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