1
如何在其文件名或路徑中有空格的文件中設置斷點?gdb:如何在帶空格的文件中設置斷點
這似乎是不可能與GDB或我錯過了什麼?
/tmp$ g++ -g debugee\ space.cpp /tmp$ gdb ./a.out GNU gdb (GDB) 7.4 Copyright (C) 2012 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-unknown-linux-gnu". For bug reporting instructions, please see: ... Reading symbols from /tmp/a.out...done. (gdb) break "/tmp/debugee space.cpp:4" Breakpoint 1 at 0x4007e3: file debugee space.cpp, line 4. (gdb) break "/tmp/debugee space.cpp":4 Note: breakpoint 1 also set at pc 0x4007e3. Breakpoint 2 at 0x4007e3: file debugee space.cpp, line 4. (gdb) run Starting program: /tmp/a.out Error in re-setting breakpoint 1: Function "/tmp/debugee space.cpp:4" not defined. Error in re-setting breakpoint 2: Function "/tmp/debugee space.cpp:4" not defined. Hello, world! [Inferior 1 (process 14188) exited normally] (gdb)
你使用的是哪個版本的gdb?我在使用gcc編譯時遇到了與您的應用程序相同的錯誤。我有GDB 7.4 – milianw 2012-02-29 22:03:19
同樣的問題對我來說:錯誤重新設置斷點1:功能「/ tmp /空間test.c:5」未定義。 (gdb 7.4) – 2012-03-01 19:14:53
at work我有'GNU gdb(GDB)7.0.1-debian' – 2012-03-02 12:12:15