* Makefile.in (ALLDEPFILES): Add hpread.c.

(hpread.o): Add dependencies.

        * somread.c: Do not include "aout/aout64.h".  SOM has nothing to
        do with a.out.
        (BYTES_IN_WORD): Delete.
        (som_symfile_read): Call hpread_build_psymtabs to build any
        minimal symbols based on the HP C native debug symbols.
        (som_symfile_finish): Call hpread_symfile_finish.
        (som_symfile_init): Call hpread_symfile_init.
        * config/pa/tm-hppa.h (HPREAD_ADJUST_STACK_ADDRESS): Define.
        * hppa-tdep.c (hpread_adjust_stack_address): New function.

        * config/pa/hppabsd.mh (NATDEPFILES): Add hpread.o
        * config/pa/hppahpux.mh (NATDEPFILES): Likewise.
        * hpread.c: New file.
This commit is contained in:
Jeff Law 1994-08-19 16:48:51 +00:00
parent 36d4f4d851
commit 98c0e047bd
9 changed files with 2369 additions and 13 deletions

View File

@ -43,6 +43,20 @@ else
fi
fi
hpread_files="hpread.c ChangeLog.hpread"
if ( echo $* | grep keep\-hpread > /dev/null ) ; then
keep_these_too="${hpread_files} ${keep_these_too}"
if [ -n "${verbose}" ] ; then
echo Keeping ${hpread_files}
fi
else
lose_these_too="${hpread_files} ${lose_these_too}"
if [ -n "${verbose}" ] ; then
echo Deleting ${hpread_files}
fi
fi
# All files listed between the "Things-to-keep:" line and the
# "Files-to-sed:" line will be kept. All other files will be removed.
# Directories listed in this section will have their own Sanitize
@ -372,4 +386,30 @@ else
done
fi
echo Removing traces of \"hpread\"...
# Don't try to clean directories here, as the 'mv' command will fail.
# Also, grep fails on NFS mounted directories.
if ( echo $* | grep keep\-hpread > /dev/null ) ; then
for i in * ; do
if test ! -d $i && (grep sanitize-hpread $i > /dev/null) ; then
echo Keeping hpread stuff in $i
fi
done
else
for i in * ; do
if test ! -d $i && (grep sanitize-hpread $i > /dev/null) ; then
echo Removing traces of \"hpread\" out of $i...
cp $i new
sed '/start\-sanitize\-hpread/,/end-\sanitize\-hpread/d' < $i > new
if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
echo Caching $i in .Recover...
mv $i .Recover
fi
mv new $i
fi
done
fi
# End of file.

204
gdb/ChangeLog.hpread Normal file
View File

