Commit Graph

5696 Commits

Author SHA1 Message Date
Sean Callanan 7505079a1f An API in Clang got renamed; fixing LLDB to match.
llvm-svn: 165144
2012-10-03 19:23:27 +00:00
Jason Molenda 5e8534efe7 The kernel loading code is now isolated in the DynamicLoaderDarwinKernel;
remove the duplicates of this code in ProcessGDBRemote and ProcessKDP.
These two Process plugins will hardcode their DynamicLoader name to be
the DynamicLoaderDarwinKernel so the correct DynamicLoader is picked,
and return the kernel load address as the ImageInfosAddress.
<rdar://problem/12417038> 

llvm-svn: 165080
2012-10-03 01:29:34 +00:00
Jason Molenda 743e439608 Change DynamicLoaderDarwinKernel::OSKextLoadedKextSummary to use
the Symbols::LocateExecutableObjectFile method to locate kexts and
kernels instead of copying them out of the memory of the remote
system.  This is the fix for <rdar://problem/12416384>.

Fix a variable shadowing problem in
Symbols::LocateMacOSXFilesUsingDebugSymbols which caused the symbol
rich executable binaries to not be found even if they were listed
in the dSYM Info.plist.

Change Symbols::DownloadObjectAndSymbolFile to ignore dsymForUUID's
negative cache - this is typically being called by the user and we
should try even if there's a incorrect entry in the negative cache.

llvm-svn: 165061
2012-10-02 22:23:42 +00:00
Greg Clayton 548e9a3e61 <rdar://problem/11791234>
Shared libraries on MacOSX were not properly being removed from the shared
module list when re-running a debug session due to an error in:

Module::MatchesModuleSpec()

llvm-svn: 164991
2012-10-02 06:04:17 +00:00
Jason Molenda 68b3607fa2 Handle KASLR kernel loading for kernel corefiles.
Reduce the amount of output that DynamicLoaderDarwinKernel
prints for each kext it loads.
<rdar://problem/7714201> 

llvm-svn: 164985
2012-10-02 03:49:41 +00:00
Enrico Granata 83c85e4193 <rdar://problem/12349509> Renaming the structure that we use for NSDictionary children
llvm-svn: 164973
2012-10-01 21:49:10 +00:00
Enrico Granata e00af8093c <rdar://problem/12406088> Fixing a crasher with adding a regex command, due to accessing a shared pointer without first checking for NULL
llvm-svn: 164950
2012-10-01 17:19:37 +00:00
Jason Molenda d1fae144ba Add the RelocateOrLoadKernel and LoadKernel methods to ProcessGDBRemote::DoRemoteConnect().
When attaching to a remote system that does not look like a typical vendor system, and no
executable binary was specified to lldb, check a couple of fixed locations where kernels
running in ASLR mode (slid in memory to a random address) store their load addr when booted
in debug mode, and relocate the symbols or load the kernel wholesale from the host computer
if we can find it.  

<rdar://problem/7714201>

llvm-svn: 164888
2012-09-29 08:03:33 +00:00
Jason Molenda 4bd4e7e3ba Add support for debugging KASLR kernels via kdp (the kernel being
loaded at a random offset).

To get the kernel's UUID and load address I need to send a kdp
packet so I had to implement the kernel relocation (and attempt to
find the kernel if none was provided to lldb already) in ProcessKDP
-- but this code really properly belongs in DynamicLoaderDarwinKernel.

I also had to add an optional Stream to ConnectRemote so
ProcessKDP::DoConnectRemote can print feedback about the remote kernel's
UUID, load address, and notify the user if we auto-loaded the kernel via
the UUID.

<rdar://problem/7714201>

llvm-svn: 164881
2012-09-29 04:02:01 +00:00
Sean Callanan eb918cd789 Now in the presence of an Objective-C version 2
runtime, we read method signatures for both class
and instance methods out of the runtime data.

(lldb) fr var str
(NSString *) str = 0x0000000105000180 @"Hello from '/Volumes/Data/projects/lldb/test/lang/objc/foundation/a.out'"
(lldb) expr str.length
(unsigned long long) $0 = 72
(lldb) expr [NSString stringWithCString:"Hello world!" encoding:1]
(id) $1 = 0x0000000105100050
(lldb) po $1
$1 = 0x0000000105100050 Hello world!

(lldb) fr var array1
(NSArray *) array1 = 0x000000010010a6e0 @"3 objects"
(lldb) expr array1.count
(unsigned long long) $0 = 3
(lldb) expr [array1 objectAtIndex:2]
(id) $1 = 0x00000001000025d0
(lldb) po $1
$1 = 0x00000001000025d0 array1 object3

Notice that both regular and property-style notation
work.  I still need to add explicit support for
properties with non-default setters/getters.

This information is only queried if an Objective-C
object does not have debug information for a complete
type available.  Otherwise we query debug information
as usual.

llvm-svn: 164878
2012-09-29 01:53:36 +00:00
Enrico Granata 6d39077fe7 <rdar://problem/12378910> Fix a bunch of other places where similar problems could happen
llvm-svn: 164871
2012-09-29 00:47:43 +00:00
Enrico Granata 60b81dff85 <rdar://problem/12378910> Fixing a potential crasher in the data formatters where we fail to check for NULL or empty class name
llvm-svn: 164870
2012-09-29 00:45:53 +00:00
Enrico Granata 21dfcd9d41 Implementing plugins that provide commands.
This checkin adds the capability for LLDB to load plugins from external dylibs that can provide new commands
It exports an SBCommand class from the public API layer, and a new SBCommandPluginInterface

There is a minimal load-only plugin manager built into the debugger, which can be accessed via Debugger::LoadPlugin.

Plugins are loaded from two locations at debugger startup (LLDB.framework/Resources/PlugIns and ~/Library/Application Support/LLDB/PlugIns) and more can be (re)loaded via the "plugin load" command

For an example of how to make a plugin, refer to the fooplugin.cpp file in examples/plugins/commands

Caveats:
	Currently, the new API objects and features are not exposed via Python.
	The new commands can only be "parsed" (i.e. not raw) and get their command line via a char** parameter (we do not expose our internal Args object)
	There is no unloading feature, which can potentially lead to leaks if you overwrite the commands by reloading the same or different plugins
	There is no API exposed for option parsing, which means you may need to use getopt or roll-your-own

llvm-svn: 164865
2012-09-28 23:57:51 +00:00
Greg Clayton 3852b3e189 <rdar://problem/12398225>
Improve performance of StringExtractor::GetHexS8().

llvm-svn: 164852
2012-09-28 21:51:54 +00:00
Sean Callanan d473424d53 Fixed a bug where if something went wrong while
constructing the ObjCInterfaceDecl for an ISA,
we'd continue and try to use that Decl anyway,
possibly causing a crash.

llvm-svn: 164844
2012-09-28 20:47:47 +00:00
Filipe Cabecinhas e26391a43f Fix a bug introduced in an earlier revision: actually return the StopReason, when we have a StopInfo object.
llvm-svn: 164825
2012-09-28 15:55:43 +00:00
Jason Molenda f49306a2c6 Recognize the eax/ebp/eip etc version of x86 register
names in addition to the rax/rbp/rip register names when
deciding whether a register is volatile or not.

llvm-svn: 164812
2012-09-28 05:46:55 +00:00
Jason Molenda 65c28cb47a Fix the extra space char being emitted in this message when breakpoints resolve -
1 location  added to breakpoint 2

llvm-svn: 164810
2012-09-28 01:50:47 +00:00
Sean Callanan 21b51062db Improved the runtime reading to also get data
out of the metaclass, so as to enumerate class
methods for an object.

llvm-svn: 164808
2012-09-27 23:47:51 +00:00
Greg Clayton b5f0feabae Wrapped up the work I am going to do for now for the "add-dsym" or "target symfile add" command.
We can now do:

Specify a path to a debug symbols file:
(lldb) add-dsym <path-to-dsym>

Go and download the dSYM file for the "libunc.dylib" module in your target:
(lldb) add-dsym --shlib libunc.dylib

Go and download the dSYM given a UUID:
(lldb) add-dsym --uuid <UUID>

Go and download the dSYM file for the current frame:
(lldb) add-dsym --frame

llvm-svn: 164806
2012-09-27 22:26:11 +00:00
Jason Molenda 47d114ac01 Patch from Dan Malea to get the Bourne shells scripts to run cleanly on Ubuntu.
llvm-svn: 164801
2012-09-27 21:26:57 +00:00
Sean Callanan 2885a7088d Fixed some bugs in the runtime reader code. Also
added a parser for method signatures in the
Objective-C @encode format.

llvm-svn: 164792
2012-09-27 20:38:15 +00:00
Greg Clayton 6f485f3f77 Ashok Thirumurthi patch to enable the latest and greatest DWARF forms from the DWARF 4 specification.
llvm-svn: 164779
2012-09-27 16:48:25 +00:00
Filipe Cabecinhas ebca38a4c5 Fixed a typo.
llvm-svn: 164777
2012-09-27 15:31:38 +00:00
Greg Clayton c8f814d1df Added the ability to download a symboled executable and symbol file given a UUID.
llvm-svn: 164753
2012-09-27 03:13:55 +00:00
Jason Molenda c36b184fa2 Change the kdp-remote alias to require a hostname (instead of allowing a zero-length hostname to be specified).
llvm-svn: 164752
2012-09-27 02:47:55 +00:00
Jim Ingham 1f51e60b74 Implement returning integer values in "thread return" for arm, x86_64 and i386. Also returns
floats & doubles on x86_64.

<rdar://problem/8356523>

llvm-svn: 164741
2012-09-27 01:15:29 +00:00
Greg Clayton 91e407ea07 If we are attached to a platform, then make sure that we can verify that a process exists when attaching by "pid" before we try and do a lengthy command that could take a while to timeout.
llvm-svn: 164738
2012-09-27 00:03:39 +00:00
Greg Clayton e86fd74901 Added "k" as an alias to "process kill" since the new "kdb-remote" will now conflict with it.
llvm-svn: 164737
2012-09-27 00:02:27 +00:00
Jason Molenda e5b55eadda Add examples of using the kdp-remote and gdb-remote commands to connect to
gdb-remote protocol and kdp protocol systems.

