* alpha-tdep.c (heuristic_proc_desc): Stop examining the prologue

if we encounter a positive stack adjustment.
	(find_proc_desc):  If heuristic_fence_post is non-zero, use
	heuristic_proc_start to determine the start of a function before
	calling heuristic_proc_desc.

	* coffread.c (coff_symtab_read):  Change minimal symbol types
	for C_LABEL symbols from mst_* to mst_file_*.

	* config/m68k/sun3os4.mh (MMALLOC_CFLAGS): Define MMCHECK_FORCE to 1.

	* configure.in:  Handle error message from sun3 native ld when
	configuring HLDFLAGS.
	* configure:  Regenerated with autoconf.

	* c-valprint.c (c_value_print):  Adjust value address by VALUE_OFFSET.
	* cp-valprint.c (cp_print_value):  Prevent gdb crashes by making sure
	that the virtual base pointer from an user object still points to
	accessible memory.

	* dbxread.c (dbx_symfile_init):  Initialize sym_stab_info to
	clear the recently added header_files fields.
	(dbx_symfile_finish):  Free hfiles[i].vector to avoid storage leak.
This commit is contained in:
Peter Schauer 1996-11-09 09:17:34 +00:00
parent 849c575f97
commit 074d813d38
6 changed files with 69 additions and 7 deletions

View File

@ -1,3 +1,29 @@
Sat Nov 9 01:05:10 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
* alpha-tdep.c (heuristic_proc_desc): Stop examining the prologue
if we encounter a positive stack adjustment.
(find_proc_desc): If heuristic_fence_post is non-zero, use
heuristic_proc_start to determine the start of a function before
calling heuristic_proc_desc.
* coffread.c (coff_symtab_read): Change minimal symbol types
for C_LABEL symbols from mst_* to mst_file_*.
* config/m68k/sun3os4.mh (MMALLOC_CFLAGS): Define MMCHECK_FORCE to 1.
* configure.in: Handle error message from sun3 native ld when
configuring HLDFLAGS.
* configure: Regenerated with autoconf.
* c-valprint.c (c_value_print): Adjust value address by VALUE_OFFSET.
* cp-valprint.c (cp_print_value): Prevent gdb crashes by making sure
that the virtual base pointer from an user object still points to
accessible memory.
* dbxread.c (dbx_symfile_init): Initialize sym_stab_info to
clear the recently added header_files fields.
(dbx_symfile_finish): Free hfiles[i].vector to avoid storage leak.
Fri Nov 8 14:30:23 1996 Michael Snyder <msnyder@cleaver.cygnus.com>
* config/tm-sh.h: Added a missing comma in middle of REGISTER_NAMES list.

View File

@ -1,5 +1,5 @@
/* Target-dependent code for the ALPHA architecture, for GDB, the GNU Debugger.
Copyright 1993, 1994, 1995 Free Software Foundation, Inc.
Copyright 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
This file is part of GDB.
@ -489,7 +489,15 @@ heuristic_proc_desc(start_pc, limit_pc, next_frame)
word = extract_unsigned_integer (buf, 4);
if ((word & 0xffff0000) == 0x23de0000) /* lda $sp,n($sp) */
frame_size += (-word) & 0xffff;
{
if (word & 0x8000)
frame_size += (-word) & 0xffff;
else
/* Exit loop if a positive stack adjustment is found, which
usually means that the stack cleanup code in the function
epilogue is reached. */
break;
}
else if ((word & 0xfc1f0000) == 0xb41e0000 /* stq reg,n($sp) */
&& (word & 0xffff0000) != 0xb7fe0000) /* reg != $zero */
{
@ -728,7 +736,13 @@ find_proc_desc (pc, next_frame)
if (offset >= 0)
return push_sigtramp_desc (pc - offset);
if (startaddr == 0)
/* If heuristic_fence_post is non-zero, determine the procedure
start address by examining the instructions.
This allows us to find the start address of static functions which
have no symbolic information, as startaddr would have been set to
the preceding global function start address by the
find_pc_partial_function call above. */
if (startaddr == 0 || heuristic_fence_post != 0)
startaddr = heuristic_proc_start (pc);
proc_desc =

View File

@ -1,5 +1,5 @@
/* Support for printing C values for GDB, the GNU debugger.
Copyright 1986, 1988, 1989, 1991, 1992, 1993, 1994, 1995
Copyright 1986, 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996
Free Software Foundation, Inc.
This file is part of GDB.
@ -465,6 +465,7 @@ c_value_print (val, stream, format, pretty)
fprintf_filtered (stream, ") ");
}
}
return (val_print (type, VALUE_CONTENTS (val),
VALUE_ADDRESS (val), stream, format, 1, 0, pretty));
return val_print (type, VALUE_CONTENTS (val),
VALUE_ADDRESS (val) + VALUE_OFFSET (val),
stream, format, 1, 0, pretty);
}

2
gdb/configure vendored
View File

@ -2688,6 +2688,8 @@ case "${host}" in
:
elif grep 'do not mix' conftest.t >/dev/null 2>&1; then
:
elif grep 'some text already loaded' conftest.t >/dev/null 2>&1; then
:
elif test "${shared}" = "true"; then
HLDFLAGS='-Wl,-rpath=$(libdir)'
else

View File

@ -334,6 +334,8 @@ case "${host}" in
:
elif grep 'do not mix' conftest.t >/dev/null 2>&1; then
:
elif grep 'some text already loaded' conftest.t >/dev/null 2>&1; then
:
elif test "${shared}" = "true"; then
HLDFLAGS='-Wl,-rpath=$(libdir)'
else

View File

@ -30,6 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "annotate.h"
#include "gdb_string.h"
#include "c-lang.h"
#include "target.h"
int vtblprint; /* Controls printing of vtbl's */
int objectprint; /* Controls looking up an object's derived type
@ -410,6 +411,7 @@ cp_print_value (type, valaddr, address, stream, format, recurse, pretty,
int boffset;
struct type *baseclass = check_typedef (TYPE_BASECLASS (type, i));
char *basename = TYPE_NAME (baseclass);
char *base_valaddr;
if (BASETYPE_VIA_VIRTUAL (type, i))
{
@ -438,10 +440,25 @@ cp_print_value (type, valaddr, address, stream, format, recurse, pretty,
baseclass name. */
fputs_filtered (basename ? basename : "", stream);
fputs_filtered ("> = ", stream);
/* The virtual base class pointer might have been clobbered by the
user program. Make sure that it still points to a valid memory
location. */
if (boffset != -1 && (boffset < 0 || boffset >= TYPE_LENGTH (type)))
{
base_valaddr = (char *) alloca (TYPE_LENGTH (baseclass));
if (target_read_memory (address + boffset, base_valaddr,
TYPE_LENGTH (baseclass)) != 0)
boffset = -1;
}
else
base_valaddr = valaddr + boffset;
if (boffset == -1)
fprintf_filtered (stream, "<invalid address>");
else
cp_print_value_fields (baseclass, valaddr + boffset, address + boffset,
cp_print_value_fields (baseclass, base_valaddr, address + boffset,
stream, format, recurse, pretty,
(struct type **) obstack_base (&dont_print_vb_obstack),
0);