@ -0,0 +1,204 @@
Fri Aug 19 10:36:15 1994 Jeff Law (law@snake.cs.utah.edu)
* Makefile.in (ALLDEPFILES): Add hpread.c.
(hpread.o): Add dependencies.
* somread.c: Do not include "aout/aout64.h". SOM has nothing to
do with a.out.
(BYTES_IN_WORD): Delete.
(som_symfile_read): Call hpread_build_psymtabs to build any
minimal symbols based on the HP C native debug symbols.
(som_symfile_finish): Call hpread_symfile_finish.
(som_symfile_init): Call hpread_symfile_init.
* config/pa/tm-hppa.h (HPREAD_ADJUST_STACK_ADDRESS): Define.
* hppa-tdep.c (hpread_adjust_stack_address): New function.
* config/pa/hppabsd.mh (NATDEPFILES): Add hpread.o
* config/pa/hppahpux.mh (NATDEPFILES): Likewise.
* hpread.c: New file.
Fri Aug 12 19:30:53 1994 Jeff Law (law@snake.cs.utah.edu)
* hpread.c: Delete rest of TODO list. Do not include "libbfd.h",
<time.h>, <sys/types.h>, "demangle.h", <sys/file.h>,
"expression.h", "language.h", "gdbtypes.h", "demangleh".
Move all global variables into the private symbol table structure
and add accessor macros. Update some comments.
(hpread_build_psymtabs): Delete dbsubc_addr, we don't need it.
(hpread_end_psymtab): New function to end a partial symbol table,
all callers changed (no more bogus sharing with dbxread.c).
Mon Aug 08 15:34:13 1994 Jeff Law (law@snake.cs.utah.edu)
* hpread.c (hpread_process_one_debug_symbol): Fix block scoping
problem (losing localvars on the close-brace instead of after
the close brace).
Wed Jul 06 12:39:07 1994 Jeff Law (law@snake.cs.utah.edu)
* hpread.c: More cleanups. Delete lots of trailing whitespace.
Remove some items from the TODO list and notes throughout code
for things which need fixing. Add more comments.
Document bogus struct symloc sharing with dbxread.c. Delete more
useless variables. Add more PARAM prototypes. Fixup more
indention problems that have crept in.
(SET_NAMESTRING): Accept new namep and objfile arguments so that
it doesn't depend on the variable names on the procedures it's
used from.
(hpread_symfile_init): Delete incorrect checks for bogus sizes of
the debug sections.
Mon Jul 04 19:48:03 1994 Jeff Law (law@snake.cs.utah.edu)
* hpread.c (hpread_symfile_init): Make sure to initialize all the
private data to zero. Not having any HP C debug symbols is not an
error. Just return.
Fri Jul 01 19:50:21 1994 Jeff Law (law@snake.cs.utah.edu)
* hpread.c: Change contribution notice to the Cygnus/Utah agreed
upon notice. Delete some stuff from the TODO list. Rework
many comments to be clearer. Major cleanups. Consistently
use "hpread_" prefix. Delete unnecessary macros, structures
variables, fiels, functions and #if 0 code. Mark code which
still needs to be cleaned up. PARAMize and make most functions
static. Fix error checking when reading in the debug section
contents. No more minimal symbol table handling in this code!
Mon Mar 21 10:09:06 1994 Jeff Law (law@snake.cs.utah.edu)
* hpread.c (_initialize_hpuxread): Don't call add_symtab_fns if
HPREAD is not defined.
Sun Mar 13 17:19:03 1994 Jeff Law (law@snake.cs.utah.edu)
* hpread.c (read_hpux_symtab: Correctly determine the namespace
and address class of SVAR, DVAR, TYPEDEF, TAGDEF, CONST, and
MEMENUM symbols. Do not include function-scoped variables in
the partial symbol table.
Sun Feb 6 15:56:09 1994 Jeff Law (law@wild.cs.utah.edu)
* hpread.c (hpux_symfile_init): Use obj_som_* rather than obj_* to
access BFD private data. Search for the "$TEXT$" space rather
than ".text".
(hppa_sym_fns): Add bfd target flavour to initializer.
Thu Dec 16 09:14:58 1993 Jeff Law (law@snake.cs.utah.edu)
* hpread.c (read_hp_function_type): Correctly handle
pass-by-value structures > 64bits in size.
(process_one_debug_symbol): Likewise.
Tue Nov 2 03:01:01 1993 Jeff Law (law@snake.cs.utah.edu)
* hpread.c: Include <time.h> and <sys/types.h>. Change include
of "libhppa.h" to "som.h".
(BYTES_IN_WORD): Define.
(hppa_sym_fns): "hppa" is 4 characters, not 5.
Wed Sep 29 17:20:54 1993 Jeff Law (law@snake.cs.utah.edu)
* hpread.c (read_hpux_symtab): When a K_END is found for a
K_MODULE, clear the have_module and have_name flags.
Sun Aug 22 22:50:32 1993 Jeff Law (law@snake.cs.utah.edu)
* hpread.c (get_textlow): Don't go past a K_END when looking for a
K_FUNCTION. Avoids losing on source files with no functions.
Wed Aug 18 21:42:52 1993 Jeff Law (law@snake.cs.utah.edu)
* hpread.c (read_hpux_symtab): Call SET_NAMESTRING for K_MODULE
debug symbols.
Mon Aug 16 09:52:33 1993 Jeff Law (law@snake.cs.utah.edu)
* hpread.c: Add U Utah contribution notice. Add TODO list.
(hp_type_lookup): Use TYPE_NAME and TYPE_TAG_NAME.
(process_one_debug_symbol): Likewise.
Tue Jul 20 14:14:59 1993 Jeff Law (law@snake.cs.utah.edu)
* hpread.c (read_hp_array_type): Handle "char foo[]".
Thu Jul 1 15:46:10 1993 Jeff Law (law@snake.cs.utah.edu)
* hpread.c: Run through gnu-indent.
Mon Jun 28 19:00:21 1993 Jeff Law (law@snake.cs.utah.edu)
* hpread.c: Do not include libhppax. Instead include libhppa.h
and hpux-symtab.h. Misc indention fixes.
(find_unwind_entry): Add PARAM prototype.
(read_hpux_symtab): More fixes for names and sizes of structs,
unions, enums, typedefs, and tagdefs.
(read_hp_enum_type, read_hp_struct_type): Likewise.
(read_hp_set_type, read_hp_subrange_type): Likewise.
(hp_type_lookup, process_one_debug_symbol): Likewise.
(process_one_debug_symbol): Search forward from the K_FUNCTION for
the first K_BEGIN when setting the line number associated with a
function. Avoid unnecessary calls to savestring.
(hp_alloc_type): Initialize TYPE_CPLUS_SPECIFIC here. Remove
most cases where we set it elsewhere.
(hppa_sym_fns): Use "hppa" instead of hppax since hpread.c and
paread.c use the same BFD backend now. All references changed.
(hpux_symfile_init): Allocate space to hold the debugging section
contents on the symbol obstack.
Wed Jun 23 16:33:36 1993 Jeff Law (law@snake.cs.utah.edu)
* hpread.c: Document a few functions, misc cleanups. Update
copyright to reflect the first "release" of this file.
(struct hpux_symfile_info): Delete unneeded fields. Keep pointers
to the contents of the debug sections rather than offsets within
the file itself. Corresponding changes to the accessor macros.
(sl_symbol_size, slt_symbuf): Delete unneeded global variables.
(slt_symbuf_start, slt_symbuf_end, lntt_symbuf): Likewise.
(lntt_symbuf_start, lntt_symbuf_end, gntt_symbuf): Likewise.
(gntt_symbuf_start, gntt_symbuf_end): Likewise.
(fill_slt_symbuf, fill_lntt_symbuf): Delete unneeded functions.
(fill_gntt_symbuf): Likewise.
(get_lntt, get_gntt, get_slt): Simplify.
(hpux_symfile_init): Read and store the contents of the debugging
sections. Do error checking on memory allocation and BFD calls.
(read_hpux_symtab): Delete KERNELDEBUG crud. Ignore debug symbols
which are not needed for building partial symbol tables. Handle
K_CONST, K_TYPEDEF, and K_TAGDEF just like K_SVAR and K_DVAR.
(read_ofile_symtab): Delete useless processing_gcc_compilation stuff.
(read_hp_struct_type): Initialize TYPE_CPLUS_SPECIFIC.
(read_hp_set_type, read_hp_array_type): Likewise.
(read_hp_subrange_type, hp_type_lookup): Likewise.
Tue Jun 22 11:03:13 1993 Jeff Law (law@snake.cs.utah.edu)
* hpread.c: Delete useless #if 1 statements.
(hp_type_translate): Use T_LONG, T_UNS_LONG, and T_DOUBLE instead
of magic integers. Fix handling for T_UNS_INT. Abort if the type
passed in is not an "immediate" type.
(read_hp_enum_type): Properly compute the size of the type.
(read_hp_array_type): Likewise.
(hp_type_lookup): Prefix the names of structs, unions and enums
with "struct", "union", and "enum" as appropriate.
Mon Jun 21 10:13:42 1993 Jeff Law (law@snake.cs.utah.edu)
* hpread.c: Include "demangle.h".
(process_one_debug_symbol): Set the SYMBOL_LANGUAGE and
SYMBOL_INIT_DEMANGLED_NAME for the current symbol. Adjust
SYMBOL_VALUE for local variables in the stack by the size of the
current function's stack (found in unwind descriptor). Keep
better track of the current unwind descriptor.
Wed Jun 16 14:34:10 1993 Jeff Law (law@snake.cs.utah.edu)
* hpread.c (hp_type_translate): Fix promotion bugs from
char to short and short to int.
Thu Jun 10 11:27:34 1993 Jeff Law (law@snake.cs.utah.edu)
* hpread.c (read_hp_function_type): Adjust SYMBOL_VALUE for
arguments in the stack by the size of the current function's stack
(found in the unwind descriptor).
(process_one_debug_symbol): Likewise. Keep track of the current
function's unwind descriptor.

View File

@ -860,6 +860,11 @@ unexport CHILLFLAGS CHILL_LIB CHILL_FOR_TARGET :
# These are things from config/*/*.m? fragments. There is no good reason
# why they are separate from the lists of files above.
HPREAD_SOURCE=
# start-sanitize-hpread
HPREAD_SOURCE=hpread.c
# end-sanitize-hpread
ALLDEPFILES = 29k-share/udi/udip2soc.c 29k-share/udi/udr.c \
29k-share/udi/udi2go32.c \
a29k-pinsn.c a29k-tdep.c a68v-nat.c alpha-nat.c alpha-tdep.c \
@ -882,7 +887,7 @@ ALLDEPFILES = 29k-share/udi/udip2soc.c 29k-share/udi/udr.c \
nindy-share/Onindy.c nindy-share/nindy.c \
nindy-share/ttyflush.c nindy-tdep.c \
ns32k-pinsn.c ns32km3-nat.c osfsolib.c \
somread.c procfs.c pyr-pinsn.c pyr-tdep.c pyr-xdep.c \
somread.c $(HPREAD_SOURCE) procfs.c pyr-pinsn.c pyr-tdep.c pyr-xdep.c \
remote-adapt.c remote-bug.c remote-e7000.c remote-eb.c remote-es.c \
remote-hms.c remote-mips.c \
remote-mm.c remote-mon.c remote-nindy.c remote-os9k.c remote-sim.c \
@ -1240,6 +1245,11 @@ osfsolib.o: osfsolib.c $(command_h) $(defs_h) $(gdbcore_h) $(inferior_h) \
somread.o: somread.c $(bfd_h) buildsym.h complaints.h $(defs_h) \
gdb-stabs.h objfiles.h symfile.h $(symtab_h)
# start-sanitize-hpread
hpread.o: hpread.c $(bfd_h) buildsym.h complaints.h $(defs_h) \
gdb-stabs.h objfiles.h symfile.h $(symtab_h)
# end-sanitize-hpread
parse.o: parse.c $(command_h) $(defs_h) $(expression_h) $(frame_h) \
$(gdbtypes_h) language.h parser-defs.h $(symtab_h) $(value_h)

View File

@ -41,4 +41,29 @@ Things-to-lose:
Do-last:
echo Removing traces of \"hpread\"...
# Don't try to clean directories here, as the 'mv' command will fail.
# Also, grep fails on NFS mounted directories.
if ( echo $* | grep keep\-hpread > /dev/null ) ; then
for i in * ; do
if test ! -d $i && (grep sanitize-hpread $i > /dev/null) ; then
echo Keeping hpread stuff in $i
fi
done
else
for i in * ; do
if test ! -d $i && (grep sanitize-hpread $i > /dev/null) ; then
echo Removing traces of \"hpread\" out of $i...
cp $i new
sed '/start\-sanitize\-hpread/,/end-\sanitize\-hpread/d' < $i > new
if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
echo Caching $i in .Recover...
mv $i .Recover
fi
mv new $i
fi
done
fi
# End of file.

View File

@ -1,5 +1,9 @@
# Host: Hewlett-Packard PA-RISC machine, running BSD
HPREAD=
# start-sanitize-hpread
HPREAD=hpread.o
# end-sanitize-hpread
XDEPFILES=
XM_FILE= xm-hppab.h
NAT_FILE= nm-hppab.h
NATDEPFILES= hppab-nat.o coredep.o corelow.o exec.o inftarg.o fork-child.o somread.o infptrace.o
NATDEPFILES= hppab-nat.o coredep.o corelow.o exec.o inftarg.o fork-child.o somread.o infptrace.o $(HPREAD)

View File

@ -1,9 +1,13 @@
# Host: Hewlett-Packard PA-RISC machine, running HPUX
HPREAD=
# start-sanitize-hpread
HPREAD=hpread.o
# end-sanitize-hpread
TERMCAP = -lcurses
XDEPFILES= ser-tcp.o
XM_FILE= xm-hppah.h
NAT_FILE= nm-hppah.h
NATDEPFILES= hppah-nat.o coredep.o corelow.o inftarg.o fork-child.o somread.o infptrace.o
REGEX=regex.o
REGEX1=regex.o
HOST_IPC=-DBSD_IPC -DPOSIX_WAIT
NATDEPFILES= hppah-nat.o coredep.o corelow.o inftarg.o fork-child.o somread.o infptrace.o $(HPREAD)

View File

@ -508,6 +508,27 @@ find_unwind_entry(pc)
return NULL;
}
/* start-sanitize-hpread */
/* Return the adjustment necessary to make for addresses on the stack
as presented by hpread.c.
This is necessary because of the stack direction on the PA and the
bizarre way in which someone (?) decided they wanted to handle
frame pointerless code in GDB. */
int
hpread_adjust_stack_address (func_addr)
CORE_ADDR func_addr;
{
struct unwind_table_entry *u;
u = find_unwind_entry (func_addr);
if (!u)
return 0;
else
return u->Total_frame_size << 3;
}
/* end-sanitize-hpread */
/* Called to determine if PC is in an interrupt handler of some
kind. */

