WARNING: This server is unstable and will be retired in the next days. If you want to keep this forum available, please request immediately a migration on the Nabble Support forum. Forums that don't receive any migration request will be deleted forever.

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

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

by Matt Rice-2 :: Rate this Message:

| View in Thread

On Mon, Jun 11, 2012 at 2:36 AM, Hui Zhu <teawater@...> 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

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