Commit Graph

4743 Commits

Author SHA1 Message Date
Greg Clayton 47037bc4d7 Fixed a few things in the ELF object file:
1 - sections only get a valid VM size if they have SHF_ALLOC in the section flags
2 - symbol names are marked as mangled if they start with "_Z"

Also fixed the DWARF parser to correctly use the section file size when extracting the DWARF.

llvm-svn: 153496
2012-03-27 02:40:46 +00:00
Enrico Granata c5bc412cf6 Synthetic values are now automatically enabled and active by default. SBValue is set up to always wrap a synthetic value when one is available.
A new setting enable-synthetic-value is provided on the target to disable this behavior.
There also is a new GetNonSyntheticValue() API call on SBValue to go back from synthetic to non-synthetic. There is no call to go from non-synthetic to synthetic.
The test suite has been changed accordingly.
Fallout from changes to type searching: an hack has to be played to make it possible to use maps that contain std::string due to the special name replacement operated by clang
Fixing a test case that was using libstdcpp instead of libc++ - caught as a consequence of said changes to type searching

llvm-svn: 153495
2012-03-27 02:35:13 +00:00
Greg Clayton 84db9105d2 <rdar://problem/11113279>
Fixed type lookups to "do the right thing". Prior to this fix, looking up a type using "foo::bar" would result in a type list that contains all types that had "bar" as a basename unless the symbol file was able to match fully qualified names (which our DWARF parser does not). 

This fix will allow type matches to be made based on the basename and then have the types that don't match filtered out. Types by name can be fully qualified, or partially qualified with the new "bool exact_match" parameter to the Module::FindTypes() method.

This fixes some issue that we discovered with dynamic type resolution as well as improves the overall type lookups in LLDB.

llvm-svn: 153482
2012-03-26 23:03:23 +00:00
Johnny Chen 41b77265e3 If creation of watchpoint failed on the device, make sure the list maintained by the target reflects that by cleaning it up.
llvm-svn: 153477
2012-03-26 22:00:10 +00:00
Sean Callanan 91e1080bcb <rdar://problem/11022964>
Patched LLVM to handle generic i386 relocations.
This avoids some sudden termination problems on
i386 where the JIT would exit() out reporting
"Invalid CPU type!"

llvm-svn: 153467
2012-03-26 20:52:07 +00:00
Eric Christopher 6cc6e60b6e Use GetClangDeclContextForDIE, it'll find the cached one
if it's there and we may not have a cached die yet. This
fixes a bunch of false positives on "die has no decl".

llvm-svn: 153417
2012-03-25 19:37:33 +00:00
Eric Christopher ffe318dbb3 Fix method name for output.
llvm-svn: 153416
2012-03-25 19:30:08 +00:00
Jason Molenda 03c970e2fe Bump version to debugserver-184, lldb-135.
llvm-svn: 153374
2012-03-24 04:05:56 +00:00
Jason Molenda 91fe8072ab Small tweak to list of arches to build debugserver for on arm.
llvm-svn: 153371
2012-03-24 03:51:07 +00:00
Johnny Chen 042537be33 Explicit casts to remove two compile-time warnings.
llvm-svn: 153365
2012-03-24 01:24:13 +00:00
Enrico Granata 86027e954c Adding a new API call IsTypeComplete() to SBType. This call is meant to check if the type has been previously completed or not (which is mostly interesting from a performance point of view)
Adding a test case that checks that we do not complete types before due time. This should help us track cases similar to the cascading data formatters.

llvm-svn: 153363
2012-03-24 01:11:14 +00:00
Sean Callanan 21f395f35e <rdar://problem/11101372>
We now reject binaries built with LTO and print
an error, rather than crashing later while trying
to parse them.

llvm-svn: 153361
2012-03-24 00:43:18 +00:00
Johnny Chen 760c54e640 Fix a typo.
llvm-svn: 153301
2012-03-23 01:28:19 +00:00
Johnny Chen 3f8140a6d8 Make arm debugserver handle setting a watchpoint on, for example, (uint64_t)variable.
We do this by delegating to two available Watchpoint Register Pairs (wvr, wcr).  With
each pair handling the 4 bytes of (uint64_t)variable.

llvm-svn: 153300
2012-03-23 01:24:52 +00:00
Greg Clayton aaaec7cf1f Bumped Xcode project versions for lldb-134 and debugserver-183.
llvm-svn: 153298
2012-03-23 01:04:39 +00:00
Greg Clayton 18eca8a0bd Fixed up the command so that it doesn't dump the first arguments when run from the command line which was causing this script to dump the script itself.
llvm-svn: 153294
2012-03-23 00:01:02 +00:00
Greg Clayton 0f729e9b38 Added python script that implements a "parse_log_file" command in LLDB which can
parse the output from "log enable --timestamp ...." and converts it to be relative
to the first timestamp and shows the time deltas between log lines. This can also
be used as a stand along script outside of lldb:

