Commit Graph

5936 Commits

Author SHA1 Message Date
Jason Molenda c500aea639 Mark Objective-C 2.0 status as "Not applicable" on Linux.
The objc 2 runtime doesn't run on Linux.

llvm-svn: 167606
2012-11-09 06:16:12 +00:00
Jason Molenda 1f3ea66e23 Update the status page to include Linux status information,
patch from Dan Malea, daniel.malea@intel.com.

llvm-svn: 167605
2012-11-09 06:14:39 +00:00
Jason Molenda 44de0c3ac9 Fix typeo in example help text for type filter add.
<rdar://problem/12090979> 

llvm-svn: 167601
2012-11-08 23:57:44 +00:00
Jason Molenda 28826a491c Patch from Dan Malea daniel.malea@gmail.com to add some required
flags to the Linux makefiles to get the tests to run.

llvm-svn: 167600
2012-11-08 23:50:33 +00:00
Enrico Granata efe637d440 Minor cleanups to the new ModuleList notification APIs: passing in the ModuleList as part of the callbacks, and not copying the notifier as part of copy constructing and assigning
llvm-svn: 167592
2012-11-08 19:16:03 +00:00
Enrico Granata 2ffcf43a13 Adding support for loading the scripting resource as part of a framework, lacking the dSYM bundle, or if the bundle has no Pythonic resources whatsoever
Solving an issue where "command script import" would fail to pick the file indicated by the user as a result of something with the same name being in an earlier position in sys.path

llvm-svn: 167570
2012-11-08 02:44:10 +00:00
Enrico Granata 1759848be0 <rdar://problem/12586350>
This commit does three things:
(a) introduces a new notification model for adding/removing/changing modules to a ModuleList, and applies it to the Target's ModuleList, so that we make sure to always trigger the right set of actions
whenever modules come and go in a target. Certain spots in the code still need to "manually" notify the Target for several reasons, so this is a work in progress
(b) adds a new capability to the Platforms: locating a scripting resources associated to a module. A scripting resource is a Python file that can load commands, formatters, ... and any other action
of interest corresponding to the loading of a module. At the moment, this is only implemented on Mac OS X and only for files inside .dSYM bundles - the next step is going to be letting
the frameworks themselves hold their scripting resources. Implementors of platforms for other systems are free to implement "the right thing" for their own worlds
(c) hooking up items (a) and (b) so that targets auto-load the scripting resources as the corresponding modules get loaded in a target. This has a few caveats at the moment:
 - the user needs to manually add the .py file to the dSYM (soon, it will also work in the framework itself)
 - if two modules with the same name show up during the lifetime of an LLDB session, the second one won't be able to load its scripting resource, but will otherwise work just fine

llvm-svn: 167569
2012-11-08 02:22:02 +00:00
Jason Molenda c56bd08373 Fix a crasher in
DynamicLoaderDarwinKernel::OSKextLoadedKextSummary::LoadImageUsingMemoryModule
where it assumed that a kernel had been found in memory, when that may not be
the case when we're attaching to a device early in the boot process.
<rdar://problem/12638140> 

llvm-svn: 167564
2012-11-08 00:19:28 +00:00
Greg Clayton 1cb5951a2f Added a posix_spawn based launchd plist for always using posix_spawn to launch programs.
llvm-svn: 167563
2012-11-08 00:06:59 +00:00
Greg Clayton 84afacd253 <rdar://problem/12645617>
<rdar://problem/12153915>  (partial fix)

Remove an assert and place an error message instead so we don't crash when we run into a type tag that we don't recognize. We will now emit a warning so that hopefully we can get a bug report that has example code that shows what we are missing.

Also fixed a case when trying to unique one type to another where we would confuse concrete instances of methods with their definitions and end up not correctly registering the types.

llvm-svn: 167557
2012-11-07 23:09:32 +00:00
Jim Ingham d073fe4e5b When we were calculating the max byte size of ONE instruction to handle something like
x/9i

we actually calculated the size of 9 instructions.  Then we multiplied it by the count again 
to get the total amount we should fetch, so we thought 9 x86_64 instructions took over 1K
to fetch...

<rdar://problem/12649027>

llvm-svn: 167520
2012-11-07 01:52:04 +00:00
Sean Callanan 439265aba4 Logging improvements for the Objective-C runtime.
Also fixed a bug where the Objective-C runtime
would not properly report that it found a class if
(a) it had to build the ObjCInterfaceDecl for the
class and (b) logging was enabled.

<rdar://problem/12641180>

llvm-svn: 167516
2012-11-07 01:27:50 +00:00
Greg Clayton 9eb4e03873 <rdar://problem/12647273>
Added the ability to get the full process list when using the --applist option in debugserver.

llvm-svn: 167502
2012-11-06 23:36:26 +00:00
Greg Clayton 9f078b773d Added unnamed bitfields to our bitfield test.
llvm-svn: 167473
2012-11-06 18:22:59 +00:00
Greg Clayton 6421cccff8 Make sure to check the module is valid after trying to find a shared module.
llvm-svn: 167471
2012-11-06 17:50:15 +00:00
Jim Ingham 3bfa753fa1 Add a workaround to problems with the clang debug info for
inlined subroutine ranges.

<rdar://problem/12588579>

llvm-svn: 167430
2012-11-06 01:14:52 +00:00
Greg Clayton 88bc7f35b8 <rdar://problem/12582031>
Unnamed bitfields cause struct layout problems

