Reorganize solib.c.
[deliverable/binutils-gdb.git] / gdb / solist.h
1 /* Shared library declarations for GDB, the GNU Debugger.
2 Copyright 1990, 91, 92, 93, 94, 95, 96, 98, 1999, 2000
3 Free Software Foundation, Inc.
4
5 This file is part of GDB.
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */
21
22 #define SO_NAME_MAX_PATH_SIZE 512 /* FIXME: Should be dynamic */
23
24 /* Forward declaration for target specific link map information. This
25 struct is opaque to all but the target specific file. */
26 struct lm_info;
27
28 struct so_list
29 {
30 /* The following fields of the structure come directly from the
31 dynamic linker's tables in the inferior, and are initialized by
32 current_sos. */
33
34 struct so_list *next; /* next structure in linked list */
35
36 /* A pointer to target specific link map information. Often this
37 will be a copy of struct link_map from the user process, but
38 it need not be; it can be any collection of data needed to
39 traverse the dynamic linker's data structures. */
40 struct lm_info *lm_info;
41
42 /* Shared object file name, exactly as it appears in the
43 inferior's link map. This may be a relative path, or something
44 which needs to be looked up in LD_LIBRARY_PATH, etc. We use it
45 to tell which entries in the inferior's dynamic linker's link
46 map we've already loaded. */
47 char so_original_name[SO_NAME_MAX_PATH_SIZE];
48
49 /* shared object file name, expanded to something GDB can open */
50 char so_name[SO_NAME_MAX_PATH_SIZE];
51
52 /* The following fields of the structure are built from
53 information gathered from the shared object file itself, and
54 are initialized when we actually add it to our symbol tables. */
55
56 bfd *abfd;
57 CORE_ADDR lmend; /* upper addr bound of mapped object */
58 char symbols_loaded; /* flag: symbols read in yet? */
59 char from_tty; /* flag: print msgs? */
60 struct objfile *objfile; /* objfile for loaded lib */
61 struct section_table *sections;
62 struct section_table *sections_end;
63 struct section_table *textsection;
64 };
65
66 struct target_so_ops
67 {
68 CORE_ADDR (*lm_addr) (struct so_list *so);
69 void (*free_so) (struct so_list *so);
70 void (*clear_solib) (void);
71 void (*solib_create_inferior_hook) (void);
72 void (*special_symbol_handling) (void);
73 struct so_list *(*current_sos) (void);
74 int (*open_symbol_file_object) (void *from_ttyp);
75 };
76
77 void free_so (struct so_list *so);
78
79 /* FIXME: gdbarch needs to control this variable */
80 extern struct target_so_ops *current_target_so_ops;
81
82 #define TARGET_SO_LM_ADDR (current_target_so_ops->lm_addr)
83 #define TARGET_SO_FREE_SO (current_target_so_ops->free_so)
84 #define TARGET_SO_CLEAR_SOLIB (current_target_so_ops->clear_solib)
85 #define TARGET_SO_SOLIB_CREATE_INFERIOR_HOOK \
86 (current_target_so_ops->solib_create_inferior_hook)
87 #define TARGET_SO_SPECIAL_SYMBOL_HANDLING \
88 (current_target_so_ops->special_symbol_handling)
89 #define TARGET_SO_CURRENT_SOS (current_target_so_ops->current_sos)
90 #define TARGET_SO_OPEN_SYMBOL_FILE_OBJECT \
91 (current_target_so_ops->open_symbol_file_object)
This page took 0.061439 seconds and 5 git commands to generate.