[Bug testsuite/34552] New: [gdb/testsuite] Use try finally

"vries at gcc dot gnu.org via Gdb-prs" <[email protected]>
Newsgroups gmane.comp.gdb.bugs.discuss
Message-ID <[email protected]/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=34552

            Bug ID: 34552
           Summary: [gdb/testsuite] Use try finally
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: testsuite
          Assignee: unassigned at sourceware dot org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

We have this pattern in the testsuite:
...
proc with_test_prefix { prefix body } {
  global pf_prefix

  set saved $pf_prefix
  append pf_prefix " " $prefix ":"
  set code [catch {uplevel 1 $body} result]
  set pf_prefix $saved

  if {$code == 1} {
      global errorInfo errorCode
      return -code $code -errorinfo $errorInfo -errorcode $errorCode $result
  } else {
      return -code $code $result
  }
}
...

It would be nice to use try/finally for this.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.