This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Is there a way to define a macro?
- From: Konstantin Karganov <kostik at ispras dot ru>
- To: wmaple <wmaple at 126 dot com>
- Cc: gdb <gdb at sources dot redhat dot com>
- Date: Thu, 15 Sep 2005 16:44:07 +0400 (MSD)
- Subject: Re: Is there a way to define a macro?
On Thu, 15 Sep 2005, wmaple wrote:
> Hi.
>
> When I debug a program on disassambly level, for inspecting registers or
> memory units, I have to enter same commands again and again. For
> example, after execution of each instruction, I want to inspecting all common
> registers. So, every time, I have to enter command 'info register' several
> times. Is there a way to define a macro, by which I can enter these
> commands conveniently.
> Thanks!
You need to use command hooks (see section 20.2 of UsersGuide for
details).
I.e. putting this in your .gdbinit will print registers automatically on
each "next" command:
define hook-next
info registers
end
Best regards,
Konstantin.