Commit Graph

398 Commits

Author SHA1 Message Date
Greg Clayton 0b76a2c21f Modified the host process monitor callback function Host::StartMonitoringChildProcess
to spawn a thread for each process that is being monitored. Previously
LLDB would spawn a single thread that would wait for any child process which
isn't ok to do as a shared library (LLDB.framework on Mac OSX, or lldb.so on
linux). The old single thread used to call wait4() with a pid of -1 which 
could cause it to reap child processes that it shouldn't have.

Re-wrote the way Function blocks are handles. Previously I attempted to keep
all blocks in a single memory allocation (in a std::vector). This made the
code somewhat efficient, but hard to work with. I got rid of the old BlockList
class, and went to a straight parent with children relationship. This new 
approach will allow for partial parsing of the blocks within a function.

llvm-svn: 111706
2010-08-21 02:22:51 +00:00
Johnny Chen ff3d01d0b7 Print the verbose output of runCmd()/expect() to stderr instead of stdout.
And converted the rest of the test cases to runCmd()/expect().

llvm-svn: 111677
2010-08-20 21:03:09 +00:00
Johnny Chen 74f26b8188 Changed TestBase.expect() to allow default 'msg' arg. Converted TestHelp.py.
llvm-svn: 111671
2010-08-20 19:17:39 +00:00
Johnny Chen b145bbaf4b Added more verbose output when string match fails. Converted TestGlobalVariables.py.
llvm-svn: 111666
2010-08-20 18:25:15 +00:00
Johnny Chen 5bbb88ff97 Added verbose option to runCmd()/expect() in lldbtest.py. Converted TestFunctionTypes.py.
llvm-svn: 111658
2010-08-20 17:57:32 +00:00
Johnny Chen 617cca957e Converted some more test cases to use runCmd()/expect().
llvm-svn: 111652
2010-08-20 17:04:20 +00:00
Jim Ingham 5466e751f0 Added "source list -n" so you can list by symbol name. Moved "--count" from "-n" to "-c". Added a -s option so you can restrict the source listing to a particular shared library.
llvm-svn: 111608
2010-08-20 01:17:07 +00:00
Jim Ingham 64b931c1e1 Add an accessor to get the Declaration for a type.
llvm-svn: 111607
2010-08-20 01:15:38 +00:00
Jim Ingham 9976033698 Add methods to Function to get the first and last source lines of the function, and to get whether this Function is an inlined instance or not.
llvm-svn: 111606
2010-08-20 01:15:01 +00:00
Jim Ingham 182702076b Remove redundant call to ParseCompileUnitLineTable. The call to sc.comp_unit->GetLineTable() will parse the line table if it hasn't been read in.
llvm-svn: 111605
2010-08-20 01:13:58 +00:00
Sean Callanan d0ef0eff61 First step of refactoring variable handling in the
expression parser.  There shouldn't be four separate
classes encapsulating a variable.

ClangExpressionVariable is now meant to be the
container for all variable information.  It has
several optional components that hold data for
different subsystems.

ClangPersistentVariable has been removed; we now
use ClangExpressionVariable instead.

llvm-svn: 111600
2010-08-20 01:02:30 +00:00
Johnny Chen f85b0b866c Converted to use runCmd() and expect() for more abstraction.
llvm-svn: 111593
2010-08-20 00:27:37 +00:00
Johnny Chen a6480c124e Use cmd.startswith("run") instead of string equivalence test.
llvm-svn: 111587
2010-08-19 23:53:55 +00:00
Johnny Chen 27f212d1e6 Abstracted the running of command through the command interpreter and checking
its return status into lldbtest.TestBase.runCmd(); and runCmd() in combination
with checking the output against matching substrings (including startswith) into
lldbtest.TestBase.expect().

TestUnsignedTypes.py is refactored to use the abstracted APIs.  Other test cases
to be modified later.