Synthesize unnamed bitfields when required. Most compilers don't mention unnamed bitfields in the DWARF, so we need to create them to keep clang happy with the types we create from the DWARF. We currently can't do this for ObjC since the DW_AT_bit_offset value for any direct ivars of ObjC classes as the values for these attributes are bogus. A bug has been filed on Clang to fix this, and another bug has been filed on LLDB to make sure we fix the DWARF parser once the clang fix is in by looking the the DW_AT_producer in the compile unit attributes and finding the compiler version and only enabling it for newer versions of clang.

llvm-svn: 167424
2012-11-06 00:20:41 +00:00
Filipe Cabecinhas 7c3a53c0b2 Avoid potentially disastrous mistakes when removing a file.
llvm-svn: 167391
2012-11-05 18:41:33 +00:00
Greg Clayton 23e05e4e9a Cleaned up the code signing instructions:
- make sure to delet the .cer file on the desktop
- added section that describes what to do when you re-install a new OS where 
  you still have an old code signing certificate around.

llvm-svn: 167389
2012-11-05 18:23:25 +00:00
Jason Molenda ba813dc03c Add new ArchSpec methods, IsCompatibleMatch() and IsExactMatch().
The operator== method is a synonym for IsExactMatch().  

The essential difference between these two is that IsCompatibleMatch()
will say that armv7 and armv7s are compatible and return true.
IsExactMatch() will say that armv7 and armv7s are not a match.

An armv7s cpu can run either generic armv7 binaries or armv7s binaries
(the latter being tuned for it).  When we're picking the slice of a 
universal Mach-O file to load in an armv7s Target, we need to be able to
first look for an exact cpu subtype match (armv7s == armv7s) and failing
that, looking for a slice with a compatible architecture.

Update ObjectContainerUniversalMachO::GetObjectFile to prefer an exact
match of the cpu type, falling back to a compatible match if necessary.

<rdar://problem/12593515>

llvm-svn: 167365
2012-11-04 03:20:05 +00:00
Jim Ingham a537f6ce37 Fix a little think-o. In FileSpec::operator== we were trying to figure out whether the rhs file was resolved or not by comparing
the resolved version of the rhs FileSpec's directory name with the lhs FileSpec's directory name.  We really meant to compare it
with the rhs FileSpec's directory name...

<rdar://problem/12438838>

llvm-svn: 167349
2012-11-03 02:12:46 +00:00
Greg Clayton dfdd1eb65e Make sure users know that "target variable" can read variables while running a process by changing the documentation string.
llvm-svn: 167343
2012-11-03 00:10:22 +00:00
Enrico Granata 80fcdd429f Caught two cases where we were passing a Stream* without checking for NULL
llvm-svn: 167342
2012-11-03 00:09:46 +00:00
Sean Callanan 7273e2d124 Fixed a problem where we mistook normal result
variables for guard variables because the current
class or method named contained the letters "GV".

llvm-svn: 167327
2012-11-02 22:28:08 +00:00
Greg Clayton 2346fcf60c Fixed the "--force" option for memory read.
llvm-svn: 167314
2012-11-02 21:14:58 +00:00
Sean Callanan 84dcccd14b Switched debugserver to use C++11/libc++.
<rdar://problem/12624679>

llvm-svn: 167303
2012-11-02 18:30:51 +00:00
Sean Callanan 5540094ccd Extra safeguards to ensure that we never query
the runtime if we have complete debug information
for a class.

Also made the Objective-C language runtime return
NULL when asked for the complete debug information
(i.e., information from DWARF, not information from
the runtime) if that information isn't present.  It
used to return a non-authoritative version, which
made it hard for clients to determine whether
complete debug information was available.

<rdar://problem/12608895>

llvm-svn: 167299
2012-11-02 17:09:58 +00:00
Jason Molenda e7a9168908 Set the MACOSX_DEPLOYMENT_TARGET in a few more places.
llvm-svn: 167267
2012-11-02 00:35:51 +00:00
Jason Molenda 4cbf8f3d4b Set the MACOSX_DEPLOYMENT_TARGET for Debug/Release builds
(but not BuildAndIntegration builds).

llvm-svn: 167264
2012-11-01 23:37:53 +00:00
Jason Molenda cc57a38325 Change DataExtractor::Dump() to use a series of if..else if
statements instead of a switch for the size of the floating
point types; some architectures sizeof double and sizeof long
double are the same and that's invalid in a switch.

Fix the LLDB_DISABLE_PYTHON ifdef block in FormatManager::LoadObjCFormatters
so it builds on arm again.

llvm-svn: 167263
2012-11-01 23:35:19 +00:00
Greg Clayton 2508b9b8d3 <rdar://problem/12585314>
LLDB now provides base class offsets (virtual and non virtual) to Clang's record layout. We previously were told this wasn't necessary, but it is when pragma pack gets involved.

llvm-svn: 167262
2012-11-01 23:20:02 +00:00
Greg Clayton aa0c70e38c Get rid of hack by making the actual call public. This was causing the lldb-platform to not be able to link.
llvm-svn: 167253
2012-11-01 21:35:16 +00:00
Sean Callanan 0c23368a34 Fixes to make the test suite work better when
explicitly pointed at an LLDB framework and
executable.

llvm-svn: 167250
2012-11-01 21:23:21 +00:00
Filipe Cabecinhas c281a3bf43 Makefile patches from Charles Davis and Daniel Malea (+ one or two tweaks).
llvm-svn: 167242
2012-11-01 18:55:16 +00:00
Greg Clayton da2455bd45 Avoid a crash when trying to parse a line table in the DWARF parser.
llvm-svn: 167236
2012-11-01 17:28:37 +00:00
Jason Molenda 0b2dbe0ebe Fix an error message in debugserver so it doesn't print "Unable to
launch process (null)" because we changed argv while doing argument
parsing.

llvm-svn: 167202
2012-11-01 02:02:59 +00:00
Jim Ingham 455fa5ccc6 There seems to be some odd corner case where we shut down the ProcessGDBRemote, but we haven't managed to shut down the async thread. That causes the ProcessGDBRemote::AsyncThread to crash when it wakes up. So I changed StartAsyncThread and StopAsyncThread to be callable multiple times (only the first one does anything) so that we can just shut it down unequivocally in the ProcessGDBRemote destructor.
<rdar://problem/12602981>

llvm-svn: 167197
2012-11-01 01:15:33 +00:00
Jim Ingham 490bccd659 Switch from using KERN_PROCARGS2 to get the path to the executed process to proc_pidpath. The former was flakey, and the whole point of libproc is to protect us from potential flakiness at that level...
<rdar://problem/12594781>

llvm-svn: 167194
2012-11-01 01:04:46 +00:00
Greg Clayton d9c2370b33 Added the plists to the debugserver project and fixed the labels for the new plists.
llvm-svn: 167183
2012-10-31 23:49:14 +00:00
Greg Clayton e11b43bc69 More launchd style plists.
llvm-svn: 167182
2012-10-31 23:43:37 +00:00
Filipe Cabecinhas 6fd25ac3e2 Use libxml2 on Mac OS X.
llvm-svn: 167179
2012-10-31 23:02:00 +00:00
Greg Clayton 48baf7a788 Resolve any bundle paths we are given when the specified executable is a bundle.
llvm-svn: 167175
2012-10-31 21:44:39 +00:00
Greg Clayton b70c2309b6 More fixes from MSVC warnings found by Carlo Kok.
llvm-svn: 167171
2012-10-31 20:56:43 +00:00
Greg Clayton 5d361d7e3a Carlo Kok was compiling with MSVC, caught some more issues.
llvm-svn: 167168
2012-10-31 20:51:31 +00:00
Greg Clayton 26ab83d3dd Carlo Kok found an issue where default parameters were causing the wrong argument to be passed. I got rid of the default args so we don't run into this.
llvm-svn: 167167
2012-10-31 20:49:04 +00:00
Greg Clayton 4a6591da25 Patch for issue found by Carlo Kok. Fixed a type issue where an ';' was incorrectly following an if statement. There actually isn't a need for the if statement, so it was removed.
llvm-svn: 167160
2012-10-31 19:05:35 +00:00
Sean Callanan 256cf2cb49 Rmoved a duplicate version of SetSelectedThreadByID
that confused external clients.

<rdar://problem/12599528>

llvm-svn: 167097
2012-10-31 02:12:08 +00:00
Sean Callanan 5bb2673fc8 Removed some spurious files from our Copy
Headers build phase.

llvm-svn: 167096
2012-10-31 02:03:31 +00:00
Sean Callanan 4ac7ec7341 Fixed a crash when we couldn't create a
CXXMethodDecl but tried to manipulate it
anyway.

<rdar://problem/12601996>

llvm-svn: 167095
2012-10-31 02:01:58 +00:00
Jason Molenda e2db91b8b0 Fix the bit pattern for vst1 in EmulateInstructionARM::GetThumbOpcodeForInstruction
so it is recognized correctly.  The second patch needed for <rdar://problem/10652166>.

llvm-svn: 167094
2012-10-31 02:00:46 +00:00
Enrico Granata 085577f8d0 <rdar://problem/12586188> Make ImportError a special case for "command script import", such that the error message for the exception becomes the error for the entire import operation
and silence the backtrace printout

In the process, refactor the Execute* commands in ScriptInterpreter to take an options object, and add a new setting to not mask out errors so that the callers can handle them directly
instead of having the default behavior

llvm-svn: 167067
2012-10-31 00:01:26 +00:00
Greg Clayton c280746b8c <rdar://problem/12602978>
RegisterContextKDP_i386 was not correctly writing registers due to missing "virtual" keywords. Added the virtual keywords and made the functions pure virtual to ensure subclasses can't get away without implementing these functions.

llvm-svn: 167066
2012-10-30 23:57:32 +00:00
Greg Clayton 2fb45d0aff Fixed build warnings.
llvm-svn: 167065
2012-10-30 23:56:14 +00:00
Jim Ingham 5fdeed4e9f Make blocks that capture their containing method's object pointer look like methods of
the containing class so that direct ivar access will work in the expression parser.

<rdar://problem/9797999>

llvm-svn: 167061
2012-10-30 23:35:54 +00:00
Jim Ingham 2cffda3ff8 Change a couple of raw printf's to expression log output.
llvm-svn: 167060
2012-10-30 23:34:07 +00:00
Jason Molenda 055c57b7ce Change the MacOSX Symbols::DownloadObjectAndSymbolFile to look up
"~rc" via getpwnam() instead of doing tilde expansion and doing soft-link
dereferencing via realpath() - if we're pointing to a softlink, leave it
as-is.  
<rdar://problem/12597698>

llvm-svn: 167052
2012-10-30 21:26:30 +00:00
Greg Clayton 0665a0f09e Path from Ashok Thirumurthi:
The attached patch adds eValueTypeVector to lldb_private::Value.  The nested struct Vector is patterned after RegisterValue::m_data.buffer.  This change to Value allows ClangExpressionDeclMap::LookupDecl to return vector register data for consumption by InterpreterStackFrame::ResolveValue.  Note that ResolveValue was tweaked slightly to allocate enough memory for vector registers.
 
An immediate result of this patch is that "expr $xmm0" generates the same results on Linux as on the Mac, which is good enough for TestRegisters.py.  In addition, the log of m_memory.PrintData(data_region.m_base, data_region.m_extent) shows that the register content has been resolved successfully.  On the other hand, the output is glaringly empty:
    runCmd: expr $xmm0
    output: (unsigned char __attribute__((ext_vector_type(16)))) $0 = {}
    Expecting sub string: vector_type
    Matched

