Commit Graph

4677 Commits

Author SHA1 Message Date
Johnny Chen f087c8255e Add test case associated with:
rdar://problem/11034702

For the time being, skip the relevant disassemble action which resulted in a crash.

Minor modification (print out format) to the existing TestDisassembleRawBytes.py test file.

llvm-svn: 152822
2012-03-15 18:23:59 +00:00
Greg Clayton 0c94313d20 <rdar://problem/11052829>
Fixed a case where if you have a argument stirng that ends with a '\' character, it would infinite loop while consuming all of your memory.

Also fixed a case where non-quote terminated strings would inefficiently be handled.

llvm-svn: 152809
2012-03-15 17:10:48 +00:00
Han Ming Ong 2ee44a1e38 <rdar://11033946>
Made sure that the root XPC service validate the right before starting the service. The right is created and authenticated by clients (in this case, lldb) and transferred over for validiation.

llvm-svn: 152802
2012-03-15 15:37:50 +00:00
Sean Callanan cf12862a9a Strengthened LLDB's completion of object types.
Now when LLDB reports a variable, it has a
complete type.  Similarly, when it reports
members of a struct, it completes their types.
Also, when it creates the result variable for
an expression, it ensures that variable's type
is complete.

This ensures compliance with Clang's
expectations, preventing potential crashes.

llvm-svn: 152771
2012-03-15 01:53:17 +00:00
Greg Clayton 1b02c17391 <rdar://problem/11049371>
http://llvm.org/bugs/show_bug.cgi?id=12232

Fixed a case where a missing "break" in a switch statement could cause an assertion to fire and kill the debug session.

The fix was derived from the findings of Andrea Bigagli, thanks Andrea.

llvm-svn: 152741
2012-03-14 21:00:47 +00:00
Enrico Granata a88fdd3cdd Committing a patch from Filipe Cabecinhas
llvm-svn: 152733
2012-03-14 18:52:33 +00:00
Johnny Chen 24b5b8b7b8 Remove a debug statement.
llvm-svn: 152732
2012-03-14 18:35:38 +00:00
Sean Callanan cc5039dd9e Updating Xcode project version numbers for lldb-131 and debugserver-181
llvm-svn: 152726
2012-03-14 17:15:39 +00:00
Benjamin Kramer e6afc77a1b Makefile build: clang now depends on libclangEdit.
llvm-svn: 152710
2012-03-14 11:03:46 +00:00
Greg Clayton d64afba584 <rdar://problem/10434005>
Prepare LLDB to be built with C++11 by hiding all accesses to std::tr1 behind
macros that allows us to easily compile for either C++.

llvm-svn: 152698
2012-03-14 03:07:05 +00:00
Greg Clayton 29e08cbb9c <rdar://problem/11042408>
Fixed an issue with the FUNC_STARTS load command where we would get the
symbol size wrong and we would add all sorts of symbols due to bit zero being
set to indicate thumb.

llvm-svn: 152696
2012-03-14 01:53:24 +00:00
Jason Molenda 9def4c36be bump to lldb-130
llvm-svn: 152689
2012-03-14 00:03:49 +00:00
Jason Molenda 64cab1220a bump to debugserver-180
llvm-svn: 152687
2012-03-14 00:00:36 +00:00
Jason Molenda 9514fa3d39 On iOS builds, install debugserver in /Developer/usr/bin.
Also add a copy files phase for -target ios that installs
the debugserver launch plists.

llvm-svn: 152680
2012-03-13 23:29:39 +00:00
Greg Clayton a174349960 <rdar://problem/11034170>
Simplify the locking strategy for Module and its owned objects to always use the Module's mutex to avoid A/B deadlocks. We had a case where a symbol vendor was locking itself and then calling a function that would try to get it's Module's mutex and at the same time another thread had the Module mutex that was trying to get the SymbolVendor mutex. Now any classes that inherit from ModuleChild should use the module lock using code like:

void
ModuleChildSubclass::Function
{
	ModuleSP module_sp(GetModule());
	if (module_sp)
	{
    	lldb_private::Mutex::Locker locker(module_sp->GetMutex());
		... do work here...
	}
}

This will help avoid deadlocks by using as few locks as possible for a module and all its child objects and also enforce detecting if a module has gone away (the ModuleSP will be returned empty if the weak_ptr does refer to a valid object anymore).

llvm-svn: 152679
2012-03-13 23:14:29 +00:00
Enrico Granata 3f1052b7cf The Cocoa formatters now provide error messages for many of the common things-went-wrong situations. Previously they would say nothing or log failures to the Python console
llvm-svn: 152673
2012-03-13 21:52:00 +00:00
Jason Molenda 08441ba45e Send an "OK" response to the "D" (detach) packet.
v. http://sourceware.org/gdb/current/onlinedocs/gdb/Packets.html#Packets

the detach packet is supposed to send a reply.

llvm-svn: 152671
2012-03-13 21:10:35 +00:00
Johnny Chen a4ac217d6c rdar://problem/11031743
For EmulateInstructionARM::EmulatePUSH(), fix the logical branch for when pc is pushed to behave
like the other cases where:

    context.SetRegisterToRegisterPlusOffset (reg_info, sp_reg, addr - sp);

is called to inform of the operation to set a register value to a memory location calculated from
a base register plus an offset.

llvm-svn: 152670
2012-03-13 21:07:03 +00:00
Sean Callanan 632d2f729d Hardened the step-out plan in case it receives
bad stack IDs.

llvm-svn: 152630
2012-03-13 16:34:56 +00:00
Greg Clayton 9096603ae1 Bumped Xcode project versions for lldb-129 and debugserver-179.
llvm-svn: 152606
2012-03-13 02:26:21 +00:00
Jason Molenda 68fc21562f version bump to lldb-128
llvm-svn: 152603
2012-03-13 02:13:37 +00:00
Jason Molenda 0c482971e4 version bump to 178
llvm-svn: 152602
2012-03-13 02:12:55 +00:00
Jason Molenda d60205e68e Don't SKIP_INSTALL for sdk==iOS, install in to /usr/local/bin for now.
llvm-svn: 152601
2012-03-13 01:56:24 +00:00
Jason Molenda 16d7581fdb Pull in another plist from the old debugserver project.
Switch default compiler to clang.

