gdb/solib-svr4.h - gdb

Data types defined

Macros defined

Source code

  1. /* Handle shared libraries for GDB, the GNU Debugger.

  2.    Copyright (C) 2000-2015 Free Software Foundation, Inc.

  3.    This file is part of GDB.

  4.    This program is free software; you can redistribute it and/or modify
  5.    it under the terms of the GNU General Public License as published by
  6.    the Free Software Foundation; either version 3 of the License, or
  7.    (at your option) any later version.

  8.    This program is distributed in the hope that it will be useful,
  9.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  10.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  11.    GNU General Public License for more details.

  12.    You should have received a copy of the GNU General Public License
  13.    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */

  14. #ifndef SOLIB_SVR4_H
  15. #define SOLIB_SVR4_H

  16. struct objfile;
  17. struct target_so_ops;

  18. extern struct target_so_ops svr4_so_ops;

  19. /* Critical offsets and sizes which describe struct r_debug and
  20.    struct link_map on SVR4-like targets.  All offsets and sizes are
  21.    in bytes unless otherwise specified.  */

  22. struct link_map_offsets
  23.   {
  24.     /* Offset and size of r_debug.r_version.  */
  25.     int r_version_offset, r_version_size;

  26.     /* Offset of r_debug.r_map.  */
  27.     int r_map_offset;

  28.     /* Offset of r_debug.r_brk.  */
  29.     int r_brk_offset;

  30.     /* Offset of r_debug.r_ldsomap.  */
  31.     int r_ldsomap_offset;

  32.     /* Size of struct link_map (or equivalent), or at least enough of it
  33.        to be able to obtain the fields below.  */
  34.     int link_map_size;

  35.     /* Offset to l_addr field in struct link_map.  */
  36.     int l_addr_offset;

  37.     /* Offset to l_ld field in struct link_map.  */
  38.     int l_ld_offset;

  39.     /* Offset to l_next field in struct link_map.  */
  40.     int l_next_offset;

  41.     /* Offset to l_prev field in struct link_map.  */
  42.     int l_prev_offset;

  43.     /* Offset to l_name field in struct link_map.  */
  44.     int l_name_offset;
  45.   };

  46. /* set_solib_svr4_fetch_link_map_offsets() is intended to be called by
  47.    a <arch>_gdbarch_init() function.  It is used to establish an
  48.    architecture specific link_map_offsets fetcher for the architecture
  49.    being defined.  */

  50. extern void set_solib_svr4_fetch_link_map_offsets
  51.   (struct gdbarch *gdbarch, struct link_map_offsets *(*func) (void));

  52. /* This function is called by thread_db.c.  Return the address of the
  53.    link map for the given objfile.  */
  54. extern CORE_ADDR svr4_fetch_objfile_link_map (struct objfile *objfile);

  55. /* Fetch (and possibly build) an appropriate `struct link_map_offsets'
  56.    for ILP32 and LP64 SVR4 systems.  */
  57. extern struct link_map_offsets *svr4_ilp32_fetch_link_map_offsets (void);
  58. extern struct link_map_offsets *svr4_lp64_fetch_link_map_offsets (void);

  59. /* Return 1 if PC lies in the dynamic symbol resolution code of the
  60.    SVR4 run time loader.  */
  61. int svr4_in_dynsym_resolve_code (CORE_ADDR pc);

  62. #endif /* solib-svr4.h */