llvm-svn: 167033
2012-10-30 18:18:43 +00:00
Enrico Granata 4fb310e883 Replace printf with result.Printf, so that the plugin shows its output with any configuration of the LLDB I/O streams (esp. useful in graphic environments such as Xcode)
llvm-svn: 167030
2012-10-30 18:01:15 +00:00
Jim Ingham 3b1c97aa74 Patch from Matt Kopec <matt.kopec@intel.com> to handle stepping into multiply-nested inlined code.
llvm-svn: 167028
2012-10-30 17:44:49 +00:00
Greg Clayton 0734dfb23d Patch from Matt Kopec:
This patch switches support on Linux from JIT to MCJIT.

llvm-svn: 167026
2012-10-30 17:11:34 +00:00
Greg Clayton 21a78c9ac2 Fixed File::SeekFromEnd() to use SEEK_END insted of SEEK_CUR.
llvm-svn: 167025
2012-10-30 17:04:45 +00:00
Greg Clayton 9cb25c412a Use the "data()" accessor on the std::vector<clang_type_t> in case it is empty.
llvm-svn: 167024
2012-10-30 17:02:18 +00:00
Greg Clayton 373670df5a Added the ability to get function return and argument types to SBType():
bool
     SBType::IsFunctionType ();

     lldb::SBType
     SBType::GetFunctionReturnType ();
 
     lldb::SBTypeList
     SBType::GetFunctionArgumentTypes ();

llvm-svn: 167023
2012-10-30 16:57:17 +00:00
Greg Clayton bbffdd71eb Add missing return to SBAddress::GetOffset(). This was caught by Carlo Kok.
llvm-svn: 167019
2012-10-30 16:32:38 +00:00
Enrico Granata 7389f8454f Ensuring that the swig typemaps for SBData set the size to 0 along with the pointer to NULL
There should be no functional changes as SBData creation functions already checked for NULL regardless of size - but it ensures consistency

llvm-svn: 166978
2012-10-29 23:06:44 +00:00
Enrico Granata b588726ec9 <rdar://problem/11449953> Change Debugger::SetOutputFileHandle() so that it does not automatically initialize the script interpreter in order to transfer its output file handle to it
This should delay initialization of Python until strictly necessary and speed-up debugger startup
Also, convert formatters for SEL and BOOL ObjC data-types from Python to C++, in order to reap more performance benefits from the above changes

llvm-svn: 166967
2012-10-29 21:18:03 +00:00
Greg Clayton 35a4cc5ea7 <rdar://problem/12500785>
I tracked down a leak that could happen when detaching from a process where the lldb_private::Process objects would stay around forever. This was caused by a eStateDetached event that was queued up on the lldb_private::Process private state thread listener. Since process events contain shared pointers to the process, this is dangerous if they don't get consume or cleared as having the lldb_private::Process class contain a collection of things that have a shared pointer to yourself is obviously bad. 

To fix this I modified the Process::Finalize() function to clear this list. The actual thing that was holding onto the ModuleSP and thus the static archive, was a stack frame. Since the process wasn't going away, it still had thread objects and they still had frames. I modified the Thread::Destroy() to clear the stack frames to ensure this further doesn't happen.

llvm-svn: 166964
2012-10-29 20:52:08 +00:00
Jim Ingham 629e7a9846 Fix an incorrect comment...
llvm-svn: 166959
2012-10-29 19:24:56 +00:00
Greg Clayton 6a3efacc0f Improve the broadcast event dumping.
llvm-svn: 166950
2012-10-29 18:08:18 +00:00
Jim Ingham 3793976376 This is the first phase of supporting the DW_AT_object_pointer tag. I expanded the decl metadata
so it could hold this information, and then used it to look up unfound names in the object pointer
if it exists.  This gets "frame var" to work for unqualified references to ivars captured in blocks.
But the expression parser is ignoring this information still.

llvm-svn: 166860
2012-10-27 02:54:13 +00:00
Jim Ingham 4dc613b364 If we got what looks like a single step exception but we weren't single stepping then just report
the raw exception.

llvm-svn: 166859
2012-10-27 02:52:04 +00:00
Enrico Granata 21fd13f9b7 Moving ValueObjectCast over to its own .h/.cpp files instead of sharing ValueObjectDynamic.h/.cpp
Removing the IsDynamic() and GetStaticValue() calls, so that they will default to the base class behavior:
 - non-dynamic
 - itself as the static value
This is in contrast with the previous behavior which could be confusing and could potentially cause issues when using those objects

llvm-svn: 166857
2012-10-27 02:05:48 +00:00
Sean Callanan cd6ce2ff31 Fixes to the Objective-C V2 runtime:
- Only read the statically-defined isa table in the
  shared cache once.  Only the dynamically-constructed
  isa table can change.

- Ignore the statically-defined isa table if its
  version isn't what we expect.

llvm-svn: 166856
2012-10-27 01:51:44 +00:00
Jason Molenda aba75e6495 Show both lldb-168 and earlier "bt -c 5" as well as lldb-169 and later "bt 5" usage.
llvm-svn: 166839
2012-10-26 23:56:03 +00:00
Jason Molenda ca76ecda8a Document "bt <n>" for "thread backtrace -c <n>", note that it is available
in lldb-169 and later.

llvm-svn: 166838
2012-10-26 23:52:49 +00:00
Andrew Kaylor 9ed6ae5ee0 This patch updates comments in the Predicate class to describe a subtle behavior that callers may need to be aware. It also adds documentation for one function which didn’t have any.
The subtle behavior is that the Predicate wait functions may not detect transitory changes in the predicate value.  Consider the following scenario.