llvm-svn: 152600
2012-03-13 01:23:54 +00:00
Jason Molenda f0d0b85da0 Mark newly added synthesizer calls as being #ifndef LLDB_DISABLE_PYTHON
llvm-svn: 152599
2012-03-13 01:19:42 +00:00
Enrico Granata 8c69c96dc9 Changed several of the Cocoa formatters to match the output style that Xcode uses internally to provide summaries
This has been done for those summaries where the difference is only cosmetic (e.g. naming things as items instead of values, ...)
The LLDB output style has been preserved when it provides more information (e.g. telling the type as well as the value of an NSNumber)

Test cases have been updated to reflect the updated output style where necessary

llvm-svn: 152592
2012-03-13 00:25:59 +00:00
Enrico Granata c7f873064b Added formatters for libc++ (http://libcxx.llvm.org):
std::string has a summary provider
 std::vector std::list and std::map have both a summary and a synthetic children provider
Given the usage of a custom namespace (std::__1::classname) for the implementation of libc++, we keep both libstdcpp and libc++ formatters enabled at the same time since that raises no conflicts and enabled for seamless transition between the two
The formatters for libc++ reside in a libcxx category, and are loaded from libcxx.py (to be found in examples/synthetic)

The formatters-stl test cases have been divided to be separate for libcxx and libstdcpp. This separation is necessary because
 (a) we need different compiler flags for libc++ than for libstdcpp
 (b) libc++ inlines a lot more than libstdcpp and some code changes were required to accommodate this difference

llvm-svn: 152570
2012-03-12 19:47:17 +00:00
Greg Clayton 701a6b473d <rdar://problem/11030692>
SBProcess::PutSTDIN() was not working for a few builds on darwin when using debugserver. This is now fixed.

llvm-svn: 152569
2012-03-12 19:02:41 +00:00
Sean Callanan ddcda28fee Disabled the i386 tests pending fixes in the JIT.
llvm-svn: 152568
2012-03-12 18:54:10 +00:00
Sean Callanan b7de960158 Hardened the process of reading the program counter
on behalf of a DWARF expression.

llvm-svn: 152477
2012-03-10 03:03:46 +00:00
Jim Ingham fd9de90123 Meta classes can't have dynamic types...
<rdar://problem/11021925>

llvm-svn: 152473
2012-03-10 02:03:37 +00:00
Sean Callanan 1fc91ad1c5 ...And finished the job.
llvm-svn: 152472
2012-03-10 02:00:32 +00:00
Sean Callanan d7dabe2237 Hardened isObjCObjectPointerType() against NULLs.
llvm-svn: 152471
2012-03-10 01:59:11 +00:00
Jason Molenda e23d854c05 Bump lldb version to lldb-127.
llvm-svn: 152465
2012-03-10 01:10:19 +00:00
Jason Molenda 5a37223ece Bump debugserver version to 177.
llvm-svn: 152464
2012-03-10 01:09:40 +00:00
Jason Molenda bdf4161ab7 Re-enable the use of the ARMDisassembler framework when building debugserver for ios.
Greg disabled this back in 2012-01-10 r147886 but we still need to use it.

<rdar://problem/11016745>

llvm-svn: 152463
2012-03-10 01:09:05 +00:00
Jim Ingham ab175242d9 Fix the process of getting the ObjC runtime - if we ask for it too early (in the process of handling the
load notification for the first load) then we will set it the runtime to NULL and won't re-search for it.
Added a way for the dynamic loader to force a re-search, since it knows the world has changed.

llvm-svn: 152453
2012-03-10 00:22:19 +00:00
Jim Ingham 329617a80a Make debugserver quieter about memory read errors.
<rdar://problem/10681220>

llvm-svn: 152438
2012-03-09 21:09:42 +00:00
Jim Ingham 34aae5b9bc Handle the case where we get called to determine the ObjC runtime version BEFORE the loader code has
winnowed all the unloaded libraries from the process module list.
<rdar://problem/11015223>

llvm-svn: 152427
2012-03-09 19:59:28 +00:00
Enrico Granata 332b0b9a2f Fixing a problem with the NSSet summary provider; plus, providing a further optimization to the whole Cocoa formatters infrastructure
llvm-svn: 152423
2012-03-09 19:04:53 +00:00
Greg Clayton 2bf10c3766 Bumping Xcode project versions for lldb-126 and debugserver-176.
llvm-svn: 152384
2012-03-09 04:31:41 +00:00
Greg Clayton b5225c863c Bumping Xcode project versions for lldb-126 and debugserver-176.
llvm-svn: 152383
2012-03-09 04:31:35 +00:00
Greg Clayton f3bb3e472f <rdar://problem/11016907>
Get function boundaries from the LC_FUNCTION_STARTS load command. This helps to determine symbol sizes and also allows us to be able to debug stripped binaries.

If you have a stack backtrace that goes through a function that has been stripped from the symbol table, the variables for any functions above that stack frame will most likely be incorrect. It can also affect our ability to step in/out/through of a function.

llvm-svn: 152381
2012-03-09 04:26:05 +00:00
Greg Clayton efbc7d2356 <rdar://problem/11016922>
Don't show variable values in Xcode when they are out of scope. This allows Xcode to step a lot faster when there are many variables in the variables view.

llvm-svn: 152380
2012-03-09 04:23:44 +00:00
Greg Clayton 8f15c829bf Remove a debug binary from the scheme.
llvm-svn: 152379
2012-03-09 04:22:55 +00:00
Jim Ingham 564d8bc255 First stage of implementing step by "run to next branch". Doesn't work yet, is turned off.
<rdar://problem/10975912>

llvm-svn: 152376
2012-03-09 04:10:47 +00:00
Enrico Granata 9d60f60760 Changed ValueObject to use a dedicated ChildrenManager class to store its children, instead of an std::vector
This solves an issue where a ValueObject was getting a wrong children count (usually, a huge value) and trying to resize the vector of children to fit that many ValueObject*

Added a loop detection algorithm to the synthetic children provider for std::list

Added a few more checks to the synthetic children provider for std::vector

Both std::list and std::vector's synthetic children providers now cache the count of children instead of recomputing it every time
std::map has a field that stores the count, so there is little need to cache it on our side

llvm-svn: 152371
2012-03-09 03:09:58 +00:00
Johnny Chen 934c05d284 Add the capability on OS X to utilize 'xcrun' to locate the compilers used for building the inferior programs
to be debugged while running the test suite.  By default, compilers is set to ['clang'] and can be overridden
using the "-C compilerA^compilerB" option.

llvm-svn: 152367
2012-03-09 02:11:37 +00:00
Enrico Granata eb55ad4ad7 the formatter for NSNotification was not being initialized correctly
llvm-svn: 152358
2012-03-09 00:45:19 +00:00
Johnny Chen 5a9a9883be Change the test driver so that, by default, it takes into consideration of both 'x86_64' and 'i386' architectures
when building the inferior programs.

Example:

/Volumes/data/lldb/svn/ToT/test $ ./dotest.py -v functionalities/watchpoint
LLDB build dir: /Volumes/data/lldb/svn/ToT/build/Debug
LLDB-123
Path: /Volumes/data/lldb/svn/ToT
URL: https://johnny@llvm.org/svn/llvm-project/lldb/trunk
Repository Root: https://johnny@llvm.org/svn/llvm-project
Repository UUID: 91177308-0d34-0410-b5e6-96231b3b80d8
Revision: 152244
Node Kind: directory
Schedule: normal
Last Changed Author: gclayton
Last Changed Rev: 152244
Last Changed Date: 2012-03-07 13:03:09 -0800 (Wed, 07 Mar 2012)



Session logs for test failures/errors/unexpected successes will go into directory '2012-03-08-16_43_51'
Command invoked: python ./dotest.py -v functionalities/watchpoint

Configuration: arch=x86_64
----------------------------------------------------------------------
Collected 21 tests

 1: test_hello_watchlocation_with_dsym (TestWatchLocation.HelloWatchLocationTestCase)
    Test watching a location with '-x size' option. ... ok
 2: test_hello_watchlocation_with_dwarf (TestWatchLocation.HelloWatchLocationTestCase)
    Test watching a location with '-x size' option. ... ok
 3: test_hello_watchpoint_with_dsym_using_watchpoint_set (TestMyFirstWatchpoint.HelloWatchpointTestCase)
    Test a simple sequence of watchpoint creation and watchpoint hit. ... ok
 4: test_hello_watchpoint_with_dwarf_using_watchpoint_set (TestMyFirstWatchpoint.HelloWatchpointTestCase)
    Test a simple sequence of watchpoint creation and watchpoint hit. ... ok
 5: test_watchpoint_multiple_threads_with_dsym (TestWatchpointMultipleThreads.WatchpointForMultipleThreadsTestCase)
    Test that lldb watchpoint works for multiple threads. ... ok
 6: test_watchpoint_multiple_threads_with_dwarf (TestWatchpointMultipleThreads.WatchpointForMultipleThreadsTestCase)
    Test that lldb watchpoint works for multiple threads. ... ok
 7: test_rw_disable_after_first_stop__with_dwarf (TestWatchpointCommands.WatchpointCommandsTestCase)
    Test read_write watchpoint but disable it after the first stop. ... ok
 8: test_rw_disable_after_first_stop_with_dsym (TestWatchpointCommands.WatchpointCommandsTestCase)
    Test read_write watchpoint but disable it after the first stop. ... ok
 9: test_rw_disable_then_enable_with_dsym (TestWatchpointCommands.WatchpointCommandsTestCase)
    Test read_write watchpoint, disable initially, then enable it. ... ok
10: test_rw_disable_then_enable_with_dwarf (TestWatchpointCommands.WatchpointCommandsTestCase)
    Test read_write watchpoint, disable initially, then enable it. ... ok
11: test_rw_watchpoint_delete_with_dsym (TestWatchpointCommands.WatchpointCommandsTestCase)
    Test delete watchpoint and expect not to stop for watchpoint. ... ok
12: test_rw_watchpoint_delete_with_dwarf (TestWatchpointCommands.WatchpointCommandsTestCase)
    Test delete watchpoint and expect not to stop for watchpoint. ... ok
13: test_rw_watchpoint_set_ignore_count_with_dsym (TestWatchpointCommands.WatchpointCommandsTestCase)
    Test watchpoint ignore count and expect to not to stop at all. ... ok
14: test_rw_watchpoint_set_ignore_count_with_dwarf (TestWatchpointCommands.WatchpointCommandsTestCase)
    Test watchpoint ignore count and expect to not to stop at all. ... ok
15: test_rw_watchpoint_with_dsym (TestWatchpointCommands.WatchpointCommandsTestCase)
    Test read_write watchpoint and expect to stop two times. ... ok
16: test_rw_watchpoint_with_dwarf (TestWatchpointCommands.WatchpointCommandsTestCase)
    Test read_write watchpoint and expect to stop two times. ... ok
17: test_watchpoint_cond_with_dsym (TestWatchpointConditionCmd.WatchpointConditionCmdTestCase)
    Test watchpoint condition. ... ok
18: test_watchpoint_cond_with_dwarf (TestWatchpointConditionCmd.WatchpointConditionCmdTestCase)
    Test watchpoint condition. ... ok
19: test_watchlocation_with_dsym_using_watchpoint_set (TestWatchLocationWithWatchSet.WatchLocationUsingWatchpointSetTestCase)
    Test watching a location with 'watchpoint set expression -w write -x size' option. ... ok
20: test_watchlocation_with_dwarf_using_watchpoint_set (TestWatchLocationWithWatchSet.WatchLocationUsingWatchpointSetTestCase)
    Test watching a location with 'watchpoint set expression -w write -x size' option. ... ok
21: test_error_cases_with_watchpoint_set (TestWatchpointSetErrorCases.WatchpointSetErrorTestCase)
    Test error cases with the 'watchpoint set' command. ... ok

----------------------------------------------------------------------
Ran 21 tests in 74.590s

OK

Configuration: arch=i386
----------------------------------------------------------------------
Collected 21 tests

 1: test_hello_watchlocation_with_dsym (TestWatchLocation.HelloWatchLocationTestCase)
    Test watching a location with '-x size' option. ... ok
 2: test_hello_watchlocation_with_dwarf (TestWatchLocation.HelloWatchLocationTestCase)
    Test watching a location with '-x size' option. ... ok
 3: test_hello_watchpoint_with_dsym_using_watchpoint_set (TestMyFirstWatchpoint.HelloWatchpointTestCase)
    Test a simple sequence of watchpoint creation and watchpoint hit. ... ok
 4: test_hello_watchpoint_with_dwarf_using_watchpoint_set (TestMyFirstWatchpoint.HelloWatchpointTestCase)
    Test a simple sequence of watchpoint creation and watchpoint hit. ... ok
 5: test_watchpoint_multiple_threads_with_dsym (TestWatchpointMultipleThreads.WatchpointForMultipleThreadsTestCase)
    Test that lldb watchpoint works for multiple threads. ... ok
 6: test_watchpoint_multiple_threads_with_dwarf (TestWatchpointMultipleThreads.WatchpointForMultipleThreadsTestCase)
    Test that lldb watchpoint works for multiple threads. ... ok
 7: test_rw_disable_after_first_stop__with_dwarf (TestWatchpointCommands.WatchpointCommandsTestCase)
    Test read_write watchpoint but disable it after the first stop. ... ok
 8: test_rw_disable_after_first_stop_with_dsym (TestWatchpointCommands.WatchpointCommandsTestCase)
    Test read_write watchpoint but disable it after the first stop. ... ok
 9: test_rw_disable_then_enable_with_dsym (TestWatchpointCommands.WatchpointCommandsTestCase)
    Test read_write watchpoint, disable initially, then enable it. ... ok
10: test_rw_disable_then_enable_with_dwarf (TestWatchpointCommands.WatchpointCommandsTestCase)
    Test read_write watchpoint, disable initially, then enable it. ... ok
11: test_rw_watchpoint_delete_with_dsym (TestWatchpointCommands.WatchpointCommandsTestCase)
    Test delete watchpoint and expect not to stop for watchpoint. ... ok
12: test_rw_watchpoint_delete_with_dwarf (TestWatchpointCommands.WatchpointCommandsTestCase)
    Test delete watchpoint and expect not to stop for watchpoint. ... ok
13: test_rw_watchpoint_set_ignore_count_with_dsym (TestWatchpointCommands.WatchpointCommandsTestCase)
    Test watchpoint ignore count and expect to not to stop at all. ... ok
14: test_rw_watchpoint_set_ignore_count_with_dwarf (TestWatchpointCommands.WatchpointCommandsTestCase)
    Test watchpoint ignore count and expect to not to stop at all. ... ok
15: test_rw_watchpoint_with_dsym (TestWatchpointCommands.WatchpointCommandsTestCase)
    Test read_write watchpoint and expect to stop two times. ... ok
16: test_rw_watchpoint_with_dwarf (TestWatchpointCommands.WatchpointCommandsTestCase)
    Test read_write watchpoint and expect to stop two times. ... ok
17: test_watchpoint_cond_with_dsym (TestWatchpointConditionCmd.WatchpointConditionCmdTestCase)
    Test watchpoint condition. ... ok
18: test_watchpoint_cond_with_dwarf (TestWatchpointConditionCmd.WatchpointConditionCmdTestCase)
    Test watchpoint condition. ... ok
19: test_watchlocation_with_dsym_using_watchpoint_set (TestWatchLocationWithWatchSet.WatchLocationUsingWatchpointSetTestCase)
    Test watching a location with 'watchpoint set expression -w write -x size' option. ... ok
20: test_watchlocation_with_dwarf_using_watchpoint_set (TestWatchLocationWithWatchSet.WatchLocationUsingWatchpointSetTestCase)
    Test watching a location with 'watchpoint set expression -w write -x size' option. ... ok
21: test_error_cases_with_watchpoint_set (TestWatchpointSetErrorCases.WatchpointSetErrorTestCase)
    Test error cases with the 'watchpoint set' command. ... ok

----------------------------------------------------------------------
Ran 21 tests in 67.059s

OK

llvm-svn: 152357
2012-03-09 00:44:59 +00:00
Jason Molenda e83bc02b16 Bump to lldb-125.
llvm-svn: 152353
2012-03-08 23:25:56 +00:00
Johnny Chen 5d34629daf Fixed a crasher when Xcode calls into ScriptInterpreterPython::ResetOutputFileHandle().
The Locker should only perform acquire/free lock operation, but no enter/leave session
at all.  Also added sanity checks for items passed to the PyDict_SetItemString() calls.

llvm-svn: 152337
2012-03-08 20:53:04 +00:00
Greg Clayton ef5a7b1c36 Bumping Xcode project version for lldb-124 and debugserver-175.
llvm-svn: 152294
2012-03-08 04:15:20 +00:00
Jason Molenda 82df6635fe Use a new define, NO_XPC_SERVICES, to indicate that macosx/Host.mm
shouldn't compile any of the XPC support code.  

Update macosx/Host.mm to use that define.

Add a LLDB_DISABLE_PYTHON ifdef block around a new function in 
Core/FormatManager.cpp.

<rdar://problem/10942125>

llvm-svn: 152293
2012-03-08 04:03:25 +00:00
Greg Clayton 85f3fa5411 <rdar://problem/11007934>
On darwin, if child process of process being debugged dies due to mach exception, the debugged process will die.

debugserver now only handles the mach exceptions for the task being debugged.

llvm-svn: 152291
2012-03-08 03:27:27 +00:00
Sean Callanan 226b70c154 Updated the revision of LLVM/Clang used by LLDB.
This takes two important changes:

- Calling blocks is now supported.  You need to
  cast their return values, but that works fine.

- We now can correctly run JIT-compiled
  expressions that use floating-point numbers.

Also, we have taken a fix that allows us to
ignore access control in Objective-C as in C++.

llvm-svn: 152286
2012-03-08 02:39:03 +00:00
Greg Clayton ecc7c0d817 Moved inline functions into SBTarget.cpp and made destructors for SBLaunchInfo and SBAttachInfo to avoid link warnings.
llvm-svn: 152267
2012-03-07 23:52:51 +00:00
Greg Clayton 8f89a7b0b8 Make sure the byte size is correct when dumping as it may need to be calculated on the fly.
llvm-svn: 152265
2012-03-07 23:30:39 +00:00
Greg Clayton 94b1cd022c Revert the default debugger to LLDB.
llvm-svn: 152263
2012-03-07 23:05:14 +00:00
Greg Clayton fba33af11c <rdar://problem/10993996>
Added a new makefile target to help us with Apple builds where the installhdrs
will copy the headers for the shared library. Prior to this fix, the install
headers directory would contain the unix style paths to all public header
files ("#include lldb/API/SBDefines.h") instead of the fixed up framework
header paths ("#include <LLDB/SBDefines.h>").

llvm-svn: 152253
2012-03-07 22:47:26 +00:00
Sean Callanan a8b3dbf20f Look up ivar offset symbols correctly. We now
treat Objective-C ivar symbols as their own kind
of symbol rather than lumping them in with generic
"runtime" symbols.

llvm-svn: 152251
2012-03-07 22:29:49 +00:00
Jim Ingham 3d90292297 When comparing a Thread against a ThreadSpec, don't fetch the Thread's Name or QueueName if the ThreadSpec doesn't specify them.
llvm-svn: 152245
2012-03-07 22:03:04 +00:00
Greg Clayton e761213428 <rdar://problem/10997402>
This fix really needed to happen as a previous fix I had submitted for
calculating symbol sizes made many symbols appear to have zero size since
the function that was calculating the symbol size was calling another function
that would cause the calculation to happen again. This resulted in some symbols
having zero size when they shouldn't. This could then cause infinite stack
traces and many other side affects.

llvm-svn: 152244
2012-03-07 21:03:09 +00:00
Johnny Chen 2c76eb02a9 rdar://problem/10998562
lldb crashes under guard malloc

Fix CommandObjectSettingsAppend::ExecuteRawCommandString() so that it does not perform the cmd_args.Shift()
operation after it has got the var_name out of the raw string, since StringRef is manipulating the raw
string later on.

llvm-svn: 152194
2012-03-07 02:09:02 +00:00
Johnny Chen c79c93ad96 rdar://problem/10611315
expression command doesn't handle xmm or stmm registers...

o Update ClangASTContext::GetBuiltinTypeForEncodingAndBitSize() to now handle eEncodingVector.

o Modify RegisterValue::SetFromMemoryData() to fix the subtle error due to unitialized variables.

o Add a test file for "expr $xmm0".

llvm-svn: 152190
2012-03-07 01:12:24 +00:00
Enrico Granata eb06e25242 Fixing some of the new Python formatters to report '1 object' instead of '1 objects'
llvm-svn: 152186
2012-03-07 00:56:09 +00:00
Han Ming Ong e86f8f4df9 <rdar://10996650>
Passed in the right number of parameters for CFDictionaryCreate

llvm-svn: 152182
2012-03-07 00:32:38 +00:00
Enrico Granata a73b7df7de Using the new ScriptInterpreterObject in the implementation of synthetic children to enhance type safety
Several places in the ScriptInterpreter interface used StringList objects where an std::string would suffice - Fixed
Refactoring calls that generated special-purposes functions in the Python interpreter to use helper functions instead of duplicating blobs of code

llvm-svn: 152164
2012-03-06 23:42:15 +00:00
Enrico Granata 297e69f15e Fixing an issue where a ValueObject had changed its value but the 'value changed' flag was not being set. This was breaking one of our test cases
llvm-svn: 152161
2012-03-06 23:21:16 +00:00
Greg Clayton 9c76611055 Added the ability to disassembly "count" instructions given a SBAddress.
This was done in SBTarget:

lldb::SBInstructionList
lldb::SBTarget::ReadInstructions (lldb::SBAddress base_addr, uint32_t count);

Also cleaned up a few files in the LLDB.framework settings.

llvm-svn: 152152
2012-03-06 22:24:44 +00:00
Sean Callanan 75383bf34d Added support for calling blocks from expressions,
but gated by an #ifdef until we roll LLVM/Clang to
bring in the necessary parser support.

llvm-svn: 152149
2012-03-06 21:56:33 +00:00
Sean Callanan 20a33d5f65 Don't return bare symbols when asked to search
inside a namespace.  This bypasses local variables.

llvm-svn: 152144
2012-03-06 20:53:06 +00:00
Jim Ingham f0fd55e631 Fix a little nit with exception breakpoints for C++, the expression parser wants to be
more aggressive about trapping exceptions than a user would be.  Make it so...

llvm-svn: 152125
2012-03-06 18:10:38 +00:00
Greg Clayton 6a820b624b Bumping Xcode project versions for lldb-123 and debugserver-174.
llvm-svn: 152103
2012-03-06 04:02:03 +00:00
Greg Clayton 9845a8d54d <rdar://problem/10840355>
Fixed STDERR to not be opened as readable. Also cleaned up some of the code that implemented the file actions as some of the code was using the wrong variables, they now use the right ones (in for stdin, out for stdout, err for stderr).

llvm-svn: 152102
2012-03-06 04:01:04 +00:00
Jim Ingham 97f7e81891 Add a test case and fix the C++ exception symbols.
llvm-svn: 152101
2012-03-06 03:52:02 +00:00
Greg Clayton 6a1edd70cf Bumped project Xcode project version for lldb-122 and debugserver-173.
llvm-svn: 152088
2012-03-06 01:36:31 +00:00
Enrico Granata 6014590824 Fixing a crasher bug where we were not checking for NULL before trying to retrieve the format for a type
llvm-svn: 152087
2012-03-06 01:28:31 +00:00
Johnny Chen da324de971 rdar://problem/10267705
Clarification on the error message when the display format (eFormatBytes/eFormatBytesWithASCII) conflicts
with the byte size.

llvm-svn: 152084
2012-03-06 01:17:59 +00:00
Jim Ingham fab10e89ce Add a command and an SB API to create exception breakpoints. Make the break output prettier for Exception breakpoints.
llvm-svn: 152081
2012-03-06 00:37:27 +00:00
Greg Clayton e16e2d02ea <rdar://problem/10986692>
Safeguard against building on next OS and run on current OS.

llvm-svn: 152077
2012-03-06 00:24:17 +00:00
Sean Callanan bb6e7edd32 Made sure to store the type for "this" when in a
C++ method.

llvm-svn: 152064
2012-03-05 22:08:20 +00:00
Enrico Granata 3508487f37 Copying a new file required for the updated formatters to work into LLDB.framework
llvm-svn: 152053
2012-03-05 20:05:24 +00:00
Enrico Granata cfdafa37b4 Several performance-oriented changes to the introspecting data formatters:
(a) the SystemParameters object is now passed around to the formatters; doing so enables the formatters to reuse computed values for things such as pointer-size and endianness
     instead of repeatedly computing these on their own
 (b) replacing the global ISA cache with a per-process one
 (c) providing a per-process types cache where each formatter can store the types it needs to operate, and be sure to find them the next time without recalculating them
     this also enables formatters to share types if they agree on a local naming convention
 (d) lazy fetching of data from Objective-C runtime data structures
     data is fetched as needed and we stop reading as soon as we determine that an ISA is actually garbage

llvm-svn: 152052
2012-03-05 19:56:33 +00:00
Johnny Chen 35e2ab6039 rdar://problem/10976649
Add SBFrame::IsEqual(const SBFrame &that) method and export it to the Python binding.
Alos add a test case test_frame_api_IsEqual() to TestFrames.py file.

llvm-svn: 152050
2012-03-05 19:53:24 +00:00
Johnny Chen d1adb79010 Add two expectedFailure decorators with radar number.
llvm-svn: 152049
2012-03-05 19:48:28 +00:00
Johnny Chen 641e95de86 Minor cleanup.
llvm-svn: 152038
2012-03-05 18:25:29 +00:00
Jim Ingham 219ba1969b Make it possible to set Exception breakpoints when the target doesn't yet
have a process, then fetch the right runtime resolver when the process is made.

llvm-svn: 152015
2012-03-05 04:47:34 +00:00
Enrico Granata 7a3b1d9757 Correct wrong values in the test case
llvm-svn: 151982
2012-03-03 18:29:21 +00:00
Jason Molenda f7b4b56344 Remove "llvm" from list of things to ignore. This results in the
files in source/Plugins/Disassembler/llvm not being handled properly
by git.

llvm-svn: 151969
2012-03-03 06:43:59 +00:00
Enrico Granata 89fd064582 Currently TestDataFormatterPythonSynth is failing because of an issue with children capping. Splitting the test case in two so we better isolate the issue and also for better logical separation
llvm-svn: 151966
2012-03-03 03:13:03 +00:00
Jim Ingham 133e0fb3c6 First step to making an LanguageRuntime Exception breakpoint API.
<rdar://problem/10196277>

llvm-svn: 151965
2012-03-03 02:05:11 +00:00
Enrico Granata 385ad4e401 added a new formatter for CF(Mutable)BitVector
fixed a few potential NULL-pointer derefs in ValueObject
we have a way to provide docstrings for properties we add to the SWIG layer - a few of these properties have a docstring already, more will come in future commits
added a new bunch of properties to SBData to make it more natural and Python-like to access the data they contain

llvm-svn: 151962
2012-03-03 00:45:57 +00:00
Greg Clayton 44f6bddb17 <rdar://problem/10974749>
Added more cases to deal with new default compiler driver flags that were making builds fail.

llvm-svn: 151954
2012-03-02 23:25:41 +00:00
Sean Callanan 7725a4630d Added a function to the disassembler that checks
(from the mnemonic) whether an instruction is a
branch.  This function's result is exposed through
DoesBranch().

llvm-svn: 151953
2012-03-02 23:22:53 +00:00
Greg Clayton ba3c8df4d9 Bumped Xcode project versions for lldb-121 and debugserver-172
llvm-svn: 151948
2012-03-02 22:36:23 +00:00
Greg Clayton 653028fe36 <rdar://problem/10974749>
Hack our project file to deal with new default compiler driver flags that were making builds fail.

llvm-svn: 151946
2012-03-02 22:28:46 +00:00
Jim Ingham a748664c9d And remove the control character that somehow found its way into the last checkin...
llvm-svn: 151941
2012-03-02 21:35:20 +00:00
Jim Ingham bc4abcb2cb For Sean: handle the case where you are asked for a 0 byte allocation with 0 alignment.
llvm-svn: 151940
2012-03-02 21:34:28 +00:00
Johnny Chen 213ba7c7c3 rdar://problem/10652076
Add logic to GDBRemoteRegisterContext class to be able to read/write a "composite" register
which has "primordial" registers as its constituents.  In particular, Read/WriteRegisterBytes()
now delegate to Get/SetPrimordialRegister() helper methods to read/write register contents.

Also modify RegisterValue class to be able to parse "register write" string value for the
NEON quadword registers which is displayed as a vector of uint8's.

Example:

(lldb) register write q0 "{0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0a 0x0b 0x0c 0x0d 0x0e 0x0f 0x10}"
(lldb) register read q0
q0 = {0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0a 0x0b 0x0c 0x0d 0x0e 0x0f 0x10}
(lldb) register read --format uint8_t[] s0
s0 = {0x01 0x02 0x03 0x04}
(lldb) register read --format uint8_t[] d0
d0 = {0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08}
(lldb) register read --format uint8_t[] d1
d1 = {0x09 0x0a 0x0b 0x0c 0x0d 0x0e 0x0f 0x10}

llvm-svn: 151939
2012-03-02 21:32:50 +00:00
Sean Callanan 72ae832f1b Prevent assertions because of zero-sized sections,
while still ensuring that the sections get remote
allocations.

llvm-svn: 151936
2012-03-02 20:59:34 +00:00
Enrico Granata 242d9838c6 Adding a test case for a bug where types CFGregorianDate and CFRange were improperly uniqued by LLDB such that both where shown as having the same structure contents - The bug itself is fixed in TOT but we want to catch regressions ASAP
llvm-svn: 151929
2012-03-02 18:47:26 +00:00
Enrico Granata cdf38a7ffb Removing a spurious print statement leftover from debugging the formatter code
llvm-svn: 151928
2012-03-02 18:35:06 +00:00
Greg Clayton 4a49a1ff7a Bumping Xcode project versions for lldb-120 and debugserver-171.
llvm-svn: 151924
2012-03-02 17:44:37 +00:00
Greg Clayton da171f1176 Fixed Symbol objects being able to get their byte size.
llvm-svn: 151878
2012-03-02 03:01:16 +00:00
Jim Ingham 85c13d788d Make sure breakpoint partial name matches occur on namespace boundaries.
<rdar://problem/10720345> "break set -n" name matching should only match at namespace boundaries

llvm-svn: 151876
2012-03-02 02:24:42 +00:00
Enrico Granata 8dfdd89433 having std::vector still show children even if it now has a builtin summary - having the std::vector test case deal with the fact that we now have said builtin summary
llvm-svn: 151870
2012-03-02 01:14:02 +00:00
Sean Callanan e8c0cfbb00 Improved the type's handling of anonymous structs,
so that the expression parser can look up members
of anonymous structs correctly.  This meant creating
all the proper IndirectFieldDecls in each Record
after it has been completely populated with members.

llvm-svn: 151868
2012-03-02 01:03:45 +00:00
Han Ming Ong 04cf1bad35 <rdar://problem/10967188>
When using launch_info for launching with a target already set, we should just prepend the target's path as the first argument.

llvm-svn: 151867
2012-03-02 01:02:04 +00:00
Enrico Granata 8d5c83f6ef (a) adding formatters for:
NSTimeZone and CFTimeZonRef
 SEL and related types
 CFGregorianDate

llvm-svn: 151866
2012-03-02 00:55:53 +00:00
Greg Clayton 123edca0a9 <rdar://problem/10967107>
Don't try and unique anonymous struct/union/class types.

llvm-svn: 151863
2012-03-02 00:07:15 +00:00
Greg Clayton 29c5e5bb7d Bumped Xcode project version for lldb-119 and debugserver-170.
llvm-svn: 151836
2012-03-01 21:07:11 +00:00
Greg Clayton f4356d00f3 Hardcode the identifier and the execution name in debugserver since we put this into a section and not Xcode variable expansion happens.
llvm-svn: 151835
2012-03-01 21:06:20 +00:00
Jim Ingham 6b35c86fbe Purge a couple more uses of stack count for stepping.
llvm-svn: 151833
2012-03-01 20:01:22 +00:00
Enrico Granata 74ec8f9c50 this fixes unicode strings handling in 32-bit mode on Lion
llvm-svn: 151831
2012-03-01 19:48:54 +00:00
Greg Clayton 3442d46eac <rdar://problem/10963899>
Allow debugserver to be built on a newer kernel and still allow debugging on
older kernels.

llvm-svn: 151827
2012-03-01 19:35:09 +00:00
Enrico Granata 896cd1d3e6 (a) adding an introspection formatter for NS(Mutable)IndexSet
(b) fixes and improvements to the formatters for NSDate and NSString
(c) adding an introspection formatter for NSCountedSet
(d) making the Objective-C formatters test cases pass on both 64 and 32 bit
    one of the test cases is marked as expected failure on i386 - support needs to be added to the LLDB core for it to pass

llvm-svn: 151826
2012-03-01 19:32:33 +00:00
Jim Ingham d95752f240 Add an option to sort by packet count (rather than time). Also print the count,
and to print the total count & time in the header.

llvm-svn: 151823
2012-03-01 18:57:51 +00:00
Greg Clayton bf360a3808 Patch to fix GCC build from Dmitry Vyukov.
llvm-svn: 151820
2012-03-01 17:47:51 +00:00
Greg Clayton 221bae896c Fixed the incorrect LLVM configuration to be "Release".
llvm-svn: 151802
2012-03-01 04:44:54 +00:00
Enrico Granata 0c489f58cd 1) solving a bug where, after Jim's fixes to stack frames, synthetic children were not recalculated when necessary, causing them to get out of sync with live data
2) providing an updated list of tagged pointers values for the objc_runtime module - hopefully this one is final
3) changing ValueObject::DumpValueObject to use an Options class instead of providing a bulky list of parameters to pass around
   this change had been laid out previously, but some clients of DumpValueObject() were still using the old prototype and some arguments
   were treated in a special way and passed in directly instead of through the Options class
4) providing new GetSummaryAsCString() and GetValueAsCString() calls in ValueObject that are passed a formatter object and a destination string
   and fill the string by formatting themselves using the formatter argument instead of the default for the current ValueObject
5) removing the option to have formats and summaries stick to a variable for the current stoppoint
   after some debate, we are going with non-sticky: if you say frame variable --format hex foo, the hex format will only be applied to the current command execution and not stick when redisplaying foo
   the other option would be full stickiness, which means that foo would be formatted as hex for its whole lifetime
   we are open to suggestions on what feels "natural" in this regard

llvm-svn: 151801
2012-03-01 04:24:26 +00:00
Greg Clayton 7d436b8994 Changed the default installation paths for lldb for BuildAndIntegration builds.
llvm-svn: 151799
2012-03-01 04:16:38 +00:00
Jason Molenda f9196a259c Remove the sanity checks from RegisterContextLLDB::InitializeZerothFrame
which require a valid CFA address to create a stack frame.  On connecting
to just-starting-up hardware we may have a stack pointer/frame pointer of 0
but we should still create a stack frame so other code in lldb can retrieve
register values via a stackframe.

llvm-svn: 151796
2012-03-01 03:19:01 +00:00
Jim Ingham 376c485493 If the unwinder fails to make us a frame 0, make one by hand from the SP & PC.
llvm-svn: 151793
2012-03-01 02:53:40 +00:00
Sean Callanan 6d1c372c04 Added a testcase verifying that forward declarations
of Objective-C classes in header files are correctly
resolved in the final type.

