How to execute more than one command in the GDB terminal

So, are you trying to execute more than one command in the same line of GDB?

Unfortunately it will NOT work this way:

(gdb) mon si ; mon regs

GDB doesn't recognize the above command as two commands.

Fortunately you can execute these two commands creating a definition (like a MACRO) this way:

(gdb) define sishow
> mon si
> mon regs
> end

I'm creating the "sishow" command, then when I type it in the terminal it will execute "mon si" and then "mon regs". These commands will do the step instruction and show the registers to me.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s