* 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.
+Mon Oct 30 10:19:01 2000 David Taylor <taylor@redhat.com>
+
+ * 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.
+
2000-10-28 Kevin Buettner <kevinb@redhat.com>
* symtab.c (decode_line_2, file_matches, search_symbols): Protoize.
int bnum = -1;
if (bnum_exp)
- bnum = parse_and_eval_address (bnum_exp);
+ bnum = parse_and_eval_long (bnum_exp);
breakpoint_1 (bnum, 0);
}
int bnum = -1;
if (bnum_exp)
- bnum = parse_and_eval_address (bnum_exp);
+ bnum = parse_and_eval_long (bnum_exp);
breakpoint_1 (bnum, 1);
}
case var_uinteger:
if (arg == NULL)
error_no_arg ("integer to set it to.");
- *(unsigned int *) c->var = parse_and_eval_address (arg);
+ *(unsigned int *) c->var = parse_and_eval_long (arg);
if (*(unsigned int *) c->var == 0)
*(unsigned int *) c->var = UINT_MAX;
break;
unsigned int val;
if (arg == NULL)
error_no_arg ("integer to set it to.");
- val = parse_and_eval_address (arg);
+ val = parse_and_eval_long (arg);
if (val == 0)
*(int *) c->var = INT_MAX;
else if (val >= INT_MAX)
case var_zinteger:
if (arg == NULL)
error_no_arg ("integer to set it to.");
- *(int *) c->var = parse_and_eval_address (arg);
+ *(int *) c->var = parse_and_eval_long (arg);
break;
case var_enum:
{
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)
{
while (num != 0)
{
set_ignore_count (num,
- parse_and_eval_address (proc_count_exp) - 1,
+ parse_and_eval_long (proc_count_exp) - 1,
from_tty);
/* set_ignore_count prints a message ending with a period.
So print two spaces before "Continuing.". */
async_disable_stdin ();
}
- count = count_string ? parse_and_eval_address (count_string) : 1;
+ count = count_string ? parse_and_eval_long (count_string) : 1;
if (!single_inst || skip_subroutines) /* leave si command alone */
{
if (oursig == TARGET_SIGNAL_UNKNOWN)
{
/* No, try numeric. */
- int num = parse_and_eval_address (signum_exp);
+ int num = parse_and_eval_long (signum_exp);
if (num == 0)
oursig = TARGET_SIGNAL_0;
{
/* No, try numeric. */
oursig =
- target_signal_from_command (parse_and_eval_address (signum_exp));
+ target_signal_from_command (parse_and_eval_long (signum_exp));
}
sig_print_info (oursig);
return;
static void
set_backtrace_limit_command (char *count_exp, int from_tty)
{
- int count = parse_and_eval_address (count_exp);
+ int count = parse_and_eval_long (count_exp);
if (count < 0)
error ("Negative argument not meaningful as backtrace limit.");
trailing_level = 0;
if (count_exp)
{
- count = parse_and_eval_address (count_exp);
+ count = parse_and_eval_long (count_exp);
if (count < 0)
{
struct frame_info *current;
register struct frame_info *fi;
int count = 1, count1;
if (count_exp)
- count = parse_and_eval_address (count_exp);
+ count = parse_and_eval_long (count_exp);
count1 = count;
if (target_has_stack == 0 || selected_frame == 0)
register struct frame_info *frame;
int count = -1, count1;
if (count_exp)
- count = -parse_and_eval_address (count_exp);
+ count = -parse_and_eval_long (count_exp);
count1 = count;
if (target_has_stack == 0 || selected_frame == 0)
int tpnum = -1;
if (tpnum_exp)
- tpnum = parse_and_eval_address (tpnum_exp);
+ tpnum = parse_and_eval_long (tpnum_exp);
ALL_TRACEPOINTS (t)
if (tpnum == -1 || tpnum == t->number)
frameno = traceframe_number - 1;
}
else
- frameno = parse_and_eval_address (args);
+ frameno = parse_and_eval_long (args);
if (frameno < -1)
error ("invalid input (%d is less than zero)", frameno);
{
unsigned radix;
- radix = (arg == NULL) ? 10 : parse_and_eval_address (arg);
+ radix = (arg == NULL) ? 10 : parse_and_eval_long (arg);
set_output_radix_1 (0, radix);
set_input_radix_1 (0, radix);
if (from_tty)
extern CORE_ADDR parse_and_eval_address_1 (char **expptr);
+extern LONGEST parse_and_eval_long (char *exp);
+
extern value_ptr access_value_history (int num);
extern value_ptr value_of_internalvar (struct internalvar *var);
/* "info history +" should print from the stored position.
"info history <exp>" should print around value number <exp>. */
if (num_exp[0] != '+' || num_exp[1] != '\0')
- num = parse_and_eval_address (num_exp) - 5;
+ num = parse_and_eval_long (num_exp) - 5;
}
else
{