Thread A waits for a bit to be set in the predicate value.
Thread B sets the bit in the predicate value.
Before Thread A wakes up, Thread C clears the bit in the predicate value.
Thread A wakes, checks the value and goes back to waiting.

The mutex and condition variables protect access to the value, but they offer no guarantee that another thread will not acquire the mutex and change the value before a waiting thread is restarted after a change.

I believe that the current behavior is correct and reasonable.  I just want to leave a marker to prevent possible problems in the future or to help anyone who might be unfortunate enough to encounter such a problem.

llvm-svn: 166800
2012-10-26 19:28:36 +00:00
Jim Ingham d7b30ef93c Add API to get the process plugin name & short name.
llvm-svn: 166799
2012-10-26 19:18:04 +00:00
Greg Clayton 13b1213de3 Updated the "breakpoint command add" documentation and fixed the web site docs for the signature of the python breakpoint callback functions.
llvm-svn: 166789
2012-10-26 17:53:21 +00:00
Jason Molenda 60f0bd4944 Add a new capability to RegisterContextLLDB: To recognize when the
Full UnwindPlan is trying to do an impossible unwind; in that case
invalidate the Full UnwindPlan and replace it with the architecture
default unwind plan.

This is a scenario that happens occasionally with arm unwinds in
particular; the instruction analysis based full unwindplan can
mis-parse the functions and the stack walk stops prematurely.  Now
we can do a simpleminded frame-chain walk to find the caller frame
and continue the unwind.  It's not ideal but given the complicated
nature of analyzing the arm functions, and the lack of eh_frame
information on iOS, it is a distinct improvement and fixes some
long-standing problems with the unwinder on that platform.  

This is fixing <rdar://problem/12091421>.  I may re-use this
invalidate feature in the future if I can identify other cases where
the full unwindplan's unwind information is clearly incorrect.

This checkin also includes some cleanup for the volatile register
definition in the arm ABI plugin for <rdar://problem/10652166> 
although work remains to be done for that bug.

llvm-svn: 166757
2012-10-26 06:08:58 +00:00
Jason Molenda a3843dd2a5 Document target.source-map as the replacement for gdb's directory command.
llvm-svn: 166753
2012-10-26 04:38:09 +00:00
Filipe Cabecinhas be45ce66d4 Add a teardown function to TestAbbreviations so it doesn't error out when running for two archs.
llvm-svn: 166740
2012-10-25 23:52:28 +00:00
Greg Clayton 82d792958b <rdar://problem/12570550>
TOT lldb broke finding App in app bundles when launching with shell.

llvm-svn: 166733
2012-10-25 22:45:35 +00:00
Jim Ingham 4a58e96846 Found a couple more places where we need to run all threads when stepping.
llvm-svn: 166732
2012-10-25 22:30:09 +00:00
Jim Ingham 5c48d5c536 Add text to the help to explain how to set user defined variables.
llvm-svn: 166704
2012-10-25 18:11:24 +00:00
Greg Clayton ead45e0174 Allow operating system plug-ins to specify the address for registers so we don't have to create data up front.
llvm-svn: 166701
2012-10-25 17:56:31 +00:00
Jim Ingham 06933e2af0 Add section on creating convenience variables.
llvm-svn: 166697
2012-10-25 17:35:53 +00:00
Greg Clayton 89870cebcb Changed the V1 and V2 runtimes to be able to detect when the ISA hash table has changed, and auto update as needed.
llvm-svn: 166693
2012-10-25 16:54:22 +00:00
Sean Callanan ec8f1ef9db Updated LLDB's use of the DiagnosticsEngine to
reflect a change to the initializer.

llvm-svn: 166657
2012-10-25 01:00:25 +00:00
Jason Molenda 840f12cf6b Identify a kdp session that is connecting to an EFI monitor,
use a DynamicLoaderStatic dynamic loader for the session
instead of a kernel or user dynamic loader.

llvm-svn: 166652
2012-10-25 00:25:13 +00:00
Sean Callanan ee1450aece Added --framework and --executable arguments
to dotest.py so that the testsuite can run against
any LLDB.

<rdar://problem/12512268>

llvm-svn: 166635
2012-10-24 22:45:39 +00:00
Enrico Granata 2928d37096 Fixing the test case for rdar://12481949 to do the right thing with our new rules for sign-extension in GetValueAsUnsigned()
llvm-svn: 166631
2012-10-24 22:15:04 +00:00
Enrico Granata df26a90dc2 And one more logging message goes away
llvm-svn: 166628
2012-10-24 21:54:04 +00:00
Enrico Granata 1918627d93 Reverting unwanted changes to the test suite
llvm-svn: 166627
2012-10-24 21:44:48 +00:00
Enrico Granata 5020f958d8 Reverting the changes to Scalar since this class needs to follow C rules for type promotion
llvm-svn: 166626
2012-10-24 21:42:49 +00:00
Enrico Granata 48ea80f9ff Reimplementing SBValue/ValueObject.GetValueAsUnsigned() in terms of appropriate calls in Scalar - Making sure Scalar does the right thing when casting signed values to unsigned ones.
llvm-svn: 166618
2012-10-24 20:24:39 +00:00
Enrico Granata 7b3d205ee3 Changing the NSDate data formatter to use GetData().uint64[] instead of relying on SBValue.GetValueAsUnsigned() to reinterpret a double as a uint64_t
llvm-svn: 166610
2012-10-24 19:05:32 +00:00
Greg Clayton 1c22be6999 Added process and thread logging the python OperatingSystem plug-in.
llvm-svn: 166608
2012-10-24 18:39:14 +00:00
Greg Clayton 5db6b79955 Patch from Ashok Thirumurthi that enabled FPU registers for POSIX x86_64.
llvm-svn: 166604
2012-10-24 18:24:14 +00:00
Enrico Granata 7e137e3d8f <rdar://problem/12481949> Fixing SBValue.GetValueAsSigned() to do the right thing when dealing with a 32-bit negative value
llvm-svn: 166603
2012-10-24 18:14:21 +00:00
Greg Clayton fb9c6b760b Cleanup some variable names to indicate auto pointers and also manager the llvm::Module memory more correctly.
llvm-svn: 166598
2012-10-24 17:37:53 +00:00
Jason Molenda 67c3cf5357 eArgTypePath was removed in r166533; change -c to
expect eArgTypeFilename.

