Commit Graph

568 Commits

Author SHA1 Message Date
Johnny Chen 85ffddc1bf The unix "source" command maps to "command source" in lldb. :-)
llvm-svn: 109673
2010-07-28 21:16:11 +00:00
Greg Clayton b132097b45 I enabled some extra warnings for hidden local variables and for hidden
virtual functions and caught some things and did some general code cleanup.

llvm-svn: 108299
2010-07-14 00:18:15 +00:00
Greg Clayton c8e11e17aa Patch from Jean-Daniel Dupas:
Makefile patch to explicitly use PROJ_SRC_DIR when required. It fixes 
        build when obj dir is not source dir. 

I also fixed a build warning in ClangResultSynthesizer.cpp.

llvm-svn: 108210
2010-07-12 23:14:00 +00:00
Eli Friedman 8878f87fb6 Misc warning fixes.
llvm-svn: 108029
2010-07-09 22:53:18 +00:00
Eli Friedman 098039e4f0 Make current Makefiles work on Linux (at least, they work for me). Please
tell me if this breaks anything.

llvm-svn: 108025
2010-07-09 22:11:43 +00:00
Greg Clayton c982c768d2 Merged Eli Friedman's linux build changes where he added Makefile files that
enabled LLVM make style building and made this compile LLDB on Mac OS X. We
can now iterate on this to make the build work on both linux and macosx.

llvm-svn: 108009
2010-07-09 20:39:50 +00:00
Greg Clayton 388e3b0fa9 Added "-Wparentheses" so we catch possible errors like:
if (a = 0)

instead of: 

if (a == 0)

Thanks to Jean-Daniel Dupas.

llvm-svn: 107672
2010-07-06 16:16:14 +00:00
Greg Clayton 0b42ac32c8 More leaks detection:
- fixed 3 posix spawn attributes leaks 
- fixed us always leaking CXXBaseSpecifier objects when we create class 
  base classes. Clang apparently copies the base classes we pass in.

Fixed some code formatting in ClangASTContext.cpp.

llvm-svn: 107459
2010-07-02 01:29:13 +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 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
Jim Ingham 8651121c11 Change the Options parser over to use a mask rather than an ordinal for option sets.
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
2010-06-15 18:47:14 +00:00
Eli Friedman adb3502477 Make getopt() use portable to Linux.
llvm-svn: 105922
2010-06-13 19:18:49 +00:00
Jason Molenda a34a0c61ae Move source/Utility/PseudoTerminal.h into include/lldb/Utility.
The top of the header file seems to indicate that this was
intended to be over at include/lldb/Core but we should be in line
with the .cpp file's location so it's include/lldb/Utility for now.

llvm-svn: 105753
2010-06-09 21:28:42 +00:00
Eli Friedman 07b1627f46 Add a few more missing includes.
llvm-svn: 105743
2010-06-09 19:11:30 +00:00
Eli Friedman a382d474b6 Misc minor warning/error fixes.
llvm-svn: 105720
2010-06-09 09:50:17 +00:00
Eli Friedman 778b08546e And part two of two of fixing includes; somehow I thought the problem was more
widespread than it was.

llvm-svn: 105689
2010-06-09 06:50:29 +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