GDB (xrefs)
Loading...
Searching...
No Matches
solib-darwin.c
Go to the documentation of this file.
1/* Handle Darwin shared libraries for GDB, the GNU Debugger.
2
3 Copyright (C) 2009-2023 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 3 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, see <http://www.gnu.org/licenses/>. */
19
20#include "defs.h"
21
22#include "bfd.h"
23#include "objfiles.h"
24#include "gdbcore.h"
25#include "target.h"
26#include "inferior.h"
27#include "regcache.h"
28#include "gdb_bfd.h"
29
30#include "solist.h"
31#include "solib-darwin.h"
32
33#include "mach-o.h"
34#include "mach-o/external.h"
35
37{
38 /* Base address (which corresponds to the Mach-O header). */
39 CORE_ADDR mach_header;
40 /* Image file path. */
41 CORE_ADDR file_path;
42 /* st.m_time of image file. */
43 unsigned long mtime;
44};
45
46/* Content of inferior dyld_all_image_infos structure.
47 See /usr/include/mach-o/dyld_images.h for the documentation. */
49{
50 /* Version (1). */
51 unsigned int version;
52 /* Number of images. */
53 unsigned int count;
54 /* Image description. */
55 CORE_ADDR info;
56 /* Notifier (function called when a library is added or removed). */
57 CORE_ADDR notifier;
58};
59
60/* Current all_image_infos version. */
61#define DYLD_VERSION_MIN 1
62#define DYLD_VERSION_MAX 15
63
64/* Per PSPACE specific data. */
66{
67 /* Address of structure dyld_all_image_infos in inferior. */
68 CORE_ADDR all_image_addr = 0;
69
70 /* Gdb copy of dyld_all_info_infos. */
72};
73
74/* Per-program-space data key. */
77
78/* Get the current darwin data. If none is found yet, add it now. This
79 function always returns a valid object. */
80
81static struct darwin_info *
83{
84 struct darwin_info *info;
85
87 if (info != NULL)
88 return info;
89
91}
92
93/* Return non-zero if the version in dyld_all_image is known. */
94
95static int
97{
98 return info->all_image.version >= DYLD_VERSION_MIN
99 && info->all_image.version <= DYLD_VERSION_MAX;
100}
101
102/* Read dyld_all_image from inferior. */
103
104static void
106{
107 gdb_byte buf[24];
108 enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
109 struct type *ptr_type = builtin_type (target_gdbarch ())->builtin_data_ptr;
110 int len;
111
112 /* If the structure address is not known, don't continue. */
113 if (info->all_image_addr == 0)
114 return;
115
116 /* The structure has 4 fields: version (4 bytes), count (4 bytes),
117 info (pointer) and notifier (pointer). */
118 len = 4 + 4 + 2 * ptr_type->length ();
119 gdb_assert (len <= sizeof (buf));
120 memset (&info->all_image, 0, sizeof (info->all_image));
121
122 /* Read structure raw bytes from target. */
123 if (target_read_memory (info->all_image_addr, buf, len))
124 return;
125
126 /* Extract the fields. */
127 info->all_image.version = extract_unsigned_integer (buf, 4, byte_order);
128 if (!darwin_dyld_version_ok (info))
129 return;
130
131 info->all_image.count = extract_unsigned_integer (buf + 4, 4, byte_order);
132 info->all_image.info = extract_typed_address (buf + 8, ptr_type);
133 info->all_image.notifier = extract_typed_address
134 (buf + 8 + ptr_type->length (), ptr_type);
135}
136
137/* Link map info to include in an allocated so_list entry. */
138
140{
141 /* The target location of lm. */
142 CORE_ADDR lm_addr = 0;
143};
144
145/* Lookup the value for a specific symbol. */
146
147static CORE_ADDR
148lookup_symbol_from_bfd (bfd *abfd, const char *symname)
149{
150 long storage_needed;
151 asymbol **symbol_table;
152 unsigned int number_of_symbols;
153 unsigned int i;
154 CORE_ADDR symaddr = 0;
155
156 storage_needed = bfd_get_symtab_upper_bound (abfd);
157
158 if (storage_needed <= 0)
159 return 0;
160
161 symbol_table = (asymbol **) xmalloc (storage_needed);
162 number_of_symbols = bfd_canonicalize_symtab (abfd, symbol_table);
163
164 for (i = 0; i < number_of_symbols; i++)
165 {
166 asymbol *sym = symbol_table[i];
167
168 if (strcmp (sym->name, symname) == 0
169 && (sym->section->flags & (SEC_CODE | SEC_DATA)) != 0)
170 {
171 /* BFD symbols are section relative. */
172 symaddr = sym->value + sym->section->vma;
173 break;
174 }
175 }
176 xfree (symbol_table);
177
178 return symaddr;
179}
180
181/* Return program interpreter string. */
182
183static char *
185{
186 char *buf = NULL;
187
188 /* If we have an current exec_bfd, get the interpreter from the load
189 commands. */
191 {
192 bfd_mach_o_load_command *cmd;
193
194 if (bfd_mach_o_lookup_command (current_program_space->exec_bfd (),
195 BFD_MACH_O_LC_LOAD_DYLINKER, &cmd) == 1)
196 return cmd->command.dylinker.name_str;
197 }
198
199 /* If we didn't find it, read from memory.
200 FIXME: todo. */
201 return buf;
202}
203
204/* Not used. I don't see how the main symbol file can be found: the
205 interpreter name is needed and it is known from the executable file.
206 Note that darwin-nat.c implements pid_to_exec_file. */
207
208static int
210{
211 return 0;
212}
213
214/* Build a list of currently loaded shared objects. See solib-svr4.c. */
215
216static struct so_list *
218{
219 struct type *ptr_type = builtin_type (target_gdbarch ())->builtin_data_ptr;
220 enum bfd_endian byte_order = type_byte_order (ptr_type);
221 int ptr_len = ptr_type->length ();
222 unsigned int image_info_size;
223 struct so_list *head = NULL;
224 struct so_list *tail = NULL;
225 int i;
226 struct darwin_info *info = get_darwin_info ();
227
228 /* Be sure image infos are loaded. */
230
231 if (!darwin_dyld_version_ok (info))
232 return NULL;
233
234 image_info_size = ptr_len * 3;
235
236 /* Read infos for each solib.
237 The first entry was rumored to be the executable itself, but this is not
238 true when a large number of shared libraries are used (table expanded ?).
239 We now check all entries, but discard executable images. */
240 for (i = 0; i < info->all_image.count; i++)
241 {
242 CORE_ADDR iinfo = info->all_image.info + i * image_info_size;
243 gdb_byte buf[image_info_size];
244 CORE_ADDR load_addr;
245 CORE_ADDR path_addr;
246 struct mach_o_header_external hdr;
247 unsigned long hdr_val;
248
249 /* Read image info from inferior. */
250 if (target_read_memory (iinfo, buf, image_info_size))
251 break;
252
253 load_addr = extract_typed_address (buf, ptr_type);
254 path_addr = extract_typed_address (buf + ptr_len, ptr_type);
255
256 /* Read Mach-O header from memory. */
257 if (target_read_memory (load_addr, (gdb_byte *) &hdr, sizeof (hdr) - 4))
258 break;
259 /* Discard wrong magic numbers. Shouldn't happen. */
261 (hdr.magic, sizeof (hdr.magic), byte_order);
262 if (hdr_val != BFD_MACH_O_MH_MAGIC && hdr_val != BFD_MACH_O_MH_MAGIC_64)
263 continue;
264 /* Discard executable. Should happen only once. */
266 (hdr.filetype, sizeof (hdr.filetype), byte_order);
267 if (hdr_val == BFD_MACH_O_MH_EXECUTE)
268 continue;
269
270 gdb::unique_xmalloc_ptr<char> file_path
271 = target_read_string (path_addr, SO_NAME_MAX_PATH_SIZE - 1);
272 if (file_path == nullptr)
273 break;
274
275 /* Create and fill the new so_list element. */
276 gdb::unique_xmalloc_ptr<struct so_list> newobj (XCNEW (struct so_list));
277
279 newobj->lm_info = li;
280
281 strncpy (newobj->so_name, file_path.get (), SO_NAME_MAX_PATH_SIZE - 1);
282 newobj->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
283 strcpy (newobj->so_original_name, newobj->so_name);
284 li->lm_addr = load_addr;
285
286 if (head == NULL)
287 head = newobj.get ();
288 else
289 tail->next = newobj.get ();
290 tail = newobj.release ();
291 }
292
293 return head;
294}
295
296/* Check LOAD_ADDR points to a Mach-O executable header. Return LOAD_ADDR
297 in case of success, 0 in case of failure. */
298
299static CORE_ADDR
300darwin_validate_exec_header (CORE_ADDR load_addr)
301{
302 enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
303 struct mach_o_header_external hdr;
304 unsigned long hdr_val;
305
306 /* Read Mach-O header from memory. */
307 if (target_read_memory (load_addr, (gdb_byte *) &hdr, sizeof (hdr) - 4))
308 return 0;
309
310 /* Discard wrong magic numbers. Shouldn't happen. */
312 (hdr.magic, sizeof (hdr.magic), byte_order);
313 if (hdr_val != BFD_MACH_O_MH_MAGIC && hdr_val != BFD_MACH_O_MH_MAGIC_64)
314 return 0;
315
316 /* Check executable. */
318 (hdr.filetype, sizeof (hdr.filetype), byte_order);
319 if (hdr_val == BFD_MACH_O_MH_EXECUTE)
320 return load_addr;
321
322 return 0;
323}
324
325/* Get the load address of the executable using dyld list of images.
326 We assume that the dyld info are correct (which is wrong if the target
327 is stopped at the first instruction). */
328
329static CORE_ADDR
331{
332 struct type *ptr_type = builtin_type (target_gdbarch ())->builtin_data_ptr;
333 int ptr_len = ptr_type->length ();
334 unsigned int image_info_size = ptr_len * 3;
335 int i;
336
337 /* Read infos for each solib. One of them should be the executable. */
338 for (i = 0; i < info->all_image.count; i++)
339 {
340 CORE_ADDR iinfo = info->all_image.info + i * image_info_size;
341 gdb_byte buf[image_info_size];
342 CORE_ADDR load_addr;
343
344 /* Read image info from inferior. */
345 if (target_read_memory (iinfo, buf, image_info_size))
346 break;
347
348 load_addr = extract_typed_address (buf, ptr_type);
349 if (darwin_validate_exec_header (load_addr) == load_addr)
350 return load_addr;
351 }
352
353 return 0;
354}
355
356/* Get the load address of the executable when the PC is at the dyld
357 entry point using parameter passed by the kernel (at SP). */
358
359static CORE_ADDR
361{
362 struct gdbarch *gdbarch = target_gdbarch ();
363 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
364 int addr_size = gdbarch_addr_bit (gdbarch) / 8;
365 ULONGEST load_ptr_addr;
366 ULONGEST load_addr;
367 gdb_byte buf[8];
368
369 /* Get SP. */
372 &load_ptr_addr) != REG_VALID)
373 return 0;
374
375 /* Read value at SP (image load address). */
376 if (target_read_memory (load_ptr_addr, buf, addr_size))
377 return 0;
378
379 load_addr = extract_unsigned_integer (buf, addr_size, byte_order);
380
381 return darwin_validate_exec_header (load_addr);
382}
383
384/* Return 1 if PC lies in the dynamic symbol resolution code of the
385 run time loader. */
386
387static int
389{
390 return 0;
391}
392
393/* A wrapper for bfd_mach_o_fat_extract that handles reference
394 counting properly. This will either return NULL, or return a new
395 reference to a BFD. */
396
397static gdb_bfd_ref_ptr
398gdb_bfd_mach_o_fat_extract (bfd *abfd, bfd_format format,
399 const bfd_arch_info_type *arch)
400{
401 bfd *result = bfd_mach_o_fat_extract (abfd, format, arch);
402
403 if (result == NULL)
404 return NULL;
405
406 if (result == abfd)
407 gdb_bfd_ref (result);
408 else
409 gdb_bfd_mark_parent (result, abfd);
410
411 return gdb_bfd_ref_ptr (result);
412}
413
414/* Return the BFD for the program interpreter. */
415
416static gdb_bfd_ref_ptr
418{
419 char *interp_name;
420
421 /* This method doesn't work with an attached process. */
422 if (current_inferior ()->attach_flag)
423 return NULL;
424
425 /* Find the program interpreter. */
426 interp_name = find_program_interpreter ();
427 if (!interp_name)
428 return NULL;
429
430 /* Create a bfd for the interpreter. */
431 gdb_bfd_ref_ptr dyld_bfd (gdb_bfd_open (interp_name, gnutarget));
432 if (dyld_bfd != NULL)
433 {
435 (gdb_bfd_mach_o_fat_extract (dyld_bfd.get (), bfd_object,
437 dyld_bfd = sub;
438 }
439 return dyld_bfd;
440}
441
442/* Extract dyld_all_image_addr when the process was just created, assuming the
443 current PC is at the entry of the dynamic linker. */
444
445static void
447{
448 CORE_ADDR load_addr = 0;
450
451 if (dyld_bfd == NULL)
452 return;
453
454 /* We find the dynamic linker's base address by examining
455 the current pc (which should point at the entry point for the
456 dynamic linker) and subtracting the offset of the entry point. */
457 load_addr = (regcache_read_pc (get_current_regcache ())
458 - bfd_get_start_address (dyld_bfd.get ()));
459
460 /* Now try to set a breakpoint in the dynamic linker. */
461 info->all_image_addr =
462 lookup_symbol_from_bfd (dyld_bfd.get (), "_dyld_all_image_infos");
463
464 if (info->all_image_addr == 0)
465 return;
466
467 info->all_image_addr += load_addr;
468}
469
470/* Extract dyld_all_image_addr reading it from
471 TARGET_OBJECT_DARWIN_DYLD_INFO. */
472
473static void
475{
476 gdb_byte buf[8];
477 LONGEST len;
478 struct type *ptr_type = builtin_type (target_gdbarch ())->builtin_data_ptr;
479
480 /* Sanity check. */
481 if (ptr_type->length () > sizeof (buf))
482 return;
483
484 len = target_read (current_inferior ()->top_target (),
486 NULL, buf, 0, ptr_type->length ());
487 if (len <= 0)
488 return;
489
490 /* The use of BIG endian is intended, as BUF is a raw stream of bytes. This
491 makes the support of remote protocol easier. */
492 info->all_image_addr = extract_unsigned_integer (buf, len, BFD_ENDIAN_BIG);
493}
494
495/* Shared library startup support. See documentation in solib-svr4.c. */
496
497static void
499{
500 /* Everything below only makes sense if we have a running inferior. */
501 if (!target_has_execution ())
502 return;
503
504 struct darwin_info *info = get_darwin_info ();
505 CORE_ADDR load_addr;
506
507 info->all_image_addr = 0;
508
510
511 if (info->all_image_addr == 0)
513
514 if (info->all_image_addr == 0)
515 return;
516
518
519 if (!darwin_dyld_version_ok (info))
520 {
521 warning (_("unhandled dyld version (%d)"), info->all_image.version);
522 return;
523 }
524
525 if (info->all_image.count != 0)
526 {
527 /* Possible relocate the main executable (PIE). */
528 load_addr = darwin_read_exec_load_addr_from_dyld (info);
529 }
530 else
531 {
532 /* Possible issue:
533 Do not break on the notifier if dyld is not initialized (deduced from
534 count == 0). In that case, dyld hasn't relocated itself and the
535 notifier may point to a wrong address. */
536
537 load_addr = darwin_read_exec_load_addr_at_init (info);
538 }
539
540 if (load_addr != 0 && current_program_space->symfile_object_file != NULL)
541 {
542 CORE_ADDR vmaddr;
543
544 /* Find the base address of the executable. */
545 vmaddr = bfd_mach_o_get_base_address (current_program_space->exec_bfd ());
546
547 /* Relocate. */
548 if (vmaddr != load_addr)
550 load_addr - vmaddr);
551 }
552
553 /* Set solib notifier (to reload list of shared libraries). */
554 CORE_ADDR notifier = info->all_image.notifier;
555
556 if (info->all_image.count == 0)
557 {
558 /* Dyld hasn't yet relocated itself, so the notifier address may
559 be incorrect (as it has to be relocated). */
560 CORE_ADDR start
561 = bfd_get_start_address (current_program_space->exec_bfd ());
562 if (start == 0)
563 notifier = 0;
564 else
565 {
567 if (dyld_bfd != NULL)
568 {
569 CORE_ADDR dyld_bfd_start_address;
570 CORE_ADDR dyld_relocated_base_address;
571 CORE_ADDR pc;
572
573 dyld_bfd_start_address = bfd_get_start_address (dyld_bfd.get());
574
575 /* We find the dynamic linker's base address by examining
576 the current pc (which should point at the entry point
577 for the dynamic linker) and subtracting the offset of
578 the entry point. */
579
581 dyld_relocated_base_address = pc - dyld_bfd_start_address;
582
583 /* We get the proper notifier relocated address by
584 adding the dyld relocated base address to the current
585 notifier offset value. */
586
587 notifier += dyld_relocated_base_address;
588 }
589 }
590 }
591
592 /* Add the breakpoint which is hit by dyld when the list of solib is
593 modified. */
594 if (notifier != 0)
596}
597
598static void
600{
601 struct darwin_info *info = get_darwin_info ();
602
603 info->all_image_addr = 0;
604 info->all_image.version = 0;
605}
606
607static void
609{
611
612 delete li;
613}
614
615/* The section table is built from bfd sections using bfd VMAs.
616 Relocate these VMAs according to solib info. */
617
618static void
620 struct target_section *sec)
621{
623
624 sec->addr += li->lm_addr;
625 sec->endaddr += li->lm_addr;
626
627 /* Best effort to set addr_high/addr_low. This is used only by
628 'info sharedlibary'. */
629 if (so->addr_high == 0)
630 {
631 so->addr_low = sec->addr;
632 so->addr_high = sec->endaddr;
633 }
634 if (sec->endaddr > so->addr_high)
635 so->addr_high = sec->endaddr;
636 if (sec->addr < so->addr_low)
637 so->addr_low = sec->addr;
638}
639
640static gdb_bfd_ref_ptr
641darwin_bfd_open (const char *pathname)
642{
643 int found_file;
644
645 /* Search for shared library file. */
646 gdb::unique_xmalloc_ptr<char> found_pathname
647 = solib_find (pathname, &found_file);
648 if (found_pathname == NULL)
649 perror_with_name (pathname);
650
651 /* Open bfd for shared library. */
652 gdb_bfd_ref_ptr abfd (solib_bfd_fopen (found_pathname.get (), found_file));
653
655 (gdb_bfd_mach_o_fat_extract (abfd.get (), bfd_object,
657 if (res == NULL)
658 error (_("`%s': not a shared-library: %s"),
659 bfd_get_filename (abfd.get ()), bfd_errmsg (bfd_get_error ()));
660
661 /* The current filename for fat-binary BFDs is a name generated
662 by BFD, usually a string containing the name of the architecture.
663 Reset its value to the actual filename. */
664 bfd_set_filename (res.get (), pathname);
665
666 return res;
667}
668
void * xmalloc(YYSIZE_T)
void xfree(void *)
struct gdbarch * target_gdbarch(void)
struct breakpoint * create_solib_event_breakpoint(struct gdbarch *gdbarch, CORE_ADDR address)
void * get(unsigned key)
Definition registry.h:211
const char * gnutarget
Definition corefile.c:405
CORE_ADDR extract_typed_address(const gdb_byte *buf, struct type *type)
Definition findvar.c:152
static ULONGEST extract_unsigned_integer(gdb::array_view< const gdb_byte > buf, enum bfd_endian byte_order)
Definition defs.h:480
void gdb_bfd_mark_parent(bfd *child, bfd *parent)
Definition gdb_bfd.c:935
void gdb_bfd_ref(struct bfd *abfd)
Definition gdb_bfd.c:620
gdb_bfd_ref_ptr gdb_bfd_open(const char *name, const char *target, int fd, bool warn_if_slow)
Definition gdb_bfd.c:473
gdb::ref_ptr< struct bfd, gdb_bfd_ref_policy > gdb_bfd_ref_ptr
Definition gdb_bfd.h:79
enum bfd_endian gdbarch_byte_order(struct gdbarch *gdbarch)
Definition gdbarch.c:1396
int gdbarch_addr_bit(struct gdbarch *gdbarch)
Definition gdbarch.c:1739
int gdbarch_sp_regnum(struct gdbarch *gdbarch)
Definition gdbarch.c:2037
const struct bfd_arch_info * gdbarch_bfd_arch_info(struct gdbarch *gdbarch)
Definition gdbarch.c:1387
enum bfd_endian type_byte_order(const struct type *type)
Definition gdbtypes.c:3900
const struct builtin_type * builtin_type(struct gdbarch *gdbarch)
Definition gdbtypes.c:6168
struct inferior * current_inferior(void)
Definition inferior.c:55
info(Component c)
Definition gdbarch.py:41
void objfile_rebase(struct objfile *objfile, CORE_ADDR slide)
Definition objfiles.c:725
struct program_space * current_program_space
Definition progspace.c:40
CORE_ADDR regcache_read_pc(struct regcache *regcache)
Definition regcache.c:1333
enum register_status regcache_cooked_read_unsigned(struct regcache *regcache, int regnum, ULONGEST *val)
Definition regcache.c:796
struct regcache * get_current_regcache(void)
Definition regcache.c:429
static struct so_list * darwin_current_sos(void)
static CORE_ADDR darwin_read_exec_load_addr_at_init(struct darwin_info *info)
#define DYLD_VERSION_MIN
static char * find_program_interpreter(void)
#define DYLD_VERSION_MAX
static void darwin_load_image_infos(struct darwin_info *info)
static int darwin_in_dynsym_resolve_code(CORE_ADDR pc)
static CORE_ADDR lookup_symbol_from_bfd(bfd *abfd, const char *symname)
static int open_symbol_file_object(int from_tty)
static void darwin_clear_solib(void)
static int darwin_dyld_version_ok(const struct darwin_info *info)
static void darwin_solib_read_all_image_info_addr(struct darwin_info *info)
static CORE_ADDR darwin_validate_exec_header(CORE_ADDR load_addr)
static gdb_bfd_ref_ptr darwin_bfd_open(const char *pathname)
static gdb_bfd_ref_ptr gdb_bfd_mach_o_fat_extract(bfd *abfd, bfd_format format, const bfd_arch_info_type *arch)
const struct target_so_ops darwin_so_ops
static const registry< program_space >::key< darwin_info > solib_darwin_pspace_data
static gdb_bfd_ref_ptr darwin_get_dyld_bfd()
static struct darwin_info * get_darwin_info(void)
static void darwin_solib_create_inferior_hook(int from_tty)
static void darwin_free_so(struct so_list *so)
static void darwin_solib_get_all_image_info_addr_at_init(struct darwin_info *info)
static void darwin_relocate_section_addresses(struct so_list *so, struct target_section *sec)
static CORE_ADDR darwin_read_exec_load_addr_from_dyld(struct darwin_info *info)
gdb_bfd_ref_ptr solib_bfd_fopen(const char *pathname, int fd)
Definition solib.c:423
gdb::unique_xmalloc_ptr< char > solib_find(const char *in_pathname, int *fd)
Definition solib.c:384
#define SO_NAME_MAX_PATH_SIZE
Definition solist.h:22
struct type * builtin_data_ptr
Definition gdbtypes.h:2135
CORE_ADDR all_image_addr
unsigned long mtime
CORE_ADDR lm_addr
bfd * exec_bfd() const
Definition progspace.h:268
struct objfile * symfile_object_file
Definition progspace.h:357
CORE_ADDR addr_high
Definition solist.h:80
struct so_list * next
Definition solist.h:40
lm_info_base * lm_info
Definition solist.h:46
CORE_ADDR addr_low
Definition solist.h:80
CORE_ADDR endaddr
ULONGEST length() const
Definition gdbtypes.h:983
int target_read_string(CORE_ADDR addr, int len, int width, unsigned int fetchlimit, gdb::unique_xmalloc_ptr< gdb_byte > *buffer, int *bytes_read)
Definition target.c:65
bool target_has_execution(inferior *inf)
Definition target.c:201
LONGEST target_read(struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *buf, ULONGEST offset, LONGEST len)
Definition target.c:1970
int target_read_memory(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
Definition target.c:1785
@ TARGET_OBJECT_DARWIN_DYLD_INFO
Definition target.h:197