gdb 서버 질문입니다.
글쓴이: lovejin0309 / 작성시간: 월, 2005/01/10 - 11:24오전
arm 에서 어플을 개발하고 있습니다.
디버깅을 하기 위해 gdb server를 arm용으로 컴파일하고 타겟 보드에 올린후 다음과 같이 실행시켰습니다.
./gdbserver 192.168.1.150:9012 debug Process ./debug created; pid = 94
호스트에서 다음과 같이 접속했습니다.
lovejin:~# gdb GNU gdb 6.1-debian Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-linux". (gdb) target remote 192.168.1.150:9012 Remote debugging using 192.168.1.150:9012 0x00000000 in ?? ()
이렇게 하면 타켓쪽에서는 다음과 같은 메세지가 뜹니다.
Remote debugging from host 192.168.1.19 (gdb) run The program being debugged has been started already. Start it from the beginning? (y or n) n Program not restarted. (gdb) run The program being debugged has been started already. Start it from the beginning? (y or n) n Program not restarted. (gdb) list No symbol table is loaded. Use the "file" command. (gdb) file A program is being debugged already. Kill it? (y or n) y No executable file now. Using host libthread_db library "/lib/tls/libthread_db.so.1". No symbol file now.
해결 방안이 무엇일까요?
Forums:
gdbserver를 실행시킬때 실행파일을 명시하거나 프로세스에 attac
gdbserver를 실행시킬때 실행파일을 명시하거나 프로세스에 attach해야 하지 않나요?
그리고 host쪽에서 symbol을 읽어들이는건 target 하기 전에 하셔야 할 것 같고요.
즉 hello를 디버그 하실 생각이시면
gdbserver x.x.x.x.:nnnn hello
하시고
gdb
file hello
target remote ~~
run
오늘 우리는 동지를 땅에 묻었습니다. 그러나 땅은 이제 우리들의 것입니다.
아직도 우리의 적은 강합니다. 그러나 우리는 그들보다 많습니다.
항상 많을 것입니다.
[code:1]gdbfile debugtarget remote
을 하면,
cannot execute binary file이라고 나오는 군요.
debug란 파일을
arm-linux-gcc로 컴파일 했고, 타겟보드로 복사했습니다.
file debug라고 하면, 현재 호스트에 있는 파일이 로드 되는게 아닌가요? (어차피 그 파일도 arm용입니다.)
arm용 파일이 로드 된 상태에서 run을 하기 때문에 실행이 안되는 것인가 하는 의문이 듭니다.
[quote="lovejin0309"][code:1]gdbfile
host에 있는 gdb의 target이 i386이 아닌가 싶은데요.
확인하는 방법이 잘 기억나지 않는군요. gdb -v 였나?
gdbserver하고 같이 배포된 host i386의 gdb가 있는지 확인해 보십시요.
제 경우에는 거의 제가 빌드를 해서 썼습니다. configure에 target option만 주면 큰 어려움 없이 빌드가 되는 경우가 대부분이므로 이렇게 하시는게 차라리 속 편하실 겁니다.
댓글 달기