aboutsummaryrefslogtreecommitdiff
path: root/gdb/ChangeLog
diff options
context:
space:
mode:
authorPedro Alves <pedro@palves.net>2020-12-13 01:35:05 +0000
committerPedro Alves <pedro@palves.net>2021-02-03 01:15:12 +0000
commite87f0fe82375ffe508da44172fcfe04e258ddc9c (patch)
tree68ef50776ce802fc617c839d03b33ddab7d89bb8 /gdb/ChangeLog
parent8ff531399b7e5e391a664d089520e6d17d006ea4 (diff)
downloadgdb-e87f0fe82375ffe508da44172fcfe04e258ddc9c.zip
gdb-e87f0fe82375ffe508da44172fcfe04e258ddc9c.tar.gz
gdb-e87f0fe82375ffe508da44172fcfe04e258ddc9c.tar.bz2
detach and breakpoint removal
A following patch will add a testcase that has a number of threads constantly stepping over a breakpoint, and then has GDB detach the process. That testcase sometimes fails with the inferior crashing with SIGTRAP after the detach because of the bug fixed by this patch, when tested with the native target. The problem is that target_detach removes breakpoints from the target immediately, and that does not work with the native GNU/Linux target (and probably no other native target) currently. The test wouldn't fail with this issue when testing against gdbserver, because gdbserver does allow accessing memory while the current thread is running, by transparently pausing all threads temporarily, without GDB noticing. Implementing that in gdbserver was a lot of work, so I'm not looking forward right now to do the same in the native target. Instead, I came up with a simpler solution -- push the breakpoints removal down to the targets. The Linux target conveniently already pauses all threads before detaching them, since PTRACE_DETACH only works with stopped threads, so we move removing breakpoints to after that. Only the remote and GNU/Linux targets support support async execution, so no other target should really need this. gdb/ChangeLog: * linux-nat.c (linux_nat_target::detach): Remove breakpoints here... * remote.c (remote_target::remote_detach_1): ... and here ... * target.c (target_detach): ... instead of here. * target.h (target_ops::detach): Add comment.
Diffstat (limited to 'gdb/ChangeLog')
-rw-r--r--gdb/ChangeLog8
1 files changed, 8 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 62aab57..4113e3a 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,13 @@
2021-02-03 Pedro Alves <pedro@palves.net>
+ * linux-nat.c (linux_nat_target::detach): Remove breakpoints
+ here...
+ * remote.c (remote_target::remote_detach_1): ... and here ...
+ * target.c (target_detach): ... instead of here.
+ * target.h (target_ops::detach): Add comment.
+
+2021-02-03 Pedro Alves <pedro@palves.net>
+
* infrun.c (struct wait_one_event): Move higher up.
(prepare_for_detach): Abort in-progress displaced steps instead of
letting them complete.