* 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.
This commit is contained in:
parent
89709d42cb
commit
610a7e7458
3 changed files with 70 additions and 2 deletions
|
@ -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)
|
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.
|
* remote.c, remote-utils.c: Use SERIAL_FLUSH_INPUT after opening it.
|
||||||
|
|
|
@ -173,8 +173,31 @@ record_minimal_symbol_and_info (name, address, ms_type, info, objfile)
|
||||||
char *info; /* FIXME, is this really char *? */
|
char *info; /* FIXME, is this really char *? */
|
||||||
struct objfile *objfile;
|
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);
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -26,6 +26,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||||
#include "symtab.h"
|
#include "symtab.h"
|
||||||
#include "symfile.h"
|
#include "symfile.h"
|
||||||
#include "objfiles.h"
|
#include "objfiles.h"
|
||||||
|
#include "gdb-stabs.h"
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
@ -473,9 +474,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;
|
struct minimal_symbol *msym;
|
||||||
ALL_OBJFILE_MSYMBOLS (objfile, msym)
|
ALL_OBJFILE_MSYMBOLS (objfile, msym)
|
||||||
|
if (SYMBOL_SECTION (msym) >= 0)
|
||||||
SYMBOL_VALUE_ADDRESS (msym) += ANOFFSET (delta, SYMBOL_SECTION (msym));
|
SYMBOL_VALUE_ADDRESS (msym) += ANOFFSET (delta, SYMBOL_SECTION (msym));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue