/* Everything about breakpoints, for GDB.
- Copyright 1986, 87, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 1999
- Free Software Foundation, Inc.
+ Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
+ 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of GDB.
#include "annotate.h"
#include "symfile.h"
#include "objfiles.h"
+#include "linespec.h"
#ifdef UI_OUT
#include "ui-out.h"
#endif
static void break_at_finish_command (char *, int);
static void break_at_finish_at_depth_command (char *, int);
-void tbreak_command (char *, int);
-
static void tbreak_at_finish_command (char *, int);
static void break_command_1 (char *, int, int);
static void catch_exec_command_1 (char *arg, int tempflag, int from_tty);
#endif
-static void create_exception_catchpoint
- (int tempflag, char *cond_string,
- enum exception_event_kind ex_event, struct symtab_and_line *sal);
+static void create_exception_catchpoint (int tempflag, char *cond_string,
+ enum exception_event_kind ex_event,
+ struct symtab_and_line *sal);
-static void catch_exception_command_1
- (enum exception_event_kind ex_event, char *arg, int tempflag, int from_tty);
+static void catch_exception_command_1 (enum exception_event_kind ex_event,
+ char *arg, int tempflag, int from_tty);
static void tcatch_command (char *arg, int from_tty);
/* Prototypes for exported functions. */
-static void awatch_command (char *, int);
-
-static void do_enable_breakpoint (struct breakpoint *, enum bpdisp);
-
/* If FALSE, gdb will not use hardware support for watchpoints, even
if such is available. */
static int can_use_hw_watchpoints;
void _initialize_breakpoint (void);
-void set_breakpoint_count (int);
-
extern int addressprint; /* Print machine addresses? */
static int internal_breakpoint_number = -1;
{
if (b->cond)
{
- free ((PTR) b->cond);
+ xfree (b->cond);
b->cond = 0;
}
if (b->cond_string != NULL)
- free ((PTR) b->cond_string);
+ xfree (b->cond_string);
if (*p == 0)
{
if (bp_addr + bp_size < memaddr + len)
{
/* Copy the section of memory after the breakpoint. */
- status = read_memory_nobpt
- (bp_addr + bp_size,
- myaddr + bp_addr + bp_size - memaddr,
- memaddr + len - (bp_addr + bp_size));
+ status = read_memory_nobpt (bp_addr + bp_size,
+ myaddr + bp_addr + bp_size - memaddr,
+ memaddr + len - (bp_addr + bp_size));
if (status != 0)
return status;
}
switch (b->type)
{
case bp_catch_fork:
- val = target_insert_fork_catchpoint (inferior_pid);
+ val = target_insert_fork_catchpoint (PIDGET (inferior_ptid));
break;
case bp_catch_vfork:
- val = target_insert_vfork_catchpoint (inferior_pid);
+ val = target_insert_vfork_catchpoint (PIDGET (inferior_ptid));
break;
case bp_catch_exec:
- val = target_insert_exec_catchpoint (inferior_pid);
+ val = target_insert_exec_catchpoint (PIDGET (inferior_ptid));
break;
default:
warning ("Internal error, %s line %d.", __FILE__, __LINE__);
{
register struct breakpoint *b;
int val;
- int saved_inferior_pid = inferior_pid;
+ ptid_t saved_inferior_ptid = inferior_ptid;
- /* FIXME: use a cleanup, to insure that inferior_pid gets replaced! */
- inferior_pid = pid; /* Because remove_breakpoint will use this global. */
+ /* FIXME: use a cleanup, to insure that inferior_ptid gets replaced! */
+ inferior_ptid = pid_to_ptid (pid); /* Because remove_breakpoint will use this global. */
ALL_BREAKPOINTS (b)
{
if (b->inserted)
val = target_insert_breakpoint (b->address, b->shadow_contents);
if (val != 0)
{
- inferior_pid = saved_inferior_pid;
+ inferior_ptid = saved_inferior_ptid;
return val;
}
}
}
- inferior_pid = saved_inferior_pid;
+ inferior_ptid = saved_inferior_ptid;
return 0;
}
{
register struct breakpoint *b;
int val;
- int saved_inferior_pid = inferior_pid;
+ ptid_t saved_inferior_ptid = inferior_ptid;
- if (pid == inferior_pid)
- error ("Cannot detach breakpoints of inferior_pid");
+ if (pid == PIDGET (inferior_ptid))
+ error ("Cannot detach breakpoints of inferior_ptid");
- /* FIXME: use a cleanup, to insure that inferior_pid gets replaced! */
- inferior_pid = pid; /* Because remove_breakpoint will use this global. */
+ /* FIXME: use a cleanup, to insure that inferior_ptid gets replaced! */
+ inferior_ptid = pid_to_ptid (pid); /* Because remove_breakpoint will use this global. */
ALL_BREAKPOINTS (b)
{
if (b->inserted)
val = remove_breakpoint (b, mark_inserted);
if (val != 0)
{
- inferior_pid = saved_inferior_pid;
+ inferior_ptid = saved_inferior_ptid;
return val;
}
}
}
- inferior_pid = saved_inferior_pid;
+ inferior_ptid = saved_inferior_ptid;
return 0;
}
/* Check to see if breakpoint is in an overlay section;
if so, we should remove the breakpoint at the LMA address.
If that is not equal to the raw address, then we should
- presumable remove the breakpoint there as well. */
+ presumably remove the breakpoint there as well. */
if (overlay_debugging && b->section &&
section_is_overlay (b->section))
{
switch (b->type)
{
case bp_catch_fork:
- val = target_remove_fork_catchpoint (inferior_pid);
+ val = target_remove_fork_catchpoint (PIDGET (inferior_ptid));
break;
case bp_catch_vfork:
- val = target_remove_vfork_catchpoint (inferior_pid);
+ val = target_remove_vfork_catchpoint (PIDGET (inferior_ptid));
break;
case bp_catch_exec:
- val = target_remove_exec_catchpoint (inferior_pid);
+ val = target_remove_exec_catchpoint (PIDGET (inferior_ptid));
break;
default:
warning ("Internal error, %s line %d.", __FILE__, __LINE__);
PC is valid for process/thread PID. */
int
-breakpoint_thread_match (CORE_ADDR pc, int pid)
+breakpoint_thread_match (CORE_ADDR pc, ptid_t ptid)
{
struct breakpoint *b;
int thread;
- thread = pid_to_thread_id (pid);
+ thread = pid_to_thread_id (ptid);
ALL_BREAKPOINTS (b)
if (b->enable != disabled
|| (ep->type == bp_catch_vfork)
|| (ep->type == bp_catch_exec)
|| (ep->type == bp_catch_catch)
- || (ep->type == bp_catch_throw)
-
+ || (ep->type == bp_catch_throw);
/* ??rehrauer: Add more kinds here, as are implemented... */
- ;
}
int
{
return
(ep->type == bp_catch_load)
- || (ep->type == bp_catch_unload)
- ;
+ || (ep->type == bp_catch_unload);
}
int
{
return
(ep->type == bp_catch_catch)
- || (ep->type == bp_catch_throw)
- ;
+ || (ep->type == bp_catch_throw);
}
/* Clear a bpstat so that it says we are not at any breakpoint.
q = p->next;
if (p->old_val != NULL)
value_free (p->old_val);
- free ((PTR) p);
+ xfree (p);
p = q;
}
*bsp = NULL;
{
mention (bs->breakpoint_at);
if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
- ui_out_list_begin (uiout, "value");
- ui_out_field_string (uiout, "reason", "access-watchpoint-trigger");
+ ui_out_field_string (uiout, "reason", "access-watchpoint-trigger");
+ ui_out_list_begin (uiout, "value");
ui_out_text (uiout, "\nValue = ");
}
value_print (bs->breakpoint_at->val, stb->stream, 0,Val_pretty_default);
return print_it_typical (bs);
break;
default:
- internal_error ("print_bp_stop_message: unrecognized enum value");
+ internal_error (__FILE__, __LINE__,
+ "print_bp_stop_message: unrecognized enum value");
break;
}
}
char message[sizeof (message1) + 30 /* slop */ ];
/* Get the address where the breakpoint would have been. */
- bp_addr = *pc - (not_a_breakpoint && !SOFTWARE_SINGLE_STEP_P ?
+ bp_addr = *pc - (not_a_breakpoint && !SOFTWARE_SINGLE_STEP_P () ?
0 : DECR_PC_AFTER_BREAK);
ALL_BREAKPOINTS_SAFE (b, temp)
ignore it. */
if ((b->type == bp_catch_load)
#if defined(SOLIB_HAVE_LOAD_EVENT)
- && (!SOLIB_HAVE_LOAD_EVENT (inferior_pid)
+ && (!SOLIB_HAVE_LOAD_EVENT (PIDGET (inferior_ptid))
|| ((b->dll_pathname != NULL)
&& (strcmp (b->dll_pathname,
- SOLIB_LOADED_LIBRARY_PATHNAME (inferior_pid))
+ SOLIB_LOADED_LIBRARY_PATHNAME (
+ PIDGET (inferior_ptid)))
!= 0)))
#endif
)
if ((b->type == bp_catch_unload)
#if defined(SOLIB_HAVE_UNLOAD_EVENT)
- && (!SOLIB_HAVE_UNLOAD_EVENT (inferior_pid)
+ && (!SOLIB_HAVE_UNLOAD_EVENT (PIDGET (inferior_ptid))
|| ((b->dll_pathname != NULL)
&& (strcmp (b->dll_pathname,
- SOLIB_UNLOADED_LIBRARY_PATHNAME (inferior_pid))
+ SOLIB_UNLOADED_LIBRARY_PATHNAME (
+ PIDGET (inferior_ptid)))
!= 0)))
#endif
)
continue;
if ((b->type == bp_catch_fork)
- && !target_has_forked (inferior_pid, &b->forked_inferior_pid))
+ && !target_has_forked (PIDGET (inferior_ptid),
+ &b->forked_inferior_pid))
continue;
if ((b->type == bp_catch_vfork)
- && !target_has_vforked (inferior_pid, &b->forked_inferior_pid))
+ && !target_has_vforked (PIDGET (inferior_ptid),
+ &b->forked_inferior_pid))
continue;
if ((b->type == bp_catch_exec)
- && !target_has_execd (inferior_pid, &b->exec_pathname))
+ && !target_has_execd (PIDGET (inferior_ptid), &b->exec_pathname))
continue;
if (ep_is_exception_catchpoint (b) &&
back and decide something of a lower priority is better. The
ordering is:
- kc < clr sgl shl slr sn sr ss ts
+ kc < clr sgl shl shlr slr sn sr ss ts
sgl < clrs shl shlr slr sn sr ss ts
slr < err shl shlr sn sr ss ts
clr < clrs err shl shlr sn sr ss ts
struct breakpoint *b;
ALL_BREAKPOINTS (b)
if (b->enable == enabled && b->type == bp_watchpoint)
- return 1;
+ return 1;
return 0;
}
((b->type == bp_hardware_watchpoint) ||
(b->type == bp_read_watchpoint) ||
(b->type == bp_access_watchpoint)))
- return 1;
+ return 1;
return 0;
}
\f
catchpoint triggers. Clients who may wish to know the name
later must get it from the catchpoint itself.) */
if (ep->triggered_dll_pathname != NULL)
- free (ep->triggered_dll_pathname);
+ xfree (ep->triggered_dll_pathname);
if (ep->type == bp_catch_load)
- dll_pathname = SOLIB_LOADED_LIBRARY_PATHNAME (inferior_pid);
+ dll_pathname = SOLIB_LOADED_LIBRARY_PATHNAME (
+ PIDGET (inferior_ptid));
else
- dll_pathname = SOLIB_UNLOADED_LIBRARY_PATHNAME (inferior_pid);
+ dll_pathname = SOLIB_UNLOADED_LIBRARY_PATHNAME (
+ PIDGET (inferior_ptid));
#else
dll_pathname = NULL;
#endif
annotate_field (1);
if (((int) b->type > (sizeof (bptypes) / sizeof (bptypes[0])))
|| ((int) b->type != bptypes[(int) b->type].type))
- internal_error ("bptypes table does not describe type #%d.",
+ internal_error (__FILE__, __LINE__,
+ "bptypes table does not describe type #%d.",
(int) b->type);
#ifdef UI_OUT
ui_out_field_string (uiout, "type", bptypes[(int) b->type].description);
/* 5 and 6 */
strcpy (wrap_indent, " ");
if (addressprint)
- strcat (wrap_indent, " ");
+ {
+ if (TARGET_ADDR_BIT <= 32)
+ strcat (wrap_indent, " ");
+ else
+ strcat (wrap_indent, " ");
+ }
switch (b->type)
{
case bp_none:
- internal_error ("print_one_breakpoint: bp_none encountered\n");
+ internal_error (__FILE__, __LINE__,
+ "print_one_breakpoint: bp_none encountered\n");
break;
case bp_watchpoint:
#else
if (addressprint)
{
+ char *tmp;
+
annotate_field (4);
- /* FIXME-32x64: need a print_address_numeric with
- field width */
- printf_filtered
- ("%s ",
- local_hex_string_custom
- ((unsigned long) b->address, "08l"));
+
+ if (TARGET_ADDR_BIT <= 32)
+ tmp = longest_local_hex_string_custom (b->address
+ & (CORE_ADDR) 0xffffffff,
+ "08l");
+ else
+ tmp = longest_local_hex_string_custom (b->address, "016l");
+
+ printf_filtered ("%s ", tmp);
}
annotate_field (5);
*last_addr = b->address;
if (addressprint)
{
annotate_field (4);
- ui_out_table_header (uiout, 10, ui_left, "Address"); /* 5 */
+ if (TARGET_ADDR_BIT <= 32)
+ ui_out_table_header (uiout, 10, ui_left, "Address"); /* 5 */
+ else
+ ui_out_table_header (uiout, 18, ui_left, "Address"); /* 5 */
}
annotate_field (5);
ui_out_table_header (uiout, 40, ui_noalign, "What"); /* 6 */
if (addressprint)
{
annotate_field (4);
- printf_filtered ("Address ");
+ if (TARGET_ADDR_BIT <= 32)
+ printf_filtered ("Address ");
+ else
+ printf_filtered ("Address ");
}
annotate_field (5);
printf_filtered ("What\n");
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);
}
b->section == section)
{
others--;
- printf_filtered
- ("%d%s%s ",
- b->number,
- ((b->enable == disabled ||
- b->enable == shlib_disabled ||
- b->enable == call_disabled) ? " (disabled)"
- : b->enable == permanent ? " (permanent)"
- : ""),
- (others > 1) ? "," : ((others == 1) ? " and" : ""));
+ printf_filtered ("%d%s%s ",
+ b->number,
+ ((b->enable == disabled ||
+ b->enable == shlib_disabled ||
+ b->enable == call_disabled) ? " (disabled)"
+ : b->enable == permanent ? " (permanent)"
+ : ""),
+ (others > 1) ? ","
+ : ((others == 1) ? " and" : ""));
}
printf_filtered ("also set at pc ");
print_address_numeric (pc, 1, gdb_stdout);
/* Permanent breakpoint should always be inserted. */
if (! perm_bp->inserted)
- internal_error ("allegedly permanent breakpoint is not "
+ internal_error (__FILE__, __LINE__,
+ "allegedly permanent breakpoint is not "
"actually inserted");
ALL_BREAKPOINTS (b)
if (b != perm_bp)
{
if (b->inserted)
- internal_error ("another breakpoint was inserted on top of "
+ internal_error (__FILE__, __LINE__,
+ "another breakpoint was inserted on top of "
"a permanent breakpoint");
if (b->enable != disabled
b->enable = disabled;
b->silent = 1;
if (func_name)
- b->addr_string = strsave (func_name);
+ b->addr_string = xstrdup (func_name);
b->number = internal_breakpoint_number--;
}
b->enable = enabled;
/* addr_string has to be used or breakpoint_re_set will delete me. */
sprintf (addr_string, "*0x%s", paddr (b->address));
- b->addr_string = strsave (addr_string);
+ b->addr_string = xstrdup (addr_string);
return b;
}
ALL_BREAKPOINTS_SAFE (b, temp)
if (b->type == bp_shlib_event)
- delete_breakpoint (b);
+ delete_breakpoint (b);
}
struct breakpoint *
/* Make sure that all storage allocated in decode_line_1 gets freed
in case the following errors out. */
- old_chain = make_cleanup (free, sals.sals);
+ old_chain = make_cleanup (xfree, sals.sals);
if (canonical != (char **) NULL)
{
- make_cleanup (free, canonical);
+ make_cleanup (xfree, canonical);
canonical_strings_chain = make_cleanup (null_cleanup, 0);
if (canonical[0] != NULL)
- make_cleanup (free, canonical[0]);
+ make_cleanup (xfree, canonical[0]);
}
resolve_sal_pc (&sals.sals[0]);
/* If we're debugging a multi-threaded program, then we
want momentary breakpoints to be active in only a
single thread of control. */
- if (in_thread_list (inferior_pid))
- b->thread = pid_to_thread_id (inferior_pid);
+ if (in_thread_list (inferior_ptid))
+ b->thread = pid_to_thread_id (inferior_ptid);
return b;
}
old_chain = make_cleanup (null_cleanup, 0);
/* Make sure that all storage allocated to SALS gets freed. */
- make_cleanup (free, sals.sals);
+ make_cleanup (xfree, sals.sals);
/* Cleanup the addr_string array but not its contents. */
- make_cleanup (free, addr_string);
+ make_cleanup (xfree, addr_string);
/* Allocate space for all the cond expressions. */
cond = xcalloc (sals.nelts, sizeof (struct expression *));
- make_cleanup (free, cond);
+ make_cleanup (xfree, cond);
/* Allocate space for all the cond strings. */
cond_string = xcalloc (sals.nelts, sizeof (char **));
- make_cleanup (free, cond_string);
+ make_cleanup (xfree, cond_string);
/* ----------------------------- SNIP -----------------------------
Anything added to the cleanup chain beyond this point is assumed
for (i = 0; i < sals.nelts; i++)
{
if (addr_string[i] != NULL)
- make_cleanup (free, addr_string[i]);
+ make_cleanup (xfree, addr_string[i]);
}
/* Resolve all line numbers to PC's and verify that the addresses
{
tok = cond_start = end_tok + 1;
cond[i] = parse_exp_1 (&tok, block_for_pc (sals.sals[i].pc), 0);
- make_cleanup (free, cond[i]);
+ make_cleanup (xfree, cond[i]);
cond_end = tok;
cond_string[i] = savestring (cond_start, cond_end - cond_start);
- make_cleanup (free, cond_string[i]);
+ make_cleanup (xfree, cond_string[i]);
}
else if (toklen >= 1 && strncmp (tok, "thread", toklen) == 0)
{
old_chain = make_cleanup (null_cleanup, 0);
/* Always have a addr_string array, even if it is empty. */
- make_cleanup (free, addr_string);
+ make_cleanup (xfree, addr_string);
/* Make sure that all storage allocated to SALS gets freed. */
- make_cleanup (free, sals.sals);
+ make_cleanup (xfree, sals.sals);
/* Allocate space for all the cond expressions. */
cond = xcalloc (sals.nelts, sizeof (struct expression *));
- make_cleanup (free, cond);
+ make_cleanup (xfree, cond);
/* Allocate space for all the cond strings. */
cond_string = xcalloc (sals.nelts, sizeof (char **));
- make_cleanup (free, cond_string);
+ make_cleanup (xfree, cond_string);
/* ----------------------------- SNIP -----------------------------
Anything added to the cleanup chain beyond this point is assumed
for (i = 0; i < sals.nelts; i++)
{
if (addr_string[i] != NULL)
- make_cleanup (free, addr_string[i]);
+ make_cleanup (xfree, addr_string[i]);
}
/* Wait until now before checking for garbage at the end of the
cond[i] = parse_exp_1 (&tok, block_for_pc (sals.sals[i].pc), 0);
if (*tok != '\0')
error ("Garbage %s follows condition", tok);
- make_cleanup (free, cond[i]);
+ make_cleanup (xfree, cond[i]);
cond_string[i] = xstrdup (args->condition);
}
}
{
struct frame_info *frame;
CORE_ADDR low, high, selected_pc = 0;
- char *extra_args, *level_arg, *addr_string;
+ char *extra_args = NULL;
+ char *level_arg;
+ char *addr_string;
int extra_args_len = 0, if_arg = 0;
if (!arg ||
else
sprintf (addr_string, "*0x%s", paddr_nz (high));
break_command_1 (addr_string, flag, from_tty);
- free (addr_string);
+ xfree (addr_string);
}
else
error ("No function contains the specified address");
struct symtabs_and_lines sals;
struct symtab_and_line sal;
struct cleanup *old_chain;
- char *extra_args;
+ char *extra_args = NULL;
int extra_args_len = 0;
int i, if_arg = 0;
sals = decode_line_1 (&addr_string, 1, (struct symtab *) NULL, 0,
(char ***) NULL);
- free (beg_addr_string);
- old_chain = make_cleanup (free, sals.sals);
+ xfree (beg_addr_string);
+ old_chain = make_cleanup (xfree, sals.sals);
for (i = 0; (i < sals.nelts); i++)
{
sal = sals.sals[i];
else
sprintf (break_string, "*0x%s", paddr_nz (high));
break_command_1 (break_string, flag, from_tty);
- free (break_string);
+ xfree (break_string);
}
else
error ("No function contains the specified address");
startup sequence by the dynamic linker.
However, I tried avoiding that by having HP-UX's implementation of
- TARGET_CAN_USE_HW_WATCHPOINT return FALSE if there was no inferior_pid
+ TARGET_CAN_USE_HW_WATCHPOINT return FALSE if there was no inferior_ptid
yet, which forced slow watches before a "run" or "attach", and it
still fails somewhere in the startup code.
#if !defined(TARGET_REGION_OK_FOR_HW_WATCHPOINT)
#define TARGET_REGION_OK_FOR_HW_WATCHPOINT(ADDR,LEN) \
- TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT(LEN)
+ (TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT(LEN))
#endif
static int
error ("Couldn't get information on specified line.");
sal = sals.sals[0];
- free ((PTR) sals.sals); /* malloc'd, so freed */
+ xfree (sals.sals); /* malloc'd, so freed */
if (*arg)
error ("Junk at end of arguments.");
/* Create a load breakpoint that only triggers when a load of
the specified dll (or any dll, if no pathname was specified)
occurs. */
- SOLIB_CREATE_CATCH_LOAD_HOOK (inferior_pid, tempflag,
+ SOLIB_CREATE_CATCH_LOAD_HOOK (PIDGET (inferior_ptid), tempflag,
dll_pathname, cond_string);
}
/* Create an unload breakpoint that only triggers when an unload of
the specified dll (or any dll, if no pathname was specified)
occurs. */
- SOLIB_CREATE_CATCH_UNLOAD_HOOK (inferior_pid, tempflag,
+ SOLIB_CREATE_CATCH_UNLOAD_HOOK (PIDGET (inferior_ptid), tempflag,
dll_pathname, cond_string);
}
#endif /* SOLIB_ADD */
warning ("Multiple breakpoints were set.");
warning ("Use the \"delete\" command to delete unwanted breakpoints.");
}
- free ((PTR) sals.sals);
+ xfree (sals.sals);
}
#if 0
if (from_tty)
putchar_unfiltered ('\n');
}
- free ((PTR) sals.sals);
+ xfree (sals.sals);
}
\f
/* Delete breakpoint in BS if they are `delete' breakpoints and
If there is a permanent breakpoint somewhere, it should
always be the only one inserted. */
if (b->enable == permanent)
- internal_error ("another breakpoint was inserted on top of "
+ internal_error (__FILE__, __LINE__,
+ "another breakpoint was inserted on top of "
"a permanent breakpoint");
if (b->type == bp_hardware_breakpoint)
free_command_lines (&bpt->commands);
if (bpt->cond)
- free (bpt->cond);
+ xfree (bpt->cond);
if (bpt->cond_string != NULL)
- free (bpt->cond_string);
+ xfree (bpt->cond_string);
if (bpt->addr_string != NULL)
- free (bpt->addr_string);
+ xfree (bpt->addr_string);
if (bpt->exp != NULL)
- free (bpt->exp);
+ xfree (bpt->exp);
if (bpt->exp_string != NULL)
- free (bpt->exp_string);
+ xfree (bpt->exp_string);
if (bpt->val != NULL)
value_free (bpt->val);
if (bpt->source_file != NULL)
- free (bpt->source_file);
+ xfree (bpt->source_file);
if (bpt->dll_pathname != NULL)
- free (bpt->dll_pathname);
+ xfree (bpt->dll_pathname);
if (bpt->triggered_dll_pathname != NULL)
- free (bpt->triggered_dll_pathname);
+ xfree (bpt->triggered_dll_pathname);
if (bpt->exec_pathname != NULL)
- free (bpt->exec_pathname);
+ xfree (bpt->exec_pathname);
/* Be sure no bpstat's are pointing at it after it's been freed. */
/* FIXME, how can we find all bpstat's?
bp, we mark it as deleted before freeing its storage. */
bpt->type = bp_none;
- free ((PTR) bpt);
+ xfree (bpt);
}
static void
{
s = b->cond_string;
if (b->cond)
- free ((PTR) b->cond);
+ xfree (b->cond);
b->cond = parse_exp_1 (&s, block_for_pc (sals.sals[i].pc), 0);
}
)
{
if (b->source_file != NULL)
- free (b->source_file);
+ xfree (b->source_file);
if (sals.sals[i].symtab == NULL)
b->source_file = NULL;
else
check_duplicates (b->address, b->section);
}
- free ((PTR) sals.sals);
+ xfree (sals.sals);
break;
case bp_watchpoint:
/* So for now, just use a global context. */
if (b->exp)
- free ((PTR) b->exp);
+ xfree (b->exp);
b->exp = parse_expression (b->exp_string);
b->exp_valid_block = innermost_block;
mark = value_mark ();
{
s = b->cond_string;
if (b->cond)
- free ((PTR) b->cond);
+ xfree (b->cond);
b->cond = parse_exp_1 (&s, (struct block *) 0, 0);
}
if (b->enable == enabled)
/* Reset the thread number of this breakpoint:
- If the breakpoint is for all threads, leave it as-is.
- - Else, reset it to the current thread for inferior_pid. */
+ - Else, reset it to the current thread for inferior_ptid. */
void
breakpoint_re_set_thread (struct breakpoint *b)
{
if (b->thread != -1)
{
- if (in_thread_list (inferior_pid))
- b->thread = pid_to_thread_id (inferior_pid);
+ if (in_thread_list (inferior_ptid))
+ b->thread = pid_to_thread_id (inferior_ptid);
}
}