1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00
Commit Graph

35 Commits

Author SHA1 Message Date
David Blaikie
c5322af8c2 DebugInfo: Support debug_loc under fission
Implement debug_loc.dwo, as well as llvm-dwarfdump support for dumping
this section.

Outlined in the DWARF5 spec and http://gcc.gnu.org/wiki/DebugFission the
debug_loc.dwo section has more variation than the standard debug_loc,
allowing 3 different forms of entry (plus the end of list entry). GCC
seems to, and Clang certainly, only use one form, so I've just
implemented dumping support for that for now.

It wasn't immediately obvious that there was a good refactoring to share
the implementation of dumping support between debug_loc and
debug_loc.dwo, so they're separate for now - ideas welcome or I may come
back to it at some point.

As per a comment in the code, we could choose different forms that may
reduce the number of debug_addr entries we emit, but that will require
further study.

llvm-svn: 204697
2014-03-25 01:44:02 +00:00
Ahmed Charles
52ce0c101e Replace OwningPtr<T> with std::unique_ptr<T>.
This compiles with no changes to clang/lld/lldb with MSVC and includes
overloads to various functions which are used by those projects and llvm
which have OwningPtr's as parameters. This should allow out of tree
projects some time to move. There are also no changes to libs/Target,
which should help out of tree targets have time to move, if necessary.

llvm-svn: 203083
2014-03-06 05:51:42 +00:00
Ahmed Charles
4a96a15754 [C++11] Replace OwningPtr::take() with OwningPtr::release().
llvm-svn: 202957
2014-03-05 10:19:29 +00:00
David Blaikie
5c7418b2ee llvm-dwarfdump: Support for debug_line.dwo section for file names for type units under fission.
llvm-svn: 202091
2014-02-24 23:58:54 +00:00
Rafael Espindola
a7de95d3e7 Change createObjectFile to return an ErrorOr.
llvm-svn: 199776
2014-01-22 00:14:49 +00:00
David Blaikie
d9fe95178b llvm-dwarfdump: type unit dwo support
llvm-svn: 198850
2014-01-09 05:08:24 +00:00
NAKAMURA Takumi
955efe24ce [CMake] Update LLVM_LINK_COMPONENTS for each CMakeLists.txt.
llvm-svn: 196908
2013-12-10 11:13:32 +00:00
David Blaikie
97d9c49ba1 llvm-dwarfdump: support for emitting only the debug_types section using -debug-dump
llvm-svn: 195063
2013-11-19 00:29:42 +00:00
Eric Christopher
7f9a74f73f Add gnu pubsections as options to llvm-dwarfdump.
Argument spelling feedback welcome.

llvm-svn: 191409
2013-09-25 23:02:44 +00:00
Eric Christopher
02158bcbd4 Dump the normal dwarf pubtypes section as well.
llvm-svn: 191408
2013-09-25 23:02:41 +00:00
David Blaikie
7637c0313e llvm-dwarfdump: Add support for dumping the .debug_loc section
This is a basic implementation - we still don't have any support (that I
know of) for dumping DWARF expressions in a meaningful way, so the
location information itself is just printed as a sequence of bytes as we
do elsewhere.

llvm-svn: 184361
2013-06-19 21:37:13 +00:00
Krzysztof Parzyszek
de39fad3d2 Add support for the pubnames section to llvm-dwarfdump.
llvm-svn: 174976
2013-02-12 16:20:28 +00:00
Eli Bendersky
0802d28eff Initial support for DWARF CFI parsing and dumping in LLVM
llvm-svn: 174463
2013-02-05 23:30:58 +00:00
Eli Bendersky
87e2fa1583 When encountering an unknown file format, ObjectFile::createObjectFile should
politely report it instead of running into llvm_unreachable.

Also patch llvm-dwarfdump to actually check whether the file it's attempting to
dump is a valid object file.

llvm-svn: 173489
2013-01-25 20:53:41 +00:00
Eli Bendersky
1b58747212 Add command-line flags for DWARF dumping.
Flags for dumping specific DWARF sections added in lib/DebugInfo and
llvm-dwarfdump.

