It would be nice if we can have the equivalent of windbg's pc and tc command in gdb, well, here is how:
def pc
set $continue_flag = 1
ni
while($continue_flag)
set $opcode = *(unsigned char *)$pc
x/i $pc
if ((unsigned int)$opcode == 0xe8)
set $continue_flag = 0
else
ni
end
end
end
def tc
si
set $continue_flag = 1
while($continue_flag)
set $opcode = *(unsigned char *)$pc
x/i $pc
if ((unsigned int)$opcode == 0xe8)
set $continue_flag = 0
else
si
end
end
end
Wednesday, April 23, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment