#include "command.h"
#include "inferior.h"
#include "target.h"
+#include "language.h"
#include <string.h>
extern int addressprint; /* Print machine addresses? */
/* I don't know if it matters whether this is the string the user
typed in or the decompiled expression. */
b->cond_string = savestring (arg, strlen (arg));
- b->cond = parse_c_1 (&arg, block_for_pc (b->address), 0);
+ b->cond = parse_exp_1 (&arg, block_for_pc (b->address), 0);
if (*arg)
error ("Junk at end of expression");
}
#endif
{
fprintf (stderr, "Cannot insert breakpoint %d:\n", b->number);
+#ifdef ONE_PROCESS_WRITETEXT
+ fprintf (stderr,
+ "The same program may be running in another process.\n");
+#endif
memory_error (val, b->address); /* which bombs us out */
}
}
return val;
b->inserted = 0;
#ifdef BREAKPOINT_DEBUG
- printf ("Removed breakpoint at 0x%x, shadow 0x%x, 0x%x.\n",
- b->address, b->shadow_contents[0], b->shadow_contents[1]);
+ printf ("Removed breakpoint at %s",
+ local_hex_string(b->address));
+ printf (", shadow %s",
+ local_hex_string(b->shadow_contents[0]));
+ printf (", %s.\n",
+ local_hex_string(b->shadow_contents[1]));
#endif /* BREAKPOINT_DEBUG */
}
breakpoint_cond_eval (exp)
char *exp;
{
- return value_zerop (evaluate_expression ((struct expression *)exp));
+ return !value_true (evaluate_expression ((struct expression *)exp));
}
/* Allocate a new bpstat and chain it to the current one. */
print_expression (b->exp, stdout);
} else {
if (addressprint)
- printf_filtered (" 0x%08x ", b->address);
+ printf_filtered (" %s ", local_hex_string_custom(b->address, "08"));
last_addr = b->address;
if (b->symtab)
printf_filtered ("\n");
if (b->frame)
- printf_filtered ("\tstop only in stack frame at 0x%x\n", b->frame);
+ printf_filtered ("\tstop only in stack frame at %s\n",
+ local_hex_string(b->frame));
if (b->cond)
{
printf_filtered ("\tstop only if ");
(b->enable == disabled) ? " (disabled)" : "",
(others > 1) ? "," : ((others == 1) ? " and" : ""));
}
- printf ("also set at pc 0x%x.\n", pc);
+ printf ("also set at pc %s.\n", local_hex_string(pc));
}
}
\f
}
else
{
- printf_filtered ("Breakpoint %d at 0x%x", b->number, b->address);
+ printf_filtered ("Breakpoint %d at %s", b->number,
+ local_hex_string(b->address));
if (b->symtab)
printf_filtered (": file %s, line %d.",
b->symtab->filename, b->line_number);
{
arg += 2;
cond_start = arg;
- cond = parse_c_1 (&arg, block_for_pc (pc), 0);
+ cond = parse_exp_1 (&arg, block_for_pc (pc), 0);
cond_end = arg;
}
else
/* Parse arguments. */
innermost_block = NULL;
- exp = parse_c_expression (arg);
+ exp = parse_expression (arg);
exp_valid_block = innermost_block;
val = evaluate_expression (exp);
release_value (val);
{
if (arg[0] == 'i' && arg[1] == 'f'
&& (arg[2] == ' ' || arg[2] == '\t'))
- cond = (struct expression *) parse_c_1 ((arg += 2, &arg),
+ cond = (struct expression *) parse_exp_1 ((arg += 2, &arg),
block_for_pc (pc), 0);
else
error ("Junk at end of arguments.");
if (tempflag)
b->enable = temporary;
- printf ("Breakpoint %d at 0x%x", b->number, b->address);
+ printf ("Breakpoint %d at %s", b->number, local_hex_string(b->address));
if (b->symtab)
printf (": file %s, line %d.", b->symtab->filename, b->line_number);
printf ("\n");
if (b->cond_string != NULL)
{
s = b->cond_string;
- b->cond = parse_c_1 (&s, block_for_pc (sal.pc), 0);
+ b->cond = parse_exp_1 (&s, block_for_pc (sal.pc), 0);
}
check_duplicates (b->address);
add_com ("condition", class_breakpoint, condition_command,
"Specify breakpoint number N to break only if COND is true.\n\
-N is an integer; COND is a C expression to be evaluated whenever\n\
-breakpoint N is reached. Actually break only when COND is nonzero.");
+N is an integer; COND is an expression to be evaluated whenever\n\
+breakpoint N is reached. ");
add_com ("tbreak", class_breakpoint, tbreak_command,
"Set a temporary breakpoint. Args like \"break\" command.\n\