History log of /external/lldb/source/Expression/ClangUserExpression.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
4a4448ba891e48882f8a8c0e891d4fb207a74a0a 13-Jul-2013 Sean Callanan <scallanan@apple.com> Modified the expression parser to only try to
write to registers if they were modified in the
expression. This eliminates spurious errors if
the register can't be written to but the
expression didn't write to it anyway.

Also improved error handling for the materializer
to make "couldn't materialize struct" errors more
informative.

<rdar://problem/14322579>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@186228 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
52f792329be5db8e38961350589e97e8f2823acd 12-Jul-2013 Greg Clayton <gclayton@apple.com> Huge change to clean up types.

A long time ago we start with clang types that were created by the symbol files and there were many functions in lldb_private::ClangASTContext that helped. Later we create ClangASTType which contains a clang::ASTContext and an opauque QualType, but we didn't switch over to fully using it. There were a lot of places where we would pass around a raw clang_type_t and also pass along a clang::ASTContext separately. This left room for error.

This checkin change all type code over to use ClangASTType everywhere and I cleaned up the interfaces quite a bit. Any code that was in ClangASTContext that was type related, was moved over into ClangASTType. All code that used these types was switched over to use all of the new goodness.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@186130 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
cdc3ea5398f251d3eca482595f103b1874e51538 27-Apr-2013 Sean Callanan <scallanan@apple.com> Performance optimizations to ClangUserExpression,
mostly related to management of the stack frame
for the interpreter.

- First, if the expression can be interpreted,
allocate the stack frame in the target process
(to make sure pointers are valid) but only
read/write to the copy in the host's memory.

- Second, keep the memory allocations for the
stack frame and the materialized struct as
member variables of ClangUserExpression. This
avoids memory allocations and deallocations
each time the expression runs.

<rdar://problem/13043685>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@180664 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
d387b462eecb908af265ecc7006781b4532073ad 19-Apr-2013 Greg Clayton <gclayton@apple.com> Fixed some linux buildbot warnings.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@179892 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
28195f9e55173cd06c3c5f9e69cefeb1d03cc129 19-Apr-2013 Sean Callanan <scallanan@apple.com> Optimized the way breakpoint conditions are evaluated.
Previously, the options for a breakopint or its
locations stored only the text of the breakpoint
condition (ironically, they used ClangUserExpression
as a glorified std::string) and, each time the condition
had to be evaluated in the StopInfo code, the expression
parser would be invoked via a static method to parse and
then execute the expression.

I made several changes here:

- Each breakpoint location now has its own
ClangUserExpressionSP containing a version of
the breakpoint expression compiled for that exact
location.

- Whenever the breakpoint is hit, the breakpoint
condition expression is simply re-run to determine
whether to stop.