llvm-svn: 166542
2012-10-24 03:29:40 +00:00
Enrico Granata 44818163ed <rdar://problem/12523238> Commit 3 of 3
Changed all relevant test cases to verify that MightHaveChildren() works correctly for objects of interest
Added a bunch of convenience methods for test cases to use: target(), process(), thread() and frame() which mimic the lldb.X convenience variables
As a bonus, edited the documentation on the website to describe the new method available for synthetic children providers writers to implement!

That's all folks!

llvm-svn: 166535
2012-10-24 01:23:57 +00:00
Sean Callanan 3154255fd6 This is a fix for the command option parser.
There was a generic catch-all type for path arguments
called "eArgTypePath," and a specialized version
called "eArgTypeFilename."  It turns out all the
cases where we used eArgTypePath we could have
used Filename or we explicitly meant a directory.

I changed Path to DirectoryName, made it use the
directory completer, and rationalized the uses of
Path.

<rdar://problem/12559915>

llvm-svn: 166533
2012-10-24 01:12:14 +00:00
Enrico Granata 6c61cbbc49 Better error message for invalid argument to --category - silenced the printout of the raw args when not in verbose mode
llvm-svn: 166514
2012-10-23 22:52:49 +00:00
Greg Clayton d64dd12fcf Objective C cleanup. Removed an cache that was no longer needed and changes the code that gets the dynamic type and class name to use our new Objective C cache.
llvm-svn: 166512
2012-10-23 22:41:19 +00:00
Sean Callanan 7fcf0c131b Added a testcase for runtime types in Objective-C.
llvm-svn: 166507
2012-10-23 22:14:39 +00:00
Enrico Granata 91fe01753d <rdar://problem/12523238> Commit 2 of 3
Adding the new has_children (or MightHaveChildren() in C++) for the existing synthetic children providers
In a few cases, the new call is going to be much more efficient than the previous num_children > 0 check
When the optimization was marginal (e.g. std::vector<>), the choice was to use num_children in order to keep
implementation details in one function instead of duplicating code

Next step is to provide test cases

llvm-svn: 166506
2012-10-23 21:54:53 +00:00
Jim Ingham ce0740d8cf Turns out there are 8 bits in a byte.
llvm-svn: 166502
2012-10-23 21:09:09 +00:00
Enrico Granata adaf282c76 <rdar://problem/12523238> Commit 1 of 3
This commit enables the new HasChildren() feature for synthetic children providers
Namely, it hooks up the required bits and pieces so that individual synthetic children providers can implement a new (optional) has_children call
Default implementations have been provided where necessary so that any existing providers continue to work and behave correctly

Next steps are:
2) writing smart implementations of has_children for our providers whenever possible
3) make a test case

llvm-svn: 166495
2012-10-23 19:54:09 +00:00
Jim Ingham a7dfb665e3 Watchpoints remember the type of the expression or variable they were set with, and use
it to print the old and new values.
Temporarily disable the "out of scope" checking since it didn't work correctly, and was
not what people generally expected watchpoints to be doing.  

llvm-svn: 166472
2012-10-23 07:20:06 +00:00
Jason Molenda 7cd5e831e5 Change how the UnwindAssemblyInstEmulation class tracks the setup of
the function's prologue instructions so we can re-instate that prologue
if we hit an early return mid-function.  Add some additional heuristics
to differentiate between prologue and epilogue instruction sequences.

This fixes the specific problem of correctly unwinding through a function
which has an epilogue one instruction after the last prologue setup
instruction has completed.
<rdar://problem/12091139> 

llvm-svn: 166465
2012-10-23 03:08:31 +00:00
Jason Molenda a7dcb33716 Clean up help/usage messages for kdp-remote / gdb-remote a little bit.
llvm-svn: 166464
2012-10-23 03:05:16 +00:00
Enrico Granata db8142b8e8 Fixing a compiler warning about has_children being used before being initialized
llvm-svn: 166462
2012-10-23 02:07:54 +00:00
Greg Clayton 4a792072ce <rdar://problem/12493007>
Added a new API call to help efficiently determine if a SBValue could have children:

     bool
     SBValue::MightHaveChildren ();
     
This is inteneded to be used bui GUI programs that need to show if a SBValue needs a disclosure triangle when displaying a hierarchical type in a tree view without having to complete the type (by calling SBValue::GetNumChildren()) as completing the type is expensive.

llvm-svn: 166460
2012-10-23 01:50:10 +00:00
Sean Callanan d94773972c Improved support for language types as command
options:

- added help ("help language") listing the
  possible options;

- added the possibility of synonyms for language
  names, in this case "ObjC" for "Objective-C";
  and

- made matching against language names case
  insensitive.

This should improve discoverability.

<rdar://problem/12552359>

