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: break of close loop


Daniel Jacobowitz wrote:
> On Fri, Nov 04, 2005 at 10:14:31AM +0100, Efim Monjak wrote:
>> Hi,
>> 
>> as I see the step for debugger is not the same as stepi.
>> After step command debugger try to go to the next source line.
>> I think it checks for number of source line.
>> I mean many single steps can be done before an another source
>> line is recognised. Recognising of an other source line is need
>> to complete the step command.
>> After single step command only one single step is done. I don't know
>> if for an other address is checked or single step responce is enougth
>> to complete the single step.
> 
> Then your stub is simply wrong.  GDB expects a single step instruction
> to execute a single instruction, not until the address changes.


  The stub is probably implemented by placing a temp breakpoint immediately
after the instruction to be tested, but has negelected the fact that to handle
jumps you may need to place the temp breakpoint somewhere _other_ than
immediately after the instruction, and that with conditional branches you need
to place _two_ temp breakpoints, one at the branch target and one immediately
after the branch to catch the fallthrough if the branch is not taken.

  Which is why it's often easier for a stub to just emulate jump/branch insns.



    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....


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