* symtab.c (iterate_over_some_symtabs): Fix indentation.
[deliverable/binutils-gdb.git] / gdb / i386-sol2-tdep.c
index 586ca963dd714f04d029b29808da1941c44f4ac9..37721384f449e0bb35619b18222bd15a9ef5cc50 100644 (file)
@@ -1,6 +1,6 @@
 /* Target-dependent code for Solaris x86.
 
-   Copyright (C) 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2002-2013 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -48,14 +48,14 @@ static int i386_sol2_gregset_reg_offset[] =
   0 * 4                                /* %gs */
 };
 
-/* Return whether the frame preceding NEXT_FRAME corresponds to a
-   Solaris sigtramp routine.  */
+/* Return whether THIS_FRAME corresponds to a Solaris sigtramp
+   routine.  */
 
 static int
-i386_sol2_sigtramp_p (struct frame_info *next_frame)
+i386_sol2_sigtramp_p (struct frame_info *this_frame)
 {
-  CORE_ADDR pc = frame_pc_unwind (next_frame);
-  char *name;
+  CORE_ADDR pc = get_frame_pc (this_frame);
+  const char *name;
 
   find_pc_partial_function (pc, &name, NULL, NULL);
   return (name && (strcmp ("sigacthandler", name) == 0
@@ -66,12 +66,12 @@ i386_sol2_sigtramp_p (struct frame_info *next_frame)
    `mcontext_t' that contains the saved set of machine registers.  */
 
 static CORE_ADDR
-i386_sol2_mcontext_addr (struct frame_info *next_frame)
+i386_sol2_mcontext_addr (struct frame_info *this_frame)
 {
   CORE_ADDR sp, ucontext_addr;
 
-  sp = frame_unwind_register_unsigned (next_frame, I386_ESP_REGNUM);
-  ucontext_addr = get_frame_memory_unsigned (next_frame, sp + 8, 4);
+  sp = get_frame_register_unsigned (this_frame, I386_ESP_REGNUM);
+  ucontext_addr = get_frame_memory_unsigned (this_frame, sp + 8, 4);
 
   return ucontext_addr + 36;
 }
@@ -79,8 +79,8 @@ i386_sol2_mcontext_addr (struct frame_info *next_frame)
 /* SunPRO encodes the static variables.  This is not related to C++
    mangling, it is done for C too.  */
 
-static char *
-i386_sol2_static_transform_name (char *name)
+static const char *
+i386_sol2_static_transform_name (const char *name)
 {
   char *p;
   if (name[0] == '.')
@@ -109,6 +109,10 @@ i386_sol2_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
   /* Solaris is SVR4-based.  */
   i386_svr4_init_abi (info, gdbarch);
 
+  /* The SunPRO compiler puts out 0 instead of the address in N_SO symbols,
+     and for SunPRO 3.0, N_FUN symbols too.  */
+  set_gdbarch_sofun_address_maybe_missing (gdbarch, 1);
+
   /* Handle SunPRO encoding of static symbols.  */
   set_gdbarch_static_transform_name (gdbarch, i386_sol2_static_transform_name);
 
@@ -130,6 +134,9 @@ i386_sol2_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
   set_gdbarch_skip_solib_resolver (gdbarch, sol2_skip_solib_resolver);
   set_solib_svr4_fetch_link_map_offsets
     (gdbarch, svr4_ilp32_fetch_link_map_offsets);
+
+  /* How to print LWP PTIDs from core files.  */
+  set_gdbarch_core_pid_to_str (gdbarch, sol2_core_pid_to_str);
 }
 \f
 
This page took 0.031822 seconds and 4 git commands to generate.