Re: [PATCH] tests: ptrace-sync: relax breakpoint pattern matching
Jan Kiszka <[email protected]>
| Newsgroups | dev.linux.lists.xenomai |
|---|---|
| Message-ID | <[email protected]> |
On 02.03.26 15:26, Yuan Wang wrote:
> In some OS distributions, the gdb output of the break instruction
> doesn't contain the function name where the breakpoint is set. This
> is observed on Ubuntu 22.04.5. with GNU gdb
> (Ubuntu 12.1-0ubuntu1~22.04.2) 12.1., causing pattern matching
> failures and subsequent test failures.
>
> Remove the ": bp\." suffix requirement to make the pattern
> more robust across different gdb versions and configurations.
>
> The original failed log (run with -v) -
>
> "
> -> {{ "b bp" }}
> EXPECT {{ ^Breakpoint 1 at .*: bp\.}}
> <- {{ "Breakpoint 1 at 0x28b9: file ../tests/ptrace-sync.c, line 59." }}
I guess the difference comes from this toolchain compiling bp into a
single function, rather than 3 inline spots like gcc-4 of Debian is
generating.
> <- {{ "(gdb)" }}
>
> <timeout waiting for gdb>
> "
>
> Signed-off-by: Yuan Wang <[email protected]>
> Signed-off-by: Junxiao Chang <[email protected]>
> ---
> tests/ptrace-sync.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tests/ptrace-sync.c b/tests/ptrace-sync.c
> index 4c56e73..556c7a6 100644
> --- a/tests/ptrace-sync.c
> +++ b/tests/ptrace-sync.c
> @@ -147,7 +147,7 @@ static struct dialog {
> { "^Reading symbols from .*", "set prompt (gdb)\\n" },
> { ".*(gdb).*", "set env __EVL_DEBUGGEE__=1" },
> { "(gdb)", "b bp" },
> - { "^Breakpoint 1 at .*: bp\\.", "r" },
> + { "^Breakpoint 1 at .*", "r" },
> { "^Thread 1 .* hit Breakpoint 1.*, bp ().*", "c" },
> { "^Thread 3 .* hit Breakpoint 1.*, bp ().*", "c" },
> { "^Thread 2 .* hit Breakpoint 1.*, bp ().*", "c" },
Maybe you could tag the target repo in future submissions, e.g. like this:
[PATCH libevl] ...
Thanks,
Jan
--
Siemens AG, Foundational Technologies
Linux Expert Center