xref: /dflybsd-src/contrib/gdb-7/gdb/solib-svr4.h (revision de8e141f24382815c10a4012d209bbbf7abf1112)
15796c8dcSSimon Schubert /* Handle shared libraries for GDB, the GNU Debugger.
25796c8dcSSimon Schubert 
3*ef5ccd6cSJohn Marino    Copyright (C) 2000-2013 Free Software Foundation, Inc.
45796c8dcSSimon Schubert 
55796c8dcSSimon Schubert    This file is part of GDB.
65796c8dcSSimon Schubert 
75796c8dcSSimon Schubert    This program is free software; you can redistribute it and/or modify
85796c8dcSSimon Schubert    it under the terms of the GNU General Public License as published by
95796c8dcSSimon Schubert    the Free Software Foundation; either version 3 of the License, or
105796c8dcSSimon Schubert    (at your option) any later version.
115796c8dcSSimon Schubert 
125796c8dcSSimon Schubert    This program is distributed in the hope that it will be useful,
135796c8dcSSimon Schubert    but WITHOUT ANY WARRANTY; without even the implied warranty of
145796c8dcSSimon Schubert    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
155796c8dcSSimon Schubert    GNU General Public License for more details.
165796c8dcSSimon Schubert 
175796c8dcSSimon Schubert    You should have received a copy of the GNU General Public License
185796c8dcSSimon Schubert    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
195796c8dcSSimon Schubert 
205796c8dcSSimon Schubert #ifndef SOLIB_SVR4_H
215796c8dcSSimon Schubert #define SOLIB_SVR4_H
225796c8dcSSimon Schubert 
235796c8dcSSimon Schubert struct objfile;
245796c8dcSSimon Schubert struct target_so_ops;
255796c8dcSSimon Schubert 
265796c8dcSSimon Schubert extern struct target_so_ops svr4_so_ops;
275796c8dcSSimon Schubert 
285796c8dcSSimon Schubert /* Critical offsets and sizes which describe struct r_debug and
295796c8dcSSimon Schubert    struct link_map on SVR4-like targets.  All offsets and sizes are
305796c8dcSSimon Schubert    in bytes unless otherwise specified.  */
315796c8dcSSimon Schubert 
325796c8dcSSimon Schubert struct link_map_offsets
335796c8dcSSimon Schubert   {
345796c8dcSSimon Schubert     /* Offset and size of r_debug.r_version.  */
355796c8dcSSimon Schubert     int r_version_offset, r_version_size;
365796c8dcSSimon Schubert 
375796c8dcSSimon Schubert     /* Offset of r_debug.r_map.  */
385796c8dcSSimon Schubert     int r_map_offset;
395796c8dcSSimon Schubert 
405796c8dcSSimon Schubert     /* Offset of r_debug.r_brk.  */
415796c8dcSSimon Schubert     int r_brk_offset;
425796c8dcSSimon Schubert 
435796c8dcSSimon Schubert     /* Offset of r_debug.r_ldsomap.  */
445796c8dcSSimon Schubert     int r_ldsomap_offset;
455796c8dcSSimon Schubert 
465796c8dcSSimon Schubert     /* Size of struct link_map (or equivalent), or at least enough of it
475796c8dcSSimon Schubert        to be able to obtain the fields below.  */
485796c8dcSSimon Schubert     int link_map_size;
495796c8dcSSimon Schubert 
505796c8dcSSimon Schubert     /* Offset to l_addr field in struct link_map.  */
515796c8dcSSimon Schubert     int l_addr_offset;
525796c8dcSSimon Schubert 
535796c8dcSSimon Schubert     /* Offset to l_ld field in struct link_map.  */
545796c8dcSSimon Schubert     int l_ld_offset;
555796c8dcSSimon Schubert 
565796c8dcSSimon Schubert     /* Offset to l_next field in struct link_map.  */
575796c8dcSSimon Schubert     int l_next_offset;
585796c8dcSSimon Schubert 
595796c8dcSSimon Schubert     /* Offset to l_prev field in struct link_map.  */
605796c8dcSSimon Schubert     int l_prev_offset;
615796c8dcSSimon Schubert 
625796c8dcSSimon Schubert     /* Offset to l_name field in struct link_map.  */
635796c8dcSSimon Schubert     int l_name_offset;
645796c8dcSSimon Schubert   };
655796c8dcSSimon Schubert 
665796c8dcSSimon Schubert /* set_solib_svr4_fetch_link_map_offsets() is intended to be called by
675796c8dcSSimon Schubert    a <arch>_gdbarch_init() function.  It is used to establish an
685796c8dcSSimon Schubert    architecture specific link_map_offsets fetcher for the architecture
695796c8dcSSimon Schubert    being defined.  */
705796c8dcSSimon Schubert 
715796c8dcSSimon Schubert extern void set_solib_svr4_fetch_link_map_offsets
725796c8dcSSimon Schubert   (struct gdbarch *gdbarch, struct link_map_offsets *(*func) (void));
735796c8dcSSimon Schubert 
745796c8dcSSimon Schubert /* This function is called by thread_db.c.  Return the address of the
755796c8dcSSimon Schubert    link map for the given objfile.  */
765796c8dcSSimon Schubert extern CORE_ADDR svr4_fetch_objfile_link_map (struct objfile *objfile);
775796c8dcSSimon Schubert 
785796c8dcSSimon Schubert /* Fetch (and possibly build) an appropriate `struct link_map_offsets'
795796c8dcSSimon Schubert    for ILP32 and LP64 SVR4 systems.  */
805796c8dcSSimon Schubert extern struct link_map_offsets *svr4_ilp32_fetch_link_map_offsets (void);
815796c8dcSSimon Schubert extern struct link_map_offsets *svr4_lp64_fetch_link_map_offsets (void);
825796c8dcSSimon Schubert 
835796c8dcSSimon Schubert /* Return 1 if PC lies in the dynamic symbol resolution code of the
845796c8dcSSimon Schubert    SVR4 run time loader.  */
855796c8dcSSimon Schubert int svr4_in_dynsym_resolve_code (CORE_ADDR pc);
865796c8dcSSimon Schubert 
875796c8dcSSimon Schubert #endif /* solib-svr4.h */
88