diff options
author | David Taylor <taylor@redhat.com> | 2000-10-30 15:32:51 +0000 |
---|---|---|
committer | David Taylor <taylor@redhat.com> | 2000-10-30 15:32:51 +0000 |
commit | bb518678acdf8bdf3c7640c8d1dea7bba35e176a (patch) | |
tree | 085bacf758e7c90690c25e32a44bcec3232e0367 /gdb/eval.c | |
parent | 4291c3fa65b2a9f4eb66aa8921e6163b3e7e7b53 (diff) | |
download | gdb-bb518678acdf8bdf3c7640c8d1dea7bba35e176a.zip gdb-bb518678acdf8bdf3c7640c8d1dea7bba35e176a.tar.gz gdb-bb518678acdf8bdf3c7640c8d1dea7bba35e176a.tar.bz2 |
* eval.c (parse_and_eval_long): New function.
* value.h: Declare it.
* breakpoint.c (breakpoints_info, maintenance_info_breakpoints):
Call parse_and_eval_long, not parse_and_eval_address.
* command.c (do_setshow_command): Ditto.
* infcmd.c (step_1, signal_command, continue_command): Ditto.
* infrun.c (signals_info): Ditto.
* stack.c (set_backtrace_limit_command, backtrace_command_1,
up_silently_base, down_silently_base): Ditto.
* tracepoints.c (tracepoints_info, trace_find_command,
trace_find_tracepoint_command): Ditto.
* valprint.c (set_radix): Ditto.
* values.c (show_values): Ditto.
Diffstat (limited to 'gdb/eval.c')
-rw-r--r-- | gdb/eval.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -103,6 +103,21 @@ parse_and_eval_address_1 (char **expptr) return addr; } +/* Like parse_and_eval_address, but treats the value of the expression + as an integer, not an address, returns a LONGEST, not a CORE_ADDR */ +LONGEST +parse_and_eval_long (char *exp) +{ + struct expression *expr = parse_expression (exp); + register LONGEST retval; + register struct cleanup *old_chain = + make_cleanup (free_current_contents, &expr); + + retval = value_as_long (evaluate_expression (expr)); + do_cleanups (old_chain); + return (retval); +} + value_ptr parse_and_eval (char *exp) { |