1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
Commit Graph

316 Commits

Author SHA1 Message Date
Eric Christopher
eb7dd83969 Only emit DW_AT_object_pointer if this is a definition.
llvm-svn: 164326
2012-09-20 22:51:57 +00:00
NAKAMURA Takumi
ac2900c5f9 llvm/test/DebugInfo: Move two tests, 2010-04-13-PubType.ll and linkage-name.ll to X86.
llvm-svn: 164129
2012-09-18 14:57:11 +00:00
Eric Christopher
853a000638 Recommit, with fixes:
Add some support for dealing with an object pointer on arguments.

    Part of rdar://9797999

which now supports adding the object pointer attribute to the
subprogram as it should.

llvm-svn: 163754
2012-09-12 23:36:19 +00:00
Eric Christopher
e2dae503e6 Revert "Add some support for dealing with an object pointer on arguments."
This should be done on the subprogram, not the variable itself.

llvm-svn: 163734
2012-09-12 18:42:31 +00:00
Eric Christopher
9a8f37667b Add some support for dealing with an object pointer on arguments.
Part of rdar://9797999

llvm-svn: 163667
2012-09-12 00:26:55 +00:00
Eric Christopher
5fe521ef3a Revert r160148 it seems to cause more problems than it should
right now. We'll fix PR13303 a different way.

llvm-svn: 163570
2012-09-10 23:34:06 +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
Eric Christopher
4e278d30eb Use DW_FORM_flag_present to save space in debug information if we're
not in darwin gdb compat mode.

Fixes rdar://10975088

llvm-svn: 162526
2012-08-24 01:14:27 +00:00
Eric Christopher
5e0b3cf4a6 Remove the DW_AT_MIPS_linkage name attribute when we don't need it
output (we're emitting a specification already and the information
isn't changing) and we're not in old gdb compat mode.

Saves 1% on the debug information for a build of llvm.

Fixes rdar://11043421

llvm-svn: 162493
2012-08-23 22:52:55 +00:00
Eric Christopher
b5562e6c57 Turn these two options in to trinary state so that they can be
turned on and off separate from the platform if you're on darwin.

llvm-svn: 162487
2012-08-23 22:36:40 +00:00
Eric Christopher
73580f210f Make this darwin specific to try to silence the bots.
llvm-svn: 162435
2012-08-23 07:18:46 +00:00
Eric Christopher
09caadf6c2 Emit pubtypes only when going for darwin gdb compatibility.
rdar://10393214

llvm-svn: 162434
2012-08-23 07:10:56 +00:00
Eric Christopher
7917d1558a Filecheck-ize.
llvm-svn: 162433
2012-08-23 07:10:51 +00:00
Alexey Samsonov
fa8f91a368 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.

llvm-svn: 161414
2012-08-07 11:46:57 +00:00
Eric Christopher
dde7784606 Temporarily revert c23b933d5f8be9b51a1d22e717c0311f65f87dcd. It's causing
failures in the debug testsuite and possibly PR13486.

llvm-svn: 161121
2012-08-01 18:19:01 +00:00
Eric Christopher
acd91c534d Add a DW_AT_high_pc for CUs that are a single address range. Update
all tests accordingly.

Fixes PR13351.

Patch by shinichiro hamaji!

llvm-svn: 160899
2012-07-27 22:00:05 +00:00
NAKAMURA Takumi
f7dd74d4cc test/DebugInfo/dwarfdump-test.test: Tweak expressions for Win32 to match backslashes. They are still odd, though.
For example, Paths are printed on Win32 as below;

/tmp/dbginfo\def2.cc:4:0
/tmp/dbginfo\include\decl2.h:1:0
/tmp/include\decl.h:5:0

llvm-svn: 160505
2012-07-19 13:40:09 +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
5204605486 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.

llvm-svn: 160365
2012-07-17 15:28:35 +00:00
Eric Christopher
2db5457cb8 The end of the prologue should be marked with is_stmt.
Fixes PR13303.

Patch by Paul Robinson!

llvm-svn: 160148
2012-07-12 23:30:25 +00:00
Alexey Samsonov
195a9e9c55 Fix PR13202 and a regtest.
DwarfDebug class could generate the same (inlined) DIVariable twice:
1) when trying to find abstract debug variable for a concrete inlined instance.
2) when explicitly collecting info for variables that were optimized out.

This change makes sure that this duplication won't happen and makes
Clang pass "gdb.opt/inline-locals" test from gdb testsuite.

Reviewed by Eric Christopher.

