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: Instrcutions that must not be stepped.


Daniel Jacobowitz writes:

> Nope.  You'd have to add one.  And, you'd have to be able to tell
> whether you were in the middle of a GDB-automated step or a user stepi;
> stepping multiple instructions when the user asked for one is probably
> just confusing.

To whom or what?  I would be quite happy if gdb did the right thing
and output a message to the effect that an atomic sequence was indeed
treated as atomic.  That is the count of instructions stepped changed
by one for any number of failed attempts and then one final successful
execution of the entire atomic sequence.

> Reading the instruction before stepping is going to slow down single
> stepping.  Is there some other way we can handle this?

The overhead could be ameliorated by having the status returned from
a completed single step include an optional assertion that if gdb were
to step again without altering the pc or the contents of memory at the
address referenced by the pc then that step would initiate an atomic
sequence.

With this mechanism the first attempt to single step after a period of
non-single stepped execution would need to check the first instruction;
after that the process would be self sustaining without any addition
gdb initiated instruction inspection.

Admitted this mechanism does not absolve the greater gestalt of gdb +
stub + single step break handle from needing to retrieve and inspect
instructions.  But it may push it to a point where the overhead becomes
acceptable.

/john


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