- Upgrade to the FSF GDB gdb-6.8.50 snapshot.

This commit is contained in:
Jan Kratochvil 2009-02-11 00:04:48 +00:00
commit 81783d0ff2
19 changed files with 3174 additions and 2205 deletions

View file

@ -26,11 +26,11 @@
Fix scan_dyntag() for binaries provided by valgrind (BZ 460319).
Index: gdb-6.8.50.20081209/gdb/amd64-tdep.c
Index: gdb-6.8.50.20090209/gdb/amd64-tdep.c
===================================================================
--- gdb-6.8.50.20081209.orig/gdb/amd64-tdep.c 2008-12-14 14:55:58.000000000 +0100
+++ gdb-6.8.50.20081209/gdb/amd64-tdep.c 2008-12-14 14:56:49.000000000 +0100
@@ -34,6 +34,7 @@
--- gdb-6.8.50.20090209.orig/gdb/amd64-tdep.c 2009-02-09 16:02:28.000000000 +0100
+++ gdb-6.8.50.20090209/gdb/amd64-tdep.c 2009-02-09 16:21:55.000000000 +0100
@@ -36,6 +36,7 @@
#include "regcache.h"
#include "regset.h"
#include "symfile.h"
@ -38,7 +38,7 @@ Index: gdb-6.8.50.20081209/gdb/amd64-tdep.c
#include "gdb_assert.h"
@@ -906,16 +907,28 @@ amd64_analyze_stack_align (CORE_ADDR pc,
@@ -1597,16 +1598,28 @@ amd64_analyze_stack_align (CORE_ADDR pc,
Any function that doesn't start with this sequence will be assumed
to have no prologue and thus no valid frame pointer in %rbp. */
@ -71,7 +71,7 @@ Index: gdb-6.8.50.20081209/gdb/amd64-tdep.c
pc = amd64_analyze_stack_align (pc, current_pc, cache);
@@ -930,18 +943,57 @@ amd64_analyze_prologue (CORE_ADDR pc, CO
@@ -1621,18 +1634,57 @@ amd64_analyze_prologue (CORE_ADDR pc, CO
/* If that's all, return now. */
if (current_pc <= pc + 1)
@ -132,11 +132,11 @@ Index: gdb-6.8.50.20081209/gdb/amd64-tdep.c
return pc;
}
Index: gdb-6.8.50.20081209/gdb/auxv.c
Index: gdb-6.8.50.20090209/gdb/auxv.c
===================================================================
--- gdb-6.8.50.20081209.orig/gdb/auxv.c 2008-12-14 14:55:58.000000000 +0100
+++ gdb-6.8.50.20081209/gdb/auxv.c 2008-12-14 14:57:58.000000000 +0100
@@ -80,7 +80,7 @@ procfs_xfer_auxv (struct target_ops *ops
--- gdb-6.8.50.20090209.orig/gdb/auxv.c 2009-01-03 06:57:50.000000000 +0100
+++ gdb-6.8.50.20090209/gdb/auxv.c 2009-02-09 16:21:55.000000000 +0100
@@ -81,7 +81,7 @@ procfs_xfer_auxv (struct target_ops *ops
Return 1 if an entry was read into *TYPEP and *VALP. */
int
default_auxv_parse (struct target_ops *ops, gdb_byte **readptr,
@ -145,7 +145,7 @@ Index: gdb-6.8.50.20081209/gdb/auxv.c
{
const int sizeof_auxv_field = gdbarch_ptr_bit (target_gdbarch)
/ TARGET_CHAR_BIT;
@@ -107,7 +107,7 @@ default_auxv_parse (struct target_ops *o
@@ -108,7 +108,7 @@ default_auxv_parse (struct target_ops *o
Return 1 if an entry was read into *TYPEP and *VALP. */
int
target_auxv_parse (struct target_ops *ops, gdb_byte **readptr,
@ -154,7 +154,7 @@ Index: gdb-6.8.50.20081209/gdb/auxv.c
{
struct target_ops *t;
for (t = ops; t != NULL; t = t->beneath)
@@ -122,9 +122,10 @@ target_auxv_parse (struct target_ops *op
@@ -123,9 +123,10 @@ target_auxv_parse (struct target_ops *op
an error getting the information. On success, return 1 after
storing the entry's value field in *VALP. */
int
@ -167,7 +167,7 @@ Index: gdb-6.8.50.20081209/gdb/auxv.c
gdb_byte *data;
LONGEST n = target_read_alloc (ops, TARGET_OBJECT_AUXV, NULL, &data);
gdb_byte *ptr = data;
@@ -134,10 +135,10 @@ target_auxv_search (struct target_ops *o
@@ -135,10 +136,10 @@ target_auxv_search (struct target_ops *o
return n;
while (1)
@ -180,7 +180,7 @@ Index: gdb-6.8.50.20081209/gdb/auxv.c
{
xfree (data);
*valp = val;
@@ -160,7 +161,8 @@ target_auxv_search (struct target_ops *o
@@ -161,7 +162,8 @@ target_auxv_search (struct target_ops *o
int
fprint_target_auxv (struct ui_file *file, struct target_ops *ops)
{
@ -190,7 +190,7 @@ Index: gdb-6.8.50.20081209/gdb/auxv.c
gdb_byte *data;
LONGEST len = target_read_alloc (ops, TARGET_OBJECT_AUXV, NULL,
&data);
@@ -170,13 +172,13 @@ fprint_target_auxv (struct ui_file *file
@@ -171,13 +173,13 @@ fprint_target_auxv (struct ui_file *file
if (len <= 0)
return len;
@ -206,7 +206,7 @@ Index: gdb-6.8.50.20081209/gdb/auxv.c
{
#define TAG(tag, text, kind) \
case tag: name = #tag; description = text; flavor = kind; break
@@ -231,7 +233,7 @@ fprint_target_auxv (struct ui_file *file
@@ -232,7 +234,7 @@ fprint_target_auxv (struct ui_file *file
}
fprintf_filtered (file, "%-4s %-20s %-30s ",
@ -215,7 +215,7 @@ Index: gdb-6.8.50.20081209/gdb/auxv.c
switch (flavor)
{
case dec:
@@ -252,7 +254,7 @@ fprint_target_auxv (struct ui_file *file
@@ -253,7 +255,7 @@ fprint_target_auxv (struct ui_file *file
break;
}
++ents;
@ -224,11 +224,11 @@ Index: gdb-6.8.50.20081209/gdb/auxv.c
break;
}
Index: gdb-6.8.50.20081209/gdb/auxv.h
Index: gdb-6.8.50.20090209/gdb/auxv.h
===================================================================
--- gdb-6.8.50.20081209.orig/gdb/auxv.h 2008-12-14 14:55:58.000000000 +0100
+++ gdb-6.8.50.20081209/gdb/auxv.h 2008-12-14 14:56:49.000000000 +0100
@@ -35,14 +35,14 @@ struct target_ops; /* Forward declarati
--- gdb-6.8.50.20090209.orig/gdb/auxv.h 2009-01-03 06:57:50.000000000 +0100
+++ gdb-6.8.50.20090209/gdb/auxv.h 2009-02-09 16:21:55.000000000 +0100
@@ -36,14 +36,14 @@ struct target_ops; /* Forward declarati
Return 1 if an entry was read into *TYPEP and *VALP. */
extern int target_auxv_parse (struct target_ops *ops,
gdb_byte **readptr, gdb_byte *endptr,
@ -245,11 +245,11 @@ Index: gdb-6.8.50.20081209/gdb/auxv.h
/* Print the contents of the target's AUXV on the specified file. */
extern int fprint_target_auxv (struct ui_file *file, struct target_ops *ops);
Index: gdb-6.8.50.20081209/gdb/breakpoint.c
Index: gdb-6.8.50.20090209/gdb/breakpoint.c
===================================================================
--- gdb-6.8.50.20081209.orig/gdb/breakpoint.c 2008-12-14 14:55:58.000000000 +0100
+++ gdb-6.8.50.20081209/gdb/breakpoint.c 2008-12-14 14:56:49.000000000 +0100
@@ -3861,7 +3861,8 @@ describe_other_breakpoints (CORE_ADDR pc
--- gdb-6.8.50.20090209.orig/gdb/breakpoint.c 2009-02-09 16:12:23.000000000 +0100
+++ gdb-6.8.50.20090209/gdb/breakpoint.c 2009-02-09 16:21:55.000000000 +0100
@@ -3894,7 +3894,8 @@ describe_other_breakpoints (CORE_ADDR pc
printf_filtered (" (thread %d)", b->thread);
printf_filtered ("%s%s ",
((b->enable_state == bp_disabled ||
@ -259,7 +259,7 @@ Index: gdb-6.8.50.20081209/gdb/breakpoint.c
? " (disabled)"
: b->enable_state == bp_permanent
? " (permanent)"
@@ -4692,6 +4693,61 @@ create_catchpoint (int tempflag, char *c
@@ -4725,6 +4726,61 @@ create_catchpoint (int tempflag, char *c
return b;
}
@ -321,10 +321,10 @@ Index: gdb-6.8.50.20081209/gdb/breakpoint.c
static void
create_fork_vfork_event_catchpoint (int tempflag, char *cond_string,
struct breakpoint_ops *ops)
Index: gdb-6.8.50.20081209/gdb/breakpoint.h
Index: gdb-6.8.50.20090209/gdb/breakpoint.h
===================================================================
--- gdb-6.8.50.20081209.orig/gdb/breakpoint.h 2008-12-14 14:55:58.000000000 +0100
+++ gdb-6.8.50.20081209/gdb/breakpoint.h 2008-12-14 14:56:49.000000000 +0100
--- gdb-6.8.50.20090209.orig/gdb/breakpoint.h 2009-01-30 19:28:00.000000000 +0100
+++ gdb-6.8.50.20090209/gdb/breakpoint.h 2009-02-09 16:21:55.000000000 +0100
@@ -126,6 +126,7 @@ enum enable_state
automatically enabled and reset when the call
"lands" (either completes, or stops at another
@ -333,7 +333,7 @@ Index: gdb-6.8.50.20081209/gdb/breakpoint.h
bp_permanent /* There is a breakpoint instruction hard-wired into
the target's code. Don't try to write another
breakpoint instruction on top of it, or restore
@@ -818,6 +819,10 @@ extern void remove_thread_event_breakpoi
@@ -819,6 +820,10 @@ extern void remove_thread_event_breakpoi
extern void disable_breakpoints_in_shlibs (void);
@ -344,11 +344,11 @@ Index: gdb-6.8.50.20081209/gdb/breakpoint.h
/* This function returns TRUE if ep is a catchpoint. */
extern int ep_is_catchpoint (struct breakpoint *);
Index: gdb-6.8.50.20081209/gdb/dwarf2read.c
Index: gdb-6.8.50.20090209/gdb/dwarf2read.c
===================================================================
--- gdb-6.8.50.20081209.orig/gdb/dwarf2read.c 2008-12-14 14:55:58.000000000 +0100
+++ gdb-6.8.50.20081209/gdb/dwarf2read.c 2008-12-14 14:56:49.000000000 +0100
@@ -1295,7 +1295,7 @@ dwarf2_build_psymtabs (struct objfile *o
--- gdb-6.8.50.20090209.orig/gdb/dwarf2read.c 2009-02-09 16:12:23.000000000 +0100
+++ gdb-6.8.50.20090209/gdb/dwarf2read.c 2009-02-09 16:21:55.000000000 +0100
@@ -1296,7 +1296,7 @@ dwarf2_build_psymtabs (struct objfile *o
else
dwarf2_per_objfile->loc_buffer = NULL;
@ -357,10 +357,10 @@ Index: gdb-6.8.50.20081209/gdb/dwarf2read.c
|| (objfile->global_psymbols.size == 0
&& objfile->static_psymbols.size == 0))
{
Index: gdb-6.8.50.20081209/gdb/elfread.c
Index: gdb-6.8.50.20090209/gdb/elfread.c
===================================================================
--- gdb-6.8.50.20081209.orig/gdb/elfread.c 2008-12-14 14:55:58.000000000 +0100
+++ gdb-6.8.50.20081209/gdb/elfread.c 2008-12-14 14:56:49.000000000 +0100
--- gdb-6.8.50.20090209.orig/gdb/elfread.c 2009-01-03 06:57:51.000000000 +0100
+++ gdb-6.8.50.20090209/gdb/elfread.c 2009-02-09 16:21:55.000000000 +0100
@@ -680,7 +680,7 @@ elf_symfile_read (struct objfile *objfil
/* If we are reinitializing, or if we have never loaded syms yet,
set table to empty. MAINLINE is cleared so that *_read_psymtab
@ -370,11 +370,11 @@ Index: gdb-6.8.50.20081209/gdb/elfread.c
{
init_psymbol_list (objfile, 0);
mainline = 0;
Index: gdb-6.8.50.20081209/gdb/infrun.c
Index: gdb-6.8.50.20090209/gdb/infrun.c
===================================================================
--- gdb-6.8.50.20081209.orig/gdb/infrun.c 2008-12-14 14:55:58.000000000 +0100
+++ gdb-6.8.50.20081209/gdb/infrun.c 2008-12-14 14:56:49.000000000 +0100
@@ -3229,6 +3229,11 @@ infrun: BPSTAT_WHAT_SET_LONGJMP_RESUME (
--- gdb-6.8.50.20090209.orig/gdb/infrun.c 2009-02-09 16:12:23.000000000 +0100
+++ gdb-6.8.50.20090209/gdb/infrun.c 2009-02-09 16:21:55.000000000 +0100
@@ -3278,6 +3278,11 @@ infrun: BPSTAT_WHAT_SET_LONGJMP_RESUME (
#endif
target_terminal_inferior ();
@ -386,10 +386,10 @@ Index: gdb-6.8.50.20081209/gdb/infrun.c
/* If requested, stop when the dynamic linker notifies
gdb of events. This allows the user to get control
and place breakpoints in initializer routines for
Index: gdb-6.8.50.20081209/gdb/objfiles.c
Index: gdb-6.8.50.20090209/gdb/objfiles.c
===================================================================
--- gdb-6.8.50.20081209.orig/gdb/objfiles.c 2008-12-14 14:55:58.000000000 +0100
+++ gdb-6.8.50.20081209/gdb/objfiles.c 2008-12-14 14:56:49.000000000 +0100
--- gdb-6.8.50.20090209.orig/gdb/objfiles.c 2009-01-15 17:35:22.000000000 +0100
+++ gdb-6.8.50.20090209/gdb/objfiles.c 2009-02-09 16:21:55.000000000 +0100
@@ -51,6 +51,9 @@
#include "arch-utils.h"
#include "exec.h"
@ -421,11 +421,21 @@ Index: gdb-6.8.50.20081209/gdb/objfiles.c
}
/* Create the terminating entry of OBJFILE's minimal symbol table.
Index: gdb-6.8.50.20081209/gdb/solib-svr4.c
@@ -458,6 +458,9 @@ free_objfile (struct objfile *objfile)
if (objfile == rt_common_objfile)
rt_common_objfile = NULL;
+ if (objfile == symfile_objfile)
+ symfile_objfile = NULL;
+
/* Before the symbol table code was redone to make it easier to
selectively load and remove information particular to a specific
linkage unit, gdb used to do these things whenever the monolithic
Index: gdb-6.8.50.20090209/gdb/solib-svr4.c
===================================================================
--- gdb-6.8.50.20081209.orig/gdb/solib-svr4.c 2008-12-14 14:55:58.000000000 +0100
+++ gdb-6.8.50.20081209/gdb/solib-svr4.c 2008-12-14 14:56:49.000000000 +0100
@@ -44,6 +44,7 @@
--- gdb-6.8.50.20090209.orig/gdb/solib-svr4.c 2009-02-09 16:02:35.000000000 +0100
+++ gdb-6.8.50.20090209/gdb/solib-svr4.c 2009-02-09 16:21:55.000000000 +0100
@@ -45,6 +45,7 @@
#include "exec.h"
#include "auxv.h"
#include "exceptions.h"
@ -433,7 +443,7 @@ Index: gdb-6.8.50.20081209/gdb/solib-svr4.c
static struct link_map_offsets *svr4_fetch_link_map_offsets (void);
static int svr4_have_link_map_offsets (void);
@@ -286,7 +287,9 @@ static CORE_ADDR main_lm_addr;
@@ -287,7 +288,9 @@ static CORE_ADDR main_lm_addr;
/* Local function prototypes */
@ -443,7 +453,7 @@ Index: gdb-6.8.50.20081209/gdb/solib-svr4.c
static CORE_ADDR bfd_lookup_symbol (bfd *, char *);
@@ -520,10 +523,12 @@ scan_dyntag (int dyntag, bfd *abfd, CORE
@@ -521,10 +524,12 @@ scan_dyntag (int dyntag, bfd *abfd, CORE
int arch_size, step, sect_size;
long dyn_tag;
CORE_ADDR dyn_ptr, dyn_addr;
@ -456,7 +466,7 @@ Index: gdb-6.8.50.20081209/gdb/solib-svr4.c
if (abfd == NULL)
return 0;
@@ -531,19 +536,81 @@ scan_dyntag (int dyntag, bfd *abfd, CORE
@@ -532,19 +537,81 @@ scan_dyntag (int dyntag, bfd *abfd, CORE
if (arch_size == -1)
return 0;
@ -540,7 +550,7 @@ Index: gdb-6.8.50.20081209/gdb/solib-svr4.c
/* Iterate over BUF and scan for DYNTAG. If found, set PTR and return. */
step = (arch_size == 32) ? sizeof (Elf32_External_Dyn)
@@ -564,26 +631,105 @@ scan_dyntag (int dyntag, bfd *abfd, CORE
@@ -565,26 +632,105 @@ scan_dyntag (int dyntag, bfd *abfd, CORE
dyn_tag = bfd_h_get_64 (abfd, (bfd_byte *) x_dynp_64->d_tag);
dyn_ptr = bfd_h_get_64 (abfd, (bfd_byte *) x_dynp_64->d_un.d_ptr);
}
@ -665,7 +675,7 @@ Index: gdb-6.8.50.20081209/gdb/solib-svr4.c
}
return 0;
@@ -773,6 +919,10 @@ solib_svr4_r_map (void)
@@ -774,6 +920,10 @@ solib_svr4_r_map (void)
struct link_map_offsets *lmo = svr4_fetch_link_map_offsets ();
struct type *ptr_type = builtin_type (target_gdbarch)->builtin_data_ptr;
@ -676,7 +686,7 @@ Index: gdb-6.8.50.20081209/gdb/solib-svr4.c
return read_memory_typed_address (debug_base + lmo->r_map_offset, ptr_type);
}
@@ -944,6 +1094,11 @@ svr4_current_sos (void)
@@ -945,6 +1095,11 @@ svr4_current_sos (void)
struct so_list *head = 0;
struct so_list **link_ptr = &head;
CORE_ADDR ldsomap = 0;
@ -688,7 +698,7 @@ Index: gdb-6.8.50.20081209/gdb/solib-svr4.c
/* Always locate the debug struct, in case it has moved. */
debug_base = 0;
@@ -952,10 +1107,19 @@ svr4_current_sos (void)
@@ -953,10 +1108,19 @@ svr4_current_sos (void)
/* If we can't find the dynamic linker's base structure, this
must not be a dynamically linked executable. Hmm. */
if (! debug_base)
@ -709,7 +719,7 @@ Index: gdb-6.8.50.20081209/gdb/solib-svr4.c
lm = solib_svr4_r_map ();
while (lm)
@@ -972,26 +1136,104 @@ svr4_current_sos (void)
@@ -973,26 +1137,104 @@ svr4_current_sos (void)
new->lm_info->lm = xzalloc (lmo->link_map_size);
make_cleanup (xfree, new->lm_info->lm);
@ -818,7 +828,7 @@ Index: gdb-6.8.50.20081209/gdb/solib-svr4.c
target_read_string (LM_NAME (new), &buffer,
SO_NAME_MAX_PATH_SIZE - 1, &errcode);
if (errcode != 0)
@@ -999,47 +1241,60 @@ svr4_current_sos (void)
@@ -1000,47 +1242,60 @@ svr4_current_sos (void)
safe_strerror (errcode));
else
{
@ -912,7 +922,7 @@ Index: gdb-6.8.50.20081209/gdb/solib-svr4.c
}
/* On Solaris, the dynamic linker is not in the normal list of
@@ -1055,6 +1310,9 @@ svr4_current_sos (void)
@@ -1056,6 +1311,9 @@ svr4_current_sos (void)
if (head == NULL)
return svr4_default_sos ();
@ -922,7 +932,7 @@ Index: gdb-6.8.50.20081209/gdb/solib-svr4.c
return head;
}
@@ -1086,7 +1344,7 @@ svr4_fetch_objfile_link_map (struct objf
@@ -1087,7 +1345,7 @@ svr4_fetch_objfile_link_map (struct objf
/* On some systems, the only way to recognize the link map entry for
the main executable file is by looking at its name. Return
non-zero iff SONAME matches one of the known main executable names. */
@ -931,7 +941,7 @@ Index: gdb-6.8.50.20081209/gdb/solib-svr4.c
static int
match_main (char *soname)
{
@@ -1100,6 +1358,7 @@ match_main (char *soname)
@@ -1101,6 +1359,7 @@ match_main (char *soname)
return (0);
}
@ -939,7 +949,7 @@ Index: gdb-6.8.50.20081209/gdb/solib-svr4.c
/* Return 1 if PC lies in the dynamic symbol resolution code of the
SVR4 run time loader. */
@@ -1250,15 +1509,29 @@ enable_break (void)
@@ -1251,15 +1510,29 @@ enable_break (void)
/* Find the program interpreter; if not found, warn the user and drop
into the old breakpoint at symbol code. */
interp_name = find_program_interpreter ();
@ -969,7 +979,7 @@ Index: gdb-6.8.50.20081209/gdb/solib-svr4.c
sym_addr = 0;
@@ -1275,6 +1548,9 @@ enable_break (void)
@@ -1276,6 +1549,9 @@ enable_break (void)
{
tmp_bfd = solib_bfd_open (interp_name);
}
@ -979,7 +989,7 @@ Index: gdb-6.8.50.20081209/gdb/solib-svr4.c
if (tmp_bfd == NULL)
goto bkpt_at_symbol;
@@ -1328,16 +1604,16 @@ enable_break (void)
@@ -1329,16 +1605,16 @@ enable_break (void)
interp_sect = bfd_get_section_by_name (tmp_bfd, ".text");
if (interp_sect)
{
@ -1000,7 +1010,7 @@ Index: gdb-6.8.50.20081209/gdb/solib-svr4.c
interp_plt_sect_high =
interp_plt_sect_low + bfd_section_size (tmp_bfd, interp_sect);
}
@@ -1372,7 +1648,11 @@ enable_break (void)
@@ -1373,7 +1649,11 @@ enable_break (void)
if (sym_addr != 0)
{
@ -1013,7 +1023,7 @@ Index: gdb-6.8.50.20081209/gdb/solib-svr4.c
xfree (interp_name);
return 1;
}
@@ -1638,6 +1918,8 @@ svr4_solib_create_inferior_hook (void)
@@ -1639,6 +1919,8 @@ svr4_solib_create_inferior_hook (void)
while (tp->stop_signal != TARGET_SIGNAL_TRAP);
inf->stop_soon = NO_STOP_QUIETLY;
#endif /* defined(_SCO_DS) */
@ -1022,7 +1032,7 @@ Index: gdb-6.8.50.20081209/gdb/solib-svr4.c
}
static void
@@ -1819,6 +2101,75 @@ svr4_lp64_fetch_link_map_offsets (void)
@@ -1820,6 +2102,75 @@ svr4_lp64_fetch_link_map_offsets (void)
return lmp;
}
@ -1098,7 +1108,7 @@ Index: gdb-6.8.50.20081209/gdb/solib-svr4.c
struct target_so_ops svr4_so_ops;
@@ -1858,4 +2209,7 @@ _initialize_svr4_solib (void)
@@ -1859,4 +2210,7 @@ _initialize_svr4_solib (void)
svr4_so_ops.in_dynsym_resolve_code = svr4_in_dynsym_resolve_code;
svr4_so_ops.lookup_lib_global_symbol = elf_lookup_lib_symbol;
svr4_so_ops.same = svr4_same;
@ -1106,10 +1116,10 @@ Index: gdb-6.8.50.20081209/gdb/solib-svr4.c
+ add_info ("linkmap", info_linkmap_command,
+ "Display the inferior's linkmap.");
}
Index: gdb-6.8.50.20081209/gdb/solib.c
Index: gdb-6.8.50.20090209/gdb/solib.c
===================================================================
--- gdb-6.8.50.20081209.orig/gdb/solib.c 2008-12-14 14:55:58.000000000 +0100
+++ gdb-6.8.50.20081209/gdb/solib.c 2008-12-14 14:56:49.000000000 +0100
--- gdb-6.8.50.20090209.orig/gdb/solib.c 2009-01-15 17:35:22.000000000 +0100
+++ gdb-6.8.50.20090209/gdb/solib.c 2009-02-09 16:26:02.000000000 +0100
@@ -80,6 +80,8 @@ set_solib_ops (struct gdbarch *gdbarch,
/* external data declarations */
@ -1128,67 +1138,79 @@ Index: gdb-6.8.50.20081209/gdb/solib.c
/*
GLOBAL FUNCTION
@@ -405,7 +409,6 @@ free_so (struct so_list *so)
xfree (so);
}
@@ -425,10 +429,23 @@ free_so (struct so_list *so)
if (so->abfd)
{
- bfd_filename = bfd_get_filename (so->abfd);
- if (! bfd_close (so->abfd))
- warning (_("cannot close \"%s\": %s"),
- bfd_filename, bfd_errmsg (bfd_get_error ()));
+ struct objfile *objfile;
+
+ ALL_OBJFILES (objfile)
+ if (objfile->obfd == so->abfd)
+ {
+ gdb_assert (objfile->flags & OBJF_KEEPBFD);
+ objfile->flags &= ~OBJF_KEEPBFD;
+ break;
+ }
+
+ if (!objfile)
+ {
+ bfd_filename = bfd_get_filename (so->abfd);
+ if (! bfd_close (so->abfd))
+ warning (_("cannot close \"%s\": %s"),
+ bfd_filename, bfd_errmsg (bfd_get_error ()));
+ }
}
-
/* Return address of first so_list entry in master shared object list. */
struct so_list *
master_so_list (void)
@@ -413,7 +416,6 @@ master_so_list (void)
return so_list_head;
}
-
/* A small stub to get us past the arg-passing pinhole of catch_errors. */
static int
@@ -425,15 +427,40 @@ symbol_add_stub (void *arg)
if (bfd_filename)
@@ -459,15 +461,40 @@ symbol_add_stub (void *arg)
/* Have we already loaded this shared object? */
ALL_OBJFILES (so->objfile)
{
- if (strcmp (so->objfile->name, so->so_name) == 0)
+ /* Found an already loaded shared library. */
+ if (strcmp (so->objfile->name, so->so_name) == 0
+ && !so->main)
return 1;
+ && !so->main)
+ return 1;
+ /* Found an already loaded main executable. This could happen in
+ two circumstances.
+ First case: the main file has already been read in
+ as the first thing that gdb does at startup, and the file
+ hasn't been relocated properly yet. Therefor we need to read
+ it in with the proper section info.
+ Second case: it has been read in with the correct relocation,
+ and therefore we need to skip it. */
+ two circumstances.
+ First case: the main file has already been read in
+ as the first thing that gdb does at startup, and the file
+ hasn't been relocated properly yet. Therefor we need to read
+ it in with the proper section info.
+ Second case: it has been read in with the correct relocation,
+ and therefore we need to skip it. */
+ if (strcmp (so->objfile->name, so->so_name) == 0
+ && so->main
+ && so->main_relocated)
+ return 1;
+ && so->main
+ && so->main_relocated)
return 1;
}
sap = build_section_addr_info_from_section_table (so->sections,
so->sections_end);
- so->objfile = symbol_file_add (so->so_name, so->from_tty,
- sap, 0, OBJF_SHARED);
- so->objfile = symbol_file_add_from_bfd (so->abfd, so->from_tty,
- sap, 0, OBJF_SHARED | OBJF_KEEPBFD);
+ if (so->main)
+ {
+ if (debug_solib)
+ fprintf_unfiltered (gdb_stdlog,
+ "symbol_add_stub: adding symbols for main\n");
+ so->objfile = symbol_file_add (so->so_name, /*so->from_tty*/ 0,
+ sap, 1, 0);
+ so->objfile = symbol_file_add_from_bfd (so->abfd, /*so->from_tty*/ 0,
+ sap, 1, OBJF_KEEPBFD);
+ so->main_relocated = 1;
+ }
+ else
+ so->objfile = symbol_file_add (so->so_name, so->from_tty,
+ sap, 0, OBJF_SHARED);
+ so->objfile = symbol_file_add_from_bfd (so->abfd, so->from_tty,
+ sap, 0, OBJF_SHARED | OBJF_KEEPBFD);
+
free_section_addr_info (sap);
return (1);
@@ -565,6 +592,10 @@ update_solib_list (int from_tty, struct
@@ -599,6 +626,10 @@ update_solib_list (int from_tty, struct
}
else
{
@ -1199,7 +1221,7 @@ Index: gdb-6.8.50.20081209/gdb/solib.c
if (! strcmp (gdb->so_original_name, i->so_original_name))
break;
}
@@ -619,28 +650,7 @@ update_solib_list (int from_tty, struct
@@ -653,28 +684,7 @@ update_solib_list (int from_tty, struct
/* Fill in the rest of each of the `struct so_list' nodes. */
for (i = inferior; i; i = i->next)
{
@ -1229,7 +1251,7 @@ Index: gdb-6.8.50.20081209/gdb/solib.c
/* Notify any observer that the shared object has been
loaded now that we've added it to GDB's tables. */
@@ -736,6 +746,41 @@ solib_add (char *pattern, int from_tty,
@@ -770,6 +780,41 @@ solib_add (char *pattern, int from_tty,
}
}
@ -1271,7 +1293,7 @@ Index: gdb-6.8.50.20081209/gdb/solib.c
/*
@@ -1053,4 +1098,12 @@ This takes precedence over the environme
@@ -1087,4 +1132,12 @@ This takes precedence over the environme
reload_shared_libraries,
show_solib_search_path,
&setlist, &showlist);
@ -1284,10 +1306,10 @@ Index: gdb-6.8.50.20081209/gdb/solib.c
+ NULL, NULL,
+ &setdebuglist, &showdebuglist);
}
Index: gdb-6.8.50.20081209/gdb/solist.h
Index: gdb-6.8.50.20090209/gdb/solist.h
===================================================================
--- gdb-6.8.50.20081209.orig/gdb/solist.h 2008-12-14 14:55:58.000000000 +0100
+++ gdb-6.8.50.20081209/gdb/solist.h 2008-12-14 14:56:49.000000000 +0100
--- gdb-6.8.50.20090209.orig/gdb/solist.h 2009-02-04 09:42:11.000000000 +0100
+++ gdb-6.8.50.20090209/gdb/solist.h 2009-02-09 16:21:55.000000000 +0100
@@ -61,6 +61,8 @@ struct so_list
bfd *abfd;
char symbols_loaded; /* flag: symbols read in yet? */
@ -1297,7 +1319,7 @@ Index: gdb-6.8.50.20081209/gdb/solist.h
struct objfile *objfile; /* objfile for loaded lib */
struct section_table *sections;
struct section_table *sections_end;
@@ -138,4 +140,10 @@ struct symbol *solib_global_lookup (cons
@@ -149,4 +151,10 @@ struct symbol *solib_global_lookup (cons
const char *linkage_name,
const domain_enum domain);
@ -1308,10 +1330,10 @@ Index: gdb-6.8.50.20081209/gdb/solist.h
+extern int debug_solib;
+
#endif
Index: gdb-6.8.50.20081209/gdb/symfile-mem.c
Index: gdb-6.8.50.20090209/gdb/symfile-mem.c
===================================================================
--- gdb-6.8.50.20081209.orig/gdb/symfile-mem.c 2008-12-14 14:55:58.000000000 +0100
+++ gdb-6.8.50.20081209/gdb/symfile-mem.c 2008-12-14 14:56:49.000000000 +0100
--- gdb-6.8.50.20090209.orig/gdb/symfile-mem.c 2009-02-09 15:49:25.000000000 +0100
+++ gdb-6.8.50.20090209/gdb/symfile-mem.c 2009-02-09 16:21:55.000000000 +0100
@@ -116,7 +116,7 @@ symbol_file_add_from_memory (struct bfd
}
@ -1321,10 +1343,10 @@ Index: gdb-6.8.50.20081209/gdb/symfile-mem.c
/* This might change our ideas about frames already looked at. */
reinit_frame_cache ();
Index: gdb-6.8.50.20081209/gdb/symfile.c
Index: gdb-6.8.50.20090209/gdb/symfile.c
===================================================================
--- gdb-6.8.50.20081209.orig/gdb/symfile.c 2008-12-14 14:55:58.000000000 +0100
+++ gdb-6.8.50.20081209/gdb/symfile.c 2008-12-14 14:56:49.000000000 +0100
--- gdb-6.8.50.20090209.orig/gdb/symfile.c 2009-02-09 16:03:45.000000000 +0100
+++ gdb-6.8.50.20090209/gdb/symfile.c 2009-02-09 16:21:55.000000000 +0100
@@ -47,6 +47,7 @@
#include "readline/readline.h"
#include "gdb_assert.h"
@ -1351,7 +1373,7 @@ Index: gdb-6.8.50.20081209/gdb/symfile.c
{
asection *lower_sect;
asection *sect;
@@ -916,17 +917,21 @@ new_symfile_objfile (struct objfile *obj
@@ -917,17 +918,21 @@ new_symfile_objfile (struct objfile *obj
/* If this is the main symbol file we have to clean up all users of the
old main symbol file. Otherwise it is sufficient to fixup all the
breakpoints that may have been redefined by this symbol file. */
@ -1375,7 +1397,7 @@ Index: gdb-6.8.50.20081209/gdb/symfile.c
/* We're done reading the symbol file; finish off complaints. */
clear_complaints (&symfile_complaints, 0, verbo);
@@ -969,7 +974,7 @@ symbol_file_add_with_addrs_or_offsets (b
@@ -970,7 +975,7 @@ symbol_file_add_with_addrs_or_offsets (b
interactively wiping out any existing symbols. */
if ((have_full_symbols () || have_partial_symbols ())
@ -1384,7 +1406,7 @@ Index: gdb-6.8.50.20081209/gdb/symfile.c
&& from_tty
&& !query ("Load new symbol table from \"%s\"? ", name))
error (_("Not confirmed."));
@@ -1160,6 +1165,10 @@ symbol_file_clear (int from_tty)
@@ -1161,6 +1166,10 @@ symbol_file_clear (int from_tty)
symfile_objfile->name)
: !query (_("Discard symbol table? "))))
error (_("Not confirmed."));
@ -1395,7 +1417,7 @@ Index: gdb-6.8.50.20081209/gdb/symfile.c
free_all_objfiles ();
/* solib descriptors may have handles to objfiles. Since their
@@ -3259,6 +3268,8 @@ reread_symbols (void)
@@ -3260,6 +3269,8 @@ reread_symbols (void)
/* Discard cleanups as symbol reading was successful. */
discard_cleanups (old_cleanups);
@ -1404,7 +1426,7 @@ Index: gdb-6.8.50.20081209/gdb/symfile.c
/* If the mtime has changed between the time we set new_modtime
and now, we *want* this to be out of date, so don't call stat
again now. */
@@ -3628,6 +3639,7 @@ clear_symtab_users (void)
@@ -3629,6 +3640,7 @@ clear_symtab_users (void)
breakpoint_re_set ();
set_default_breakpoint (0, 0, 0, 0);
clear_pc_function_cache ();
@ -1412,11 +1434,11 @@ Index: gdb-6.8.50.20081209/gdb/symfile.c
observer_notify_new_objfile (NULL);
/* Clear globals which might have pointed into a removed objfile.
Index: gdb-6.8.50.20081209/gdb/varobj.c
Index: gdb-6.8.50.20090209/gdb/varobj.c
===================================================================
--- gdb-6.8.50.20081209.orig/gdb/varobj.c 2008-12-14 14:55:58.000000000 +0100
+++ gdb-6.8.50.20081209/gdb/varobj.c 2008-12-14 14:56:49.000000000 +0100
@@ -1116,6 +1116,62 @@ install_new_value (struct varobj *var, s
--- gdb-6.8.50.20090209.orig/gdb/varobj.c 2009-02-05 18:28:21.000000000 +0100
+++ gdb-6.8.50.20090209/gdb/varobj.c 2009-02-09 16:21:55.000000000 +0100
@@ -1123,6 +1123,62 @@ install_new_value (struct varobj *var, s
return changed;
}
@ -1479,10 +1501,10 @@ Index: gdb-6.8.50.20081209/gdb/varobj.c
/* Update the values for a variable and its children. This is a
two-pronged attack. First, re-parse the value for the root's
expression to see if it's changed. Then go all the way
Index: gdb-6.8.50.20081209/gdb/varobj.h
Index: gdb-6.8.50.20090209/gdb/varobj.h
===================================================================
--- gdb-6.8.50.20081209.orig/gdb/varobj.h 2008-12-14 14:55:58.000000000 +0100
+++ gdb-6.8.50.20081209/gdb/varobj.h 2008-12-14 14:56:49.000000000 +0100
--- gdb-6.8.50.20090209.orig/gdb/varobj.h 2009-01-03 06:57:54.000000000 +0100
+++ gdb-6.8.50.20090209/gdb/varobj.h 2009-02-09 16:21:55.000000000 +0100
@@ -141,4 +141,6 @@ extern int varobj_editable_p (struct var
extern int varobj_floating_p (struct varobj *var);
@ -1490,10 +1512,10 @@ Index: gdb-6.8.50.20081209/gdb/varobj.h
+extern void varobj_refresh(void);
+
#endif /* VAROBJ_H */
Index: gdb-6.8.50.20081209/gdb/target.h
Index: gdb-6.8.50.20090209/gdb/target.h
===================================================================
--- gdb-6.8.50.20081209.orig/gdb/target.h 2008-12-14 11:52:54.000000000 +0100
+++ gdb-6.8.50.20081209/gdb/target.h 2008-12-14 14:57:21.000000000 +0100
--- gdb-6.8.50.20090209.orig/gdb/target.h 2009-02-09 16:02:42.000000000 +0100
+++ gdb-6.8.50.20090209/gdb/target.h 2009-02-09 16:21:55.000000000 +0100
@@ -524,7 +524,7 @@ struct target_ops
Return -1 if there is insufficient buffer for a whole entry.
Return 1 if an entry was read into *TYPEP and *VALP. */