Revert the last change.
[deliverable/binutils-gdb.git] / gdb / stack.c
index 757e1097326d2277c8abf4356e16b495650e3625..1c37801f2ea44b1014c8f8b36154f18bc3771f57 100644 (file)
@@ -164,6 +164,8 @@ static void
 print_frame_nameless_args (struct frame_info *frame, long start, int num,
                           int first, struct ui_file *stream)
 {
+  struct gdbarch *gdbarch = get_frame_arch (frame);
+  enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   int i;
   CORE_ADDR argsaddr;
   long arg_value;
@@ -174,7 +176,8 @@ print_frame_nameless_args (struct frame_info *frame, long start, int num,
       argsaddr = get_frame_args_address (frame);
       if (!argsaddr)
        return;
-      arg_value = read_memory_integer (argsaddr + start, sizeof (int));
+      arg_value = read_memory_integer (argsaddr + start,
+                                      sizeof (int), byte_order);
       if (!first)
        fprintf_filtered (stream, ", ");
       fprintf_filtered (stream, "%ld", arg_value);
@@ -478,7 +481,9 @@ static void
 gdb_disassembly_stub (void *args)
 {
   struct gdb_disassembly_stub_args *p = args;
-  gdb_disassembly (p->gdbarch, uiout, 0, 0, p->how_many, p->low, p->high);
+  gdb_disassembly (p->gdbarch, uiout, 0,
+                   DISASSEMBLY_RAW_INSN, p->how_many,
+                   p->low, p->high);
 }
 
 /* Use TRY_CATCH to catch the exception from the gdb_disassembly
@@ -1184,6 +1189,8 @@ frame_info (char *addr_exp, int from_tty)
                               &realnum, NULL);
        if (!optimized && lval == not_lval)
          {
+           enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+           int sp_size = register_size (gdbarch, gdbarch_sp_regnum (gdbarch));
            gdb_byte value[MAX_REGISTER_SIZE];
            CORE_ADDR sp;
            frame_register_unwind (fi, gdbarch_sp_regnum (gdbarch),
@@ -1192,9 +1199,7 @@ frame_info (char *addr_exp, int from_tty)
            /* NOTE: cagney/2003-05-22: This is assuming that the
                stack pointer was packed as an unsigned integer.  That
                may or may not be valid.  */
-           sp = extract_unsigned_integer (value,
-                                          register_size (gdbarch,
-                                          gdbarch_sp_regnum (gdbarch)));
+           sp = extract_unsigned_integer (value, sp_size, byte_order);
            printf_filtered (" Previous frame's sp is ");
            fputs_filtered (paddress (gdbarch, sp), gdb_stdout);
            printf_filtered ("\n");
@@ -1270,11 +1275,6 @@ backtrace_command_1 (char *count_exp, int show_locals, int from_tty)
      of frames which we should print, or -1 if all of them.  */
   trailing = get_current_frame ();
 
-  /* The target can be in a state where there is no valid frames
-     (e.g., just connected). */
-  if (trailing == NULL)
-    error (_("No stack."));
-
   trailing_level = 0;
   if (count_exp)
     {
This page took 0.040689 seconds and 4 git commands to generate.