Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: gdb-patches@sourceware.org
Subject: [patch] python: load *-gdb.py for shlibs during attach
Date: Wed, 22 Sep 2010 16:20:00 -0000	[thread overview]
Message-ID: <20100922090919.GA21901@host1.dyn.jankratochvil.net> (raw)

Hi,

currently if you attach to or load a core file for executable, its -gdb.py
script is loaded.  But none -gdb.py for the shared libraries.

Spawned or with the fix (libstdc++-gdb.py):
#1  0x00000000004007b5 in f (s="a") at 1.C:4
                             ^ is std::string

Attached/core without the fix:
#1  0x00000000004007b5 in f (s=...) at 1.C:4

No regressions on {x86_64,x86_64-m32,i686}-fedora13-linux-gnu.

Mostly obvious, I will check it in later.


Thanks,
Jan


gdb/
2010-09-22  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* main.c: Include objfiles.h.
	(captured_main): New variable objfile.  Call
	load_auto_scripts_for_objfile for ALL_OBJFILES.

--- ./gdb/main.c	2010-09-22 10:51:32.000000000 +0200
+++ ./gdb/main.c	2010-09-22 10:50:44.000000000 +0200
@@ -43,6 +43,7 @@
 #include "source.h"
 #include "cli/cli-cmds.h"
 #include "python/python.h"
+#include "objfiles.h"
 
 /* The selected interpreter.  This will be used as a set command
    variable, so it should always be malloc'ed - since
@@ -323,6 +324,7 @@ captured_main (void *data)
 
   int i;
   int save_auto_load;
+  struct objfile *objfile;
 
   struct cleanup *pre_stat_chain = make_command_stats_cleanup (0);
 
@@ -957,8 +959,8 @@ Can't attach to process and specify a co
      We wait until now because it is common to add to the source search
      path in local_gdbinit.  */
   gdbpy_global_auto_load = save_auto_load;
-  if (symfile_objfile != NULL)
-    load_auto_scripts_for_objfile (symfile_objfile);
+  ALL_OBJFILES (objfile)
+    load_auto_scripts_for_objfile (objfile);
 
   for (i = 0; i < ncmd; i++)
     {


             reply	other threads:[~2010-09-22  9:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-22 16:20 Jan Kratochvil [this message]
2010-09-22 19:41 ` Tom Tromey
2010-09-22 19:51   ` Jan Kratochvil
2010-09-22 20:09     ` Tom Tromey
2010-09-22 21:33       ` Jan Kratochvil

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=20100922090919.GA21901@host1.dyn.jankratochvil.net \
    --to=jan.kratochvil@redhat.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