GDB
para executar
gdb --args python editje-bin
quando aparecer o segmentation fault, pressionar [Ctrl+x] [a]
e ira aparecer um editor de texto no ponto do exato do código fonte onde ocorreu a falha.
[Ctrl+x] [a] para fechar o editor.
[Ctrl+x] [1] ver somente o codigo C
[Ctrl+x] [2] ver o codigo C e o codigo assembly
layout next Display the next layout.
layout prev Display the previous layout.
layout src Display the source window only.
layout asm Display the assembly window only.
layout split Display the source and assembly window.
layout regs Display the register window together with the source or assembly window.
focus next | prev | src | asm | regs | split
Set the focus to the named window. This command allows to change the active window so that scrolling keys can be affected to another window.
refresh
Refresh the screen. This is similar to using C-L key.
update Update the source window and the current execution point.
winheight name +count
winheight name -count
Change the height of the window name by count lines. Positive counts increase the height, while negative counts decrease it.
Executar em ordem inversa
reverse-continue ('rc') -- Continue program being debugged but run it in reverse
reverse-finish -- Execute backward until just before the selected stack frame is called
reverse-next ('rn') -- Step program backward, proceeding through subroutine calls.
reverse-nexti ('rni') -- Step backward one instruction, but proceed through called subroutines.
reverse-step ('rs') -- Step program backward until it reaches the beginning of a previous source line
reverse-stepi -- Step backward exactly one instruction
set exec-direction (forward/reverse) -- Set direction of execution.
All subsequent execution commands (continue, step, until etc.) will run the program being debugged in the selected direction.
Lista ultimas linhas executadas
list
Referências:
http://developer.apple.com/mac/library/documentation/DeveloperTools/gdb/gdb/gdb_23.html