llvm-svn: 151790
2012-03-01 02:06:31 +00:00
Sean Callanan d5f33a86f0 Updated LLVM to take a new MC JIT that supports
allocations by section.  We install these sections
in the target process and inform the JIT of their
new locations.

Also removed some unused variable warnings.

llvm-svn: 151789
2012-03-01 02:03:47 +00:00
Jim Ingham b5c0d1ccbd Convert the thread plans over from using the stack count to do their logic to using StackID's. This
should be more efficient.

llvm-svn: 151780
2012-03-01 00:50:50 +00:00
Johnny Chen bc34a59d8f Fix a typo in comment.
llvm-svn: 151759
2012-02-29 21:51:13 +00:00
Johnny Chen 6600bc92b2 rdar://problem/10652076
Incremental check in to calculate the offsets of registers correctly.  Registers can be primordial or composite,
for example, r0-r12 are primordial, s0-s31 are primordial, while q0 is composite consisting of (s0, s1, s2, s3).
Modify q0-q8 to be composed of the primordial s0-s31 registers.

llvm-svn: 151757
2012-02-29 21:44:11 +00:00
Enrico Granata 0448d9fe2b Fixing a problem with v1 runtime - plus hopefully finalizing the code to check for tagged pointers
llvm-svn: 151753
2012-02-29 20:46:00 +00:00
Jim Ingham 1692b90130 Use the correct (computed by the unwinder) CallFrameAddress as the CFA for Frame 0 rather than using the stack pointer which is not constant over the life of the frame.
llvm-svn: 151744
2012-02-29 19:58:25 +00:00
Greg Clayton 435d85a2c2 Filled in two missing values when dynamically making register info structs.
llvm-svn: 151742
2012-02-29 19:27:27 +00:00
Han Ming Ong bee9839770 <rdar://10949461>
Only set the ProcessSP when the attach is successful.

