From: Pedro Alves <pedro_alves@portugalmail.pt>
To: gdb-patches <gdb-patches@sourceware.org>
Subject: [PATCH] Fix gdb.mi/mi-file.exp for stubs.
Date: Wed, 13 Dec 2006 22:41:00 -0000 [thread overview]
Message-ID: <45808168.9010601@portugalmail.pt> (raw)
[-- Attachment #1: Type: text/plain, Size: 1006 bytes --]
Hi all,
There is a comment on mi-file.exp that says:
# get the path and absolute path to the current executable
#
# In gdb 6.2 (at least), the default line number is set by
# select_source_symtab to the first line of "main" minus
# the value of "lines_to_list" (which defaults to 10) plus one.
# --chastain 2004-08-13
That won't work for remote stubs.
The attached patch adds a call to mi_run_to_main with the following comment:
# When debugging a stub, we can't depend on the current file
# being the default file set by select_source_symtab.
# When the gdb host connects to the stub, the stub will already be
# running the target program stopped at a function
# that probably isn't the one with main. We force
# the file with main to be the current, so the following tests work.
Please review and commit.
Cheers,
Pedro Alves
---
2006-12-13 Pedro Alves <pedro_alves@portugalmail.pt>
* gdb.mi/mi-file.exp: Call mi_run_to_main if use_gdb_stub is set.
[-- Attachment #2: mi-file.exp.diff --]
[-- Type: text/plain, Size: 916 bytes --]
Index: mi-file.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-file.exp,v
retrieving revision 1.7
diff -u -p -r1.7 mi-file.exp
--- mi-file.exp 12 Sep 2006 20:11:42 -0000 1.7
+++ mi-file.exp 13 Dec 2006 22:34:53 -0000
@@ -45,6 +45,18 @@ mi_delete_breakpoints
mi_gdb_reinitialize_dir $srcdir/$subdir
mi_gdb_load ${binfile}
+if [target_info exists use_gdb_stub] {
+
+ # When debugging a stub, we can't depend on the current file
+ # being the default file set by select_source_symtab.
+ # When the gdb host connects to the stub, the stub will already be
+ # running the target program stopped at a function
+ # that probably isn't the one with main. We force
+ # the file with main to be the current, so the following tests work.
+
+ mi_run_to_main
+}
+
proc test_file_list_exec_source_file {} {
global srcfile
global srcdir
next reply other threads:[~2006-12-13 22:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-13 22:41 Pedro Alves [this message]
2006-12-13 23:26 ` [PATCH 2] " Pedro Alves
2006-12-14 9:59 ` Pedro Alves
2007-01-04 20:37 ` Daniel Jacobowitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=45808168.9010601@portugalmail.pt \
--to=pedro_alves@portugalmail.pt \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox