Commit Graph

7116 Commits

Author SHA1 Message Date
Ashok Thirumurthi 582133e88e Skipping a test that asserts with gcc and icc to allow the test suite to run to completion on the gcc buildbot.
llvm-svn: 181512
2013-05-09 14:46:01 +00:00
Ashok Thirumurthi a91a561571 Fixed a build failure introduced by r181501.
Patch by Yao Qi.

llvm-svn: 181511
2013-05-09 13:58:54 +00:00
Greg Clayton 6e0ff1a3cb Changed the formerly pure virtual function:
namespace lldb_private {
    class Thread
    {
        virtual lldb::StopInfoSP
        GetPrivateStopReason() = 0;
    };
}

To not be virtual. The lldb_private::Thread now handles the correct caching and will call a new pure virtual function:

namespace lldb_private {
    class Thread
    {
        virtual bool
        CalculateStopInfo() = 0;
    }
}

This function must be overridden by thead lldb_private::Thread subclass and the only thing it needs to do is to set the Thread::StopInfo() with the current stop reason and return true, or return false if there is no stop reason. The  lldb_private::Thread class will take care of calling this function only when it is required. This allows lldb_private::Thread subclasses to be a bit simpler and not all need to duplicate the cache and invalidation settings.

Also renamed:

lldb::StopInfoSP
lldb_private::Thread::GetPrivateStopReason();

To:

lldb::StopInfoSP
lldb_private::Thread::GetPrivateStopInfo();

Also cleaned up a case where the ThreadPlanStepOverBreakpoint might not re-set its breakpoint if the thread disappears (which was happening due to a bug when using the OperatingSystem plug-ins with memory threads and real threads).

llvm-svn: 181501
2013-05-09 01:55:29 +00:00
Enrico Granata 083fcdb414 Providing a more interesting command template for LLDB
This one actually exploits the SB API to obtain information about your inferior process

llvm-svn: 181500
2013-05-09 01:32:24 +00:00
Sean Callanan 04b2bfa3a9 Add all Decls found through FindExternalLexicalDecls
to the DeclContext.  This fulfils the contract that
we make with Clang by returning ELR_AlreadyLoaded.

This is a little aggressive in that it does not allow
the ASTImporter to import the child decls with any
lexical parent other than the Decl that reported them
as children.

<rdar://problem/13517713>

llvm-svn: 181498
2013-05-09 01:09:49 +00:00
Enrico Granata da144dc216 Changing the std::map test case to use source breakpoints instead of relying on the nexting always "getting it right" to stop at the locations of interest
This should make us more robust in the face of changing compiler line tables and other library modifications

llvm-svn: 181497
2013-05-09 01:04:59 +00:00
Jim Ingham 77e82d1ebd Fix the error reporting for ProcessKDP::DoDetach.
llvm-svn: 181493
2013-05-09 00:05:35 +00:00
Greg Clayton 65c163529d Fixed the process attach by name test to get the target _after_ doing process attach. Otherwise the target isn't valid. This fixes 2 test suite failures on darwin.
llvm-svn: 181488
2013-05-08 23:45:06 +00:00
Greg Clayton dbe445fdd8 Remove debug print statement.
llvm-svn: 181486
2013-05-08 23:37:59 +00:00
Andrew Kaylor 14263f31ae Adding code to set thread state to stopped when the process stops.
llvm-svn: 181482
2013-05-08 23:15:46 +00:00
Enrico Granata 068c11096a Now that you can "command script import" packages, the docs should reflect the best practice
llvm-svn: 181475
2013-05-08 21:39:19 +00:00
Greg Clayton 610f9260fa Quiet g++-4.7 warnings about const issues and fix the scope of the "if (IsValid())".
llvm-svn: 181474
2013-05-08 21:35:24 +00:00
Enrico Granata b7d6e2a4e0 Test case added for importing packages
llvm-svn: 181472
2013-05-08 21:26:37 +00:00
Enrico Granata cc7f9bf51e <rdar://problem/13621080>
This commit changes the ${function.name-with-args} prompt keyword to also tackle structs
Previously, since aggregates have no values, this would show up as foo=(null)
This checkin changes that to instead print foo=(Foo at 0x123) (i.e. typename at address)
There are other potential choices here (summary, one-liner printout of all members, ...) and I would love to hear feedback about better options, if any

llvm-svn: 181462
2013-05-08 20:27:37 +00:00
Enrico Granata e1432cfe4c Improvements to the package importing feature - test case will follow
llvm-svn: 181461
2013-05-08 20:25:10 +00:00
Matt Kopec 23f23f4b7a Update lldb status page to reflect watchpoint support on Linux.
llvm-svn: 181460
2013-05-08 19:45:07 +00:00
Matt Kopec 4fadea28d1 Mark multi-threaded watchpoint test as skip on Linux due to lldb assertions in the debian buildbot.
llvm-svn: 181454
2013-05-08 17:52:17 +00:00
Matt Kopec 52c8476a47 Fix assertion from previous fix for debian os watchpoints.
Also mark one of the tests as expected fail on Linux due to the debian fix.

llvm-svn: 181448
2013-05-08 16:52:34 +00:00
Matt Kopec 667f12b53d Attempt to fix failing watchpoints for debian os buildbot.
llvm-svn: 181447
2013-05-08 16:10:09 +00:00
Daniel Malea 5d3e8a62e0 Remove distinction between Apple/Linux for Process run locks:
- Played with the current dual run lock implementation for a few days, noticed
  no regressions, so enabling in trunk so we see if any problems are detected
  by buildbots.

llvm-svn: 181446
2013-05-08 15:46:04 +00:00
Daniel Malea ee6481273e Adding test-case for llvm.org/pr15936 (known failure with GCC 4.6/4.7)
- verify that backtraces for stacks that include functions which contain 
  illegal instructions are correct, and that variables in said functions can be
  printed.

