From 5ea25f0b0ae711bd30c6d8b21db33a633ec3e4b9 Mon Sep 17 00:00:00 2001 From: Paul Floyd Date: Sat, 6 May 2023 13:30:44 +0200 Subject: [PATCH] FreeBSD regtest: add small hack to mcclean_after_fork gdb script As far as I can tell this was a regression in FreeBSD gdb around Aug 2022 when the default install upgraded from 11.2 to 12.1 --- gdbserver_tests/mcclean_after_fork.stdinB.gdb | 3 +++ gdbserver_tests/mcclean_after_fork.stdoutB.exp | 1 + 2 files changed, 4 insertions(+) diff --git a/gdbserver_tests/mcclean_after_fork.stdinB.gdb b/gdbserver_tests/mcclean_after_fork.stdinB.gdb index bd2a5685f2..bbe795f95e 100644 --- a/gdbserver_tests/mcclean_after_fork.stdinB.gdb +++ b/gdbserver_tests/mcclean_after_fork.stdinB.gdb @@ -15,6 +15,9 @@ continue # put a read watchpoint on mem # we expect that the read watchpoint is not triggered in the child # (as we expect it will be cleared at fork). +# On FreeBSD directly calling rwatch mem causes an error +# calling print first fixes that as a workaround +p mem rwatch mem # continue diff --git a/gdbserver_tests/mcclean_after_fork.stdoutB.exp b/gdbserver_tests/mcclean_after_fork.stdoutB.exp index 590e4c93b9..c7bdba12d2 100644 --- a/gdbserver_tests/mcclean_after_fork.stdoutB.exp +++ b/gdbserver_tests/mcclean_after_fork.stdoutB.exp @@ -4,6 +4,7 @@ Breakpoint 3 at 0x........: file clean_after_fork.c, line 22. Continuing. Breakpoint 1, main () at clean_after_fork.c:9 9 pid = fork(); +$1 = 0 Hardware read watchpoint 4: mem Continuing. Hardware read watchpoint 4: mem -- 2.47.2