2007-11-03 19:10:29 +00:00
|
|
|
|
2007-11-02 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
Port to GDB-6.7.1.
|
|
|
|
|
|
|
|
|
|
2007-11-02 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
Port to post-GDB-6.7.1 multi-PC breakpoints.
|
|
|
|
|
|
2007-11-16 02:15:40 +00:00
|
|
|
|
2007-11-09 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
* solib-svr4.c (svr4_current_sos): Fix segfault on NULL EXEC_BFD.
|
|
|
|
|
|
2008-03-03 16:13:47 +00:00
|
|
|
|
2008-02-24 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
Port to GDB-6.8pre.
|
|
|
|
|
|
|
|
|
|
2008-02-27 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
Port to gdb-6.7.50.20080227.
|
|
|
|
|
|
2008-06-01 13:14:20 +00:00
|
|
|
|
2008-06-01 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
Fix crash on a watchpoint update on an inferior stop.
|
|
|
|
|
|
2008-09-02 00:55:43 +00:00
|
|
|
|
2008-09-01 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
Fix scan_dyntag() for binaries provided by valgrind (BZ 460319).
|
|
|
|
|
|
2009-08-10 13:22:51 +00:00
|
|
|
|
Index: gdb-6.8.50.20090809/gdb/amd64-tdep.c
|
2008-12-14 14:05:20 +00:00
|
|
|
|
===================================================================
|
2009-08-10 13:22:51 +00:00
|
|
|
|
--- gdb-6.8.50.20090809.orig/gdb/amd64-tdep.c 2009-08-10 00:50:30.000000000 +0200
|
|
|
|
|
+++ gdb-6.8.50.20090809/gdb/amd64-tdep.c 2009-08-10 14:59:58.000000000 +0200
|
2009-02-11 00:04:48 +00:00
|
|
|
|
@@ -36,6 +36,7 @@
|
2008-12-14 14:05:20 +00:00
|
|
|
|
#include "regcache.h"
|
|
|
|
|
#include "regset.h"
|
2008-09-02 00:55:43 +00:00
|
|
|
|
#include "symfile.h"
|
|
|
|
|
+#include "exceptions.h"
|
2005-01-11 00:15:58 +00:00
|
|
|
|
|
2008-12-14 14:05:20 +00:00
|
|
|
|
#include "gdb_assert.h"
|
|
|
|
|
|
2009-08-04 05:37:29 +00:00
|
|
|
|
@@ -1591,18 +1592,31 @@ amd64_analyze_stack_align (CORE_ADDR pc,
|
2008-09-02 00:55:43 +00:00
|
|
|
|
Any function that doesn't start with this sequence will be assumed
|
|
|
|
|
to have no prologue and thus no valid frame pointer in %rbp. */
|
|
|
|
|
|
|
|
|
|
-static CORE_ADDR
|
2009-08-04 05:37:29 +00:00
|
|
|
|
-amd64_analyze_prologue (struct gdbarch *gdbarch,
|
|
|
|
|
- CORE_ADDR pc, CORE_ADDR current_pc,
|
2008-09-02 00:55:43 +00:00
|
|
|
|
- struct amd64_frame_cache *cache)
|
|
|
|
|
+struct amd64_analyze_prologue_data
|
|
|
|
|
+ {
|
2009-08-04 05:37:29 +00:00
|
|
|
|
+ struct gdbarch *gdbarch;
|
2008-09-02 00:55:43 +00:00
|
|
|
|
+ CORE_ADDR pc, current_pc;
|
|
|
|
|
+ struct amd64_frame_cache *cache;
|
|
|
|
|
+ CORE_ADDR retval;
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+static int
|
|
|
|
|
+amd64_analyze_prologue_1 (void *data_pointer)
|
|
|
|
|
{
|
|
|
|
|
+ struct amd64_analyze_prologue_data *data = data_pointer;
|
2009-08-04 05:37:29 +00:00
|
|
|
|
+ struct gdbarch *gdbarch = data->gdbarch;
|
2008-09-02 00:55:43 +00:00
|
|
|
|
+ CORE_ADDR pc = data->pc, current_pc = data->current_pc;
|
|
|
|
|
+ struct amd64_frame_cache *cache = data->cache;
|
2009-08-04 05:37:29 +00:00
|
|
|
|
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
|
2008-09-02 00:55:43 +00:00
|
|
|
|
static gdb_byte proto[3] = { 0x48, 0x89, 0xe5 }; /* movq %rsp, %rbp */
|
|
|
|
|
gdb_byte buf[3];
|
|
|
|
|
gdb_byte op;
|
|
|
|
|
|
|
|
|
|
if (current_pc <= pc)
|
|
|
|
|
- return current_pc;
|
|
|
|
|
+ {
|
|
|
|
|
+ data->retval = current_pc;
|
|
|
|
|
+ return 1;
|
|
|
|
|
+ }
|
|
|
|
|
|
2008-12-14 14:05:20 +00:00
|
|
|
|
pc = amd64_analyze_stack_align (pc, current_pc, cache);
|
2008-09-02 00:55:43 +00:00
|
|
|
|
|
2009-08-04 05:37:29 +00:00
|
|
|
|
@@ -1617,18 +1631,59 @@ amd64_analyze_prologue (struct gdbarch *
|
2008-09-02 00:55:43 +00:00
|
|
|
|
|
|
|
|
|
/* If that's all, return now. */
|
|
|
|
|
if (current_pc <= pc + 1)
|
|
|
|
|
- return current_pc;
|
|
|
|
|
+ {
|
|
|
|
|
+ data->retval = current_pc;
|
|
|
|
|
+ return 1;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
/* Check for `movq %rsp, %rbp'. */
|
|
|
|
|
read_memory (pc + 1, buf, 3);
|
|
|
|
|
if (memcmp (buf, proto, 3) != 0)
|
|
|
|
|
- return pc + 1;
|
|
|
|
|
+ {
|
|
|
|
|
+ data->retval = pc + 1;
|
|
|
|
|
+ return 1;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
/* OK, we actually have a frame. */
|
|
|
|
|
cache->frameless_p = 0;
|
|
|
|
|
- return pc + 4;
|
|
|
|
|
+ data->retval = pc + 4;
|
|
|
|
|
+ return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
+ data->retval = pc;
|
|
|
|
|
+ return 1;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+/* Catch memory read errors and return just PC in such case.
|
|
|
|
|
+ It occurs very early on enable_break->new_symfile_objfile->
|
|
|
|
|
+ ->breakpoint_re_set->decode_line_1->decode_variable_1->
|
|
|
|
|
+ ->find_function_start_sal */
|
|
|
|
|
+
|
|
|
|
|
+static CORE_ADDR
|
2009-08-04 05:37:29 +00:00
|
|
|
|
+amd64_analyze_prologue (struct gdbarch *gdbarch,
|
|
|
|
|
+ CORE_ADDR pc, CORE_ADDR current_pc,
|
2008-09-02 00:55:43 +00:00
|
|
|
|
+ struct amd64_frame_cache *cache)
|
|
|
|
|
+{
|
|
|
|
|
+ int status;
|
|
|
|
|
+ struct amd64_analyze_prologue_data data;
|
|
|
|
|
+ struct ui_file *saved_gdb_stderr;
|
|
|
|
|
+
|
|
|
|
|
+ /* Suppress error messages. */
|
|
|
|
|
+ saved_gdb_stderr = gdb_stderr;
|
|
|
|
|
+ gdb_stderr = ui_file_new ();
|
|
|
|
|
+
|
2009-08-04 05:37:29 +00:00
|
|
|
|
+ data.gdbarch = gdbarch;
|
2008-09-02 00:55:43 +00:00
|
|
|
|
+ data.pc = pc;
|
|
|
|
|
+ data.current_pc = current_pc;
|
|
|
|
|
+ data.cache = cache;
|
|
|
|
|
+ status = catch_errors (amd64_analyze_prologue_1, &data, "", RETURN_MASK_ALL);
|
|
|
|
|
+
|
|
|
|
|
+ /* Stop suppressing error messages. */
|
|
|
|
|
+ ui_file_delete (gdb_stderr);
|
|
|
|
|
+ gdb_stderr = saved_gdb_stderr;
|
|
|
|
|
+
|
|
|
|
|
+ if (status)
|
|
|
|
|
+ return data.retval;
|
|
|
|
|
return pc;
|
|
|
|
|
}
|
|
|
|
|
|
2009-08-10 13:22:51 +00:00
|
|
|
|
Index: gdb-6.8.50.20090809/gdb/auxv.c
|
2008-12-14 14:05:20 +00:00
|
|
|
|
===================================================================
|
2009-08-10 13:22:51 +00:00
|
|
|
|
--- gdb-6.8.50.20090809.orig/gdb/auxv.c 2009-07-02 19:25:52.000000000 +0200
|
|
|
|
|
+++ gdb-6.8.50.20090809/gdb/auxv.c 2009-08-10 14:59:58.000000000 +0200
|
2009-08-04 05:37:29 +00:00
|
|
|
|
@@ -78,7 +78,7 @@ procfs_xfer_auxv (struct target_ops *ops
|
2005-01-11 00:15:58 +00:00
|
|
|
|
Return 1 if an entry was read into *TYPEP and *VALP. */
|
2009-03-02 00:11:35 +00:00
|
|
|
|
static int
|
2008-12-14 14:05:20 +00:00
|
|
|
|
default_auxv_parse (struct target_ops *ops, gdb_byte **readptr,
|
2006-07-11 06:33:02 +00:00
|
|
|
|
- gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp)
|
|
|
|
|
+ gdb_byte *endptr, ULONGEST *typep, CORE_ADDR *valp)
|
2005-01-11 00:15:58 +00:00
|
|
|
|
{
|
2008-12-14 14:05:20 +00:00
|
|
|
|
const int sizeof_auxv_field = gdbarch_ptr_bit (target_gdbarch)
|
|
|
|
|
/ TARGET_CHAR_BIT;
|
2009-08-04 05:37:29 +00:00
|
|
|
|
@@ -106,7 +106,7 @@ default_auxv_parse (struct target_ops *o
|
2008-12-14 14:05:20 +00:00
|
|
|
|
Return 1 if an entry was read into *TYPEP and *VALP. */
|
|
|
|
|
int
|
|
|
|
|
target_auxv_parse (struct target_ops *ops, gdb_byte **readptr,
|
|
|
|
|
- gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp)
|
|
|
|
|
+ gdb_byte *endptr, ULONGEST *typep, CORE_ADDR *valp)
|
|
|
|
|
{
|
|
|
|
|
struct target_ops *t;
|
|
|
|
|
for (t = ops; t != NULL; t = t->beneath)
|
2009-08-04 05:37:29 +00:00
|
|
|
|
@@ -121,9 +121,10 @@ target_auxv_parse (struct target_ops *op
|
2005-01-11 00:15:58 +00:00
|
|
|
|
an error getting the information. On success, return 1 after
|
|
|
|
|
storing the entry's value field in *VALP. */
|
|
|
|
|
int
|
|
|
|
|
-target_auxv_search (struct target_ops *ops, CORE_ADDR match, CORE_ADDR *valp)
|
|
|
|
|
+target_auxv_search (struct target_ops *ops, ULONGEST match, CORE_ADDR *valp)
|
|
|
|
|
{
|
|
|
|
|
- CORE_ADDR type, val;
|
|
|
|
|
+ CORE_ADDR val;
|
|
|
|
|
+ ULONGEST at_type;
|
2006-07-11 06:33:02 +00:00
|
|
|
|
gdb_byte *data;
|
2007-01-21 01:53:01 +00:00
|
|
|
|
LONGEST n = target_read_alloc (ops, TARGET_OBJECT_AUXV, NULL, &data);
|
2006-07-11 06:33:02 +00:00
|
|
|
|
gdb_byte *ptr = data;
|
2009-08-04 05:37:29 +00:00
|
|
|
|
@@ -133,10 +134,10 @@ target_auxv_search (struct target_ops *o
|
2005-01-11 00:15:58 +00:00
|
|
|
|
return n;
|
|
|
|
|
|
|
|
|
|
while (1)
|
|
|
|
|
- switch (target_auxv_parse (ops, &ptr, data + n, &type, &val))
|
|
|
|
|
+ switch (target_auxv_parse (ops, &ptr, data + n, &at_type, &val))
|
|
|
|
|
{
|
|
|
|
|
case 1: /* Here's an entry, check it. */
|
|
|
|
|
- if (type == match)
|
|
|
|
|
+ if (at_type == match)
|
|
|
|
|
{
|
|
|
|
|
xfree (data);
|
|
|
|
|
*valp = val;
|
2009-08-04 05:37:29 +00:00
|
|
|
|
@@ -159,7 +160,8 @@ target_auxv_search (struct target_ops *o
|
2005-01-11 00:15:58 +00:00
|
|
|
|
int
|
|
|
|
|
fprint_target_auxv (struct ui_file *file, struct target_ops *ops)
|
|
|
|
|
{
|
|
|
|
|
- CORE_ADDR type, val;
|
|
|
|
|
+ CORE_ADDR val;
|
|
|
|
|
+ ULONGEST at_type;
|
2006-07-11 06:33:02 +00:00
|
|
|
|
gdb_byte *data;
|
2007-01-21 01:53:01 +00:00
|
|
|
|
LONGEST len = target_read_alloc (ops, TARGET_OBJECT_AUXV, NULL,
|
|
|
|
|
&data);
|
2009-08-04 05:37:29 +00:00
|
|
|
|
@@ -169,13 +171,13 @@ fprint_target_auxv (struct ui_file *file
|
2005-01-11 00:15:58 +00:00
|
|
|
|
if (len <= 0)
|
|
|
|
|
return len;
|
|
|
|
|
|
|
|
|
|
- while (target_auxv_parse (ops, &ptr, data + len, &type, &val) > 0)
|
|
|
|
|
+ while (target_auxv_parse (ops, &ptr, data + len, &at_type, &val) > 0)
|
|
|
|
|
{
|
|
|
|
|
const char *name = "???";
|
|
|
|
|
const char *description = "";
|
|
|
|
|
enum { dec, hex, str } flavor = hex;
|
|
|
|
|
|
|
|
|
|
- switch (type)
|
|
|
|
|
+ switch (at_type)
|
|
|
|
|
{
|
|
|
|
|
#define TAG(tag, text, kind) \
|
|
|
|
|
case tag: name = #tag; description = text; flavor = kind; break
|
2009-08-04 05:37:29 +00:00
|
|
|
|
@@ -231,7 +233,7 @@ fprint_target_auxv (struct ui_file *file
|
2005-01-11 00:15:58 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fprintf_filtered (file, "%-4s %-20s %-30s ",
|
2008-12-14 14:05:20 +00:00
|
|
|
|
- plongest (type), name, description);
|
|
|
|
|
+ plongest (at_type), name, description);
|
2005-01-11 00:15:58 +00:00
|
|
|
|
switch (flavor)
|
|
|
|
|
{
|
|
|
|
|
case dec:
|
2009-08-04 05:37:29 +00:00
|
|
|
|
@@ -253,7 +255,7 @@ fprint_target_auxv (struct ui_file *file
|
2008-12-14 14:05:20 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
++ents;
|
|
|
|
|
- if (type == AT_NULL)
|
|
|
|
|
+ if (at_type == AT_NULL)
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
2009-08-10 13:22:51 +00:00
|
|
|
|
Index: gdb-6.8.50.20090809/gdb/auxv.h
|
2008-12-14 14:05:20 +00:00
|
|
|
|
===================================================================
|
2009-08-10 13:22:51 +00:00
|
|
|
|
--- gdb-6.8.50.20090809.orig/gdb/auxv.h 2009-06-07 21:07:08.000000000 +0200
|
|
|
|
|
+++ gdb-6.8.50.20090809/gdb/auxv.h 2009-08-10 14:59:58.000000000 +0200
|
2009-08-04 05:37:29 +00:00
|
|
|
|
@@ -31,14 +31,14 @@
|
2005-01-11 00:15:58 +00:00
|
|
|
|
Return 1 if an entry was read into *TYPEP and *VALP. */
|
|
|
|
|
extern int target_auxv_parse (struct target_ops *ops,
|
2006-07-11 06:33:02 +00:00
|
|
|
|
gdb_byte **readptr, gdb_byte *endptr,
|
2005-01-11 00:15:58 +00:00
|
|
|
|
- CORE_ADDR *typep, CORE_ADDR *valp);
|
|
|
|
|
+ ULONGEST *typep, CORE_ADDR *valp);
|
|
|
|
|
|
|
|
|
|
/* Extract the auxiliary vector entry with a_type matching MATCH.
|
|
|
|
|
Return zero if no such entry was found, or -1 if there was
|
|
|
|
|
an error getting the information. On success, return 1 after
|
|
|
|
|
storing the entry's value field in *VALP. */
|
|
|
|
|
extern int target_auxv_search (struct target_ops *ops,
|
|
|
|
|
- CORE_ADDR match, CORE_ADDR *valp);
|
|
|
|
|
+ ULONGEST match, CORE_ADDR *valp);
|
|
|
|
|
|
|
|
|
|
/* 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);
|
2009-08-10 13:22:51 +00:00
|
|
|
|
Index: gdb-6.8.50.20090809/gdb/dwarf2read.c
|
2008-12-14 14:05:20 +00:00
|
|
|
|
===================================================================
|
2009-08-10 13:22:51 +00:00
|
|
|
|
--- gdb-6.8.50.20090809.orig/gdb/dwarf2read.c 2009-08-10 14:59:28.000000000 +0200
|
|
|
|
|
+++ gdb-6.8.50.20090809/gdb/dwarf2read.c 2009-08-10 14:59:58.000000000 +0200
|
2009-08-04 05:37:29 +00:00
|
|
|
|
@@ -1659,7 +1659,7 @@ dwarf2_build_psymtabs (struct objfile *o
|
|
|
|
|
dwarf2_read_section (objfile, &dwarf2_per_objfile->eh_frame);
|
|
|
|
|
dwarf2_read_section (objfile, &dwarf2_per_objfile->frame);
|
2005-01-11 00:15:58 +00:00
|
|
|
|
|
2008-09-02 00:55:43 +00:00
|
|
|
|
- if (mainline
|
|
|
|
|
+ if ((mainline == 1)
|
|
|
|
|
|| (objfile->global_psymbols.size == 0
|
|
|
|
|
&& objfile->static_psymbols.size == 0))
|
|
|
|
|
{
|
2009-08-10 13:22:51 +00:00
|
|
|
|
Index: gdb-6.8.50.20090809/gdb/elfread.c
|
2008-12-14 14:05:20 +00:00
|
|
|
|
===================================================================
|
2009-08-10 13:22:51 +00:00
|
|
|
|
--- gdb-6.8.50.20090809.orig/gdb/elfread.c 2009-08-10 00:50:30.000000000 +0200
|
|
|
|
|
+++ gdb-6.8.50.20090809/gdb/elfread.c 2009-08-10 14:59:58.000000000 +0200
|
2009-08-04 05:37:29 +00:00
|
|
|
|
@@ -681,7 +681,7 @@ elf_symfile_read (struct objfile *objfil
|
2008-09-02 00:55:43 +00:00
|
|
|
|
/* If we are reinitializing, or if we have never loaded syms yet,
|
|
|
|
|
set table to empty. MAINLINE is cleared so that *_read_psymtab
|
|
|
|
|
functions do not all also re-initialize the psymbol table. */
|
|
|
|
|
- if (mainline)
|
|
|
|
|
+ if (mainline == 1)
|
|
|
|
|
{
|
|
|
|
|
init_psymbol_list (objfile, 0);
|
|
|
|
|
mainline = 0;
|
2009-08-10 13:22:51 +00:00
|
|
|
|
Index: gdb-6.8.50.20090809/gdb/infrun.c
|
2008-12-14 14:05:20 +00:00
|
|
|
|
===================================================================
|
2009-08-10 13:22:51 +00:00
|
|
|
|
--- gdb-6.8.50.20090809.orig/gdb/infrun.c 2009-08-10 00:50:30.000000000 +0200
|
|
|
|
|
+++ gdb-6.8.50.20090809/gdb/infrun.c 2009-08-10 14:59:58.000000000 +0200
|
2009-08-04 05:37:29 +00:00
|
|
|
|
@@ -3531,6 +3531,10 @@ infrun: BPSTAT_WHAT_SET_LONGJMP_RESUME (
|
2007-11-03 19:10:29 +00:00
|
|
|
|
#endif
|
|
|
|
|
target_terminal_inferior ();
|
2005-01-11 00:15:58 +00:00
|
|
|
|
|
|
|
|
|
+ /* For PIE executables, we dont really know where the
|
2009-08-04 05:37:29 +00:00
|
|
|
|
+ breakpoints are going to be until we start up the inferior. */
|
|
|
|
|
+ enable_breakpoints_after_startup ();
|
2005-01-11 00:15:58 +00:00
|
|
|
|
+
|
|
|
|
|
/* 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
|
2009-08-10 13:22:51 +00:00
|
|
|
|
Index: gdb-6.8.50.20090809/gdb/objfiles.c
|
2008-12-14 14:05:20 +00:00
|
|
|
|
===================================================================
|
2009-08-10 13:22:51 +00:00
|
|
|
|
--- gdb-6.8.50.20090809.orig/gdb/objfiles.c 2009-08-10 00:50:30.000000000 +0200
|
|
|
|
|
+++ gdb-6.8.50.20090809/gdb/objfiles.c 2009-08-10 14:59:58.000000000 +0200
|
2009-06-10 13:05:57 +00:00
|
|
|
|
@@ -52,6 +52,9 @@
|
2008-12-14 14:05:20 +00:00
|
|
|
|
#include "exec.h"
|
2009-08-04 05:37:29 +00:00
|
|
|
|
#include "observer.h"
|
2005-01-11 00:15:58 +00:00
|
|
|
|
|
2006-07-11 06:33:02 +00:00
|
|
|
|
+#include "auxv.h"
|
2005-01-11 00:15:58 +00:00
|
|
|
|
+#include "elf/common.h"
|
|
|
|
|
+
|
|
|
|
|
/* Prototypes for local functions */
|
|
|
|
|
|
|
|
|
|
static void objfile_alloc_data (struct objfile *objfile);
|
2009-08-04 05:37:29 +00:00
|
|
|
|
@@ -279,9 +282,17 @@ init_entry_point_info (struct objfile *o
|
2005-01-11 00:15:58 +00:00
|
|
|
|
CORE_ADDR
|
|
|
|
|
entry_point_address (void)
|
|
|
|
|
{
|
|
|
|
|
+ int ret;
|
|
|
|
|
+
|
2009-08-04 05:37:29 +00:00
|
|
|
|
struct gdbarch *gdbarch;
|
|
|
|
|
CORE_ADDR entry_point;
|
|
|
|
|
|
2005-01-11 00:15:58 +00:00
|
|
|
|
+ /* Find the address of the entry point of the program from the
|
|
|
|
|
+ auxv vector. */
|
2009-08-04 05:37:29 +00:00
|
|
|
|
+ ret = target_auxv_search (¤t_target, AT_ENTRY, &entry_point);
|
2005-01-11 00:15:58 +00:00
|
|
|
|
+ if (ret == 1)
|
2009-08-04 05:37:29 +00:00
|
|
|
|
+ return entry_point;
|
|
|
|
|
+
|
|
|
|
|
if (symfile_objfile == NULL)
|
|
|
|
|
return 0;
|
2005-01-11 00:15:58 +00:00
|
|
|
|
|
2009-08-10 13:22:51 +00:00
|
|
|
|
@@ -465,6 +476,9 @@ free_objfile (struct objfile *objfile)
|
2009-08-04 05:37:29 +00:00
|
|
|
|
if (objfile == symfile_objfile)
|
|
|
|
|
symfile_objfile = NULL;
|
2009-02-11 00:04:48 +00:00
|
|
|
|
|
|
|
|
|
+ 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
|
2009-08-10 13:22:51 +00:00
|
|
|
|
Index: gdb-6.8.50.20090809/gdb/solib-svr4.c
|
2008-12-14 14:05:20 +00:00
|
|
|
|
===================================================================
|
2009-08-10 13:22:51 +00:00
|
|
|
|
--- gdb-6.8.50.20090809.orig/gdb/solib-svr4.c 2009-08-10 14:56:11.000000000 +0200
|
|
|
|
|
+++ gdb-6.8.50.20090809/gdb/solib-svr4.c 2009-08-10 14:59:58.000000000 +0200
|
2009-08-04 05:37:29 +00:00
|
|
|
|
@@ -47,6 +47,7 @@
|
2008-12-14 14:05:20 +00:00
|
|
|
|
#include "exec.h"
|
|
|
|
|
#include "auxv.h"
|
|
|
|
|
#include "exceptions.h"
|
2005-01-11 00:15:58 +00:00
|
|
|
|
+#include "command.h"
|
|
|
|
|
|
2008-12-14 14:05:20 +00:00
|
|
|
|
static struct link_map_offsets *svr4_fetch_link_map_offsets (void);
|
|
|
|
|
static int svr4_have_link_map_offsets (void);
|
2009-08-04 05:37:29 +00:00
|
|
|
|
@@ -359,7 +360,9 @@ solib_svr4_inferior_exit (int pid)
|
2005-01-11 00:15:58 +00:00
|
|
|
|
|
|
|
|
|
/* Local function prototypes */
|
|
|
|
|
|
|
|
|
|
+#if 0
|
|
|
|
|
static int match_main (char *);
|
|
|
|
|
+#endif
|
|
|
|
|
|
2007-11-01 20:24:20 +00:00
|
|
|
|
static CORE_ADDR bfd_lookup_symbol (bfd *, char *);
|
2005-01-11 00:15:58 +00:00
|
|
|
|
|
2009-08-04 05:37:29 +00:00
|
|
|
|
@@ -600,10 +603,12 @@ scan_dyntag (int dyntag, bfd *abfd, CORE
|
2007-11-01 20:24:20 +00:00
|
|
|
|
int arch_size, step, sect_size;
|
|
|
|
|
long dyn_tag;
|
|
|
|
|
CORE_ADDR dyn_ptr, dyn_addr;
|
2008-09-02 00:55:43 +00:00
|
|
|
|
+ CORE_ADDR reloc_addr = 0;
|
2007-11-01 20:24:20 +00:00
|
|
|
|
gdb_byte *bufend, *bufstart, *buf;
|
|
|
|
|
Elf32_External_Dyn *x_dynp_32;
|
|
|
|
|
Elf64_External_Dyn *x_dynp_64;
|
|
|
|
|
struct bfd_section *sect;
|
2005-01-11 00:15:58 +00:00
|
|
|
|
+ int ret;
|
2007-11-01 20:24:20 +00:00
|
|
|
|
|
|
|
|
|
if (abfd == NULL)
|
|
|
|
|
return 0;
|
2009-08-04 05:37:29 +00:00
|
|
|
|
@@ -615,19 +620,81 @@ scan_dyntag (int dyntag, bfd *abfd, CORE
|
2007-11-01 20:24:20 +00:00
|
|
|
|
if (arch_size == -1)
|
2009-08-04 05:37:29 +00:00
|
|
|
|
return 0;
|
2007-11-01 20:24:20 +00:00
|
|
|
|
|
|
|
|
|
+ /* The auxv vector based relocatable files reading is limited to the main
|
|
|
|
|
+ executable. */
|
|
|
|
|
+ gdb_assert (abfd == exec_bfd || ptr == NULL);
|
2005-01-11 00:15:58 +00:00
|
|
|
|
+
|
2007-11-01 20:24:20 +00:00
|
|
|
|
+ if (ptr != NULL)
|
2005-01-11 00:15:58 +00:00
|
|
|
|
+ {
|
2008-09-02 00:55:43 +00:00
|
|
|
|
+ CORE_ADDR entry_addr;
|
|
|
|
|
+
|
2007-11-01 20:24:20 +00:00
|
|
|
|
+ /* Find the address of the entry point of the program from the
|
|
|
|
|
+ auxv vector. */
|
|
|
|
|
+ ret = target_auxv_search (¤t_target, AT_ENTRY, &entry_addr);
|
2005-01-11 00:15:58 +00:00
|
|
|
|
+
|
2007-11-01 20:24:20 +00:00
|
|
|
|
+ if (ret == 0 || ret == -1)
|
|
|
|
|
+ {
|
|
|
|
|
+ /* No auxv info, maybe an older kernel. Fake our way through. */
|
|
|
|
|
+ entry_addr = bfd_get_start_address (exec_bfd);
|
|
|
|
|
+
|
|
|
|
|
+ if (debug_solib)
|
|
|
|
|
+ fprintf_unfiltered (gdb_stdlog,
|
2009-08-04 05:37:29 +00:00
|
|
|
|
+ "elf_locate_base: program entry address not found. Using bfd's %s for %s\n",
|
|
|
|
|
+ paddress (target_gdbarch, entry_addr), exec_bfd->filename);
|
2007-11-01 20:24:20 +00:00
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ if (debug_solib)
|
|
|
|
|
+ fprintf_unfiltered (gdb_stdlog,
|
2009-08-04 05:37:29 +00:00
|
|
|
|
+ "elf_locate_base: found program entry address %s for %s\n",
|
|
|
|
|
+ paddress (target_gdbarch, entry_addr), exec_bfd->filename);
|
2007-11-01 20:24:20 +00:00
|
|
|
|
+ }
|
2008-09-02 00:55:43 +00:00
|
|
|
|
+ reloc_addr = entry_addr - bfd_get_start_address (exec_bfd);
|
|
|
|
|
+ if (debug_solib)
|
|
|
|
|
+ fprintf_unfiltered (gdb_stdlog,
|
2009-08-04 05:37:29 +00:00
|
|
|
|
+ "elf_locate_base: expected relocation offset %s for %s\n",
|
|
|
|
|
+ paddress (target_gdbarch, reloc_addr), exec_bfd->filename);
|
2005-01-11 00:15:58 +00:00
|
|
|
|
+ }
|
2007-11-01 20:24:20 +00:00
|
|
|
|
+
|
2005-01-11 00:15:58 +00:00
|
|
|
|
/* Find the start address of the .dynamic section. */
|
2007-11-01 20:24:20 +00:00
|
|
|
|
sect = bfd_get_section_by_name (abfd, ".dynamic");
|
|
|
|
|
if (sect == NULL)
|
2005-01-11 00:15:58 +00:00
|
|
|
|
- return 0;
|
|
|
|
|
+ {
|
|
|
|
|
+ if (debug_solib)
|
|
|
|
|
+ fprintf_unfiltered (gdb_stdlog,
|
|
|
|
|
+ "elf_locate_base: .dynamic section not found in %s -- return now\n",
|
|
|
|
|
+ exec_bfd->filename);
|
|
|
|
|
+ return 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ if (debug_solib)
|
|
|
|
|
+ fprintf_unfiltered (gdb_stdlog,
|
|
|
|
|
+ "elf_locate_base: .dynamic section found in %s\n",
|
|
|
|
|
+ exec_bfd->filename);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
2007-11-01 20:24:20 +00:00
|
|
|
|
dyn_addr = bfd_section_vma (abfd, sect);
|
2005-01-11 00:15:58 +00:00
|
|
|
|
+ if (debug_solib)
|
|
|
|
|
+ fprintf_unfiltered (gdb_stdlog,
|
2009-08-04 05:37:29 +00:00
|
|
|
|
+ "elf_locate_base: .dynamic addr %s\n",
|
|
|
|
|
+ paddress (target_gdbarch, dyn_addr));
|
2005-01-11 00:15:58 +00:00
|
|
|
|
|
2007-11-01 20:24:20 +00:00
|
|
|
|
/* Read in .dynamic from the BFD. We will get the actual value
|
|
|
|
|
from memory later. */
|
|
|
|
|
sect_size = bfd_section_size (abfd, sect);
|
|
|
|
|
buf = bufstart = alloca (sect_size);
|
2005-01-11 00:15:58 +00:00
|
|
|
|
+ if (debug_solib)
|
|
|
|
|
+ fprintf_unfiltered (gdb_stdlog,
|
|
|
|
|
+ "elf_locate_base: read in .dynamic section\n");
|
2007-11-01 20:24:20 +00:00
|
|
|
|
if (!bfd_get_section_contents (abfd, sect,
|
|
|
|
|
buf, 0, sect_size))
|
|
|
|
|
- return 0;
|
2005-01-11 00:15:58 +00:00
|
|
|
|
+ {
|
|
|
|
|
+ if (debug_solib)
|
|
|
|
|
+ fprintf_unfiltered (gdb_stdlog,
|
2007-11-01 20:24:20 +00:00
|
|
|
|
+ "elf_locate_base: couldn't read .dynamic section -- return now\n");
|
2005-01-11 00:15:58 +00:00
|
|
|
|
+ return 0;
|
|
|
|
|
+ }
|
|
|
|
|
|
2007-11-01 20:24:20 +00:00
|
|
|
|
/* Iterate over BUF and scan for DYNTAG. If found, set PTR and return. */
|
|
|
|
|
step = (arch_size == 32) ? sizeof (Elf32_External_Dyn)
|
2009-08-04 05:37:29 +00:00
|
|
|
|
@@ -648,26 +715,105 @@ scan_dyntag (int dyntag, bfd *abfd, CORE
|
2008-09-02 00:55:43 +00:00
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
- if (dyn_tag == DT_NULL)
|
|
|
|
|
+
|
|
|
|
|
+ /* Verify RELOC_ADDR makes sense - it does not have to for valgrind which
|
|
|
|
|
+ supplies us a specially crafted executable in /proc/PID/fd/X while
|
|
|
|
|
+ /proc/PID/auxv corresponds to a different executable (.../memcheck). */
|
|
|
|
|
+ if (reloc_addr)
|
|
|
|
|
+ {
|
|
|
|
|
+ gdb_byte tag_buf[8];
|
|
|
|
|
+ CORE_ADDR tag_addr;
|
|
|
|
|
+
|
|
|
|
|
+ tag_addr = dyn_addr + (buf - bufstart) + reloc_addr;
|
|
|
|
|
+ if (target_read_memory (tag_addr, tag_buf, arch_size / 8) == 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (memcmp (tag_buf, buf, arch_size / 8) != 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (debug_solib)
|
|
|
|
|
+ fprintf_unfiltered (gdb_stdlog,
|
|
|
|
|
+ "elf_locate_base: tag at offset 0x%lx does not match,"
|
|
|
|
|
+ " dropping relocation offset %s\n",
|
2009-08-04 05:37:29 +00:00
|
|
|
|
+ (unsigned long) (buf - bufstart), paddress (target_gdbarch, reloc_addr));
|
2008-09-02 00:55:43 +00:00
|
|
|
|
+ reloc_addr = 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ if (debug_solib)
|
|
|
|
|
+ fprintf_unfiltered (gdb_stdlog,
|
|
|
|
|
+ "elf_locate_base: tag at offset 0x%lx is not readable,"
|
|
|
|
|
+ " dropping relocation offset %s\n",
|
2009-08-04 05:37:29 +00:00
|
|
|
|
+ (unsigned long) (buf - bufstart), paddress (target_gdbarch, reloc_addr));
|
2008-09-02 00:55:43 +00:00
|
|
|
|
+ reloc_addr = 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (dyn_tag == DT_NULL)
|
|
|
|
|
return 0;
|
|
|
|
|
- if (dyn_tag == dyntag)
|
|
|
|
|
- {
|
|
|
|
|
- /* If requested, try to read the runtime value of this .dynamic
|
|
|
|
|
- entry. */
|
|
|
|
|
- if (ptr)
|
|
|
|
|
- {
|
2008-12-14 14:05:20 +00:00
|
|
|
|
- struct type *ptr_type;
|
2008-09-02 00:55:43 +00:00
|
|
|
|
- gdb_byte ptr_buf[8];
|
|
|
|
|
- CORE_ADDR ptr_addr;
|
|
|
|
|
-
|
2008-12-14 14:05:20 +00:00
|
|
|
|
- ptr_type = builtin_type (target_gdbarch)->builtin_data_ptr;
|
2008-09-02 00:55:43 +00:00
|
|
|
|
- ptr_addr = dyn_addr + (buf - bufstart) + arch_size / 8;
|
|
|
|
|
- if (target_read_memory (ptr_addr, ptr_buf, arch_size / 8) == 0)
|
2008-12-14 14:05:20 +00:00
|
|
|
|
- dyn_ptr = extract_typed_address (ptr_buf, ptr_type);
|
2008-09-02 00:55:43 +00:00
|
|
|
|
- *ptr = dyn_ptr;
|
|
|
|
|
- }
|
|
|
|
|
- return 1;
|
|
|
|
|
- }
|
|
|
|
|
+ if (dyn_tag == dyntag)
|
|
|
|
|
+ {
|
|
|
|
|
+ /* If requested, try to read the runtime value of this .dynamic
|
|
|
|
|
+ entry. */
|
|
|
|
|
+ if (ptr)
|
|
|
|
|
+ {
|
|
|
|
|
+ gdb_byte ptr_buf[8];
|
|
|
|
|
+ CORE_ADDR ptr_addr;
|
|
|
|
|
+ int got;
|
|
|
|
|
+
|
|
|
|
|
+ ptr_addr = dyn_addr + (buf - bufstart) + arch_size / 8;
|
|
|
|
|
+ if (ptr != NULL)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (debug_solib)
|
|
|
|
|
+ fprintf_unfiltered (gdb_stdlog,
|
2009-08-04 05:37:29 +00:00
|
|
|
|
+ "elf_locate_base: unrelocated ptr addr %s\n",
|
|
|
|
|
+ paddress (target_gdbarch, ptr_addr));
|
2008-09-02 00:55:43 +00:00
|
|
|
|
+ ptr_addr += reloc_addr;
|
|
|
|
|
+ if (debug_solib)
|
|
|
|
|
+ fprintf_unfiltered (gdb_stdlog,
|
2009-08-04 05:37:29 +00:00
|
|
|
|
+ "elf_locate_base: relocated ptr addr %s"
|
2008-09-02 00:55:43 +00:00
|
|
|
|
+ " (relocation offset %s) for %s\n",
|
2009-08-04 05:37:29 +00:00
|
|
|
|
+ paddress (target_gdbarch, ptr_addr), paddress (target_gdbarch, reloc_addr),
|
2008-09-02 00:55:43 +00:00
|
|
|
|
+ exec_bfd->filename);
|
|
|
|
|
+ }
|
|
|
|
|
+ got = target_read_memory (ptr_addr, ptr_buf, arch_size / 8);
|
|
|
|
|
+ if (got != 0 && reloc_addr)
|
|
|
|
|
+ {
|
|
|
|
|
+ ptr_addr -= reloc_addr;
|
|
|
|
|
+ if (debug_solib)
|
|
|
|
|
+ fprintf_unfiltered (gdb_stdlog,
|
2009-08-04 05:37:29 +00:00
|
|
|
|
+ "elf_locate_base: unrelocated back to ptr addr %s"
|
2008-09-02 00:55:43 +00:00
|
|
|
|
+ " as the memory was unreable for %s\n",
|
2009-08-04 05:37:29 +00:00
|
|
|
|
+ paddress (target_gdbarch, ptr_addr), exec_bfd->filename);
|
2008-09-02 00:55:43 +00:00
|
|
|
|
+ got = target_read_memory (ptr_addr, ptr_buf, arch_size / 8);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (got == 0)
|
|
|
|
|
+ {
|
2008-12-14 14:05:20 +00:00
|
|
|
|
+ struct type *ptr_type;
|
|
|
|
|
+
|
|
|
|
|
+ ptr_type = builtin_type (target_gdbarch)->builtin_data_ptr;
|
|
|
|
|
+ dyn_ptr = extract_typed_address (ptr_buf, ptr_type);
|
2008-09-02 00:55:43 +00:00
|
|
|
|
+ if (ptr != NULL)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (debug_solib)
|
|
|
|
|
+ fprintf_unfiltered (gdb_stdlog,
|
2009-08-04 05:37:29 +00:00
|
|
|
|
+ "elf_locate_base: Tag entry has value %s -- return now\n",
|
|
|
|
|
+ paddress (target_gdbarch, dyn_ptr));
|
2008-09-02 00:55:43 +00:00
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ if (ptr != NULL)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (debug_solib)
|
|
|
|
|
+ fprintf_unfiltered (gdb_stdlog,
|
|
|
|
|
+ "elf_locate_base: Couldn't read tag entry value -- return now\n");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ *ptr = dyn_ptr;
|
|
|
|
|
+ }
|
|
|
|
|
+ return 1;
|
|
|
|
|
+ }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
2009-08-04 05:37:29 +00:00
|
|
|
|
@@ -1040,6 +1186,11 @@ svr4_current_sos (void)
|
2006-07-11 06:33:02 +00:00
|
|
|
|
CORE_ADDR ldsomap = 0;
|
2009-08-04 05:37:29 +00:00
|
|
|
|
struct inferior *inf;
|
|
|
|
|
struct svr4_info *info;
|
2007-11-16 02:15:40 +00:00
|
|
|
|
+ const char *filename = exec_bfd ? exec_bfd->filename : "<none>";
|
2008-03-03 16:13:47 +00:00
|
|
|
|
+
|
2005-01-11 00:15:58 +00:00
|
|
|
|
+ if (debug_solib)
|
|
|
|
|
+ fprintf_unfiltered (gdb_stdlog,
|
2007-11-16 02:15:40 +00:00
|
|
|
|
+ "svr4_current_sos: exec_bfd %s\n", filename);
|
2008-03-03 16:13:47 +00:00
|
|
|
|
|
2009-08-04 05:37:29 +00:00
|
|
|
|
if (ptid_equal (inferior_ptid, null_ptid))
|
|
|
|
|
return NULL;
|
|
|
|
|
@@ -1054,7 +1205,13 @@ svr4_current_sos (void)
|
2008-03-03 16:13:47 +00:00
|
|
|
|
/* If we can't find the dynamic linker's base structure, this
|
|
|
|
|
must not be a dynamically linked executable. Hmm. */
|
2009-08-04 05:37:29 +00:00
|
|
|
|
if (! info->debug_base)
|
2008-03-03 16:13:47 +00:00
|
|
|
|
- return svr4_default_sos ();
|
|
|
|
|
+ {
|
|
|
|
|
+ if (debug_solib)
|
|
|
|
|
+ fprintf_unfiltered (gdb_stdlog,
|
|
|
|
|
+ "svr4_current_sos: no DT_DEBUG found in %s -- return now\n",
|
|
|
|
|
+ filename);
|
|
|
|
|
+ return svr4_default_sos ();
|
|
|
|
|
+ }
|
2005-01-11 00:15:58 +00:00
|
|
|
|
|
|
|
|
|
/* Walk the inferior's link map list, and build our list of
|
|
|
|
|
`struct so_list' nodes. */
|
2009-08-04 05:37:29 +00:00
|
|
|
|
@@ -1074,26 +1231,104 @@ svr4_current_sos (void)
|
2006-07-11 06:33:02 +00:00
|
|
|
|
new->lm_info->lm = xzalloc (lmo->link_map_size);
|
2005-01-11 00:15:58 +00:00
|
|
|
|
make_cleanup (xfree, new->lm_info->lm);
|
|
|
|
|
|
|
|
|
|
+ if (debug_solib)
|
|
|
|
|
+ fprintf_unfiltered (gdb_stdlog,
|
2009-08-04 05:37:29 +00:00
|
|
|
|
+ "svr4_current_sos: read lm at %s\n", paddress (target_gdbarch, lm));
|
2005-01-11 00:15:58 +00:00
|
|
|
|
read_memory (lm, new->lm_info->lm, lmo->link_map_size);
|
|
|
|
|
|
|
|
|
|
lm = LM_NEXT (new);
|
|
|
|
|
|
|
|
|
|
+ if (debug_solib)
|
|
|
|
|
+ fprintf_unfiltered (gdb_stdlog,
|
|
|
|
|
+ "svr4_current_sos: is first link entry? %d\n",
|
|
|
|
|
+ IGNORE_FIRST_LINK_MAP_ENTRY (new));
|
|
|
|
|
+
|
|
|
|
|
/* For SVR4 versions, the first entry in the link map is for the
|
|
|
|
|
inferior executable, so we must ignore it. For some versions of
|
|
|
|
|
SVR4, it has no name. For others (Solaris 2.3 for example), it
|
|
|
|
|
does have a name, so we can no longer use a missing name to
|
|
|
|
|
decide when to ignore it. */
|
2007-11-16 02:15:40 +00:00
|
|
|
|
- if (IGNORE_FIRST_LINK_MAP_ENTRY (new) && ldsomap == 0)
|
|
|
|
|
+ if (exec_bfd != NULL && IGNORE_FIRST_LINK_MAP_ENTRY (new) && ldsomap == 0)
|
2008-12-14 14:05:20 +00:00
|
|
|
|
{
|
2009-08-04 05:37:29 +00:00
|
|
|
|
- info->main_lm_addr = new->lm_info->lm_addr;
|
2008-12-14 14:05:20 +00:00
|
|
|
|
- free_so (new);
|
|
|
|
|
- }
|
2005-01-11 00:15:58 +00:00
|
|
|
|
+ /* It is the first link map entry, i.e. it is the main executable. */
|
|
|
|
|
+
|
|
|
|
|
+ if (bfd_get_start_address (exec_bfd) == entry_point_address ())
|
|
|
|
|
+ {
|
2008-12-14 14:05:20 +00:00
|
|
|
|
+ /* Non-pie case, main executable has not been relocated. */
|
2009-08-04 05:37:29 +00:00
|
|
|
|
+ info->main_lm_addr = new->lm_info->lm_addr;
|
2005-01-11 00:15:58 +00:00
|
|
|
|
+ free_so (new);
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ /* Pie case, main executable has been relocated. */
|
|
|
|
|
+ struct so_list *gdb_solib;
|
|
|
|
|
+
|
|
|
|
|
+ if (debug_solib)
|
|
|
|
|
+ fprintf_unfiltered (gdb_stdlog,
|
|
|
|
|
+ "svr4_current_sos: Processing first link map entry\n");
|
|
|
|
|
+ strncpy (new->so_name, exec_bfd->filename,
|
|
|
|
|
+ SO_NAME_MAX_PATH_SIZE - 1);
|
|
|
|
|
+ new->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
|
|
|
|
|
+ strcpy (new->so_original_name, new->so_name);
|
|
|
|
|
+ /*new->main = 1;*/
|
|
|
|
|
+ new->main_relocated = 0;
|
|
|
|
|
+
|
|
|
|
|
+ if (debug_solib)
|
|
|
|
|
+ {
|
|
|
|
|
+ fprintf_unfiltered (gdb_stdlog,
|
|
|
|
|
+ "svr4_current_sos: Processing nameless DSO\n");
|
|
|
|
|
+ fprintf_unfiltered (gdb_stdlog,
|
|
|
|
|
+ "svr4_current_sos: adding name %s\n",
|
|
|
|
|
+ new->so_name);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ for (gdb_solib = master_so_list ();
|
|
|
|
|
+ gdb_solib;
|
|
|
|
|
+ gdb_solib = gdb_solib->next)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (debug_solib)
|
|
|
|
|
+ fprintf_unfiltered (gdb_stdlog,
|
|
|
|
|
+ "svr4_current_sos: compare gdb %s and new %s\n",
|
|
|
|
|
+ gdb_solib->so_name, new->so_name);
|
|
|
|
|
+ if (strcmp (gdb_solib->so_name, new->so_name) == 0)
|
|
|
|
|
+ if (gdb_solib->main_relocated)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (debug_solib)
|
|
|
|
|
+ fprintf_unfiltered (gdb_stdlog,
|
|
|
|
|
+ "svr4_current_sos: found main relocated\n");
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if ((gdb_solib && !gdb_solib->main_relocated) || (!gdb_solib))
|
|
|
|
|
+ {
|
|
|
|
|
+ add_to_target_sections (0 /*from_tty*/, ¤t_target, new);
|
|
|
|
|
+ new->main = 1;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* We need this in the list of shared libs we return because
|
|
|
|
|
+ solib_add_stub will loop through it and add the symbol file. */
|
|
|
|
|
+ new->next = 0;
|
|
|
|
|
+ *link_ptr = new;
|
|
|
|
|
+ link_ptr = &new->next;
|
|
|
|
|
+ }
|
|
|
|
|
+ } /* End of IGNORE_FIRST_LINK_MAP_ENTRY */
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
+ /* This is not the first link map entry, i.e. is not the main
|
|
|
|
|
+ executable. Note however that it could be the DSO supplied on
|
|
|
|
|
+ certain systems (i.e. Linux 2.6) containing information about
|
|
|
|
|
+ the vsyscall page. We must ignore such entry. This entry is
|
|
|
|
|
+ nameless (just like the one for the main executable, sigh). */
|
|
|
|
|
+
|
|
|
|
|
int errcode;
|
|
|
|
|
char *buffer;
|
|
|
|
|
|
|
|
|
|
/* Extract this shared object's name. */
|
|
|
|
|
+ if (debug_solib)
|
|
|
|
|
+ fprintf_unfiltered (gdb_stdlog,
|
|
|
|
|
+ "svr4_current_sos: read LM_NAME\n");
|
|
|
|
|
+
|
|
|
|
|
target_read_string (LM_NAME (new), &buffer,
|
|
|
|
|
SO_NAME_MAX_PATH_SIZE - 1, &errcode);
|
|
|
|
|
if (errcode != 0)
|
2009-08-04 05:37:29 +00:00
|
|
|
|
@@ -1101,47 +1336,60 @@ svr4_current_sos (void)
|
2006-07-11 06:33:02 +00:00
|
|
|
|
safe_strerror (errcode));
|
2005-01-11 00:15:58 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
2008-04-22 22:13:56 +00:00
|
|
|
|
- struct build_id *build_id;
|
2007-11-01 20:24:20 +00:00
|
|
|
|
+ if (debug_solib)
|
|
|
|
|
+ fprintf_unfiltered (gdb_stdlog,
|
|
|
|
|
+ "svr4_current_sos: LM_NAME is <%s>\n",
|
|
|
|
|
+ buffer);
|
|
|
|
|
+ /* The name could be empty, in which case it is the
|
|
|
|
|
+ system supplied DSO. */
|
|
|
|
|
+ if (strcmp (buffer, "") == 0)
|
|
|
|
|
+ free_so (new);
|
|
|
|
|
+ else
|
2006-07-11 06:33:02 +00:00
|
|
|
|
+ {
|
2008-04-22 22:13:56 +00:00
|
|
|
|
+ struct build_id *build_id;
|
|
|
|
|
|
|
|
|
|
- strncpy (new->so_original_name, buffer, SO_NAME_MAX_PATH_SIZE - 1);
|
|
|
|
|
- new->so_original_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
|
|
|
|
|
- /* May get overwritten below. */
|
|
|
|
|
- strcpy (new->so_name, new->so_original_name);
|
|
|
|
|
+ strncpy (new->so_original_name, buffer, SO_NAME_MAX_PATH_SIZE - 1);
|
|
|
|
|
+ new->so_original_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
|
|
|
|
|
+ /* May get overwritten below. */
|
|
|
|
|
+ strcpy (new->so_name, new->so_original_name);
|
|
|
|
|
|
|
|
|
|
- build_id = build_id_addr_get (LM_DYNAMIC_FROM_LINK_MAP (new));
|
|
|
|
|
- if (build_id != NULL)
|
|
|
|
|
- {
|
|
|
|
|
- char *name, *build_id_filename;
|
|
|
|
|
+ build_id = build_id_addr_get (LM_DYNAMIC_FROM_LINK_MAP (new));
|
|
|
|
|
+ if (build_id != NULL)
|
2006-07-11 06:33:02 +00:00
|
|
|
|
+ {
|
2008-04-22 22:13:56 +00:00
|
|
|
|
+ char *name, *build_id_filename;
|
|
|
|
|
+
|
|
|
|
|
+ /* Missing the build-id matching separate debug info file
|
|
|
|
|
+ would be handled while SO_NAME gets loaded. */
|
|
|
|
|
+ name = build_id_to_filename (build_id, &build_id_filename, 0);
|
|
|
|
|
+ if (name != NULL)
|
|
|
|
|
+ {
|
|
|
|
|
+ strncpy (new->so_name, name, SO_NAME_MAX_PATH_SIZE - 1);
|
|
|
|
|
+ new->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
|
|
|
|
|
+ xfree (name);
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ debug_print_missing (new->so_name, build_id_filename);
|
2008-12-14 14:05:20 +00:00
|
|
|
|
+
|
|
|
|
|
+ xfree (build_id_filename);
|
|
|
|
|
+ xfree (build_id);
|
|
|
|
|
+ }
|
2008-04-22 22:13:56 +00:00
|
|
|
|
|
|
|
|
|
- /* Missing the build-id matching separate debug info file
|
|
|
|
|
- would be handled while SO_NAME gets loaded. */
|
|
|
|
|
- name = build_id_to_filename (build_id, &build_id_filename, 0);
|
|
|
|
|
- if (name != NULL)
|
|
|
|
|
+ if (debug_solib)
|
|
|
|
|
{
|
|
|
|
|
- strncpy (new->so_name, name, SO_NAME_MAX_PATH_SIZE - 1);
|
|
|
|
|
- new->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
|
|
|
|
|
- xfree (name);
|
2006-07-11 06:33:02 +00:00
|
|
|
|
+ fprintf_unfiltered (gdb_stdlog,
|
|
|
|
|
+ "svr4_current_sos: Processing DSO: %s\n",
|
|
|
|
|
+ new->so_name);
|
|
|
|
|
+ fprintf_unfiltered (gdb_stdlog,
|
|
|
|
|
+ "svr4_current_sos: first link entry %d\n",
|
|
|
|
|
+ IGNORE_FIRST_LINK_MAP_ENTRY (new));
|
2008-04-22 22:13:56 +00:00
|
|
|
|
}
|
|
|
|
|
- else
|
|
|
|
|
- debug_print_missing (new->so_name, build_id_filename);
|
|
|
|
|
|
|
|
|
|
- xfree (build_id_filename);
|
|
|
|
|
- xfree (build_id);
|
2006-07-11 06:33:02 +00:00
|
|
|
|
+ new->next = 0;
|
|
|
|
|
+ *link_ptr = new;
|
|
|
|
|
+ link_ptr = &new->next;
|
2008-04-22 22:13:56 +00:00
|
|
|
|
}
|
2006-07-11 06:33:02 +00:00
|
|
|
|
}
|
2008-04-22 22:13:56 +00:00
|
|
|
|
- xfree (buffer);
|
|
|
|
|
-
|
|
|
|
|
- /* If this entry has no name, or its name matches the name
|
|
|
|
|
- for the main executable, don't include it in the list. */
|
|
|
|
|
- if (! new->so_name[0]
|
|
|
|
|
- || match_main (new->so_name))
|
|
|
|
|
- free_so (new);
|
|
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- new->next = 0;
|
|
|
|
|
- *link_ptr = new;
|
|
|
|
|
- link_ptr = &new->next;
|
|
|
|
|
- }
|
2007-11-01 20:24:20 +00:00
|
|
|
|
+ xfree (buffer);
|
2005-01-11 00:15:58 +00:00
|
|
|
|
}
|
|
|
|
|
|
2007-11-01 20:24:20 +00:00
|
|
|
|
/* On Solaris, the dynamic linker is not in the normal list of
|
2009-08-04 05:37:29 +00:00
|
|
|
|
@@ -1157,6 +1405,9 @@ svr4_current_sos (void)
|
2007-01-21 01:53:01 +00:00
|
|
|
|
if (head == NULL)
|
|
|
|
|
return svr4_default_sos ();
|
2005-01-11 00:15:58 +00:00
|
|
|
|
|
|
|
|
|
+ if (debug_solib)
|
2007-11-16 02:15:40 +00:00
|
|
|
|
+ fprintf_unfiltered (gdb_stdlog, "svr4_current_sos: ENDS %s\n", filename);
|
2005-01-11 00:15:58 +00:00
|
|
|
|
+
|
|
|
|
|
return head;
|
|
|
|
|
}
|
|
|
|
|
|
2009-08-04 05:37:29 +00:00
|
|
|
|
@@ -1189,7 +1440,7 @@ svr4_fetch_objfile_link_map (struct objf
|
2005-01-11 00:15:58 +00:00
|
|
|
|
/* 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. */
|
|
|
|
|
-
|
|
|
|
|
+#if 0
|
|
|
|
|
static int
|
|
|
|
|
match_main (char *soname)
|
|
|
|
|
{
|
2009-08-04 05:37:29 +00:00
|
|
|
|
@@ -1203,6 +1454,7 @@ match_main (char *soname)
|
2005-01-11 00:15:58 +00:00
|
|
|
|
|
|
|
|
|
return (0);
|
|
|
|
|
}
|
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
|
|
/* Return 1 if PC lies in the dynamic symbol resolution code of the
|
|
|
|
|
SVR4 run time loader. */
|
2009-08-04 05:37:29 +00:00
|
|
|
|
@@ -1354,15 +1606,29 @@ enable_break (struct svr4_info *info)
|
2008-12-14 14:05:20 +00:00
|
|
|
|
/* Find the program interpreter; if not found, warn the user and drop
|
2005-01-11 00:15:58 +00:00
|
|
|
|
into the old breakpoint at symbol code. */
|
2008-12-14 14:05:20 +00:00
|
|
|
|
interp_name = find_program_interpreter ();
|
2005-01-11 00:15:58 +00:00
|
|
|
|
+
|
|
|
|
|
+ if (debug_solib)
|
|
|
|
|
+ fprintf_unfiltered (gdb_stdlog,
|
|
|
|
|
+ "enable_break: search for .interp in %s\n",
|
|
|
|
|
+ exec_bfd->filename);
|
2008-12-14 14:05:20 +00:00
|
|
|
|
if (interp_name)
|
2005-01-11 00:15:58 +00:00
|
|
|
|
{
|
2008-04-22 22:13:56 +00:00
|
|
|
|
CORE_ADDR load_addr = 0;
|
|
|
|
|
+ CORE_ADDR load_addr_mask = -1L;
|
|
|
|
|
int load_addr_found = 0;
|
|
|
|
|
int loader_found_in_list = 0;
|
|
|
|
|
struct so_list *so;
|
2008-12-14 14:05:20 +00:00
|
|
|
|
bfd *tmp_bfd = NULL;
|
2008-04-22 22:13:56 +00:00
|
|
|
|
struct target_ops *tmp_bfd_target;
|
2008-12-14 14:05:20 +00:00
|
|
|
|
volatile struct gdb_exception ex;
|
2008-04-22 22:13:56 +00:00
|
|
|
|
+ int arch_size;
|
|
|
|
|
+
|
|
|
|
|
+ /* For 32bit inferiors with 64bit GDB we may get LOAD_ADDR at 0xff......
|
|
|
|
|
+ and thus overflowing its addition to the address while CORE_ADDR is
|
|
|
|
|
+ 64bit producing 0x1........ address invalid across GDB. */
|
|
|
|
|
+ arch_size = bfd_get_arch_size (exec_bfd);
|
|
|
|
|
+ if (arch_size > 0 && arch_size < sizeof (1UL) * 8)
|
|
|
|
|
+ load_addr_mask = (1UL << arch_size) - 1;
|
|
|
|
|
|
2008-12-14 14:05:20 +00:00
|
|
|
|
sym_addr = 0;
|
2005-01-11 00:15:58 +00:00
|
|
|
|
|
2009-08-04 05:37:29 +00:00
|
|
|
|
@@ -1379,6 +1645,9 @@ enable_break (struct svr4_info *info)
|
2008-12-14 14:05:20 +00:00
|
|
|
|
{
|
|
|
|
|
tmp_bfd = solib_bfd_open (interp_name);
|
|
|
|
|
}
|
2005-01-11 00:15:58 +00:00
|
|
|
|
+ if (debug_solib)
|
2008-12-14 14:05:20 +00:00
|
|
|
|
+ fprintf_unfiltered (gdb_stdlog,
|
|
|
|
|
+ "enable_break: opening %s\n", interp_name);
|
2005-01-11 00:15:58 +00:00
|
|
|
|
if (tmp_bfd == NULL)
|
|
|
|
|
goto bkpt_at_symbol;
|
|
|
|
|
|
2009-08-04 05:37:29 +00:00
|
|
|
|
@@ -1436,16 +1705,16 @@ enable_break (struct svr4_info *info)
|
2008-04-22 22:13:56 +00:00
|
|
|
|
interp_sect = bfd_get_section_by_name (tmp_bfd, ".text");
|
|
|
|
|
if (interp_sect)
|
|
|
|
|
{
|
|
|
|
|
- interp_text_sect_low =
|
|
|
|
|
- bfd_section_vma (tmp_bfd, interp_sect) + load_addr;
|
|
|
|
|
+ interp_text_sect_low = (bfd_section_vma (tmp_bfd, interp_sect)
|
|
|
|
|
+ + load_addr) & load_addr_mask;
|
|
|
|
|
interp_text_sect_high =
|
|
|
|
|
interp_text_sect_low + bfd_section_size (tmp_bfd, interp_sect);
|
|
|
|
|
}
|
|
|
|
|
interp_sect = bfd_get_section_by_name (tmp_bfd, ".plt");
|
|
|
|
|
if (interp_sect)
|
|
|
|
|
{
|
|
|
|
|
- interp_plt_sect_low =
|
|
|
|
|
- bfd_section_vma (tmp_bfd, interp_sect) + load_addr;
|
|
|
|
|
+ interp_plt_sect_low = (bfd_section_vma (tmp_bfd, interp_sect)
|
|
|
|
|
+ + load_addr) & load_addr_mask;
|
|
|
|
|
interp_plt_sect_high =
|
|
|
|
|
interp_plt_sect_low + bfd_section_size (tmp_bfd, interp_sect);
|
|
|
|
|
}
|
2009-08-04 05:37:29 +00:00
|
|
|
|
@@ -1480,7 +1749,7 @@ enable_break (struct svr4_info *info)
|
2008-04-22 22:13:56 +00:00
|
|
|
|
|
2005-01-11 00:15:58 +00:00
|
|
|
|
if (sym_addr != 0)
|
|
|
|
|
{
|
2009-08-04 05:37:29 +00:00
|
|
|
|
- create_solib_event_breakpoint (target_gdbarch, load_addr + sym_addr);
|
|
|
|
|
+ create_solib_event_breakpoint (target_gdbarch, (load_addr + sym_addr) & load_addr_mask);
|
2008-12-14 14:05:20 +00:00
|
|
|
|
xfree (interp_name);
|
2005-01-11 00:15:58 +00:00
|
|
|
|
return 1;
|
|
|
|
|
}
|
2009-08-04 05:37:29 +00:00
|
|
|
|
@@ -1753,6 +2022,8 @@ svr4_solib_create_inferior_hook (void)
|
2008-12-14 14:05:20 +00:00
|
|
|
|
while (tp->stop_signal != TARGET_SIGNAL_TRAP);
|
|
|
|
|
inf->stop_soon = NO_STOP_QUIETLY;
|
2005-01-11 00:15:58 +00:00
|
|
|
|
#endif /* defined(_SCO_DS) */
|
2008-12-14 14:05:20 +00:00
|
|
|
|
+
|
2009-08-04 05:37:29 +00:00
|
|
|
|
+ disable_breakpoints_before_startup ();
|
2005-01-11 00:15:58 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2009-08-04 05:37:29 +00:00
|
|
|
|
@@ -1929,6 +2200,76 @@ svr4_lp64_fetch_link_map_offsets (void)
|
2005-01-11 00:15:58 +00:00
|
|
|
|
|
|
|
|
|
return lmp;
|
|
|
|
|
}
|
|
|
|
|
+void
|
|
|
|
|
+info_linkmap_command (char *cmd, int from_tty)
|
|
|
|
|
+{
|
|
|
|
|
+ CORE_ADDR lm;
|
2009-08-04 05:37:29 +00:00
|
|
|
|
+ struct svr4_info *info = get_svr4_info (PIDGET (inferior_ptid));
|
2005-01-11 00:15:58 +00:00
|
|
|
|
+
|
|
|
|
|
+ /* Make sure we've looked up the inferior's dynamic linker's base
|
|
|
|
|
+ structure. */
|
2009-08-04 05:37:29 +00:00
|
|
|
|
+ if (! info->debug_base)
|
2005-01-11 00:15:58 +00:00
|
|
|
|
+ {
|
2009-08-04 05:37:29 +00:00
|
|
|
|
+ info->debug_base = locate_base (info);
|
2005-01-11 00:15:58 +00:00
|
|
|
|
+
|
|
|
|
|
+ /* If we can't find the dynamic linker's base structure, this
|
|
|
|
|
+ must not be a dynamically linked executable. Hmm. */
|
2009-08-04 05:37:29 +00:00
|
|
|
|
+ if (! info->debug_base)
|
2005-01-11 00:15:58 +00:00
|
|
|
|
+ {
|
|
|
|
|
+ if (debug_solib)
|
|
|
|
|
+ fprintf_unfiltered (gdb_stdlog,
|
|
|
|
|
+ "svr4_print_linkmap: no DT_DEBUG found in %s -- return now\n",
|
|
|
|
|
+ exec_bfd->filename);
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* Walk the inferior's link map list, and print the info. */
|
|
|
|
|
+
|
2009-08-04 05:37:29 +00:00
|
|
|
|
+ lm = solib_svr4_r_map (info);
|
2005-01-11 00:15:58 +00:00
|
|
|
|
+ while (lm)
|
|
|
|
|
+ {
|
|
|
|
|
+ int errcode;
|
|
|
|
|
+ char *buffer;
|
|
|
|
|
+ CORE_ADDR load_addr;
|
|
|
|
|
+
|
2006-07-11 06:33:02 +00:00
|
|
|
|
+ struct link_map_offsets *lmo = svr4_fetch_link_map_offsets ();
|
2005-01-11 00:15:58 +00:00
|
|
|
|
+ struct so_list *new
|
|
|
|
|
+ = (struct so_list *) xmalloc (sizeof (struct so_list));
|
|
|
|
|
+ struct cleanup *old_chain = make_cleanup (xfree, new);
|
2006-07-11 06:33:02 +00:00
|
|
|
|
+
|
2005-01-11 00:15:58 +00:00
|
|
|
|
+ memset (new, 0, sizeof (*new));
|
|
|
|
|
+
|
|
|
|
|
+ new->lm_info = xmalloc (sizeof (struct lm_info));
|
|
|
|
|
+ make_cleanup (xfree, new->lm_info);
|
2006-07-11 06:33:02 +00:00
|
|
|
|
+
|
2005-01-11 00:15:58 +00:00
|
|
|
|
+ new->lm_info->lm = xmalloc (lmo->link_map_size);
|
|
|
|
|
+ make_cleanup (xfree, new->lm_info->lm);
|
|
|
|
|
+ memset (new->lm_info->lm, 0, lmo->link_map_size);
|
2006-07-11 06:33:02 +00:00
|
|
|
|
+
|
2005-01-11 00:15:58 +00:00
|
|
|
|
+ if (debug_solib)
|
|
|
|
|
+ fprintf_unfiltered (gdb_stdlog,
|
2009-08-04 05:37:29 +00:00
|
|
|
|
+ "svr4_print_linkmap: read lm at %s\n", paddress (target_gdbarch, lm));
|
2005-01-11 00:15:58 +00:00
|
|
|
|
+ read_memory (lm, new->lm_info->lm, lmo->link_map_size);
|
2006-07-11 06:33:02 +00:00
|
|
|
|
+
|
2005-01-11 00:15:58 +00:00
|
|
|
|
+ lm = LM_NEXT (new);
|
2006-07-11 06:33:02 +00:00
|
|
|
|
+
|
2005-01-11 00:15:58 +00:00
|
|
|
|
+ /* Load address. */
|
2006-07-11 06:33:02 +00:00
|
|
|
|
+ load_addr = LM_ADDR_CHECK (new, NULL);
|
2005-01-11 00:15:58 +00:00
|
|
|
|
+ /* Shared object's name. */
|
|
|
|
|
+ target_read_string (LM_NAME (new), &buffer,
|
|
|
|
|
+ SO_NAME_MAX_PATH_SIZE - 1, &errcode);
|
|
|
|
|
+ make_cleanup (xfree, buffer);
|
|
|
|
|
+ if (errcode != 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ warning ("svr4_print_linkmap: Can't read pathname for load map: %s\n",
|
|
|
|
|
+ safe_strerror (errcode));
|
|
|
|
|
+ }
|
2009-08-04 05:37:29 +00:00
|
|
|
|
+ fprintf_filtered (gdb_stdout, "%-8s %-30s\n", paddress (target_gdbarch, load_addr), buffer);
|
2005-01-11 00:15:58 +00:00
|
|
|
|
+ do_cleanups (old_chain);
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
2007-11-01 20:24:20 +00:00
|
|
|
|
struct target_so_ops svr4_so_ops;
|
2009-08-04 05:37:29 +00:00
|
|
|
|
@@ -1969,4 +2310,7 @@ _initialize_svr4_solib (void)
|
2008-03-03 16:13:47 +00:00
|
|
|
|
svr4_so_ops.same = svr4_same;
|
2009-08-04 05:37:29 +00:00
|
|
|
|
|
|
|
|
|
observer_attach_inferior_exit (solib_svr4_inferior_exit);
|
2005-01-11 00:15:58 +00:00
|
|
|
|
+
|
|
|
|
|
+ add_info ("linkmap", info_linkmap_command,
|
2008-03-03 16:13:47 +00:00
|
|
|
|
+ "Display the inferior's linkmap.");
|
2005-01-11 00:15:58 +00:00
|
|
|
|
}
|
2009-08-10 13:22:51 +00:00
|
|
|
|
Index: gdb-6.8.50.20090809/gdb/solib.c
|
2008-12-14 14:05:20 +00:00
|
|
|
|
===================================================================
|
2009-08-10 13:22:51 +00:00
|
|
|
|
--- gdb-6.8.50.20090809.orig/gdb/solib.c 2009-08-10 00:50:30.000000000 +0200
|
|
|
|
|
+++ gdb-6.8.50.20090809/gdb/solib.c 2009-08-10 15:07:13.000000000 +0200
|
2009-03-02 00:11:35 +00:00
|
|
|
|
@@ -81,6 +81,8 @@ set_solib_ops (struct gdbarch *gdbarch,
|
2005-01-11 00:15:58 +00:00
|
|
|
|
|
|
|
|
|
/* external data declarations */
|
|
|
|
|
|
|
|
|
|
+int debug_solib;
|
|
|
|
|
+
|
2007-11-01 20:24:20 +00:00
|
|
|
|
/* FIXME: gdbarch needs to control this variable, or else every
|
|
|
|
|
configuration needs to call set_solib_ops. */
|
2005-01-11 00:15:58 +00:00
|
|
|
|
struct target_so_ops *current_target_so_ops;
|
2009-03-02 00:11:35 +00:00
|
|
|
|
@@ -104,6 +106,8 @@ The search path for loading non-absolute
|
2006-07-11 06:33:02 +00:00
|
|
|
|
value);
|
|
|
|
|
}
|
2005-01-11 00:15:58 +00:00
|
|
|
|
|
|
|
|
|
+void add_to_target_sections (int, struct target_ops *, struct so_list *);
|
|
|
|
|
+
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
|
|
GLOBAL FUNCTION
|
2009-08-11 14:42:47 +00:00
|
|
|
|
@@ -453,14 +453,38 @@ symbol_add_stub (struct so_list *so, int
|
2005-01-11 00:15:58 +00:00
|
|
|
|
/* 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
|
2009-02-11 00:04:48 +00:00
|
|
|
|
+ && !so->main)
|
2009-08-04 05:37:29 +00:00
|
|
|
|
+ return;
|
2005-01-11 00:15:58 +00:00
|
|
|
|
+ /* Found an already loaded main executable. This could happen in
|
2009-02-11 00:04:48 +00:00
|
|
|
|
+ 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. */
|
2008-04-22 22:13:56 +00:00
|
|
|
|
+ if (strcmp (so->objfile->name, so->so_name) == 0
|
2009-02-11 00:04:48 +00:00
|
|
|
|
+ && so->main
|
|
|
|
|
+ && so->main_relocated)
|
2009-08-04 05:37:29 +00:00
|
|
|
|
return;
|
2005-01-11 00:15:58 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sap = build_section_addr_info_from_section_table (so->sections,
|
|
|
|
|
so->sections_end);
|
|
|
|
|
|
2009-08-10 13:22:51 +00:00
|
|
|
|
- so->objfile = symbol_file_add_from_bfd (so->abfd, flags, sap, OBJF_SHARED);
|
2005-01-11 00:15:58 +00:00
|
|
|
|
+ if (so->main)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (debug_solib)
|
|
|
|
|
+ fprintf_unfiltered (gdb_stdlog,
|
|
|
|
|
+ "symbol_add_stub: adding symbols for main\n");
|
2009-08-10 13:22:51 +00:00
|
|
|
|
+ so->objfile = symbol_file_add_from_bfd (so->abfd, (flags & ~SYMFILE_VERBOSE) | SYMFILE_MAINLINE, sap, 0);
|
2005-01-11 00:15:58 +00:00
|
|
|
|
+ so->main_relocated = 1;
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
2009-08-10 13:22:51 +00:00
|
|
|
|
+ so->objfile = symbol_file_add_from_bfd (so->abfd, flags, sap, OBJF_SHARED);
|
2005-01-11 00:15:58 +00:00
|
|
|
|
+
|
2009-08-10 13:22:51 +00:00
|
|
|
|
p_refcount = xmalloc (sizeof (*p_refcount));
|
|
|
|
|
*p_refcount = 2; /* Both solib and objfile refer to this abfd. */
|
2009-08-11 14:42:47 +00:00
|
|
|
|
bfd_usrdata (so->abfd) = p_refcount;
|
2009-08-10 13:22:51 +00:00
|
|
|
|
@@ -600,6 +628,10 @@ update_solib_list (int from_tty, struct
|
2008-03-03 16:13:47 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
+ if (debug_solib)
|
|
|
|
|
+ fprintf_unfiltered (gdb_stdlog,
|
|
|
|
|
+ "update_solib_list: compare gdb:%s and inferior:%s\n",
|
|
|
|
|
+ gdb->so_original_name, i->so_original_name);
|
|
|
|
|
if (! strcmp (gdb->so_original_name, i->so_original_name))
|
|
|
|
|
break;
|
|
|
|
|
}
|
2009-08-10 13:22:51 +00:00
|
|
|
|
@@ -654,18 +686,7 @@ update_solib_list (int from_tty, struct
|
2005-01-11 00:15:58 +00:00
|
|
|
|
/* Fill in the rest of each of the `struct so_list' nodes. */
|
|
|
|
|
for (i = inferior; i; i = i->next)
|
|
|
|
|
{
|
|
|
|
|
- i->from_tty = from_tty;
|
|
|
|
|
-
|
|
|
|
|
- /* Fill in the rest of the `struct so_list' node. */
|
|
|
|
|
- catch_errors (solib_map_sections, i,
|
|
|
|
|
- "Error while mapping shared library sections:\n",
|
|
|
|
|
- RETURN_MASK_ALL);
|
|
|
|
|
-
|
2009-08-04 05:37:29 +00:00
|
|
|
|
- /* Add the shared object's sections to the current set of
|
|
|
|
|
- file section tables. Do this immediately after mapping
|
|
|
|
|
- the object so that later nodes in the list can query this
|
|
|
|
|
- object, as is needed in solib-osf.c. */
|
|
|
|
|
- add_target_sections (i->sections, i->sections_end);
|
|
|
|
|
+ add_to_target_sections (from_tty, target, i);
|
2006-07-11 06:33:02 +00:00
|
|
|
|
|
|
|
|
|
/* Notify any observer that the shared object has been
|
|
|
|
|
loaded now that we've added it to GDB's tables. */
|
2009-08-10 13:22:51 +00:00
|
|
|
|
@@ -775,6 +796,32 @@ solib_add (char *pattern, int from_tty,
|
2007-01-21 01:53:01 +00:00
|
|
|
|
}
|
2005-01-11 00:15:58 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
+void
|
|
|
|
|
+add_to_target_sections (int from_tty, struct target_ops *target, struct so_list *solib)
|
|
|
|
|
+{
|
|
|
|
|
+ /* If this is set, then the sections have been already added to the
|
|
|
|
|
+ target list. */
|
|
|
|
|
+ if (solib->main)
|
|
|
|
|
+ return;
|
|
|
|
|
+
|
|
|
|
|
+ solib->from_tty = from_tty;
|
|
|
|
|
+
|
|
|
|
|
+ /* Fill in the rest of the `struct so_list' node. */
|
|
|
|
|
+ catch_errors (solib_map_sections, solib,
|
2009-08-04 05:37:29 +00:00
|
|
|
|
+ "Error while mapping shared library sections:\n",
|
|
|
|
|
+ RETURN_MASK_ALL);
|
2005-01-11 00:15:58 +00:00
|
|
|
|
+
|
2009-08-04 05:37:29 +00:00
|
|
|
|
+ if (debug_solib)
|
|
|
|
|
+ fprintf_unfiltered (gdb_stdlog,
|
|
|
|
|
+ "add_to_target_sections: add %s to to_sections\n",
|
|
|
|
|
+ solib->so_original_name);
|
|
|
|
|
+
|
|
|
|
|
+ /* Add the shared object's sections to the current set of
|
|
|
|
|
+ file section tables. Do this immediately after mapping
|
|
|
|
|
+ the object so that later nodes in the list can query this
|
|
|
|
|
+ object, as is needed in solib-osf.c. */
|
|
|
|
|
+ add_target_sections (solib->sections, solib->sections_end);
|
2005-01-11 00:15:58 +00:00
|
|
|
|
+}
|
|
|
|
|
|
2007-01-21 01:53:01 +00:00
|
|
|
|
/*
|
2005-01-11 00:15:58 +00:00
|
|
|
|
|
2009-08-10 13:22:51 +00:00
|
|
|
|
@@ -1128,4 +1175,12 @@ This takes precedence over the environme
|
2006-07-11 06:33:02 +00:00
|
|
|
|
reload_shared_libraries,
|
|
|
|
|
show_solib_search_path,
|
|
|
|
|
&setlist, &showlist);
|
2005-01-11 00:15:58 +00:00
|
|
|
|
+
|
2006-07-11 06:33:02 +00:00
|
|
|
|
+ add_setshow_boolean_cmd ("solib", no_class, &debug_solib,
|
|
|
|
|
+ _("\
|
|
|
|
|
+Set debugging of GNU/Linux shlib module.\n"), _("\
|
|
|
|
|
+Show debugging status of GNU/Linux shlib module.\n"), _("\
|
|
|
|
|
+Enables printf debugging output of GNU/Linux shlib module.\n"),
|
|
|
|
|
+ NULL, NULL,
|
|
|
|
|
+ &setdebuglist, &showdebuglist);
|
2005-01-11 00:15:58 +00:00
|
|
|
|
}
|
2009-08-10 13:22:51 +00:00
|
|
|
|
Index: gdb-6.8.50.20090809/gdb/solist.h
|
2008-12-14 14:05:20 +00:00
|
|
|
|
===================================================================
|
2009-08-10 13:22:51 +00:00
|
|
|
|
--- gdb-6.8.50.20090809.orig/gdb/solist.h 2009-08-10 00:50:30.000000000 +0200
|
|
|
|
|
+++ gdb-6.8.50.20090809/gdb/solist.h 2009-08-10 14:59:58.000000000 +0200
|
2008-09-02 00:55:43 +00:00
|
|
|
|
@@ -61,6 +61,8 @@ struct so_list
|
|
|
|
|
bfd *abfd;
|
|
|
|
|
char symbols_loaded; /* flag: symbols read in yet? */
|
|
|
|
|
char from_tty; /* flag: print msgs? */
|
|
|
|
|
+ char main; /* flag: is this the main executable? */
|
|
|
|
|
+ char main_relocated; /* flag: has it been relocated yet? */
|
|
|
|
|
struct objfile *objfile; /* objfile for loaded lib */
|
2009-08-04 05:37:29 +00:00
|
|
|
|
struct target_section *sections;
|
|
|
|
|
struct target_section *sections_end;
|
|
|
|
|
@@ -147,4 +149,10 @@ struct symbol *solib_global_lookup (cons
|
|
|
|
|
const char *name,
|
2008-12-14 14:05:20 +00:00
|
|
|
|
const domain_enum domain);
|
2008-09-02 00:55:43 +00:00
|
|
|
|
|
|
|
|
|
+/* Add the list of sections in so_list to the target to_sections. */
|
|
|
|
|
+extern void add_to_target_sections (int, struct target_ops *, struct so_list *);
|
|
|
|
|
+
|
|
|
|
|
+/* Controls the printing of debugging output. */
|
|
|
|
|
+extern int debug_solib;
|
2008-12-14 14:05:20 +00:00
|
|
|
|
+
|
2008-09-02 00:55:43 +00:00
|
|
|
|
#endif
|
2009-08-10 13:22:51 +00:00
|
|
|
|
Index: gdb-6.8.50.20090809/gdb/symfile-mem.c
|
2008-12-14 14:05:20 +00:00
|
|
|
|
===================================================================
|
2009-08-10 13:22:51 +00:00
|
|
|
|
--- gdb-6.8.50.20090809.orig/gdb/symfile-mem.c 2009-08-10 00:50:30.000000000 +0200
|
|
|
|
|
+++ gdb-6.8.50.20090809/gdb/symfile-mem.c 2009-08-10 14:59:58.000000000 +0200
|
2009-08-04 05:37:29 +00:00
|
|
|
|
@@ -115,7 +115,7 @@ symbol_file_add_from_memory (struct bfd
|
|
|
|
|
++i;
|
2008-09-02 00:55:43 +00:00
|
|
|
|
}
|
|
|
|
|
|
2009-08-04 05:37:29 +00:00
|
|
|
|
- objf = symbol_file_add_from_bfd (nbfd, from_tty ? SYMFILE_VERBOSE : 0,
|
|
|
|
|
+ objf = symbol_file_add_from_bfd (nbfd, (from_tty ? SYMFILE_VERBOSE : 0) | SYMFILE_MAINLINE2_BOTH,
|
|
|
|
|
sai, OBJF_SHARED);
|
2008-09-02 00:55:43 +00:00
|
|
|
|
|
|
|
|
|
/* This might change our ideas about frames already looked at. */
|
2009-08-10 13:22:51 +00:00
|
|
|
|
Index: gdb-6.8.50.20090809/gdb/symfile.c
|
2008-12-14 14:05:20 +00:00
|
|
|
|
===================================================================
|
2009-08-10 13:22:51 +00:00
|
|
|
|
--- gdb-6.8.50.20090809.orig/gdb/symfile.c 2009-08-10 14:59:28.000000000 +0200
|
|
|
|
|
+++ gdb-6.8.50.20090809/gdb/symfile.c 2009-08-10 14:59:58.000000000 +0200
|
2009-08-04 05:37:29 +00:00
|
|
|
|
@@ -49,6 +49,7 @@
|
2008-09-02 00:55:43 +00:00
|
|
|
|
#include "readline/readline.h"
|
|
|
|
|
#include "gdb_assert.h"
|
|
|
|
|
#include "block.h"
|
|
|
|
|
+#include "varobj.h"
|
|
|
|
|
#include "observer.h"
|
|
|
|
|
#include "exec.h"
|
|
|
|
|
#include "parser-defs.h"
|
2009-08-04 05:37:29 +00:00
|
|
|
|
@@ -785,7 +786,7 @@ syms_from_objfile (struct objfile *objfi
|
2008-09-02 00:55:43 +00:00
|
|
|
|
|
|
|
|
|
/* Now either addrs or offsets is non-zero. */
|
|
|
|
|
|
2005-01-11 00:15:58 +00:00
|
|
|
|
- if (mainline)
|
2009-08-04 05:37:29 +00:00
|
|
|
|
+ if ((add_flags & SYMFILE_MAINLINE) && !(add_flags & SYMFILE_MAINLINE2_ONLY))
|
2005-01-11 00:15:58 +00:00
|
|
|
|
{
|
2008-09-02 00:55:43 +00:00
|
|
|
|
/* We will modify the main symbol table, make sure that all its users
|
|
|
|
|
will be cleaned up if an error occurs during symbol reading. */
|
2009-08-04 05:37:29 +00:00
|
|
|
|
@@ -813,7 +814,7 @@ syms_from_objfile (struct objfile *objfi
|
2007-11-01 20:24:20 +00:00
|
|
|
|
|
2008-09-02 00:55:43 +00:00
|
|
|
|
We no longer warn if the lowest section is not a text segment (as
|
|
|
|
|
happens for the PA64 port. */
|
|
|
|
|
- if (!mainline && addrs && addrs->other[0].name)
|
|
|
|
|
+ if (/*!mainline &&*/ addrs && addrs->other[0].name)
|
|
|
|
|
{
|
2008-12-14 14:05:20 +00:00
|
|
|
|
asection *lower_sect;
|
2008-09-02 00:55:43 +00:00
|
|
|
|
asection *sect;
|
2009-08-04 05:37:29 +00:00
|
|
|
|
@@ -896,7 +897,7 @@ syms_from_objfile (struct objfile *objfi
|
|
|
|
|
init_objfile_sect_indices (objfile);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (*objfile->sf->sym_read) (objfile, mainline);
|
|
|
|
|
+ (*objfile->sf->sym_read) (objfile, add_flags & SYMFILE_MAINLINE2_ONLY ? 2 : (add_flags & SYMFILE_MAINLINE ? 1 : 0));
|
|
|
|
|
|
|
|
|
|
/* Discard cleanups as symbol reading was successful. */
|
|
|
|
|
|
|
|
|
|
@@ -915,17 +916,22 @@ new_symfile_objfile (struct objfile *obj
|
2008-09-02 00:55:43 +00:00
|
|
|
|
/* 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. */
|
2009-08-04 05:37:29 +00:00
|
|
|
|
- if (add_flags & SYMFILE_MAINLINE)
|
|
|
|
|
+ if (add_flags & SYMFILE_MAINLINE && !(add_flags & SYMFILE_MAINLINE2_ONLY))
|
2008-09-02 00:55:43 +00:00
|
|
|
|
{
|
|
|
|
|
/* OK, make it the "real" symbol file. */
|
|
|
|
|
symfile_objfile = objfile;
|
2007-11-01 20:24:20 +00:00
|
|
|
|
|
2008-09-02 00:55:43 +00:00
|
|
|
|
clear_symtab_users ();
|
|
|
|
|
}
|
2009-08-04 05:37:29 +00:00
|
|
|
|
- else if ((add_flags & SYMFILE_DEFER_BP_RESET) == 0)
|
|
|
|
|
+ else if ((add_flags & SYMFILE_DEFER_BP_RESET) == 0
|
|
|
|
|
+ && (add_flags & SYMFILE_MAINLINE2_BOTH) == 0)
|
2008-09-02 00:55:43 +00:00
|
|
|
|
{
|
|
|
|
|
breakpoint_re_set ();
|
|
|
|
|
}
|
|
|
|
|
+ else
|
2007-11-01 20:24:20 +00:00
|
|
|
|
+ {
|
2008-09-02 00:55:43 +00:00
|
|
|
|
+ /* Don't reset breakpoints or it will screw up PIE. */
|
2007-11-01 20:24:20 +00:00
|
|
|
|
+ }
|
|
|
|
|
|
2008-09-02 00:55:43 +00:00
|
|
|
|
/* We're done reading the symbol file; finish off complaints. */
|
2009-08-04 05:37:29 +00:00
|
|
|
|
clear_complaints (&symfile_complaints, 0, add_flags & SYMFILE_VERBOSE);
|
|
|
|
|
@@ -982,7 +988,7 @@ symbol_file_add_with_addrs_or_offsets (b
|
2009-03-02 00:11:35 +00:00
|
|
|
|
/* Give user a chance to burp if we'd be
|
2008-09-02 00:55:43 +00:00
|
|
|
|
interactively wiping out any existing symbols. */
|
2007-11-01 20:24:20 +00:00
|
|
|
|
|
2009-08-04 05:37:29 +00:00
|
|
|
|
- if ((add_flags & SYMFILE_MAINLINE)
|
|
|
|
|
+ if ((add_flags & SYMFILE_MAINLINE) && !(add_flags & SYMFILE_MAINLINE2_ONLY)
|
|
|
|
|
&& (have_full_symbols () || have_partial_symbols ())
|
2008-09-02 00:55:43 +00:00
|
|
|
|
&& from_tty
|
2009-03-02 00:11:35 +00:00
|
|
|
|
&& (have_full_symbols () || have_partial_symbols ())
|
2009-08-04 05:37:29 +00:00
|
|
|
|
@@ -1183,6 +1189,9 @@ symbol_file_clear (int from_tty)
|
2008-09-02 00:55:43 +00:00
|
|
|
|
symfile_objfile->name)
|
|
|
|
|
: !query (_("Discard symbol table? "))))
|
|
|
|
|
error (_("Not confirmed."));
|
|
|
|
|
+#ifdef CLEAR_SOLIB
|
|
|
|
|
+ CLEAR_SOLIB ();
|
|
|
|
|
+#endif
|
2007-11-01 20:24:20 +00:00
|
|
|
|
|
2009-08-04 05:37:29 +00:00
|
|
|
|
free_all_objfiles ();
|
|
|
|
|
|
2009-08-10 13:22:51 +00:00
|
|
|
|
@@ -3387,6 +3396,8 @@ reread_symbols (void)
|
2008-09-02 00:55:43 +00:00
|
|
|
|
/* Discard cleanups as symbol reading was successful. */
|
|
|
|
|
discard_cleanups (old_cleanups);
|
2007-11-01 20:24:20 +00:00
|
|
|
|
|
2008-09-02 00:55:43 +00:00
|
|
|
|
+ init_entry_point_info (objfile);
|
|
|
|
|
+
|
|
|
|
|
/* 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. */
|
2009-08-10 13:22:51 +00:00
|
|
|
|
Index: gdb-6.8.50.20090809/gdb/target.h
|
2008-12-14 14:05:20 +00:00
|
|
|
|
===================================================================
|
2009-08-10 13:22:51 +00:00
|
|
|
|
--- gdb-6.8.50.20090809.orig/gdb/target.h 2009-08-10 14:59:28.000000000 +0200
|
|
|
|
|
+++ gdb-6.8.50.20090809/gdb/target.h 2009-08-10 14:59:58.000000000 +0200
|
2009-08-04 05:37:29 +00:00
|
|
|
|
@@ -524,7 +524,7 @@ struct target_ops
|
2008-12-14 14:05:20 +00:00
|
|
|
|
Return -1 if there is insufficient buffer for a whole entry.
|
|
|
|
|
Return 1 if an entry was read into *TYPEP and *VALP. */
|
|
|
|
|
int (*to_auxv_parse) (struct target_ops *ops, gdb_byte **readptr,
|
|
|
|
|
- gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp);
|
|
|
|
|
+ gdb_byte *endptr, ULONGEST *typep, CORE_ADDR *valp);
|
|
|
|
|
|
|
|
|
|
/* Search SEARCH_SPACE_LEN bytes beginning at START_ADDR for the
|
|
|
|
|
sequence of bytes in PATTERN with length PATTERN_LEN.
|
2009-08-10 13:22:51 +00:00
|
|
|
|
Index: gdb-6.8.50.20090809/gdb/symfile.h
|
2009-08-04 05:37:29 +00:00
|
|
|
|
===================================================================
|
2009-08-10 13:22:51 +00:00
|
|
|
|
--- gdb-6.8.50.20090809.orig/gdb/symfile.h 2009-08-10 14:59:28.000000000 +0200
|
|
|
|
|
+++ gdb-6.8.50.20090809/gdb/symfile.h 2009-08-10 14:59:58.000000000 +0200
|
2009-08-04 05:37:29 +00:00
|
|
|
|
@@ -229,7 +229,13 @@ enum symfile_add_flags
|
|
|
|
|
SYMFILE_MAINLINE = 1 << 2,
|
|
|
|
|
|
|
|
|
|
/* Do not call breakpoint_re_set when adding this symbol file. */
|
|
|
|
|
- SYMFILE_DEFER_BP_RESET = 1 << 3
|
|
|
|
|
+ SYMFILE_DEFER_BP_RESET = 1 << 3,
|
|
|
|
|
+
|
|
|
|
|
+ /* Red Hat PIE patch: Like SYMFILE_MAINLINE but for mainline == 2.
|
|
|
|
|
+ Former code was checking `if (mainline)' being satisfied both by
|
|
|
|
|
+ standard 1 and rare 2, simulate it here. */
|
|
|
|
|
+ SYMFILE_MAINLINE2_ONLY = 1 << 4,
|
|
|
|
|
+ SYMFILE_MAINLINE2_BOTH = SYMFILE_MAINLINE2_ONLY | SYMFILE_MAINLINE
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
extern void syms_from_objfile (struct objfile *,
|