| OLD | NEW |
| 1 /* Program and address space management, for GDB, the GNU debugger. | 1 /* Program and address space management, for GDB, the GNU debugger. |
| 2 | 2 |
| 3 Copyright (C) 2009-2012 Free Software Foundation, Inc. | 3 Copyright (C) 2009-2012 Free Software Foundation, Inc. |
| 4 | 4 |
| 5 This file is part of GDB. | 5 This file is part of GDB. |
| 6 | 6 |
| 7 This program is free software; you can redistribute it and/or modify | 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 | 8 it under the terms of the GNU General Public License as published by |
| 9 the Free Software Foundation; either version 3 of the License, or | 9 the Free Software Foundation; either version 3 of the License, or |
| 10 (at your option) any later version. | 10 (at your option) any later version. |
| 11 | 11 |
| 12 This program is distributed in the hope that it will be useful, | 12 This program is distributed in the hope that it will be useful, |
| 13 but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 GNU General Public License for more details. | 15 GNU General Public License for more details. |
| 16 | 16 |
| 17 You should have received a copy of the GNU General Public License | 17 You should have received a copy of the GNU General Public License |
| 18 along with this program. If not, see <http://www.gnu.org/licenses/>. */ | 18 along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
| 19 | 19 |
| 20 | 20 |
| 21 #ifndef PROGSPACE_H | 21 #ifndef PROGSPACE_H |
| 22 #define PROGSPACE_H | 22 #define PROGSPACE_H |
| 23 | 23 |
| 24 #include "target.h" | 24 #include "target.h" |
| 25 #include "vec.h" | 25 #include "vec.h" |
| 26 #include "gdb_vecs.h" |
| 26 | 27 |
| 27 struct target_ops; | 28 struct target_ops; |
| 28 struct bfd; | 29 struct bfd; |
| 29 struct objfile; | 30 struct objfile; |
| 30 struct inferior; | 31 struct inferior; |
| 31 struct exec; | 32 struct exec; |
| 32 struct address_space; | 33 struct address_space; |
| 33 struct program_space_data; | 34 struct program_space_data; |
| 34 | 35 |
| 36 typedef struct so_list *so_list_ptr; |
| 37 DEF_VEC_P (so_list_ptr); |
| 38 |
| 35 /* A program space represents a symbolic view of an address space. | 39 /* A program space represents a symbolic view of an address space. |
| 36 Roughly speaking, it holds all the data associated with a | 40 Roughly speaking, it holds all the data associated with a |
| 37 non-running-yet program (main executable, main symbols), and when | 41 non-running-yet program (main executable, main symbols), and when |
| 38 an inferior is running and is bound to it, includes the list of its | 42 an inferior is running and is bound to it, includes the list of its |
| 39 mapped in shared libraries. | 43 mapped in shared libraries. |
| 40 | 44 |
| 41 In the traditional debugging scenario, there's a 1-1 correspondence | 45 In the traditional debugging scenario, there's a 1-1 correspondence |
| 42 among program spaces, inferiors and address spaces, like so: | 46 among program spaces, inferiors and address spaces, like so: |
| 43 | 47 |
| 44 pspace1 (prog1) <--> inf1(pid1) <--> aspace1 | 48 pspace1 (prog1) <--> inf1(pid1) <--> aspace1 |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 this program space. Managed by both exec_ops and solib.c. */ | 185 this program space. Managed by both exec_ops and solib.c. */ |
| 182 struct target_section_table target_sections; | 186 struct target_section_table target_sections; |
| 183 | 187 |
| 184 /* List of shared objects mapped into this space. Managed by | 188 /* List of shared objects mapped into this space. Managed by |
| 185 solib.c. */ | 189 solib.c. */ |
| 186 struct so_list *so_list; | 190 struct so_list *so_list; |
| 187 | 191 |
| 188 /* Number of calls to solib_add. */ | 192 /* Number of calls to solib_add. */ |
| 189 unsigned solib_add_generation; | 193 unsigned solib_add_generation; |
| 190 | 194 |
| 195 /* When an solib is added, it is also added to this vector. This |
| 196 is so we can properly report solib changes to the user. */ |
| 197 VEC (so_list_ptr) *added_solibs; |
| 198 |
| 199 /* When an solib is removed, its name is added to this vector. |
| 200 This is so we can properly report solib changes to the user. */ |
| 201 VEC (char_ptr) *deleted_solibs; |
| 202 |
| 191 /* Per pspace data-pointers required by other GDB modules. */ | 203 /* Per pspace data-pointers required by other GDB modules. */ |
| 192 void **data; | 204 void **data; |
| 193 unsigned num_data; | 205 unsigned num_data; |
| 194 }; | 206 }; |
| 195 | 207 |
| 196 /* The object file that the main symbol table was loaded from (e.g. the | 208 /* The object file that the main symbol table was loaded from (e.g. the |
| 197 argument to the "symbol-file" or "file" command). */ | 209 argument to the "symbol-file" or "file" command). */ |
| 198 | 210 |
| 199 #define symfile_objfile current_program_space->symfile_object_file | 211 #define symfile_objfile current_program_space->symfile_object_file |
| 200 | 212 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 inferiors will share an address space or not. Call this after | 283 inferiors will share an address space or not. Call this after |
| 272 having connected to the target interface and having fetched the | 284 having connected to the target interface and having fetched the |
| 273 target description, to fixup the program/address spaces | 285 target description, to fixup the program/address spaces |
| 274 mappings. */ | 286 mappings. */ |
| 275 extern void update_address_spaces (void); | 287 extern void update_address_spaces (void); |
| 276 | 288 |
| 277 /* Prune away automatically added program spaces that aren't required | 289 /* Prune away automatically added program spaces that aren't required |
| 278 anymore. */ | 290 anymore. */ |
| 279 extern void prune_program_spaces (void); | 291 extern void prune_program_spaces (void); |
| 280 | 292 |
| 293 /* Reset saved solib data at the start of an solib event. This lets |
| 294 us properly collect the data when calling solib_add, so it can then |
| 295 later be printed. */ |
| 296 extern void clear_program_space_solib_cache (struct program_space *); |
| 297 |
| 281 /* Keep a registry of per-pspace data-pointers required by other GDB | 298 /* Keep a registry of per-pspace data-pointers required by other GDB |
| 282 modules. */ | 299 modules. */ |
| 283 | 300 |
| 284 extern const struct program_space_data *register_program_space_data (void); | 301 extern const struct program_space_data *register_program_space_data (void); |
| 285 extern const struct program_space_data *register_program_space_data_with_cleanup | 302 extern const struct program_space_data *register_program_space_data_with_cleanup |
| 286 (void (*cleanup) (struct program_space *, void *)); | 303 (void (*cleanup) (struct program_space *, void *)); |
| 287 extern void clear_program_space_data (struct program_space *pspace); | 304 extern void clear_program_space_data (struct program_space *pspace); |
| 288 extern void set_program_space_data (struct program_space *pspace, | 305 extern void set_program_space_data (struct program_space *pspace, |
| 289 const struct program_space_data *data, | 306 const struct program_space_data *data, |
| 290 void *value); | 307 void *value); |
| 291 extern void *program_space_data (struct program_space *pspace, | 308 extern void *program_space_data (struct program_space *pspace, |
| 292 const struct program_space_data *data); | 309 const struct program_space_data *data); |
| 293 | 310 |
| 294 #endif | 311 #endif |
| OLD | NEW |