gdb/testsuite: Fix supplying a function name to gdb_continue_to_breakpoint

Message ID 20260827203857.206218-1-guinevere@redhat.com
State New
Headers
Series gdb/testsuite: Fix supplying a function name to gdb_continue_to_breakpoint |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_gdb_check--master-arm success Test passed
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 success Test passed

Commit Message

Guinevere Larsen Aug. 27, 2026, 8:38 p.m. UTC
  The previous regex pattern in gdb_continue_to_breakpoint expects a
message in one of the following forms:
    Breakpoint N, <hex address> in <function>
    Breakpoint N, <function> at <linespec>

And so, checks for either the "in" or the "at" keywords before the
user-supplied pattern.  However, this means that if GDB doesn't stop
somewhere that requires printing the address, the test can't supply
the function name when checking for the breakpoint.

This commit adds the possibility of looking just for the comma before
the user-supplied pattern, allowing the second form of the stop
message to also accept a function name.

with '#' will be ignored, and an empty message aborts the commit.  # #
On branch gwen-test_breakpoint_threads # Changes to be committed: #
modified: gdb/testsuite/lib/gdb.exp #
---
 gdb/testsuite/lib/gdb.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


base-commit: 6e3ecea0e3ca191e81e82ee0194c49eea1ffb101
  

Comments

Kevin Buettner Aug. 28, 2026, 3:28 a.m. UTC | #1
On Thu, 27 Aug 2026 17:38:57 -0300
Guinevere Larsen <guinevere@redhat.com> wrote:

> The previous regex pattern in gdb_continue_to_breakpoint expects a
> message in one of the following forms:
>     Breakpoint N, <hex address> in <function>
>     Breakpoint N, <function> at <linespec>
> 
> And so, checks for either the "in" or the "at" keywords before the
> user-supplied pattern.  However, this means that if GDB doesn't stop
> somewhere that requires printing the address, the test can't supply
> the function name when checking for the breakpoint.
> 
> This commit adds the possibility of looking just for the comma before
> the user-supplied pattern, allowing the second form of the stop
> message to also accept a function name.

Makes sense to me.

Approved-By: Kevin Buettner <kevinb@redhat.com>
  
Guinevere Larsen Aug. 31, 2026, 11:29 a.m. UTC | #2
Thanks for the quick review, I've pushed this!

On 8/28/26 12:28 AM, Kevin Buettner wrote:
> On Thu, 27 Aug 2026 17:38:57 -0300
> Guinevere Larsen <guinevere@redhat.com> wrote:
>
>> The previous regex pattern in gdb_continue_to_breakpoint expects a
>> message in one of the following forms:
>>      Breakpoint N, <hex address> in <function>
>>      Breakpoint N, <function> at <linespec>
>>
>> And so, checks for either the "in" or the "at" keywords before the
>> user-supplied pattern.  However, this means that if GDB doesn't stop
>> somewhere that requires printing the address, the test can't supply
>> the function name when checking for the breakpoint.
>>
>> This commit adds the possibility of looking just for the comma before
>> the user-supplied pattern, allowing the second form of the stop
>> message to also accept a function name.
> Makes sense to me.
>
> Approved-By: Kevin Buettner <kevinb@redhat.com>
>
  

Patch

diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 1a6438f36a5..1eb643cdf1a 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -954,7 +954,7 @@  proc gdb_continue_to_breakpoint {name {location_pattern .*}} {
 
     set kfail_pattern "Process record does not support instruction 0xfae64 at.*"
     return [gdb_test_multiple "continue" $full_name {
-	-re "(?:Breakpoint|Temporary breakpoint) .* (at|in) $location_pattern\r\n$gdb_prompt $" {
+	-re "(?:Breakpoint|Temporary breakpoint) .*( at| in|,) $location_pattern\r\n$gdb_prompt $" {
 	    pass $full_name
 	}
 	-re "(?:$kfail_pattern)\r\n$gdb_prompt $" {