aboutsummaryrefslogtreecommitdiff
path: root/gdb/valops.c
diff options
context:
space:
mode:
authorStu Grossman <grossman@cygnus>1993-04-23 18:01:02 +0000
committerStu Grossman <grossman@cygnus>1993-04-23 18:01:02 +0000
commitb5728692b43217ea2babbe08a94552cb4b2ffeff (patch)
treec8d9bdff58794e4ef37a05faa4111665f7626829 /gdb/valops.c
parentc156f3c1c9395bcb721678e07a5cf10b7c0d7b18 (diff)
downloadgdb-b5728692b43217ea2babbe08a94552cb4b2ffeff.zip
gdb-b5728692b43217ea2babbe08a94552cb4b2ffeff.tar.gz
gdb-b5728692b43217ea2babbe08a94552cb4b2ffeff.tar.bz2
* 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"').
Diffstat (limited to 'gdb/valops.c')
-rw-r--r--gdb/valops.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/gdb/valops.c b/gdb/valops.c
index c0931c5..2180c03 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -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);