Commit Graph

373 Commits

Author SHA1 Message Date
Sean Callanan 2ab712f212 Added the skeleton of an IR transformer that will
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
2010-07-03 01:35:46 +00:00
Sean Callanan 2df8a1f39c Added the skeleton of a transformation pass to
convert IR to DWARF.  So far, this pass only
performs a depth-first traversal of the IR,
logging each basic block as it finds it.

llvm-svn: 107515
2010-07-02 21:09:36 +00:00
Sean Callanan 116be5347e Added a SemaConsumer that transforms the ASTs for
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
2010-07-01 20:08:22 +00:00
Greg Clayton 0c5cd90d63 Added function name types to allow us to set breakpoints by name more
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
2010-06-28 21:30:43 +00:00
Greg Clayton 6611103cfe Very large changes that were needed in order to allow multiple connections
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
2010-06-23 01:19:29 +00:00
Jim Ingham b01e742af7 Two changes in this checkin. Added a ThreadPlanKind so that I can do some reasoning based on the kind of thread plan
without having to use RTTI.
Removed the ThreadPlanContinue and replaced with a ShouldAutoContinue query that serves the same purpose.  Having to push
another plan to assert that if there's no other indication the target should continue when this plan is popped was flakey
and error prone.  This method is more stable, and fixed problems we were having with thread specific breakpoints.

llvm-svn: 106378
2010-06-19 04:45:32 +00:00
Jim Ingham 4b9bea87e6 Move the "status" command to "process status" since that's where it belongs. Also make it print "running" if invoked
when the current process is running.

llvm-svn: 106265
2010-06-18 01:23:09 +00:00
Caroline Tice d6ac38485b Parameterize the shell scripts for creating and copying the python and
other script files around, so they can be run from outside Xcode.  Also,
check the current OS, and only try to use the framework structure stuff on
Darwin systems.

llvm-svn: 106132
2010-06-16 19:26:52 +00:00
Jim Ingham 1b54c88cc4 Add a "thread specification" class that specifies thread specific breakpoints by name, index, queue or TID.
Push this through all the breakpoint management code.  Allow this to be set when the breakpoint is created.
Fix the Process classes so that a breakpoint hit that is not for a particular thread is not reported as a 
breakpoint hit event for that thread.
Added a "breakpoint configure" command to allow you to reset any of the thread 
specific options (or the ignore count.)

llvm-svn: 106078
2010-06-16 02:00:15 +00:00
Jim Ingham 40af72e106 Move Args.{cpp,h} and Options.{cpp,h} to Interpreter where they really belong.
llvm-svn: 106034
2010-06-15 19:49:27 +00:00
Greg Clayton 7a47bd9f02 Move posix specific files into posix subdirectory so they can
be shared with linux.

Updated Xcode project.

llvm-svn: 105928
2010-06-14 04:30:13 +00:00
Greg Clayton 474966a41e I have eliminated RTTI from LLDB!
Also added a shell script build phase that fixes the headers in 
LLDB.framework.

llvm-svn: 105899
2010-06-12 18:59:55 +00:00
Greg Clayton ef59f829e4 Switched over to using the new lldb::SharingPtr from Howard Hinnant.
We need to put this in LLDB since we need to vend this in our API
because our public API uses shared pointers to our private objects.

Removed a deprecated file: include/lldb/Host/Types.h

Added the new SharingPtr.cpp/.h files into source/Utility.

Added a shell script build phase that fixes up all headers in the
LLDB.framework.

llvm-svn: 105895
2010-06-12 17:45:57 +00:00
Greg Clayton c9af18a502 Moved files around for linux build. Fixed up Xcode project to
refer to the new locations.

llvm-svn: 105885
2010-06-12 15:43:35 +00:00
Greg Clayton e20855403b Fixed the build after recent header changes.
Fixed an extra include path in the Xcode project.

llvm-svn: 105867
2010-06-12 01:12:23 +00:00
Jason Molenda 8edec78f84 Update USER_HEADER_SEARCH_PATHS settings to all be the same.
Change the Release -rpath LDFLAG to look for LLDB.framework in the
same directory as the lldb binary itself.  For the BuildAndIntegration
target, continue to use the ../../ etc path to match how we install
the binaries inside Apple.

Patch from Dimiter "malkia" Stanev.  I still need to look at the
suggested changing of ONLY_ACTIVE_ARCH settings.

llvm-svn: 105864
2010-06-12 00:38:35 +00:00
Greg Clayton 41f923275e Made lldb_private::ArchSpec more generic so that it can take a mach-o cpu
type and sub-type, or an ELF e_machine value. Also added a generic CPU type
to the arch spec class so we can have a single arch definition that the LLDB
core code can use. Previously a lot of places in the code were using the
mach-o definitions from a macosx header file. 

Switches over to using "llvm/Support/MachO.h" for the llvm::MachO::XXX for the
CPU types and sub types for mach-o ArchSpecs. Added "llvm/Support/ELF.h" so 
we can use the "llvm::ELF::XXX" defines for the ELF ArchSpecs.

Got rid of all CPU_TYPE_ and CPU_SUBTYPE_ defines that were previously being
used in LLDB.

llvm-svn: 105806
2010-06-11 03:25:34 +00:00
Jason Molenda f7a4715fdb SymbolVendor.mm doesn't seem to have any Objective-C in it;
move to SymbolVendor.cpp.  Xcode project file updated.

llvm-svn: 105755
2010-06-09 21:48:33 +00:00
Christopher Friesen f2d015d110 OK, we should only point to PROJECT_DIR/include for the header search paths since the includes specify lldb/API/etc. This is temporary until the final install location is decided upon for the headers.
llvm-svn: 105707
2010-06-09 07:57:59 +00:00
Jason Molenda 8fd1b58faf update the USER_HEADER_SEARCH_PATHS for one of the variants.
llvm-svn: 105703
2010-06-09 07:44:25 +00:00
Christopher Friesen 5fa3614849 Narrow down the header search path to the public API
llvm-svn: 105694
2010-06-09 07:13:13 +00:00
Christopher Friesen 930e33794a fixing headers search paths so lldb-tool will build with these new changes
llvm-svn: 105692
2010-06-09 07:06:05 +00:00
Chris Lattner 30fdc8d841 Initial checkin of lldb code from internal Apple repo.
llvm-svn: 105619
2010-06-08 16:52:24 +00:00