Commit Graph

113632 Commits

Author SHA1 Message Date
Johnny Chen 6027c94d2f Add an SB API SBFrame::WatchValue() and exported to the Python interface to
set a watchpoint Pythonically.  If the find-and-watch-a-variable operation
fails, an invalid SBValue is returned, instead.

Example Python usage:

        value = frame0.WatchValue('global',
                                  lldb.eValueTypeVariableGlobal,
                                  lldb.LLDB_WATCH_TYPE_READ|lldb.LLDB_WATCH_TYPE_WRITE)

Add TestSetWatchpoint.py to exercise this API.
We have 400 test cases now.

llvm-svn: 140436
2011-09-24 00:50:33 +00:00
Douglas Gregor 52da28be50 Don't translate CRLF files into LF files. Fixes PR6870, from Aaron Ballman!
llvm-svn: 140435
2011-09-23 23:43:36 +00:00
Daniel Dunbar eb5348ac31 Driver: Use sys::Process::SetWorkingDirectory, for consistency.
llvm-svn: 140434
2011-09-23 23:32:02 +00:00
Daniel Dunbar 9b92e2be30 sys::Process: Add a SetWorkingDirectory method.
llvm-svn: 140433
2011-09-23 23:23:36 +00:00
Fariborz Jahanian 44653709fd objc - fixes a crash when undefined typed property
followed by it implementation crashes when attempt
is made to access the synthesized ivar. 
// rdar://10177744

llvm-svn: 140432
2011-09-23 23:11:38 +00:00
Andrew Trick 8b2fe2f744 LSR minor bug fix in RateRegister.
No test case. Noticed by inspection and I doubt it ever affects the
outcome of the overall heuristic, let alone final codegen.

llvm-svn: 140431
2011-09-23 23:05:19 +00:00
Chris Lattner ad4ab93e48 Duncan owns dragonegg too, it's all his fault :)
llvm-svn: 140430
2011-09-23 22:46:43 +00:00
Jakob Stoklund Olesen 3bb99bc957 Verify that terminators follow non-terminators.
This exposes a -segmented-stacks bug.

llvm-svn: 140429
2011-09-23 22:45:39 +00:00
Eli Friedman 8a15a5aa93 PR10998: It is not legal to sink an instruction past the terminator of a block; make sure we don't do that.
llvm-svn: 140428
2011-09-23 22:41:57 +00:00
Matt Beaumont-Gay d0457924e3 Fix a crash-on-invalid.
The token stream was not getting properly reset when leaving
ParseLexedMethodDef in some error cases. In the testcase, that caused later
accesses to the token stream to touch memory which had been freed as we
finished parsing the class definition. Major hat-tip to AddressSanitizer for
helping pinpoint the use-after-free, including the allocation and deallocation
points:

==21510== ERROR: AddressSanitizer heap-use-after-free on address 0x7feb3de87848 at pc 0x249f4e2 bp 0x7fff15a89df0 sp 0x7fff15a89ce0
READ of size 1 at 0x7feb3de87848 thread T0
  #0 0x249f4e2 clang::TokenLexer::Lex()
  #1 0x1c834a0 clang::Parser::ConsumeToken()
  #2 0x1c7dc0f clang::Parser::ParseDeclarationOrFunctionDefinition()
  #3 0x1c7e16b clang::Parser::ParseDeclarationOrFunctionDefinition()
<snip>
0x7feb3de87848 is located 1992 bytes inside of 3816-byte region [0x7feb3de87080,0x7feb3de87f68)
freed by thread T0 here:
  #0 0x3a22c19 free
  #1 0x1d136a1 clang::Parser::LexedMethod::~LexedMethod()
  #2 0x1cef528 clang::Parser::DeallocateParsedClasses()
  #3 0x1cef676 clang::Parser::PopParsingClass()
  #4 0x1cea094 clang::Parser::ParseCXXMemberSpecification()
  #5 0x1ce7ae5 clang::Parser::ParseClassSpecifier()
  #6 0x1cfe588 clang::Parser::ParseDeclarationSpecifiers()
  #7 0x1c7dbe8 clang::Parser::ParseDeclarationOrFunctionDefinition()
  #8 0x1c7e16b clang::Parser::ParseDeclarationOrFunctionDefinition()
<snip>
previously allocated by thread T0 here:
  #0 0x3a2302d realloc
  #1 0x39d7c97 llvm::SmallVectorBase::grow_pod()
  #2 0x1ac588e llvm::SmallVectorImpl<>::push_back()
  #3 0x1d12d8b clang::Parser::ConsumeAndStoreUntil()
  #4 0x1c9c24d clang::Parser::ConsumeAndStoreUntil()
  #5 0x1d12c1e clang::Parser::ConsumeAndStoreUntil()
  #6 0x1c9c24d clang::Parser::ConsumeAndStoreUntil()
  #7 0x1d10042 clang::Parser::ParseCXXInlineMethodDef()
  #8 0x1cec51a clang::Parser::ParseCXXClassMemberDeclaration()
  #9 0x1ce9de5 clang::Parser::ParseCXXMemberSpecification()
  #10 0x1ce7ae5 clang::Parser::ParseClassSpecifier()
  #11 0x1cfe588 clang::Parser::ParseDeclarationSpecifiers()
  #12 0x1c7dbe8 clang::Parser::ParseDeclarationOrFunctionDefinition()
  #13 0x1c7e16b clang::Parser::ParseDeclarationOrFunctionDefinition()
