Jiwon
Jiwon

Reputation: 1218

setting a breakpoint in a specific offset inside a function with '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)

Upvotes: 18

Views: 17022

Answers (1)

Employed Russian
Employed Russian

Reputation: 213636

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

Both of these appear to do what you want:

b *(&error+184)
b *(error+184)

Upvotes: 24

Related Questions