Commit Graph

352 Commits

Author SHA1 Message Date
Marshall Clow
e1630e01de Fix compile error when building with C++11 - clang thinks that PRIx64 is a user-defined suffix or something
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162704 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-27 22:53:35 +00:00
NAKAMURA Takumi
83e2546ad3 DWARFDebugRangeList.cpp: Use PRIx64 for uint64_t as format string.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162665 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-27 10:10:10 +00:00
Alexey Samsonov
07071c1c75 [DebugInfo] fixup for r162657: update CMakeLists.txt
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162659 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-27 07:24:43 +00:00
Alexey Samsonov
eceb5b9977 Add basic support for .debug_ranges section to LLVM's DebugInfo library.
This section (introduced in DWARF-3) is used to define instruction address
ranges for functions that are not contiguous and can't be described
by low_pc/high_pc attributes (this is the usual case for inlined subroutines).
The patch is the first step to support fetching complete inlining info from DWARF.

Reviewed by Benjamin Kramer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162657 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-27 07:17:47 +00:00
Eric Christopher
3887a902a1 Add support for some missing DW_FORM_*.
TODO: Fix code duplication and coding style.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162525 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-24 01:14:23 +00:00
Eric Christopher
08cdb6e6b2 Formatting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162524 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-24 01:14:21 +00:00
Eric Christopher
5d04a3ad0e Formatting cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162499 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-23 23:26:57 +00:00
Eric Christopher
fa76f22865 Add an assert here in case parsing gave us a NULL compile unit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162498 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-23 23:21:11 +00:00
Eric Christopher
bd5bc2161c 80-col.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162422 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-23 00:52:51 +00:00
Eric Christopher
1a145c409a Tidy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162421 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-23 00:52:49 +00:00
Alexey Samsonov
351f83be64 Fix the representation of debug line table in DebugInfo LLVM library,
and "instruction address -> file/line" lookup.

Instead of plain collection of rows, debug line table for compilation unit is now
treated as the number of row ranges, describing sequences (series of contiguous machine
instructions). The sequences are not always listed in the order of increasing
address, so previously used std::lower_bound() sometimes produced wrong results.
Now the instruction address lookup consists of two stages: finding the correct
sequence, and searching for address in range of rows for this sequence.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161414 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-07 11:46:57 +00:00
Alexey Samsonov
71d94f8055 DebugInfo library: add support for fetching absolute paths to source files
(instead of basenames) from DWARF. Use this behavior in llvm-dwarfdump tool.

Reviewed by Benjamin Kramer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160496 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-19 07:03:58 +00:00
Alexey Samsonov
9d26b0ba06 Improve behavior of DebugInfoEntryMinimal::getSubprogramName() introduced in r159512.
To fetch a subprogram name we should not only inspect the DIE for this subprogram, but optionally inspect
its specification, or its abstract origin (even if there is no inlining), or even specification of an abstract origin.

Reviewed by Benjamin Kramer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160365 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-17 15:28:35 +00:00
Alexey Samsonov
a9543aadff Fix a bug in DebugInfo lib, extend a comment for one of the methods
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159707 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-04 09:42:54 +00:00
Alexey Samsonov
3e25c4a1e3 This patch extends the libLLVMDebugInfo which contains a minimalistic DWARF parser:
1) DIContext is now able to return function name for a given instruction address (besides file/line info).
2) llvm-dwarfdump accepts flag --functions that prints the function name (if address is specified by --address flag).
3) test case that checks the basic functionality of llvm-dwarfdump added

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159512 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-02 05:54:45 +00:00
Benjamin Kramer
e25a2bd2e3 Fix a C++11 UDL conflict.
Still not fixed in the standard ;)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154044 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-04 20:33:56 +00:00
David Blaikie
4d6ccb5f68 More dead code removal (using -Wunreachable-code)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148578 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-20 21:51:11 +00:00
David Blaikie
2d24e2a396 Unweaken vtables as per http://llvm.org/docs/CodingStandards.html#ll_virtual_anch
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146960 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20 02:50:00 +00:00
Daniel Dunbar
4ab406d7fc LLVMBuild: Remove trailing newline, which irked me.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146409 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-12 19:48:00 +00:00
Daniel Dunbar
d782bae970 build/CMake: Finish removal of add_llvm_library_dependencies.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145420 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-29 19:25:30 +00:00
Benjamin Kramer
5eccd36f1a Audited all the format strings in libDebugInfo and fixed those that didn't match the types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143814 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-05 16:01:13 +00:00
Benjamin Kramer
80cc2598f8 Reduce the offsets in DwarfDebugInfoEntry to 32 bit, they're printed with %x and
that breaks on big-endian machines.

