* Fix two bugs found by deja-gnu. One is the incorrect reporting

of the PC being in a stack dummy when looking at a core file
	without symbols.  The other is the incorrect passing of char
	arguments during expression evaluation (ie: p foo('a','b') would
	mess up the passing of it's args because it wasn't coercing the
	char's to ints).
	* hppah-tdep.c:  Rename global functions to have consistent hppa_
	prefix.  Make more functions static.  Drop hp_ prefix from static
	functions.  (hppa_push_arguments):  Call value_arg_coerce to cast
	char to int args if necessary.  (hppa_fix_call_dummy):  Create
	this routine from FIX_CALL_DUMMY macro in tm-hppa.h.
	* inferior.h (PC_IN_CALL_DUMMY):  Check for frame_address being
	valid (ie: != 0) before doing comparison against PC.
	* valops.c (call_function_by_hand):  Adjust call to FIX_CALL_DUMMY
	to reflect new arguments.
	* config/pa/tm-hppa.h (POP_FRAME, PUSH_ARGUMENTS):  Use new hppa_
	prefix for func	name.  (FIX_CALL_DUMMY):  Move code into
	hppah-tdep.c.

	* testsuite/gdb.t16/gdbme.c, testsuite/gdb.t17/gdbme.c:  Add calls
	to malloc() so that we can test GDB eval of dynamically created
	arrays (like char strings in `print "foo"').
This commit is contained in:
Stu Grossman
1993-04-23 18:01:02 +00:00
parent c156f3c1c9
commit b5728692b4
3 changed files with 98 additions and 12 deletions

View File

@ -31,6 +31,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
/* Local functions. */
static int
typecmp PARAMS ((int staticp, struct type *t1[], value t2[]));
static CORE_ADDR
find_function_addr PARAMS ((value, struct type **));
@ -664,6 +667,13 @@ value_arg_coerce (arg)
register struct type *type;
COERCE_ENUM (arg);
#if 1 /* FIXME: This is only a temporary patch. -fnf */
if (VALUE_REPEATED (arg)
|| TYPE_CODE (VALUE_TYPE (arg)) == TYPE_CODE_ARRAY)
arg = value_coerce_array (arg);
if (TYPE_CODE (VALUE_TYPE (arg)) == TYPE_CODE_FUNC)
arg = value_coerce_function (arg);
#endif
type = VALUE_TYPE (arg);
@ -822,8 +832,8 @@ call_function_by_hand (function, nargs, args)
SWAP_TARGET_AND_HOST (&dummy1[i], sizeof (REGISTER_TYPE));
#ifdef GDB_TARGET_IS_HPPA
FIX_CALL_DUMMY (dummy1, start_sp, real_pc, funaddr, nargs, args,
value_type, using_gcc);
real_pc = FIX_CALL_DUMMY (dummy1, start_sp, funaddr, nargs, args,
value_type, using_gcc);
#else
FIX_CALL_DUMMY (dummy1, start_sp, funaddr, nargs, args,
value_type, using_gcc);