llvm-svn: 166457
2012-10-23 00:50:09 +00:00
Enrico Granata bc08ab450a <rdar://problem/12500212> Test case for the new plugin feature
llvm-svn: 166453
2012-10-23 00:09:02 +00:00
Sean Callanan ec979baef7 Added support for zero-length arrays at the end
of structures, and added a testcase.

<rdar://problem/12551591>

llvm-svn: 166450
2012-10-22 23:56:48 +00:00
Enrico Granata dbeb0f0e0c Proper copyright notice
llvm-svn: 166443
2012-10-22 22:03:16 +00:00
Greg Clayton e4c1ef55ce <rdar://problem/12524810>
Fixed a crasher where if an invalid SBTarget was passed to:

lldb::addr_t
SBAddress::GetLoadAddress (const SBTarget &target) const;

We would crash.

llvm-svn: 166439
2012-10-22 20:49:35 +00:00
Enrico Granata f71a839999 <rdar://problem/12479701> Use the plain pydoc pager to work around Python help() pagination conflicts with our I/O management
llvm-svn: 166432
2012-10-22 19:09:28 +00:00
Enrico Granata e3e91517ff <rdar://problem/12437442>
Given our implementation of ValueObjects we could have a scenario where a ValueObject has a dynamic type of Foo* at one point, and then its dynamic type changes to Bar*
If Bar* has synthetic children enabled, by the time we figure that out, our public API is already vending SBValues wrapping a DynamicVO, instead of a SyntheticVO and there was
no trivial way for us to change the SP inside an SBValue on the fly
This checkin reimplements SBValue in terms of a wrapper, ValueImpl, that allows this substitutions on-the-fly by overriding GetSP() to do The Right Thing (TM)
As an additional bonus, GetNonSyntheticValue() now works, and we can get rid of the ForceDisableSyntheticChildren idiom in ScriptInterpreterPython
Lastly, this checkin makes sure the synthetic VOs get the correct m_value and m_data from their parents (prevented summaries from working in some cases)

llvm-svn: 166426
2012-10-22 18:18:36 +00:00
Greg Clayton 7bc31332b8 <rdar://problem/12473003>
Allow type searches to specify a type keyword when searching for type. Currently supported type keywords are: struct, class, union, enum, and typedef.

So now you can search for types with a string like "struct foo".

llvm-svn: 166420
2012-10-22 16:19:56 +00:00
Jason Molenda 60c9dae2bf Reorder the sections of "USE AND EXTENSIONS" so the most useful to
users new to lldb are at the top.

llvm-svn: 166381
2012-10-20 21:01:22 +00:00
Jason Molenda 96c53b71cb Rename the lldb/gdb command page.
Remove 'Customization', 'Documentation', and 'FAQ' pages from the sidebar's "USE AND EXTENSION"
section.  These pages have no content.  If someone ever wants to add content to them, we can
re-add them to the sidebar.

llvm-svn: 166380
2012-10-20 21:00:03 +00:00
Sean Callanan a2cd62a1e7 Fixed a bug that caused floating-point values
to be printed truncated.

<rdar://problem/12389615>

