Commit Graph

47 Commits

Author SHA1 Message Date
Zebediah Figura b7defd2946 dbghelp: Correctly determine the dyld image info address.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-08-14 13:55:55 +02:00
Ken Thomases 3ff8fa7ed1 dbghelp: Fix loading of Mach-O load commands for 64-bit binaries.
Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-07-17 08:41:22 +02:00
Michael Stefaniuc 053a7e225c dbghelp: Use the ARRAY_SIZE() macro.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-07-13 00:18:02 +02:00
Zebediah Figura 7d441808ac dbghelp: Read the stabs nlist entry corresponding to the target's architecture.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-06-15 12:56:48 +02:00
Zebediah Figura 1dc9bb70cd dbghelp: Translate the 32-bit Mach-O section header to the 64-bit one.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-06-15 12:56:48 +02:00
Zebediah Figura 0fc3c33637 dbghelp: Read the Mach-O segment command corresponding to the target's architecture.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-06-15 12:56:48 +02:00
Zebediah Figura bf7681cb2f dbghelp: Pass an image_file_map to macho_enum_load_commands().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-06-15 12:56:48 +02:00
Zebediah Figura f2e38e1795 dbghelp: Read the 32-bit Mach-O header.
It is identical to the 64-bit header, except for the "reserved" field.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-06-15 12:56:48 +02:00
Zebediah Figura f0ee3471f3 dbghelp: Determine the target Mach-O architecture from the process's architecture.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-06-15 12:56:48 +02:00
Huw Davies cf78601b37 dbghelp: Add a missing include to fix the build.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-06-01 19:42:25 +02:00
Zebediah Figura a981edf0bc dbghelp: Determine the wine loader name from the target process's architecture.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-05-31 21:36:42 +02:00
Michael Stefaniuc c8ab4004ad dbghelp: Use CONTAINING_RECORD instead of reimplementing it.
Signed-off-by: Michael Stefaniuc <mstefani@redhat.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-03-08 21:29:15 +09:00
Ken Thomases d5739561d8 dbghelp: Provide a default value for DYLD_FALLBACK_LIBRARY_PATH, which is closer to how dyld behaves. 2015-09-18 14:59:01 +02:00
Ken Thomases 8d6b349409 dbghelp: Fix a comment to reflect what the code's actually doing. 2015-09-18 14:58:58 +02:00
Ken Thomases f458cd844a dbghelp: On Mac, get the wineloader path from the target or our own process before resorting to guessing.
This makes backtraces more reliably complete when WINELOADER isn't set
and the loader isn't in a typical location.
2015-09-18 14:58:55 +02:00
Ken Thomases 49f0bf6f0b dbghelp: Ignore Mach-O segments other than __TEXT for images in dyld's shared cache.
Images in the shared cache have their segments mapped non-contiguously.  We
don't know how to find where the non-__TEXT segments actually are.  Also, the
code assumes that the image is mapped contiguously in various places.  So, we
just ignore those segments.

