From Daniel Jacobowitz <drow@mvista.com>
* dbxread.c (dbx_symfile_read): Only reinitialize
the psymbol list if mainline or if both static
and global lists are empty.
* dwarf2read.c (dwarf2_build_psymtabs): Likewise.
* dwarfread.c (dwarf_build_psymtabs): Likewise.
* xcoffread.c (xcoff_initial_scan): Likewise.
* os9kread.c (os9k_symfile_read): Likewise.
* blockframe.c (find_pc_sect_partial_function): Add braces to avoid
possible nested-if confusion.
* breakpoint.c (breakpoint_here_p): Ditto.
(breakpoint_inserted_here_p): Ditto.
(breakpoint_thread_match): Ditto.
* gnu-regex.c: Define _REGEX_RE_COMP only if it isn't already defined.
* gnu-regex.h: Define _REGEX_RE_COMP to pick up old compatability
prototypes.
* symtab.h: Add prototype for _initialize_source.
* value.h: Add prototype for _initialize_value.
* defs.h: Include sys/types.h or stddef.h to get size_t.
(make_cleanup): Add make_cleanup_func typedef and switch to using
a prototype for this function.
(mfree): Add prototypes for mmalloc, mrealloc, mfree if we aren't
using mmalloc.
* ax-gdb.c breakpoint.c coffread.c corelow.c dbxread.c dwarf2read.c
dwarfread.c elfread.c eval.c exec.c gdbtk-cmds.c gdbtk.c infcmd.c
infrun.c mipsread.c nlmread.c os9kread.c parse.c printcmd.c symfile.c
symmisc.c symtab.c thread.c top.c tracepoint.c typeprint.c valops.c:
Cast parameters passed to make_cleanup to use the new
make_cleanup_func typedef.
More warning cleanups. There are still a bunch of places where the first
argument to make_cleanup is not cast to (make_cleanup_func); these are
either due to the function fitting the make_cleanup_func specification
already (e.g. free()) or they are in files that weren't compiled when
I did my make on a Linux native system. Bwahahaha. You can see them
like this:
grep make_cleanup\ * | grep -v make_cleanup_func
I'll surely go back and clean up the remaining suspicious calls in
GDB one of these days. :-)
Only worked if the first element in the list was
being deleted.
o When MAINLINE (reading main objectfile and need to
clear out old data), change elfread.c so that the
psymbol table is emptied once (in elf_symfile_read)
instead of multiple times in each *_read_psymtab
function.
o For elf_symfile_read, load dwarf2 symbols last
(so that they are searched for first).
o In mdebug_psymtab_read, delete check to see if
symbols for current source file already loaded.
Test doesn't work for .h files. Above change
works better
(record_debugformat): Declare global function.
* buildsym.c (start_subfile): Initialize debugformat member
to NULL.
(record_debugformat): New function to record the format.
(end_symtab): Copy format into symtab debugformat member.
(end_symtab): Free subfile debugformat member.
* symmisc.c (free_symtab): Free debugformat when freeing
symtab.
* symfile.c (allocate_symtab): Initialize the new debugformat
member for new symtabs.
* symtab.h (struct symtab): Add debugformat member.
* source.c (source_info): Print the debug format.
* os9kread.c (os9k_process_one_symbol): Call record_debugformat
with "OS9".
* hpread.c (hpread_expand_symtab): Call record_debugformat
with "HP".
(hpread_process_one_debug_symbol): Ditto.
* dbxread.c (process_one_symbol): Call record_debugformat
with "stabs".
* coffread.c (coff_start_symtab): Call record_debugformat
with "COFF".
* xcoffread.c (read_xcoff_symtab): Call record_debugformat
with "XCOFF".
* dwarfread.c (read_file_scope): Call record_debugformat
with "DWARF 1".
* dwarf2read.c (read_file_scope): Call record_debugformat
with "DWARF 2".
* dstread.c (dst_end_symtab): Set debugformat to be
"Apollo DST".
* mdebugread.c (new_symtab): Set debugformat to be "ECOFF".
* dbxread.c (dbx_symfile_read): Call free_pending_blocks rather
than poking global variable (which is now static).
* hpread.c (hpread_build_psymtabs): Ditto.
* os9kread.c (os9k_symfile_read): Ditto.
* xcoffread.c (xcoff_initial_scan): Ditto.
* buildsym.h (free_pending_blocks): Declare here.
(pending_blocks): Remove declaration of global symbol.
(free_pendings): Remove declaration of global symbol.
(make_blockvector): Declare here.
(record_pending_block): Declare here.
* dstread.c (make_blockvector): Remove static copy that was old
clone of version in buildsym.c.
(process_dst_block): Call record_pending_block rather than doing
it by hand.
(read_dst_symtab): Ditto.
* buildsym.c (make_blockvector): Make global rather than static,
(record_pending_block): New function, code moved from finish_block.
(finish_block): Use record_pending_block.
(free_pending_blocks): New function.
(really_free_pendings): Call free_pending_blocks.
(pending_blocks): Make static instead of global.
(free_pendings): Make static instead of global.
mdebugread.c os9kread.c source.c top.c utils.c: Don't
include param.h or sys/file.h (or unistd.h in some cases).
* defs.h exec.c inflow.c remote-array.c remote-e7000.c
sparcl-tdep.c terminal.h utils.c: Replace all occurances of
__WIN32__, WINGDB, WIN32, etc... with _WIN32.
* main.c: Remove #ifndef WINGDB around option processing. Fix
bug with passing argc==0 and argv==NULL to getopt.
* (main) Remove calls to access() before source_command. Let
soure_command handle access errors.
* maint.c (maintenance_dump_me): #ifdef out for _WIN32.
* symtab.c (operator_chars): Make this global for wingdb.
* top.c (disconnect): #ifdef out for _WIN32.
* (source_command): If got an error and from_tty, then call print
error, else just return quietly.
* utils.c (fatal_dump_core): Can't kill ourselves under windows.
Just exit.
* (pollquit notice_quit): #ifdef out stuff that doesn't exist
under windows.
* coffread.c (record_minimal_symbol): Don't presave name string
on symbol_obstack before passing to prim_record_minimal_symbol.
It now handles saving the string itself.
* dbxread.c (read_dbx_dynamic_symtab): Ditto.
* mipsread.c (read_alphacoff_dynamic_symtab): Ditto.
* os9kread.c (record_minimal_symbol): Ditto.
* solib.c (solib_add_common_symbols): Ditto.
* coffread.c (coff_symtab_read): Don't presave name string on
symbol_obstack before passing to prim_record_minimal_symbol_and_info.
It now handles saving the string itself.
* dbxread.c (record_minimal_symbol): Ditto.
* elfread.c (record_minimal_symbol_and_info): Ditto.
* dstread.c (record_minimal_symbol): Remove static function that just
called prim_record_minimal_symbol with the same args (after change to
prim_record_minimal_symbol to do it's own name string saves).
* nlmread.c (record_minimal_symbol): Ditto.
* somread.c (record_minimal_symbol): Ditto.
* hpread.c (hpread_read_enum_type): Save symbol name on symbol obstack.
(hpread_read_function_type): Ditto.
(hpread_process_one_debug_symbol): Ditto.
* mdebugread.c (parse_symbol): Ditto.
(new_symbol): Ditto.
* minsyms.c (prim_record_minimal_symbol_and_info): Ditto.
* coffread.c (process_coff_symbol): Use obsavestring to save
SYMBOL_NAME, rather than obstack_copy0.
* dstread.c (create_new_symbol): Ditto
* symfile.c (obconcat): Ditto.
* stabsread.c (patch_block_stabs): Ditto.
* xcoffread.c (SYMNAME_ALLOC): Ditto.
* symfile.c (obsavestring): Update comments
* solib.c (solib_add_common_symbols): Remove local var origname.
(add_psymbol_to_list): Add an arg for passing CORE_ADDR values and
use it, rather than calling add_psymbol_addr_to_list.
(add_psymbol_addr_to_list): Delete.
(add_psymbol_to_list): Make psymbol static to avoid random data in
gaps due to alignment of structure members.
* symfile.h (INLINE_ADD_PSYMBOL, ADD_PSYMBOL_TO_LIST,
ADD_PSYMBOL_ADDR_TO_LIST): Remove. Real world tests show no
performance improvements by inlining via complicated macros and
they just make gdb larger and harder to maintain.
* dwarfread.c (add_enum_psymbol): Replace ADD_PSYMBOL_TO_LIST
and/or ADD_PSYMBOL_ADDR_TO_LIST macro(s) with call to
add_psymbol_to_list with appropriate long or CORE_ADDR args.
(add_partial_symbol): Ditto.
* partial-stab.h: Ditto.
* os9kread.c (read_os9k_psymtab): Ditto
* mdebugread.c (parse_partial_symbols): Ditto.
(handle_psymbol_enumerators): Ditto.
(demangle.h): Include.
* hpread.c (hpread_build_psymtabs): Ditto.
(hpread_build_psymtabs): Ditto.
(demangle.h): Include
assumption that an int can hold a char *.
* bcache.h (struct hashlink): Wrap data[] inside union with
double to force longest alignment.
(BCACHE_DATA): New macro to access data[].
(BCACHE_ALIGNMENT): New macro to get offset to data[].
* bcache.c (lookup_cache, bcache): Use BCACHE_DATA to get
address of cached data. Use BCACHE_ALIGNMENT to compute
amount of space to allocate for each hashlink struct.
* Makefile.in (SFILES): Add bcache.c.
(symtab_h): Add bcache.h.
(HFILES_NO_SRCDIR): add bcache.h
(COMMON_OBJS): Add bcache.o
(bcache.o): New target.
* dbxread.c (start_psymtab): Make global_syms & static_syms
type "partial_symbol **".
* hpread.c (hpread_start_symtab): Ditto.
* os9kread.c (os9k_start_psymtab): Ditto.
* stabsread.h (start_psymtab): Ditto.
* {symfile.c, symfile.h} (start_psymtab_common): Ditto.
* maint.c (maintenance_print_statistics): Call
print_symbol_bcache_statistics.
* objfiles.c (allocate_objfile): Initialize psymbol bcache malloc
and free pointers.
* solib.c (allocate_rt_common_objfile): Ditto.
* symfile.c (reread_symbols): Ditto.
(free_objfile): Free psymbol bcache when objfile is freed.
(objfile_relocate): Use new indirect psymbol pointers.
* objfiles.h (struct objfile): Add psymbol cache.
* symfile.c (compare_psymbols): Now passed pointers to pointers to
psymbols.
(reread_symbols): Free psymbol bcache when freeing other objfile
resources.
(add_psymbol_to_list, add_psymbol_addr_to_list): Initialize new
psymbol using the psymbol bcache.
(init_psymbol_list): Psymbol lists now contain pointers rather than
the actual psymbols.
* symfile.h (psymbol_allocation_list): Psymbol lists now dynamically
grown arrays of pointers.
(ADD_PSYMBOL_VT_TO_LIST): Initialize new symbol using the psymbol
bcache.
* symmisc.c (print_partial_symbols): Now takes pointer to pointer
to partial symbol.
(print_symbol_bcache_statistics): New function to print per objfile
bcache statistics.
(print_partial_symbol, print_partial_symbols,
maintenance_check_symtabs, extend_psymbol_list):
Account for change to pointer to pointer to partial symbol.
* symtab.c (find_pc_psymbol, lookup_partial_symbol, decode_line_2,
make_symbol_completion_list):
Account for change to pointer to pointer to partial symbol.
* symtab.h (bcache.h): Include.
* xcoffread.c (xcoff_start_psymtab): Make global_syms & static_syms
type "partial_symbol **".
arguments. Sorting is now dependent on OBJF_REORDERED. All
callers/references changed.
* dbxread.c (read_ofile_symtab): Correctly determine value for
last_source_start_addr for reordered executables.
(process_one_symbol): Handle N_FUN with no name as an end of
function marker.
* partial-stab.h (case N_FN, N_TEXT): Don't assume CUR_SYMBOL_VALUE
is the high text address for a psymtab.
(case N_SO): Likewise.
(case N_FUN): Handle N_FUN with no name as an end of function
marker.
* minsyms.c (lookup_minimal_symbol_by_pc): Examine all symbols
at the same address rather than a random subset of them.
* coffread.c (coff_symfile_init): Set OBJF_REORDERED.
* elfread.c (elf_symfile_init): Similarly.
* somread.c (som_symfile_init): Similarly.
* xcoffread.c (xcoff_symfile_init): Similarly.
Support for debugging reordered executables. Remaining mentor vm
changes.
(coffstab_build_psymtabs): Remove staboff and stabsize parameters.
Add textaddr, textsize, and stabs parameters.
* gdb-stabs.h (struct dbx_symfile_info): Remove text_sect field.
Add text_addr and text_size fields.
(DBX_TEXT_SECT): Don't define.
(DBX_TEXT_ADDR, DBX_TEXT_SIZE): Define.
* coffread.c: Include <ctype.h>.
(struct coff_symfile_info): Remove stabsect and stabindexsect
fields. Add textaddr, textsize, and stabsects fields.
(coff_locate_sections): Record the address of the .text section,
and total the sizes of all sections with names beginning with
".text". Don't bother to record a .stab.index section (COFF
doesn't use them). Make a linked list of all sections with names
beginning with ".stab".
(coff_symfile_read): Adjust call to coffstab_build_psymtabs for
new parameters.
* dbxread.c (dbx_symfile_read): Use DBX_TEXT_ADDR and
DBX_TEXT_SIZE, rather than getting both from DBX_TEXT_SECT.
(dbx_symfile_init): Set DBX_TEXT_ADDR and DBX_TEXT_SIZE, not
DBX_TEXT_SECT.
(elfstab_build_psymtabs): Likewise.
(stabsect_build_psymtabs): Likewise.
(symbuf_sections, symbuf_left, symbuf_read): New static variables.
(fill_symbuf): If symbuf_sections is not NULL, read symbols from
multiple sections.
(coffstab_build_psymtabs): Remove staboffset and stabsize
parameters. Add textaddr, textsize, and stabsects parameters.
Set DBX_TEXT_ADDR and DBX_TEXT_SIZE, not DBX_TEXT_SECT. Handle
multiple stabs sections.
* os9kread.c (os9k_symfile_read): Use DBX_TEXT_ADDR and
DBX_TEXT_SIZE, rather than getting both from DBX_TEXT_SECT.
(os9k_symfile_init): Set DBX_TEXT_ADDR and DBX_TEXT_SIZE, not
DBX_TEXT_SECT.
PR 7241.
* symfile.c, symfile.h (init_psymbol_list): New function;
consolidate duplicated copies from os9kread.c, dbxread.c
and dwarfread.c.
* defs.h: Declare info_verbose.
* xcoffread.c: Extensive changes to support psymtabs.
Move "no debugging symbols found" test to symfile.c.
* symfile.c (syms_from_objfile, reread_symbols): Add
"no debugging symbols found" test.
* coffread.c (init_stringtab): Handle stripped files with a
stringtab offset of zero gracefully.
* osfsolib.c (solib_create_inferior_hook): Use DYNAMIC flag from
BFD instead of stop_pc heuristic to determine if it is a dynamically
linked object file.
* procfs.c (wait_fd): Handle ENOENT error return from PIOCWSTOP
ioctl, it indicates that the process has exited.
ChangeLog remote-os9k.c os9kread.c stabsread.c
* remote-os9k.c (rombug_fetch_registers): set trace mode
correctly.
* remote-os9k.c (rombug_read_inferior_memory): cache data in
buffer.
* os9kread,c (read_os9k_psymtab): process file symbol to truncate
extra info.
* os9kread.c (os9k_read_ofile_symtab): proper casting of args
passed to process_one_symbol.
* stabsread.c (read_type): process os9k functio prototype.
ChangeLog os9kread.c remote-os9k.c
* os9kread.c (record_minmal_symbol): add section_offset to
relocate minimal symbol table.
* os9kread.c (read_minimal_symbols): ditto.
* os9kread.c (os9k_symfile_init): increase size of dbg and stb
file names.
* os9kread.c (read_os9k_psymtab): if there's no dbg file, just
return. Also if file addr is 0 leave it 0, not to relocate.
* remote-os9k.c (_initialize_remote_os9k): add 'set remotexon',
'set remotexoff' and 'set remotelog' commands.
ChangeLog os9kread.c stabsread.c remote-os9k.c symfile.c
target.c
* os9kread.c (fill_sym): check compiler verion number for pre-
UltraC compiler.
* os9kread.c (os9k_process_one_symbol): address of symbol is
relative to section not module.
* stabsread.c (define_symbol): add symbol type 's' as local
symbol for os9k.
* remote-os9k.c: add command 'set monitor_log' to turn on or off
monitor logging.
* remote-os9k.c: fix bug in delete breakpoint, single step trace.
* remote-os9k.c: fix bug in 'set remotebaud' function.
* remote-os9k.c (rombug_link): minimize checking so to improve
speed.
* symfile.c (symfile_command): check if failed to link, also make
the command be able to accept more than one filenames.
* target.c (target_link): check if failed to link with rombug.
VARIABLES_INSIDE_BLOCK to OS9K_VARIABLES_INSIDE_BLOCK.
* symfile.c (symbol_file_command): Check for (CORE_ADDR)-1, not
(CORE_ADDR)0, from target_link, since that is what it uses.
Process name at end, not during parsing (like we did before Kung's
change), so that -readnow and -mapped can appear anywhere.
Make text_relocation a local variable.
* config/i386/i386os9k.mt: Fix comment.
* Makefile.in (ALLDEPFILES): Add remote-os9k.c.
* os9kread.c: Put "comments" after #endif inside /* */.
* stabsread.h: Add os9k_stabs variable.
* stabsread.c (start_stabs), os9kread.c (os9k_process_one_symbol):
Set it.
* stabsread.c (define_symbol): If os9k_stabs, put a 'V' symbol
descriptor in global_symbols not local_symbols.
(read_type): If os9k_stabs, accept 'c', 'i', and 'b' type
descriptors.
(read_type): If os9k_stabs, accept function parameters after 'f'
type descriptor.
(read_array_type): If os9k_stabs, don't expect index type and
expect lower and upper to be separated by ',' not ';'.
(read_enum_type): If os9k_stabs, read a number before the first
enumeration constant.
(os9k_init_type_vector): New function.
(dbx_lookup_type): Call it when starting new type vector.
* config/i386/tm-i386os9k.h: Define BELIEVE_PCC_PROMOTION.
* (os9k_process_one_symbol): Call define_symbol not os9k_define_symbol.
* os9kstab.c: Removed.
* Makefile.in: Update accordingly.
* objfiles.c (objfile_relocate_data): Removed.
* remote-os9k.c (rombug_wait): Call objfile_relocate
not objfile_relocate_data.
* objfiles.h, objfiles.c: Remove find_pc_objfile.
* remote-os9k.c (rombug_wait): Call find_pc_section not
find_pc_objfile.
* main.c (quit_command): Check inferior_pid; revert Kung change.
* remote-os9k.c (rombug_create_inferior): Set inferior_pid.
ChangeLog objfiles.c objfiles.h symfile.c target.c main.c
Makefile.in configure.in
Added Files:
os9kread.c os9kstab.c remote-os9k.c
* os9kread.c: New file to read os9000 style symbo table.
* os9kstab.c: new file to read os9000 style stabs.
* remote-os9k.c: remote protocol talking to os9000 rombug monitor.
* objfiles.c (find_pc_objfile): new function to search objfile
from pc.
* objfiles.c (objfile_relocate_data): new function to relocate
data symbols in symbol table.
* objfiles.h: Add two aux fields in struct objfile to handle
multiple symbol table files situation like in os9000.
* symfile.c: Change so 'symbol-file' command can handle multiple
files. Also call target_link() to get relocation infos.
* target.c (target_link): new function to get relocation info when
a symbol file is requested to load.
* main.c (quit_command): take out 'inferior_pid != 0' condition,
because in cross mode there's no inferior pid, bit they need to
be detached.
Makefile.in: add os9kread.c os9kstab.c and .o's.
configure.in: add i386os9k target.
config/i386/i386os9k.mt: new add.
config/i386/tm-i386os9k.h: new add.