llvm-svn: 151741
2012-02-29 19:16:40 +00:00
Greg Clayton 9029f2d8e0 Fixed the install path for the XPC binaries. Added 3 aggregate targets:
"desktop" - build all binaries with XPC
"desktop_no_xcp" - build all binaries with none of the XPC binaries
"ios" - build all binaries with special iOS install settings.

Bumped the Xcode project build version for lldb-118 and debugserver-169.

llvm-svn: 151740
2012-02-29 19:16:02 +00:00
Greg Clayton 64d6eb1195 Removed an unused logging API call.
llvm-svn: 151736
2012-02-29 18:34:11 +00:00
Sean Callanan 3f548137d0 Made the IR interpreter handle GetElementPtr instructions
with non-constant indexes.

llvm-svn: 151734
2012-02-29 17:57:18 +00:00
Jason Molenda 7ac23ac422 Fix a recursion that could happen when creating the first frame in
an unwind because RegisterContextLLDB::InitializeZerothFrame() would
create a minimal stack frame to fetch the pc value of the current
instruction.  This proved fragile when another section of code was
trying to create the first stack frame and UnwindLLDB called
RegisterContextLLDB which tried to create its minimal stack frame.

Instead, get the live RegisterContext, retrieve the pc value from
the registers, and create an Address object from that.

