proc/gdbserial: inline (*gdbThread).stepInstruction (#2155)
(*gdbThread).StepInstruction is a single call to stepInstruction so inline it.
This commit is contained in:
parent
9957bee78d
commit
788c41be76
@ -661,7 +661,7 @@ func (p *gdbProcess) ContinueOnce() (proc.Thread, proc.StopReason, error) {
|
|||||||
// step threads stopped at any breakpoint over their breakpoint
|
// step threads stopped at any breakpoint over their breakpoint
|
||||||
for _, thread := range p.threads {
|
for _, thread := range p.threads {
|
||||||
if thread.CurrentBreakpoint.Breakpoint != nil {
|
if thread.CurrentBreakpoint.Breakpoint != nil {
|
||||||
if err := thread.stepInstruction(&threadUpdater{p: p}); err != nil {
|
if err := thread.StepInstruction(); err != nil {
|
||||||
return nil, proc.StopUnknown, err
|
return nil, proc.StopUnknown, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1305,7 +1305,8 @@ func (t *gdbThread) Common() *proc.CommonThread {
|
|||||||
return &t.common
|
return &t.common
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *gdbThread) stepInstruction(tu *threadUpdater) error {
|
// StepInstruction will step exactly 1 CPU instruction.
|
||||||
|
func (t *gdbThread) StepInstruction() error {
|
||||||
pc := t.regs.PC()
|
pc := t.regs.PC()
|
||||||
if _, atbp := t.p.breakpoints.M[pc]; atbp {
|
if _, atbp := t.p.breakpoints.M[pc]; atbp {
|
||||||
err := t.p.conn.clearBreakpoint(pc)
|
err := t.p.conn.clearBreakpoint(pc)
|
||||||
@ -1317,12 +1318,7 @@ func (t *gdbThread) stepInstruction(tu *threadUpdater) error {
|
|||||||
// Reset thread registers so the next call to
|
// Reset thread registers so the next call to
|
||||||
// Thread.Registers will not be cached.
|
// Thread.Registers will not be cached.
|
||||||
t.regs.regs = nil
|
t.regs.regs = nil
|
||||||
return t.p.conn.step(t.strID, tu, false)
|
return t.p.conn.step(t.strID, &threadUpdater{p: t.p}, false)
|
||||||
}
|
|
||||||
|
|
||||||
// StepInstruction will step exactly 1 CPU instruction.
|
|
||||||
func (t *gdbThread) StepInstruction() error {
|
|
||||||
return t.stepInstruction(&threadUpdater{p: t.p})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Blocked returns true if the thread is blocked in runtime or kernel code.
|
// Blocked returns true if the thread is blocked in runtime or kernel code.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user