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?


Hello,

You may also want to take a look at automatic display, which can also and save you lots of keystrokes.

See http://sources.redhat.com/gdb/current/onlinedocs/gdb_9.html#SEC62 for more details,

Cheers,

Vincent

Bob Rossi wrote:
On Thu, Sep 15, 2005 at 08:22:44PM +0800, 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!


Yes, try something like this,

define macro1
   b main
   r
   next
   next
   next
end

Put that in your .gdbinit file and then start up GDB and type 'macro1'
to get it to execute the commands.

Bob Rossi

-- Using Firefox and Thunderbird at Wind River: http://twiki.wrs.com/do/view/ENGtools/MozillaAtWindriver


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