2044
gdb/hpread.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -34,13 +34,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "demangle.h"
#include <sys/file.h>
/* Size of n_value and n_strx fields in a stab symbol. */
#define BYTES_IN_WORD 4
#if 0
#include "aout/aout64.h"
#endif
/* Various things we might complain about... */
static void
@ -336,10 +329,15 @@ som_symfile_read (objfile, section_offsets, mainline)
som_symtab_read (abfd, offset, objfile);
/* Now read information from the debugging sections. */
/* Now read information from the stabs debug sections. */
stabsect_build_psymtabs (objfile, section_offsets, mainline,
"$GDB_SYMBOLS$", "$GDB_STRINGS$", "$TEXT$");
/* start-sanitize-hpread */
/* Now read the native debug information. */
hpread_build_psymtabs (objfile, section_offsets, mainline);
/* end-sanitize-hpread */
/* Install any minimal symbols that have been collected as the current
minimal symbols for this objfile. */
install_minimal_symbols (objfile);
@ -374,15 +372,21 @@ som_symfile_finish (objfile)
{
mfree (objfile -> md, objfile -> sym_stab_info);
}
/* start-sanitize-hpread */
hpread_symfile_finish (objfile);
/* end-sanitize-hpread */
}
/* SOM specific initialization routine for reading symbols.
Nothing SOM specific left to do anymore. */
static void
som_symfile_init (ignore)
struct objfile *ignore;
som_symfile_init (objfile)
struct objfile *objfile;
{
/* start-sanitize-hpread */
hpread_symfile_init (objfile);
/* end-sanitize-hpread */
}
/* SOM specific parsing routine for section offsets.