./delta.py log.txt

llvm-svn: 153288
2012-03-22 23:08:07 +00:00
Greg Clayton e26928c5be <rdar://problem/11095005>
Fixed a performance regression when dynamic types are enable where we would ask a C++ type if it can possibly be dynamic. Previously we would force the type to complete itself and then anwwer the question definitively. Now we ask the type if it is already complete and only definitively answer the question for completed types and just say "yes" for non-complete C++ types. We also always now answer yes for Objective C classes and do not complete those types either.

llvm-svn: 153284
2012-03-22 22:23:17 +00:00
Jason Molenda c4530bfe21 SBTypeCategory::GetName returns const char* so return
NULL instead of false if no valid name (fixes compiler
warning).

llvm-svn: 153282
2012-03-22 21:23:49 +00:00
Sean Callanan 745af46e2f Resolved two problems in the disassembler:
- Addresses with no description were given
   comments, leading to useless comments like 
   "; , "

 - Addresses weren't resolved with respect
   to the correct module.

llvm-svn: 153274
2012-03-22 20:04:23 +00:00
Johnny Chen d45a9c32c2 Previous check-ins allow to hit the arm hardware watchpoint, with a workaound to handle the issue
that the inferior cannot execute past the watchpoint-triggering instruction.

The solution is disable the watchpoint before resuming the inferior and make it hardware single step;
when the inferior stops again due to single step, re-enable the watchpoint and disable the single step
to make the inferior able to continue again without obstacle.

rdar://problem/9667960

llvm-svn: 153273
2012-03-22 20:04:07 +00:00
Enrico Granata 4a3274af96 Removing cascading through inheritance chains for data formatters
This is the feature that allowed the user to have things like:

class Base { ... };
class Derived : public Base { ... };

and have formatters defined for Base work automatically for Derived.

This feature turned out to be too expensive since it requires completing types.

This patch takes care of removing cascading (other than typedefs chain cascading), updating the test suite accordingly, and adding required Cocoa class names to keep the AppKit formatters working

llvm-svn: 153272
2012-03-22 19:55:55 +00:00
Johnny Chen fd4177d9fd Check in main.c modified for testing hardware watchpoints on arm architectures.
llvm-svn: 153268
2012-03-22 18:51:59 +00:00
Greg Clayton f830dbb77b Added the ability to log a value object just as a value would be display
when using the "frame variable" or "target variable" commands.

llvm-svn: 153266
2012-03-22 18:15:37 +00:00
Sean Callanan 1d1435d8a8 Integrated LLVM revision 153218, which fixes a
crash in disassembly of VST instructions.

llvm-svn: 153265
2012-03-22 17:57:10 +00:00
Johnny Chen 8c9739eeda Fixed a bug with the r153228 check-in earlier today in that the cached watchpoint
member variables were not reset appropriately.

llvm-svn: 153239
2012-03-22 05:10:43 +00:00
Sean Callanan 3f85b3205a Fixed a bug in the disassembler where we did
not properly print the load addresses for
PC-relative jumps.

llvm-svn: 153233
2012-03-22 01:10:50 +00:00
Greg Clayton f8712de58c Since we are having issues with the new LLVM MC disassembler, we can have
them both installed with the LLVM MC version being the default. I renamed the
name of the LLVM MC disassembler plug-in to "llvm-mc" and the LLVM enhanced
disassembly plug-in to "llvm-edis" and they can both be installed for now.

To use the "llvm-edis" disassembler, you can just specify it while disassembling:

(lldb) disassemble --plugin llvm-edis --name main
(lldb) disassemble --plugin llvm-mc --name main

This will allow us to compare the output of the two disassembler and eventually
deprecate the old one when the new one is ready. But it does use the new disassembler
by default so we continue to test it on a daily basis.

llvm-svn: 153231
2012-03-22 00:49:15 +00:00
Johnny Chen 7cb09b61b2 WIP snapshot of hardware watchpoints for arm. A simple watchpoint has triggered.
However, the debugserver cannot get past the instruction which triggered the watchpoint.
So a workaround is in place for the time being which disables the triggered watchpoint
before resuming.

Lots of commented out printf's remain in the source which needs to be cleaned up.

WIP rdar://problem/9667960

llvm-svn: 153228
2012-03-22 00:08:13 +00:00
Greg Clayton 02c322c575 Commit missing function prototype.
llvm-svn: 153223
2012-03-21 22:50:54 +00:00
Johnny Chen 72ee62e030 Add missing watchpoint stop info creation logic for arm on the debugger side.
WIP for rdar://problem/9667960

