forked from Imagelibrary/binutils-gdb
* symfile.c (symbol_file_add_with_addrs_or_offsets): New function,
like the old symbol_file_add, but taking new arguments: you can now pass in either a `struct section_addr_info' list to say where each section is loaded, or a `struct section_offsets' table. Pass these new arguments through to syms_from_objfile as appropriate. (symbol_file_add): Just call symbol_file_add_with_addrs_or_offsets, with the appropriate quiescent values for the new arguments.
This commit is contained in:
@@ -1,5 +1,13 @@
|
|||||||
2002-11-25 Jim Blandy <jimb@redhat.com>
|
2002-11-25 Jim Blandy <jimb@redhat.com>
|
||||||
|
|
||||||
|
* symfile.c (symbol_file_add_with_addrs_or_offsets): New function,
|
||||||
|
like the old symbol_file_add, but taking new arguments: you can
|
||||||
|
now pass in either a `struct section_addr_info' list to say where
|
||||||
|
each section is loaded, or a `struct section_offsets' table. Pass
|
||||||
|
these new arguments through to syms_from_objfile as appropriate.
|
||||||
|
(symbol_file_add): Just call symbol_file_add_with_addrs_or_offsets,
|
||||||
|
with the appropriate quiescent values for the new arguments.
|
||||||
|
|
||||||
* symfile.c: #include "gdb_assert.h".
|
* symfile.c: #include "gdb_assert.h".
|
||||||
(syms_from_objfile): Add the ability to pass in a section offset
|
(syms_from_objfile): Add the ability to pass in a section offset
|
||||||
table directly, as an alternative to the section_addr_info table.
|
table directly, as an alternative to the section_addr_info table.
|
||||||
|
|||||||
@@ -866,17 +866,24 @@ new_symfile_objfile (struct objfile *objfile, int mainline, int verbo)
|
|||||||
|
|
||||||
NAME is the file name (which will be tilde-expanded and made
|
NAME is the file name (which will be tilde-expanded and made
|
||||||
absolute herein) (but we don't free or modify NAME itself).
|
absolute herein) (but we don't free or modify NAME itself).
|
||||||
FROM_TTY says how verbose to be. MAINLINE specifies whether this
|
|
||||||
is the main symbol file, or whether it's an extra symbol file such
|
FROM_TTY says how verbose to be.
|
||||||
as dynamically loaded code. If !mainline, ADDR is the address
|
|
||||||
where the text segment was loaded.
|
MAINLINE specifies whether this is the main symbol file, or whether
|
||||||
|
it's an extra symbol file such as dynamically loaded code.
|
||||||
|
|
||||||
|
ADDRS, OFFSETS, and NUM_OFFSETS are as described for
|
||||||
|
syms_from_objfile, above. ADDRS is ignored when MAINLINE is
|
||||||
|
non-zero.
|
||||||
|
|
||||||
Upon success, returns a pointer to the objfile that was added.
|
Upon success, returns a pointer to the objfile that was added.
|
||||||
Upon failure, jumps back to command level (never returns). */
|
Upon failure, jumps back to command level (never returns). */
|
||||||
|
static struct objfile *
|
||||||
struct objfile *
|
symbol_file_add_with_addrs_or_offsets (char *name, int from_tty,
|
||||||
symbol_file_add (char *name, int from_tty, struct section_addr_info *addrs,
|
struct section_addr_info *addrs,
|
||||||
int mainline, int flags)
|
struct section_offsets *offsets,
|
||||||
|
int num_offsets,
|
||||||
|
int mainline, int flags)
|
||||||
{
|
{
|
||||||
struct objfile *objfile;
|
struct objfile *objfile;
|
||||||
struct partial_symtab *psymtab;
|
struct partial_symtab *psymtab;
|
||||||
@@ -929,7 +936,8 @@ symbol_file_add (char *name, int from_tty, struct section_addr_info *addrs,
|
|||||||
gdb_flush (gdb_stdout);
|
gdb_flush (gdb_stdout);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
syms_from_objfile (objfile, addrs, 0, 0, mainline, from_tty);
|
syms_from_objfile (objfile, addrs, offsets, num_offsets,
|
||||||
|
mainline, from_tty);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We now have at least a partial symbol table. Check to see if the
|
/* We now have at least a partial symbol table. Check to see if the
|
||||||
@@ -980,6 +988,19 @@ symbol_file_add (char *name, int from_tty, struct section_addr_info *addrs,
|
|||||||
return (objfile);
|
return (objfile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Process a symbol file, as either the main file or as a dynamically
|
||||||
|
loaded file. See symbol_file_add_with_addrs_or_offsets's comments
|
||||||
|
for details. */
|
||||||
|
struct objfile *
|
||||||
|
symbol_file_add (char *name, int from_tty, struct section_addr_info *addrs,
|
||||||
|
int mainline, int flags)
|
||||||
|
{
|
||||||
|
return symbol_file_add_with_addrs_or_offsets (name, from_tty, addrs, 0, 0,
|
||||||
|
mainline, flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Call symbol_file_add() with default values and update whatever is
|
/* Call symbol_file_add() with default values and update whatever is
|
||||||
affected by the loading of a new main().
|
affected by the loading of a new main().
|
||||||
Used when the file is supplied in the gdb command line
|
Used when the file is supplied in the gdb command line
|
||||||
|
|||||||
Reference in New Issue
Block a user