Kokomelom
Kokomelom

Reputation: 353

GDB set breakpoint in function offset

I can set breakpoint like

b some_function

But hiw can I put a breakpoint in offset 0x10 of this function

b some_function +0x10  

Or b (some_function +0x10)

Doesn't work

Upvotes: 0

Views: 590

Answers (1)

Employed Russian
Employed Russian

Reputation: 213526

(gdb) p &foo
$1 = (<text variable, no debug info> *) 0x555555555129 <foo>
(gdb) b *foo+0x10
Breakpoint 2 at 0x555555555139

QED.

Upvotes: 1

Related Questions