I have to clean up the 32/64 bit confusion in libDebugInfo some day.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143812 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-05 15:35:00 +00:00
Benjamin Kramer
41a964931a Add more PRI.64 macros for MSVC and use them throughout the codebase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143799 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-05 08:57:40 +00:00
Daniel Dunbar
a3a2dfd4a2 build: Add initial cut at LLVMBuild.txt files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143634 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-03 18:53:17 +00:00
NAKAMURA Takumi
017449d64b lib/DebugInfo/DWARFDebugLine.cpp: De-Unicode-ify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141484 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-08 11:22:47 +00:00
NAKAMURA Takumi
3a79eac5b8 Whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141483 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-08 11:22:41 +00:00
Benjamin Kramer
1d13d9ed96 DWARF: avoid unnecessary map lookups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140260 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-21 17:31:42 +00:00
Benjamin Kramer
76f58d2031 Namespacify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139892 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-16 00:35:06 +00:00
Benjamin Kramer
9013db3399 DWARF: Reset the state after parsing a line table prologue and remove an unnecessary lookup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139859 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-15 21:59:13 +00:00
Benjamin Kramer
f5b0accf43 DWARF: Don't crash when looking up an invalid address.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139846 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-15 21:08:54 +00:00
Benjamin Kramer
101b1c5ff1 DWARF: Put all the pieces we have together and provide a single accessor to DIContext that provides line information when given an address.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139836 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-15 20:43:22 +00:00
Benjamin Kramer
c26ed9b47f DWARF: Remove accessors that parse the whole line table section in one go, this can't possibly work.
The address size is specified by the compile unit associated with a line table, there is no global address size.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139835 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-15 20:43:18 +00:00
Benjamin Kramer
fe80f1da40 DWARF: Print line tables per compile unit, so they get the right address size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139808 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-15 18:02:20 +00:00
Benjamin Kramer
34f864fd38 DWARF: wire up .debug_str dumping.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139799 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-15 16:57:13 +00:00
Benjamin Kramer
75c63087b4 DWARF: Make DIE printing more bulletproof.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139786 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-15 05:43:00 +00:00
Benjamin Kramer
7b97442b49 DWARF: Print the number for unknown abbrev fields.
Thanks Nick!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139778 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-15 04:15:59 +00:00
Benjamin Kramer
42180e8336 DWARF: Fail gracefully when encountering unknown values in an abbrev.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139777 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-15 04:00:58 +00:00
Nick Lewycky
6bc4e712dc Give structs with virtual methods a virtual destructor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139776 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-15 03:41:51 +00:00
Benjamin Kramer
068d9a564b DWARF: Silence GCC -Wsign-compare warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139775 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-15 03:20:04 +00:00
Benjamin Kramer
89aedba562 DWARF: Fix indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139774 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-15 03:11:09 +00:00
Benjamin Kramer
7393c7f748 DWARF: Include <algorithm> explicitly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139773 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-15 02:19:33 +00:00
Benjamin Kramer
b848e97611 DWARF: Add basic support for line tables.
The llvm-dwarfdump output isn't very verbose yet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139771 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-15 02:12:05 +00:00
Benjamin Kramer
10df80692c DWARF: Generate the address lookup table from the DIE tree if .debug_aranges is not available.
Ported from LLDB.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139732 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-14 20:52:27 +00:00
Benjamin Kramer
d6361c0954 DWARF: Reorder fields to reduce padding.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139712 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-14 18:34:47 +00:00
Benjamin Kramer
0942255f6d DWARF: Improve indentation of DIE dumping so it's easier to see the structure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139705 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-14 17:54:56 +00:00
Benjamin Kramer
1c0b24f91a llvm-dwarfdump: Make the "is debug info section" heuristic stricter so it doesn't accidentaly picks up the wrong section.
Also add some validation code to the aranges section parser.

Fixes PR10926.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139701 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-14 17:28:13 +00:00
Benjamin Kramer
553f933963 Don't rely in <algorithm> being pulled in transitively.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139684 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-14 01:27:48 +00:00
Benjamin Kramer
358f4fd9ee DWARF: Port support for parsing .debug_aranges section from LLDB and wire it up to llvm-dwarfdump.
This is only one half of it, the part that caches address ranges from the DIEs when .debug_aranges is
not available will be ported soon.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139680 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-14 01:09:52 +00:00
Benjamin Kramer
15ec085c40 DebugInfo: Don't print DIEs multiple times.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139671 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-14 00:15:32 +00:00
Benjamin Kramer
4aa3fea8b1 Style & indentation tweaks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139646 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-13 21:47:32 +00:00
Benjamin Kramer
8a23a77a54 I know copy&paste!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139628 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-13 19:49:53 +00:00
Benjamin Kramer
72c0d7fdd3 Sketch out a DWARF parser.
This introduces a new library to LLVM: libDebugInfo. It will provide debug information
parsing to LLVM. Much of the design and some of the code is taken from the LLDB project.

It also contains an llvm-dwarfdump tool that can dump the abbrevs and DIEs from an
object file. It can be used to write tests for DWARF input and output easily.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139627 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-13 19:42:23 +00:00