Commit Graph

10 Commits

Author SHA1 Message Date
Oleksandr Redko
938cb6e9d8
pkg,service: remove unnecessary convertions (#3564) 2023-11-14 16:36:55 +01:00
gocurr
8023fa956e
all: use "len == 0" rather than "len <= 0" when checking empty slice/string (#3439) 2023-07-13 11:30:32 -07:00
Oleksandr Redko
13143680f7
proc/dwarf: LEB128 encode/decode in separate pkg (#3235) 2023-01-10 12:29:58 -08:00
Alessandro Arzilli
29eae8f617
*: clean up staticcheck problems (#2723)
Fix problems that can be fixed, ignore the ones that don't make sense
2021-09-28 12:07:42 -07:00
Alessandro Arzilli
f5d5a681d0
proc: do not assume abstract origins precede their uses (#2293)
The DWARF standard does not say that a DW_ATTR_abstract_origin can only
reference entries that appear before it, this change fixes BinaryInfo
to comply. See #2284 for an example of this happening.
2021-01-27 06:58:48 -08:00
Alessandro Arzilli
b65882a588 proc: ignore DW_TAG_inlined_subroutine entries without abstract origin (#1637)
GCC produces DW_TAG_inlined_subroutine entries without a
DW_AT_abstract_origin attribute.
From the bug report:

 <1><1fe6c7c>: Abbrev Number: 41 (DW_TAG_subprogram)
    <1fe6c7d>   DW_AT_external    : 1
    <1fe6c7d>   DW_AT_name        : (indirect string, offset: 0x485814): MultiGetImpl
    (omissis)
 <2><1fe6c9e>: Abbrev Number: 65 (DW_TAG_inlined_subroutine)
    <1fe6c9f>   DW_AT_low_pc      : 0x311023a
    <1fe6ca7>   DW_AT_high_pc     : 0x5
    <1fe6caf>   DW_AT_call_file   : 10
    <1fe6cb0>   DW_AT_call_line   : 1690
 <2><1fe6cb2>: Abbrev Number: 20 (DW_TAG_inlined_subroutine)
    <1fe6cb3>   DW_AT_abstract_origin: <0x1ffb534>
    <1fe6cb7>   DW_AT_entry_pc    : 0x311023f
    <1fe6cbf>   DW_AT_ranges      : 0xe9bf20
    <1fe6cc3>   DW_AT_call_file   : 10
    <1fe6cc4>   DW_AT_call_line   : 1690

Inlined subroutine at 1fe6c9e doesn't have abstract origin, a name or a
declaration location. It's unclear whether this is in-standard and what
it even means.

Let's ignore it.

Fixes #1636
2019-07-26 11:24:35 -07:00
Alessandro Arzilli
a7c2d837d5 proc: add LocationCover method to BinaryInfo (#1573)
Also fixes findCompileUnitForOffset which was broken in some edge cases
(when looking up an offset inside the last child of the compilation
unit) which don't happen in normal executables (we only look up types, and those
are always direct childs of compile units).
2019-06-24 08:02:14 -07:00
Derek Parker
4c9a72e486 *: Update import name to github.com/go-delve/delve
The repository is being switched from the personal account
github.com/derekparker/delve to the organization account
github.com/go-delve/delve. This patch updates imports and docs, while
preserving things which should not be changed such as my name in the
CHANGELOG and in TODO comments.
2019-01-04 19:43:13 +01:00
aarzilli
53957e9f4d proc: do not panic if we can't satisfy a composite location for a slice var
The fix in 7f53117 for Issue #1416 had a bug, fix it and add a test.

Fixes #1419
2018-11-26 11:05:00 -08:00
aarzilli
f098915192 proc/tests: testing apparatus for complex location expressions 2017-11-21 11:51:02 -08:00