llvm-svn: 151714
2012-02-29 11:25:29 +00:00
Greg Clayton a9f7b79dfe <rdar://problem/10605072>
Added the ability to override command line commands. In some cases GUI interfaces
might want to intercept commands like "quit" or "process launch" (which might cause
the process to re-run). They can now do so by overriding/intercepting commands
by using functions added to SBCommandInterpreter using a callback function. If the
callback function returns true, the command is assumed to be handled. If false
is returned the command should be evaluated normally.

Adopted this up in the Driver.cpp for intercepting the "quit" command.

llvm-svn: 151708
2012-02-29 04:21:24 +00:00
Jim Ingham b0c72a5f58 Make the StackFrameList::GetFrameAtIndex only fetch as many stack frames as needed to
get the frame requested.
<rdar://problem/10943135>

llvm-svn: 151705
2012-02-29 03:40:22 +00:00
Enrico Granata 7bc0ec3aad This commit:
a) adds a Python summary provider for NSDate
 b) changes the initialization for ScriptInterpreter so that we are not passing a bulk of Python-specific function pointers around
 c) provides a new ScriptInterpreterObject class that allows for ref-count safe wrapping of scripting objects on the C++ side
 d) contains much needed performance improvements:
    1) the pointer to the Python function generating a scripted summary is now cached instead of looked up every time
    2) redundant memory reads in the Python ObjC runtime wrapper are eliminated
    3) summaries now use the m_summary_str in ValueObject to store their data instead of passing around ( == copying) an std::string object
 e) contains other minor fixes, such as adding descriptive error messages for some cases of summary generation failure

