Bug 813068

Summary: gdb finish inside commands list quit program
Product: [Fedora] Fedora Reporter: Jérôme Glisse <jglisse>
Component: gdbAssignee: Jan Kratochvil <jan.kratochvil>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 17CC: jan.kratochvil, pmuldoon, sergiodj, tromey
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-04-16 19:58:45 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Jérôme Glisse 2012-04-16 19:49:20 UTC
If executing the following gdb script, gdb quit the program on the finish command while i expect it should finish the current function

file ls
set $myvar = 1
break indent
set $myvar = 0
finish
set $myvar = 1
continue
end
r

Version-Release number of selected component (if applicable):
Tested on f16 & f17

Comment 1 Jan Kratochvil 2012-04-16 19:58:45 UTC
Assuming you should have put "commands" after "break".

Finish does not work in command lists, it should work as:

file ls
set $myvar = 1
break indent
commands
  set $myvar = 0
  up
  tbreak
  commands
    set $myvar = 1
    continue
  end
  continue
end
r

Untested, maybe also some "silent" should be there as it will be talkative this way.

The problem is GDB commands get executed on a single stop, "finish" resumes execution, execution resume can be always only the last command of a sequence.