行番号が出ない件
推測:gdb に読ませた実行ファイルに行番号情報が付属していないのだろうか?
検証
objdump -Sl すると
% /usr/bin/i586-mingw32msvc-objdump -lS test/monapi/mutex/TMUTEX.EXE | head -n 30 ... asm("int $3;"); a0001fd6: cc int3 /home/taro/mona/test/monapi/mutex/mutex.cpp:194 testSyscallMutex(); a0001fd7: e8 14 f9 ff ff call a00018f0 <__Z16testSyscallMutexv> /home/taro/mona/test/monapi/mutex/mutex.cpp:195
行番号が含まれている。
推測: gdb のターゲットが間違っている?
現在の環境は Host が amd64 ELF 。Target は i586 mingw PE 。
Target 用の gdb をビルドしなければいけないのかもしれない。 target を指定してみた。
% ./configure --prefix=~/tmp/ --target=i586-mingw32msvc
gdb を起動すると。
(gdb) target remote localhost:43770 Remote debugging using localhost:43770 warning: unrecognized item "T0b4:98cf1000" in "qSupported" response warning: unrecognized item "5:b4cf1000" in "qSupported" response warning: unrecognized item "8:40012100" in "qSupported" response 0x00210140 in ?? () (gdb) bt #0 0x00210140 in ?? () #1 0xa00050e4 in _imp__logprintf () #2 0x00000004 in ?? () #3 0xa0002260 in user_start_c_impl () #4 0x00000000 in ?? ()
何かそれっぽいが行番号は出ていない。
うーん違ったか。それにしても行番号あるんだけどなあ。
int result = user_start_c_impl(main); a000103e: c7 04 24 c0 1f 00 a0 movl $0xa0001fc0,(%esp) a0001045: e8 0e 12 00 00 call a0002258 <_user_start_c_impl> /home/taro/mona/core/monapi/monapi_crt.cpp:27
list コマンドもそれっぽい
(gdb) list 182 183 // wait forever 184 for (;;) { 185 if (Message::receive(&msg) != 0) { 186 continue; 187 } 188 } 189 } 190 191 int main(int argc, char *argv[]) (gdb) bt #0 0x00210140 in ?? () #1 0xa00050e4 in _imp__logprintf () #2 0x00000004 in ?? () #3 0xa0002260 in user_start_c_impl ()
ちょっと保留にしよう。(他の ToDo で直るかもしれない)