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

Viewed 9158

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)

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)
Related