- If the process changes (e.g., it's re-run) or
the source code of the expression changes (we use
a hash so as to avoid doing string comparisons)
the ClangUserExpressionSP is re-generated.

This should improve performance of breakpoint
conditions significantly, and takes advantage of
the recent expression re-use work.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@179838 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
102b2c2681c9a830afe25bfea35557421905e42c 19-Apr-2013 Greg Clayton <gclayton@apple.com> After discussing with Chris Lattner, we require C++11, so lets get rid of the macros and just use C++11.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@179805 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
0f0551e67d8ea8d63ace5456f7d42d951827b017 19-Apr-2013 Sean Callanan <scallanan@apple.com> This commit changes the way LLDB executes user
expressions.

Previously, ClangUserExpression assumed that if
there was a constant result for an expression
then it could be determined during parsing. In
particular, the IRInterpreter ran while parser
state (in particular, ClangExpressionDeclMap)
was present. This approach is flawed, because
the IRInterpreter actually is capable of using
external variables, and hence the result might
be different each run. Until now, we papered
over this flaw by re-parsing the expression each
time we ran it.

I have rewritten the IRInterpreter to be
completely independent of the ClangExpressionDeclMap.
Instead of special-casing external variable lookup,
which ties the IRInterpreter closely to LLDB,
we now interpret the exact same IR that the JIT
would see. This IR assumes that materialization
has occurred; hence the recent implementation of the
Materializer, which does not require parser state
(in the form of ClangExpressionDeclMap) to be
present.

Materialization, interpretation, and dematerialization
are now all independent of parsing. This means that
in theory we can parse expressions once and run them
many times. I have three outstanding tasks before
shutting this down:

- First, I will ensure that all of this works with
core files. Core files have a Process but do not
allow allocating memory, which currently confuses
materialization.

- Second, I will make expression breakpoint
conditions remember their ClangUserExpression and
re-use it.

- Third, I will tear out all the redundant code
(for example, materialization logic in
ClangExpressionDeclMap) that is no longer used.

While implementing this fix, I also found a bug in
IRForTarget's handling of floating-point constants.
This should be fixed.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@179801 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
81a96aa6242f7b559770f5dc62316253cb8cb0d4 18-Apr-2013 Greg Clayton <gclayton@apple.com> Since we use C++11, we should switch over to using std::unique_ptr when C++11 is being used. To do this, we follow what we have done for shared pointers and we define a STD_UNIQUE_PTR macro that can be used and it will "do the right thing". Due to some API differences in std::unique_ptr and due to the fact that we need to be able to compile without C++11, we can't use move semantics so some code needed to change so that it can compile with either C++.

Anyone wanting to use a unique_ptr or auto_ptr should now use the "STD_UNIQUE_PTR(TYPE)" macro.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@179779 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
a6686e36cd56843e594139324884585fb47b918b 17-Apr-2013 Sean Callanan <scallanan@apple.com> Flipped the big switch: LLDB now uses the new
Materializer for all expressions that need to
run in the target. This includes the following
changes:

- Removed a bunch of (de-)materialization code
from ClangExpressionDeclMap and assumed the
presence of a Materializer where we previously
had a fallback.

- Ensured that an IRMemoryMap is passed into
ClangExpressionDeclMap::Materialize().

- Fixed object ownership on LLVMContext; it is
now owned by the IRExecutionUnit, since the
Module and the ExecutionEngine both depend on
its existence.

- Fixed a few bugs in IRMemoryMap and the
Materializer that showed up during testing.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@179649 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
3b16eb9d424068446fea9cd0e0fe5e7d435f5b6e 11-Apr-2013 Sean Callanan <scallanan@apple.com> Added a Materializer class that contains
information about each variable that needs to
be materialized for an expression to work. The
next step is to migrate all materialization code
from ClangExpressionDeclMap to Materializer, and
to use it for variable materialization.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@179245 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
9e6f6a6f394bb570c5f1f9a850ec0befe4a59fef 05-Apr-2013 Sean Callanan <scallanan@apple.com> Factored out memory access into the target process
from IRExecutionUnit into a superclass called
IRMemoryMap. IRMemoryMap handles all reading and
writing, ensuring that areas are kept track of and
memory is properly cached (and deleted).

Also fixed several cases where we would simply leak
binary data in the target process over time. Now
the expression objects explicitly own their
IRExecutionUnit and delete it when they go away. This
is why I had to modify ClangUserExpression,
ClangUtilityFunction, and ClangFunction.

As a side effect of this, I am removing the JIT
mutex for an IRMemoryMap. If it turns out that we
need this mutex, I'll add it in then, but right now
it's just adding complexity.

This is part of a more general project to make
expressions fully reusable. The next step is to
make materialization and dematerialization use
the IRMemoryMap API rather than writing and
reading directly from the process's memory.
This will allow the IR interpreter to use the
same data, but in the host's memory, without having
to use a different set of pointers.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@178832 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
29f3beabadc646d80a74ce3286c862bbca6ac011 28-Mar-2013 Jim Ingham <jingham@apple.com> Use the error from ValidatePlan.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@178204 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
952e9dc874944fcdbbb224f3ec4fc2c859376f64 28-Mar-2013 Greg Clayton <gclayton@apple.com> <rdar://problem/13521159>

LLDB is crashing when logging is enabled from lldb-perf-clang. This has to do with the global destructor chain as the process and its threads are being torn down.

All logging channels now make one and only one instance that is kept in a global pointer which is never freed. This guarantees that logging can correctly continue as the process tears itself down.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@178191 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
017c16aa483e6edabdbbee1bdcd1ce3f8e8a12d1 27-Mar-2013 Greg Clayton <gclayton@apple.com> Don't use a "uintptr_t" for the metadata key, use a "void *". This removes all of the casts that were being used and cleans the code up a bit. Also added the ability to dump the metadata.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@178113 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
1cf3da8b0fb0cabf2431b5fe521842929fca69a3 19-Mar-2013 Sean Callanan <scallanan@apple.com> Refactored the expression parser so that the IR
and the JITted code are managed by a standalone
class that handles memory management itself.

I have removed RecordingMemoryManager and
ProcessDataAllocator, which filled similar roles
and had confusing ownership, with a common class
called IRExecutionUnit. The IRExecutionUnit
manages all allocations ever made for an expression
and frees them when it goes away. It also contains
the code generator and can vend the Module for an
expression to other clases.

The end goal here is to make the output of the
expression parser re-usable; that is, to avoid
re-parsing when re-parsing isn't necessary.

I've also cleaned up some code and used weak pointers
in more places. Please let me know if you see any
leaks; I checked myself as well but I might have
missed a case.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@177364 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
89e248f04ecb87d0df4a4b96158c3fac0a3e43c7 09-Feb-2013 Jim Ingham <jingham@apple.com> Reworked the way Process::RunThreadPlan and the ThreadPlanCallFunction interoperate to fix problems where
hitting auto-continue signals while running a thread plan would cause us to lose control of the debug
session.

<rdar://problem/12993641>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@174793 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
be51f8a81ecf1f50b2843b7b3ecb8cfbc54d9787 31-Jan-2013 Jim Ingham <jingham@apple.com> Add "thread return -x" to unwind the innermost user called expression (if you happen to have stopped in it due to a crash.)
Make the message when you hit an crash while evaluating an expression a little clearer, and mention "thread return -x".

rdar://problem/13110464


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@174095 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
288ddfedeb1946d68e467f342f600e9325060e51 19-Jan-2013 Sean Callanan <scallanan@apple.com> Extended LLDB to handle blocks capturing 'self'
in an Objective-C class method. Before, errors
of the form

error: cannot find interface declaration for '$__lldb_objc_class'

would appear when running any expression when
the current frame is a block that captures 'self'
from an Objective-C class method.

<rdar://problem/12905561>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@172880 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
b794020ffbd6473c59a6e98be044df50abf7fc30 15-Jan-2013 Jim Ingham <jingham@apple.com> Separated the "expr --unwind-on-error" behavior into two parts, actual errors (i.e. crashes) which continue to be
controlled by the --unwind-on-error flag, and --ignore-breakpoint which separately controls behavior when a called
function hits a breakpoint. For breakpoints, we don't unwind, we either stop, or ignore the breakpoint, which makes
more sense.
Also make both these behaviors globally settable through "settings set".
Also handle the case where a breakpoint command calls code that ends up re-hitting the breakpoint. We were recursing
and crashing. Now we just stop without calling the second command.

<rdar://problem/12986644>
<rdar://problem/9119325>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@172503 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
6798bd472f98f860b911a0de0586a73f3fa6ddf7 07-Dec-2012 Jim Ingham <jingham@apple.com> Now that we set ThreadPlanCallFunction to private in the constructor, it is confusing that we set it
again in client code after creating the plans. So remove those unnecessary calls.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@169625 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
77dd4a4181f616f6d3c1205075872bc6325e0adf 06-Dec-2012 Sean Callanan <scallanan@apple.com> The expression parser will now check the validity
of the "self"/"this" pointer for the current stack
frame before wrapping expressions in C++ or
Objective-C methods. This works around bad debug
info where the compiler emits a "this" or "self"
but doesn't give any way to find its location.

<rdar://problem/12809985>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@169461 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
5474125bb24890a0018398cbbc5f9b4e571f61eb 01-Dec-2012 Sean Callanan <scallanan@apple.com> Added logging to the code that determines
whether the current frame is in a C++/Objective-C
class or instance method.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@169062 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
5f35a4be95aed0e5b2cb36f7d785bcbfc67284ae 29-Nov-2012 Daniel Malea <daniel.malea@intel.com> Resolve printf formatting warnings on Linux:
- use macros from inttypes.h for format strings instead of OS-specific types

Patch from Matt Kopec!



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@168945 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
c7f17c030eb0632a0bb1cd0ebf29900d6d97a902 31-Oct-2012 Jim Ingham <jingham@apple.com> Make blocks that capture their containing method's object pointer look like methods of
the containing class so that direct ivar access will work in the expression parser.

<rdar://problem/9797999>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@167061 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
47beabb1386be44e3f90dbc30a0b22c23b93a4dc 16-Oct-2012 Jim Ingham <jingham@apple.com> 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>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@166062 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
6f01c93497df194b6f2194630a81e87d806ce0e0 12-Oct-2012 Jim Ingham <jingham@apple.com> Bunch of cleanups for warnings found by the llvm static analyzer.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@165808 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
7adfcfdb46018d16393995276699a04505727808 18-Sep-2012 Enrico Granata <egranata@apple.com> 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

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@164082 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
49ce8969d3154e1560106cfe530444c09410f217 29-Aug-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/11757916>

Make breakpoint setting by file and line much more efficient by only looking for inlined breakpoint locations if we are setting a breakpoint in anything but a source implementation file. Implementing this complex for a many reasons. Turns out that parsing compile units lazily had some issues with respect to how we need to do things with DWARF in .o files. So the fixes in the checkin for this makes these changes:
- Add a new setting called "target.inline-breakpoint-strategy" which can be set to "never", "always", or "headers". "never" will never try and set any inlined breakpoints (fastest). "always" always looks for inlined breakpoint locations (slowest, but most accurate). "headers", which is the default setting, will only look for inlined breakpoint locations if the breakpoint is set in what are consudered to be header files, which is realy defined as "not in an implementation source file".
- modify the breakpoint setting by file and line to check the current "target.inline-breakpoint-strategy" setting and act accordingly
- Modify compile units to be able to get their language and other info lazily. This allows us to create compile units from the debug map and not have to fill all of the details in, and then lazily discover this information as we go on debuggging. This is needed to avoid parsing all .o files when setting breakpoints in implementation only files (no inlines). Otherwise we would need to parse the .o file, the object file (mach-o in our case) and the symbol file (DWARF in the object file) just to see what the compile unit was.
- modify the "SymbolFileDWARFDebugMap" to subclass lldb_private::Module so that the virtual "GetObjectFile()" and "GetSymbolVendor()" functions can be intercepted when the .o file contenst are later lazilly needed. Prior to this fix, when we first instantiated the "SymbolFileDWARFDebugMap" class, we would also make modules, object files and symbol files for every .o file in the debug map because we needed to fix up the sections in the .o files with information that is in the executable debug map. Now we lazily do this in the DebugMapModule::GetObjectFile()

Cleaned up header includes a bit as well.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@162860 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
544f2b622e58bcf43406fd7d0102dedadd49858f 18-Aug-2012 Johnny Chen <johnny.chen@apple.com> Fix missing braces from the python-GIL merge.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@162162 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
8165d43ee84ab51de9218ba38bea257d082cec1f 18-Aug-2012 Johnny Chen <johnny.chen@apple.com> Merge python-GIL bracnh (by filcab) back into trunk!


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@162161 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
b386d82334b65fb984348f2027b1cb7714de993f 09-Aug-2012 Sean Callanan <scallanan@apple.com> Removed explicit NULL checks for shared pointers
and instead made us use implicit casts to bool.
This generated a warning in C++11.

<rdar://problem/11930775>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@161559 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
6cca9695637b27bd583eaae310d5c09dede7cc49 17-Jul-2012 Enrico Granata <egranata@apple.com> <rdar://problem/11672978> Fixing an issue where an ObjC object might come out without a description because the expression used to obtain it would timeout before running to completion

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@160326 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
b3a1a2bba41281ba56a99fe64887a8a04760784c 14-Jul-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/11870357>

Allow "frame variable" to find ivars without the need for "this->" or "self->".


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@160211 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
b573bd6eb07845623a3b846358e082463c88667c 13-Jul-2012 Sean Callanan <scallanan@apple.com> Be a little more safe when checking whether the
current symbol context is a C++ or Objective-C
instance method.

Specifically, ensure that we fetch information
on the current block, not just the current
function.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@160195 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
d787da46c01f3b212a42891b3b54e608358a7efe 03-Apr-2012 Bill Wendling <isanbard@gmail.com> Initialize ivars in the correct order.

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@153947 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
142f94c8a1498c5269a9f878ed92adf0ffc71215 01-Mar-2012 Sean Callanan <scallanan@apple.com> Updated LLVM to take a new MC JIT that supports
allocations by section. We install these sections
in the target process and inform the JIT of their
new locations.

Also removed some unused variable warnings.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@151789 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
3508c387c3f0c9ecc439d98048fd7694d41bab1b 24-Feb-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/10103468>

I started work on being able to add symbol files after a debug session
had started with a new "target symfile add" command and quickly ran into
problems with stale Address objects in breakpoint locations that had
lldb_private::Section pointers into modules that had been removed or
replaced. This also let to grabbing stale modules from those sections.
So I needed to thread harded the Address, Section and related objects.

To do this I modified the ModuleChild class to now require a ModuleSP
on initialization so that a weak reference can created. I also changed
all places that were handing out "Section *" to have them hand out SectionSP.
All ObjectFile, SymbolFile and SymbolVendors were inheriting from ModuleChild
so all of the find plug-in, static creation function and constructors now
require ModuleSP references instead of Module *.

Address objects now have weak references to their sections which can
safely go stale when a module gets destructed.

This checkin doesn't complete the "target symfile add" command, but it
does get us a lot clioser to being able to do such things without a high
risk of crashing or memory corruption.




git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@151336 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
dd1dcfdbad297562951169ad621f895daf32b382 10-Feb-2012 Sean Callanan <scallanan@apple.com> Fixed a bunch of ownership problems with the expression
parser. Specifically:

- ClangUserExpression now keeps weak pointers to the
structures it needs and then locks them when needed.
This ensures that they continue to be valid without
leaking memory if the ClangUserExpression is long
lived.

- ClangExpressionDeclMap, instead of keeping a pointer
to an ExecutionContext, now contains an
ExecutionContext. This prevents bugs if the pointer
or its contents somehow become stale. It also no
longer requires that ExecutionContexts be passed
into any function except its initialization function,
since it can count on the ExecutionContext still
being around.

There's a lot of room for improvement (specifically,
ClangExpressionDeclMap should also use weak pointers
insetad of shared pointers) but this is an important
first step that codifies assumptions that already
existed in the code.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@150217 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
e7ba112632f671dc76502262e46c97cb2f7dc4e1 08-Feb-2012 Sean Callanan <scallanan@apple.com> In the absence of a valid process, the expression
parser now at least tries to generate IR for the
target.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@150079 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
13d24fb1817faa7ccc4cfd799113ba1a2b8968eb 29-Jan-2012 Greg Clayton <gclayton@apple.com> Switching back to using std::tr1::shared_ptr. We originally switched away
due to RTTI worries since llvm and clang don't use RTTI, but I was able to
switch back with no issues as far as I can tell. Once the RTTI issue wasn't
an issue, we were looking for a way to properly track weak pointers to objects
to solve some of the threading issues we have been running into which naturally
led us back to std::tr1::weak_ptr. We also wanted the ability to make a shared
pointer from just a pointer, which is also easily solved using the
std::tr1::enable_shared_from_this class.

