From: Adrian Sendroiu <adrian.sendroiu@freescale.com>
To: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: [PATCH] call observer_notify_new_objfile after the attach command
Date: Wed, 09 Jul 2014 13:51:00 -0000 [thread overview]
Message-ID: <7e50a9e5f62f49c39dfaff1a57487393@BLUPR03MB136.namprd03.prod.outlook.com> (raw)
When debugging a remote bare-metal target which implements the gdb protocol,
using target extended-remote + attach, gdb will not send the qSymbol packet,
even if a file was previously specified using file or symbol-file.
Normally gdb would call remote_check_symbols in several places: the solib
inferior hook, the add_vsyscall_page hook or if the executable file changed
in the time passed between the file and the attach commands. Since none of these
conditions hold in the above scenario (no shared libraries are used and no
vsyscall page is present), gdb won't send a qSymbol packet.
To fix this problem this patch calls observer_notify_new_objfile after the attach
command is completed, if such a symbol file is present.
---
gdb/infcmd.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index 14736a5..e491b5d 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -2368,11 +2368,15 @@ attach_command_post_wait (char *args, int from_tty, int async_exec)
exec_file_attach (full_exec_path, from_tty);
symbol_file_add_main (full_exec_path, from_tty);
}
+ else if (symfile_objfile)
+ observer_notify_new_objfile(symfile_objfile);
}
else
{
reopen_exec_file ();
reread_symbols ();
+
+ observer_notify_new_objfile(symfile_objfile);
}
/* Take any necessary post-attaching actions for this platform. */
--
1.7.9.5
next reply other threads:[~2014-07-09 13:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-09 13:51 Adrian Sendroiu [this message]
2014-07-09 14:18 ` Pedro Alves
2014-07-10 10:57 ` Adrian Sendroiu
2014-07-10 13:53 ` Pedro Alves
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=7e50a9e5f62f49c39dfaff1a57487393@BLUPR03MB136.namprd03.prod.outlook.com \
--to=adrian.sendroiu@freescale.com \
--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