<snip>

llvm-svn: 140427
2011-09-23 22:39:23 +00:00
Owen Anderson 4916840eb8 Teach the Thumb2 AsmParser to accept pre-indexed loads/stores with an offset of #-0.
llvm-svn: 140426
2011-09-23 22:25:02 +00:00
Jakob Stoklund Olesen 2056d15bd9 Also match negative offsets for addrmode3 and addrmode5.
Math is hard, and isScaledConstantInRange() always returned false for
negative constants.  It was doing unsigned division of negative numbers
before casting back to signed.

llvm-svn: 140425
2011-09-23 22:10:33 +00:00
Douglas Gregor 27f58c2e66 Fix up assertion a bit more
llvm-svn: 140424
2011-09-23 22:07:41 +00:00
Owen Anderson b75772201f Fix incorrect disassembly test.
llvm-svn: 140423
2011-09-23 22:05:54 +00:00
Owen Anderson b0b865d658 Add more fixed bits to USAT16 encoding to filter out incorrect decodings.
llvm-svn: 140422
2011-09-23 21:57:50 +00:00
Johnny Chen 12e27887cb Add a simple regression test for 'target stop-hook list' with no target specified.
It should not crash lldb.

llvm-svn: 140421
2011-09-23 21:34:40 +00:00
Owen Anderson 737beaf86d Post-index loads/stores in still need to print the post-indexed immediate, even if it's zero, to distinguish them from non-post-indexed instructions.
llvm-svn: 140420
2011-09-23 21:26:40 +00:00
Jim Ingham 76bb759605 Added a test for problems caused when Clang errantly makes the line range for one line
too long, so that the jump from the line above the bad line to the line after
ends up in the middle of the bad line instead.  Added a workaround to lldb to just
continue to the end if we find ourselves stopped in the middle of some other line.

llvm-svn: 140419
2011-09-23 21:24:57 +00:00
Johnny Chen edf503757c Add a (bool)end_to_end parameter, default true, to the Target::Remove/Disable/EnableALLWatchpointLocations()
methods.  If passed as false, it signifies that only the debugger side is affected.

Modify Target::DeleteCurrentProcess() to use DisableAllWatchpointLocations(false) to
disable the watchpoint locations, instead of removing them between process instances.

llvm-svn: 140418
2011-09-23 21:21:43 +00:00
Jason Molenda effcd2aa70 in CommandObjectTargetStopHookList::Execute, if we don't have a target,
return before we try to dereference the target later in the function.
Currently,

% lldb -x
(lldb) target stop-hook list

crashes because of this.

llvm-svn: 140417
2011-09-23 21:15:42 +00:00
Jim Ingham 843bfb2c4e If stepping takes us from the line range we were stepping through into the MIDDLE of another line, then continue till we get to the real beginning of a line. This is mostly to work around debug information bugs.
llvm-svn: 140416
2011-09-23 21:08:11 +00:00
Owen Anderson 987a878946 Reapply r140412 (Thumb2 reg-reg loads cannot target SP or PC), with invalid testcases updated.
llvm-svn: 140415
2011-09-23 21:07:25 +00:00
Benjamin Kramer 333198cbd7 Driver: Explicitly include <unistd.h>, libstdc++'s <map> pulls it in, libc++ doesn't.
Also, on windows, chdir seems to live in <direct.h>.

llvm-svn: 140414
2011-09-23 21:03:19 +00:00
Owen Anderson ffa8428acf Revert r140412. This affects more instructions than intended.
llvm-svn: 140413
2011-09-23 21:02:01 +00:00
Owen Anderson 7591d0c363 Thumb2 register-shifted-register loads cannot target the PC or the SP.
llvm-svn: 140412
2011-09-23 21:00:32 +00:00
Matt Beaumont-Gay c9229a71ac Add DiagGroups to a couple of warnings.
llvm-svn: 140411
2011-09-23 20:56:58 +00:00
Daniel Dunbar db086f93dd Driver: Test case that was supposed to go with previous commit.
llvm-svn: 140410
2011-09-23 20:35:31 +00:00
Daniel Dunbar 10d398f894 Driver: Add a --working-directory option which can be used to cause the compiler
to operate "as if" in a certain working directory.
 - For now, we just implement this by changing the actual working directory, but
   eventually we would want to handle this transparently. This is useful to
   avoid an extra exec() pair in some situations, and will be something we would
   want to support for more flexibility in using the Clang libraries.

