Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

setting a breakpoint in a specific offset inside a function with 'gdb'

Tags:

debugging

gdb

I am trying to set a breakpoint to with 'gdb'.

From here I understood how to break specific line of function.
But I want to break specific offset of function.

0xb7eecfa8 <error+184>    mov    eax, dword ptr [ebx - 0x40]
0xb7eecfae <error+190>    sub    esp, 4
0xb7eecfb1 <error+193>    push   dword ptr [eax]

gdb> break error+184
Function "error+184" not defined.

Is there any command to break on 0xb7eecfa8 <error+184>?
(except for just typing b *0xb7eecfa8)

like image 226
Jiwon Avatar asked Feb 03 '23 22:02

Jiwon


1 Answers

Is there any command to break on <error+184>

Both of these appear to do what you want:

b *(&error+184)
b *(error+184)
like image 112
Employed Russian Avatar answered May 22 '23 00:05

Employed Russian