GDB (xrefs)

/tmp/gdb-8.1/gdb/solib-spu.c
Go to the documentation of this file.
1 /* Cell SPU GNU/Linux support -- shared library handling.
2 Copyright (C) 2009-2018 Free Software Foundation, Inc.
3
4 Contributed by Ulrich Weigand <uweigand@de.ibm.com>.
5
6 This file is part of GDB.
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>. */
20
21 #include "defs.h"
22 #include "solib-spu.h"
23 #include "gdbcore.h"
24 #include <sys/stat.h>
25 #include "arch-utils.h"
26 #include "bfd.h"
27 #include "symtab.h"
28 #include "solib.h"
29 #include "solib-svr4.h"
30 #include "solist.h"
31 #include "inferior.h"
32 #include "objfiles.h"
33 #include "observer.h"
34 #include "breakpoint.h"
35 #include "gdbthread.h"
36 #include "gdb_bfd.h"
37
38 #include "spu-tdep.h"
39
40 /* Highest SPE id (file handle) the inferior may have. */
41 #define MAX_SPE_FD 1024
42
43 /* Stand-alone SPE executable? */
44 #define spu_standalone_p() \
45 (symfile_objfile && symfile_objfile->obfd \
46 && bfd_get_arch (symfile_objfile->obfd) == bfd_arch_spu)
47
48
49 /* Relocate main SPE executable. */
50 static void
51 spu_relocate_main_executable (int spufs_fd)
52 {
53 struct section_offsets *new_offsets;
54 int i;
55
56 if (symfile_objfile == NULL)
57 return;
58
59 new_offsets = XALLOCAVEC (struct section_offsets,
60 symfile_objfile->num_sections);
61
62 for (i = 0; i < symfile_objfile->num_sections; i++)
63 new_offsets->offsets[i] = SPUADDR (spufs_fd, 0);
64
65 objfile_relocate (symfile_objfile, new_offsets);
66 }
67
68 /* When running a stand-alone SPE executable, we may need to skip one more
69 exec event on startup, to get past the binfmt_misc loader. */
70 static void
71 spu_skip_standalone_loader (void)
72 {
73 if (target_has_execution && !current_inferior ()->attach_flag)
74 {
75 struct target_waitstatus ws;
76
77 /* Only some kernels report an extra SIGTRAP with the binfmt_misc
78 loader; others do not. In addition, if we have attached to an
79 already running inferior instead of starting a new one, we will
80 not see the extra SIGTRAP -- and we cannot readily distinguish
81 the two cases, in particular with the extended-remote target.
82
83 Thus we issue a single-step here. If no extra SIGTRAP was pending,
84 this will step past the first instruction of the stand-alone SPE
85 executable loader, but we don't care about that. */
86
87 inferior_thread ()->control.in_infcall = 1; /* Suppress MI messages. */
88
89 target_resume (inferior_ptid, 1, GDB_SIGNAL_0);
90 target_wait (minus_one_ptid, &ws, 0);
91 set_executing (minus_one_ptid, 0);
92
93 inferior_thread ()->control.in_infcall = 0;
94 }
95 }
96
97 static const struct objfile_data *ocl_program_data_key;
98
99 /* Appends OpenCL programs to the list of `struct so_list' objects. */
100 static void
101 append_ocl_sos (struct so_list **link_ptr)
102 {
103 CORE_ADDR *ocl_program_addr_base;
104 struct objfile *objfile;
105
106 ALL_OBJFILES (objfile)
107 {
108 ocl_program_addr_base
109 = (CORE_ADDR *) objfile_data (objfile, ocl_program_data_key);
110 if (ocl_program_addr_base != NULL)
111 {
112 enum bfd_endian byte_order = bfd_big_endian (objfile->obfd)?
113 BFD_ENDIAN_BIG : BFD_ENDIAN_LITTLE;
114 TRY
115 {
116 CORE_ADDR data =
117 read_memory_unsigned_integer (*ocl_program_addr_base,
118 sizeof (CORE_ADDR),
119 byte_order);
120 if (data != 0x0)
121 {
122 struct so_list *newobj;
123
124 /* Allocate so_list structure. */
125 newobj = XCNEW (struct so_list);
126
127 /* Encode FD and object ID in path name. */
128 xsnprintf (newobj->so_name, sizeof newobj->so_name, "@%s <%d>",
129 hex_string (data),
130 SPUADDR_SPU (*ocl_program_addr_base));
131 strcpy (newobj->so_original_name, newobj->so_name);
132
133 *link_ptr = newobj;
134 link_ptr = &newobj->next;
135 }
136 }
137 CATCH (ex, RETURN_MASK_ALL)
138 {
139 /* Ignore memory errors. */
140 switch (ex.error)
141 {
142 case MEMORY_ERROR:
143 break;
144 default:
145 throw_exception (ex);
146 break;
147 }
148 }
149 END_CATCH
150 }
151 }
152 }
153
154 /* Build a list of `struct so_list' objects describing the shared
155 objects currently loaded in the inferior. */
156 static struct so_list *
157 spu_current_sos (void)
158 {
159 enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
160 struct so_list *head;
161 struct so_list **link_ptr;
162
163 gdb_byte buf[MAX_SPE_FD * 4];
164 int i, size;
165
166 /* First, retrieve the SVR4 shared library list. */
167 head = svr4_so_ops.current_sos ();
168
169 /* Append our libraries to the end of the list. */
170 for (link_ptr = &head; *link_ptr; link_ptr = &(*link_ptr)->next)
171 ;
172
173 /* Determine list of SPU ids. */
174 size = target_read (&current_target, TARGET_OBJECT_SPU, NULL,
175 buf, 0, sizeof buf);
176
177 /* Do not add stand-alone SPE executable context as shared library,
178 but relocate main SPE executable objfile. */
179 if (spu_standalone_p ())
180 {
181 if (size == 4)
182 {
183 int fd = extract_unsigned_integer (buf, 4, byte_order);
184
185 spu_relocate_main_executable (fd);
186
187 /* Re-enable breakpoints after main SPU context was established;
188 see also comments in spu_solib_create_inferior_hook. */
189 enable_breakpoints_after_startup ();
190 }
191
192 return head;
193 }
194
195 /* Create an so_list entry for each SPU id. */
196 for (i = 0; i < size; i += 4)
197 {
198 int fd = extract_unsigned_integer (buf + i, 4, byte_order);
199 struct so_list *newobj;
200
201 unsigned long long addr;
202 char annex[32], id[100];
203 int len;
204
205 /* Read object ID. There's a race window where the inferior may have
206 already created the SPE context, but not installed the object-id
207 yet. Skip such entries; we'll be back for them later. */
208 xsnprintf (annex, sizeof annex, "%d/object-id", fd);
209 len = target_read (&current_target, TARGET_OBJECT_SPU, annex,
210 (gdb_byte *) id, 0, sizeof id);
211 if (len <= 0 || len >= sizeof id)
212 continue;
213 id[len] = 0;
214 if (sscanf (id, "0x%llx", &addr) != 1 || !addr)
215 continue;
216
217 /* Allocate so_list structure. */
218 newobj = XCNEW (struct so_list);
219
220 /* Encode FD and object ID in path name. Choose the name so as not
221 to conflict with any (normal) SVR4 library path name. */
222 xsnprintf (newobj->so_name, sizeof newobj->so_name, "@%s <%d>",
223 hex_string (addr), fd);
224 strcpy (newobj->so_original_name, newobj->so_name);
225
226 *link_ptr = newobj;
227 link_ptr = &newobj->next;
228 }
229
230 /* Append OpenCL sos. */
231 append_ocl_sos (link_ptr);
232
233 return head;
234 }
235
236 /* Free so_list information. */
237 static void
238 spu_free_so (struct so_list *so)
239 {
240 if (so->so_original_name[0] != '@')
241 svr4_so_ops.free_so (so);
242 }
243
244 /* Relocate section addresses. */
245 static void
246 spu_relocate_section_addresses (struct so_list *so,
247 struct target_section *sec)
248 {
249 if (so->so_original_name[0] != '@')
250 svr4_so_ops.relocate_section_addresses (so, sec);
251 else
252 {
253 unsigned long long addr;
254 int fd;
255
256 /* Set addr_low/high to just LS offset for display. */
257 if (so->addr_low == 0 && so->addr_high == 0
258 && strcmp (sec->the_bfd_section->name, ".text") == 0)
259 {
260 so->addr_low = sec->addr;
261 so->addr_high = sec->endaddr;
262 }
263
264 /* Decode object ID. */
265 if (sscanf (so->so_original_name, "@0x%llx <%d>", &addr, &fd) != 2)
266 internal_error (__FILE__, __LINE__, "bad object ID");
267
268 sec->addr = SPUADDR (fd, sec->addr);
269 sec->endaddr = SPUADDR (fd, sec->endaddr);
270 }
271 }
272
273
274 /* Inferior memory should contain an SPE executable image at location ADDR.
275 Allocate a BFD representing that executable. Return NULL on error. */
276
277 static void *
278 spu_bfd_iovec_open (bfd *nbfd, void *open_closure)
279 {
280 return open_closure;
281 }
282
283 static int
284 spu_bfd_iovec_close (bfd *nbfd, void *stream)
285 {
286 xfree (stream);
287
288 /* Zero means success. */
289 return 0;
290 }
291
292 static file_ptr
293 spu_bfd_iovec_pread (bfd *abfd, void *stream, void *buf,
294 file_ptr nbytes, file_ptr offset)
295 {
296 CORE_ADDR addr = *(CORE_ADDR *)stream;
297 int ret;
298
299 ret = target_read_memory (addr + offset, (gdb_byte *) buf, nbytes);
300 if (ret != 0)
301 {
302 bfd_set_error (bfd_error_invalid_operation);
303 return -1;
304 }
305
306 return nbytes;
307 }
308
309 static int
310 spu_bfd_iovec_stat (bfd *abfd, void *stream, struct stat *sb)
311 {
312 /* We don't have an easy way of finding the size of embedded spu
313 images. We could parse the in-memory ELF header and section
314 table to find the extent of the last section but that seems
315 pointless when the size is needed only for checks of other
316 parsed values in dbxread.c. */
317 memset (sb, 0, sizeof (struct stat));
318 sb->st_size = INT_MAX;
319 return 0;
320 }
321
322 static gdb_bfd_ref_ptr
323 spu_bfd_fopen (char *name, CORE_ADDR addr)
324 {
325 CORE_ADDR *open_closure = XNEW (CORE_ADDR);
326
327 *open_closure = addr;
328
329 gdb_bfd_ref_ptr nbfd (gdb_bfd_openr_iovec (name, "elf32-spu",
330 spu_bfd_iovec_open, open_closure,
331 spu_bfd_iovec_pread,
332 spu_bfd_iovec_close,
333 spu_bfd_iovec_stat));
334 if (nbfd == NULL)
335 return NULL;
336
337 if (!bfd_check_format (nbfd.get (), bfd_object))
338 return NULL;
339
340 return nbfd;
341 }
342
343 /* Open shared library BFD. */
344 static gdb_bfd_ref_ptr
345 spu_bfd_open (char *pathname)
346 {
347 char *original_name = strrchr (pathname, '@');
348 asection *spu_name;
349 unsigned long long addr;
350 int fd;
351
352 /* Handle regular SVR4 libraries. */
353 if (!original_name)
354 return svr4_so_ops.bfd_open (pathname);
355
356 /* Decode object ID. */
357 if (sscanf (original_name, "@0x%llx <%d>", &addr, &fd) != 2)
358 internal_error (__FILE__, __LINE__, "bad object ID");
359
360 /* Open BFD representing SPE executable. */
361 gdb_bfd_ref_ptr abfd (spu_bfd_fopen (original_name, (CORE_ADDR) addr));
362 if (abfd == NULL)
363 error (_("Cannot read SPE executable at %s"), original_name);
364
365 /* Retrieve SPU name note. */
366 spu_name = bfd_get_section_by_name (abfd.get (), ".note.spu_name");
367 if (spu_name)
368 {
369 int sect_size = bfd_section_size (abfd.get (), spu_name);
370
371 if (sect_size > 20)
372 {
373 char *buf
374 = (char *) alloca (sect_size - 20 + strlen (original_name) + 1);
375
376 bfd_get_section_contents (abfd.get (), spu_name, buf, 20,
377 sect_size - 20);
378 buf[sect_size - 20] = '\0';
379
380 strcat (buf, original_name);
381
382 xfree ((char *)abfd->filename);
383 abfd->filename = xstrdup (buf);
384 }
385 }
386
387 return abfd;
388 }
389
390 /* Lookup global symbol in a SPE executable. */
391 static struct block_symbol
392 spu_lookup_lib_symbol (struct objfile *objfile,
393 const char *name,
394 const domain_enum domain)
395 {
396 if (bfd_get_arch (objfile->obfd) == bfd_arch_spu)
397 return lookup_global_symbol_from_objfile (objfile, name, domain);
398
399 if (svr4_so_ops.lookup_lib_global_symbol != NULL)
400 return svr4_so_ops.lookup_lib_global_symbol (objfile, name, domain);
401 return (struct block_symbol) {NULL, NULL};
402 }
403
404 /* Enable shared library breakpoint. */
405 static int
406 spu_enable_break (struct objfile *objfile)
407 {
408 struct bound_minimal_symbol spe_event_sym;
409
410 /* The libspe library will call __spe_context_update_event whenever any
411 SPE context is allocated or destroyed. */
412 spe_event_sym = lookup_minimal_symbol ("__spe_context_update_event",
413 NULL, objfile);
414
415 /* Place a solib_event breakpoint on the symbol. */
416 if (spe_event_sym.minsym)
417 {
418 CORE_ADDR addr = BMSYMBOL_VALUE_ADDRESS (spe_event_sym);
419
420 addr = gdbarch_convert_from_func_ptr_addr (target_gdbarch (), addr,
421 &current_target);
422 create_solib_event_breakpoint (target_gdbarch (), addr);
423 return 1;
424 }
425
426 return 0;
427 }
428
429 /* Enable shared library breakpoint for the
430 OpenCL runtime running on the SPU. */
431 static void
432 ocl_enable_break (struct objfile *objfile)
433 {
434 struct bound_minimal_symbol event_sym;
435 struct bound_minimal_symbol addr_sym;
436
437 /* The OpenCL runtime on the SPU will call __opencl_program_update_event
438 whenever an OpenCL program is loaded. */
439 event_sym = lookup_minimal_symbol ("__opencl_program_update_event", NULL,
440 objfile);
441 /* The PPU address of the OpenCL program can be found
442 at opencl_elf_image_address. */
443 addr_sym = lookup_minimal_symbol ("opencl_elf_image_address", NULL, objfile);
444
445 if (event_sym.minsym && addr_sym.minsym)
446 {
447 /* Place a solib_event breakpoint on the symbol. */
448 CORE_ADDR event_addr = BMSYMBOL_VALUE_ADDRESS (event_sym);
449 create_solib_event_breakpoint (get_objfile_arch (objfile), event_addr);
450
451 /* Store the address of the symbol that will point to OpenCL program
452 using the per-objfile private data mechanism. */
453 if (objfile_data (objfile, ocl_program_data_key) == NULL)
454 {
455 CORE_ADDR *ocl_program_addr_base = OBSTACK_CALLOC (
456 &objfile->objfile_obstack,
457 objfile->sections_end - objfile->sections,
458 CORE_ADDR);
459 *ocl_program_addr_base = BMSYMBOL_VALUE_ADDRESS (addr_sym);
460 set_objfile_data (objfile, ocl_program_data_key,
461 ocl_program_addr_base);
462 }
463 }
464 }
465
466 /* Create inferior hook. */
467 static void
468 spu_solib_create_inferior_hook (int from_tty)
469 {
470 /* Handle SPE stand-alone executables. */
471 if (spu_standalone_p ())
472 {
473 /* After an SPE stand-alone executable was loaded, we'll receive
474 an additional trap due to the binfmt_misc handler. Make sure
475 to skip that trap. */
476 spu_skip_standalone_loader ();
477
478 /* If the user established breakpoints before starting the inferior, GDB
479 would attempt to insert those now. This would fail because the SPU
480 context has not yet been created and the SPU executable has not yet
481 been loaded. To prevent such failures, we disable all user-created
482 breakpoints now; they will be re-enabled in spu_current_sos once the
483 main SPU context has been detected. */
484 disable_breakpoints_before_startup ();
485
486 /* A special case arises when re-starting an executable, because at
487 this point it still resides at the relocated address range that was
488 determined during its last execution. We need to undo the relocation
489 so that that multi-architecture target recognizes the stand-alone
490 initialization special case. */
491 spu_relocate_main_executable (-1);
492 }
493
494 /* Call SVR4 hook -- this will re-insert the SVR4 solib breakpoints. */
495 svr4_so_ops.solib_create_inferior_hook (from_tty);
496
497 /* If the inferior is statically linked against libspe, we need to install
498 our own solib breakpoint right now. Otherwise, it will be installed by
499 the solib_loaded observer below as soon as libspe is loaded. */
500 spu_enable_break (NULL);
501 }
502
503 /* Install SPE "shared library" handling. This is called by -tdep code
504 that wants to support SPU as a secondary architecture. */
505 void
506 set_spu_solib_ops (struct gdbarch *gdbarch)
507 {
508 static struct target_so_ops spu_so_ops;
509
510 /* Initialize this lazily, to avoid an initialization order
511 dependency on solib-svr4.c's _initialize routine. */
512 if (spu_so_ops.current_sos == NULL)
513 {
514 spu_so_ops = svr4_so_ops;
515 spu_so_ops.solib_create_inferior_hook = spu_solib_create_inferior_hook;
516 spu_so_ops.relocate_section_addresses = spu_relocate_section_addresses;
517 spu_so_ops.free_so = spu_free_so;
518 spu_so_ops.current_sos = spu_current_sos;
519 spu_so_ops.bfd_open = spu_bfd_open;
520 spu_so_ops.lookup_lib_global_symbol = spu_lookup_lib_symbol;
521 }
522
523 set_solib_ops (gdbarch, &spu_so_ops);
524 }
525
526 /* Observer for the solib_loaded event. Used to install our breakpoint
527 if libspe is a shared library. */
528 static void
529 spu_solib_loaded (struct so_list *so)
530 {
531 if (strstr (so->so_original_name, "/libspe") != NULL)
532 {
533 solib_read_symbols (so, 0);
534 spu_enable_break (so->objfile);
535 }
536 /* In case the OpenCL runtime is loaded we install a breakpoint
537 to get notified whenever an OpenCL program gets loaded. */
538 if (strstr (so->so_name, "CLRuntimeAccelCellSPU@") != NULL)
539 {
540 solib_read_symbols (so, 0);
541 ocl_enable_break (so->objfile);
542 }
543 }
544
545 void
546 _initialize_spu_solib (void)
547 {
548 observer_attach_solib_loaded (spu_solib_loaded);
549 ocl_program_data_key = register_objfile_data ();
550 }
551
target_gdbarch
struct gdbarch * target_gdbarch(void)
Definition: gdbarch.c:5467
gdbarch
Definition: gdbarch.c:127
MEMORY_ERROR
Definition: common-exceptions.h:78
hex_string
char * hex_string(LONGEST num)
Definition: print-utils.c:220
ocl_enable_break
static void ocl_enable_break(struct objfile *objfile)
Definition: solib-spu.c:432
spu_relocate_main_executable
static void spu_relocate_main_executable(int spufs_fd)
Definition: solib-spu.c:51
SPUADDR
#define SPUADDR(spu, addr)
Definition: spu-tdep.h:104
section_offsets::offsets
CORE_ADDR offsets[1]
Definition: symtab.h:1273
OBSTACK_CALLOC
#define OBSTACK_CALLOC(OBSTACK, NUMBER, TYPE)
Definition: gdb_obstack.h:30
enable_breakpoints_after_startup
void enable_breakpoints_after_startup(void)
Definition: breakpoint.c:8514
objfile::obfd
bfd * obfd
Definition: objfiles.h:342
target_waitstatus
Definition: waitstatus.h:104
CORE_ADDR
bfd_vma CORE_ADDR
Definition: common-types.h:41
disable_breakpoints_before_startup
void disable_breakpoints_before_startup(void)
Definition: breakpoint.c:8507
target_wait
ptid_t target_wait(ptid_t ptid, struct target_waitstatus *status, int options)
Definition: target.c:2177
RETURN_MASK_ALL
Definition: common-exceptions.h:44
spu-tdep.h
xfree
void xfree(void *)
so_list::next
struct so_list * next
Definition: solist.h:44
create_solib_event_breakpoint
struct breakpoint * create_solib_event_breakpoint(struct gdbarch *gdbarch, CORE_ADDR address)
Definition: breakpoint.c:7560
solist.h
spu_bfd_iovec_open
static void * spu_bfd_iovec_open(bfd *nbfd, void *open_closure)
Definition: solib-spu.c:278
ocl_program_data_key
static const struct objfile_data * ocl_program_data_key
Definition: solib-spu.c:97
set_solib_ops
void set_solib_ops(struct gdbarch *gdbarch, const struct target_so_ops *new_ops)
Definition: solib.c:77
INT_MAX
#define INT_MAX
Definition: defs.h:477
BMSYMBOL_VALUE_ADDRESS
#define BMSYMBOL_VALUE_ADDRESS(symbol)
Definition: symtab.h:691
spu_solib_loaded
static void spu_solib_loaded(struct so_list *so)
Definition: solib-spu.c:529
append_ocl_sos
static void append_ocl_sos(struct so_list **link_ptr)
Definition: solib-spu.c:101
SPUADDR_SPU
#define SPUADDR_SPU(addr)
Definition: spu-tdep.h:107
domain_enum
enum domain_enum_tag domain_enum
target_so_ops::relocate_section_addresses
void(* relocate_section_addresses)(struct so_list *so, struct target_section *)
Definition: solist.h:95
spu_standalone_p
#define spu_standalone_p()
Definition: solib-spu.c:44
memset
void * memset(T *s, int c, size_t n)=delete
internal_error
void internal_error(const char *file, int line, const char *fmt,...)
Definition: errors.c:50
inferior_thread
struct thread_info * inferior_thread(void)
Definition: thread.c:90
target_so_ops::solib_create_inferior_hook
void(* solib_create_inferior_hook)(int from_tty)
Definition: solist.h:112
target_so_ops::current_sos
struct so_list *(* current_sos)(void)
Definition: solist.h:121
objfile_relocate
void objfile_relocate(struct objfile *objfile, const struct section_offsets *new_offsets)
Definition: objfiles.c:896
spu_bfd_iovec_stat
static int spu_bfd_iovec_stat(bfd *abfd, void *stream, struct stat *sb)
Definition: solib-spu.c:310
spu_current_sos
static struct so_list * spu_current_sos(void)
Definition: solib-spu.c:157
so_list
Definition: solist.h:38
_
#define _(String)
Definition: gdb_locale.h:35
target_so_ops
Definition: solist.h:91
gdb_bfd.h
defs.h
END_CATCH
#define END_CATCH
Definition: common-exceptions.h:259
target_so_ops::bfd_open
gdb_bfd_ref_ptr(* bfd_open)(char *pathname)
Definition: solist.h:132
objfiles.h
arch-utils.h
so_list::abfd
bfd * abfd
Definition: solist.h:71
XNEW
#define XNEW(T)
Definition: poison.h:109
observer.h
TRY
#define TRY
Definition: common-exceptions.h:246
symtab.h
name
const char *const name
Definition: aarch64-tdep.c:76
thread_control_state::in_infcall
int in_infcall
Definition: gdbthread.h:130
spu_solib_create_inferior_hook
static void spu_solib_create_inferior_hook(int from_tty)
Definition: solib-spu.c:468
spu_bfd_open
static gdb_bfd_ref_ptr spu_bfd_open(char *pathname)
Definition: solib-spu.c:345
TARGET_OBJECT_SPU
Definition: target.h:137
section_offsets
Definition: symtab.h:1271
gdb::ref_ptr
Definition: gdb_ref_ptr.h:49
CATCH
#define CATCH(EXCEPTION, MASK)
Definition: common-exceptions.h:254
spu_relocate_section_addresses
static void spu_relocate_section_addresses(struct so_list *so, struct target_section *sec)
Definition: solib-spu.c:246
solib-spu.h
_initialize_spu_solib
void _initialize_spu_solib(void)
Definition: solib-spu.c:546
current_target
struct target_ops current_target
objfile::objfile
objfile(bfd *, const char *, objfile_flags)
Definition: objfiles.c:373
solib-svr4.h
extract_unsigned_integer
static ULONGEST extract_unsigned_integer(const gdb_byte *addr, int len, enum bfd_endian byte_order)
Definition: defs.h:577
bound_minimal_symbol
Definition: minsyms.h:29
target_so_ops::lookup_lib_global_symbol
struct block_symbol(* lookup_lib_global_symbol)(struct objfile *objfile, const char *name, const domain_enum domain)
Definition: solist.h:143
gdbarch_convert_from_func_ptr_addr
CORE_ADDR gdbarch_convert_from_func_ptr_addr(struct gdbarch *gdbarch, CORE_ADDR addr, struct target_ops *targ)
Definition: gdbarch.c:3191
target_resume
void target_resume(ptid_t ptid, int step, enum gdb_signal signal)
Definition: target.c:2215
block_symbol
Definition: symtab.h:1133
spu_skip_standalone_loader
static void spu_skip_standalone_loader(void)
Definition: solib-spu.c:71
so_list::so_original_name
char so_original_name[SO_NAME_MAX_PATH_SIZE]
Definition: solist.h:57
gdbarch_byte_order
enum bfd_endian gdbarch_byte_order(struct gdbarch *gdbarch)
Definition: gdbarch.c:1509
gdbthread.h
inferior.h
get_objfile_arch
struct gdbarch * get_objfile_arch(const struct objfile *objfile)
Definition: objfiles.c:445
spu_enable_break
static int spu_enable_break(struct objfile *objfile)
Definition: solib-spu.c:406
objfile::sections
struct obj_section * sections
Definition: objfiles.h:423
so_list::so_name
char so_name[SO_NAME_MAX_PATH_SIZE]
Definition: solist.h:60
solib.h
symfile_objfile
#define symfile_objfile
Definition: progspace.h:227
target_section::endaddr
CORE_ADDR endaddr
Definition: target.h:2318
target_has_execution
#define target_has_execution
Definition: target.h:1756
breakpoint.h
target_section::the_bfd_section
struct bfd_section * the_bfd_section
Definition: target.h:2320
set_spu_solib_ops
void set_spu_solib_ops(struct gdbarch *gdbarch)
Definition: solib-spu.c:506
target_section::addr
CORE_ADDR addr
Definition: target.h:2317
objfile
Definition: objfiles.h:286
throw_exception
void throw_exception(struct gdb_exception exception)
Definition: common-exceptions.c:312
gdb_byte
bfd_byte gdb_byte
Definition: common-types.h:38
svr4_so_ops
struct target_so_ops svr4_so_ops
Definition: solib-svr4.c:3242
so_list::addr_low
CORE_ADDR addr_low
Definition: solist.h:88
lookup_global_symbol_from_objfile
struct block_symbol lookup_global_symbol_from_objfile(struct objfile *main_objfile, const char *name, const domain_enum domain)
Definition: symtab.c:2226
XCNEW
#define XCNEW(T)
Definition: poison.h:121
gdbcore.h
xsnprintf
int xsnprintf(char *str, size_t size, const char *format,...)
Definition: common-utils.c:134
thread_info::control
thread_control_state control
Definition: gdbthread.h:291
gdb_bfd_openr_iovec
gdb_bfd_ref_ptr gdb_bfd_openr_iovec(const char *filename, const char *target, void *(*open_func)(struct bfd *nbfd, void *open_closure), void *open_closure, file_ptr(*pread_func)(struct bfd *nbfd, void *stream, void *buf, file_ptr nbytes, file_ptr offset), int(*close_func)(struct bfd *nbfd, void *stream), int(*stat_func)(struct bfd *abfd, void *stream, struct stat *sb))
Definition: gdb_bfd.c:804
target_read_memory
int target_read_memory(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
Definition: target.c:1370
inferior_ptid
ptid_t inferior_ptid
Definition: infcmd.c:94
bound_minimal_symbol::minsym
struct minimal_symbol * minsym
Definition: minsyms.h:34
target_so_ops::free_so
void(* free_so)(struct so_list *so)
Definition: solist.h:100
offset
int offset
Definition: agent.c:65
spu_bfd_iovec_close
static int spu_bfd_iovec_close(bfd *nbfd, void *stream)
Definition: solib-spu.c:284
target_section
Definition: target.h:2315
gdb::ref_ptr::get
T * get() const
Definition: gdb_ref_ptr.h:130
current_inferior
struct inferior * current_inferior(void)
Definition: inferior.c:58
target_read
LONGEST target_read(struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *buf, ULONGEST offset, LONGEST len)
Definition: target.c:1562
spu_free_so
static void spu_free_so(struct so_list *so)
Definition: solib-spu.c:238
solib_read_symbols
int solib_read_symbols(struct so_list *so, symfile_add_flags flags)
Definition: solib.c:676
so_list::addr_high
CORE_ADDR addr_high
Definition: solist.h:88
read_memory_unsigned_integer
ULONGEST read_memory_unsigned_integer(CORE_ADDR memaddr, int len, enum bfd_endian byte_order)
Definition: corefile.c:326
objfile::objfile_obstack
Definition: objfiles.h:357
ALL_OBJFILES
#define ALL_OBJFILES(obj)
Definition: objfiles.h:582
so_list::objfile
struct objfile * objfile
Definition: solist.h:77
lookup_minimal_symbol
struct bound_minimal_symbol lookup_minimal_symbol(const char *name, const char *sfile, struct objfile *objf)
Definition: minsyms.c:311
MAX_SPE_FD
#define MAX_SPE_FD
Definition: solib-spu.c:41
set_executing
void set_executing(ptid_t ptid, int executing)
Definition: thread.c:991
spu_bfd_iovec_pread
static file_ptr spu_bfd_iovec_pread(bfd *abfd, void *stream, void *buf, file_ptr nbytes, file_ptr offset)
Definition: solib-spu.c:293
error
void error(const char *fmt,...)
Definition: errors.c:38
size
size_t size
Definition: go32-nat.c:242
minus_one_ptid
ptid_t minus_one_ptid
Definition: ptid.c:26
observer_attach_solib_loaded
struct observer * observer_attach_solib_loaded(observer_solib_loaded_ftype *f)
spu_bfd_fopen
static gdb_bfd_ref_ptr spu_bfd_fopen(char *name, CORE_ADDR addr)
Definition: solib-spu.c:323
objfile::sections_end
struct obj_section * sections_end
Definition: objfiles.h:424
spu_lookup_lib_symbol
static struct block_symbol spu_lookup_lib_symbol(struct objfile *objfile, const char *name, const domain_enum domain)
Definition: solib-spu.c:392