aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2012-02-16 21:07:20 +0000
committerTom Tromey <tromey@redhat.com>2012-02-16 21:07:20 +0000
commit7dcd53a07458941ccf02e280b42f9d68dfb976b0 (patch)
treed8826dcdbcc1399f5700f571362fc3c257455006
parent7b5de7eeacf1f08bc31562510bab508ebcaae3ee (diff)
downloadgdb-7dcd53a07458941ccf02e280b42f9d68dfb976b0.zip
gdb-7dcd53a07458941ccf02e280b42f9d68dfb976b0.tar.gz
gdb-7dcd53a07458941ccf02e280b42f9d68dfb976b0.tar.bz2
* symfile.c (symbol_file_add_main_1): Use inferior's
symfile_flags. * solib.c (solib_read_symbols): Use inferior's symfile_flags. * linux-nat.c (linux_child_follow_fork): Set symfile_flags on inferior. * infrun.c (handle_vfork_child_exec_or_exit): Set symfile_flags on inferior. (follow_exec): Use inferior's symfile_flags. * inferior.h (struct inferior) <symfile_flags>: New field.
-rw-r--r--gdb/ChangeLog12
-rw-r--r--gdb/inferior.h5
-rw-r--r--gdb/infrun.c8
-rw-r--r--gdb/linux-nat.c3
-rw-r--r--gdb/solib.c2
-rw-r--r--gdb/symfile.c7
6 files changed, 33 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 261b54e..77d2d7e 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,15 @@
+2012-02-16 Tom Tromey <tromey@redhat.com>
+
+ * symfile.c (symbol_file_add_main_1): Use inferior's
+ symfile_flags.
+ * solib.c (solib_read_symbols): Use inferior's symfile_flags.
+ * linux-nat.c (linux_child_follow_fork): Set symfile_flags on
+ inferior.
+ * infrun.c (handle_vfork_child_exec_or_exit): Set symfile_flags on
+ inferior.
+ (follow_exec): Use inferior's symfile_flags.
+ * inferior.h (struct inferior) <symfile_flags>: New field.
+
2012-02-16 Mike Frysinger <vapier@gentoo.org>
PR gdb/9734:
diff --git a/gdb/inferior.h b/gdb/inferior.h
index 7857cbf..65abf26 100644
--- a/gdb/inferior.h
+++ b/gdb/inferior.h
@@ -516,6 +516,11 @@ struct inferior
if any catching is necessary. */
int total_syscalls_count;
+ /* Default flags to pass to the symbol reading functions. These are
+ used whenever a new objfile is created. The valid values come
+ from enum symfile_add_flags. */
+ int symfile_flags;
+
/* Per inferior data-pointers required by other GDB modules. */
void **data;
unsigned num_data;
diff --git a/gdb/infrun.c b/gdb/infrun.c
index d3dab9a..1b2da67 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -739,6 +739,7 @@ handle_vfork_child_exec_or_exit (int exec)
pspace = add_program_space (maybe_new_address_space ());
set_current_program_space (pspace);
inf->removable = 1;
+ inf->symfile_flags = SYMFILE_NO_READ;
clone_program_space (pspace, inf->vfork_parent->pspace);
inf->pspace = pspace;
inf->aspace = pspace->aspace;
@@ -900,10 +901,13 @@ follow_exec (ptid_t pid, char *execd_pathname)
solib_create_inferior_hook below. breakpoint_re_set would fail to insert
the breakpoints with the zero displacement. */
- symbol_file_add (execd_pathname, SYMFILE_MAINLINE | SYMFILE_DEFER_BP_RESET,
+ symbol_file_add (execd_pathname,
+ (inf->symfile_flags
+ | SYMFILE_MAINLINE | SYMFILE_DEFER_BP_RESET),
NULL, 0);
- set_initial_language ();
+ if ((inf->symfile_flags & SYMFILE_NO_READ) == 0)
+ set_initial_language ();
#ifdef SOLIB_CREATE_INFERIOR_HOOK
SOLIB_CREATE_INFERIOR_HOOK (PIDGET (inferior_ptid));
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index 6aab087..3731096 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -59,6 +59,7 @@
#include "solib.h"
#include "linux-osdata.h"
#include "linux-tdep.h"
+#include "symfile.h"
#ifndef SPUFS_MAGIC
#define SPUFS_MAGIC 0x23c9b64e
@@ -723,6 +724,7 @@ holding the child stopped. Try \"set detach-on-fork\" or \
child_lp = add_lwp (inferior_ptid);
child_lp->stopped = 1;
child_lp->last_resume_kind = resume_stop;
+ child_inf->symfile_flags = SYMFILE_NO_READ;
/* If this is a vfork child, then the address-space is
shared with the parent. */
@@ -928,6 +930,7 @@ holding the child stopped. Try \"set detach-on-fork\" or \
child_inf->aspace = new_address_space ();
child_inf->pspace = add_program_space (child_inf->aspace);
child_inf->removable = 1;
+ child_inf->symfile_flags = SYMFILE_NO_READ;
set_current_program_space (child_inf->pspace);
clone_program_space (child_inf->pspace, parent_pspace);
diff --git a/gdb/solib.c b/gdb/solib.c
index 84b9019..656e8df 100644
--- a/gdb/solib.c
+++ b/gdb/solib.c
@@ -592,6 +592,8 @@ solib_read_symbols (struct so_list *so, int flags)
{
volatile struct gdb_exception e;
+ flags |= current_inferior ()->symfile_flags;
+
TRY_CATCH (e, RETURN_MASK_ERROR)
{
struct section_addr_info *sap;
diff --git a/gdb/symfile.c b/gdb/symfile.c
index 7529196..11ddfe8 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -1246,14 +1246,17 @@ symbol_file_add_main (char *args, int from_tty)
static void
symbol_file_add_main_1 (char *args, int from_tty, int flags)
{
- const int add_flags = SYMFILE_MAINLINE | (from_tty ? SYMFILE_VERBOSE : 0);
+ const int add_flags = (current_inferior ()->symfile_flags
+ | SYMFILE_MAINLINE | (from_tty ? SYMFILE_VERBOSE : 0));
+
symbol_file_add (args, add_flags, NULL, flags);
/* Getting new symbols may change our opinion about
what is frameless. */
reinit_frame_cache ();
- set_initial_language ();
+ if ((flags & SYMFILE_NO_READ) == 0)
+ set_initial_language ();
}
void