This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]