동료의 컴퓨터에 코어 덤프 파일이 있습니다.실행 파일은 다르지만 소스가 동일한 코어 덤프 파일 열기
우리는 모두 프로그램과 동일한 타사 *.so
파일 (예 : libmysqlclient18
및 여러 사내 파일)을 가지고 있습니다.
문제는 우리가 (동일한 소스에서) 소프트웨어를 독립적으로 컴파일하고 있으며 내 컴퓨터에서 GDB를 검사하기 위해 코어 덤프 파일을 사용하려고합니다.
내가 GDB에 코어 파일 내 실행 파일을로드하려고 내가 얻을 :
[email protected]:/mnt/hgfs/share/dir$ gdb prog core
GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2.1) 7.4-2012.04
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
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 "i686-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.launchpad.net/gdb-linaro/>...
Reading symbols from /mnt/hgfs/share/dir/prog...done.
warning: exec file is newer than core file.
[New LWP 4465]
[New LWP 4462]
[New LWP 4464]
warning: Can't read pathname for load map: Input/output error.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".
Core was generated by `./prog'.
Program terminated with signal 11, Segmentation fault.
#0 0x002d3706 in ??() from /lib/i386-linux-gnu/libc.so.6
(gdb) bt full
#0 0x002d3706 in ??() from /lib/i386-linux-gnu/libc.so.6
No symbol table info available.
#1 0x00000000 in ??()
No symbol table info available.
(gdb)
이 시나리오가 작동하려면이 수 있습니까? (나는 디버깅 심볼을 사용하여 소프트웨어를 컴파일한다.) 그렇지 않다면 내가 놓친 기술 내용은 무엇인가?
나는 그가 소스 코드를 수정할 수 있다는 것을 알고있다. 실행 파일은 달라 지겠지만, 그렇지 않다. 제 3자인 *.so
파일과 소스, 그들은 모두 일치합니다.
UPDATE :이 코멘트에 제안 사용자로 mkfs 명령을 libc6-dbg
를 설치 한 후, 내가 GDB이 얻을 :
[email protected]:/mnt/hgfs/share/dir$ gdb prog core
GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2.1) 7.4-2012.04
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
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 "i686-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.launchpad.net/gdb-linaro/>...
Reading symbols from /mnt/hgfs/share/dir/prog...done.
warning: exec file is newer than core file.
[New LWP 4465]
[New LWP 4462]
[New LWP 4464]
warning: Can't read pathname for load map: Input/output error.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".
Core was generated by `./prog'.
Program terminated with signal 11, Segmentation fault.
#0 0x002d3706 in _IO_helper_overflow (s=0x0, c=0) at vfprintf.c:2188
2188 vfprintf.c: No such file or directory.
(gdb) bt
#0 0x002d3706 in _IO_helper_overflow (s=0x0, c=0) at vfprintf.c:2188
#1 0x00000000 in ??()
(gdb) bt full
#0 0x002d3706 in _IO_helper_overflow (s=0x0, c=0) at vfprintf.c:2188
written = 47
target = <optimized out>
used = -1226838776
#1 0x00000000 in ??()
No symbol table info available.
(gdb)
libc (예 : libc6-dbg 패키지)의 디버그 기호를 설치 했습니까? 또한, 찾고 있기 때문에.실행 파일의 경우 동료의 실행 파일과 코어 덤프를 temp 디렉토리에 넣고 거기에서 gdb를 실행할 수 있습니다. – mkfs
컴파일러 플래그를 포함하여 빌드가 정확히 동일하면이 방법이 유용합니다. 빌드 env에 차이가 있다면 실행 파일을 공유하는 것이 훨씬 쉽습니다. –
@MatthewFisher 플래그가 같고 동일한 Makefile을 사용합니다. – Paul