Commit Graph

5731 Commits

Author SHA1 Message Date
Sean Callanan 7fcf0c131b Added a testcase for runtime types in Objective-C.
llvm-svn: 166507
2012-10-23 22:14:39 +00:00
Enrico Granata 91fe01753d <rdar://problem/12523238> Commit 2 of 3
Adding the new has_children (or MightHaveChildren() in C++) for the existing synthetic children providers
In a few cases, the new call is going to be much more efficient than the previous num_children > 0 check
When the optimization was marginal (e.g. std::vector<>), the choice was to use num_children in order to keep
implementation details in one function instead of duplicating code

Next step is to provide test cases

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

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

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

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

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

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

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

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

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

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

- made matching against language names case
  insensitive.

This should improve discoverability.

<rdar://problem/12552359>

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

<rdar://problem/12551591>

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

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

We would crash.

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

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

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

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

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

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

<rdar://problem/12389615>

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

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

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

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

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

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

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

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

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

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

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

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

settings set target.disable-kext-loading true

<rdar://problem/12490623>

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

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

<rdar://problem/12380800>

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

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

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

Then run your program and see the extra threads. 

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

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

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

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

target.arg0 (string) = 

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

target.run-args (arguments) =

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

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

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

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

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

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

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

<rdar://problem/12457211>

llvm-svn: 166062
2012-10-16 21:41:58 +00:00
Enrico Granata 430e540b6b Removing the two extra GetXSize(bool) calls since we do not desire to support them long-term
llvm-svn: 166060
2012-10-16 21:11:14 +00:00
Enrico Granata cd4d24d5e9 <rdar://problem/12446320> Fixing an issue with our Driver where setting an immediate output would not cause suppression of the final printout. This allows effective output redirection for Python commands
llvm-svn: 166058
2012-10-16 20:57:12 +00:00
Jason Molenda 981d4dfa0f llvm needs the OS to be set to either iOS or Mac OS X
to work properly; when doing bare-boards rom debugging
force the OS to be one of those when initializing llvm.
<rdar://problem/12504138>

llvm-svn: 166057
2012-10-16 20:45:49 +00:00
Greg Clayton 743ecf4393 Patch from Matt Kopec:
This patch fixes an issue where if lldb fails to attach to a process (ie. invalid pid) on Linux, the process monitor thread gets stuck waiting for a signal from the attach thread, which never comes due to not being signaled. It also implements StopOpThread which is used for both attach/launch cases as I'm not aware of any special handling needed for the attach case. Also, propagate 'Error' from the Detach function instead of using a bool.

llvm-svn: 166055
2012-10-16 20:20:18 +00:00
Sean Callanan 794baf6fb7 If a full path to a compiler is provided on the
command line to dotest.py, replace / with _ in
the logfile names that mention that compiler so
that we don't try to put log files in weird
places.

llvm-svn: 166038
2012-10-16 18:22:04 +00:00