debugging a callq command
"Mahmood Naderan via gdb" <[email protected]>
| Newsgroups | gmane.comp.gdb.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi, Trying to debug an assembly code with gdb, I see that a call function to a valid address exists but the control won't go to the target address. As you can see, the first instruction is a jmp to 0x7fffffffde7d and there, it will call 0x7fffffffde70. However, the next instruction is something else while the program receives seg fault. (gdb) nexti 0x00007fffffffde6e in ?? () 1: x/20i $pc => 0x7fffffffde6e: jmp 0x7fffffffde7d 0x7fffffffde70: pop %rsi 0x7fffffffde71: xor %ecx,%ecx 0x7fffffffde73: mov $0x21,%cl 0x7fffffffde75: xorb $0x35,(%rsi) 0x7fffffffde78: rex.RX loop 0x7fffffffde75 0x7fffffffde7b: jmp 0x7fffffffde82 0x7fffffffde7d: callq 0x7fffffffde70 0x7fffffffde82: pop %rdi 0x7fffffffde83: jae 0x7fffffffdef2 (gdb) nexti 0x00007fffffffde6e in ?? () 1: x/20i $pc => 0x7fffffffde6e: jmp 0x7fffffffde7d 0x7fffffffde70: pop %rsi 0x7fffffffde71: xor %ecx,%ecx 0x7fffffffde73: mov $0x21,%cl 0x7fffffffde75: xorb $0x35,(%rsi) 0x7fffffffde78: rex.RX loop 0x7fffffffde75 0x7fffffffde7b: jmp 0x7fffffffde82 0x7fffffffde7d: callq 0x7fffffffde70 0x7fffffffde82: pop %rdi 0x7fffffffde83: jae 0x7fffffffdef2 (gdb) nexti Program received signal SIGSEGV, Segmentation fault. 0x00007fffffffde8c in ?? () 1: x/20i $pc => 0x7fffffffde8c: out %eax,$0x5f 0x7fffffffde8e: ds insl (%dx),%es:(%rdi) 0x7fffffffde90: addr32 pop %rbp 0x7fffffffde92: sbb 0x46(%rdi),%cl 0x7fffffffde95: pop %rbp 0x7fffffffde96: pop %rbp 0x7fffffffde97: sbb 0x5c(%rdi),%dl What is happening there? Any idea? Regards, Mahmood