public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Fix latent bug in default_prompt_gdb_start
@ 2023-01-13 20:37 Tom Tromey
0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2023-01-13 20:37 UTC (permalink / raw)
To: gdb-cvs
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=d394684d5531ea85fc347d68910bed858880f2e0
commit d394684d5531ea85fc347d68910bed858880f2e0
Author: Tom Tromey <tom@tromey.com>
Date: Wed Jan 11 16:52:38 2023 -0700
Fix latent bug in default_prompt_gdb_start
default_prompt_gdb_start mimics default_gdb_start, but does not set
the use_gdb_stub global. This caused one Python test to work only
because it used the ordinary gdb_start before later using
default_prompt_gdb_start.
This patch updates default_prompt_gdb_start to set this global as
well.
Diff:
---
gdb/testsuite/lib/prompt.exp | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/gdb/testsuite/lib/prompt.exp b/gdb/testsuite/lib/prompt.exp
index a7c34fae2ec..56cafa4dd93 100644
--- a/gdb/testsuite/lib/prompt.exp
+++ b/gdb/testsuite/lib/prompt.exp
@@ -24,6 +24,7 @@
# uses pass if it sees $gdb_prompt, and fail if it sees $gdb_prompt_fail.
#
proc default_prompt_gdb_start { } {
+ global use_gdb_stub
global GDB
global INTERNAL_GDBFLAGS GDBFLAGS
global gdb_prompt
@@ -31,7 +32,17 @@ proc default_prompt_gdb_start { } {
global timeout
global gdb_spawn_id
+ # Set the default value, it may be overriden later by specific testfile.
+ #
+ # Use `set_board_info use_gdb_stub' for the board file to flag the inferior
+ # is already started after connecting and run/attach are not supported.
+ # This is used for the "remote" protocol. After GDB starts you should
+ # check global $use_gdb_stub instead of the board as the testfile may force
+ # a specific different target protocol itself.
+ set use_gdb_stub [target_info exists use_gdb_stub]
+
verbose "Spawning $GDB $INTERNAL_GDBFLAGS $GDBFLAGS"
+ gdb_write_cmd_file "$GDB $INTERNAL_GDBFLAGS $GDBFLAGS"
if [info exists gdb_spawn_id] {
return 0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-01-13 20:37 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-13 20:37 [binutils-gdb] Fix latent bug in default_prompt_gdb_start Tom Tromey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).