llvm-svn: 153206
2012-03-21 18:28:25 +00:00
Johnny Chen 907c233591 Add "frame info" command to the "Examining Thread State" section, as suggested by Andrew Trick.
llvm-svn: 153204
2012-03-21 18:14:37 +00:00
Sean Callanan e2d4748ae3 Added some hardening to make sure that we don't
use QualType contents unchecked.

llvm-svn: 153201
2012-03-21 17:13:20 +00:00
Sean Callanan 8ce585f8f1 Added a local patch to reflect an LLVM fix for
relocations (LLVM revision 153147).  Now when
we report section locations in the target process,
LLVM will apply both those relocations whose
targets are in that section and those relocations
which reside in that section and point to other
sections.

llvm-svn: 153199
2012-03-21 16:42:08 +00:00
Greg Clayton 2af282a16b Fixed the ability to load a module from a path by using just a UUID. After
the migration to ModuleSpec objects this broke and is now fixed.

Also fixed a case in the darwin kernel dynamic loader where we just need to
trust the load address of the kernel if we can't read it from memory.

llvm-svn: 153164
2012-03-21 04:25:00 +00:00
Sean Callanan 61b33f7464 Fixed some potential null-pointer bugs in the
expression parser code.

llvm-svn: 153128
2012-03-20 21:11:12 +00:00
Enrico Granata 50c88593d6 Headers cleanup
llvm-svn: 153113
2012-03-20 19:33:01 +00:00
Enrico Granata 84f4f84c68 More #includes removed
llvm-svn: 153108
2012-03-20 19:14:34 +00:00
Enrico Granata 22bd67751e Removing spurious <locale> include
llvm-svn: 153107
2012-03-20 18:56:47 +00:00
Enrico Granata 0b45669b6b Removing spurious <ostream> include
llvm-svn: 153106
2012-03-20 18:52:57 +00:00
Greg Clayton b3a40ba812 Platforms can now auto-select themselves if you specify a full target triple when doing a "target create" command.
Each platform now knows if it can handle an architecture and a platform can be found using an architecture. Each platform can look at the arch, vendor and OS and know if it should be used or not.

llvm-svn: 153104
2012-03-20 18:34:04 +00:00
Enrico Granata c2c4e34a46 Fixing a bug where child names in filters were not matched properly
llvm-svn: 153101
2012-03-20 18:02:56 +00:00
Greg Clayton 5400bad64d <rdar://problem/11078937>
LLDB can match incorrect line table entries when an address is between two valid line entries (in the gap between the valid debug info), now it doesn't!

llvm-svn: 153077
2012-03-20 02:15:45 +00:00
Greg Clayton 9ff1ba2546 Make sure that if a UUID was passed in, and we found a match, that should be enough for us.
llvm-svn: 153076
2012-03-20 01:31:19 +00:00
Greg Clayton 2b1bc868a0 Added a fix to the crash log script that allows you to locate and load a binary from any location and _then_ do the symbolication. Something like:
(lldb) file /path/to/file.so
(lldb) crashlog crash.log
....

Then if the file.so has already been loaded it will use the one that is already in LLDB without trying to match up the paths.

llvm-svn: 153075
2012-03-20 01:30:27 +00:00
Johnny Chen e344486e63 Add a '-E' option to the test driver for the purpose of specifying some extra CFLAGS
to pass to the toolchain in order to build the inferior programs to be run/debugged
duirng the test suite.  The architecture might dictate some special CFLAGS which are
more easily specified in a central place (like the command line) instead of inside
make rules.

For Example,

./dotest.py -v -r /shared/phone -A armv7 -E "-isysroot your_sdk_root" functionalities/watchpoint/hello_watchpoint

will relocate the particular test directory ('functionalities/watchpoint/hello_watchpoint' in this case) to a
new directory named '/shared/phone'.  The particular incarnation of the architecture-compiler combination of the
test support files are therefore to be found under:

/shared/phone.arch=armv7-compiler=clang/functionalities/watchpoint/hello_watchpoint

The building of the inferior programs under testing is now working.

The actual launching/debugging of the inferior programs are not yet working,
neither is the setting of a watchpoint on the phone.

llvm-svn: 153070
2012-03-20 00:33:51 +00:00
Enrico Granata a7a3a4c79e Editing documentation to reflect recent changes in the formatters support
llvm-svn: 153068
2012-03-19 23:57:06 +00:00
Enrico Granata 86cc982974 Massive enumeration name changes: a number of enums in ValueObject were not following the naming pattern
Changes to synthetic children:
 - the update(self): function can now (optionally) return a value - if it returns boolean value True, ValueObjectSyntheticFilter will not clear its caches across stop-points
   this should allow better performance for Python-based synthetic children when one can be sure that the child ValueObjects have not changed
 - making a difference between a synthetic VO and a VO with a synthetic value: now a ValueObjectSyntheticFilter will not return itself as its own synthetic value, but will (correctly)
   claim to itself be synthetic
 - cleared up the internal synthetic children architecture to make a more consistent use of pointers and references instead of shared pointers when possible
 - major cleanup of unnecessary #include, data and functions in ValueObjectSyntheticFilter itself
 - removed the SyntheticValueType enum and replaced it with a plain boolean (to which it was equivalent in the first place)
