PR gdb/8704
[deliverable/binutils-gdb.git] / gdb / stack.c
index 757e1097326d2277c8abf4356e16b495650e3625..4aad34c9d6cd9c4b80e02b189855da9affe5f7e5 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
@@ -638,12 +643,12 @@ print_frame_info (struct frame_info *frame, int print_level,
       /* If disassemble-next-line is set to on and there is line debug
          messages, output assembly codes for next line.  */
       if (disassemble_next_line == AUTO_BOOLEAN_TRUE)
-       do_gdb_disassembly (get_frame_arch (frame), -1,
-                           get_frame_pc (frame), sal.end);
+       do_gdb_disassembly (get_frame_arch (frame), -1, sal.pc, sal.end);
     }
 
   if (print_what != LOCATION)
-    set_default_breakpoint (1, get_frame_pc (frame), sal.symtab, sal.line);
+    set_default_breakpoint (1, sal.pspace,
+                           get_frame_pc (frame), sal.symtab, sal.line);
 
   annotate_frame_end ();
 
@@ -820,7 +825,8 @@ print_frame (struct frame_info *frame, int print_level,
 #ifdef PC_SOLIB
       char *lib = PC_SOLIB (get_frame_pc (frame));
 #else
-      char *lib = solib_name_from_address (get_frame_pc (frame));
+      char *lib = solib_name_from_address (get_frame_program_space (frame),
+                                          get_frame_pc (frame));
 #endif
       if (lib)
        {
@@ -1184,6 +1190,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 +1200,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 +1276,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.025003 seconds and 4 git commands to generate.