Commit Graph

365 Commits

Author SHA1 Message Date
Jim Ingham c55e951523 Check for errors in Resume before waiting for the resume to complete.
llvm-svn: 111216
2010-08-17 00:35:35 +00:00
Greg Clayton 57a6b999af Fixed FindFunctions so it works with all the new name types for the DWARF in object files case.
llvm-svn: 111215
2010-08-17 00:35:34 +00:00
Sean Callanan 6dce6de80c Documented ClangResultSynthesizer and added very minor
API fixes.

llvm-svn: 111202
2010-08-16 23:01:35 +00:00
Johnny Chen 46c2614b99 Added logging for process.gdb-remote by defining an environment variable named
GDB_REMOTE_LOG which specifies the log file pathname.

llvm-svn: 111198
2010-08-16 22:37:45 +00:00
Sean Callanan b3cecb4c96 Documented ClangPersistentVariable(s). No API
cleanup here, since this is a new and fairly
clean class already.

llvm-svn: 111194
2010-08-16 22:14:59 +00:00
Johnny Chen 6ca006c7c1 Factored the "continue" command execution of the inferior process as part of the
cleanup before finish into the test fixture in lldbtest.TestBase.tearDown().

Derivatives of TestBase is responsible for setting self.runStarted to True if an
inferior process has been started.

llvm-svn: 111188
2010-08-16 21:28:10 +00:00
Johnny Chen dd63f5dbe1 Added a workaround for test suite hang while terminating by checking env variable
LLDB_TESTSUITE_FORCE_FINISH and, if defined, kill the test suite.

llvm-svn: 111056
2010-08-13 22:58:44 +00:00
Sean Callanan df4581f1c5 Documented ClangExpressionVariable(List), and
cleaned up its API slightly.

llvm-svn: 111053
2010-08-13 22:52:29 +00:00
Sean Callanan 03e9771458 Added documentation to ClangExpressionDeclMap.
Also cleaned up its API a tiny bit (but not the
extensive amount that is actually needed.  That's
still coming.)

llvm-svn: 111049
2010-08-13 22:29:54 +00:00
Johnny Chen f288803a95 Added a test case to exercise persistent variables in combination with the "expr" command.
llvm-svn: 111035
2010-08-13 20:12:05 +00:00
Johnny Chen fcd43b719b Modified CommandObjectExpression::EvaluateExpression() so that it takes an
additional (ComandReturnObject *) result parameter (default to NULL) and does
the right thing in setting the result status.

Also removed used variable ast_context.

llvm-svn: 110992
2010-08-13 00:42:30 +00:00
Sean Callanan b269b6eabb Documented ClangExpression and made parts of it
more sane (i.e., removed dead arguments, made
sensible defaults, etc.)

llvm-svn: 110990
2010-08-13 00:28:39 +00:00
Sean Callanan 04949cc65e Added documentation to ClangASTSource and
NameSearchContext.

llvm-svn: 110980
2010-08-12 23:45:38 +00:00
Sean Callanan 384cae6e06 Fixed copyright notice on ClangASTSource.h.
llvm-svn: 110977
2010-08-12 23:08:37 +00:00
Sean Callanan 35053747cc Removed the ClangStmtVisitor, which is old code
that translates Clang ASTs straight to DWARF.  We
are now using IR instead.