llvm-svn: 181442
2013-05-08 15:09:30 +00:00
Daniel Malea 32052b62ae Fix rdar-13338477 test-case for Linux.
- Using __builtin_trap confuses the stack unwinder
- __builtin_trap specific test will be added shortly

llvm-svn: 181441
2013-05-08 15:07:24 +00:00
Sean Callanan 1aee70b773 Fixed IRExecutionUnit build failures due to changes
in the underlying llvm::JITMemoryManager API.

llvm-svn: 181387
2013-05-08 01:30:52 +00:00
Jim Ingham 55d24311f2 If the MemoryCache is asked to look up an address that is in an invalid
range, it should set the error in the Error passed into the function.

llvm-svn: 181386
2013-05-08 01:20:53 +00:00
Jim Ingham 221d51cf84 Figure out the reply to "PlanExplainsStop" once when we stop and then use the cached
value.  This fixes problems, for instance, with the StepRange plans, where they know that
they explained the stop because they were at their "run to here" breakpoint, then deleted
that breakpoint, so when they got asked again, doh!  I had done this for a couple of plans
in an ad hoc fashion, this just formalizes it.

Also add a "ResumeRequested" in Process so that the code in the completion handlers can
tell the ShouldStop logic they want to resume rather than just directly resuming.  That allows 
us to handle resuming in a more controlled fashion.

Also, SetPublicState can take a "restarted" flag, so that it doesn't drop the run lock when
the target was immediately restarted.
--This line, and those below , will be ignored--

M    test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py
M    include/lldb/Target/ThreadList.h
M    include/lldb/Target/ThreadPlanStepOut.h
M    include/lldb/Target/Thread.h
M    include/lldb/Target/ThreadPlanBase.h
M    include/lldb/Target/ThreadPlanStepThrough.h
M    include/lldb/Target/ThreadPlanStepInstruction.h
M    include/lldb/Target/ThreadPlanStepInRange.h
M    include/lldb/Target/ThreadPlanStepOverBreakpoint.h
M    include/lldb/Target/ThreadPlanStepUntil.h
M    include/lldb/Target/StopInfo.h
M    include/lldb/Target/Process.h
M    include/lldb/Target/ThreadPlanRunToAddress.h
M    include/lldb/Target/ThreadPlan.h
M    include/lldb/Target/ThreadPlanCallFunction.h
M    include/lldb/Target/ThreadPlanStepOverRange.h
M    source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.h
M    source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp
M    source/Target/StopInfo.cpp
M    source/Target/Process.cpp
M    source/Target/ThreadPlanRunToAddress.cpp
M    source/Target/ThreadPlan.cpp
M    source/Target/ThreadPlanCallFunction.cpp
M    source/Target/ThreadPlanStepOverRange.cpp
M    source/Target/ThreadList.cpp
M    source/Target/ThreadPlanStepOut.cpp
M    source/Target/Thread.cpp
M    source/Target/ThreadPlanBase.cpp
M    source/Target/ThreadPlanStepThrough.cpp
M    source/Target/ThreadPlanStepInstruction.cpp
M    source/Target/ThreadPlanStepInRange.cpp
M    source/Target/ThreadPlanStepOverBreakpoint.cpp
M    source/Target/ThreadPlanStepUntil.cpp
M    lldb.xcodeproj/xcshareddata/xcschemes/Run Testsuite.xcscheme

llvm-svn: 181381
2013-05-08 00:35:16 +00:00
Jason Molenda fa76156064 Add code to ReplaceDSYMSectionsWithExecutableSections() to handle the case where
a new section is added to the executable after the dSYM has been created, e.g.
the CTF segment added to mach_kernel after all other linking and processing has
been finished.
<rdar://problem/13258780> 

llvm-svn: 181375
2013-05-07 22:55:04 +00:00
Andrew Kaylor bf9b4c171a Adding support for process attach by pid on Linux.
llvm-svn: 181374
2013-05-07 22:46:38 +00:00
Enrico Granata 78f05f13ad Adding some LLDB-specific logic to the tracer (in a separate tracer module) to improve the quality of the output when debugging data formatters
(more improvements are necessary before this is really legible)

llvm-svn: 181367
2013-05-07 21:42:18 +00:00
Enrico Granata c8b36f160c First iteration of a Python tracer module
This module uses Python's sys.settrace() mechanism so setup a hook that can log every significant operation
This is a first step in providing a good debugging experience of Python embedded in LLDB
This module comprises an OO infrastructure that wraps Python's tracing and inspecting mechanisms, plus a very simple logging tracer
Output from this tracer looks like:

call print_keyword_args from <module> @ 243 args are kwargs are {'first_name': 'John', 'last_name': 'Doe'}
running print_keyword_args @ 228 locals are {'kwargs': {'first_name': 'John', 'last_name': 'Doe'}}
running print_keyword_args @ 229 locals are {'key': 'first_name', 'value': 'John', 'kwargs': {'first_name': 'John', 'last_name': 'Doe'}}
first_name = John
running print_keyword_args @ 228 locals are {'key': 'first_name', 'value': 'John', 'kwargs': {'first_name': 'John', 'last_name': 'Doe'}}
running print_keyword_args @ 229 locals are {'key': 'last_name', 'value': 'Doe', 'kwargs': {'first_name': 'John', 'last_name': 'Doe'}}
last_name = Doe
running print_keyword_args @ 228 locals are {'key': 'last_name', 'value': 'Doe', 'kwargs': {'first_name': 'John', 'last_name': 'Doe'}}
return from print_keyword_args value is None locals are {'key': 'last_name', 'value': 'Doe', 'kwargs': {'first_name': 'John', 'last_name': 'Doe'}}

llvm-svn: 181343
2013-05-07 19:49:59 +00:00
Matt Kopec e9ea0da82e Add watchpoint support for Linux on 64-bit host.
llvm-svn: 181341
2013-05-07 19:29:28 +00:00
Andrew Kaylor ba4e61d3f5 Reinstating r181091 and r181106 with fix for Linux regressions.
llvm-svn: 181340
2013-05-07 18:35:34 +00:00
Ashok Thirumurthi f5b92402bf Temporarily reverting r181091 and r181106 due to the vast test breakage on the Linux buildbots
while we develop a better understanding of how to manage the thread lists in a platform-independant fashion.

Reviewed by: Daniel Malea

llvm-svn: 181323
2013-05-07 15:01:34 +00:00
Enrico Granata e5cc5cd5ac Making it possible to specify a substring for a category name as long as the match is unique
llvm-svn: 181281
2013-05-07 00:36:28 +00:00
Jason Molenda a8ea4bae08 In ProcessKDP, if the remote connection is not EFI,
force this to be a DynamicLoaderDarwinKernel debug
session even if we didn't get back a load address
for the kernel.

llvm-svn: 181264
2013-05-06 23:02:03 +00:00
Enrico Granata 6e088d810e <rdar://problem/13063912>
If the user pressed ^D, that would bypass the exit confirmation mechanism
This checkin remedies that by making sure that users get prompted on exit when appropriate even if they use CTRL+D instead of typing quit at the prompt

llvm-svn: 181257
2013-05-06 22:10:33 +00:00
Daniel Malea 0b7c611f56 Fix typo in C++11 flag for the GCC 4.6 code path: missing '-'
llvm-svn: 181239
2013-05-06 19:31:31 +00:00
Enrico Granata 14b74fd153 <rdar://problem/11669154>
Make a summary format for libc++ STL containers that shows the number of items as before, but also shows the pointer value for pointer-to-container

llvm-svn: 181236
2013-05-06 18:55:52 +00:00
Enrico Granata 36aa5ae625 Converting ScanFormatDescriptor to use std::string instead of a manually managed buffer of bytes
llvm-svn: 181218
2013-05-06 17:18:22 +00:00
Jason Molenda db7d11c7a2 A few small fixes to make things like image list not
print "//mach_kernel" if you are debugging an executable
in the top level directory.

llvm-svn: 181190
2013-05-06 10:21:11 +00:00
Jason Molenda 513db4d9f4 Change ProcessKDP::UpdateThreadList's call to FindThreadByProtocolID
to not let it update the thread list or else we'll infinite recurse
call back to UpdateThreadList.

llvm-svn: 181106
2013-05-04 05:51:02 +00:00
Greg Clayton 1b7746e383 After recent OperatingsSystem plug-in changes, the lldb_private::Process and lldb_private::Thread subclasses were changed and the API was not respected properly.
This checkin aims to fix this. The process now has two thread lists: a real thread list for threads that are created by the lldb_private::Process subclass, and the user visible threads. The user visible threads are the same as the real threas when no OS plug-in in used. But when an OS plug-in is used, the user thread can be a combination of real and "memory" threads. Real threads can be placed inside of memory threads so that a thread appears to be different, but is still controlled by the actual real thread. When the thread list needs updating, the lldb_private::Process class will call the: lldb_private::Process::UpdateThreadList() function with the old real thread list, and the function is expected to fill in the new real thread list with the current state of the process. After this function, the process will check if there is an OS plug-in being used, and if so, it will give the old user thread list, the new real thread list and the OS plug-in will create the new user thread list from both of these lists. If there is no OS plug-in, the real thread list is the user thread list.

These changes keep the lldb_private::Process subclasses clean and no changes are required.

llvm-svn: 181091
2013-05-04 01:38:48 +00:00
Jason Molenda fe806906d4 fix a couple of clang static analyzer warnings.
Most important was a new[] + delete mismatch in ScanFormatDescriptor()
and a couple of possible memory leaks in FileSpec::EnumerateDirectory().

llvm-svn: 181080
2013-05-04 00:39:52 +00:00
Jason Molenda c16b4af0d7 Remove the UUID::GetAsCString() method which required a buffer to save the
UUID string in; added UUID::GetAsString() which returns the uuid string in
a std::string.  Updated callers to use the new method.

llvm-svn: 181078
2013-05-03 23:56:12 +00:00
Enrico Granata 3880c4cebd Don’t use the resolved value to calculate the location unless the variable is in a register
This was causing a bunch of test cases to fail in python_api/process since they relied on SBValue::GetLocation()

llvm-svn: 181075
2013-05-03 23:28:47 +00:00
Greg Clayton b23b11300a Unbreak lldb/test/macosx/universal.
llvm-svn: 181074
2013-05-03 23:22:20 +00:00
Greg Clayton 5fe0e7b2f6 Fixed a test suite typo error that caused the test to fail.
llvm-svn: 181069
2013-05-03 23:04:47 +00:00
Jim Ingham a8ca6e2145 Don't check the private state in DoOnRemoval, check whether THIS event caused a restart.
rdar://problem/13788593

llvm-svn: 181068
2013-05-03 23:04:37 +00:00
Jason Molenda 60e58967f9 Small adjustment to PlatformDarwinKernel::ExamineKextForMatchingUUID to
help performance -- if the FileSpec we're examining does not contain the
UUID we're looking for, don't bother examining the file any further.

llvm-svn: 181063
2013-05-03 22:28:10 +00:00
Greg Clayton aa49c83cd9 Clear up any deadlocks on Apple builds that were due to the lldb_private::Process.m_private_run_lock variable.
If someone on Linux and/or FreeBSD can try to comment out the " #if defined(__APPLE__)" that surrounds access to "m_private_run_lock" and run the test suite, that would be nice. The new location where the locking/unlocking happens is bulletproof on MacOSX, and I want to verify that it is good on linux as well.

llvm-svn: 181061
2013-05-03 22:25:56 +00:00
Ashok Thirumurthi d36712df8d Refactoring for struct UserArea:
- Decouples RegisterContext_x86_64 from UserArea.
- Restores the original definition of UserArea so that it can be used to generate offsets for use with ptrace.
- Moves UserArea to the 64-bit Linux specialization.

- Also fixes an off-by-one error for the size of m_gpr.
- Also adds a TODO comment noting the need for a mechanism to identify the correct plugin based on the target OS (and architecture).

Reviewed by: Matt Kopec and Samuel Jacob

llvm-svn: 181055
2013-05-03 20:00:17 +00:00
Andrew Kaylor 3a8625dda9 Fix logic error in ProcessInfo::SetArg0
llvm-svn: 181049
2013-05-03 19:38:09 +00:00
Enrico Granata 4ffff2791f Harden against potential empty nodes in the map
llvm-svn: 181045
2013-05-03 19:07:20 +00:00
Enrico Granata d03a273b96 <rdar://problem/13749871>
Improvements to the std::map data formatter to recognize when invalid memory is being explored and bail out instead of looping for a potentially very long time

llvm-svn: 181044
2013-05-03 19:04:35 +00:00
Greg Clayton 6991afe31b Added a few things that need to be installed on linux to build LLDB.
llvm-svn: 181028
2013-05-03 16:29:42 +00:00
Ashok Thirumurthi d77e8aefe3 Fixed 'command script import' by eliminating the shadowing of basename.
Reviewed by: Daniel Malea

llvm-svn: 181027
2013-05-03 15:56:59 +00:00
Sylvestre Ledru 5b5a6e0162 Fixed the build to reflect the removal of OperatingSystem/Darwin-Kernel in r180993.
llvm-svn: 181024
2013-05-03 15:28:03 +00:00
Ashok Thirumurthi 72b4c8dce3 Fixed the build to reflect the removal of OperatingSystem/Darwin-Kernel in r180993.
llvm-svn: 181018
2013-05-03 14:45:11 +00:00
Jason Molenda 9dbe9e630e Add a hard limit to how many frames lldb will unwind in a single
thread before UnwindLLDB::AddOneMoreFrame calls it quits.  We have
a couple of reports of unending backtraces in the field and we
haven't been able to collect any information about what kind of
backtrace is causing this.  We've found on Mac OS X that it's tricky
to get more than around 200k stack frames before a process exceeds
its stack space so we're starting with a hard limit of 300,000 frames.
<rdar://problem/13383069> 

llvm-svn: 180995
2013-05-03 04:48:41 +00:00
Jason Molenda 90e536caf7 Remove the initialization/termination of the now-removed OperatingSystemDarwinKernel.
llvm-svn: 180994
2013-05-03 03:55:48 +00:00
Greg Clayton e26dcbddda Remove unused OperatingSystem plugin.
llvm-svn: 180993
2013-05-03 03:05:52 +00:00
Jason Molenda 0faf3311fa Pass down the architecture of the module we're trying to
match when looking at kext on the local filesystem.
<rdar://problem/13785112> 

llvm-svn: 180989
2013-05-03 01:31:44 +00:00
Enrico Granata c3387333ce <rdar://problem/11742979>
SWIG is smart enough to recognize that C++ operators == and != mean __eq__ and __ne__ in Python and do the appropriate translation
But it is not smart enough to recognize that mySBObject == None should return False instead of erroring out
The %pythoncode blocks are meant to provide those extra smarts (and they play some SWIG&Python magic to find the right function to call behind the scenes with no risk of typos :-)
Lastly, SBBreakpoint provides an == but never provided a != operator - common courtesy is to provide both

llvm-svn: 180987
2013-05-03 01:29:27 +00:00
Greg Clayton a80ea12703 <rdar://problem/13751683>
Make sure to handle all thumb variants correctly.

llvm-svn: 180984
2013-05-03 01:05:04 +00:00
Andrew Kaylor 46791da61a Adding test for non-API process attach
llvm-svn: 180977
2013-05-03 00:10:27 +00:00
Enrico Granata bfa9fb134b <rdar://problem/11558812>
Allow command script import to load packages.

e.g.:
egranata$ ./lldb
(lldb) command script import lldb.macosx.crashlog
"crashlog" and "save_crashlog" command installed, use the "--help" option for detailed help
"malloc_info", "ptr_refs", "cstr_refs", and "objc_refs" commands have been installed, use the "--help" options on these commands for detailed help.
The "unwind-diagnose" command has been installed, type "help unwind-diagnose" for detailed help.
(lldb) 

./lldb
(lldb) command script import theFoo
I am happy
(lldb) fbc
àèìòù
(lldb)

egranata$ ls theFoo/
__init__.py theBar.py

egranata$ cat theFoo/__init__.py 
import lldb
import theBar

def __lldb_init_module(debugger, internal_dict):
	print "I am happy"
	debugger.HandleCommand("command script add -f theFoo.theBar.theCommand fbc")
	return None

egranata$ cat theFoo/theBar.py 
#encoding=utf-8

def theCommand(debugger, command, result, internal_dict):
	result.PutCString(u"àèìòù")
	return None

llvm-svn: 180975
2013-05-02 23:57:33 +00:00
Jim Ingham 076b7fc608 If HandleCommands is called with add_to_history set to false, turn on the m_command_source_depth so that when we forget the value for regex & alias commands it still stays off.
<rdar://problem/13795202>

llvm-svn: 180971
2013-05-02 23:15:37 +00:00
Enrico Granata 78081be1be <rdar://problem/13732521>
Updated the logic for the Sketch test case

