expression. It is now possible to do things like this:
(lldb) expr int $i = 5; $i + 1
$0 = (int) 6
(lldb) expr $i + 3
$1 = (int) 8
(lldb) expr $1 + $0
$2 = (int) 14
As a bonus, this allowed us to move printing of
expression results into the ClangPersistentVariable
class. This code needs a bit of refactoring -- in
particular, ClangExpressionDeclMap has eaten one too
many bacteria and needs to undergo mitosis -- but the
infrastructure appears to be holding up nicely.
llvm-svn: 110896
expression parser. It is now possible to type:
(lldb) expr int $i = 5; $i + 1
(int) 6
(lldb) expr $i + 2
(int) 7
The skeleton for automatic result variables is
also implemented. The changes affect:
- the process, which now contains a
ClangPersistentVariables object that holds
persistent variables associated with it
- the expression parser, which now uses
the persistent variables during variable
lookup
- TaggedASTType, where I loaded some commonly
used tags into a header so that they are
interchangeable between different clients of
the class
llvm-svn: 110777
made IR-based expression evaluation the default.
Also added a new class to hold persistent variables.
The class is empty as yet while I write up a design
document for what it will do. Also the place where
it is currently created (by the Expression command)
is certainly wrong.
llvm-svn: 110415
- When we JIT an expression, we print the disassembly
of the generated code
- When we put the structure into the target, we print
the individual entries in the structure byte for
byte.
llvm-svn: 109278
to be executed by the inferior. This required explicit support
from RecordingMemoryManager for finding the address range
belonging to a particular function.
Also fixed a bug in DisassemblerLLVM where the disassembler
assumed there was an AddressRange available even when it was
NULL.
llvm-svn: 109209
and moved it to its own header file for cleanliness.
Added more logging to ClangFunction so that we can
diagnose crashes in the executing expression.
Added code to extract the result of the expression
from the struct that is passed to the JIT-compiled
code.
llvm-svn: 109199
defines that are in "llvm/Support/MachO.h". This should allow ObjectFileMachO
and ObjectContainerUniversalMachO to be able to be cross compiled in Linux.
Also did some cleanup on the ASTType by renaming it to ClangASTType and
renaming the header file. Moved a lot of "AST * + opaque clang type *"
functionality from lldb_private::Type over into ClangASTType.
llvm-svn: 109046
used by the JIT compiled expression, including the
result of the expression.
Also added a new class, ASTType, which encapsulates an
opaque Clang type and its associated AST context.
Refactored ClangExpressionDeclMap to use ASTTypes,
significantly reducing the possibility of mixups of
types from different AST contexts.
llvm-svn: 108965
to correctly unfold constant-folded global variables.
Also added code to JIT the expression. Simple
expressions are now JIT compiled successfully.
llvm-svn: 108380
prepare IR for execution in the target. Wired the
expression command to use this IR transformer when
conversion to DWARF fails, and wired conversion to
DWARF to always fail (well, we don't generate any
DWARF...)
llvm-svn: 107559
an expression, adding code to put the value of the
last expression (if there is one) into a variable
and write the address of that variable to a global
pointer.
llvm-svn: 107419
intelligently. The four name types we currently have are:
eFunctionNameTypeFull = (1 << 1), // The function name.
// For C this is the same as just the name of the function
// For C++ this is the demangled version of the mangled name.
// For ObjC this is the full function signature with the + or
// - and the square brackets and the class and selector
eFunctionNameTypeBase = (1 << 2), // The function name only, no namespaces or arguments and no class
// methods or selectors will be searched.
eFunctionNameTypeMethod = (1 << 3), // Find function by method name (C++) with no namespace or arguments
eFunctionNameTypeSelector = (1 << 4) // Find function by selector name (ObjC) names
this allows much more flexibility when setting breakoints:
(lldb) breakpoint set --name main --basename
(lldb) breakpoint set --name main --fullname
(lldb) breakpoint set --name main --method
(lldb) breakpoint set --name main --selector
The default:
(lldb) breakpoint set --name main
will inspect the name "main" and look for any parens, or if the name starts
with "-[" or "+[" and if any are found then a full name search will happen.
Else a basename search will be the default.
Fixed some command option structures so not all options are required when they
shouldn't be.
Cleaned up the breakpoint output summary.
Made the "image lookup --address <addr>" output much more verbose so it shows
all the important symbol context results. Added a GetDescription method to
many of the SymbolContext objects for the more verbose output.
llvm-svn: 107075
- Rationalized EvaluateExpression to remove a lot
of nesting; also added comments to make it easy
to find what's happening where
- Made ExecuteRawCommandString subcontract out to
EvaluateExpression
- Minor logging improvements
llvm-svn: 106703
to the debugger from GUI windows. Previously there was one global debugger
instance that could be accessed that had its own command interpreter and
current state (current target/process/thread/frame). When a GUI debugger
was attached, if it opened more than one window that each had a console
window, there were issues where the last one to setup the global debugger
object won and got control of the debugger.
To avoid this we now create instances of the lldb_private::Debugger that each
has its own state:
- target list for targets the debugger instance owns
- current process/thread/frame
- its own command interpreter
- its own input, output and error file handles to avoid conflicts
- its own input reader stack
So now clients should call:
SBDebugger::Initialize(); // (static function)
SBDebugger debugger (SBDebugger::Create());
// Use which ever file handles you wish
debugger.SetErrorFileHandle (stderr, false);
debugger.SetOutputFileHandle (stdout, false);
debugger.SetInputFileHandle (stdin, true);
// main loop
SBDebugger::Terminate(); // (static function)
SBDebugger::Initialize() and SBDebugger::Terminate() are ref counted to
ensure nothing gets destroyed too early when multiple clients might be
attached.
Cleaned up the command interpreter and the CommandObject and all subclasses
to take more appropriate arguments.
llvm-svn: 106615
Fixed the Disassemble arguments so you can't specify start address or name in multiple ways.
Fixed the command line input so you can specify the filename without "-f" even if you use other options.
llvm-svn: 106020