llvm-svn: 111572
2010-08-19 23:26:59 +00:00
Greg Clayton be77e3bd6e Fixed a long delay in shutdown times by invalidating m_private_state_thread right before the private state thread (which calls "void *Process::RunPrivateStateThread ()") exits.
llvm-svn: 111567
2010-08-19 21:50:06 +00:00
Johnny Chen 0c19186352 Added more informational assert message strings.
llvm-svn: 111536
2010-08-19 18:17:48 +00:00
Johnny Chen 5a2133909d Simplify the assert matched-string criterion.
llvm-svn: 111429
2010-08-18 21:28:35 +00:00
Jim Ingham e1be14df1e Some Block:: methods wandered to the end of the file after the BlockList:: methods. I moved them back.
llvm-svn: 111396
2010-08-18 19:29:16 +00:00
Sean Callanan eaacbc9da6 Patch by Bill Lynch fixing handling of the pid
in the IR transformation passes.

llvm-svn: 111388
2010-08-18 18:50:51 +00:00
Greg Clayton d1f57fc6a3 Avoid an assertion crash by avoiding a circular dependency in the objective
C builtin type conversion.

llvm-svn: 111381
2010-08-18 18:29:55 +00:00
Greg Clayton ad3843c93b Changed "Error Value::GetValueAsData (...)" to set the data extractor byte
order and address size correctly when the value comes from a file address.
Values have "file" addresses when they are globals and the debug information
specifies that they live in the object file at a given address (DWARF will
represent this as a location "DW_OP_addr <addr>"). This causes global pointers
to correctly extract their children on 64 bit programs.

llvm-svn: 111380
2010-08-18 18:28:52 +00:00
Jim Ingham ea480e507c Added call stacks with inlined functions higher on the stack, and non-inlined functions at the bottom.
llvm-svn: 111379
2010-08-18 18:28:17 +00:00
Greg Clayton 52d64d9ea9 Added a Thread accessor to the register context.
llvm-svn: 111378
2010-08-18 18:25:47 +00:00
Greg Clayton ddfda9d7a2 Allow the SBDebugger to construct itself with the default constructor so
objects can own one of these objects and assign a valid value at a later point.

llvm-svn: 111377
2010-08-18 18:25:20 +00:00
Sean Callanan 5fb17ea113 Documented RecordingMemoryManager and removed an
undefined, unused function from its API.

llvm-svn: 111335
2010-08-18 00:25:09 +00:00
Sean Callanan 98ab8f0cfc Documented IRToDWARF, and added return value
documentation to IRForTarget.

llvm-svn: 111323
2010-08-17 23:18:59 +00:00
Greg Clayton 3ef3fc6462 Fixed an issue where we would return matches for DWARF in the .o files when
the resulting function from the .o file DWARF didn't make it into the final
executable. I recently changed the way FindFunctions() worked in the DWARF
with debug map case that caused regressions in our test suite for dead 
stripped functions. The previous changes allowed us to leverage the powerful 
searching added to the DWARF parser (search by full name, basename, selector, 
or method name), without having to chop up the symbol names from the symbol
table and do any special parsing of the names to extract the basename, 
selector or method. Previously we would look through the symbol table for 
matches first, then try and find the .o file with DWARF for that symbol and
only search those .o files. Now we let the DWARF for the .o file search using
the new search styles, and filter out any functions that didn't make it.

llvm-svn: 111322
2010-08-17 23:16:15 +00:00
Johnny Chen 83072afbcd Write out the informational message about the total number of test cases to be
run to stderr, instead of stdout.  The same as what the unittest framework uses.

llvm-svn: 111319
2010-08-17 23:00:13 +00:00
Sean Callanan f346a3dd68 Documented IRForTarget
llvm-svn: 111313
2010-08-17 22:36:13 +00:00
Jim Ingham 2ecb7421c1 Don't try to get the architecture up front when doing attach -w.
llvm-svn: 111302
2010-08-17 21:54:19 +00:00
Johnny Chen 8a05de4d29 Add the ability to specify logging options for lldb and gdb-remote through two
additional env variables.

llvm-svn: 111295
2010-08-17 21:36:09 +00:00
Johnny Chen e76896c987 Specify a more meaningful assert message for TestDeadStrip.py.
llvm-svn: 111294
2010-08-17 21:33:31 +00:00
Sean Callanan 2cdbc722fc Documented DWARFExpression.
llvm-svn: 111276
2010-08-17 20:24:29 +00:00
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