llvm-svn: 180966
2013-05-02 22:40:22 +00:00
Greg Clayton 5378bbaec0 Mark TestConstVariables as expected to fail due to radar 13314878 on darwin. The tests are already skipped on linux.
llvm-svn: 180965
2013-05-02 22:19:05 +00:00
Greg Clayton 864fa8c085 <rdar://problem/13788674>
TestPlatformCommand failing on buildbot.

llvm-svn: 180963
2013-05-02 22:07:16 +00:00
Jason Molenda a4ce253819 If the Target's current architecture is incompatible with the kernel
DynamicLoaderDarwinKernel finds in memory, have DynamicLoaderDarwinKernel
re-set the Target's arch based on the kernel's cpu type / cpu subtype.

llvm-svn: 180962
2013-05-02 22:02:57 +00:00
Greg Clayton 6ad5269558 <rdar://problem/13788579>
TestRegisters failing on buildbot on MacOSX. Some registers that were valid for linux/freebsd, were not valid on MacOSX. The tests now allow a register be skipped if it doesn't exist on the host.

llvm-svn: 180961
2013-05-02 22:00:02 +00:00
Daniel Malea 55faa40823 Fix check_public_api_headers test on mac os x, and refactor some logic into lldbtest.py
- moved build logic from Makefile and TestPublicAPIHeaders.py into lldbtest to allow reuse
- added decorator @skipIfi386

llvm-svn: 180955
2013-05-02 21:44:31 +00:00
Daniel Malea c7da5d0122 Add missing include to LLDB.h -- SBStream
llvm-svn: 180954
2013-05-02 21:42:13 +00:00
Ashok Thirumurthi 759a217dab Changing the test to use eax rather than rax for compatibility with i386.
llvm-svn: 180952
2013-05-02 21:15:23 +00:00
Enrico Granata a9a50ffb02 <rdar://problem/13338477>
clang sugarcoats expressions of the sort *(int (*)[3])foo where foo is an int* saying that their type class is Paren
This checkin updates our lookup tables to properly desugar Paren into the actual type of interest

llvm-svn: 180938
2013-05-02 18:54:54 +00:00
Enrico Granata e55f77aec8 <rdar://problem/13499317>
Enabling Python commands to produce Unicode output via:

result.PutCString(u”whatever”)

llvm-svn: 180930
2013-05-02 17:29:04 +00:00
Greg Clayton 05e2c79f87 We aren't ready for the assertions to be enabled on the ReadWriteLock classes yet.
llvm-svn: 180928
2013-05-02 17:17:05 +00:00
Greg Clayton 4fea4f27e3 Clear the register context if our process is no longer alive.
llvm-svn: 180927
2013-05-02 17:16:00 +00:00
Jim Ingham c56781fffa This is a useful scheme for running a particular testsuite case under Xcode. Just edit the
run arguments to include the directory of the test you want to run, and run the scheme.

llvm-svn: 180926
2013-05-02 17:04:10 +00:00
Daniel Malea 5eff59e74c Update CMakeLists with RegisterContext* files added
llvm-svn: 180920
2013-05-02 15:23:53 +00:00
Greg Clayton bca31a3d64 Correctly create the register contexts in RegisterContextThreadMemory.
llvm-svn: 180908
2013-05-02 04:15:24 +00:00
Sean Callanan 3fa3e65d3b Since the IR interpreter does not (currently)
support operands with vector types, it now reports
that it cannot interpret expressions that use
vector types.  They get sent to the JIT instead.

<rdar://problem/13733651>

llvm-svn: 180899
2013-05-02 00:33:44 +00:00
Jim Ingham acff895015 Recommitting r180831 with trivial fix - remember to return errors if you compute.
llvm-svn: 180898
2013-05-02 00:27:30 +00:00
Greg Clayton 7060f8976c Return zero when we don't support the byte size. Previously is we were asked to read 3, 5, 6, or 7 byte integers, we would set the error, but still return that we read that number of bytes without populating the scalar.
llvm-svn: 180896
2013-05-01 23:41:30 +00:00
Sean Callanan 16f45ca6ba Make our eliding of artificially-generated methods
in debug information more aggressive.  Emitting
classes containing these methods causes crashes in
Clang when dealing with complex code bases.

<rdar://problem/12640887>

llvm-svn: 180895
2013-05-01 23:18:34 +00:00
Sean Callanan 7f13bd7678 Fixed Process::ReadScalarIntegerFromMemory()
to report proper errors when the size is not
correct.

<rdar://problem/13784456>

llvm-svn: 180888
2013-05-01 22:01:40 +00:00
Greg Clayton 160c9d81e0 <rdar://problem/13700260>
<rdar://problem/13723772>

Modified the lldb_private::Thread to work much better with the OperatingSystem plug-ins. Operating system plug-ins can now return have a "core" key/value pair in each thread dictionary for the OperatingSystemPython plug-ins which allows the core threads to be contained with memory threads. It also allows these memory threads to be stepped, resumed, and controlled just as if they were the actual backing threads themselves.

A few things are introduced:
- lldb_private::Thread now has a GetProtocolID() method which returns the thread protocol ID for a given thread. The protocol ID (Thread::GetProtocolID()) is usually the same as the thread id (Thread::GetID()), but it can differ when a memory thread has its own id, but is backed by an actual API thread.
- Cleaned up the Thread::WillResume() code to do the mandatory parts in Thread::ShouldResume(), and let the thread subclasses override the Thread::WillResume() which is now just a notification.
- Cleaned up ClearStackFrames() implementations so that fewer thread subclasses needed to override them
- Changed the POSIXThread class a bit since it overrode Thread::WillResume(). It is doing the wrong thing by calling "Thread::SetResumeState()" on its own, this shouldn't be done by thread subclasses, but the current code might rely on it so I left it in with a TODO comment with an explanation.

