2
는 그래서 GDB의 스크립트 명령이 있습니다gdb에서 변수 값만 인쇄하는 방법은 무엇입니까?
$ cat gdb_commands.txt
set pagination off
set logging file output.txt
set logging on
file stuff
b *0x80000014
run
echo ***DIFF THIS***\n
echo eax:
print $eax
echo ebx:
print $ebx
echo ecx:
print $ecx
echo edx:
print $edx
echo ***DIFF THIS END***\n
quit
나는이 얻을 내가 그것을 실행하는 경우 :
$ gdb -q -x gdb_commands.txt
Breakpoint 1 at 0x80000014
Breakpoint 1, 0x80000014 in _start()
***DIFF THIS***
eax:$1 = 1
ebx:$2 = 2
ecx:$3 = 3
edx:$4 = 4
***DIFF THIS END***
A debugging session is active.
Inferior 1 [process 8947] will be killed.
Quit anyway? (y or n) [answered Y; input not from terminal]
그래서이 못생긴 달러 기호 일을. 내가 할 수있는 sed
하지만, 나는 그것을 할 gdb를하고 싶습니다. 가능한가?
(그 이유는 우리가 에뮬레이터를 작성하고 올바르게 작동하는지 테스트 할 때문에이 같은 사용 GDB입니다.)
는