llvm-svn: 159811
2012-07-06 08:45:08 +00:00
Chandler Carruth
d200829a4f Convert the uses of '|&' to use '2>&1 |' instead, which works on old
versions of Bash. In addition, I can back out the change to the lit
built-in shell test runner to support this.

This should fix the majority of fallout on Darwin, but I suspect there
will be a few straggling issues.

llvm-svn: 159544
2012-07-02 18:37:59 +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
Nick Lewycky
da52706728 Emit relocations for DW_AT_location entries on systems which need it. This is
a recommit of r127757. Fixes PR9493. Patch by Paul Robinson!

llvm-svn: 158957
2012-06-22 01:25:12 +00:00
Eric Christopher
2cff8a57a0 Add support for enum forward declarations.
Part of rdar://11570854

llvm-svn: 157786
2012-06-01 00:22:32 +00:00
Peter Collingbourne
740b217134 Have getOrCreateSubprogramDIE store the DIE for a subprogram
definition in the map before calling itself to retrieve the
DIE for the declaration.  Without this change, if this causes
getOrCreateSubprogramDIE to be recursively called on the definition,
it will create multiple DIEs for that definition.  Fixes PR12831.

llvm-svn: 157541
2012-05-27 18:36:44 +00:00
Eric Christopher
809a39bd54 Add support for C++11 enum classes in llvm.
Part of rdar://11496790

llvm-svn: 157303
2012-05-23 00:09:20 +00:00
Eric Christopher
74be9f0f18 Actually support DW_TAG_rvalue_reference_type that we were trying
to generate out of the front end.

rdar://11479676

llvm-svn: 157094
2012-05-19 01:36:37 +00:00
Eric Christopher
63b73ede75 Handle OpDeref in case it comes in as a register operand.
Part of rdar://11352000

llvm-svn: 156405
2012-05-08 18:56:00 +00:00
Alexey Samsonov
246af5318a X86: Use StackRegister instead of FrameRegister in getFrameIndexReference (to generate debug info for local variables) if stack needs realignment
llvm-svn: 155917
2012-05-01 15:16:06 +00:00
Eric Christopher
2e17b32e69 Patch to set is_stmt a little better for prologue lines in a function.
This enables debuggers to see what are interesting lines for a
breakpoint rather than any line that starts a function.

rdar://9852092

llvm-svn: 154120
2012-04-05 20:39:05 +00:00
Eric Christopher
53ef0cf4a5 Fix thinko check for number of operands to be the one that actually
might have more than 19 operands. Add a testcase to make sure I
never screw that up again.

Part of rdar://11026482

llvm-svn: 153961
2012-04-03 17:55:42 +00:00
Eric Christopher
57ec9a8587 Fix the output of the DW_TAG_friend tag to include DW_AT_friend
and not the rest of the member tag.

Fixes PR11695

llvm-svn: 153570
2012-03-28 07:34:31 +00:00
Eric Christopher
324ff39943 Add a test for the previous commit. Also, remove two tests that were
testing a) the wrong behavior or b) something that I'm already testing
in the new test.

llvm-svn: 153525
2012-03-27 18:35:57 +00:00
Eli Bendersky
3ef88c1833 Continue cleanup of LIT, getting rid of the remaining artifacts from dejagnu
* Removed test/lib/llvm.exp - it is no longer needed 
* Deleted the dg.exp reading code from test/lit.cfg. There are no dg.exp files
  left in the test suite so this code is no longer required. test/lit.cfg is
  now much shorter and clearer 
* Removed a lot of duplicate code in lit.local.cfg files that need access to
  the root configuration, by adding a "root" attribute to the TestingConfig
  object. This attribute is dynamically computed to provide the same
  information as was previously provided by the custom getRoot functions. 
* Documented the config.root attribute in docs/CommandGuide/lit.pod

llvm-svn: 153408
2012-03-25 09:02:19 +00:00
NAKAMURA Takumi
41690b3b7f llvm/test/DebugInfo: Move two tests to DebugInfo/X86. They are X86-dependent.
llvm-svn: 153038
2012-03-19 16:16:03 +00:00
Eric Christopher
40cd87af9e Do the right thing on NULL uint64 fields.
Patch by Clemens Hammacher!

Fixes PR12243

llvm-svn: 152880
2012-03-16 00:21:54 +00:00
Eric Christopher
1fb8e7458e For types with a parent of the compile unit make sure and emit
the DECL information.

rdar://10855921

llvm-svn: 152876
2012-03-15 23:55:40 +00:00
Eric Christopher
0711b41ec6 Revert the removal of DW_AT_MIPS_linkage_name when we aren't putting
out the DW_AT_name. Older gdbs unfortunately still use it to
disambiguate member functions in templated classes (gdb.cp/templates.exp).