llvm-svn: 180886
2013-05-01 21:54:04 +00:00
Ashok Thirumurthi 0f3b9b819a Build fixes for FreeBSD 9.1.
- TODO: Support extended register sets on FreeBSD.

Patch by Samuel Jacob.

llvm-svn: 180879
2013-05-01 20:38:19 +00:00
Ashok Thirumurthi e4a862f794 Platform-specific specialization for the GPR register file.
- Required for platform-independant handling of general purpose registers (i.e. for core dumps).

Thanks to Samuel Jacob for this patch.

llvm-svn: 180878
2013-05-01 20:17:59 +00:00
Ashok Thirumurthi fa6e1f94a4 Refactored convenience register tests to provide some coverage on Linux that is not marked xfail.
- Also minor improvements to the comments and the expected results.

llvm-svn: 180876
2013-05-01 20:07:13 +00:00
Daniel Malea 7f3859538f Revert 180829 as it causes hangs in TestTypeCompletion.py on 2 Linux buildbots:
http://lab.llvm.org:8011/builders/lldb-x86_64-linux/builds/3810
http://lab.llvm.org:8011/builders/lldb-x86_64-debian-clang/builds/2754

llvm-svn: 180870
2013-05-01 19:14:30 +00:00
Daniel Malea 54e39db805 Reverting 180831 as it crashes TestDefaultConstructorForAPIObjects.py
llvm-svn: 180868
2013-05-01 19:11:56 +00:00
Jason Molenda 59d55219cf Change CommandReturnObject::AppendMessage to print an empty line if
AppendMessage("") is called.  This idiom is used in a handful of places
right now (e.g. to put space between different threads in 'bt all') but
the empty newline is being omitted instead of emitted.
<rdar://problem/13753830> 

llvm-svn: 180841
2013-05-01 08:37:52 +00:00
Jason Molenda 64dd73e5e1 Print a backtrace line for a pc value even if we can't make an SBAddress
out of it.

llvm-svn: 180835
2013-05-01 01:26:52 +00:00
Sean Callanan 99c272d3eb TestCallCPPFunction is an expected failure on
Linux; marking as such.

llvm-svn: 180832
2013-04-30 23:52:02 +00:00
Jim Ingham a23f73dbbc Added an option to "process detach" to keep the process stopped, if the process plugin (or in the
case of ProcessGDBRemote the stub we are talking to) know how to do that.

rdar://problem/13680832

llvm-svn: 180831
2013-04-30 23:46:08 +00:00
Jim Ingham 3ca3cd1ed7 Add an option to resume a suspended task.
llvm-svn: 180830
2013-04-30 23:43:52 +00:00
Jim Ingham 2d386b35eb Make "process handle -n true -s false" actually notifies of the signal.
rdar://problem/12020085

llvm-svn: 180829
2013-04-30 23:42:24 +00:00
Andrew Kaylor 9f6c535b0d Refactoring thread state tests to show individual failures
llvm-svn: 180828
2013-04-30 23:39:14 +00:00
Jason Molenda 14c84cdb9c Put a try/catch block around the SBAddress setting; don't want to
terminate the command early if we happen to have an invalid load
address.

llvm-svn: 180826
2013-04-30 23:03:56 +00:00
Jason Molenda cc6dc78046 Make the warning message about not finding the kernel binary clearer
about which kernel binary lldb is referring to.

llvm-svn: 180821
2013-04-30 22:38:28 +00:00
Greg Clayton 8363325962 <rdar://problem/13776113>
Dynamic type resolution not working for typedef's such as the __ptr_ member in the C++11 std::shared_ptr.

llvm-svn: 180818
2013-04-30 22:29:29 +00:00
Sean Callanan 8d285ada3d Added a test case verifying that simple C++
functions can be called by basename.

<rdar://problem/13709855>

llvm-svn: 180814
2013-04-30 22:05:15 +00:00
Sean Callanan 9b7005bf42 RegisterValues can now report their contents as
UInts even if their contents were set as bytes.
This makes expressions using registers work
better, especially with core files.

<rdar://problem/13743427>

llvm-svn: 180810
2013-04-30 21:41:44 +00:00
Enrico Granata 82fabf89b4 <rdar://problem/13695846>
Enabling LLDB to write to variables that are stored in registers
Previously, this would not work since the Value's Context loses the notion of the data being in a register
We now store an "original" context that comes out of DWARF parsing, and use that context's data when attempting a write

llvm-svn: 180803
2013-04-30 20:45:04 +00:00
Jason Molenda f7305a6103 Rename unwind_diagnose.py to diagnose_unwind.py. Change
finish-swig-Python-LLDB.sh to create a new lldb.diagnose subdirectory
in the LLDB framework; the first diagnostic command in this directory
is diagnose-unwind.  There may be others added in the future.

Users can load these diagnostic tools into their session with 
"script import lldb.diagnose".

llvm-svn: 180768
2013-04-30 03:03:06 +00:00
Sean Callanan 116ace2125 Fixed a problem where the expression parser would
give up if it couldn't find the address for the
first symbol it found with a particular name and
type.

<rdar://problem/13748253>

llvm-svn: 180764
2013-04-30 00:21:42 +00:00
Sean Callanan 1c27616226 Fixed completion of incomplete array types, fixing
an assertion if we attempted to get the size of one.

<rdar://problem/13748253>

llvm-svn: 180763
2013-04-30 00:20:10 +00:00
Greg Clayton 46c2b6e605 lldb_private::StopInfo now holds onto a ThreadWP (a std::weak_ptr<lldb_private::Thread>) in case the thread goes away while the stop info still exists.
llvm-svn: 180749
2013-04-29 23:30:46 +00:00
Enrico Granata d987cdf123 Avoiding a potentially memory allocating code path in the Python InputReader's CTRL+C handling code path - this can potentially cause a deadlock while interrupting a user-made Python command
llvm-svn: 180726
2013-04-29 19:38:17 +00:00
Greg Clayton b5ad4ec7a3 Cleanup logging to use the new "std::string FileSpec::GetPath()" function. Also added a similar function for modules:
std::string
Module::GetSpecificationDescription () const;