Some clean ups to the summary generation code
Centralized the code that clears out user-visible strings and data in ValueObject
More efficient summaries for libc++ containers

llvm-svn: 153061
2012-03-19 22:58:49 +00:00
Greg Clayton f9be693369 <rdar://problem/11072382>
Fixed a case where the source path remappings on the module were too expensive to
use when we try to verify (stat the file system) that the remapped path points to
a valid file. Now we will use the lldb_private::Module path remappings (if any) when
parsing the debug info without verifying that the paths exist so we don't slow down
line table parsing speeds.

llvm-svn: 153059
2012-03-19 22:22:41 +00:00
Benjamin Kramer 44057c3d01 Include limits.h for PATH_MAX.
llvm-svn: 153013
2012-03-18 13:06:54 +00:00
Jason Molenda be55f383f0 Bump to lldb-133.
Remove unused entitlements plist from debugserver.

llvm-svn: 152973
2012-03-17 03:27:04 +00:00
Enrico Granata 3713cadd09 Changed the URL to the CFString summary provider; slightly reworded the relevant piece of content
llvm-svn: 152972
2012-03-17 02:14:46 +00:00
Enrico Granata 0fddd5631d Pointing users to a new example of synthetic children provider en lieu of the old StdVector example which was removed earlier today
llvm-svn: 152971
2012-03-17 02:04:20 +00:00
Enrico Granata ab8674f99f Adding a new example of synthetic children provider
llvm-svn: 152970
2012-03-17 02:02:03 +00:00
Sean Callanan 7de79f3297 Updated LLVM/Clang to take a patch that fixes some
ARM assembly syntax in LLVM.  This allows LLDB to
build with the latest Clang.

llvm-svn: 152965
2012-03-17 00:02:03 +00:00
Johnny Chen 1b72f09150 Export the APIs submitted by Dawn to the Python bindings. Add a simple test case for the SBModule.compile_unit_iter() API.
llvm-svn: 152952
2012-03-16 21:55:42 +00:00
Johnny Chen e025e30a0e Fix FRAMEWORK_SEARCH_PATHS for iOS builds.
llvm-svn: 152948
2012-03-16 21:25:14 +00:00
Johnny Chen 873a7a4b64 Patch from dawn@burble.org:
GetSupportFileAtIndex(), GetNumSupportFiles(), FindSupportFileIndex():
   Add API support for getting the list of files in a compilation unit.
GetNumCompileUnits(), GetCompileUnitAtIndex():
   Add API support for retrieving the compilation units in a module.

llvm-svn: 152942
2012-03-16 20:46:10 +00:00
Johnny Chen 531c085815 Fix a bug in getRunOptions() where there was no space between the arch spec and the compiler spec.
llvm-svn: 152941
2012-03-16 20:44:00 +00:00
Sean Callanan 9f9ab86581 Updating Xcode project version numbers for lldb-132 and debugserver-182
llvm-svn: 152901
2012-03-16 06:05:58 +00:00
Sean Callanan d6a4b2cdb2 Integrated two high-value Clang fixes:
- Clang now completes all Objective-C objects (if
  they are not already complete, and they have
  external lexical sources) during structure
  layout, avoiding a LLDB crash.

- The Clang Decl printer handles reference types
  correctly.  This prevents LLDB from crashing
  when expression logging is enabled.

llvm-svn: 152897
2012-03-16 05:34:53 +00:00
Enrico Granata 676d3b0682 Warn about an example script being obsoleted by new native features and just an example
llvm-svn: 152890
2012-03-16 01:25:01 +00:00
Enrico Granata 797017a4c1 Deleting obsolete files
llvm-svn: 152888
2012-03-16 01:15:31 +00:00
Johnny Chen a113abce1d rdar://problem/11057400
Add documentation for watchpoint commands.

llvm-svn: 152882
2012-03-16 00:44:02 +00:00
Greg Clayton d804d28556 <rdar://problem/8196933>
Use the metadata in the dSYM bundle Info.plist to remap source paths when they keys are available.

llvm-svn: 152836
2012-03-15 21:01:31 +00:00
Johnny Chen 3bc8ae4014 Add a test case to go with <rdar://problem/11052829> and svn check-in r152809.
llvm-svn: 152825
2012-03-15 19:10:00 +00:00
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