3

Consider a case where a function has 10 lines of code and you are doing a step debugging via GDB and are on line six. You realize that function call at line 4 did some goof up due to which you are at line 5.

Assuming that line 4 function call does not do anything drastic (mem free, etc) you wish to make your SP point @ line 4 and step into that func without re-running that test case.

I have been able to do it by doing registry modification.

What I wanted to know, are there some gdb commands which can help me achieve the above without manual registry mod.

Thanks,

3 Answers 3

3

Use jump command as described here.

Sign up to request clarification or add additional context in comments.

Comments

0

Just set a breakpoint on the line you need (using the break command) and jump to it (using the jump command).

Comments

0

If I understand correctly, you want to "step back". This is supported by GDB since version 7. See manual, tutorial or related Stackoverflow topic.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.