aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1993-09-21 21:21:35 +0000
committerIan Lance Taylor <ian@airs.com>1993-09-21 21:21:35 +0000
commit610a7e7458b46449c5cdedd48079ed974dd5683a (patch)
tree27cef6a12bdbeca44d24cf8d87b5360ae3ebd4ab /gdb
parent89709d42cb37bb82209954709939fdf2c2afc519 (diff)
downloadgdb-610a7e7458b46449c5cdedd48079ed974dd5683a.zip
gdb-610a7e7458b46449c5cdedd48079ed974dd5683a.tar.gz
gdb-610a7e7458b46449c5cdedd48079ed974dd5683a.tar.bz2
* elfread.c (record_minimal_symbol_and_info): Guess the section to
use from the type. * objfiles.c: Include gdb-stabs.h for SECT_* macros. (objfile_relocate): Relocate textlow and texthigh in psymtabs. Relocate partial symbols. Check that minimal SYMBOL_SECTION is nonnegative before using it. * symtab.h: Adjust section field comment.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog18
-rw-r--r--gdb/elfread.c25
-rw-r--r--gdb/objfiles.c29
3 files changed, 70 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index aa3fe96..df51c8b 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,21 @@
+Tue Sep 21 17:06:19 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * elfread.c (record_minimal_symbol_and_info): Guess the section to
+ use from the type.
+ * objfiles.c: Include gdb-stabs.h for SECT_* macros.
+ (objfile_relocate): Relocate textlow and texthigh in psymtabs.
+ Relocate partial symbols. Check that minimal SYMBOL_SECTION is
+ nonnegative before using it.
+ * symtab.h: Adjust section field comment.
+
+ * remote.c (interrupt_query): New function.
+ (remote_interrupt_twice): Call interrupt_query.
+ (putpkt, getpkt): If quit_flag is set, call interrupt_query.
+ (remote_wait): Don't bother with objfile_relocate if the addresses
+ haven't changed.
+ (remote_fetch_registers): If we see a packet that doesn't start
+ with a hex character, fetch a new one.
+
Tue Sep 21 11:44:00 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
* remote.c, remote-utils.c: Use SERIAL_FLUSH_INPUT after opening it.
diff --git a/gdb/elfread.c b/gdb/elfread.c
index fc74813..5112e51 100644
--- a/gdb/elfread.c
+++ b/gdb/elfread.c
@@ -173,8 +173,31 @@ record_minimal_symbol_and_info (name, address, ms_type, info, objfile)
char *info; /* FIXME, is this really char *? */
struct objfile *objfile;
{
+ int section;
+
+ /* Guess the section from the type. This is likely to be wrong in
+ some cases. */
+ switch (ms_type)
+ {
+ case mst_text:
+ case mst_file_text:
+ section = SECT_OFF_TEXT;
+ break;
+ case mst_data:
+ case mst_file_data:
+ section = SECT_OFF_DATA;
+ break;
+ case mst_bss:
+ case mst_file_bss:
+ section = SECT_OFF_BSS;
+ break;
+ default:
+ section = -1;
+ break;
+ }
+
name = obsavestring (name, strlen (name), &objfile -> symbol_obstack);
- prim_record_minimal_symbol_and_info (name, address, ms_type, info, -1);
+ prim_record_minimal_symbol_and_info (name, address, ms_type, info, section);
}
/*
diff --git a/gdb/objfiles.c b/gdb/objfiles.c
index 060409d..30a0aad 100644
--- a/gdb/objfiles.c
+++ b/gdb/objfiles.c
@@ -26,6 +26,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "symtab.h"
#include "symfile.h"
#include "objfiles.h"
+#include "gdb-stabs.h"
#include <sys/types.h>
#include <sys/stat.h>
@@ -474,9 +475,35 @@ objfile_relocate (objfile, new_offsets)
}
{
+ struct partial_symtab *p;
+
+ ALL_OBJFILE_PSYMTABS (objfile, p)
+ {
+ p->textlow += ANOFFSET (delta, SECT_OFF_TEXT);
+ p->texthigh += ANOFFSET (delta, SECT_OFF_TEXT);
+ }
+ }
+
+ {
+ struct partial_symbol *psym;
+
+ for (psym = objfile->global_psymbols.list;
+ psym < objfile->global_psymbols.next;
+ psym++)
+ if (SYMBOL_SECTION (psym) >= 0)
+ SYMBOL_VALUE_ADDRESS (psym) += ANOFFSET (delta, SYMBOL_SECTION (psym));
+ for (psym = objfile->static_psymbols.list;
+ psym < objfile->static_psymbols.next;
+ psym++)
+ if (SYMBOL_SECTION (psym) >= 0)
+ SYMBOL_VALUE_ADDRESS (psym) += ANOFFSET (delta, SYMBOL_SECTION (psym));
+ }
+
+ {
struct minimal_symbol *msym;
ALL_OBJFILE_MSYMBOLS (objfile, msym)
- SYMBOL_VALUE_ADDRESS (msym) += ANOFFSET (delta, SYMBOL_SECTION (msym));
+ if (SYMBOL_SECTION (msym) >= 0)
+ SYMBOL_VALUE_ADDRESS (msym) += ANOFFSET (delta, SYMBOL_SECTION (msym));
}
{