[Question] does GDB have a commands to get the end address of a function?

Matt Rice ratmice@gmail.com
Mon Jun 11 19:36:00 GMT 2012


On Mon, Jun 11, 2012 at 2:36 AM, Hui Zhu <teawater@gmail.com> wrote:
> Now, I get the end address of a function with command "disassemble
> function_name".
> Does GDB have an command to output the end address of a function?

i'm not aware of anything, there is the following which could be made
into a user defined command or something.


py gdb.execute("p/x %s" %
gdb.block_for_pc(gdb.decode_line("*main")[1][0].pc).end)

seems to differ slightly from 'disassemble' I suppose by the length of
the last instruction



More information about the Gdb mailing list