The main reason for this move back is so we can start properly having weak
references to objects. Currently a lldb_private::Thread class has a refrence
to its parent lldb_private::Process. This doesn't work well when we now hand
out a SBThread object that contains a shared pointer to a lldb_private::Thread
as this SBThread can be held onto by external clients and if they end up
using one of these objects we can easily crash.

So the next task is to start adopting std::tr1::weak_ptr where ever it makes
sense which we can do with lldb_private::Debugger, lldb_private::Target,
lldb_private::Process, lldb_private::Thread, lldb_private::StackFrame, and
many more objects now that they are no longer using intrusive ref counted
pointer objects (you can't do std::tr1::weak_ptr functionality with intrusive
pointers).



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@149207 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
c61349681fa2923bd30ad16afce450a0da6108cf 06-Jan-2012 Johnny Chen <johnny.chen@apple.com> http://llvm.org/bugs/show_bug.cgi?id=11618
lldb::SBValue::AddressOf does not work on dereferenced registers in synthetic children provider

Patch submitted by Enrico Granata.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@147637 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
daa6efe771f5f068e29328a774fa5bf2358ce14a 21-Dec-2011 Sean Callanan <scallanan@apple.com> The "desired result type" code in the expression
parser has hitherto been an implementation waiting
for a use. I have now tied the '-o' option for
the expression command -- which indicates that the
result is an Objective-C object and needs to be
printed -- to the ExpressionParser, which
communicates the desired type to Clang.

Now, if the result of an expression is determined
by an Objective-C method call for which there is
no type information, that result is implicitly
cast to id if and only if the -o option is passed
to the expression command. (Otherwise if there
is no explicit cast Clang will issue an error.
This behavior is identical to what happened before
r146756.)

Also added a testcase for -o enabled and disabled.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@147099 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
21f2e192079b6aa9ddd2d25283e19abdb38eeeb5 14-Dec-2011 Sean Callanan <scallanan@apple.com> This commit is the result of a general audit of
the expression parser to locate instances where
dyn_cast<>() and isa<>() are used on types, and
replace them with getAs<>() as appropriate.

The difference is that dyn_cast<>() and isa<>()
are essentially LLVM/Clang's equivalent of RTTI
-- that is, they try to downcast the object and
return NULL if they cannot -- but getAs<>() can
traverse typedefs to perform a semantic cast.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@146537 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
5ed59a78c1970fab44b393cd9d20f0e6fc2e326a 13-Dec-2011 Sean Callanan <scallanan@apple.com> I have modified the part of the code that finds and
validates the "self," "this," and "_cmd" pointers
that get passed into expressions. It used to check
them aggressively for validity before allowing the
expression to run as an object method; now, this
functionality is gated by a bool and off by default.

Now the default is that when LLDB is stopped in a
method of a class, code entered using "expr" will
always masquerade as an instance method. If for
some reason "self," "this," or "_cmd" is unavailable
it will be reported as NULL. This may cause the
expression to crash if it relies on those pointers,
but for example getting the addresses of ivars will
now work as the user would expect.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@146465 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
e1301a62783cf0d5457350b90830917841cbf6fc 06-Dec-2011 Sean Callanan <scallanan@apple.com> As part of the work to make Objective-C type information
from symbols more accessible, I have added a second
map to the ClangASTImporter: the ObjCInterfaceMetaMap.
This map keeps track of all type definitions found for
a particular Objective-C interface, allowing the
ClangASTSource to refer to all possible sources when
looking for method definitions.

There is a bug in lookup that I still need to figure out,
but after that we should be able to report full method
information for Objective-C classes shown in symbols.

Also fixed some errors I ran into when enabling the maps
for the persistent type store. The persistent type store
previously did not use the ClangASTImporter to import
types, instead using ASTImporters that got allocated each
time a type needed copying. To support the requirements
of the persistent type store -- namely, that types must be
copied, completed, and then completely severed from their
origin in the parser's AST context (which will go away) --
I added a new function called DeportType which severs all
these connections.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@145914 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
e6ea5fe8e76b028a0565bc01543bc15f8c120e8a 15-Nov-2011 Sean Callanan <scallanan@apple.com> Pulled in a new version of LLVM/Clang to solve a variety
of problems with Objective-C object completion. To go
along with the LLVM/Clang-side fixes, we have a variety
of Objective-C improvements.

Fixes include:

- It is now possible to run expressions when stopped in
an Objective-C class method and have "self" act just
like "self" would act in the class method itself (i.e.,
[self classMethod] works without casting the return
type if debug info is present). To accomplish this,
the expression masquerades as a class method added by
a category.

- Objective-C objects can now provide methods and
properties and methods to Clang on demand (i.e., the
ASTImporter sets hasExternalVisibleDecls on Objective-C
interface objects).

- Objective-C built-in types, which had long been a bone
of contention (should we be using "id"? "id*"?), are
now fetched correctly using accessor functions on
ClangASTContext. We inhibit searches for them in the
debug information.

There are also a variety of logging fixes, and I made two
changes to the test suite:

