From d42db22aa54876e12f93d85f33a9dcc00d31c5b4 Mon Sep 17 00:00:00 2001 From: "Michael J. Eager" Date: Mon, 21 Apr 2025 17:44:08 -0700 Subject: [PATCH] MicroBlaze: Make sure we see memory breakpoints before reading For linux target, when trying to run a program from gdb, the following defect is seen: Program received signal SIGILL, Illegal instruction. 0x48004674 in _dl_debug_state () from target:/lib/ld.so.1 * microblaze-linux-tdep.c (microblaze_linux_memory_remove_breakpoint): Call make_scoped_restore_show_memory_breakpoints Signed-off-by: Gopi Kumar Bulusu Signed-off-by: Michael J. Eager --- gdb/microblaze-linux-tdep.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gdb/microblaze-linux-tdep.c b/gdb/microblaze-linux-tdep.c index 0f2f2726b94..8dcbeaafb83 100644 --- a/gdb/microblaze-linux-tdep.c +++ b/gdb/microblaze-linux-tdep.c @@ -49,6 +49,9 @@ microblaze_linux_memory_remove_breakpoint (struct gdbarch *gdbarch, /* Determine appropriate breakpoint contents and size for this address. */ bp = gdbarch_breakpoint_from_pc (gdbarch, &addr, &bplen); + /* Make sure we see the memory breakpoints. */ + scoped_restore restore_memory + = make_scoped_restore_show_memory_breakpoints (1); val = target_read_memory (addr, old_contents, bplen); /* If our breakpoint is no longer at the address, this means that the -- 2.39.5