This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: display in ~/.gdbinit does not work
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Ente <ducksource at duckpond dot ch>
- Cc: gdb-patches at sourceware dot org, Joel Brobecker <brobecker at adacore dot com>
- Date: Mon, 28 May 2012 23:57:16 +0200
- Subject: Re: display in ~/.gdbinit does not work
- References: <4FBDF2D0.3050108@duckpond.ch> <4FBDF3C0.8090908@duckpond.ch> <20120528160901.GJ5492@adacore.com>
On Mon, 28 May 2012 18:09:01 +0200, Joel Brobecker wrote:
> You might be able to achieve what you want using command hooks,
> although it might not always work - I don't know how the hooks
> are implemented in practice. But take a look at:
>
> http://www.sourceware.org/gdb/current/onlinedocs/gdb/Startup.html#Startup
It probably has some bugs but basically it works for me:
set $dpc=1
define hookpost-file
display/i $pc
set $dpc=0
end
define hook-stop
if $dpc
display/i $pc
set $dpc=0
end
end
Regards,
Jan