- Enabled a test case for Objective-C properties in the
current translation unit.

- Added a test case for calling Objective-C class methods
when stopped in a class method.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@144607 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
0296fe73a7cb1482226b1303a795ede00e12d677 08-Nov-2011 Jim Ingham <jingham@apple.com> Do a better job of detecting when a breakpoint command has set the target running again (except you have to ignore
cases where the breakpoint runs expressions, those don't count as really "running again").


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@144064 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
5b658cc411e8810073f7f633f3c5d6f177cb3dcd 08-Nov-2011 Sean Callanan <scallanan@apple.com> Added a language parameter to the expression parser,
which will in the future allow expressions to be
compiled as C, C++, and Objective-C instead of the
current default Objective-C++. This feature requires
some additional support from Clang -- specifically, it
requires reference types in the parser regardless of
language -- so it is not yet exposed to the user.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@144042 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
fa9e6dd370331db1fdef7420e43c5aaacf0b2f65 04-Nov-2011 Sean Callanan <scallanan@apple.com> Occasionally LLDB runs into contexts where the
target is stopped in a C++ or Objective-C method
but the "self" pointer's valid range actually
doesn't cover the current location. Before, that
was confusing Clang to the point where it crashed;
now, we sanity-check and fall back to pretending
we're in a C function if "self" or "this" isn't
available.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@143676 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
97c8957257a3e0b3ce6f46f8e5a28c965e30f357 31-Oct-2011 Daniel Dunbar <daniel@zuster.org> warnings: Fix a bunch of -Wreorder problems.

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@143381 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
73b520f4f60dca58e58e446c9504d45384ee677b 29-Oct-2011 Sean Callanan <scallanan@apple.com> I moved the responsibility for interacting with the
AST importer on completing namespace mappings from
ClangExpressionDeclMap to ClangASTSource.

ClangASTSource now contains a TargetSP which it
uses to lookup namespaces in all of a target's
modules. I will use the TargetSP in the future to
look up globals.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@143275 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
6d284ef56532873d669f8edd4b40031407f0ffe4 13-Oct-2011 Sean Callanan <scallanan@apple.com> Extended the lifetime of Clang parser objects to the
lifetime of ClangExpressionDeclMap. This allows
ClangExpressionVariables found during parsing to be
queried for their containing namespaces during
expression execution.

Other clients (like ClangFunction) explicitly delete
this state, so they should not result in any memory
leaks.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@141821 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
060d53f1559d08a6923e45bdeffe8f22ca663049 08-Oct-2011 Sean Callanan <scallanan@apple.com> Fixed a memory leak of ASTResultSynthesizers,
by attaching them to the ClangExpressionParser.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@141452 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
de3d27ef1d426713d7af044cfd5c34a9aeae926a 26-Sep-2011 Sean Callanan <scallanan@apple.com> Factored out handling of the source code for an
expression into a separate class. This class
encapsulates wrapping the function as needed. I
am also moving from using booleans to indicate
what the expression's language should be to using
lldb::LanguageType instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@140545 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
567e7f3ba16eb48cb9fd6a2f26f2f7269eb6983c 22-Sep-2011 Greg Clayton <gclayton@apple.com> Converted the lldb_private::Process over to use the intrusive
shared pointers.

Changed the ExecutionContext over to use shared pointers for
the target, process, thread and frame since these objects can
easily go away at any time and any object that was holding onto
an ExecutionContext was running the risk of using a bad object.

Now that the shared pointers for target, process, thread and
frame are just a single pointer (they all use the instrusive
shared pointers) the execution context is much safer and still
the same size.

Made the shared pointers in the the ExecutionContext class protected
and made accessors for all of the various ways to get at the pointers,
references, and shared pointers.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@140298 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
6cf6c474742a23e7cb6b4f618bf1de711db90a85 21-Sep-2011 Sean Callanan <scallanan@apple.com> Fixed a problem where expressions would attempt to
allocate memory in a process that did not support
expression execution. Also improved detection of
whether or not a process can execute expressions.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@140202 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
7e5fa7fc1f8efd24c078e063b2c4b5e13ba5be20 20-Sep-2011 Jason Molenda <jmolenda@apple.com> Update declarations for all functions/methods that accept printf-style
stdarg formats to use __attribute__ format so the compiler can flag
incorrect uses. Fix all incorrect uses. Most of these are innocuous,
a few were resulting in crashes.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@140185 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
f7649bbe2b2fc103e26a7577b49089a39d9a75d7 15-Sep-2011 Sean Callanan <scallanan@apple.com> Fixed a problem where the expression parser would
attempt to obtain information from the process even
in cases where the process isn't available.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@139803 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
47dc457387b690c5e4df1c0c7dd8c4337b92e630 15-Sep-2011 Sean Callanan <scallanan@apple.com> This patch modifies the expression parser to allow it
to execute expressions even in the absence of a process.
This allows expressions to run in situations where the
target cannot run -- e.g., to perform calculations based
on type information, or to inspect a binary's static
data.

This modification touches the following files:

lldb-private-enumerations.h
Introduce a new enum specifying the policy for
processing an expression. Some expressions should
always be JITted, for example if they are functions
that will be used over and over again. Some
expressions should always be interpreted, for
example if the target is unsafe to run. For most,
it is acceptable to JIT them, but interpretation
is preferable when possible.

Target.[h,cpp]
Have EvaluateExpression now accept the new enum.

ClangExpressionDeclMap.[cpp,h]
Add support for the IR interpreter and also make
the ClangExpressionDeclMap more robust in the
absence of a process.

ClangFunction.[cpp,h]
Add support for the new enum.

IRInterpreter.[cpp,h]
New implementation.

ClangUserExpression.[cpp,h]
Add support for the new enum, and for running
expressions in the absence of a process.

ClangExpression.h
Remove references to the old DWARF-based method
of evaluating expressions, because it has been
superseded for now.

ClangUtilityFunction.[cpp,h]
Add support for the new enum.

ClangExpressionParser.[cpp,h]
Add support for the new enum, remove references
to DWARF, and add support for checking whether
the expression could be evaluated statically.

IRForTarget.[h,cpp]
Add support for the new enum, and add utility
functions to support the interpreter.

IRToDWARF.cpp
Removed

CommandObjectExpression.cpp
Remove references to the obsolete -i option.

Process.cpp
Modify calls to ClangUserExpression::Evaluate
to pass the correct enum (for dlopen/dlclose)

SBValue.cpp
Add support for the new enum.

SBFrame.cpp
Add support for he new enum.

BreakpointOptions.cpp
Add support for the new enum.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@139772 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
144188bc458a35997d2f2e52206ab69747439073 13-Sep-2011 Greg Clayton <gclayton@apple.com> Huge memory and performance improvements in the DWARF parser.

Address ranges are now split up into two different tables:
- one in DWARFDebugInfo that is compile unit specific
- one in each DWARFCompileUnit that has exact function DIE offsets

This helps keep the size of the aranges down since the main table will get
uniqued and sorted and have consecutive ranges merged. We then only parse the
compile unit one on demand once we have determined that a compile unit contains
the address in question. We also now use the .debug_aranges section if there
is one instead of always indexing the DWARF manually.

NameToDIE now uses a UniqueCStringMap<dw_offset> map instead of a std::map.
std::map is very bulky as each node has 3 pointers and the key and value types.
This gets our NameToDIE entry down to 12 bytes each instead of 48 which saves
us a lot of memory when we have very large DWARF.

DWARFDebugAranges now has a smaller footprint for each range it contains to
save on memory.




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@139557 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
036fa9000fdc68f45ee22ada3d7ce00422b8afcc 25-Aug-2011 Sean Callanan <scallanan@apple.com> Fixed a bug where the target for an expression was
not set if the containing function could not be
found. This caused LLDB to crash later in
expression parsing.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@138499 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
2431244f929e269c6ecd51aa3eb606b6a2474f19 23-Aug-2011 Sean Callanan <scallanan@apple.com> Added support for persistent types to the
expression parser. You can use a persistent
type like this:

(lldb) expr struct $foo { int a; int b; };
(lldb) struct $foo i; i.a = 2; i.b = 3; i
($foo) $0 = {
(int) a = 2
(int) b = 3
}

typedefs work similarly.

This patch affects the following files:

test/expression_command/persistent_types/*
A test case for persistent types,
in particular structs and typedefs.

ClangForward.h
Added TypeDecl, needed to declare some
functions in ASTResultSynthesizer.h

ClangPersistentVariables.[h,cpp]
Added a list of persistent types to the
persistent variable store.

ASTResultSynthesizer.[h,cpp]
Made the AST result synthesizer iterate
across TypeDecls in the expression, and
record any persistent types found. Also
made a minor documentation fix.

ClangUserExpression.[h,cpp]
Extended the user expression class to
keep the state needed to report the
persistent variable store for the target
to the AST result synthesizers.

Also introduced a new error code for
expressions that executed normally but
did not return a result.

CommandObjectExpression.cpp
Improved output for expressions (like
declarations of new persistent types) that
don't return a result. This is no longer
treated as an error.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@138383 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
ec07c0dde27ae022b87423ee106f10437864c219 09-Aug-2011 Jim Ingham <jingham@apple.com> Add EvaluateWithError static method. Fix a bug in handling constant expressions - we weren't setting the result even though the expression evaluation succeeded...

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@137077 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
c617a4cb4a451be9d7e97d7af6e165d282b5390f 06-Aug-2011 Sean Callanan <scallanan@apple.com> This is an overhaul of the expression parser code
that detects what context the current expression is
meant to execute in. LLDB now properly consults
the method declaration in the debug information
rather than trying to hunt down the "this" or "self"
pointer by name, which can be misleading.

Other fixes include:

- LLDB now properly detects that it is inside
an inlined C++ member function.

- LLDB now allows access to non-const members when
in const code.

- The functions in SymbolFile that locate the
DeclContext containing a DIE have been renamed
to reflect what they actually do. I have added
new functions that find the DeclContext for the
DIE itself.

I have also introduced testcases for C++ and
Objective-C.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@136999 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
3c24b49595130917c9e310bce9f8feeb9b5b0ab5 03-Aug-2011 Sean Callanan <scallanan@apple.com> Improved the expression parser's detection of the
current context. Previously, if there was a variable
called "self" available, the expression parser
assumed it was inside a method. But class methods
in Objective-C also take a "self" parameter, of DWARF
type "id". We now detect this properly, and only
assume we're in an instance method if "self" is a
pointer to an Objective-C object.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@136784 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
166ba106f9d8c377f2fda72112c821550d2e82d1 01-Aug-2011 Sean Callanan <scallanan@apple.com> Added checking to make sure that the target has a
scratch AST context before attempting to parse.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@136631 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
2bc9eb3ba78efc64a273729b480bafc3bbaa433a 19-Jul-2011 Johnny Chen <johnny.chen@apple.com> Patch by Matt Johnson to silence G++ warnings!
Used hand merge to apply the diffs. I did not apply the diffs for FormatManager.h and
the diffs for memberwise initialization for ValueObject.cpp because they changed since.
I will ask my colleague to apply them later.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@135508 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
4c3fb4b50a87e6e08987096d7edacc26545f58dc 19-Jul-2011 Enrico Granata <granata.enrico@gmail.com> The implementation of categories is now synchronization safe
Code cleanup:
- The Format Manager implementation is now split between two files: FormatClasses.{h|cpp} where the
actual formatter classes (ValueFormat, SummaryFormat, ...) are implemented and
FormatManager.{h|cpp} where the infrastructure classes (FormatNavigator, FormatManager, ...)
are contained. The wrapper code always remains in Debugger.{h|cpp}
- Several leftover fields, methods and comments from previous design choices have been removed
type category subcommands (enable, disable, delete) now can take a list of category names as input
- for type category enable, saying "enable A B C" is the same as saying
enable C
enable B
enable A
(the ordering is relevant in enabling categories, and it is expected that a user typing
enable A B C wants to look into category A, then into B, then into C and not the other
way round)
- for the other two commands, the order is not really relevant (however, the same inverted ordering
is used for consistency)


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@135494 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
fe1b47d67c6884a0860d1ee62a4f0beae707c679 25-Jun-2011 Greg Clayton <gclayton@apple.com> Cleanup error output on expressions.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@133834 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
e6bd142d9fa7ed149bd37efd8a75637375f165b7 20-Jun-2011 Jim Ingham <jingham@apple.com> Use the dyld_mode, image_infos & image_infos_count passed into the shared library notification function
to update libraries rather than reading the whole all_imaage_infos structure every time we get notified.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@133448 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
c0492741dc594cd02736521048fe0d8f4c9a0a61 23-May-2011 Sean Callanan <scallanan@apple.com> This commit integrates support for the LLVM MCJIT
into the mainline LLDB codebase. MCJIT introduces
API improvements and better architectural support.

This commit adds a new subsystem, the
ProcessDataAllocator, which is responsible for
performing static data allocations on behalf of the
IR transformer. MCJIT currently does not support
the relocations required to store the constant pool
in the same allocation as the function body, so we
allocate a heap region separately and redirect
static data references from the expression to that
heap region in a new IR modification pass.

This patch also fixes bugs in the IR
transformations that were exposed by the transition
to the MCJIT. Finally, the patch also pulls in a
more recent revision of LLVM so that the MCJIT is
available for use.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@131923 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
5ab7fba0d0a07add74e542689e51b729a26b7dc5 18-May-2011 Jim Ingham <jingham@apple.com> RunThreadPlan should set the plan to "not private" since it needs that,
and then reset it to the original value when done.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@131498 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
3058197753e56a7ea9f4c5784e460a3b977d7bd0 17-May-2011 Greg Clayton <gclayton@apple.com> Fixed the "mmap" to work on MacOSX/darwin by supplying the correct arguemnts.

Modified ClangUserExpression and ClangUtilityFunction to display the actual
error (if one is available) that made the JIT fail instead of a canned
response.

Fixed the restoring of all register values when the 'G' packet doesn't work
to use the correct data.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@131454 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
2370a97fe5bea6fa9d82f40bb34d37d3d3bda317 17-May-2011 Jim Ingham <jingham@apple.com> Fix the error message when an expression evaluation is interrupted by a crash/breakpoint hit to
give the reason for the interrupt. Also make sure it we don't want to unwind from the evaluation
we print something if it is interrupted.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@131448 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
0ddf806dd9e71637846bf0ad46e1b2df7d02cbce 10-May-2011 Sean Callanan <scallanan@apple.com> Fixed a bug in which expression-local variables were
treated as being permanently resident in target
memory. In fact, since the expression's stack frame
is deleted and potentially re-used after the
expression completes, the variables need to be treated
as being freeze-dried.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@131104 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
696cf5f6f2a77b87a4b06cdf0f697749b494665f 07-May-2011 Sean Callanan <scallanan@apple.com> Made expressions that are just casts of pointer
variables be evaluated statically.

Also fixed a bug that caused the results of
statically-evaluated expressions to be materialized
improperly.

This bug also removes some duplicate code.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@131042 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
47da810225d8674eb9158bcf5f1f5b847cbaeedf 23-Apr-2011 Jim Ingham <jingham@apple.com> Fix up how the ValueObjects manage their life cycle so that you can hand out a shared
pointer to a ValueObject or any of its dependent ValueObjects, and the whole cluster will
stay around as long as that shared pointer stays around.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@130035 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
dbeb3e1e038a75f00fd565203839020e1d00a7c6 11-Apr-2011 Stephen Wilson <wilsons@start.ca> Order of initialization lists.

This patch fixes all of the warnings due to unordered initialization lists.

Patch by Marco Minutoli.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@129290 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
fa3a16a2ea380ef38388ebe323817bd1b32c20cd 31-Mar-2011 Jim Ingham <jingham@apple.com> Convert ValueObject to explicitly maintain the Execution Context in which they were created, and then use that when they update themselves. That means all the ValueObject evaluate me type functions that used to require a Frame object now do not. I didn't remove the SBValue API's that take this now useless frame, but I added ones that don't require the frame, and marked the SBFrame taking ones as deprecated.

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@128593 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
b344843f75ef893762c93fd0a22d2d45712ce74d 24-Mar-2011 Greg Clayton <gclayton@apple.com> Fixed the LLDB build so that we can have private types, private enums and
public types and public enums. This was done to keep the SWIG stuff from
parsing all sorts of enums and types that weren't needed, and allows us to
abstract our API better.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@128239 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
04c9c7b03fbec6d0dcc6c848391147de2f129c66 17-Feb-2011 Greg Clayton <gclayton@apple.com> Clean up a bit of the type getting code where lldb_private:Type now has

clang_type_t
GetClangFullType(); // Get a completely defined clang type

clang_type_t
GetClangLayoutType(); // Get a clang type that can be used for type layout

clang_type_t
GetClangForwardType(); // A type that can be completed if needed, but is more efficient.




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@125691 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
395fc33dc4b06c048ed35047ec461bc092ef2df3 15-Feb-2011 Greg Clayton <gclayton@apple.com> Made lldb_private::ArchSpec contain much more than just an architecture. It
now, in addition to cpu type/subtype and architecture flavor, contains:
- byte order (big endian, little endian)
- address size in bytes
- llvm::Triple for true target triple support and for more powerful plug-in
selection.




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@125602 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
cd548034fa23113e995b8463d14f910ba2f7298c 01-Feb-2011 Greg Clayton <gclayton@apple.com> Endian patch from Kirk Beitz that allows better cross platform building.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@124643 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
14404f86e58509b7486733f7661776684e0f59b9 24-Jan-2011 Sean Callanan <scallanan@apple.com> Fixed a bug in the expression code which caused
it to interpret a "this" variable that was merely
a pointer -- that is, not a class pointer -- as
meaning that the current context was inside a C++
method. This bug would prevent expressions from
evaluating correctly in regular C code if there
was a pointer variable named "this" in scope.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@124117 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
d0882d062a09effb7a22ce81cb327e9b9fa108bd 20-Jan-2011 Greg Clayton <gclayton@apple.com> Make expressions clean up their JIT'ed code allocation.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@123855 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
61468e816e879874ee8499ce5a1b4f1d6759b026 19-Jan-2011 Greg Clayton <gclayton@apple.com> Took the timeout for a ClangUserExpression down from a 10 second timeout to
500 ms.

Make MachThreadList more threadsafe.

Added code to make sure the thread register state was properly flushed for x86_64.

Fixed an missing return code for the current thread in the new thread suffix code.

Improved debugserver logging.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@123815 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
7812e013be05cf8593d7a1d3a51bbb138c52ae90 18-Jan-2011 Jim Ingham <jingham@apple.com> Make a few log messages come out in "log enable lldb step" as well as "log enable lldb expression".

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@123784 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
c71899ef308e6134d1b0ca5f30cbc64414855e1a 18-Jan-2011 Greg Clayton <gclayton@apple.com> Thread safety changes in debugserver and also in the process GDB remote plugin.
I added support for asking if the GDB remote server supports thread suffixes
for packets that should be thread specific (register read/write packets) because
the way the GDB remote protocol does it right now is to have a notion of a
current thread for register and memory reads/writes (set via the "$Hg%x" packet)
and a current thread for running ("$Hc%x"). Now we ask the remote GDB server
if it supports adding the thread ID to the register packets and we enable
that feature in LLDB if supported. This stops us from having to send a bunch
of packets that update the current thread ID to some value which is prone to
error, or extra packets.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@123762 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
c7674af9458fbad6f07fa73609c354abf93af2dc 18-Jan-2011 Sean Callanan <scallanan@apple.com> Added support for the fragile ivars provided by
Apple's Objective-C 2.0 runtime. They are enabled
if the Objective-C runtime has the proper version.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@123694 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
6a92553d2cc2b7a3b853fcb6da101583435c2dc0 13-Jan-2011 Sean Callanan <scallanan@apple.com> Implemented a major overhaul of the way variables are handled
by LLDB. Instead of being materialized into the input structure
passed to the expression, variables are left in place and pointers
to them are materialzied into the structure. Variables not resident
in memory (notably, registers) get temporary memory regions allocated
for them.

Persistent variables are the most complex part of this, because they
are made in various ways and there are different expectations about
their lifetime. Persistent variables now have flags indicating their
status and what the expectations for longevity are. They can be
marked as residing in target memory permanently -- this is the
default for result variables from expressions entered on the command
line and for explicitly declared persistent variables (but more on
that below). Other result variables have their memory freed.

Some major improvements resulting from this include being able to
properly take the address of variables, better and cleaner support
for functions that return references, and cleaner C++ support in
general. One problem that remains is the problem of explicitly
declared persistent variables; I have not yet implemented the code
that makes references to them into indirect references, so currently
materialization and dematerialization of these variables is broken.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@123371 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
c5157ecb9c6185b92923fab50de53f3fad86095d 17-Dec-2010 Greg Clayton <gclayton@apple.com> Added access to set the current stack frame within a thread so any command
line commands can use the current thread/frame.

Fixed an issue with expressions that get sandboxed in an objective C method
where unichar wasn't being passed down.

Added a "static size_t Scalar::GetMaxByteSize();" function in case we need
to know the max supported by size of something within a Scalar object.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@122027 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
01cd93dd057adf324bc9777099e4ac86a6048566 16-Dec-2010 Jason Molenda <jmolenda@apple.com> Remove #include of non-existant lldb/Expression/ASTSplitConsumer.h
(from Sean's commit a minute ago)


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@121954 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
05a5a1bcbed5c0f31fed29153bb2912d71836e91 16-Dec-2010 Sean Callanan <scallanan@apple.com> Implemented a feature where the expression parser
can avoid running the code in the target if the
expression's result is known and the expression
has no side effects.

Right now this feature is quite conservative in
its guess about side effects, and it only computes
integer results, but the machinery to make it more
sophisticated is there.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@121952 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
427f290ff96f3ab9f2cf3a1af7001d2c560424c7 14-Dec-2010 Greg Clayton <gclayton@apple.com> Modified LLDB expressions to not have to JIT and run code just to see variable
values or persistent expression variables. Now if an expression consists of
a value that is a child of a variable, or of a persistent variable only, we
will create a value object for it and make a ValueObjectConstResult from it to
freeze the value (for program variables only, not persistent variables) and
avoid running JITed code. For everything else we still parse up and JIT code
and run it in the inferior.

There was also a lot of clean up in the expression code. I made the
ClangExpressionVariables be stored in collections of shared pointers instead
of in collections of objects. This will help stop a lot of copy constructors on
these large objects and also cleans up the code considerably. The persistent
clang expression variables were moved over to the Target to ensure they persist
across process executions.

Added the ability for lldb_private::Target objects to evaluate expressions.
We want to evaluate expressions at the target level in case we aren't running
yet, or we have just completed running. We still want to be able to access the
persistent expression variables between runs, and also evaluate constant
expressions.

Added extra logging to the dynamic loader plug-in for MacOSX. ModuleList objects
can now dump their contents with the UUID, arch and full paths being logged with
appropriate prefix values.

Thread hardened the Communication class a bit by making the connection auto_ptr
member into a shared pointer member and then making a local copy of the shared
pointer in each method that uses it to make sure another thread can't nuke the
connection object while it is being used by another thread.

Added a new file to the lldb/test/load_unload test that causes the test a.out file
to link to the libd.dylib file all the time. This will allow us to test using
the DYLD_LIBRARY_PATH environment variable after moving libd.dylib somewhere else.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@121745 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
047923c7bc90275f29c2e179d2385df26b8d81a1 14-Dec-2010 Sean Callanan <scallanan@apple.com> Bugfixes for the new "self" pointer handling. Specifically,
the code to pass the _cmd pointer has been improved, and _cmd
is now set to the value of _cmd for the current context, as
opposed to being simply NULL.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@121739 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
3aa7da5cb3327792415de44405e0896c6bdc305b 13-Dec-2010 Sean Callanan <scallanan@apple.com> Added support for generating expressions that have
access to the members of the Objective-C self object.

The approach we take is to generate the method as a
@category on top of the self object, and to pass the
"self" pointer to it. (_cmd is currently NULL.)

Most changes are in ClangExpressionDeclMap, but the
change that adds support to the ABIs to pass _cmd
touches a fair amount of code.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@121722 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
94d255f74c125889e5d0f607f4bfe5334a2999ee 07-Dec-2010 Sean Callanan <scallanan@apple.com> More logging for use in debugging the interactions
between clients of the LLDB API and the expression
parser.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@121193 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
3371102ecdff827087df3c27549e57760a6bbc97 07-Dec-2010 Sean Callanan <scallanan@apple.com> Logging improvements to help identify major events in
LLDB expression execution.
We also now print the argument structure after execution,
to allow us to verify that the expression did indeed
execute correctly.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@121126 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
aa301c49e8b31f01c551cffbaa74c8ba82851a79 03-Dec-2010 Sean Callanan <scallanan@apple.com> Fixed object lifetimes in ClangExpressionDeclMap
so that it is not referring to potentially stale
state during IR execution.

This was done by introducing modular state (like
ClangExpressionVariable) where groups of state
variables have well-defined lifetimes:

- m_parser_vars are specific to parsing, and only
exist between calls to WillParse() and DidParse().

- m_struct_vars survive for the entire execution
of the ClangExpressionDeclMap because they
provide the template for a materialized set of
expression variables.

- m_material_vars are specific to a single
instance of materialization, and only exist
between calls to Materialize() and
Dematerialize().

I also removed unnecessary references to long-
lived state that really didn't need to be referred
to at all, and also introduced several assert()s
that helped me diagnose a few bugs (fixed too).


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@120778 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
e8e5557af333aba8183ce6e9fed9996221eb1547 01-Dec-2010 Sean Callanan <scallanan@apple.com> Fixed ClangUserExpression's wrapping of expressions
in C++ methods. There were two fixes involved:

- For an object whose contents are not known, the
expression should be treated as a non-member, and
"this" should have no meaning.

- For a const object, the method should be declared
const as well.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@120606 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
a65b52703554a2c2f31357cf5a367ae35db86905 01-Dec-2010 Sean Callanan <scallanan@apple.com> Whitespace fix.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@120520 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
360f53f3c216ee4fb433da0a367168785328a856 30-Nov-2010 Jim Ingham <jingham@apple.com> Moved the code in ClangUserExpression that set up & ran the thread plan with timeouts, and restarting with all threads into a utility function in Process. This required a bunch of renaming.

Added a ThreadPlanCallUserExpression that differs from ThreadPlanCallFunction in that it holds onto a shared pointer to its ClangUserExpression so that can't go away before the thread plan is done using it.

Fixed the stop message when you hit a breakpoint while running a user expression so it is more obvious what has happened.

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@120386 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
a91dd997b1e809c67901b7ac481942cacae19150 19-Nov-2010 Sean Callanan <scallanan@apple.com> Added support for indicating to the expression parser
that the result of an expression should be coerced to
a specific type. Also made breakpoint conditions pass
in the bool type for this type.

The expression parser ignores this indication for now.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@119779 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
cb39544fedb3a5c4834c4a741031f9121413bc63 10-Nov-2010 Johnny Chen <johnny.chen@apple.com> Trivial fix for an error message.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@118697 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
6dff827fc7b73b0d1850a76b99f01448c4b98e50 08-Nov-2010 Sean Callanan <scallanan@apple.com> Added more logging so we see the register state
when a function starts and ends, and also the
disassembly for anything that is a client of
ClangExpressionParser after it has been JIT
compiled.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@118401 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
e005f2ce03c489ebde9110678a29cbfe8488d5b4 06-Nov-2010 Greg Clayton <gclayton@apple.com> Modified all logging calls to hand out shared pointers to make sure we
don't crash if we disable logging when some code already has a copy of the
logger. Prior to this fix, logs were handed out as pointers and if they were
held onto while a log got disabled, then it could cause a crash. Now all logs
are handed out as shared pointers so this problem shouldn't happen anymore.
We are also using our new shared pointers that put the shared pointer count
and the object into the same allocation for a tad better performance.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@118319 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
ea9d4267a629a1c732eb0400fa0288cee31ad49d 05-Nov-2010 Jim Ingham <jingham@apple.com> Added the equivalent of gdb's "unwind-on-signal" to the expression command, and a parameter to control it in ClangUserExpression, and on down to ClangFunction.

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@118290 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
f7731456d3d6c1fddbd1a9b3504f20b21425b857 05-Nov-2010 Sean Callanan <scallanan@apple.com> Fixed error handling when the utility functions
that check pointer validity fail to parse. Now
lldb does not crash in that case. Also added
support for checking Objective-C class validity
in the Version 1 runtime as well as Version 2
runtimes with varying levels of available debug
support.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@118271 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
0baa394cd55c6dfb7a6259d215d0dea2b708067b 04-Nov-2010 Greg Clayton <gclayton@apple.com> Added support for loading and unloading shared libraries. This was done by
adding support into lldb_private::Process:

virtual uint32_t
lldb_private::Process::LoadImage (const FileSpec &image_spec,
Error &error);

virtual Error
lldb_private::Process::UnloadImage (uint32_t image_token);

There is a default implementation that should work for both linux and MacOSX.
This ability has also been exported through the SBProcess API:

uint32_t
lldb::SBProcess::LoadImage (lldb::SBFileSpec &image_spec,
lldb::SBError &error);

lldb::SBError
lldb::SBProcess::UnloadImage (uint32_t image_token);

Modified the DynamicLoader plug-in interface to require it to be able to
tell us if it is currently possible to load/unload a shared library:

virtual lldb_private::Error
DynamicLoader::CanLoadImage () = 0;

This way the dynamic loader plug-ins are allows to veto whether we can
currently load a shared library since the dynamic loader might know if it is
currenlty loading/unloading shared libraries. It might also know about the
current host system and know where to check to make sure runtime or malloc
locks are currently being held.

Modified the expression parser to have ClangUserExpression::Evaluate() be
the one that causes the dynamic checkers to be loaded instead of other code
that shouldn't have to worry about it.






git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@118227 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
b4c0f02b4ea9a160cf4af3dd0326579594d4b488 29-Oct-2010 Johnny Chen <johnny.chen@apple.com> ClangUserExpression ctor should not crash if given a null expr_prefix char*.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@117700 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
77e9394f0af653ac0842066a9c7766a28d6c6b94 29-Oct-2010 Sean Callanan <scallanan@apple.com> Added a user-settable variable, 'target.expr-prefix',
which holds the name of a file whose contents are
prefixed to each expression. For example, if the file
~/lldb.prefix.header contains:

typedef unsigned short my_type;

then you can do this:

(lldb) settings set target.expr-prefix '~/lldb.prefix.header'
(lldb) expr sizeof(my_type)
(unsigned long) $0 = 2

When the variable is changed, the corresponding file
is loaded and its contents are fetched into a string
that is stored along with the target. This string
is then passed to each expression and inserted into
it during parsing, like this:

typedef unsigned short my_type;

void
$__lldb_expr(void *$__lldb_arg)
{
sizeof(my_type);
}


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@117627 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
f3d0b0c8081691128626eb496fdfcbf8ae54c1de 27-Oct-2010 Greg Clayton <gclayton@apple.com> Updated the lldb_private::Flags class to have better method names and made
all of the calls inlined in the header file for better performance.

Fixed the summary for C string types (array of chars (with any combo if
modifiers), and pointers to chars) work in all cases.

Fixed an issue where a forward declaration to a clang type could cause itself
to resolve itself more than once if, during the resolving of the type itself
it caused something to try and resolve itself again. We now remove the clang
type from the forward declaration map in the DWARF parser when we start to
resolve it and avoid this additional call. This should stop any duplicate
members from appearing and throwing all the alignment of structs, unions and
classes.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@117437 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
3089237161d7593a176e1f72dec1b5e4596aab96 24-Oct-2010 Sean Callanan <scallanan@apple.com> Added a hack so that "unichar" is resolved to
"unsigned short." As discussed in the comments,
this is pending a better solution to the problem
of types not in the debug information but readily
available through headers.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@117247 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
550f276a34e4db1aa513e18f3438454ce7429a3e 23-Oct-2010 Sean Callanan <scallanan@apple.com> Added a temporary hack to allow casting of Objective-C
method results to int. This will only last until we
get accurate type information for Objective-C methods
or some way of making their types inferred by the
parser.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@117178 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
ab06af92020fd4a21eaa5daac3853596b9c45398 20-Oct-2010 Sean Callanan <scallanan@apple.com> Fixed a silly bug that was causing the "this" pointer
to be passed improperly to expressions in certain
cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@116884 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
44820ec9b49bc08c0f4529091019b5bc95ec237a 19-Oct-2010 Sean Callanan <scallanan@apple.com> Fixed the message that reports that an expression
did not return a result. The result is nonexistent
(or void), not NULL.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@116855 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
8de27c761a22187ef63fb60000894be163e7285f 16-Oct-2010 Greg Clayton <gclayton@apple.com> Made many ConstString functions inlined in the header file.

Changed all of our synthesized "___clang" functions, types and variables
that get used in expressions over to have a prefix of "$_lldb". Now when we
do name lookups we can easily switch off of the first '$' character to know
if we should look through only our internal (when first char is '$') stuff,
or when we should look through program variables, functions and types.

Converted all of the clang expression code over to using "const ConstString&"
values for names instead of "const char *" since there were many places that
were converting the "const char *" names into ConstString names and them
throwing them away. We now avoid making a lot of ConstString conversions and
benefit from the quick comparisons in a few extra spots.

Converted a lot of code from LLVM coding conventions into LLDB coding
conventions.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@116634 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
d168690e51f9020b926d3d0d57dc9a2cfb2095a8 15-Oct-2010 Jim Ingham <jingham@apple.com> Added support for breakpoint conditions. I also had to separate the "run the expression" part of ClangFunction::Execute from the "Gather the expression result" so that in the case of the Breakpoint condition I can move the condition evaluation into the normal thread plan processing.

Also added support for remembering the "last set breakpoint" so that "break modify" will act on the last set breakpoint.

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@116542 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
0027cec5aaccc8e53e3dde3c88e1dda21c892d4e 07-Oct-2010 Sean Callanan <scallanan@apple.com> Changed the timeout for expressions from 10
milliseconds to 10 seconds, which was the
original intent.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@115942 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
d171972ecc7788bdb02d3e81420a24841e09a2bf 05-Oct-2010 Greg Clayton <gclayton@apple.com> Added the notion that a value object can be constant by adding:
bool ValueObject::GetIsConstant() const;
void ValueObject::SetIsConstant();

This will stop anything from being re-evaluated within the value object so
that constant result value objects can maintain their frozen values without
anything being updated or changed within the value object.

Made it so the ValueObjectConstResult can be constructed with an
lldb_private::Error object to allow for expression results to have errors.

Since ValueObject objects contain error objects, I changed the expression
evaluation in ClangUserExpression from

static Error
ClangUserExpression::Evaluate (ExecutionContext &exe_ctx,
const char *expr_cstr,
lldb::ValueObjectSP &result_valobj_sp);

to:

static lldb::ValueObjectSP
Evaluate (ExecutionContext &exe_ctx, const char *expr_cstr);

Even though expression parsing is borked right now (pending fixes coming from
Sean Callanan), I filled in the implementation for:

SBValue SBFrame::EvaluateExpression (const char *expr);

Modified all expression code to deal with the above changes.




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@115589 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
377e0b4b4677128244b151396f77b3421bf2b9fa 05-Oct-2010 Greg Clayton <gclayton@apple.com> Moved expression evaluation from CommandObjectExpression into
ClangUserExpression::Evaluate () as a public static function so anyone can
evaluate an expression.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@115581 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
3c9c5eb466869ede185e879d14a47335fb43194d 21-Sep-2010 Sean Callanan <scallanan@apple.com> Removed the hacky "#define this ___clang_this" handler
for C++ classes. Replaced it with a less hacky approach:

- If an expression is defined in the context of a
method of class A, then that expression is wrapped as
___clang_class::___clang_expr(void*) { ... }
instead of ___clang_expr(void*) { ... }.

- ___clang_class is resolved as the type of the target
of the "this" pointer in the method the expression
is defined in.

- When reporting the type of ___clang_class, a method
with the signature ___clang_expr(void*) is added to
that class, so that Clang doesn't complain about a
method being defined without a corresponding
declaration.

- Whenever the expression gets called, "this" gets
looked up, type-checked, and then passed in as the
first argument.

This required the following changes:

- The ABIs were changed to support passing of the "this"
pointer as part of trivial calls.

- ThreadPlanCallFunction and ClangFunction were changed
to support passing of an optional "this" pointer.

- ClangUserExpression was extended to perform the
wrapping described above.

- ClangASTSource was changed to revert the changes
required by the hack.

- ClangExpressionParser, IRForTarget, and
ClangExpressionDeclMap were changed to handle
different manglings of ___clang_expr flexibly. This
meant no longer searching for a function called
___clang_expr, but rather looking for a function whose
name *contains* ___clang_expr.

- ClangExpressionParser and ClangExpressionDeclMap now
remember whether "this" is required, and know how to
look it up as necessary.

A few inheritance bugs remain, and I'm trying to resolve
these. But it is now possible to use "this" as well as
refer implicitly to member variables, when in the proper
context.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@114384 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
cc0746247880e9c87711031ce8a535544f4499d7 14-Sep-2010 Sean Callanan <scallanan@apple.com> Added code to support use of "this" and "self" in
expressions. This involved three main changes:

- In ClangUserExpression::ClangUserExpression(),
we now insert the following lines into the
expression:
#define this ___clang_this
#define self ___clang_self

- In ClangExpressionDeclMap::GetDecls(), we
special-case ___clang_(this|self) and instead
look up "this" or "self"

- In ClangASTSource, we introduce the capability
to generate Decls with a different, overridden,
name from the one that was requested, e.g.
this for ___clang_this.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@113866 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
e8a59a8ec92e71203e434f28b5bac6606aacaf3c 13-Sep-2010 Sean Callanan <scallanan@apple.com> Bugfixes to the expression parser. Fixes include:

- If you put a semicolon at the end of an expression,
this no longer causes the expression parser to
error out. This was a two-part fix: first,
ClangExpressionDeclMap::Materialize now handles
an empty struct (such as when there is no return
value); second, ASTResultSynthesizer walks backward
from the end of the ASTs until it reaches something
that's not a NullStmt.

- ClangExpressionVariable now properly byte-swaps when
printing itself.

- ClangUtilityFunction now cleans up after itself when
it's done compiling itself.

- Utility functions can now use external functions just
like user expressions.

- If you end your expression with a statement that does
not return a value, the expression now runs correctly
anyway.

Also, added the beginnings of an Objective-C object
validator function, which is neither installed nor used
as yet.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@113789 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
830a903fd7cd4595cf52e1630b6491930ada0400 28-Aug-2010 Sean Callanan <scallanan@apple.com> Added a ClangUtilityFunction class that allows the
debugger to insert self-contained functions for use by
expressions (mainly for error-checking).

In order to support detecting whether a crash occurred
in one of these helpers -- currently our preferred way
of reporting that an error-check failed -- added a bit
of support for getting the extent of a JITted function
in addition to just its base.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@112324 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp
65dafa8344c8c018e346dd331a7782081a896239 27-Aug-2010 Sean Callanan <scallanan@apple.com> This is a major refactoring of the expression parser.
The goal is to separate the parser's data from the data
belonging to the parser's clients. This allows clients
to use the parser to obtain (for example) a JIT compiled
function or some DWARF code, and then discard the parser
state.

Previously, parser state was held in ClangExpression and
used liberally by ClangFunction, which inherited from
ClangExpression. The main effects of this refactoring
are:

- reducing ClangExpression to an abstract class that
declares methods that any client must expose to the
expression parser,

- moving the code specific to implementing the "expr"
command from ClangExpression and
CommandObjectExpression into ClangUserExpression,
a new class,

- moving the common parser interaction code from
ClangExpression into ClangExpressionParser, a new
class, and

- making ClangFunction rely only on
ClangExpressionParser and not depend on the
internal implementation of ClangExpression.

Side effects include:

- the compiler interaction code has been factored
out of ClangFunction and is now in an AST pass
(ASTStructExtractor),

- the header file for ClangFunction is now fully
documented,

- several bugs that only popped up when Clang was
deallocated (which never happened, since the
lifetime of the compiler was essentially infinite)
are now fixed, and

- the developer-only "call" command has been
disabled.

I have tested the expr command and the Objective-C
step-into code, which use ClangUserExpression and
ClangFunction, respectively, and verified that they
work. Please let me know if you encounter bugs or
poor documentation.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@112249 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Expression/ClangUserExpression.cpp