llvm-svn: 140409
2011-09-23 20:33:41 +00:00
Douglas Gregor 83dea558bc Add a test triple. Who knew that all the world wasn't darwin?
llvm-svn: 140408
2011-09-23 20:28:32 +00:00
David Blaikie aa347f9392 Removing a bunch of dead returns/breaks after llvm_unreachables.
llvm-svn: 140407
2011-09-23 20:26:49 +00:00
Douglas Gregor b1fa148837 Don't propagate the 'availability' attribute through declaration
merging for overrides. One might want to make a method's availability
in a superclass different from that of its subclass. Fixes
<rdar://problem/10166223>.

llvm-svn: 140406
2011-09-23 20:23:42 +00:00
Richard Trieu 021baa373f Add a new warning to -Wliteral-conversion to catch cases where a string literal
is cast to a boolean.  An exception has been made for string literals in
logical expressions to allow the common case of use in assert statements.

bool x;
x = "hi";  // Warn here
void foo(bool x);
foo("hi");  // Warn here
assert(0 && "error");
assert("error);  // Warn here

llvm-svn: 140405
2011-09-23 20:10:00 +00:00
Douglas Gregor 0c254a00c1 Clean up parsing the category names in interfaces slightly, using
MatchRHSPunctuation appropriately and giving a useful source location
for the complaint about attributes being added to a category.

llvm-svn: 140404
2011-09-23 19:19:41 +00:00
Anna Zaks ff7da05670 Move immutable map canonization out of the removeDeadBindings loop (via using ImmutableMapRef). Gives ~2% speedup.
llvm-svn: 140403
2011-09-23 19:14:09 +00:00
Anna Zaks 632bf5f084 Add getTreeFactory() to ImmutableSet to allow construction of ImmutableSetRef from an ImmutableSet object.
llvm-svn: 140402
2011-09-23 19:10:26 +00:00
Akira Hatanaka d6af2c62b4 Implement N32/64 calling convention. Patch by Liu.
llvm-svn: 140401
2011-09-23 19:08:15 +00:00
Douglas Gregor 34bc6e5ee4 When checking for weak vtables, check whether the actual definition of
the key function is inline, rather than the original
declaration. Perhaps FunctionDecl::isInlined() is poorly named. Fixes
<rdar://problem/9979458>. 

llvm-svn: 140400
2011-09-23 19:04:03 +00:00
Fariborz Jahanian c367b8f8cc objc-gc: Fix a corner case where clang fails to generate GC
write barrier with captured pointer to object. // rdar://10150823

llvm-svn: 140399
2011-09-23 18:57:30 +00:00
Johnny Chen 947961c151 Add test cases for watchpoint list, enable, disable, and delete commands.
llvm-svn: 140398
2011-09-23 18:42:28 +00:00
Akira Hatanaka ceb55e72de Make FGR64RegisterClass available if target is Mips64.
llvm-svn: 140397
2011-09-23 18:28:39 +00:00
Johnny Chen 3aa2889cc7 A second try to make the TestStopHookMechanism.py more robust after recent changes.
llvm-svn: 140396
2011-09-23 18:25:02 +00:00
Akira Hatanaka 77709a6793 Add definitions of 64-bit register files. Add code for returning Mips64's sets of
callee-saved registers and reserved registers.

llvm-svn: 140395
2011-09-23 18:11:56 +00:00
Justin Holewinski 71d32c980d PTX: Fix parameter order bug
llvm-svn: 140394
2011-09-23 17:59:11 +00:00
Johnny Chen 84128e640d Add a simple test case for 'help watchpoint', 'help watchpt-id', and 'help watchpt-id-list'.
llvm-svn: 140393
2011-09-23 17:57:49 +00:00
Johnny Chen 825815fbaf The "Stop Hooks" anchors have been removed from the stop-hook output.
Update the test case to fix test suite failure.

llvm-svn: 140392
2011-09-23 17:53:13 +00:00
Wesley Peck 24e45cabbc Fix a couple of 80 column violations.
patch contributed by Jia Liu!

llvm-svn: 140391
2011-09-23 17:24:41 +00:00
Justin Holewinski 6e84a68023 PTX: Cleanup unused code in PTXMachineFunctionInfo
llvm-svn: 140390
2011-09-23 17:15:53 +00:00
Douglas Gregor 0745ac8016 Fix up comment now that 'new' is no longer a virt-specifier, from Aaron Ballman
llvm-svn: 140389
2011-09-23 16:58:49 +00:00
Douglas Gregor 4c2e38fe1e Eliminate an MSVC comparison warning, from Aaron Ballman
llvm-svn: 140388
2011-09-23 16:57:55 +00:00
Justin Holewinski 0f1af22183 PTX: Fix another 80-column violation
llvm-svn: 140387
2011-09-23 16:50:35 +00:00