🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gdb.bug
Article #449

Re: assembly

#449
From: Bill Sommerfeld
Date: Wed, 07 Oct 1992 17:04
32 lines
1556 bytes
In article <1992Oct6.144220.2790@unlinfo.unl.edu> romig@cse.unl.edu (Phil Romig) writes:

      I'd like a
      way to define a command that will step forward one instruction and
      disassemble the instruction at the pc.  I think I'm close with:
	     define sd
	      stepi
	      x/i <address of pc>
	     end
      the problem is how to get <address of pc> into the x/i command.  
      Anyone have any ideas?

You can get what you want much more easily by using "display/i $pc",
and then just stepping normally, setting breakpoints & continuing,
etc.

If you're working on a RISC machine on which the PC is a two-element
queue, you may also want to do something along the lines of:

display/i $npc
display/i $pc

or (on HP PA machines):

display/i $pcoqt	(that's "program counter offset queue tail")
display/i $pcoqh		and			      head")

to display the next two instructions. (you have to do the display of
$npc *before* $pc because displays show up in reverse order for some
reason).

					- Bill
Technical Details
Message-ID: <SOMMERFELD.92Oct7130514@gourmet.apollo.hp.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!convex!darwin.sura.net!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!cis.ohio-state.edu!apollo.hp.com!sommerfeld
References: sommerfeld@apollo.hp.com (Bill Sommerfeld)

Show Full Headers
Complete Article Headers
Newsgroups: gnu.gdb.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!convex!darwin.sura.net!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!cis.ohio-state.edu!apollo.hp.com!sommerfeld
From: sommerfeld@apollo.hp.com (Bill Sommerfeld)
Subject: Re: assembly
Message-ID: <SOMMERFELD.92Oct7130514@gourmet.apollo.hp.com>
Sender: gnulists@ai.mit.edu
Organization: Hewlett Packard
References: sommerfeld@apollo.hp.com (Bill Sommerfeld)
Distribution: gnu
Date: Wed, 7 Oct 1992 17:04:36 GMT
Approved: bug-gdb@prep.ai.mit.edu
Lines: 39