llvm-svn: 110957
2010-08-12 21:29:03 +00:00
Johnny Chen 03b5a8a9ab Applied Pawel Wodnicki's fix for "missing" lldb-forward-rtti.h header file.
llvm-svn: 110943
2010-08-12 19:42:59 +00:00
Jim Ingham 87c1191e0e Now that we are using the Unwinder (or Jason's new unwinder when that comes about) all the plugin-specific details of getting stack frames
should be hidden behind that, and the "GetStackFrameAtIndex" and "GetStackFrameCount" algorithms become generic.  So I moved them to Thread.cpp.

llvm-svn: 110899
2010-08-12 02:14:28 +00:00
Sean Callanan d1e5b439c9 Added automatically generated result variables for each
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
2010-08-12 01:56:52 +00:00
Jim Ingham 4512065130 Test files (but no test cases yet) for handling Universal files.
llvm-svn: 110893
2010-08-12 01:21:40 +00:00
Jim Ingham b0be442408 Few little fixes to reading in inlined functions. Also added a test case with some inlining.
llvm-svn: 110892
2010-08-12 01:20:14 +00:00
Sean Callanan 2235f32bbd Added support for persistent variables to the
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
2010-08-11 03:57:18 +00:00
Johnny Chen 705c3b6aaa There is no need to restore (sys.stdin, sys.stdout) of the python script
interpreter right before calling Py_Finalize().  This also fixed the crash as
reported in rdar://problem/8252903.

llvm-svn: 110731
2010-08-10 21:26:55 +00:00
Johnny Chen edcbecfb1f Call lldb.SBDebugger.Terminate() at the end of test suite run through the atexit
handler similar to what's happening for the individual test case run.

llvm-svn: 110719
2010-08-10 20:23:55 +00:00
Benjamin Kramer cb61b8c42b Fix clang warnings.
llvm-svn: 110676
2010-08-10 13:22:03 +00:00
Jim Ingham a73f8ea4e5 Looks like this is how you identify executables in ELF.
llvm-svn: 110641
2010-08-10 01:36:46 +00:00
Jim Ingham 3ebcf7f09b Make breakpoint commands work again. Added a PerformAction to the stop info - actions are run when the
stop event is pulled from the event queue.  Then made the StopInfoBreakpoint's PerformAction do the 
breakpoint command.
Also fixed the StopInfoBreakpoint's GetDescription so it gets the breakpoint location info, not the breakpoint
site info.

llvm-svn: 110637
2010-08-10 00:59:59 +00:00
Jason Molenda 2f1a7d9e76 Remove unused powerpc unwind support.
llvm-svn: 110626
2010-08-09 23:56:27 +00:00
Johnny Chen 1794184ada Modified the remaining test cases to display more meaningful assert messages.
Added a generic message generator to the lldbtest.py base module.

llvm-svn: 110625
2010-08-09 23:44:24 +00:00
Jim Ingham 5aee162f97 Change Target & Process so they can really be initialized with an invalid architecture.
Arrange that this then gets properly set on attach, or when a "file" is set.
Add a completer for "process attach -n".

Caveats: there isn't currently a way to handle multiple processes with the same name.  That
will have to wait on a way to pass annotations along with the completion strings.

llvm-svn: 110624
2010-08-09 23:31:02 +00:00
Johnny Chen 0077809bc2 Added some commonly used assert messages to the lldbtest.py module which houses
the TestBase.  Modified TestArrayTypes.py to use the assert messages.  Other
files to follow.

llvm-svn: 110611
2010-08-09 22:01:17 +00:00
Johnny Chen f4804c696d Install the SIGINT (control-c) handler before invoking the text test runner.
llvm-svn: 110595
2010-08-09 20:40:52 +00:00
Sean Callanan 0708e2c253 Updated help text to refer to "commands alias"
instead of "alias."  Also fixed a bunch of
indentation in the help for "commands alias."

llvm-svn: 110585
2010-08-09 18:50:15 +00:00
Johnny Chen 9289a65f75 Commented out "import traceback".
llvm-svn: 110497
2010-08-07 01:13:18 +00:00
Johnny Chen f5957e0603 Putting out messages about the number of test cases to be run before running the
whole test suite.

llvm-svn: 110487
2010-08-07 00:16:07 +00:00
Johnny Chen ead526a056 Added more comments about unittest2.
llvm-svn: 110470
2010-08-06 21:07:38 +00:00
Sean Callanan fc16cc0a0c Removed the -i option from the expr command, and
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
2010-08-06 00:35:32 +00:00
Sean Callanan c503e784c7 Fixed namespace issues that were breaking the
SWIG wrappers on a non-internal SnowLeopard
system.

llvm-svn: 110413
2010-08-06 00:33:35 +00:00
Sean Callanan c7fbf73651 Fixed namespace visibility problems that were
breaking the build for me on a non-internal
SnowLeopard system.

llvm-svn: 110412
2010-08-06 00:32:49 +00:00
Johnny Chen ae9fea401d Added description about unittest2.
llvm-svn: 110400
2010-08-05 23:47:51 +00:00
Johnny Chen 73258830f3 o Added unittest2 which has added the new features in unittest for Python 2.7
backported to Python 2.3+.  Some of the features desired include better
  verbose reporting in unittest2.TextTestRunner and decorator support for
  skipping tests and expected failures.

  http://pypi.python.org/pypi/unittest2

o Modified the existing .py tests to use unittest2 and decorated
  TestSTL.test_step_into_stl(), which is known to always fail currently, with
  @unittest2.expectedFailure.

llvm-svn: 110397
2010-08-05 23:42:46 +00:00
Johnny Chen a21249597e When running a single test case, lldb.SBDebugger.Terminate() is not being called
because unittest.main() calls sys.exit() before returning.  Fixed by registering
an exit handler for this situation.

llvm-svn: 110379
2010-08-05 21:23:45 +00:00
Greg Clayton c86103d4d6 More missing files from my previous checkin.
llvm-svn: 110299
2010-08-05 01:57:25 +00:00
Greg Clayton 7620000aa6 Added functionality to our API for SBType. This will allow users to eventually find and peruse static type information from modules.
llvm-svn: 110298
2010-08-05 01:56:48 +00:00
Greg Clayton ba9fbbb880 Added functionality to our API for SBType. This will allow users to eventually find and peruse static type information from modules.
llvm-svn: 110297
2010-08-05 01:56:31 +00:00
Greg Clayton f4b47e1579 Abtracted the old "lldb_private::Thread::StopInfo" into an abtract class.
This will allow debugger plug-ins to make any instance of "lldb_private::StopInfo"
that can completely describe any stop reason. It also provides a framework for
doing intelligent things with the stop info at important times in the lifetime
of the inferior. 

Examples include the signal stop info in StopInfoUnixSignal. It will check with
the process to see that the current action is for the signal. These actions
include wether to stop for the signal, wether the notify that the signal was
hit, and wether to pass the signal along to the inferior process. The 
StopInfoUnixSignal class overrides the "ShouldStop()" method of StopInfo and
this allows the stop info to determine if it should stop at the signal or 
continue the process. 


StopInfo subclasses must override the following functions:

    virtual lldb::StopReason
    GetStopReason () const = 0;

    virtual const char *
    GetDescription () = 0;


StopInfo subclasses can override the following functions:


    // If the subclass returns "false", the inferior will resume. The default
    // version of this function returns "true" which means the default stop
    // info will stop the process. The breakpoint subclass will check if
    // the breakpoint wants us to stop by calling any installed callback on
    // the breakpoint, and also checking if the breakpoint is for the current
    // thread. Signals will check if they should stop based off of the 
    // UnixSignal settings in the process.
    virtual bool
    ShouldStop (Event *event_ptr);

    // Sublasses can state if they want to notify the debugger when "ShouldStop"
    // returns false. This would be handy for breakpoints where you want to
    // log information and continue and is also used by the signal stop info
    // to notify that a signal was received (after it checks with the process
    // signal settings).
    virtual bool
    ShouldNotify (Event *event_ptr)
    {
        return false;
    }

    // Allow subclasses to do something intelligent right before we resume.
    // The signal class will figure out if the signal should be propagated
    // to the inferior process and pass that along to the debugger plug-ins.
    virtual void
    WillResume (lldb::StateType resume_state)
    {
        // By default, don't do anything
    }


The support the Mach exceptions was moved into the lldb/source/Plugins/Process/Utility
folder and now doesn't polute the lldb_private::Thread class with platform
specific code.

llvm-svn: 110184
2010-08-04 01:40:35 +00:00
Sean Callanan 5666b674f3 Added support for accessing members of C++ objects,
including superclass members.  This involved ensuring
that access control was ignored, and ensuring that
the operands of BitCasts were properly scanned for
variables that needed importing.

Also laid the groundwork for declaring objects of
custom types; however, this functionality is disabled
for now because of a potential loop in ASTImporter.

llvm-svn: 110174
2010-08-04 01:02:13 +00:00
Johnny Chen fee57bb464 Added README file for the test suite.
llvm-svn: 110160
2010-08-03 22:12:11 +00:00
Greg Clayton 3504eee8a8 Added FindTypes to Module and ModuleList.
llvm-svn: 110093
2010-08-03 01:26:16 +00:00
Greg Clayton b0b9fe610a Added support for objective C built-in types: id, Class, and SEL. This
involved watching for the objective C built-in types in DWARF and making sure
when we convert the DWARF types into clang types that we use the appropriate
ASTContext types.

Added a way to find and dump types in lldb (something equivalent to gdb's 
"ptype" command):

    image lookup --type <TYPENAME>

This only works for looking up types by name and won't work with variables.
It also currently dumps out verbose internal information. I will modify it
to dump more appropriate user level info in my next submission.

Hookup up the "FindTypes()" functions in the SymbolFile and SymbolVendor so
we can lookup types by name in one or more images.

Fixed "image lookup --address <ADDRESS>" to be able to correctly show all
symbol context information, but it will only show this extra information when
the new "--verbose" flag is used.

Updated to latest LLVM to get a few needed fixes.

llvm-svn: 110089
2010-08-03 00:35:52 +00:00
Sean Callanan 4cf04d209b Set a CodeGenOption in Clang to inhibit insertion
of profiling code into expressions.

Modified IRForTarget to emit array and record
member accesses correctly.  (Reading and writing
both work.)

llvm-svn: 110088
2010-08-03 00:23:29 +00:00