llvm-svn: 164730
2012-09-26 22:42:25 +00:00
Greg Clayton 30c0a1cf94 Add convenience aliases to allow easy attaching to a remote gdb server or kdp (darwin kernel) server with the new "gdb-remote" regex alias and "kdp-remote" regex alias commands.
llvm-svn: 164729
2012-09-26 22:26:47 +00:00
Sean Callanan 4ca7389925 Added support for the DebugClang configuration to the
testsuite.

llvm-svn: 164723
2012-09-26 21:16:15 +00:00
Filipe Cabecinhas df461db533 Patch by Matt, to get lldb to build with the updated llvm+clang versions (via Makefiles).
llvm-svn: 164703
2012-09-26 16:27:06 +00:00
Filipe Cabecinhas 563a9521e4 Make lldb more C++11 friendly.
llvm-svn: 164702
2012-09-26 16:27:04 +00:00
Sean Callanan f601503ae6 Fixed a bug in the path remapper that caused
a crash if the path to be remaped was NULL.

<rdar://problem/12371888>

llvm-svn: 164653
2012-09-26 01:28:11 +00:00
Jim Ingham 11c8108d57 Add an API to figure out whether a breakpoint is internal or not.
llvm-svn: 164648
2012-09-25 23:55:19 +00:00
Jason Molenda c74198dedd The iOSSimulator platform should create a PlatformDarwin with
is_host == true so PlatformDarwin knows it can do same-host
operations like process lookup.  <rdar://problem/12296249> 

llvm-svn: 164647
2012-09-25 23:32:06 +00:00
Greg Clayton 984fee5b8f Added process attach options and also use the SBLaunchInfo and SBAttachInfo.
llvm-svn: 164619
2012-09-25 18:27:12 +00:00
Greg Clayton 97d5cf05eb <rdar://problem/9959501>
More KDP debugging process. We can not set breakpoints, hit them, resume, step and detach while running.

llvm-svn: 164584
2012-09-25 02:40:06 +00:00
Enrico Granata 64e15fc956 Making sure we do not try to compare a NULL string - which would cause us to crash
llvm-svn: 164574
2012-09-24 23:30:10 +00:00
Sean Callanan 771f1de241 Added a new Xcode build configuration, DebugClang,
which builds a Debug+Asserts build of Clang and
links LLDB against it.  The Debug configuration
builds Clang with Release+Asserts, for faster
linking and smaller memory footprint when debugging
the build LLDB.

llvm-svn: 164573
2012-09-24 23:21:18 +00:00
Sean Callanan c2bd8c2158 Removed some debugging cruft.
llvm-svn: 164572
2012-09-24 23:11:56 +00:00
Jason Molenda bdde850228 Fix string comparisons in ABIMacOSX_i386::RegisterIsCalleeSaved so
that volatile registers are correctly reported for this ABI.
We were incorrectly passing up volatile registers from callee
frames.

llvm-svn: 164564
2012-09-24 22:51:04 +00:00
Sean Callanan 3d654b3044 Brought LLDB top-of-tree into sync with LLVM/Clang
top-of-tree.  Removed all local patches and llvm.zip.

The intent is that fron now on top-of-tree will
always build against LLVM/Clang top-of-tree, and
that problems building will be resolved as they
occur.  Stable release branches of LLDB can be
constructed as needed and linked to specific release
branches of LLVM/Clang.

llvm-svn: 164563
2012-09-24 22:25:51 +00:00
Sean Callanan 32a5ba5b47 Made TestHiddenIvars an expected failure with
"frame variable".  "expr" finds hidden ivars
correctly.

llvm-svn: 164558
2012-09-24 21:34:40 +00:00
Jim Ingham 43de0f95ed Remove a couple of debugging printf's from the testsuite.
llvm-svn: 164544
2012-09-24 18:11:54 +00:00
Jim Ingham 493dffe2b1 Missed a few places where I didn't delete the obsolete (commented out) version of the breakpoint creation.
llvm-svn: 164436
2012-09-22 00:14:47 +00:00
Jim Ingham 63dfc725a7 Fix all the test case breakages caused by folks writing tests all over the place that depended explicitly
on the output of "break set".  Please don't do this sort of thing!!!!!

llvm-svn: 164433
2012-09-22 00:05:11 +00:00
Jim Ingham 1391cc7d51 Change the new breakpoint creation output (primarily from "break set") to something more useful.
<rdar://problem/11333623>

llvm-svn: 164432
2012-09-22 00:04:04 +00:00
Enrico Granata 165f8af8c5 Initial commit of a new testsuite feature: test categories.
This feature allows us to group test cases into logical groups (categories), and to only run a subset of test cases based on these categories.

Each test-case can have a new method getCategories(self): which returns a list of strings that are the categories to which the test case belongs.
If a test-case does not provide its own categories, we will look for categories in the class that contains the test case.
If that fails too, the default implementation looks for a .category file, which contains a comma separated list of strings.
The test suite will recurse look for .categories up until the top level directory (which we guarantee will have an empty .category file).

The driver dotest.py has a new --category <foo> option, which can be repeated, and specifies which categories of tests you want to run.
(example: ./dotest.py --category objc --category expression)

