{
const char *p;
- if (args == NULL || *args == '\0')
+ if (args == nullptr || *args == '\0')
{
*bg_char_p = 0;
- return NULL;
+ return nullptr;
}
p = args + strlen (args);
/* If the solist is global across processes, there's no need to
refetch it here. */
if (!gdbarch_has_global_solist (target_gdbarch ()))
- solib_add (NULL, 0, auto_solib_add);
+ solib_add (nullptr, 0, auto_solib_add);
}
}
want them to go away (PR 2207). This is probably reasonable. */
/* If there were other args, beside '&', process them. */
- if (args != NULL)
+ if (args != nullptr)
current_inferior ()->set_args (args);
if (from_tty)
{
- uiout->field_string (NULL, "Starting program");
+ uiout->field_string (nullptr, "Starting program");
uiout->text (": ");
if (exec_file)
uiout->field_string ("execfile", exec_file,
from_tty);
/* to_create_inferior should push the target, so after this point we
shouldn't refer to run_target again. */
- run_target = NULL;
+ run_target = nullptr;
infrun_debug_show_threads ("immediately after create_process",
current_inferior ()->non_exited_threads ());
scoped_disable_commit_resumed disable_commit_resumed
("continue all threads in non-stop");
- iterate_over_threads (proceed_thread_callback, NULL);
+ iterate_over_threads (proceed_thread_callback, nullptr);
if (current_ui->prompt_state == PROMPT_BLOCKED)
{
gdb::unique_xmalloc_ptr<char> stripped = strip_bg_char (args, &async_exec);
args = stripped.get ();
- if (args != NULL)
+ if (args != nullptr)
{
if (startswith (args, "-a"))
{
all_threads_p = true;
args += sizeof ("-a") - 1;
if (*args == '\0')
- args = NULL;
+ args = nullptr;
}
}
if (!non_stop && all_threads_p)
error (_("`-a' is meaningless in all-stop mode."));
- if (args != NULL && all_threads_p)
+ if (args != nullptr && all_threads_p)
error (_("Can't resume all threads and specify "
"proceed count simultaneously."));
/* If we have an argument left, set proceed count of breakpoint we
stopped at. */
- if (args != NULL)
+ if (args != nullptr)
{
bpstat *bs = nullptr;
int num, stat;
get_last_target_status (&last_target, &last_ptid, nullptr);
tp = find_thread_ptid (last_target, last_ptid);
}
- if (tp != NULL)
+ if (tp != nullptr)
bs = tp->control.stop_bpstat;
while ((stat = bpstat_num (&bs, &num)) != 0)
&& inline_skipped_frames (tp))
{
ptid_t resume_ptid;
- const char *fn = NULL;
+ const char *fn = nullptr;
symtab_and_line sal;
struct symbol *sym;
sal = find_frame_sal (frame);
sym = get_frame_function (frame);
- if (sym != NULL)
+ if (sym != nullptr)
fn = sym->print_name ();
if (sal.line == 0
/* See if we are trying to jump to another function. */
fn = get_frame_function (get_current_frame ());
sfn = find_pc_function (sal.pc);
- if (fn != NULL && sfn != fn)
+ if (fn != nullptr && sfn != fn)
{
if (!query (_("Line %d is not in `%s'. Jump anyway? "), sal.line,
fn->print_name ()))
}
}
- if (sfn != NULL)
+ if (sfn != nullptr)
{
struct obj_section *section;
ensure_valid_thread ();
ensure_not_running ();
- if (signum_exp == NULL)
+ if (signum_exp == nullptr)
error_no_arg (_("signal number"));
/* It would be even slicker to make signal names be valid expressions,
{
struct bound_minimal_symbol msymbol = lookup_minimal_symbol_by_pc (pc);
- if (msymbol.minsym == NULL)
+ if (msymbol.minsym == nullptr)
error (_("Execution is not within a known function."));
tp->control.step_range_start = msymbol.value_address ();
ensure_valid_thread ();
ensure_not_running ();
- if (arg == NULL)
+ if (arg == nullptr)
error_no_arg (_("a location"));
/* Find out whether we must run in the background. */
calls are made async, this will likely be made the norm. */
switch (gdbarch_return_value (gdbarch, function, value_type,
- NULL, NULL, NULL))
+ nullptr, nullptr, nullptr))
{
case RETURN_VALUE_REGISTER_CONVENTION:
case RETURN_VALUE_ABI_RETURNS_ADDRESS:
case RETURN_VALUE_ABI_PRESERVES_ADDRESS:
value = allocate_value (value_type);
gdbarch_return_value (gdbarch, function, value_type, stop_regs,
- value_contents_raw (value).data (), NULL);
+ value_contents_raw (value).data (), nullptr);
break;
case RETURN_VALUE_STRUCT_CONVENTION:
- value = NULL;
+ value = nullptr;
break;
default:
internal_error (_("bad switch"));
static void
print_return_value_1 (struct ui_out *uiout, struct return_value_info *rv)
{
- if (rv->value != NULL)
+ if (rv->value != nullptr)
{
/* Print it. */
uiout->text ("Value returned is ");
void
print_return_value (struct ui_out *uiout, struct return_value_info *rv)
{
- if (rv->type == NULL
+ if (rv->type == nullptr
|| check_typedef (rv->type)->code () == TYPE_CODE_VOID)
return;
{
struct return_value_info *rv = &return_value_info;
- if (function != NULL
+ if (function != nullptr
&& bpstat_find_breakpoint (tp->control.stop_bpstat,
- breakpoint.get ()) != NULL)
+ breakpoint.get ()) != nullptr)
{
/* We're done. */
set_finished ();
rv->type = function->type ()->target_type ();
- if (rv->type == NULL)
+ if (rv->type == nullptr)
internal_error (_("finish_command: function has no target type"));
if (check_typedef (rv->type)->code () != TYPE_CODE_VOID)
{
struct value *func;
- func = read_var_value (function, NULL, get_current_frame ());
+ func = read_var_value (function, nullptr, get_current_frame ());
if (return_buf != 0)
/* Retrieve return value from the buffer where it was saved. */
else
rv->value = get_return_value (function, func);
- if (rv->value != NULL)
+ if (rv->value != nullptr)
rv->value_history_index = record_latest_value (rv->value);
}
}
pc = get_frame_pc (get_current_frame ());
- if (find_pc_partial_function (pc, NULL, &func_addr, NULL) == 0)
+ if (find_pc_partial_function (pc, nullptr, &func_addr, nullptr) == 0)
error (_("Cannot find bounds of current function"));
sal = find_pc_line (func_addr, 0);
if (sal.pc != pc)
{
- frame_info_ptr frame = get_selected_frame (NULL);
+ frame_info_ptr frame = get_selected_frame (nullptr);
struct gdbarch *gdbarch = get_frame_arch (frame);
/* Set a step-resume at the function's entry point. Once that's
bp_finish);
/* set_momentary_breakpoint invalidates FRAME. */
- frame = NULL;
+ frame = nullptr;
set_longjmp_breakpoint (tp, frame_id);
start = frame;
frame = skip_tailcall_frames (frame);
- if (frame == NULL)
+ if (frame == nullptr)
break;
frame = skip_unwritable_frames (frame);
- if (frame == NULL)
+ if (frame == nullptr)
break;
}
while (start != frame);
if (from_tty)
{
gdb_printf (_("Run till exit from "));
- print_stack_frame (get_selected_frame (NULL), 1, LOCATION, 0);
+ print_stack_frame (get_selected_frame (nullptr), 1, LOCATION, 0);
}
proceed ((CORE_ADDR) -1, GDB_SIGNAL_DEFAULT);
}
/* Find the function we will return from. */
- frame_info_ptr callee_frame = get_selected_frame (NULL);
+ frame_info_ptr callee_frame = get_selected_frame (nullptr);
sm->function = find_pc_function (get_frame_pc (callee_frame));
sm->return_buf = 0; /* Initialize buffer address is not available. */
/* Determine the return convention. If it is RETURN_VALUE_STRUCT_CONVENTION,
attempt to determine the address of the return buffer. */
- if (sm->function != NULL)
+ if (sm->function != nullptr)
{
enum return_value_convention return_value;
struct gdbarch *gdbarch = get_frame_arch (callee_frame);
= check_typedef (sm->function->type ()->target_type ());
return_value = gdbarch_return_value (gdbarch,
- read_var_value (sm->function, NULL,
+ read_var_value (sm->function, nullptr,
callee_frame),
- val_type, NULL, NULL, NULL);
+ val_type, nullptr, nullptr, nullptr);
if (return_value == RETURN_VALUE_STRUCT_CONVENTION
&& val_type->code () != TYPE_CODE_VOID)
gdb_printf (_("Run back to call of "));
else
{
- if (sm->function != NULL && TYPE_NO_RETURN (sm->function->type ())
+ if (sm->function != nullptr && TYPE_NO_RETURN (sm->function->type ())
&& !query (_("warning: Function %s does not return normally.\n"
"Try to finish anyway? "),
sm->function->print_name ()))
{
frame = skip_finish_frames (frame);
- if (frame == NULL)
+ if (frame == nullptr)
error (_("Cannot find the caller frame."));
finish_forward (sm, frame);
{
char **envp = current_inferior ()->environment.envp ();
- for (int idx = 0; envp[idx] != NULL; ++idx)
+ for (int idx = 0; envp[idx] != nullptr; ++idx)
{
gdb_puts (envp[idx]);
gdb_puts ("\n");
mod_path (dirname, exec_path);
current_inferior ()->environment.set (path_var_name, exec_path.c_str ());
if (from_tty)
- path_info (NULL, from_tty);
+ path_info (nullptr, from_tty);
}
\f
if (!target_has_registers ())
error (_("The program has no registers now."));
- frame = get_selected_frame (NULL);
+ frame = get_selected_frame (nullptr);
gdbarch = get_frame_arch (frame);
if (!addr_exp)
break;
}
}
- if (group != NULL)
+ if (group != nullptr)
{
int regnum;
if (!target_has_registers ())
error (_("The program has no registers now."));
- print_vector_info (gdb_stdout, get_selected_frame (NULL), args);
+ print_vector_info (gdb_stdout, get_selected_frame (nullptr), args);
}
\f
/* Kill the inferior process. Make us have no inferior. */
/* If no exec file is yet known, try to determine it from the
process itself. */
- if (get_exec_file (0) == NULL)
+ if (get_exec_file (0) == nullptr)
exec_file_locate_attach (inferior_ptid.pid (), 1, from_tty);
else
{
attach_target->attach (args, from_tty);
/* to_attach should push the target, so after this point we
shouldn't refer to attach_target again. */
- attach_target = NULL;
+ attach_target = nullptr;
infrun_debug_show_threads ("immediately after attach",
current_inferior ()->non_exited_threads ());
/* If the solist is global across inferiors, don't clear it when we
detach from a single inferior. */
if (!gdbarch_has_global_solist (target_gdbarch ()))
- no_shared_libraries (NULL, from_tty);
+ no_shared_libraries (nullptr, from_tty);
if (deprecated_detach_hook)
deprecated_detach_hook ();
query_if_trace_running (from_tty);
disconnect_tracing ();
target_disconnect (args, from_tty);
- no_shared_libraries (NULL, from_tty);
+ no_shared_libraries (nullptr, from_tty);
init_thread_list ();
if (deprecated_detach_hook)
deprecated_detach_hook ();
dont_repeat (); /* Not for the faint of heart. */
- if (args != NULL
+ if (args != nullptr
&& startswith (args, "-a"))
all_threads = 1;
if (!target_has_registers ())
error (_("The program has no registers now."));
- frame = get_selected_frame (NULL);
+ frame = get_selected_frame (nullptr);
gdbarch_print_float_info (get_frame_arch (frame), gdb_stdout, frame, args);
}
\f
_initialize_infcmd ()
{
static struct cmd_list_element *info_proc_cmdlist;
- struct cmd_list_element *c = NULL;
+ struct cmd_list_element *c = nullptr;
const char *cmd_name;
/* Add the filename of the terminal connected to inferior I/O. */
show_inferior_tty_command,
&setlist, &showlist);
cmd_name = "inferior-tty";
- c = lookup_cmd (&cmd_name, setlist, "", NULL, -1, 1);
- gdb_assert (c != NULL);
+ c = lookup_cmd (&cmd_name, setlist, "", nullptr, -1, 1);
+ gdb_assert (c != nullptr);
add_alias_cmd ("tty", c, class_run, 0, &cmdlist);
cmd_name = "args";
set_args_command,
show_args_command,
&setlist, &showlist);
- c = lookup_cmd (&cmd_name, setlist, "", NULL, -1, 1);
- gdb_assert (c != NULL);
+ c = lookup_cmd (&cmd_name, setlist, "", nullptr, -1, 1);
+ gdb_assert (c != nullptr);
set_cmd_completer (c, filename_completer);
cmd_name = "cwd";
set_cwd_command,
show_cwd_command,
&setlist, &showlist);
- c = lookup_cmd (&cmd_name, setlist, "", NULL, -1, 1);
- gdb_assert (c != NULL);
+ c = lookup_cmd (&cmd_name, setlist, "", nullptr, -1, 1);
+ gdb_assert (c != nullptr);
set_cmd_completer (c, filename_completer);
c = add_cmd ("environment", no_class, environment_info, _("\
add_setshow_boolean_cmd ("finish", class_support,
&finish_print, _("\
Set whether `finish' prints the return value."), _("\
-Show whether `finish' prints the return value."), NULL,
- NULL,
+Show whether `finish' prints the return value."), nullptr,
+ nullptr,
show_print_finish,
&setprintlist, &showprintlist);
}
static const char *const follow_fork_mode_kind_names[] = {
follow_fork_mode_child,
follow_fork_mode_parent,
- NULL
+ nullptr
};
static const char *follow_fork_mode_string = follow_fork_mode_parent;
if (has_vforked)
{
- gdb_assert (child_inf->vfork_parent == NULL);
- gdb_assert (parent_inf->vfork_child == NULL);
+ gdb_assert (child_inf->vfork_parent == nullptr);
+ gdb_assert (parent_inf->vfork_child == nullptr);
child_inf->vfork_parent = parent_inf;
child_inf->pending_detach = 0;
parent_inf->vfork_child = child_inf;
followed fork child thread should have a copy of most of the
parent thread structure's run control related fields, not just these.
Initialized to avoid "may be used uninitialized" warnings from gcc. */
- struct breakpoint *step_resume_breakpoint = NULL;
- struct breakpoint *exception_resume_breakpoint = NULL;
+ struct breakpoint *step_resume_breakpoint = nullptr;
+ struct breakpoint *exception_resume_breakpoint = nullptr;
CORE_ADDR step_range_start = 0;
CORE_ADDR step_range_end = 0;
int current_line = 0;
- symtab *current_symtab = NULL;
+ symtab *current_symtab = nullptr;
struct frame_id step_frame_id = { 0 };
if (!non_stop)
/* This exec or exit marks the end of the shared memory region
between the parent and the child. Break the bonds. */
inferior *vfork_parent = inf->vfork_parent;
- inf->vfork_parent->vfork_child = NULL;
- inf->vfork_parent = NULL;
+ inf->vfork_parent->vfork_child = nullptr;
+ inf->vfork_parent = nullptr;
/* If the user wanted to detach from the parent, now is the
time. */
pspace = inf->pspace;
aspace = inf->aspace;
- inf->aspace = NULL;
- inf->pspace = NULL;
+ inf->aspace = nullptr;
+ inf->pspace = nullptr;
if (print_inferior_events)
{
{
follow_exec_mode_new,
follow_exec_mode_same,
- NULL,
+ nullptr,
};
static const char *follow_exec_mode_string = follow_exec_mode_same;
breakpoint or similar, it's gone now. We cannot truly
step-to-next statement through an exec(). */
thread_info *th = inferior_thread ();
- th->control.step_resume_breakpoint = NULL;
- th->control.exception_resume_breakpoint = NULL;
- th->control.single_step_breakpoints = NULL;
+ th->control.step_resume_breakpoint = nullptr;
+ th->control.exception_resume_breakpoint = nullptr;
+ th->control.single_step_breakpoints = nullptr;
th->control.step_range_start = 0;
th->control.step_range_end = 0;
breakpoint_init_inferior (inf_execd);
gdb::unique_xmalloc_ptr<char> exec_file_host
- = exec_file_find (exec_file_target, NULL);
+ = exec_file_find (exec_file_target, nullptr);
/* If we were unable to map the executable target pathname onto a host
pathname, tell the user that. Otherwise GDB's subsequent behavior
is confusing. Maybe it would even be better to stop at this point
so that the user can specify a file manually before continuing. */
- if (exec_file_host == NULL)
+ if (exec_file_host == nullptr)
warning (_("Could not load symbols for executable %s.\n"
"Do you need \"set sysroot\"?"),
exec_file_target);
/* Also, loading a symbol file below may trigger symbol lookups, and
we don't want those to be satisfied by the libraries of the
previous incarnation of this process. */
- no_shared_libraries (NULL, 0);
+ no_shared_libraries (nullptr, 0);
struct inferior *inf = current_inferior ();
clear_step_over_info (void)
{
infrun_debug_printf ("clearing step over info");
- step_over_info.aspace = NULL;
+ step_over_info.aspace = nullptr;
step_over_info.address = 0;
step_over_info.nonsteppable_watchpoint_p = 0;
step_over_info.thread = -1;
stepping_past_instruction_at (struct address_space *aspace,
CORE_ADDR address)
{
- return (step_over_info.aspace != NULL
+ return (step_over_info.aspace != nullptr
&& breakpoint_address_match (aspace, address,
step_over_info.aspace,
step_over_info.address));
static bool
step_over_info_valid_p (void)
{
- return (step_over_info.aspace != NULL
+ return (step_over_info.aspace != nullptr
|| stepping_past_nonsteppable_watchpoint ());
}
static bool
displaced_step_in_progress_thread (thread_info *thread)
{
- gdb_assert (thread != NULL);
+ gdb_assert (thread != nullptr);
return thread->displaced_step_state.in_progress ();
}
schedlock_on,
schedlock_step,
schedlock_replay,
- NULL
+ nullptr
};
static const char *scheduler_mode = schedlock_replay;
static void
user_visible_resume_target (ptid_t resume_ptid)
{
return (resume_ptid == minus_one_ptid && sched_multi
- ? NULL
+ ? nullptr
: current_inferior ()->process_target ());
}
clear_step_over_info ();
tp->control.trap_expected = 0;
- if (tp->control.step_resume_breakpoint == NULL)
+ if (tp->control.step_resume_breakpoint == nullptr)
{
/* Set a "high-priority" step-resume, as we don't want
user breakpoints at PC to trigger (again) when this
a step-resume breakpoint set on the earlier handler. We cannot
set another step-resume breakpoint; just continue on until the
original breakpoint is hit. */
- if (tp->control.step_resume_breakpoint == NULL)
+ if (tp->control.step_resume_breakpoint == nullptr)
{
insert_hp_step_resume_breakpoint_at_frame (get_current_frame ());
tp->step_after_step_resume_breakpoint = 1;
tp->control.step_frame_id = null_frame_id;
tp->control.step_stack_frame_id = null_frame_id;
tp->control.step_over_calls = STEP_OVER_UNDEBUGGABLE;
- tp->control.step_start_function = NULL;
+ tp->control.step_start_function = nullptr;
tp->stop_requested = 0;
tp->control.stop_step = 0;
/* We have a specific thread to check. */
tp = find_thread_ptid (inf, ptid);
- gdb_assert (tp != NULL);
+ gdb_assert (tp != nullptr);
if (!tp->has_pending_waitstatus ())
- tp = NULL;
+ tp = nullptr;
}
- if (tp != NULL
+ if (tp != nullptr
&& (tp->stop_reason () == TARGET_STOPPED_BY_SW_BREAKPOINT
|| tp->stop_reason () == TARGET_STOPPED_BY_HW_BREAKPOINT))
{
}
}
- if (tp != NULL)
+ if (tp != nullptr)
{
infrun_debug_printf ("Using pending wait status %s for %s.",
tp->pending_waitstatus ().to_string ().c_str (),
if (should_notify_stop)
{
/* We may not find an inferior if this was a process exit. */
- if (inf == NULL || inf->control.stop_soon == NO_STOP_QUIETLY)
+ if (inf == nullptr || inf->control.stop_soon == NO_STOP_QUIETLY)
proceeded = normal_stop ();
}
stepped_in_from (frame_info_ptr frame, struct frame_id step_frame_id)
{
for (frame = get_prev_frame (frame);
- frame != NULL;
+ frame != nullptr;
frame = get_prev_frame (frame))
{
if (get_frame_id (frame) == step_frame_id)
if (prev_frame)
frame = get_prev_frame (frame);
- for (; frame != NULL; frame = get_prev_frame (frame))
+ for (; frame != nullptr; frame = get_prev_frame (frame))
{
- const char *fn = NULL;
+ const char *fn = nullptr;
symtab_and_line sal;
struct symbol *sym;
sal = find_frame_sal (frame);
sym = get_frame_function (frame);
- if (sym != NULL)
+ if (sym != nullptr)
fn = sym->print_name ();
if (sal.line != 0
{
struct inferior *inf = find_inferior_ptid (ecs->target, ecs->ptid);
- gdb_assert (inf != NULL);
+ gdb_assert (inf != nullptr);
return inf->control.stop_soon;
}
for (inferior *inf : all_inferiors ())
{
process_stratum_target *target = inf->process_target ();
- if (target == NULL
+ if (target == nullptr
|| !target->is_async_p ()
|| !target->threads_executing)
continue;
for (inferior *inf : all_inferiors ())
{
process_stratum_target *target = inf->process_target ();
- if (target == NULL
+ if (target == nullptr
|| !target->is_async_p ()
|| !target->threads_executing)
continue;
/* No waitable targets left. All must be stopped. */
target_waitstatus ws;
ws.set_no_resumed ();
- return {NULL, minus_one_ptid, std::move (ws)};
+ return {nullptr, minus_one_ptid, std::move (ws)};
}
QUIT;
- int numfds = interruptible_select (nfds, &readfds, 0, NULL, 0);
+ int numfds = interruptible_select (nfds, &readfds, 0, nullptr, 0);
if (numfds < 0)
{
if (errno == EINTR)
else
{
thread_info *t = find_thread_ptid (event.target, event.ptid);
- if (t == NULL)
+ if (t == nullptr)
t = add_thread (event.target, event.ptid);
t->stop_requested = 0;
{
ecs->event_thread = find_thread_ptid (ecs->target, ecs->ptid);
/* If it's a new thread, add it to the thread database. */
- if (ecs->event_thread == NULL)
+ if (ecs->event_thread == nullptr)
ecs->event_thread = add_thread (ecs->target, ecs->ptid);
/* Disable range stepping. If the next step request could use a
return 0;
pending = iterate_over_threads (resumed_thread_with_pending_status,
- NULL);
- if (pending != NULL)
+ nullptr);
+ if (pending != nullptr)
{
struct thread_info *tp = ecs->event_thread;
struct regcache *regcache;
if (ecs->event_thread->prev_pc == ecs->event_thread->stop_pc ()
&& ecs->event_thread->control.trap_expected
- && ecs->event_thread->control.step_resume_breakpoint == NULL)
+ && ecs->event_thread->control.step_resume_breakpoint == nullptr)
{
/* We were just starting a new sequence, attempting to
single-step off of a breakpoint and expecting a SIGTRAP.
|| ecs->event_thread->control.step_range_end == 1)
&& (get_stack_frame_id (frame)
== ecs->event_thread->control.step_stack_frame_id)
- && ecs->event_thread->control.step_resume_breakpoint == NULL)
+ && ecs->event_thread->control.step_resume_breakpoint == nullptr)
{
/* The inferior is about to take a signal that will take it
out of the single step range. Set a breakpoint at the
infrun_debug_printf ("BPSTAT_WHAT_CLEAR_LONGJMP_RESUME");
gdb_assert (ecs->event_thread->control.exception_resume_breakpoint
- != NULL);
+ != nullptr);
delete_exception_resume_breakpoint (ecs->event_thread);
if (what.is_longjmp)
struct breakpoint *sr_bp
= ecs->event_thread->control.step_resume_breakpoint;
- if (sr_bp != NULL
+ if (sr_bp != nullptr
&& sr_bp->loc->permanent
&& sr_bp->type == bp_hp_step_resume
&& sr_bp->loc->address == ecs->event_thread->prev_pc)
the trampoline processing logic, however, there are some trampolines
that have no names, so we should do trampoline handling first. */
if (ecs->event_thread->control.step_over_calls == STEP_OVER_UNDEBUGGABLE
- && ecs->stop_func_name == NULL
+ && ecs->stop_func_name == nullptr
&& stop_pc_sal.line == 0)
{
infrun_debug_printf ("stepped into undebuggable function");
currently_stepping (struct thread_info *tp)
{
return ((tp->control.step_range_end
- && tp->control.step_resume_breakpoint == NULL)
+ && tp->control.step_resume_breakpoint == nullptr)
|| tp->control.trap_expected
|| tp->stepped_breakpoint
|| bpstat_should_step ());
compunit_symtab *cust
= find_pc_compunit_symtab (ecs->event_thread->stop_pc ());
- if (cust != NULL && cust->language () != language_asm)
+ if (cust != nullptr && cust->language () != language_asm)
ecs->stop_func_start
= gdbarch_skip_prologue_noexcept (gdbarch, ecs->stop_func_start);
fill_in_stop_func (gdbarch, ecs);
cust = find_pc_compunit_symtab (ecs->event_thread->stop_pc ());
- if (cust != NULL && cust->language () != language_asm)
+ if (cust != nullptr && cust->language () != language_asm)
ecs->stop_func_start
= gdbarch_skip_prologue_noexcept (gdbarch, ecs->stop_func_start);
/* There should never be more than one step-resume or longjmp-resume
breakpoint per thread, so we should never be setting a new
step_resume_breakpoint when one is already active. */
- gdb_assert (inferior_thread ()->control.step_resume_breakpoint == NULL);
+ gdb_assert (inferior_thread ()->control.step_resume_breakpoint == nullptr);
gdb_assert (sr_type == bp_step_resume || sr_type == bp_hp_step_resume);
infrun_debug_printf ("inserting step-resume breakpoint at %s",
static void
insert_hp_step_resume_breakpoint_at_frame (frame_info_ptr return_frame)
{
- gdb_assert (return_frame != NULL);
+ gdb_assert (return_frame != nullptr);
struct gdbarch *gdbarch = get_frame_arch (return_frame);
/* There should never be more than one longjmp-resume breakpoint per
thread, so we should never be setting a new
longjmp_resume_breakpoint when one is already active. */
- gdb_assert (inferior_thread ()->control.exception_resume_breakpoint == NULL);
+ gdb_assert (inferior_thread ()->control.exception_resume_breakpoint == nullptr);
infrun_debug_printf ("inserting longjmp-resume breakpoint at %s",
paddress (gdbarch, pc));
bp_exception_resume).release ();
/* set_momentary_breakpoint_at_pc invalidates FRAME. */
- frame = NULL;
+ frame = nullptr;
bp->thread = tp->global_num;
inferior_thread ()->control.exception_resume_breakpoint = bp;
ecs->event_thread->global_num);
}
else if (remove_wps)
- set_step_over_info (NULL, 0, remove_wps, -1);
+ set_step_over_info (nullptr, 0, remove_wps, -1);
/* If we now need to do an in-line step-over, we need to stop
all other threads. Note this must be done before
uiout->field_string ("thread-id", print_thread_id (thr));
const char *name = thread_name (thr);
- if (name != NULL)
+ if (name != nullptr)
{
uiout->text (" \"");
uiout->field_string ("name", name);
LOCATION: Print only location
SRC_AND_LOC: Print location and source line. */
if (do_frame_printing)
- print_stack_frame (get_selected_frame (NULL), 0, source_flag, 1);
+ print_stack_frame (get_selected_frame (nullptr), 0, source_flag, 1);
}
/* See infrun.h. */
return true;
if (inf_num != current_inferior ()->num)
return true;
- if (thread != NULL && thread->state != THREAD_STOPPED)
+ if (thread != nullptr && thread->state != THREAD_STOPPED)
return true;
if (get_stop_id () != stop_id)
return true;
gdb::observers::normal_stop.notify (inferior_thread ()->control.stop_bpstat,
stop_print_frame);
else
- gdb::observers::normal_stop.notify (NULL, stop_print_frame);
+ gdb::observers::normal_stop.notify (nullptr, stop_print_frame);
annotate_stopped ();
enum gdb_signal oursig;
int allsigs;
- if (args == NULL)
+ if (args == nullptr)
{
error_no_arg (_("signal to handle"));
}
"noignore",
"noprint",
"nopass",
- NULL,
+ nullptr,
};
signal_completer (ignore, tracker, text, word);
transferred =
target_read (current_inferior ()->top_target (),
TARGET_OBJECT_SIGNAL_INFO,
- NULL,
+ nullptr,
value_contents_all_raw (v).data (),
value_offset (v),
value_type (v)->length ());
transferred = target_write (current_inferior ()->top_target (),
TARGET_OBJECT_SIGNAL_INFO,
- NULL,
+ nullptr,
value_contents_all_raw (fromval).data (),
value_offset (v),
value_type (fromval)->length ());
{
struct type *type = gdbarch_get_siginfo_type (gdbarch);
- return allocate_computed_value (type, &siginfo_value_funcs, NULL);
+ return allocate_computed_value (type, &siginfo_value_funcs, nullptr);
}
return allocate_value (builtin_type (gdbarch)->builtin_void);
siginfo_data.reset ((gdb_byte *) xmalloc (len));
if (target_read (current_inferior ()->top_target (),
- TARGET_OBJECT_SIGNAL_INFO, NULL,
+ TARGET_OBJECT_SIGNAL_INFO, nullptr,
siginfo_data.get (), 0, len) != len)
{
/* Errors ignored. */
/* Errors ignored. */
target_write (current_inferior ()->top_target (),
- TARGET_OBJECT_SIGNAL_INFO, NULL,
+ TARGET_OBJECT_SIGNAL_INFO, nullptr,
m_siginfo_data.get (), 0, type->length ());
}
inf_status->thread_control = tp->control;
inf_status->inferior_control = inf->control;
- tp->control.step_resume_breakpoint = NULL;
- tp->control.exception_resume_breakpoint = NULL;
+ tp->control.step_resume_breakpoint = nullptr;
+ tp->control.exception_resume_breakpoint = nullptr;
/* Save original bpstat chain to INF_STATUS; replace it in TP with copy of
chain. If caller's caller is walking the chain, they'll be happier if we
static const char *const exec_direction_names[] = {
exec_forward,
exec_reverse,
- NULL
+ nullptr
};
static void
static const struct internalvar_funcs siginfo_funcs =
{
siginfo_make_value,
- NULL,
+ nullptr,
};
/* Callback for infrun's target events source. This is marked when a
/* Register extra event sources in the event loop. */
infrun_async_inferior_event_token
- = create_async_event_handler (infrun_async_inferior_event_handler, NULL,
+ = create_async_event_handler (infrun_async_inferior_event_handler, nullptr,
"infrun");
cmd_list_element *info_signals_cmd
_("Set inferior debugging."),
_("Show inferior debugging."),
_("When non-zero, inferior specific debugging is enabled."),
- NULL, show_debug_infrun, &setdebuglist, &showdebuglist);
+ nullptr, show_debug_infrun, &setdebuglist, &showdebuglist);
add_setshow_boolean_cmd ("non-stop", no_class,
&non_stop_1, _("\
child - the new process is debugged after a fork\n\
The unfollowed process will continue to run.\n\
By default, the debugger will follow the parent process."),
- NULL,
+ nullptr,
show_follow_fork_mode_string,
&setlist, &showlist);
the executable the process was running after the exec call.\n\
\n\
By default, the debugger will use the same inferior."),
- NULL,
+ nullptr,
show_follow_exec_mode_string,
&setlist, &showlist);
commands only resume the threads of the current process. The set of\n\
threads that are resumed is further refined by the scheduler-locking\n\
mode (see help set scheduler-locking)."),
- NULL,
+ nullptr,
show_schedule_multiple,
&setlist, &showlist);
When set, doing a step over a function without debug line information\n\
will stop at the first instruction of that function. Otherwise, the\n\
function is skipped and the step command stops at a different source line."),
- NULL,
+ nullptr,
show_step_stop_if_no_debug,
&setlist, &showlist);
architecture. If auto (which is the default), gdb will use displaced stepping\n\
if the target architecture supports it and non-stop mode is active, but will not\n\
use it in all-stop mode (see help set non-stop)."),
- NULL,
+ nullptr,
show_can_use_displaced_stepping,
&setlist, &showlist);
Set whether gdb will detach the child of a fork."), _("\
Show whether gdb will detach the child of a fork."), _("\
Tells gdb whether to detach the child of a fork."),
- NULL, NULL, &setlist, &showlist);
+ nullptr, nullptr, &setlist, &showlist);
/* Set/show disable address space randomization mode. */
value with a void typed value, and when we get here, gdbarch
isn't initialized yet. At this point, we're quite sure there
isn't another convenience variable of the same name. */
- create_internalvar_type_lazy ("_siginfo", &siginfo_funcs, NULL);
+ create_internalvar_type_lazy ("_siginfo", &siginfo_funcs, nullptr);
add_setshow_boolean_cmd ("observer", no_class,
&observer_mode_1, _("\