2012-02-29 3 views
1

파일 이름이나 경로에 공백이있는 파일에 어떻게 중단 점을 설정합니까?gdb : 공백이있는 파일에 중단 점을 설정하는 방법

GDB에서 가능하지 않거나 뭔가 누락 된 것 같습니다. 하지만 C++로하지 않았다 나 (TM)에 대한

 
/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) 

답변

0

작품 ...

cat space\ spaces.c 
#include <stdio.h> 

int tmp(void) { 
    int a = 42; 
    printf("%d", a); 
} 

int main(void) { 
    tmp(); 

    return 0; 
} 

$ gdb -q a.out 
Reading symbols from /home/user/slask/gdb/a.out...done. 
(gdb) b "space spaces.c":5 
Breakpoint 1 at 0x4004f3: file space spaces.c, line 5. 
(gdb) i b 
Num  Type   Disp Enb Address   What 
1  breakpoint  keep y 0x00000000004004f3 in tmp at space spaces.c:5 
(gdb) run 
Starting program: /home/user/slask/gdb/a.out 

Breakpoint 1, tmp() at space spaces.c:5 
5  printf("%d", a); 
(gdb) 
+0

gdb의 버전은 무엇입니까? gcc로 컴파일 할 때와 앱에서 동일한 오류가 발생합니다. 내가 가지고 gdb 7.4 – milianw

+0

나를 위해 동일한 문제 : 중단 점 1을 다시 설정하는 중 오류 : "/ tmp/space test.c : 5"기능이 정의되지 않았습니다. (gdb 7.4) –

+0

나는'GNU gdb (GDB) 7.0.1-debian'을 가지고있다. –

관련 문제