This returns the module as "/usr/lib/libfoo.dylib" for normal files (calls "std::string FileSpec::GetPath()" on m_file) but it also might include the object name in case the module is for a .o file in a BSD archive ("/usr/lib/libfoo.a(bar.o)"). Cleaned up necessary logging code to use it.

llvm-svn: 180717
2013-04-29 17:25:54 +00:00
Greg Clayton a44c1e6b63 Don't return a reference to a local variable, and removed a redundant API.
llvm-svn: 180713
2013-04-29 16:36:27 +00:00
Jason Molenda 7cd81c55c7 When lldb stops in a stack frame where we have source level information (file, line number), don't
print the disassembly context around $pc -- just print the filename and line number, even if we 
can't show the source code.  Previously if the source file was not available, lldb would print
the source filename & line number and assembly.  
<rdar://problem/13072951> 

llvm-svn: 180706
2013-04-29 09:59:31 +00:00
Jason Molenda 92a2ddabd1 Add a final fall-back to PlatformDarwin::GetDeveloperDirectory() which
will run xcode-select --print-path to find the currently selected 
Xcode developer directory.  Mostly useful for when lldb is not being run out
of the /Applications/Xcode.app bundle so it can't locate the iOS or
kernel SDKs.

llvm-svn: 180705
2013-04-29 09:48:26 +00:00
Jason Molenda a7ae4673c7 Add a few new methods to FileSpec to make it a little easier to work
with directories, without increasing the size of the FileSpec object.
GetPath() returns a std::string of the full pathname of the file.
IsDirectory(), IsPipe(), IsRegularFile(), IsSocket(), and IsSymbolicLink()
can be used instead of getting the FileType() and comparing it to an enum.

Update PlatformDarwinKernel to use these new methods.

llvm-svn: 180704
2013-04-29 09:46:43 +00:00
Sean Callanan df56540a58 Performance optimizations to ClangUserExpression,
mostly related to management of the stack frame
for the interpreter.

  - First, if the expression can be interpreted,
    allocate the stack frame in the target process
    (to make sure pointers are valid) but only
    read/write to the copy in the host's memory.

  - Second, keep the memory allocations for the
    stack frame and the materialized struct as
    member variables of ClangUserExpression.  This
    avoids memory allocations and deallocations
    each time the expression runs.

<rdar://problem/13043685>

llvm-svn: 180664
2013-04-27 02:19:33 +00:00
Sean Callanan 956dca9288 Fixed a crash when we tried dyn_cast<>ing a
null pointer.

<rdar://problem/13745684>

llvm-svn: 180663
2013-04-27 01:57:44 +00:00
Sean Callanan a30b5b7a97 Fixed the anonymous testcase. It was testing
access to 'z' where 'z' was not in scope.

llvm-svn: 180662
2013-04-27 01:53:20 +00:00
Enrico Granata cd67f97cb7 <rdar://problem/12529989>
Synthetic children provider for NSOrderedSet

llvm-svn: 180655
2013-04-27 00:27:20 +00:00
Sean Callanan e5270598ba Hardening to avoid null-pointer crashes in the
presence of malformed class types.

<rdar://problem/13740646>

llvm-svn: 180645
2013-04-26 22:54:19 +00:00
Daniel Malea 25029a00ca skip randomly failing test to avoid buildbot noise
llvm-svn: 180636
2013-04-26 21:39:11 +00:00
Matt Kopec 23a03de34d Mark tests as expected fail for Linux due to not being able to call/print c++ demangled functions in the global namespace (bugzilla 15854).
llvm-svn: 180623
2013-04-26 20:04:24 +00:00
Andrew Kaylor d693c19a73 Fixing a typo in the SBThread::Suspend documentation
llvm-svn: 180621
2013-04-26 18:34:17 +00:00
Matt Kopec 750dcc3323 Change Malloc to request an aligned memory size.
This fixes a problem on Linux where allocated memory would get overun in some use cases (ie. in TestExprs2.py).

llvm-svn: 180614
2013-04-26 17:48:01 +00:00
Andrew Kaylor a5d0f84694 Removing invalid test cases from thread state test
llvm-svn: 180613
2013-04-26 17:47:10 +00:00
Andrew Kaylor 5916d45add Fixing lldb log list text for commands category
llvm-svn: 180612
2013-04-26 17:44:41 +00:00
Enrico Granata c76b97bcce Make a synthetic children provider for the ObjC Class type
llvm-svn: 180588
2013-04-26 00:59:02 +00:00
Matt Kopec f92bca3b36 Build fix for systems that do not support NT_X86_XSTATE ptrace support.
Patch by Ashok Thirumurthi.

llvm-svn: 180581
2013-04-25 23:00:45 +00:00
Ashok Thirumurthi 999caf900a Adds 64-bit POSIX support for AVX
- Adds unique enums for ymm registers to the ABI and the POSIX register context.
- Reworks the register context data structures to support a union of FXSAVE and XSAVE
--- Allows the same code base to deal with the FPU independent of the availability of AVX.
- Determine if AVX is supported by attempting to read XSAVE using ptrace.
--- Support an extended register set for avx registers if available.
- Provide a mechanism to assemble/parse register halves into a single ymm buffer for use with RegisterValue.
--- Reworked Read/WriteRegister routines to read/write/parse ymm registers.

Adds tests for ymm register write with read-back, and expressions involving ymm registers.
- Tests vary depending on the availability of an avx register set.

Thanks to Daniel and Matt for their reviews.

