aboutsummaryrefslogtreecommitdiff
path: root/gdb/eval.c
diff options
context:
space:
mode:
authorStu Grossman <grossman@cygnus>1995-10-27 17:48:36 +0000
committerStu Grossman <grossman@cygnus>1995-10-27 17:48:36 +0000
commitcd10c7e3886bd28dc6ada58dcd5d93685a3ce865 (patch)
treec80e120745cd9901b95aba08398fb4e6cecff5df /gdb/eval.c
parentd6d44ef984d15d089277de11f176ce0775cabc31 (diff)
downloadgdb-cd10c7e3886bd28dc6ada58dcd5d93685a3ce865.zip
gdb-cd10c7e3886bd28dc6ada58dcd5d93685a3ce865.tar.gz
gdb-cd10c7e3886bd28dc6ada58dcd5d93685a3ce865.tar.bz2
* breakpoint.c (breakpoint_re_set): #ifdef GET_LONGJMP_TARGET
around calls to create_longjmp_breakpoint. Why install the breakpoints if we can't find the longjmp target? * infrun.c (wait_for_inferior): Cleanup comments near call test. * remote-mips.c: Fixed a bunch of prototypes to avoid char/int complaint from picky compilers. Add comment to mips_expect. Replace all instances of sr_get_debug with remote_debug. * (mips_readchar): Don't jam init string to monitor. mips_initialize() handles that. * (mips_receive_header): Print better message when we get too much garbage. * (mips_request): Allow caller to pass in buff to allow them to analyze the returned message. * (mips_initialize): Re-do initialization to try sending a BREAK, a ^C, and then a download escape sequence. Cleanup protocol startup. Eliminate sleeps. Clear breakpoints (if using monitor breakpoints). Re-init frame. * (mips_detach): Close down target. start-sanitize-gm * (mips_resume): Pass signal down to target. * (mips_create_inferior): Start target with TARGET_SIGNAL_PWR. end-sanitize-gm * (mips_wait): Handle return status with registers, or breakpoint stuff. * (mips_kill): Add ^C handling. * (mips_insert_breakpoint mips_remove_breakpoint): Call new breakpoint stuff if enabled. * (calculate_mask remote_mips_set_watchpoint remote_mips_remove_watchpoint remote_mips_stopped_by_watchpoint): Hardware watchpoint/breakpoint stuff. * (common_breakpoint): Common code for new monitor breakpoint commands. * (mips_load): Don't use `prompt'. It's a global variable. * top.c (dont_repeat_command): New command for use in user-defined commands to suppress auto-repeat (by hittin return key). start-sanitize-gm * utils.c (request_quit): Call target_kill here. Good idea. Needs a better implementation. end-sanitize-gm * valops.c: Add start of auto function-call abandonment capability. start-sanitize-gm * c-exp.y: Add code (currently disabled) to handle GM dynamic structures (it conflicts with @!). * eval.c (evaluate_subexp_standard): ditto. * expprint.c (print_subexp dump_expression): ditto. * expression.h (enum exp_opcode): ditto. * parse.c (length_of_subexp): ditto. * configure, configure.in: Add mip*-*-magic* target. * magic.c magic.h: Special routines to handle GM stuff (like stepping through dispatcher). end-sanitize-gm
Diffstat (limited to 'gdb/eval.c')
-rw-r--r--gdb/eval.c37
1 files changed, 35 insertions, 2 deletions
diff --git a/gdb/eval.c b/gdb/eval.c
index 9bc898c..0e24041 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -29,6 +29,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "demangle.h"
#include "language.h" /* For CAST_IS_CONVERSION */
#include "f-lang.h" /* for array bound stuff */
+/* start-sanitize-gm */
+#ifdef GENERAL_MAGIC_HACKS
+#include "magic.h"
+#endif /* GENERAL_MAGIC_HACKS */
+/* end-sanitize-gm */
/* Prototypes for local functions. */
@@ -839,6 +844,36 @@ evaluate_subexp_standard (expect_type, exp, pos, noside)
NULL, "structure pointer");
}
+/* start-sanitize-gm */
+#ifdef GENERAL_MAGIC_HACKS
+ case STRUCTOP_FIELD:
+ tem = longest_to_int (exp->elts[pc + 1].longconst);
+ (*pos) += 3 + BYTES_TO_EXP_ELEM (tem + 1);
+ arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+ if (noside == EVAL_SKIP)
+ goto nosideret;
+ {
+ CORE_ADDR object = value_as_long (arg1);
+ struct type *type = type_of_object (object);
+
+ if (noside == EVAL_AVOID_SIDE_EFFECTS)
+ return value_zero (lookup_struct_elt_type (type,
+ &exp->elts[pc + 2].string,
+ 0),
+ lval_memory);
+ else
+ {
+ value_ptr temp = value_from_longest (builtin_type_unsigned_long,
+ baseptr_of_object (value_as_long(arg1)));
+
+ VALUE_TYPE (temp) = type;
+ return value_struct_elt (&temp, NULL, &exp->elts[pc + 2].string,
+ NULL, "structure pointer");
+ }
+ }
+#endif /* GENERAL_MAGIC_HACKS */
+/* end-sanitize-gm */
+
case STRUCTOP_MEMBER:
arg1 = evaluate_subexp_for_address (exp, pos, noside);
goto handle_pointer_to_member;
@@ -1259,8 +1294,6 @@ evaluate_subexp_standard (expect_type, exp, pos, noside)
error ("Non-integral right operand for \"@\" operator.");
if (noside == EVAL_AVOID_SIDE_EFFECTS)
{
- if (VALUE_REPEATED (arg1))
- error ("Cannot create artificial arrays of artificial arrays.");
return allocate_repeat_value (VALUE_TYPE (arg1),
longest_to_int (value_as_long (arg2)));
}