GDB (API)
/home/stan/gdb/src/gdb/sol2-tdep.c
Go to the documentation of this file.
00001 /* Target-dependent code for Solaris.
00002 
00003    Copyright (C) 2006-2013 Free Software Foundation, Inc.
00004 
00005    This file is part of GDB.
00006 
00007    This program is free software; you can redistribute it and/or modify
00008    it under the terms of the GNU General Public License as published by
00009    the Free Software Foundation; either version 3 of the License, or
00010    (at your option) any later version.
00011 
00012    This program is distributed in the hope that it will be useful,
00013    but WITHOUT ANY WARRANTY; without even the implied warranty of
00014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015    GNU General Public License for more details.
00016 
00017    You should have received a copy of the GNU General Public License
00018    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
00019 
00020 #include "defs.h"
00021 #include "frame.h"
00022 #include "symtab.h"
00023 #include "inferior.h"
00024 
00025 #include "sol2-tdep.h"
00026 
00027 CORE_ADDR
00028 sol2_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
00029 {
00030   struct minimal_symbol *msym;
00031 
00032   msym = lookup_minimal_symbol("elf_bndr", NULL, NULL);
00033   if (msym && SYMBOL_VALUE_ADDRESS (msym) == pc)
00034     return frame_unwind_caller_pc (get_current_frame ());
00035 
00036   return 0;
00037 }
00038 
00039 /* This is how we want PTIDs from Solaris core files to be
00040    printed.  */
00041 
00042 char *
00043 sol2_core_pid_to_str (struct gdbarch *gdbarch, ptid_t ptid)
00044 {
00045   static char buf[80];
00046   struct inferior *inf;
00047   int pid;
00048 
00049   /* Check whether we're printing an LWP (gdb thread) or a
00050      process.  */
00051   pid = ptid_get_lwp (ptid);
00052   if (pid != 0)
00053     {
00054       /* A thread.  */
00055       xsnprintf (buf, sizeof buf, "LWP %ld", ptid_get_lwp (ptid));
00056       return buf;
00057     }
00058 
00059   /* GDB didn't use to put a NT_PSTATUS note in Solaris cores.  If
00060      that's missing, then we're dealing with a fake PID corelow.c made
00061      up.  */
00062   inf = find_inferior_pid (ptid_get_pid (ptid));
00063   if (inf == NULL || inf->fake_pid_p)
00064     {
00065       xsnprintf (buf, sizeof buf, "<core>");
00066       return buf;
00067     }
00068 
00069   /* Not fake; print as usual.  */
00070   return normal_pid_to_str (ptid);
00071 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines