(2). ソースの表示&ブレイクポイント挿入
1. 同一ファイル内のソース表示
list(省略可で -> l ) 行番号
2. プレイクポイント挿入
break(省略可で -> b) 行番号
3. 別ディレクトリへ移動
cd ../ディレクトリA/src
4. 別ソースファイルへのプレイクポイント挿入
break(省略可で -> b) ソースファイル名.cpp:行番号
(3). 設定したブレイクポイントの確認
info break(略可で -> b)
例:
(gdb) info break
Num Type Disp Enb Address What
1 breakpoint keep y 0x0804f31f in main at xx_XMLParserTest.cpp:160
2 breakpoint keep y 0x0804f31f in main at xx_XMLParserTest.cpp:161
3 breakpoint keep y 0x0805fd50 in xx_XMLParser::readSearchQuery(xxxx_SearchConditionCollection&,
std::string const&) at xx_XMLParser.cpp:85
例:
gdb ./xx_XMLParserTestD core
(gdb) where
#0 0x402eb890 in strcpy () from /lib/tls/libc.so.6
#1 0x0804d682 in main (argc=1, argv=0xbfd657e4) at xx_XMLParserTest.cpp:487
(gdb)
一時的に切り替える。またはユーザごと、ターミナルごとに切り替えるには
環境変数 LANG を 設定する
LANG="ja_JP.EUC" これでEUCになる
◆COMポート経由でLinuxPCにログインする方法
/etc/inittab をroot権限で下記のように編集しておく。
# getty-programs for the normal runlevels # <id>:<runlevels>:<action>:<process>
# The "id" field MUST be the same as the last # characters of the device (after "tty").
1:2345:respawn:/sbin/mingetty --noclear tty1 2:2345:respawn:/sbin/mingetty tty2 3:2345:respawn:/sbin/mingetty tty3 4:2345:respawn:/sbin/mingetty tty4 5:2345:respawn:/sbin/mingetty tty5 6:2345:respawn:/sbin/mingetty tty6
さらに /etc/securetty をroot権限で下記のように編集してから、再立ち上げする。
# y521:04:19]> ll securetty
# This file contains the device names of tty lines (one per line, # without leading /dev/) on which root is allowed to login.
# for devfs:
tty1
tty2
tty3
tty4
tty5
tty6
ttyS0 ●このようにttyS0を追加する