llvm-svn: 180572
2013-04-25 20:12:45 +00:00
Sean Callanan fefe43cd3e Purged unnecessary data structures from the IR
interpreter.  They are a legacy from when the IR
interpreter didn't work with materialized values
but rather got values directly from
ClangExpressionDeclMap.

Also updated the #includes for IRInterpreter
accordingly.

llvm-svn: 180565
2013-04-25 18:55:45 +00:00
Sean Callanan 8ef197729d Fixed a crash in ClangASTSource when logging is
disabled.

llvm-svn: 180563
2013-04-25 18:50:43 +00:00
Jim Ingham 0ad7e0545b In Process::ProcessEventData::DoOnRemoval, we need to handle the case where NO thread has a stop reason
specially, and make sure we stop.  This shouldn't happen, but if it does, the user will probably want to
see it.

<rdar://problem/13273125>

llvm-svn: 180244
2013-04-25 02:04:59 +00:00
Filipe Cabecinhas 10a7a59871 More CMake fixes for OS X.
llvm-svn: 180243
2013-04-25 01:36:53 +00:00
Jason Molenda 8214b01da2 Fix one small whitespace alignment mistake.
llvm-svn: 180242
2013-04-25 01:33:46 +00:00
Greg Clayton 9d49056ef0 <rdar://problem/13565393>
If a register is in a ValueObject, be sure to print its children if it is a vector type.

llvm-svn: 180237
2013-04-25 01:06:07 +00:00
Greg Clayton 0fa5c974ef Don't print the type if there is none and don't print "<invalid type>". ValueObjects can be register sets and register groups and dumping those with:
(lldb) script print frame.GetRegisters()

llvm-svn: 180236
2013-04-25 01:05:15 +00:00
Greg Clayton 78e44bdd47 Don't crash if we try to interpret the IR (incorrectly in this case) and can't handle the size. This came from trying to do:
(lldb) p typedef float __attribute__((ext_vector_type(8))) __ext_vector_float8; (__ext_vector_float8)$ymm0

llvm-svn: 180235
2013-04-25 00:57:05 +00:00
Greg Clayton f4d6de6a53 Added the ability to extract a ModuleSpecList (a new class) from an ObjectFile. This is designed to be used when you have an object file that contains one or more architectures (MacOSX universal (fat) files) and/or one or more objects (BSD archive (.a files)).
There is a new static ObjectFile function you can call:

size_t
ObjectFile::GetModuleSpecifications (const FileSpec &file,
                                     lldb::offset_t file_offset,
                                     ModuleSpecList &specs)

This will fill in "specs" which the details of all the module specs (file + arch + UUID (if there is one) + object name (for BSD archive objects eventually) + file offset to the object in question).

This helps us when a user specifies a file that contains a single architecture, and also helps us when we are given a debug symbol file (like a dSYM file on MacOSX) that contains one or more architectures and we need to be able to match it up to an existing Module that has no debug info.

llvm-svn: 180224
2013-04-24 22:29:28 +00:00
Greg Clayton 8d1d25222e Remove a print statement that was left in accidentally.
llvm-svn: 180223
2013-04-24 22:21:02 +00:00
Enrico Granata 3f8e40ce7a See: http://stackoverflow.com/questions/16166897/c-how-to-obtain-address-of-stdvector-object-in-lldb-xcode
The user was trying to obtain the address-of an std::vector and the experience was more painful than necessary because data formatters were kicking in for vector* objects
We got this right for libc++ - we should get it right for libstdc++ too

llvm-svn: 180219
2013-04-24 21:52:24 +00:00
Enrico Granata e743c78299 <rdar://problem/13209140>
“plugin load” tries to be more helpful when it fails to load a plugin

llvm-svn: 180218
2013-04-24 21:29:08 +00:00
Sean Callanan 2ad6691be4 Fixed IRForTarget to handle Objective-C messages
sent to "super".

<rdar://problem/13042260>

llvm-svn: 180217
2013-04-24 21:25:20 +00:00
Jason Molenda c0e5b3ba1d Temporarily recognize exc_type EXC_BREAKPOINT with an exc_code of 0
(normally undefined) as indicating a breakpoint hit, in addition
to the normal (EXC_BREAKPOINT, EXC_ARM_BREAKPOINT) pair.
<rdar://problem/13730366> 

llvm-svn: 180216
2013-04-24 20:58:03 +00:00
Sean Callanan 76ee3e7e1c Fixed expression parser handling of empty strings.
<rdar://problem/12977827>

llvm-svn: 180215
2013-04-24 19:50:12 +00:00
Sean Callanan bac54a8d54 Fixed a build problem.
llvm-svn: 180212
2013-04-24 19:26:29 +00:00
Sean Callanan 7f5ac65fb9 Added support for pulling Objective-C class symbols
out of the runtime.  This allows calling static methods
on classes whose symbols have been stripped out of the
binary.

<rdar://problem/12042992>

llvm-svn: 180210
2013-04-24 19:07:29 +00:00
Greg Clayton dcff671133 <rdar://problem/13665446>
Pass the user set target.env-vars when launching through a terminal.

llvm-svn: 180201
2013-04-24 17:53:59 +00:00
Enrico Granata b636be79c0 Changes to the ObjC runtime
llvm-svn: 180199
2013-04-24 17:49:08 +00:00
Sean Callanan 485f732b84 Fixed a problem where the expression parser would
not find multiple functions with the same name but
different types.  Now we keep track of what types
we've already reported for a function and only elide
functions if we've already reported a conflicting
one.

Also added a test case.

<rdar://problem/11367837>

llvm-svn: 180167
2013-04-24 00:34:41 +00:00
Daniel Malea ef2a53af71 Fix missing module name in expectedFailure calls
llvm-svn: 180158
2013-04-23 22:59:31 +00:00