llvm-svn: 151703
2012-02-29 03:28:49 +00:00
Johnny Chen 1cf107c433 Patch from Filipe Cabecinhas!
Attached is a small python fix to save the current stout and std err when starting a python session, then diverting them (as it was before), and restoring the previous values afterwards. Otherwise, a python script could suddenly find itself without output.

llvm-svn: 151693
2012-02-29 01:52:13 +00:00
Johnny Chen e979eda7e0 rdar://problem/10652076
Initial step -- infrastructure change -- to fix the bug.  Change the RegisterInfo data structure
to contain two additional fields (uint32_t *value_rges and uint32_t *invalidate_regs) to facilitate
architectures which have register mapping.

Update all existing RegsiterInfo arrays to have two extra NULL's (the additional fields) in each row,
GDBRemoteRegisterContext.cpp is modified to add d0-d15 and q0-q15 register info entries which take
advantage of the value_regs field to specify the containment relationship:

d0 -> (s0, s1)
...
d15 -> (s30, s31)
q0 -> (d0, d1)
...
q15 -> (d30, d31)

llvm-svn: 151686
2012-02-29 01:07:59 +00:00
Han Ming Ong cec8c90a2e <rdar://10950312>
Need to GetProcess() to set the uid of the process to attach.

llvm-svn: 151679
2012-02-29 00:12:56 +00:00
Han Ming Ong 1c0c51a51a <rdar://10950196>
Returns true when there is any info retrieved.

llvm-svn: 151678
2012-02-29 00:09:16 +00:00
Han Ming Ong ea4e8492a0 Fixed a crasher for remote device debugging.
llvm-svn: 151677
2012-02-29 00:08:13 +00:00
Greg Clayton 352c2e07fd Fix the linux build now that we link against the Linux and FreeBSD platforms.
llvm-svn: 151642
2012-02-28 18:25:00 +00:00
Johnny Chen 64e2e516bc Forgot to check in this file with r151593.
llvm-svn: 151640
2012-02-28 18:16:44 +00:00
Sean Callanan 378ecbe6f4 Extended the IR interpreter to support symbols
that have valid load addresses.

llvm-svn: 151636
2012-02-28 17:55:31 +00:00
Jason Molenda a962eab24f Add one more define for sdk==iphoneos.
llvm-svn: 151606
2012-02-28 01:42:10 +00:00
Han Ming Ong 8bd6a81b10 <rdar://problem/10942472>
Allows the debugger to put a more sensible prompt when debugging as root.

llvm-svn: 151605
2012-02-28 01:18:30 +00:00