GDB (API)
|
00001 /* Handle shared libraries for GDB, the GNU Debugger. 00002 00003 Copyright (C) 2000-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 #ifndef SOLIB_SVR4_H 00021 #define SOLIB_SVR4_H 00022 00023 struct objfile; 00024 struct target_so_ops; 00025 00026 extern struct target_so_ops svr4_so_ops; 00027 00028 /* Critical offsets and sizes which describe struct r_debug and 00029 struct link_map on SVR4-like targets. All offsets and sizes are 00030 in bytes unless otherwise specified. */ 00031 00032 struct link_map_offsets 00033 { 00034 /* Offset and size of r_debug.r_version. */ 00035 int r_version_offset, r_version_size; 00036 00037 /* Offset of r_debug.r_map. */ 00038 int r_map_offset; 00039 00040 /* Offset of r_debug.r_brk. */ 00041 int r_brk_offset; 00042 00043 /* Offset of r_debug.r_ldsomap. */ 00044 int r_ldsomap_offset; 00045 00046 /* Size of struct link_map (or equivalent), or at least enough of it 00047 to be able to obtain the fields below. */ 00048 int link_map_size; 00049 00050 /* Offset to l_addr field in struct link_map. */ 00051 int l_addr_offset; 00052 00053 /* Offset to l_ld field in struct link_map. */ 00054 int l_ld_offset; 00055 00056 /* Offset to l_next field in struct link_map. */ 00057 int l_next_offset; 00058 00059 /* Offset to l_prev field in struct link_map. */ 00060 int l_prev_offset; 00061 00062 /* Offset to l_name field in struct link_map. */ 00063 int l_name_offset; 00064 }; 00065 00066 /* set_solib_svr4_fetch_link_map_offsets() is intended to be called by 00067 a <arch>_gdbarch_init() function. It is used to establish an 00068 architecture specific link_map_offsets fetcher for the architecture 00069 being defined. */ 00070 00071 extern void set_solib_svr4_fetch_link_map_offsets 00072 (struct gdbarch *gdbarch, struct link_map_offsets *(*func) (void)); 00073 00074 /* This function is called by thread_db.c. Return the address of the 00075 link map for the given objfile. */ 00076 extern CORE_ADDR svr4_fetch_objfile_link_map (struct objfile *objfile); 00077 00078 /* Fetch (and possibly build) an appropriate `struct link_map_offsets' 00079 for ILP32 and LP64 SVR4 systems. */ 00080 extern struct link_map_offsets *svr4_ilp32_fetch_link_map_offsets (void); 00081 extern struct link_map_offsets *svr4_lp64_fetch_link_map_offsets (void); 00082 00083 /* Return 1 if PC lies in the dynamic symbol resolution code of the 00084 SVR4 run time loader. */ 00085 int svr4_in_dynsym_resolve_code (CORE_ADDR pc); 00086 00087 #endif /* solib-svr4.h */