* infcall.c: White space.
* inf-child.c: White space.
* infcmd.c: White space.
* inferior.c: White space.
* inf-loop.c: White space.
* inflow.c: White space.
* inline-frame.c: White space.
* interps.c: White space.
2010-05-14 Michael Snyder <msnyder@vmware.com>
+ * infcall.c: White space.
+ * inf-child.c: White space.
+ * infcmd.c: White space.
+ * inferior.c: White space.
+ * inf-loop.c: White space.
+ * inflow.c: White space.
+ * inline-frame.c: White space.
+ * interps.c: White space.
+
* gcore.c: White space.
* gdb.c: White space.
* gdbtypes.c: White space.
inf_child_target (void)
{
struct target_ops *t = XZALLOC (struct target_ops);
+
t->to_shortname = "child";
t->to_longname = "Unix child process";
t->to_doc = "Unix child process (started by the \"run\" command).";
{
struct gdb_exception e;
int was_sync = 0;
+
switch (event_type)
{
case INF_ERROR:
{
/* Handle function descriptors lacking debug info. */
int found_descriptor = 0;
+
funaddr = 0; /* pacify "gcc -Werror" */
if (VALUE_LVAL (function) == lval_memory)
{
CORE_ADDR nfunaddr;
+
funaddr = value_as_address (value_addr (function));
nfunaddr = funaddr;
funaddr = gdbarch_convert_from_func_ptr_addr (gdbarch, funaddr,
{
{
struct symbol *symbol = find_pc_function (funaddr);
+
if (symbol)
return SYMBOL_PRINT_NAME (symbol);
}
{
/* Try the minimal symbols. */
struct minimal_symbol *msymbol = lookup_minimal_symbol_by_pc (funaddr);
+
if (msymbol)
return SYMBOL_PRINT_NAME (msymbol);
}
{
char *tmp = xstrprintf (_(RAW_FUNCTION_ADDRESS_FORMAT),
hex_string (funaddr));
+
gdb_assert (strlen (tmp) + 1 <= buf_size);
strcpy (buf, tmp);
xfree (tmp);
/* Ensure that the initial SP is correctly aligned. */
{
CORE_ADDR old_sp = get_frame_sp (frame);
+
if (gdbarch_frame_align_p (gdbarch))
{
sp = gdbarch_frame_align (gdbarch, old_sp);
{
int i;
+
for (i = nargs - 1; i >= 0; i--)
{
int prototyped;
if (struct_return || lang_struct_return)
{
int len = TYPE_LENGTH (values_type);
+
if (gdbarch_inner_than (gdbarch, 1, 2))
{
/* Stack grows downward. Align STRUCT_ADDR and SP after
{
struct breakpoint *bpt;
struct symtab_and_line sal;
+
init_sal (&sal); /* initialize to zeroes */
sal.pspace = current_program_space;
sal.pc = bp_addr;
/* Note that we ignore the passed-in value in favor of computing it
directly. */
const char *inferior_io_terminal = get_inferior_io_terminal ();
+
if (inferior_io_terminal == NULL)
inferior_io_terminal = "";
fprintf_filtered (gdb_stdout,
if (non_stop && all_threads)
{
/* Don't error out if the current thread is running, because
- there may be other stopped threads. */
+ there may be other stopped threads. */
struct cleanup *old_chain;
/* Backup current thread and selected frame. */
for (; count > 0; count--)
{
struct thread_info *tp;
+
step_once (skip_subroutines, single_inst, count, thread);
if (target_has_execution
INFERIOR_PTID thread instead, which is the same thread when
THREAD is set. */
struct thread_info *tp = inferior_thread ();
+
clear_proceed_status ();
set_step_frame ();
else if (tp->step_range_end == 0)
{
char *name;
+
if (find_pc_partial_function (pc, &name,
&tp->step_range_start,
&tp->step_range_end) == 0)
and not step over the rest of this inlined function call. */
struct thread_info *tp = inferior_thread ();
struct symtab_and_line empty_sal;
+
init_sal (&empty_sal);
set_step_info (frame, empty_sal);
tp->step_range_start = tp->step_range_end = get_frame_pc (frame);
else
{
struct target_waitstatus ws;
+
get_last_target_status (&ptid, &ws);
}
if (var)
{
char *val = get_in_environ (current_inferior ()->environment, var);
+
if (val)
{
puts_filtered (var);
else
{
char **vector = environ_vector (current_inferior ()->environment);
+
while (*vector)
{
puts_filtered (*vector++);
{
char *exec_path;
char *env;
+
dont_repeat ();
env = get_in_environ (current_inferior ()->environment, path_var_name);
/* Can be null if path is not set */
for (j = 0; j < register_size (gdbarch, i); j++)
{
int idx;
+
if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
idx = j;
else
/* A register name? */
{
int regnum = user_reg_map_name_to_regnum (gdbarch, start, end - start);
+
if (regnum >= 0)
{
/* User registers lie completely outside of the range of
/* A register group? */
{
struct reggroup *group;
+
for (group = reggroup_next (gdbarch, NULL);
group != NULL;
group = reggroup_next (gdbarch, group))
if (group != NULL)
{
int regnum;
+
for (regnum = 0;
regnum < gdbarch_num_regs (gdbarch)
+ gdbarch_num_pseudo_regs (gdbarch);
attach_command_continuation (void *args)
{
struct attach_command_continuation_args *a = args;
+
attach_command_post_wait (a->args, a->from_tty, a->async_exec);
}
attach_command_continuation_free_args (void *args)
{
struct attach_command_continuation_args *a = args;
+
xfree (a->args);
xfree (a);
}
interrupt_target_1 (int all_threads)
{
ptid_t ptid;
+
if (all_threads)
ptid = minus_one_ptid;
else
restore_inferior (void *arg)
{
struct inferior *saved_inferior = arg;
+
set_current_inferior (saved_inferior);
}
{
struct cleanup *old_chain = make_cleanup (restore_inferior,
current_inferior_);
+
return old_chain;
}
exit_inferior (int pid)
{
struct inferior *inf = find_inferior_pid (pid);
+
exit_inferior_1 (inf, 0);
if (print_inferior_events)
exit_inferior_silent (int pid)
{
struct inferior *inf = find_inferior_pid (pid);
+
exit_inferior_1 (inf, 1);
}
detach_inferior (int pid)
{
struct inferior *inf = find_inferior_pid (pid);
+
exit_inferior_1 (inf, 1);
if (print_inferior_events)
gdb_getpgrp (void)
{
int process_group = -1;
+
#ifdef HAVE_TERMIOS
process_group = tcgetpgrp (0);
#endif
char *name = alloca (strlen (gdb_sysroot)
+ strlen (execd_pathname)
+ 1);
+
strcpy (name, gdb_sysroot);
strcat (name, execd_pathname);
execd_pathname = name;
write_memory_ptid (ptid_t ptid, CORE_ADDR memaddr, const gdb_byte *myaddr, int len)
{
struct cleanup *ptid_cleanup = save_inferior_ptid ();
+
inferior_ptid = ptid;
write_memory (memaddr, myaddr, len);
do_cleanups (ptid_cleanup);
/* Restore the contents of the copy area. */
{
ULONGEST len = gdbarch_max_insn_length (displaced->step_gdbarch);
+
write_memory_ptid (displaced->step_ptid, displaced->step_copy,
displaced->step_saved_copy, len);
if (debug_displaced)
relocate the PC. */
struct regcache *regcache = get_thread_regcache (event_ptid);
CORE_ADDR pc = regcache_read_pc (regcache);
+
pc = displaced->step_original + (pc - displaced->step_copy);
regcache_write_pc (regcache, pc);
}
}
}
+/* reset_schedlock -- public */
+
+void
+reset_schedlock ()
+{
+ if (scheduler_mode == schedlock_on)
+ {
+ warning ("Resetting scheduler-lock mode to 'off'");
+ scheduler_mode = schedlock_off;
+ }
+}
+
/* True if execution commands resume all threads of all processes by
default; otherwise, resume only threads of the current inferior
process. */
start_remote (int from_tty)
{
struct inferior *inferior;
- init_wait_for_inferior ();
+ init_wait_for_inferior ();
inferior = current_inferior ();
inferior->stop_soon = STOP_QUIETLY_REMOTE;
longjmp-resume breakpoint of the thread that just stopped
stepping. */
struct thread_info *tp = inferior_thread ();
+
delete_step_resume_breakpoint (tp);
}
else
|| (non_stop && moribund_breakpoint_here_p (aspace, breakpoint_pc)))
{
struct cleanup *old_cleanups = NULL;
+
if (RECORD_IS_USED)
old_cleanups = record_gdb_operation_disable_set ();
&& ecs->ws.kind != TARGET_WAITKIND_SIGNALLED)
{
struct inferior *inf = find_inferior_pid (ptid_get_pid (ecs->ptid));
+
gdb_assert (inf);
stop_soon = inf->stop_soon;
}
if (target_stopped_by_watchpoint ())
{
CORE_ADDR addr;
+
fprintf_unfiltered (gdb_stdlog, "infrun: stopped by watchpoint\n");
if (target_stopped_data_address (¤t_target, &addr))
the instruction and once for the delay slot. */
int step_through_delay
= gdbarch_single_step_through_delay (gdbarch, frame);
+
if (debug_infrun && step_through_delay)
fprintf_unfiltered (gdb_stdlog, "infrun: step through delay\n");
if (ecs->event_thread->step_range_end == 0 && step_through_delay)
if (!non_stop)
{
struct thread_info *tp;
+
tp = iterate_over_threads (currently_stepping_or_nexting_callback,
ecs->event_thread);
if (tp)
/* Set up a step-resume breakpoint at the address
indicated by SKIP_SOLIB_RESOLVER. */
struct symtab_and_line sr_sal;
+
init_sal (&sr_sal);
sr_sal.pc = pc_after_resolver;
sr_sal.pspace = get_frame_program_space (frame);
if (real_stop_pc != 0 && in_solib_dynsym_resolve_code (real_stop_pc))
{
struct symtab_and_line sr_sal;
+
init_sal (&sr_sal);
sr_sal.pc = ecs->stop_func_start;
sr_sal.pspace = get_frame_program_space (frame);
/* Set a breakpoint at callee's start address.
From there we can step once and be back in the caller. */
struct symtab_and_line sr_sal;
+
init_sal (&sr_sal);
sr_sal.pc = ecs->stop_func_start;
sr_sal.pspace = get_frame_program_space (frame);
Set a breakpoint at its start and continue, then
one more step will take us out. */
struct symtab_and_line sr_sal;
+
init_sal (&sr_sal);
sr_sal.pc = ecs->stop_func_start;
sr_sal.pspace = get_frame_program_space (frame);
{
/* Determine where this trampoline returns. */
CORE_ADDR real_stop_pc;
+
real_stop_pc = gdbarch_skip_trampoline_code (gdbarch, frame, stop_pc);
if (debug_infrun)
if (ecs->event_thread->stepping_over_breakpoint)
{
struct regcache *thread_regcache = get_thread_regcache (ecs->ptid);
+
if (!use_displaced_stepping (get_regcache_arch (thread_regcache)))
/* Since we can't do a displaced step, we have to remove
the breakpoint while we step it. To keep things
else
{
struct gdb_exception e;
+
/* Stop stepping when inserting breakpoints
has failed. */
TRY_CATCH (e, RETURN_MASK_ERROR)
This also restores inferior state prior to the call
(struct inferior_thread_state). */
struct frame_info *frame = get_current_frame ();
+
gdb_assert (get_frame_type (frame) == DUMMY_FRAME);
frame_pop (frame);
/* frame_pop() calls reinit_frame_cache as the last thing it does
signal_stop_update (int signo, int state)
{
int ret = signal_stop[signo];
+
signal_stop[signo] = state;
return ret;
}
signal_print_update (int signo, int state)
{
int ret = signal_print[signo];
+
signal_print[signo] = state;
return ret;
}
signal_pass_update (int signo, int state)
{
int ret = signal_program[signo];
+
signal_program[signo] = state;
return ret;
}
signals_info (char *signum_exp, int from_tty)
{
enum target_signal oursig;
+
sig_print_header ();
if (signum_exp)
&& gdbarch_get_siginfo_type_p (gdbarch))
{
struct type *type = gdbarch_get_siginfo_type (gdbarch);
+
return allocate_computed_value (type, &siginfo_value_funcs, NULL);
}
restore_inferior_ptid (void *arg)
{
ptid_t *saved_ptid_ptr = arg;
+
inferior_ptid = *saved_ptid_ptr;
xfree (arg);
}
{
struct regcache *regcache = get_thread_regcache (ptid);
CORE_ADDR current_pc = regcache_read_pc (regcache);
+
if (current_pc != state->saved_pc)
{
/* PC has changed - this context is invalid. Use the
{
VEC (inline_state_s) *new_states = NULL;
int pid = ptid_get_pid (ptid);
+
for (ix = 0; VEC_iterate (inline_state_s, inline_states, ix, state); ix++)
if (pid != ptid_get_pid (state->ptid))
VEC_safe_push (inline_state_s, new_states, state);
interp_set_quiet (struct interp *interp, int quiet)
{
int old_val = interp->quiet_p;
+
interp->quiet_p = quiet;
return old_val;
}
for (i = 1; i < nrules; i++)
{
struct gdb_exception e = interp_exec (interp_to_use, prules[i]);
+
if (e.reason < 0)
{
interp_set (old_interp, 0);