Commit Graph

89 Commits

Author SHA1 Message Date
Eric Pouech 1c5989465e dbghelp: Make symt_add_func_line() last parameter an absolute address.
It used to be an offset to the start of function, but it's actually
stored as an absolute address afterwards. This avoids unnecessary
computations.

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-29 21:27:41 +02:00
Eric Pouech 23c325276b dbghelp: Remove unneeded #include <limits.h>.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-21 19:01:03 +02:00
Eric Pouech cee52d5988 dbghelp: Get rid of useless symt_normalize_func().
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-07 23:19:22 +02:00
Eric Pouech d459301de6 dbghelp: Make symt_fill_func_line_info() and symt_get_func_line_next() static functions inside symbol.c.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-07 23:19:22 +02:00
Eric Pouech 35c45857ae dbghelp: Tidy up internals for array type.
Mainly remove hackish storage of information with negative value and
use a uniform min/count pair for all debug formats.

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-01 21:21:49 +02:00
Eric Pouech 3ed209e0d9 dbghelp: Correctly store and report bitfield information.
Bitfield information must be stored relative to first byte
of underlying integral type. We were storing the information
always relative to the first containing byte.

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-30 22:49:58 +02:00
Ken Thomases c7a0d5f626 dbghelp: Avoid asserting on egregiously long stabs symbol names.
Some Mac libraries have symbols which are many thousands of characters long.
(Thank you, C++ templates!)  It doesn't seem worth it to accommodate those by
dynamically allocating the symbol name buffer, but we definitely don't want to
assert.  Just log an ERR.

Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-10 10:24:19 +02:00
Jacek Caban e014d325dd dbghelp: Get rid of no longer needed #ifdefs.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-07 09:13:59 +02:00
Jacek Caban ceae3f0207 dbghelp: Remove unneeded includes.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-06 21:21:42 +02:00
Chip Davis 53b5c3b6c6 dbghelp: Ignore N_INDR symbols.
These are aliases for another symbol. They are often seen on Mac OS when
a dylib reexports some symbols defined in another dylib.

