/* Memory-access and commands for "inferior" process, for GDB.
- Copyright (C) 1986-2013 Free Software Foundation, Inc.
+ Copyright (C) 1986-2014 Free Software Foundation, Inc.
This file is part of GDB.
#include "defs.h"
#include "arch-utils.h"
#include <signal.h>
-#include "gdb_string.h"
+#include <string.h>
#include "symtab.h"
#include "gdbtypes.h"
#include "frame.h"
#include "gdbcore.h"
#include "target.h"
#include "language.h"
-#include "symfile.h"
#include "objfiles.h"
#include "completer.h"
#include "ui-out.h"
int stopped_by_random_signal;
+/* See inferior.h. */
+
+int startup_with_shell = 1;
+
\f
/* Accessor routines. */
{
char *result;
- if (STARTUP_WITH_SHELL)
+ if (startup_with_shell)
{
#ifdef __MINGW32__
/* This holds all the characters considered special to the
if (from_tty)
{
printf_filtered (_("Run till exit from "));
- print_stack_frame (get_selected_frame (NULL), 1, LOCATION);
+ print_stack_frame (get_selected_frame (NULL), 1, LOCATION, 0);
}
proceed ((CORE_ADDR) -1, GDB_SIGNAL_DEFAULT, 1);
else
printf_filtered (_("Run till exit from "));
- print_stack_frame (get_selected_frame (NULL), 1, LOCATION);
+ print_stack_frame (get_selected_frame (NULL), 1, LOCATION, 0);
}
if (execution_direction == EXEC_REVERSE)
struct value *val)
{
struct type *regtype = value_type (val);
+ int print_raw_format;
fputs_filtered (name, file);
print_spaces_filtered (15 - strlen (name), file);
- if (!value_entirely_available (val))
- {
- fprintf_filtered (file, "*value not available*\n");
- return;
- }
+ print_raw_format = (value_entirely_available (val)
+ && !value_optimized_out (val));
/* If virtual format is floating, print it that way, and in raw
hex. */
value_embedded_offset (val), 0,
file, 0, val, &opts, current_language);
- fprintf_filtered (file, "\t(raw 0x");
- for (j = 0; j < TYPE_LENGTH (regtype); j++)
+ if (print_raw_format)
{
- int idx;
-
- if (byte_order == BFD_ENDIAN_BIG)
- idx = j;
- else
- idx = TYPE_LENGTH (regtype) - 1 - j;
- fprintf_filtered (file, "%02x", (unsigned char) valaddr[idx]);
+ fprintf_filtered (file, "\t(raw ");
+ print_hex_chars (file, valaddr, TYPE_LENGTH (regtype), byte_order);
+ fprintf_filtered (file, ")");
}
- fprintf_filtered (file, ")");
}
else
{
file, 0, val, &opts, current_language);
/* If not a vector register, print it also according to its
natural format. */
- if (TYPE_VECTOR (regtype) == 0)
+ if (print_raw_format && TYPE_VECTOR (regtype) == 0)
{
get_user_print_options (&opts);
opts.deref_ref = 1;
for (i = 0; i < numregs; i++)
{
- struct type *regtype;
- struct value *val;
-
/* Decide between printing all regs, non-float / vector regs, or
specific reg. */
if (regnum == -1)
|| *(gdbarch_register_name (gdbarch, i)) == '\0')
continue;
- regtype = register_type (gdbarch, i);
- val = allocate_value (regtype);
-
- /* Get the data in raw format. */
- if (! deprecated_frame_register_read (frame, i, value_contents_raw (val)))
- mark_value_bytes_unavailable (val, 0, TYPE_LENGTH (value_type (val)));
-
default_print_one_register_info (file,
gdbarch_register_name (gdbarch, i),
- val);
+ value_of_register (i, frame));
}
}
if (target_has_stack)
{
printf_filtered (_("In %s,\n"), target_longname);
- print_stack_frame (get_selected_frame (NULL), 1, SRC_AND_LOC);
+ print_stack_frame (get_selected_frame (NULL), 1, SRC_AND_LOC, 1);
}
}
bfd_cache_close_all ();
exec_file = (char *) get_exec_file (0);
if (!exec_file)
{
- exec_file = target_pid_to_exec_file (PIDGET (inferior_ptid));
+ exec_file = target_pid_to_exec_file (ptid_get_pid (inferior_ptid));
if (exec_file)
{
/* It's possible we don't have a full path, but rather just a
}
/* Take any necessary post-attaching actions for this platform. */
- target_post_attach (PIDGET (inferior_ptid));
+ target_post_attach (ptid_get_pid (inferior_ptid));
post_create_inferior (¤t_target, from_tty);