GDB set breakpoint in function offset

Issue

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

Solution

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

QED.

Answered By – Employed Russian

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published