This is the mail archive of the gdb@sources.redhat.com 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: [rfc] ``pc'' -> resume_addr?


Kevin Buettner wrote:
> 
> On Apr 11,  6:16pm, Andrew Cagney wrote:
> 
> > >> I think this name choice was unfortunate.  It is too easy for a
> > >> developer to confuse ``pc'' with the hardware ``pc''.
> > >
> > > Could you please explain further why you think the name choice was
> > > unfortunate?
> >
> > I think the name ``pc'' brings with it a certain amount of baggage.
> > When reading a piece of code, it isn't clear if the hardware ``pc''
> > (possibly needing adjustment) or the program's resume address is being used.
> 
> Is there really that much confusion about this though?  I think that
> the length of time during which this confusion exists is mercifully
> brief.  AFAICT, gdb's notion of the pc is adjusted shortly after
> stopping via a call to bpstat_stop_status() and from then on, the pc
> value is simply the continuation (or resume) address.  Even the "PC"
> value in the register cache has been adjusted to be the program's
> resume address at this point.

And since the register cache is write-thru, so has the child's PC
register.


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