Signed-off-by: Chip Davis <cdavis@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-06 21:21:41 +02:00
Jacek Caban 9c2cedabc7 dbghelp: Pass stab size to stabs_parse.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-30 12:09:10 +02:00
Jacek Caban f48f8cc399 dbghelp: Use local declaration for 64-bit macho nlist.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-30 12:09:10 +02:00
Jacek Caban 061146c2ab dbghelp: Use local stab_nlist declaration in macho_module.c.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-30 12:09:09 +02:00
Jacek Caban 47f1c5a993 dbghelp: Clear N_PEXT flag of stab type in macho files.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-30 12:09:09 +02:00
Jacek Caban 208719a750 dbghelp: Provide N_PEXT and N_SECT defines when not available.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-30 12:09:09 +02:00
Jacek Caban f803da493a dbghelp: Use LONG_PTR instead of long type.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-26 18:34:50 +01: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
Ken Thomases 604ce29cb3 dbghelp: Fix STABS support for 64-bit on OS X.
OS X uses a struct nlist_64 for 64-bit images, where the n_value field is a
64-bit unsigned integer.
2015-06-25 14:01:10 +09:00
Marcus Meissner b3f9747b28 dbghelp: Free srcpath in stabs handling (Coverity). 2013-06-24 11:45:10 +02:00
Francois Gouget fac36c55e9 Assorted typo, spelling, wording and case fixes. 2012-05-15 16:26:43 +02:00
André Hentschel 89cb501927 dbghelp: Assorted fixes for shadow variables. 2012-04-23 12:58:36 +02:00
André Hentschel 85051917fe dbghelp: Rewrite stabs parsing to not need PATH_MAX. 2011-10-17 17:45:03 +02:00
Andrew Talbot 94c0407cac dbghelp: Constify some variables. 2011-08-23 16:53:52 +02:00
Eric Pouech 9c09f14270 dbghelp: Extended CPU structure by adding a default register number for frame. 2011-04-12 12:49:53 +02:00
Eric Pouech 031cce8e77 dbghelp: Added support for variables in thread storage. 2011-01-31 14:30:13 +01:00
Alexandre Julliard cf1cd33570 dbghelp: Support pointer types of various sizes. 2011-01-13 20:09:49 +01:00
Eric Pouech fac5abc551 dbghelp: Ensure the stab_nlist structure is usable on 64bit systems. 2010-10-11 17:11:24 +02:00
André Hentschel 2f5ba0d8c0 dbghelp: Fix typo in url. 2010-01-06 09:52:48 +01:00
Eric Pouech 9500df82f1 dbghelp: Move the core of some line related functions to 64bit interface. 2009-12-15 11:58:39 +01:00
Eric Pouech 92b9b0940d dbghelp: Wrap the symt* <=> index transformations. 2009-12-15 11:56:45 +01:00
Jacek Caban 1e23e88914 dbghelp: Check for NULL adt before using it in stabs_pts_read_aggregate. 2009-08-17 13:57:49 +02:00
Jacek Caban 4cc3ce923a dbghelp: Use symt_get_name directly in stabs_pts_read_aggregate. 2009-08-17 13:57:49 +02:00
Jacek Caban 956eea6b31 dbghelp: Fixed buffer overflow in stabs_parse. 2009-08-17 13:57:49 +02:00
Alexandre Julliard 75792a3e69 dbghelp: Grow all arrays by doubling the size. 2009-07-10 14:46:55 +02:00
Ken Thomases 905ab99815 dbghelp/stabs: For Mach-O, line offset is relative to original function address. 2009-04-07 11:21:40 +02:00
Ken Thomases 3a96219d57 dbghelp/stabs: For Mach-O, line numbers use absolute address, not offset.
So, compute the offset by subtracting the function address.
2009-03-25 12:17:42 +01:00
Ken Thomases 985f0ea18f dbghelp/stabs: Track line numbers pending for an upcoming function.
On Darwin, line numbers usually precede the associated function.
2009-03-12 13:09:56 +01:00
Ken Thomases 65d929079c dbghelp/stabs: Allow pending list to include line numbers as well as variables.
On Darwin, line numbers usually precede the associated function.
2009-03-12 13:09:56 +01:00
Ken Thomases a1ac32822a dbghelp/stabs: Extract growing of pending_block's buffer to pending_make_room(). 2009-03-12 13:09:56 +01:00
Ken Thomases 615fff293a dbghelp: Teach stabs_parse about other kinds of Mach-O symbol definitions. 2009-03-12 13:09:56 +01:00
Ken Thomases 3db11b98b7 dbghelp: Let stabs_parse call back for real (non-debug) symbol definitions. 2009-03-12 13:09:55 +01:00
Ken Thomases 82a3f8fcb2 dbghelp/stabs: Decode the Stabs type more carefully. 2009-03-12 13:09:55 +01:00
Ken Thomases 1ecd634c4b dbghelp/stabs: Ignore the N_OSO type used on Darwin. 2009-03-12 13:09:55 +01:00
Ken Thomases 1f4ddbaed9 dbghelp/stabs: Translate additional register codes. 2009-03-12 13:09:55 +01:00
Andrew Talbot c9563e10fc dbghelp: Sign-compare warnings fix. 2008-09-25 11:28:58 +02:00
Andrew Talbot 51b3b4a481 dbghelp: Use dbgstr_a() in case pointer is NULL. 2008-06-23 12:51:20 +02:00
Andrew Talbot dbe65d03e2 dbghelp: Include port.h for possible alternative to strtoull(). 2008-05-05 12:52:01 +02:00
Eric Pouech 3bc7657616 dbghelp: Revert commit ae1791b0b8 and correctly fix what this patch was trying to do. 2008-05-01 11:13:07 +02:00
Andrew Talbot ae1791b0b8 dbghelp: Fix type mismatch in comparison. 2008-03-31 12:51:11 +02:00