aboutsummaryrefslogtreecommitdiff
path: root/gdb/breakpoint.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2015-01-12 19:30:08 +0000
committerPedro Alves <palves@redhat.com>2015-01-14 12:34:12 +0000
commit5589af0e6661abe07e9a997f6324988b4b87c72f (patch)
tree0965e3dcece559312880a71038df982d8d9b06ef /gdb/breakpoint.c
parent6c400b59d574782afdb26eb6c021f28c31bb9f1c (diff)
downloadgdb-5589af0e6661abe07e9a997f6324988b4b87c72f.zip
gdb-5589af0e6661abe07e9a997f6324988b4b87c72f.tar.gz
gdb-5589af0e6661abe07e9a997f6324988b4b87c72f.tar.bz2
PR17525 - breakpoint commands not executed when program run from -x script
Executing a gdb script that runs the inferior (from the command line with -x), and has it hit breakpoints with breakpoint commands that themselves run the target, is currently broken on async targets (Linux, remote). While we're executing a command list or a script, we force the interpreter to be sync, which results in some functions nesting an event loop and waiting for the target to stop, instead of returning immediately and having the top level event loop handle the stop. The issue with this bug is simply that bpstat_do_actions misses checking whether the interpreter is sync. When we get here, in the case of executing a script (or, when the interpreter is sync), the program has already advanced to the next breakpoint, through maybe_wait_sync_command_done. We need to process its breakpoints immediately, just like with a sync target. Tested on x86_64 Fedora 20. gdb/ 2015-01-14 Pedro Alves <palves@redhat.com> PR gdb/17525 * breakpoint.c: Include "interps.h". (bpstat_do_actions_1): Also check whether the interpreter is async. gdb/testsuite/ 2015-01-14 Pedro Alves <palves@redhat.com> Joel Brobecker <brobecker@adacore.com> PR gdb/17525 * gdb.base/bp-cmds-execution-x-script.c: New file. * gdb.base/bp-cmds-execution-x-script.exp: New file. * gdb.base/bp-cmds-execution-x-script.gdb: New file.
Diffstat (limited to 'gdb/breakpoint.c')
-rw-r--r--gdb/breakpoint.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index c64c2a9..af0c2cf 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -66,7 +66,7 @@
#include "skip.h"
#include "ax-gdb.h"
#include "dummy-frame.h"
-
+#include "interps.h"
#include "format.h"
/* readline include files */
@@ -4635,7 +4635,7 @@ bpstat_do_actions_1 (bpstat *bsp)
if (breakpoint_proceeded)
{
- if (target_can_async_p ())
+ if (interpreter_async && target_can_async_p ())
/* If we are in async mode, then the target might be still
running, not stopped at any breakpoint, so nothing for
us to do here -- just return to the event loop. */