]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdb/testsuite: add no-delete-breakpoints option to 'runto' proc
authorAndrew Burgess <aburgess@redhat.com>
Fri, 16 Aug 2024 11:01:54 +0000 (12:01 +0100)
committerAndrew Burgess <aburgess@redhat.com>
Wed, 28 Aug 2024 09:39:21 +0000 (10:39 +0100)
commit0e6430633515f78599840ac0ab82e20f46654363
tree93abff538b714a160adbd3942207454c4209d2f2
parentbe85cdf4159c1f130778959d3ddff7c44f5eacde
gdb/testsuite: add no-delete-breakpoints option to 'runto' proc

New 'no-delete-breakpoints' option for the 'runto' proc.  This option
disables the delete_breakpoints call early on in this proc.

There are a couple of places in the testsuite where I have used:

  proc no_delete_breakpoints {} {}

  with_override delete_breakpoints no_delete_breakpoints {
    if {![runto_main]} {
      return
    }
 }

In order to avoid the deleting all breakpoints when I call
runto_main.  I was about to add yet another instance of this pattern
and I figured that it's time to do this properly.

This commit adds the new option to 'runto' which causes the
delete_breakpoints call to be skipped.

And, we now forward any arguments from 'runto_main' through to
'runto', this means I can now just do:

  if {![runto_main no-delete-breakpoints]} {
    return
  }

which I think is cleaner and easier to understand.

I've updated the two tests I found that use the old with_override
approach.

There should be no change in what is tested after this commit.

Approved-By: Tom Tromey <tom@tromey.com>
gdb/testsuite/gdb.cp/breakpoint-shlib-func.exp
gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp
gdb/testsuite/lib/gdb.exp