llvm-svn: 173480
2013-01-25 20:26:43 +00:00
Eli Bendersky
a3c71c2965 Rename variable to be more comprehensible and follow naming convention
llvm-svn: 173460
2013-01-25 17:06:42 +00:00
Chandler Carruth
800daa7d3d Sort the #include lines for tools/...
Again, tools are trickier to pick the main module header for than
library source files. I've started to follow the pattern of using
LLVMContext.h when it is included as a stub for program source files.

llvm-svn: 169252
2012-12-04 10:44:52 +00:00
Eric Christopher
9df7c1b185 Rewrite DIContext interface to take an object. Update all callers.
llvm-svn: 167757
2012-11-12 21:40:38 +00:00
Alexey Samsonov
8fee8dc998 Fixup for r167558: Store raw pointer (instead of reference) to RelocMap in DIContext. This is needed to prevent crashes because of dangling reference if the clients don't provide RelocMap to DIContext constructor.
llvm-svn: 167728
2012-11-12 14:25:36 +00:00
Eric Christopher
b34bece6a8 Add a relocation visitor to lib object. This works via caching relocated
values in a map that can be passed to consumers. Add a testcase that
ensures this works for llvm-dwarfdump.

llvm-svn: 167558
2012-11-07 23:22:07 +00:00
Eric Christopher
ae3c2b9adc Formatting and 80-col.
llvm-svn: 166075
2012-10-16 23:46:21 +00:00
Alexey Samsonov
0dd3d6f49e Add support for fetching inlining context (stack of source code locations)
by instruction address from DWARF.

Add --inlining flag to llvm-dwarfdump to demonstrate and test this functionality,
so that "llvm-dwarfdump --inlining --address=0x..." now works much like
"addr2line -i 0x...", provided that the binary has debug info
(Clang's -gline-tables-only *is* enough).

llvm-svn: 163128
2012-09-04 08:12:33 +00:00
Alexey Samsonov
e39e62d8e5 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.

llvm-svn: 162657
2012-08-27 07:17:47 +00:00
Alexey Samsonov
8832a9374f 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.

llvm-svn: 160496
2012-07-19 07:03:58 +00:00
Alexey Samsonov
2e5d156c11 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

llvm-svn: 159512
2012-07-02 05:54:45 +00:00
Daniel Dunbar
30d6a45140 LLVMBuild: Remove trailing newline, which irked me.
llvm-svn: 146409
2011-12-12 19:48:00 +00:00
Daniel Dunbar
efa02a0c3d LLVMBuild: Add description files for the LLVM tools.
llvm-svn: 144417
2011-11-11 22:59:39 +00:00
Daniel Dunbar
81780d9982 build: Tidy up a bunch of tool Makefiles, and simplify where possible using the
new all-targets pseudo-component.

llvm-svn: 142401
2011-10-18 19:27:24 +00:00
Michael J. Spencer
7037dc0b45 Fix a few changes I missed.
llvm-svn: 141392
2011-10-07 19:52:41 +00:00
Benjamin Kramer
b5c3c42a54 llvm-dwarfdump: Add an option to print out line info for a specific address
Usage:
$ llvm-dwarfdump -address=0x0000000100000ed4 a.out.dSYM/Contents/Resources/DWARF/a.out 
xxx.c:6:0

llvm-svn: 139850
2011-09-15 21:17:40 +00:00
Benjamin Kramer
900209189c DWARF: wire up .debug_str dumping.
llvm-svn: 139799
2011-09-15 16:57:13 +00:00
Benjamin Kramer
ceca872d69 DWARF: Add basic support for line tables.
The llvm-dwarfdump output isn't very verbose yet.

llvm-svn: 139771
2011-09-15 02:12:05 +00:00
Benjamin Kramer
b08f6dc724 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.

llvm-svn: 139701
2011-09-14 17:28:13 +00:00
Benjamin Kramer
6b456ffb42 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.

llvm-svn: 139680
2011-09-14 01:09:52 +00:00
Benjamin Kramer
c4e7a56915 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.

llvm-svn: 139627
2011-09-13 19:42:23 +00:00