rdar://11043421 (which is now deferred for a bit)

llvm-svn: 152782
2012-03-15 08:19:33 +00:00
Eric Christopher
ffe82d6846 Remove the DW_AT_MIPS_linkage name attribute when we don't need it
output (we're emitting a specification already and the information
isn't changing).

Saves 1% on the debug information for a build of llvm.

Fixes rdar://11043421

llvm-svn: 152697
2012-03-14 02:59:17 +00:00
Eric Christopher
6d5c7a5141 Add the DW_AT_APPLE_runtime_class attribute to forward declarations
as well as completely defined classes.

This fixes rdar://10956070

llvm-svn: 152171
2012-03-07 00:15:19 +00:00
Eric Christopher
39493f0f97 Revert "Reorder the sections being output to reduce the number of assembler"
The inline table needs to be constructed ahead of time so that it doesn't try to
create new strings while we're emitting everything.

This reverts commit a8ff9bccb399183cdd5f1c3cec2bda763664b4b0.

llvm-svn: 151864
2012-03-02 00:30:24 +00:00
Eric Christopher
3d271eb540 Reorder the sections being output to reduce the number of assembler
fixups that are being used to determine section offsets. Reduces
the total number of fixups by 50% for a non-trivial testcase.

Part of rdar://10413936

llvm-svn: 151852
2012-03-01 22:50:31 +00:00
Eric Christopher
ea7403bfe2 If the Address of a variable is an argument then treat the entire
variable declaration as an argument because we want that address
anyhow for our debug information.

This seems to fix rdar://9965111, at least we have more debug
information than before and from reading the assembly it appears
to be the correct location.

llvm-svn: 151335
2012-02-24 01:59:08 +00:00
Eric Christopher
9f47c92b48 Only add DW_AT_prototyped if we're working with a C-like language.
Worth another 45k (1%) off of a large C++ testcase.

rdar://10909458

llvm-svn: 151144
2012-02-22 08:46:21 +00:00
Eric Christopher
f725ac3dff Testcase for previous commit.
rdar://10493979

llvm-svn: 151098
2012-02-21 22:25:56 +00:00
Eric Christopher
7b19cf8b2a There's no need for a DW_AT_byte_size on a pointer type.
Part of rdar://10493979 where it reduces by about .5% (10k)

llvm-svn: 151097
2012-02-21 22:25:53 +00:00
Eli Bendersky
4afdeeb682 Replace all instances of dg.exp file with lit.local.cfg, since all tests are run with LIT now and now Dejagnu. dg.exp is no longer needed.
Patch reviewed by Daniel Dunbar. It will be followed by additional cleanup patches.

llvm-svn: 150664
2012-02-16 06:28:33 +00:00
Eric Christopher
15458de186 Fix the testcases for the previous patch.
rdar://10278198

llvm-svn: 148795
2012-01-24 10:11:49 +00:00
Eric Christopher
cc62a64250 Don't avoid recursing for pointer types, just reference types. Expand on
the comment.

Fixes constvars.exp on the gdb test builder.

llvm-svn: 147897
2012-01-11 00:01:29 +00:00
Eric Christopher
38b0b94ef2 When recursing for the original size of a type, stop if we are at a
pointer or a reference type - we actually just want the size of the
pointer then for that.

Fixes rdar://10335756

llvm-svn: 146785
2011-12-16 23:42:45 +00:00
Chris Lattner
9d1e8420ff Upgrade syntax of tests using volatile instructions to use 'load volatile' instead of 'volatile load', which is archaic.
llvm-svn: 145171
2011-11-27 06:54:59 +00:00
Chris Lattner
011a5bf0aa remove autoupgrade support for really old-style debug info intrinsics.
I think this is the last of autoupgrade that can be removed in 3.1.
Can the atomic upgrade stuff also go?

llvm-svn: 145169
2011-11-27 06:18:33 +00:00
Rafael Espindola
5f6b14719f The dwarf standard says that the only differences between a out-of-line
instance and a concrete inlined instance are the use of DW_TAG_subprogram
instead of DW_TAG_inlined_subroutine and the who owns the tree.

We were also omitting DW_AT_inline from the abstract roots. To fix this,
make sure we mark abstract instance roots with DW_AT_inline even when
we have only out-of-line instances referring to them with DW_AT_abstract_origin.

FileCheck is not a very good tool for tests like this, maybe we should add
a -verify mode to llvm-dwarfdump.

llvm-svn: 144441
2011-11-12 01:57:54 +00:00
Devang Patel
09f4f9890c Move X86 specific test in X86 directory.
llvm-svn: 144395
2011-11-11 18:13:19 +00:00
Devang Patel
a804f1a297 Move X86 specific test in X86 directory.
llvm-svn: 144394
2011-11-11 18:10:38 +00:00
Rafael Espindola
e7024f983a Check in getOrCreateSubprogramDIE if a declaration exists and if so output
it first.

This is a more general fix to pr11300.

llvm-svn: 144324
2011-11-10 22:34:29 +00:00
Rafael Espindola
a13d4ca525 Add triple to test.
llvm-svn: 143735
2011-11-04 20:20:34 +00:00
Rafael Espindola
a022f4813e Emit declarations before definitions if they are available. This causes DW_AT_specification to
point back in the file in the included testcase. Fixes PR11300.

llvm-svn: 143726
2011-11-04 19:00:29 +00:00
Eli Friedman
b32279f1fc Move another test requiring x86 into X86 directory.
llvm-svn: 143421
2011-11-01 03:12:47 +00:00
Eli Friedman
b97ce79891 Move test requiring x86 backend into X86 directory.
llvm-svn: 143420
2011-11-01 03:11:41 +00:00
Nick Lewycky
5758d6af22 Always use the string pool, even when it makes the .o larger. This may help
tools that read the debug info in the .o files by making the DIE sizes more
consistent.

llvm-svn: 143186
2011-10-28 05:29:47 +00:00
Nick Lewycky
651475977d Teach our Dwarf emission to use the string pool.
llvm-svn: 143097
2011-10-27 06:44:11 +00:00
Eric Christopher
57c57a3260 Add a new wrapper node for a DILexicalBlock that encapsulates it and a
file. Since it should only be used when necessary propagate it through
the backend code generation and tweak testcases accordingly.

This helps with code like in clang's test/CodeGen/debug-info-line.c where
we have multiple #line directives within a single lexical block and want
to generate only a single block that contains each file change.

Part of rdar://10246360

llvm-svn: 141729
2011-10-11 22:59:11 +00:00
Eli Friedman
32d22b6d3f Fix this test so it doesn't fail on Mac.
llvm-svn: 140553
2011-09-26 19:13:47 +00:00
James Molloy
d63e75cd59 Fix emission of debug data for global variables. getContext() on DIGlobalVariables is not valid any more.
llvm-svn: 140539
2011-09-26 17:40:42 +00:00
Devang Patel
d8a51ce4a9 Update tests. Remove irrelevant tests.
llvm-svn: 139658
2011-09-13 23:07:41 +00:00
Devang Patel
e4127d626e Do not use named md nodes to track variables that are completely optimized. This does not scale while doing LTO with debug info. New approach is to include list of variables in the subprogram info directly.
llvm-svn: 138145
2011-08-19 23:28:12 +00:00
Rafael Espindola
969ed05524 Test for previous commit.
llvm-svn: 133256
2011-06-17 14:16:17 +00:00
Galina Kistanova
aff6b72fc4 Move test for appropriate directory.
llvm-svn: 133176
2011-06-16 18:13:57 +00:00
Rafael Espindola
9ce5cebde6 Fix a regression I recently introduced by removing DwarfRegNum of
subregisters:

When a value is in a subregister, at least report the location as being
the superregister. We should extend the .td files to encode the bit
range so that we can produce a DW_OP_bit_piece.

llvm-svn: 132224
2011-05-27 22:15:01 +00:00
Rafael Espindola
97c81eee80 Looks like OS X assemblers (including MC) don't like
foo:
bar = foo
.quad bar

Avoid producing it. Fixes PR9951.

llvm-svn: 131687
2011-05-19 22:05:56 +00:00
Rafael Espindola
522eee90c7 Move test.
llvm-svn: 131315
2011-05-13 21:35:17 +00:00
Rafael Espindola
962d964ea5 Move test.
llvm-svn: 131314
2011-05-13 21:33:32 +00:00
Rafael Espindola
9a6bbdcc7a Add triple.
llvm-svn: 131169
2011-05-10 23:14:29 +00:00
Rafael Espindola
ec3d43391f The EH symbols are only needed in eh_frame, not debug_frame.
llvm-svn: 131146
2011-05-10 19:51:53 +00:00
Rafael Espindola
92dc58fea6 Use .cfi_sections to put the unwind info in .debug_frame when possible. With
this clang will use .debug_frame in, for example,
clang -g -c -m32 test.c
This matches gcc's behaviour. It looks like .debug_frame is a bit bigger
than .eh_frame, but has the big advantage of not being allocated.

llvm-svn: 131140
2011-05-10 18:39:09 +00:00
Galina Kistanova
7371b0a61e Move few target-dependant tests to appropriate directories.
llvm-svn: 131002
2011-05-06 18:24:46 +00:00
Rafael Espindola
8346c59e6a Producing a DW_FORM_addr for DW_AT_stmt_list is probably correct, but
it is both inefficient and unexpected by dwarfdump. Change to
a DW_FORM_data4.

While in here, change the predicate name to reflect that the position
is not really absolute (it is an offset), just that the linker needs a
relocation.

llvm-svn: 130846
2011-05-04 17:44:06 +00:00
Chris Lattner
0304b82f80 Fix a ton of comment typos found by codespell. Patch by
Luis Felipe Strano Moraes!

llvm-svn: 129558
2011-04-15 05:18:47 +00:00
Devang Patel
7adf6f4b5c Add radar number for future reference.
llvm-svn: 129172
2011-04-08 23:52:04 +00:00
Devang Patel
39ac307002 Do not emit DW_AT_upper_bound and DW_AT_lower_bound for unbouded array.
If lower bound is more then upper bound then consider it is an unbounded array.
An array is unbounded if non-zero lower bound is same as upper bound.
If lower bound and upper bound are zero than array has one element.

llvm-svn: 129156
2011-04-08 21:55:10 +00:00
Devang Patel
c6ed54c434 Move test in x86 specific area.
llvm-svn: 128245
2011-03-24 22:39:09 +00:00
Devang Patel
4909f41ec5 Keep track of directory namd and fIx regression caused by Rafael's patch r119613.
A better approach would be to move source id handling inside MC.

llvm-svn: 128233
2011-03-24 20:30:50 +00:00
Devang Patel
7f687d8790 Remove obsolete tests.
llvm-svn: 126402
2011-02-24 19:09:52 +00:00
Devang Patel
bac565c8a3 Move arch specific tests in arch specific directories.
llvm-svn: 126401
2011-02-24 19:06:27 +00:00
Devang Patel
dad3193123 Hide tests, that check .loc, .file in output assembly, from darwin9 buildbot.
llvm-svn: 120750
2010-12-02 23:29:58 +00:00
Rafael Espindola
93a07b464e Change CodeGen to use .loc directives. This produces a lot more readable output
and testing is easier.  A good example is the unknown-location.ll test that
now can just look for ".loc 1 0 0".  We also don't use a DW_LNE_set_address for
every address change anymore.

llvm-svn: 119613
2010-11-18 02:04:25 +00:00
Jakob Stoklund Olesen
7c0c554397 FileCheckize
llvm-svn: 116581
2010-10-15 16:06:42 +00:00
Devang Patel
1f2abb3af0 Fix code gen crash reported in PR 8235. We still lose debug info for the unused argument here. This is a known limitation recorded debuginfo-tests/trunk/dbg-declare2.ll function 'f6' test case.
llvm-svn: 115323
2010-10-01 19:00:44 +00:00
Jim Grosbach
ad51f6522d Add target triple info to these tests to make the results comparable when
hosted on different platforms.

llvm-svn: 114965
2010-09-28 17:10:36 +00:00
Devang Patel
99777d1d07 If FE forgot to provide a file name (usually it uses "stdin" as name in such situation) then make one up to ensure that debug info is not malformed.
llvm-svn: 114119
2010-09-16 20:57:49 +00:00
Dan Gohman
1c24df6ecc Convert DbgInfoPrinter to use errs() instead of outs().
llvm-svn: 111659
2010-08-20 18:03:05 +00:00
Devang Patel
9801232716 Move x86 specific tests into test/CodeGen/X86.
llvm-svn: 110372
2010-08-05 20:25:37 +00:00
Devang Patel
754efda3aa Test case for combination of r110234 & r110235.
llvm-svn: 110238
2010-08-04 18:42:46 +00:00
Devang Patel
e401bfe168 Fix PR 7662.
Do not try to insert local variable info to a DIE used for function declaration.

llvm-svn: 108731
2010-07-19 17:53:55 +00:00
Devang Patel
93e5e9bd19 Add variables into a scope before constructing scope DIE otherwise variables won't be included DIE tree.
llvm-svn: 107228
2010-06-30 00:11:08 +00:00
Benjamin Kramer
d02a62bee2 Fix some tests that didn't test anything.
llvm-svn: 106954
2010-06-26 20:05:06 +00:00
Devang Patel
877e8c6da0 Be specific. Use FileCheck.
llvm-svn: 106135
2010-06-16 19:39:45 +00:00