Treating the non-contiguous segments as though they were contiguous caused
their apparent memory ranges to overlap, leading to addresses being attributed
to the wrong module, let alone symbol.
2015-08-04 12:21:58 +02:00
Ken Thomases be68890cac dbghelp: Fix a copy-paste error in comparing Mach-O segment names. 2015-08-04 12:21:58 +02:00
Ken Thomases 5c39776327 dbghelp: Add support for loading an external DWARF debug info file associated with a Mach-O module.
Such external debug info files are created by the dsymutil command.  Usually, it
creates a <name>.dSYM bundle directory but it can also produce a <name>.dwarf
flat file.  The code will find and use either.  It first checks if such a bundle
or file is adjacent to the module binary.  If it's not, it uses Spotlight to
search for a .dSYM bundle based on the binary's UUID, which is what gdb and lldb
do, too.  That way, it can find it anywhere on the system.
2015-06-29 19:07:52 +09:00
Ken Thomases 70565f1b8b dbghelp: Don't parse the DWARF info from Mach-O files if we were requested to only provide public symbols.
This now works more like how the ELF and PE support works.
2015-06-29 19:07:52 +09:00
Ken Thomases 3a9698f4af dbghelp: Parse the DWARF information in Mach-O modules.
At this point, this is just the .eh_frame information used for walking the stack.
2015-06-25 14:29:38 +09:00
Ken Thomases 0bfa11455c dbghelp: Implement the image_private.h functions for Mach-O modules. 2015-06-25 14:29:38 +09:00
Ken Thomases 729b53fb9e dbghelp: For Mach-O, keep the module file mapped for as long as the module is tracked. 2015-06-25 14:02:17 +09:00
Ken Thomases e15e9331cb dbghelp: Move the macho_file_map structure into image_file_map. 2015-06-25 14:02:12 +09:00
Ken Thomases dcbec3bf6a dbghelp: Use existing IMAGE_NO_MAP constant instead of redundant MACHO_NO_MAP. 2015-06-25 14:02:00 +09:00
Ken Thomases 41d741761f dbghelp: Remove the unused arch_size field of struct macho_file_map.
It was set, but never read.
2015-06-25 14:01:54 +09:00
Ken Thomases 4923f9afd5 dbghelp: Enable enumerating and loading 64-bit Mach-O modules. 2015-06-25 14:01:49 +09:00
Ken Thomases 378d557d77 dbghelp: Fix a leak of the Mach-O module structure by adding a module_remove callback. 2015-06-25 14:01:32 +09:00
Ken Thomases 8430ebc6b5 dbghelp: Eliminate an unnecessary parameter from macho_load_debug_info().
From outside of macho_module.c, it's only called with NULL.  When it's
called with a non-NULL parameter, it's just a thin wrapper around
macho_load_debug_info_from_map(), so the code can just call that
directly.
2015-06-25 14:01:26 +09:00
Charles Davis b3232e7c9d dbghelp: Support 64-bit dyld_all_image_infos structures, too. 2015-02-06 22:35:23 +09:00
Ken Thomases 5acf1510fb dbghelp: Ignore the __PAGEZERO segment.
It made it seem as though the wineloader always started at address 0.
Issue identified by Jacek Caban.
2014-07-07 23:00:52 +02:00
Ken Thomases 1f2680f5f3 dbghelp: If the caller didn't provide a module load address use the segment start address. 2014-07-07 23:00:47 +02:00
Frédéric Delanoy d066561625 dbghelp: Constify some character strings. 2013-12-16 12:02:49 +01:00
Ken Thomases 1577fb6c3f dbghelp: For Mach-O, get the address of the process's image info from its PEB. 2013-12-05 12:40:56 +01:00
Ken Thomases 15467577fc dbghelp: Add debug logging to some error paths in the Mach-O support. 2013-12-03 12:34:45 +01:00
Ken Thomases 3fe34fe346 dbghelp: Fix some parameter names and types in the Mach-O support. 2013-12-03 12:33:55 +01:00
Alexandre Julliard a81996d757 dbghelp: Use sysconf() instead of getpagesize(). 2013-01-09 12:15:25 +01:00
Eric Pouech dca2d350ad dbghelp: Add helper to get global address out of symt, instead of going though symt_get_info. 2011-03-09 13:52:41 +01:00
Eric Pouech 031cce8e77 dbghelp: Added support for variables in thread storage. 2011-01-31 14:30:13 +01:00
Alexandre Julliard 3bae7d0383 dbghelp: Add a helper function to determine the name of the wine loader. 2011-01-28 11:41:14 +01:00
Eric Pouech 229d753bc9 dbghelp: Some more 64bit base address fixes. 2010-10-11 17:07:57 +02:00
Austin English 95740b30b9 dbghelp: Fix compile on Hurd. 2010-10-08 11:56:46 +02:00
Eric Pouech cecb80a4e8 dbghelp: Move the mach-o information into the modfmt structure. 2010-03-19 12:23:36 +01:00
Alexandre Julliard 2a07163901 dbghelp: Fix the Mac OS build. 2010-01-28 15:52:32 +01:00
Huw Davies 34a961d3af dbghelp: Fix compilation on OSX. 2009-12-16 12:20:31 +01:00
Alexandre Julliard a5231a60a1 dbghelp: Fix detection of special Wine segments. 2009-06-25 11:45:24 +02:00
Ken Thomases 6903238948 dbghelp: Don't check version of Mach-O dyld_all_image_infos structure.
The structure has changed repeatedly, but always in a backward compatible way.
The version check was only hampering us.
2009-05-04 12:52:01 +02:00
Ken Thomases d7466e0c4e dbghelp: Add support for debugging Mach-O modules. 2009-03-25 12:17:29 +01:00