All tests that do not belong to any specified category will be skipped. Other filtering options still exist and should not interfere with category filtering.
A few tests have been categorized. Feel free to categorize others, and to suggest new categories that we could want to use.

All categories need to be validly defined in dotest.py, or the test suite will refuse to run when you use them as arguments to --category.

In the end, failures will be reported on a per-category basis, as well as in the usual format.

This is the very first stage of this feature. Feel free to chime in with ideas for improvements!

llvm-svn: 164403
2012-09-21 19:10:53 +00:00
Greg Clayton 7925fbbadb Full KDP process control with per CPU resume and step.
llvm-svn: 164378
2012-09-21 16:31:20 +00:00
Sean Callanan 3e633a290e Fixed an oddity in the Objective-C class descriptors
where the descriptor took a pointer to an object and
expected the Initialize function to dereference that
pointer and extract the isa value.  This caused one
of our tests to fail.

llvm-svn: 164353
2012-09-21 02:09:51 +00:00
Greg Clayton 4b1b8b3e1d <rdar://problem/9959501>
KDP -- now with rudimentary process control (continue only) and read + write registers (which means we can see stack frames) for x86_64, i386 and ARM.

llvm-svn: 164352
2012-09-21 01:55:30 +00:00
Enrico Granata eacb4911a0 Fixing a logic error where we would incorrectly show the newly crafted function not found error for a Python function in some cases where the function actually existed and had an empty docstring
llvm-svn: 164334
2012-09-20 23:23:55 +00:00
Sean Callanan 2cb5e527f6 Fixed a problem where persistent variables did
not correctly store the contents of Objective-C
classes.  This was due to a combination of
factors:

  1) Types were only being completed if we were
     looking inside them for specific ivars
     (using FindExternalVisibleDeclsByName). 
     We now look the complete type up at every
     FindExternalLexicalDecls.

  2) Even if the types were completed properly,
     ValueObjectConstResult overrode the type
     of every ValueObject using the complete type
     for its class from the debug information.
     Superclasses of complete classes are not
     guaranteed to be complete.  Although "frame
     variable" uses the debug information,
     the expression parser does now piece together
     complete types at every level (as described
     in Bullet 1), so I provided a way for the
     expression parser to prevent overriding.

  3) Type sizes were being miscomputed by
     ClangASTContext.  It ignored the ISA pointer
     and only counted fields.  We now correctly
     count the ISA in the size of an object.

<rdar://problem/12315386>

llvm-svn: 164333
2012-09-20 23:21:16 +00:00
Greg Clayton dcadc5cfb7 Re-adding this previously removed file.
llvm-svn: 164331
2012-09-20 23:08:52 +00:00
Greg Clayton b85248da95 This file is causing problems. I am going to remove it and try re-adding it.
llvm-svn: 164328
2012-09-20 23:08:12 +00:00
Greg Clayton bb011f73f5 Show the size of what we are dematerializing in the output log for "lldb expr".
llvm-svn: 164327
2012-09-20 23:07:44 +00:00
Greg Clayton 0c9773c6d5 Compile shared libraries with dSYM files when requested on darwin. Prior to this, we never had dSYM files for shared libraries unless it was a dylib only Makefile.
llvm-svn: 164322
2012-09-20 21:43:11 +00:00
Greg Clayton 48e0c2c82d <rdar://problem/12315386>
Test suite to catch fragile base class ivar issues.

llvm-svn: 164321
2012-09-20 21:38:45 +00:00
Sean Callanan d0dcae08e5 More work for reading the Objective-C runtime.
We can now read the relevant data structures for
the method list, and use a callback mechanism to
report their details to the AppleObjCTypeVendor,
which constructs appropriate Clang types.

llvm-svn: 164310
2012-09-20 17:01:52 +00:00
Jason Molenda 944cc67eba Bump to lldb-168, debugserver-193.
llvm-svn: 164291
2012-09-20 06:42:30 +00:00
Jason Molenda 5c4210be8e Update the LLDB_DISABLE_PYTHON ifdef in FormatManager::LoadObjCFormatters to
get FormatManager.cpp to build on no-python platforms again.

llvm-svn: 164284
2012-09-20 06:06:59 +00:00
Greg Clayton 9e6cffc9fd A patch that allows for mach-o architectures to be specified as "<number>-<number>" where the first number is the cpu type and the second is the cpu subtype. Also added code to allow use of mach-o architectures that aren't in our tables so that symbolication and static file introspection (crashlogs) can work with them.
llvm-svn: 164258
2012-09-19 22:25:17 +00:00
Greg Clayton a150de05f3 Don't get everything when resolving the symbol context of the ObjC Class symbol, just the module + symbol.
llvm-svn: 164257
2012-09-19 22:23:30 +00:00
Sean Callanan 39def1f7c0 Fix to the project file, to prevent it from using
an out-of-date compiler in certain cases.

llvm-svn: 164255
2012-09-19 22:10:40 +00:00
Filipe Cabecinhas 3e6ff11220 Fix some type-related swig bugs on FreeBSD on x86_64 (and maybe other OS/arch).
llvm-svn: 164227
2012-09-19 15:22:05 +00:00
Sean Callanan 43dd07ec3e Updated AppleObjCV2Runtime to load the class
data structures more rapidly.  Also added fields
for the other data structures in a class.

I also fixed a problem where I accidentally used
hasExternalLexicalStorage() instead of
hasExternalVisibleStorage() to mark an
incomplete object.

llvm-svn: 164197
2012-09-19 03:23:13 +00:00
Greg Clayton aa4d45314c Added auto LLDB import to the crashlog script.
llvm-svn: 164192
2012-09-19 01:59:34 +00:00
Greg Clayton 9944cd7f7a <rdar://problem/11752499>
Improve error messages when memory read/write fails.

llvm-svn: 164188
2012-09-19 01:46:31 +00:00
Greg Clayton 6f4d8af713 <rdar://problem/12125274>
Intentionally leak the module list to avoid unnecessary freeing of modules + object files + symbol files when the program is exiting.

llvm-svn: 164184
2012-09-18 23:50:22 +00:00
Jason Molenda dfa424c593 Allow for numeric cputype-cpusubtype specifications where the subtype is 0. Use errno to
detect strtoul parse failure instead of return value of 0.  <rdar://problem/12198994>

llvm-svn: 164183
2012-09-18 23:27:18 +00:00
Enrico Granata fac939e918 <rdar://problem/12188843> Fixing a problem where a Python command created in the same module where the target function is defined causes the help string not to come out
llvm-svn: 164172
2012-09-18 21:53:02 +00:00
Sean Callanan 27c658bd18 Objective-C runtime class descriptors can now
populate Clang ObjCInterfaceDecls with their
ivars, methods, and properties.  The default
implementation does nothing.  I have also made
sure that AppleObjCRuntimeV2 creates 
ObjCInterfaceDecls that actually get queried
appropriately.

llvm-svn: 164164
2012-09-18 20:36:30 +00:00
Enrico Granata 5d31103974 <rdar://problem/11398693> Making sure we do not attempt to run code on zombie objects when attempting to format them
llvm-svn: 164156
2012-09-18 18:34:14 +00:00
Greg Clayton 813ddfcdd0 <rdar://problem/12219840>
Don't leak mach ports when calling "mach_thread_self()".

llvm-svn: 164152
2012-09-18 18:19:49 +00:00
Enrico Granata 63d2a23618 Fix a potential issue where data formatters can get confused over malformed UUIDs
llvm-svn: 164151
2012-09-18 18:15:27 +00:00
Enrico Granata 69277bac23 <rdar://problem/12161825> Rephrase formatter for NSIndexSet in terms of indexes instead of objects
llvm-svn: 164149
2012-09-18 18:06:37 +00:00
Greg Clayton 43e0af06b4 Stop using the "%z" size_t modifier and cast all size_t values to uint64_t. Some platforms don't support this modification.
llvm-svn: 164148
2012-09-18 18:04:04 +00:00
Enrico Granata 97fca507f4 <rdar://problem/11988289> Making C++ synthetic children provider for NSDictionary and related classes
llvm-svn: 164144
2012-09-18 17:43:16 +00:00
Enrico Granata dfc88a0338 Making ClangExpression hold on to a WP to the Process instead of a SP. This fix should enable us to have per-process maps of ClangExpressions without fear of keeping the process alive forever
llvm-svn: 164082
2012-09-18 00:08:47 +00:00
Jim Ingham a1b536a231 Remove a spurious control character coming from trying to save files in Xcode with emacs' ^x^s.
llvm-svn: 164081
2012-09-18 00:00:25 +00:00
Enrico Granata ee23ae264b Make the Class Descriptors able to fetch the class name for unrealized classes
llvm-svn: 164050
2012-09-17 19:51:33 +00:00
Sean Callanan 9b44493304 Re-applied Enrico's patch that I so rudely
stomped on.

llvm-svn: 164049
2012-09-17 19:30:47 +00:00
Enrico Granata 2e2aa6470a Stop validating the vtable_ptr since it's not actually guaranteed to be correct
llvm-svn: 164048
2012-09-17 19:26:37 +00:00
Jason Molenda 38f8bbecba Update LLDB_DISABLE_PYTHON #ifdefs in FormatManager.cpp to get it
building on no-Python systems again.

llvm-svn: 163961
2012-09-15 01:59:02 +00:00
Sean Callanan c09d9d898d More runtime work. We now successfully traverse
the dynamic and static runtime class tables to
construct our isa table.  This is putting the runtime
in contact with unrealized classes, which we need
to deal with in order to get accurate information.
That's the next piece of work.

<rdar://problem/10986023>

llvm-svn: 163957
2012-09-15 01:05:12 +00:00
Enrico Granata 01fd9804cb Fixing a potential crasher where the new C++ synthetic children can return a NULL FrontEnd and cause LLDB to crash. This patch introduces a dummy front-end which the ValueObjectSynthetic can use lacking a real FrontEnd
llvm-svn: 163946
2012-09-14 22:41:44 +00:00
Jim Ingham 6fe2dc79b7 Remove a duplicate frame_sp local that was shadowing the one we copied the incoming SBFrame into.
<rdar://problem/12304255>

llvm-svn: 163943
2012-09-14 22:16:10 +00:00
Jim Ingham 94b092461d SBThread::StepOut and SBThread::StepOutOfFrame should both run all threads.
llvm-svn: 163938
2012-09-14 21:07:14 +00:00
Jim Ingham 43d886ec90 "thread step-out" should run all threads by default.
llvm-svn: 163937
2012-09-14 21:04:15 +00:00
Jim Ingham f76ab67c55 Use the frame index passed into "thread until" rather than using the selected frame.
llvm-svn: 163936
2012-09-14 20:48:14 +00:00
Jim Ingham c02e334422 SBThread::StepOverUntil should run all threads. It is running to breakpoints, so running one thread is likely to cause the target to stall.
llvm-svn: 163924
2012-09-14 18:57:14 +00:00
Sean Callanan 903259fea2 Extended the "watchpoint set variable" code to
support watchpoints on globals.

<rdar://problem/12297238>

llvm-svn: 163913
2012-09-14 17:20:18 +00:00
Filipe Cabecinhas 3e9e081d35 Fixed some problems with SWIG bindings.
This may (but shouldn't) break Linux (but I tested and it still worked on FreeBSD).

The same shell scripts are now used on Xcode and Makefiles, for generating
the SWIG bindings.
Some compatibility fixes were applied, too (python path, bash-isms, etc).

llvm-svn: 163912
2012-09-14 17:09:15 +00:00
Filipe Cabecinhas d685840a5e Don't force libc++ and c++11 on everyone.
Make the flags part of configure and make invocations, for now.

llvm-svn: 163911
2012-09-14 17:09:06 +00:00
Greg Clayton c1b1f1ea26 <rdar://problem/11374963>
When attaching on ARM hosted debuggers we were incorrectly setting the triple to "arm-apple-ios". This was happening because in the post attach code, we would lookup the process info through the platform, and if successful, we would get the architecture of the process. This code uses sysctl() calls, but we can only get the CPU type, not the subtype, so we would get ARM for CPU type and nothing for the cpu subtype, so this would map to "arm-apple-ios". I fixed the code to get the cpu subtype from "hw.cpusubtype" which is what we really want for ARM, and not the architecture is already correct. "add-dsym" then works like a charm. I also improved the command output when the architecture changes to show the entire triple instead of just the arch name.

llvm-svn: 163868
2012-09-14 02:41:36 +00:00
Jim Ingham cb640dd8a0 Make the unwinding of the stack part of "thread return" work, and add the thread return command.
llvm-svn: 163867
2012-09-14 02:14:15 +00:00
Sean Callanan 5527442d11 Updated the demangler to take the fix for a crasher.
<rdar://problem/12293231>

llvm-svn: 163864
2012-09-14 00:52:49 +00:00
Sean Callanan a199e82cb9 Fixed the #defines for YES and NO, and centralized
them in one place rather than having them replicated
across all the potential function wrappers.

<rdar://problem/12293880>

llvm-svn: 163857
2012-09-13 23:35:30 +00:00
Enrico Granata 058049cdea Fixing a typo
llvm-svn: 163852
2012-09-13 23:06:00 +00:00
Greg Clayton a12993c930 Fixed an error with a static enum definition where it wasn't NULL terminate and could crash.
llvm-svn: 163851
2012-09-13 23:03:20 +00:00
Sean Callanan cd8b7cd0df Made the help for the -n option on
"target image lookup" a bit better
documented by indicating that it takes
symbols OR functions.

<rdar://problem/12281325>

llvm-svn: 163839
2012-09-13 21:11:40 +00:00
Enrico Granata 147a1fe15f Making sure to create the count attribute in synthetic children providers for libcxx at the right time
llvm-svn: 163823
2012-09-13 18:47:25 +00:00
Enrico Granata b2698cdf59 <rdar://problem/11086338> Implementing support for synthetic children generated by running C++ code instead of Python scripts ; Adding a bunch of value-generating APIs to our private code layer ; Providing synthetic children for NSArray
llvm-svn: 163818
2012-09-13 18:27:09 +00:00
Filipe Cabecinhas d40ca2f581 Make lldb play nicer with C++11 and fix a (maybe impossible to come by) bug.
llvm-svn: 163800
2012-09-13 14:46:00 +00:00
Greg Clayton f453907a6d Modified the command template to include best practices.
llvm-svn: 163773
2012-09-13 05:35:34 +00:00
Enrico Granata f5ba52dc80 Fixing a potential crasher related to running regular expressions against a NULL pointer
llvm-svn: 163742
2012-09-12 21:40:49 +00:00
Filipe Cabecinhas 2e098efd4d Patches to make our llvm revision more C++11 friendly.
llvm-svn: 163725
2012-09-12 17:06:07 +00:00
Filipe Cabecinhas 7d4c68a6ae Make TestAddDsymCommand not fail since bundles were accepted as add-dsym arguments.
llvm-svn: 163712
2012-09-12 14:43:45 +00:00
Greg Clayton 103f02820d <rdar://problem/11374963>
Partial fix for the above radar where we now resolve dsym mach-o files within the dSYM bundle when using "add-dsym" through the platform.

llvm-svn: 163676
2012-09-12 02:03:59 +00:00
Greg Clayton a3606adf90 Don't allow an extra entry to slip into the heap results and also add a better output format
llvm-svn: 163675
2012-09-12 02:02:32 +00:00
Greg Clayton b28179bb80 Added some documentation and an accessor for the target with an explanation of why to not use "lldb.target".
llvm-svn: 163671
2012-09-12 00:47:53 +00:00
Jim Ingham 4413758c89 Start at getting "thread return" working. Doesn't work yet.
llvm-svn: 163670
2012-09-12 00:40:39 +00:00
Jim Ingham 02430574d5 Add "info func" to the list.
llvm-svn: 163669
2012-09-12 00:38:19 +00:00
Sean Callanan 2aaba00a6b Updated the project file to reflect the added
and deleted classes.

llvm-svn: 163652
2012-09-11 21:50:14 +00:00
Sean Callanan bc47dfcba2 This patch is part of ongoing work to extract type
information from the Objective-C runtime.

This patch takes the old AppleObjCSymbolVendor and
replaces it with an AppleObjCTypeVendor, which is
much more lightweight.  Specifically, the SymbolVendor
needs to pretend that there is a backing symbol file
for the Types it vends, whereas a TypeVendor only
vends bare ClangASTTypes.  These ClangASTTypes only
need to exist in an ASTContext.

The ClangASTSource now falls back to the runtime's
TypeVendor (if one exists) if the debug information
doesn't find a complete type for a particular
Objective-C interface.  The runtime's TypeVendor
maintains an ASTContext full of types it knows about,
and re-uses the ISA-based type query information used
by the ValueObjects.

Currently, the runtime's TypeVendor doesn't provide
useful answers because we haven't yet implemented a
way to iterate across all ISAs contained in the target
process's runtime.  That's the next step.

llvm-svn: 163651
2012-09-11 21:44:01 +00:00
Filipe Cabecinhas d0b87d81a1 Some more typing-related fixes.
llvm-svn: 163641
2012-09-11 18:11:16 +00:00
Filipe Cabecinhas dd39395f83 Make size_t known before including cxxabi.h (FreeBSD fix)
llvm-svn: 163640
2012-09-11 18:11:12 +00:00
Filipe Cabecinhas ae78ce43c9 Use c++11 and libc++ and it's headers, instead of gnu's libstdcpp
Unbreaks the build on FreeBSD

People that are using Linux: if you have any problems with this patch
please let me know, and tell us how you are compiling lldb with the
makefiles.

llvm-svn: 163639
2012-09-11 18:11:09 +00:00
Filipe Cabecinhas b4cb0be3b7 Some more typing-related fixes.
llvm-svn: 163638
2012-09-11 18:11:07 +00:00
Greg Clayton 4b963415c2 Added "heap" command to get info on all allocations on the heap. Currently only objective C objects are supported since they are easy to detect.
llvm-svn: 163637
2012-09-11 18:10:27 +00:00
Filipe Cabecinhas bc6e85cb53 Change the NULL to a 0 since we need a uint32_t
llvm-svn: 163625
2012-09-11 16:09:27 +00:00
Jason Molenda 521d32dd96 Remove LLDB_DISABLE_PYTHON ifndef around FormatManager::LoadObjCFormatters() prototype,
it is unconditionally present now.

ObjectContainerBSDArchive::CreateInstance %z8.8x is not a valid printf arg specifier, %8.8zx would work
for size_t arg but this arg is addr_t.  use %8.8llx and cast up to uint64_t.

ObjectFile::FindPlugin ditto.

DynamicRegisterInfo::SetRegisterInfo ifdef this function out if LLDB_DISABLE_PYTHON.

llvm-svn: 163599
2012-09-11 06:35:15 +00:00
Greg Clayton 85fb1b93f3 <rdar://problem/11935492>
Fixed an issue where if we call "Process::Destroy()" and the process is running, if we try to stop it and get "exited" back as the stop reason, we will still deliver the exited event.

llvm-svn: 163591
2012-09-11 02:33:37 +00:00
Greg Clayton 0e3ab7ac5b Fixed some logging messages.
llvm-svn: 163590
2012-09-11 02:28:49 +00:00
Greg Clayton a4475f22fc Print the stack size followed by the full stack info.
llvm-svn: 163589
2012-09-11 02:25:20 +00:00
Jim Ingham a39ad077c9 Initialize a variable to quite a compiler warning.
llvm-svn: 163576
2012-09-11 00:09:25 +00:00
Jim Ingham 45350374f1 Typed too fast adding lockers. Actually put them in a locker.
llvm-svn: 163575
2012-09-11 00:08:52 +00:00
Jim Ingham 927bfa3fd9 Shortcut ThreadPlanStepRange::MischiefManaged - if we have pushed new plans and they are not done, then we aren't done either.
<rdar://problem/12259124>

llvm-svn: 163572
2012-09-10 23:42:44 +00:00
Sean Callanan 3ff3199e61 Fixed a bug where the LLDB_VERSION wasn't properly
truncated during install-headers.

<rdar://problem/12268130>

llvm-svn: 163559
2012-09-10 22:43:22 +00:00
Greg Clayton 6b152ff550 Added a python example that will compute which functions in a process are hogging the stack.
llvm-svn: 163543
2012-09-10 20:55:08 +00:00
Jim Ingham 41f2b940c9 Fixed a few places where we were doing:
uint32_t size = ThreadList.GetSize();
for (i=0; i < size; ++i)

without grabbing the thread list mutex.

llvm-svn: 163541
2012-09-10 20:50:15 +00:00
Greg Clayton bded106120 Playing around with "objc_refs" over the weekend and improved it to work on a large ObjC program without running into expression timeouts. Now we get a full list of ObjC classes using a runtime function and then qsort the result. Also added code that can count all instances of each ObjC on the heap and also the total byte sizes for the object allocations.
llvm-svn: 163520
2012-09-10 17:22:45 +00:00
Sean Callanan 2201905b6c Fixed a problem where watchpoint conditions would
run code when it didn't really need to run.

<rdar://problem/12145006>

llvm-svn: 163450
2012-09-08 01:51:48 +00:00
Greg Clayton 88344b7133 Don't allocate memory when enumerting stack. We now have fixed size buffers to avoid this issue.
llvm-svn: 163441
2012-09-08 01:16:16 +00:00
Sean Callanan 6e4100ead8 Fixed a crash in the testsuite because the wrong
type was being completed.

llvm-svn: 163440
2012-09-08 00:49:45 +00:00
Jim Ingham c635500dbb Fiddle with the heuristic about where to set the stop point in a nested inline stack when we get there by breakpoint. If we hit a user breakpoint, I set the stop point to the bottom-most frame 'cause that's what we did before.
<rdar://problem/12258999> Setting breakpoint in always inline function is stopping in function above it

llvm-svn: 163439
2012-09-08 00:26:49 +00:00
Jim Ingham 3a4599f6cb A bunch of test cases for inlined stepping.
llvm-svn: 163436
2012-09-07 23:58:16 +00:00
Greg Clayton 93bfb29ada Make file + line breakpoints even more efficient by using our SearchFilter objects correctly now that we sometimes don't check for inlined breakpoints.
llvm-svn: 163435
2012-09-07 23:48:57 +00:00
Jim Ingham 625fca7c5a Save and restore the current inlined depth over function calls.
llvm-svn: 163433
2012-09-07 23:36:43 +00:00
Jim Ingham 6cd41da75d Add SetCurrentInlinedDepth API.
In GetFramesUpTo, don't adjust the number of frames for the inlined depth if the number of frames in UINT32_MAX.

llvm-svn: 163432
2012-09-07 23:35:54 +00:00
Greg Clayton ba1fad8420 Added a quick example to show how disasembly output can be customized.
llvm-svn: 163421
2012-09-07 21:18:45 +00:00
Greg Clayton 0662d966dc Train LLDB to deal with bad linker N_SO entries that point to our source files for debug map + DWARF in .o file debugging.
llvm-svn: 163417
2012-09-07 20:29:13 +00:00
Greg Clayton e2186ed6d9 Patch from Andrew Kaylor for linux:
The attached patch fixes a problem with performing an attach from the SBTarget API on Linux (and other systems that use ProcessPOSIX).
 
When Process::Attach was called from SBTarget, it resulted in a call to a form of the DoAttachWithID function that wasn't implemented in ProcessPOSIX, and so it fell back to the default implementation (which just returns an error).  It didn't seem necessary to use the attach_info parameter for this case, so I just implemented it as a call to the simpler version of the function.
 
In debugging this problem, I also found that SBTarget wasn't checking the return value from the Attach call, causing it to hang when the attach fails.

llvm-svn: 163399
2012-09-07 17:51:47 +00:00
Greg Clayton 542e407581 Patch from Andrew Kaylor for linux:
The attached patch adds support for debugging 32-bit processes when running a 64-bit lldb on an x86_64 Linux system.
 
Making this work required two basic changes:
 
1)      Getting lldb to report that it could debug 32-bit processes
2)      Changing an assumption about how ptrace works when debugging cross-platform
 
For the first change, I took a conservative approach and only enabled this for x86_64 Linux platforms.  It may be that the change I made in Host.cpp could be extended to other 64-bit Linux platforms, but I'm not familiar enough with the other platforms to know for sure.
 
For the second change, the Linux ProcessMonitor class was assuming that ptrace(PTRACE_[PEEK|POKE]DATA...) would read/write a "word" based on the child process word size.  However, the ptrace documentation says that the "word" size read or written is "determined by the OS variant."  I verified experimentally that when ptracing a 32-bit child from a 64-bit parent a 64-bit word is read or written.

llvm-svn: 163398
2012-09-07 17:49:29 +00:00
Jim Ingham f02a2e96b8 Ensure that the ShouldStopHere plans get called even when doing "virtual" steps.
llvm-svn: 163366
2012-09-07 01:11:44 +00:00
Jim Ingham 7da851a3e2 For now, treat breakpoint hits like regular stops when calculation InlinedStackDepth.
llvm-svn: 163365
2012-09-07 01:11:08 +00:00
Enrico Granata c30a73adf6 Fixing a constness issue in an otherwise trivial patch
llvm-svn: 163352
2012-09-06 22:02:28 +00:00
Enrico Granata 6b09d42335 Restoring an API as deprecated which was removed in a previous commit
llvm-svn: 163351
2012-09-06 21:58:25 +00:00