llvm-svn: 166368
2012-10-20 06:08:09 +00:00
Jason Molenda 269055c438 Also remove PlatformiOSSimulator::GetProcessInfo decl from
the header file.
(followup patch to Sean's commit of r166355 earlier today.)

llvm-svn: 166365
2012-10-20 04:57:29 +00:00
Sean Callanan 575a4545de Improved logging for the SBTarget's launching
and attaching APIs.

llvm-svn: 166356
2012-10-20 00:21:31 +00:00
Sean Callanan ae99b0b3cc Fixed the iOS simulator platform:
- Fixed a crash when the executable module
  couldn't be found.
- Fixed a problem that made it impossible
  to attach to processes in the simulator
  using the SBTarget::Attach.

llvm-svn: 166355
2012-10-20 00:19:59 +00:00
Greg Clayton 1d19a2f253 <rdar://problem/12491387>
Added commands to the KDP plug-in that allow sending raw commands through the KDP protocol. You specify a command byte and a payload as ASCII hex bytes, and the packet is created with a valid header/sequenceID/length and sent. The command responds with a raw ASCII hex string that contains all bytes in the reply including the header.

An example of sending a read register packet for the GPR on x86_64:

(lldb) process plugin packet send --command 0x07 --payload 0100000004000000

llvm-svn: 166346
2012-10-19 22:22:57 +00:00
Greg Clayton 66763eed3c Change the name of the variable used to detect if we are loading kexts to "load-kexts" instead of "disable-kext-loading" since the value is a boolean. This was requested by the person who requested the feature. It now defaults to true:
(lldb) settings show plugin.dynamic-loader.darwin-kernel.load-kexts
plugin.dynamic-loader.darwin-kernel.load-kexts (boolean) = true

llvm-svn: 166315
2012-10-19 20:53:18 +00:00
Jason Molenda 3929249281 Remove -w write flag to watch set var from tutorial.html.
Fix one gdb example that had an "(lldb)" prompt in the lldb/gdb page.

llvm-svn: 166297
2012-10-19 19:52:12 +00:00
Greg Clayton 468ea4eb9d Rename "macosx-kernel" to "darwin-kernel" to match the filenames before anyone starts using the settings for this plug-in.
llvm-svn: 166295
2012-10-19 18:14:47 +00:00
Greg Clayton e8cd0c9859 Added the infrastructure necessary for plug-ins to be able to add their own settings instead of having settings added to existing ones. In particular "target.disable-kext-loading" was added to "target" where it should actually be specific to the the dynamic loader plugin. Now the plug-in manager has the ability to create settings at the root level starting with "plugin". Each plug-in type can add new sub dictionaries, and then each plug-in can register a setting dictionary under its own short name. For example the DynamicLoaderDarwinKernel plug-in now registers a setting dictionary at:
plugin
    dynamic-loader
        macosx-kernel
            (bool) disable-kext-loading
            
To settings can be set using:

(lldb) settings set plugin.dynamic-loader.macosx-kernel.disable-kext-loading true

I currently only hooked up the DynamicLoader plug-ins, but the code is very easy to duplicate when and if we need settings for other plug-ins.

llvm-svn: 166294
2012-10-19 18:02:49 +00:00
Jason Molenda 87a04b2445 Add a new target setting to disable automatic loading of kext images
in a kernel debug session:

settings set target.disable-kext-loading true

<rdar://problem/12490623>

llvm-svn: 166262
2012-10-19 03:40:45 +00:00
Jason Molenda c26f5457d0 typeo fix in comment
llvm-svn: 166259
2012-10-19 02:18:10 +00:00
Jason Molenda 57656e7a8f Change CommunicationKDP::SendRequestWriteMemory to append data as binary
instead of asciified bytes.  <rdar://problem/12522978>

llvm-svn: 166258
2012-10-19 02:16:22 +00:00
Sean Callanan 433cd221ec Fixed a bug where empty C structs were given size
1 by the expression parser.  We now correctly
report that they are of size 0.  (C++ structs
are mandated to have nonzero size, and Clang marks
them as being 1 byte in size.)

<rdar://problem/12380800>

llvm-svn: 166256
2012-10-19 01:37:25 +00:00
Jim Ingham 06d282d1cb Change the "rb" alias to "rbreak" since some people are used to typing more than "rb" and so weren't
finding the alias.

llvm-svn: 166249
2012-10-18 23:24:12 +00:00
Greg Clayton c9d645d306 <rdar://problem/12491420>
Added a new setting that allows a python OS plug-in to detect threads and provide registers for memory threads. To enable this you set the setting:

settings set target.process.python-os-plugin-path lldb/examples/python/operating_system.py

Then run your program and see the extra threads. 

llvm-svn: 166244
2012-10-18 22:40:37 +00:00
Jim Ingham 5114f91a43 Mention "break set -r" and "break set -p".
llvm-svn: 166238
2012-10-18 21:54:05 +00:00
Greg Clayton a0ca6601bc <rdar://problem/12462048>
<rdar://problem/12068650>

More fixes to how we handle paths that are used to create a target.

This modification centralizes the location where and how what the user specifies gets resolved. Prior to this fix, the TargetList::CreateTarget variants took a FileSpec object which meant everyone had the opportunity to resolve the path their own way. Now both CreateTarget variants take a "const char *use_exe_path" which allows the TargetList::CreateTarget to centralize where the resolving happens and "do the right thing".

llvm-svn: 166186
2012-10-18 16:33:33 +00:00
Greg Clayton 453925530d <rdar://problem/12462048>
LLDB changes argv[0] when debugging a symlink. Now we have the notion of argv0 in the target settings:

target.arg0 (string) = 

There is also the program argument that are separate from the first argument that have existed for a while:

target.run-args (arguments) =

When running "target create <exe>", we will place the untouched "<exe>" into target.arg0 to ensure when we run, we run with what the user typed. This has been added to the ProcessLaunchInfo and all other needed places so we always carry around the:
- resolved executable path
- argv0
- program args

Some systems may not support separating argv0 from the resolved executable path and the ProcessLaunchInfo needs to carry all of this information along so that each platform can make that decision.

llvm-svn: 166137
2012-10-17 22:57:12 +00:00
Enrico Granata d228483d8c Improvements to the data formatters logging - plus, new log messages when our dynamic type changes
llvm-svn: 166133
2012-10-17 22:23:56 +00:00
Sean Callanan c5069ad26c Fixed ClangASTContext to own its TargetOptions
using a reference-counted pointer.  This avoids
memory-management problems when the TargetOptions
are deleted.

llvm-svn: 166132
2012-10-17 22:11:14 +00:00
Sean Callanan aa0f9cbc9a Added support for "bool", "true", and "false" to
the expression parser (also wchar_t) and added a
test case.

llvm-svn: 166131
2012-10-17 22:09:59 +00:00
Greg Clayton 84ffa16de6 Added register write examples and also how to modify the pc. For this we show and example of GDB using the "jump" command, and LLDB using "register write" with an expression.
llvm-svn: 166127
2012-10-17 20:58:52 +00:00
Enrico Granata 13ac0e253d <rdar://problem/12503640> Fixing an issue where the dynamic type of an Objective-C pointer changed but we still reported the one-true-definition for the previous type. This was causing issues where a variable could be reported as being of an entirely different type after an assignment
llvm-svn: 166119
2012-10-17 19:03:34 +00:00
Jason Molenda 5c1ac4ea72 Add code to UnwindAssemblyInstEmulation::GetNonCallSiteUnwindPlanFromAssembly
to handle an addition class of early-return instructions we find in arm code:
tail-call optimziation returns where we restore the register state from the
function entry and jump directly (not branch & link) to another function --
when that other function returns, it will return to our caller.

Previously this mid-function epilogue sequence was not being correctly detected.
We would not re-instate the prologue setup instructions for the rest of the function
so unwinds would break from that point until the end of the function.
<rdar://problem/12502597> 

llvm-svn: 166081
2012-10-17 00:41:14 +00:00
Greg Clayton cced1566e2 API cleanup.
llvm-svn: 166070
2012-10-16 22:58:25 +00:00
Jim Ingham 35e1bda695 Add the ability to set timeout & "run all threads" options both from the "expr" command and from
the SB API's that evaluate expressions.

<rdar://problem/12457211>

llvm-svn: 166062
2012-10-16 21:41:58 +00:00