Commit Graph

620 Commits

Author SHA1 Message Date
Greg Clayton 158483cf62 Thread no longer needs to be a friend in StackFrameList now that StackFrameList
contains the entire stack backtrace.

llvm-svn: 112009
2010-08-25 00:58:59 +00:00
Greg Clayton 12daf946c8 Cleaned up the inline backtrace code even more by moving all stack backtracing
functionality into StackFrameList. This will allow us to copy the previous
stack backtrace from the previous stop into another variable so we can re-use
as much as possible from the previous stack backtrace.

llvm-svn: 112007
2010-08-25 00:35:26 +00:00
Johnny Chen c7c9fcfbd6 More descriptive trace messages for the matchings of start and sub strings.
llvm-svn: 112000
2010-08-24 23:48:10 +00:00
Johnny Chen 536b7d2d26 Removed the @unitest2.expectedFailure decorator. The i386 process launch works
correctly after all.  It was my own configuration error (I was building x86_64
only).

llvm-svn: 111992
2010-08-24 23:14:47 +00:00
Greg Clayton 288e5afe6b Fixed another issue with the inline stack frames where if the first frame
has inlined functions that all started at the same address, then the inlined
backtrace would not produce correct stack frames.

Also cleaned up and inlined a lot of stuff in lldb_private::Address.

Added a function to StackFrame to detect if the frame is a concrete frame so
we can detect the difference between actual frames and inlined frames.

llvm-svn: 111989
2010-08-24 22:59:52 +00:00
Johnny Chen 3c884a014c Added a test for launching a universal binary. Launch of i386 architecture
currently fails: rdar://problem/8349784.

Forgot to check in lldbtest.py in the previous commit r111958.

llvm-svn: 111975
2010-08-24 22:07:56 +00:00
Greg Clayton 9da7bd0739 Got a lot of the kinks worked out in the inline support after debugging more
complex inlined examples.

StackFrame classes don't have a "GetPC" anymore, they have "GetFrameCodeAddress()".
This is because inlined frames will have a PC value that is the same as the 
concrete frame that owns the inlined frame, yet the code locations for the
frame can be different. We also need to be able to get the real PC value for
a given frame so that variables evaluate correctly. To get the actual PC
value for a frame you can use:

    addr_t pc = frame->GetRegisterContext()->GetPC();

Some issues with the StackFrame stomping on its own symbol context were 
resolved which were causing the information to change for a frame when the
stack ID was calculated. Also the StackFrame will now correctly store the
symbol context resolve flags for any extra bits of information that were 
looked up (if you ask for a block only and you find one, you will alwasy have
the compile unit and function).

llvm-svn: 111964
2010-08-24 21:05:24 +00:00
Johnny Chen 9c194e3e75 Converted to Makefile.rules.
llvm-svn: 111961
2010-08-24 20:54:26 +00:00
Johnny Chen 9d2bd8301d More descriptive method doc string.
llvm-svn: 111960
2010-08-24 20:48:28 +00:00
Johnny Chen 6b900c5dcd Added a test case which uses "image lookup" command on an enum data type.
llvm-svn: 111958
2010-08-24 20:44:33 +00:00
Johnny Chen f2b1419acc Need a better method name.
llvm-svn: 111939
2010-08-24 18:46:00 +00:00
Johnny Chen f0dec3cf31 Converted to Makefile.rules.
llvm-svn: 111938
2010-08-24 18:41:52 +00:00
Johnny Chen ea920fe8b4 Added test case TestBitfields.py for rdar://problem/8348251, where
"variable list bits" display bits variable correctly, but not "variable list".

llvm-svn: 111937
2010-08-24 18:21:23 +00:00
Johnny Chen 734cdb58f1 Converted to Makefile.rules.
llvm-svn: 111928
2010-08-24 17:43:34 +00:00
Johnny Chen e3dc0f048a Generates the .d prerequisite file for dylib as well.
llvm-svn: 111920
2010-08-24 16:35:00 +00:00
Greg Clayton bba1ba8575 Clear the inline stack frame info when we clean all stack frames.
llvm-svn: 111891
2010-08-24 01:28:00 +00:00
Greg Clayton 1b72fcb7d1 Added support for inlined stack frames being represented as real stack frames
which is now on by default. Frames are gotten from the unwinder as concrete
frames, then if inline frames are to be shown, extra information to track
and reconstruct these frames is cached with each Thread and exanded as needed.

I added an inline height as part of the lldb_private::StackID class, the class
that helps us uniquely identify stack frames. This allows for two frames to
shared the same call frame address, yet differ only in inline height.

Fixed setting breakpoint by address to not require addresses to resolve.

A quick example:

% cat main.cpp

% ./build/Debug/lldb test/stl/a.out 
Current executable set to 'test/stl/a.out' (x86_64).
(lldb) breakpoint set --address 0x0000000100000d31
Breakpoint created: 1: address = 0x0000000100000d31, locations = 1
(lldb) r
Launching 'a.out'  (x86_64)
(lldb) Process 38031 Stopped
* thread #1: tid = 0x2e03, pc = 0x0000000100000d31, where = a.out`main [inlined] std::string::_M_data() const at /usr/include/c++/4.2.1/bits/basic_string.h:280, stop reason = breakpoint 1.1, queue = com.apple.main-thread
 277   	
 278   	      _CharT*
 279   	      _M_data() const
 280 ->	      { return  _M_dataplus._M_p; }
 281   	
 282   	      _CharT*
 283   	      _M_data(_CharT* __p)
(lldb) bt
thread #1: tid = 0x2e03, stop reason = breakpoint 1.1, queue = com.apple.main-thread
  frame #0: pc = 0x0000000100000d31, where = a.out`main [inlined] std::string::_M_data() const at /usr/include/c++/4.2.1/bits/basic_string.h:280
  frame #1: pc = 0x0000000100000d31, where = a.out`main [inlined] std::string::_M_rep() const at /usr/include/c++/4.2.1/bits/basic_string.h:288
  frame #2: pc = 0x0000000100000d31, where = a.out`main [inlined] std::string::size() const at /usr/include/c++/4.2.1/bits/basic_string.h:606
  frame #3: pc = 0x0000000100000d31, where = a.out`main [inlined] operator<< <char, std::char_traits<char>, std::allocator<char> > at /usr/include/c++/4.2.1/bits/basic_string.h:2414
  frame #4: pc = 0x0000000100000d31, where = a.out`main + 33 at /Volumes/work/gclayton/Documents/src/lldb/test/stl/main.cpp:14
  frame #5: pc = 0x0000000100000d08, where = a.out`start + 52

Each inline frame contains only the variables that they contain and each inlined
stack frame is treated as a single entity.

llvm-svn: 111877
2010-08-24 00:45:41 +00:00
Johnny Chen 9bc867aaf5 Makefile refactoring for the test suite. Added a make directory under test,
which hosts the Makefile.rules and modified most of the Makefiles under each
test case directories to utilize Mekefile.rules.

Added a description of 'make' directory into README-TestSuite file.

llvm-svn: 111868
2010-08-23 23:56:08 +00:00
Sean Callanan 64dfc9a3f9 Refactored ClangExpressionDeclMap to use
ClangExpressionVariables for found external variables
as well as for struct members, replacing the Tuple
and StructMember data structures.

llvm-svn: 111859
2010-08-23 23:09:38 +00:00
Johnny Chen a73af6f698 Fixed a crasher where during shutdown, loggings attempted to access the
thread name but the static map instance had already been destructed.

rdar://problem/8153284

llvm-svn: 111812
2010-08-23 17:13:12 +00:00
Johnny Chen d0190a6182 Changed the keyword argument for runCmd()/expect() from 'verbose' to 'trace',
which, defaults to False, and if set to True, will trace lldb command execution
and result.

Added "-t" command option to the test driver dotest.py which sets the
LLDB_COMMAND_TRACE environment variable to "YES" and as a result always turns on
command tracing regardless of the 'trace' keyword argument to runCmd()/expect().

llvm-svn: 111811
2010-08-23 17:10:44 +00:00
Greg Clayton 2cf205ff23 Fixed the Xcode project file to not build all architectures
for Debug builds. I accidentally checked this in with my last
round of changes.

llvm-svn: 111743
2010-08-21 20:12:22 +00:00
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
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
Johnny Chen 7f5f2809e8 Added comment.
llvm-svn: 110066
2010-08-02 21:26:00 +00:00
Johnny Chen 8402832e50 Cleanup of test case. Added more comments.
llvm-svn: 110064
2010-08-02 21:19:08 +00:00
Sean Callanan 5300d37aa7 Added support for rewriting objc_msgSend so we can
call Objective-C methods from expressions.  Also added
some more logging to the function-calling thread plan
so that we can see the registers when a function
finishes.

Also documented things maybe a bit better.

llvm-svn: 109938
2010-07-31 01:32:05 +00:00
Greg Clayton 3382c2c80d Fixed debugserver to not exit when we are able to spawn the process, yet not
launch it due to not being able to get the task port. A SIGHUP was killing us
and also an error string wasn't properly being passed along. Got rid of a
class error variable that can only lead to multi-threaded crashes.

llvm-svn: 109930
2010-07-30 23:14:42 +00:00
Johnny Chen 7dc2e4784e We can do better when reporting the status of one-liner script execution.
Change the prototype of ScriptInterpreter::ExecuteOneLine() to return bool
instead of void and take one additional parameter as CommandReturnObject *.

Propagate the status of one-liner execution back appropriately.

llvm-svn: 109899
2010-07-30 22:33:14 +00:00
Greg Clayton e637112102 Updated to llvm/clang from July 30, 2010 at 08:00.
llvm-svn: 109887
2010-07-30 20:30:44 +00:00
Greg Clayton 48e4254989 Added "void Clear();" methods to SBDebugger, SBTarget and SBThread so they can release their shared pointers.
llvm-svn: 109882
2010-07-30 20:12:55 +00:00
Johnny Chen b9e7c0aef6 Add a test case to test that lldb command "command source" works correctly.
llvm-svn: 109806
2010-07-29 21:42:28 +00:00
Johnny Chen c0599ea1e7 Removed redundant import statement.
llvm-svn: 109803
2010-07-29 20:49:07 +00:00
Greg Clayton 76a5cce6c0 Removed pending TODOs after resolving them with help of the clang folks and the discussion list.
llvm-svn: 109802
2010-07-29 20:38:50 +00:00
Greg Clayton 2d5cdf0615 Added an objective C test case.
llvm-svn: 109798
2010-07-29 20:08:39 +00:00
Greg Clayton 5fb47cd535 Fixed "void *ClangASTContext::CreatePointerType (void *clang_type);" to return objective C pointers for clang::Type::TypeClass types that are "clang::Type::ObjCObject" and "clang::Type::ObjCInterface" .
llvm-svn: 109795
2010-07-29 20:06:32 +00:00
Johnny Chen 1bb9bc72b9 Fixed "warning: unused variable 'log'".
llvm-svn: 109794
2010-07-29 19:51:52 +00:00
Greg Clayton 4b4b5fcebc Fixed expression result printing to have the expression result type be in
parens and to have a space before the value.

Before:
(lldb) expr 3 + 1
int4

(lldb) expr 3 + 1
(int) 4

llvm-svn: 109793
2010-07-29 19:36:30 +00:00
Sean Callanan 4ed7c5b2f8 Fixed the expression code to use the right
code model with the JIT.

llvm-svn: 109792
2010-07-29 19:03:08 +00:00
Johnny Chen ed4377eded Removed debug stmts checked into the previous commit.
llvm-svn: 109712
2010-07-29 00:40:06 +00:00
Johnny Chen 588ddc1c58 Add some comment about possible related bug info.
llvm-svn: 109678
2010-07-28 22:00:42 +00:00
Johnny Chen 377a8ed913 Added a test case to test that we can successfully step into an STL function.
This test case currently always fails.

llvm-svn: 109674
2010-07-28 21:24:31 +00:00
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 9e40956aea Created lldb::LanguageType by moving an enumeration from the
lldb_private::Language class into the enumerations header so it can be freely
used by other interfaces.

Added correct objective C class support to the DWARF symbol parser. Prior to
this fix we were parsing objective C classes as C++ classes and now that the
expression parser is ready to call functions we need to make sure the objective
C classes have correct AST types.

llvm-svn: 109574
2010-07-28 02:04:09 +00:00
Sean Callanan cc54bd3cef Added and improved logging. This is helping us as we
diagnose a problem where we're not correctly emitting
PIC code.

llvm-svn: 109568
2010-07-28 01:00:59 +00:00
Johnny Chen 571bfd6a2d Added a test case to test that break on a struct declaration has no effect.
Instead, the first executable statement is set as the breakpoint.

llvm-svn: 109552
2010-07-27 22:48:46 +00:00
Johnny Chen ef2f552de4 Added a test case for showing variables of unsigned types.
llvm-svn: 109545
2010-07-27 21:49:20 +00:00
Sean Callanan 7ea3501bd8 Added support for calling functions from expressions.
Right now we mock up the function as a variadic
function when generating the IR for the call; we need
to eventually make the function be the right type if
the type is available.

llvm-svn: 109543
2010-07-27 21:39:39 +00:00
Johnny Chen 3c39a980d7 Renaming from TestOrder.py to TestOrderFile.py.
llvm-svn: 109540
2010-07-27 21:03:55 +00:00
Johnny Chen 49583c207f Fixed typos from cut-and-paste errors.
llvm-svn: 109539
2010-07-27 20:59:06 +00:00
Sean Callanan 4edba2d130 Added support for locating a function that is
referenced in the IR.  We don't yet support updating
the call to that function.

llvm-svn: 109483
2010-07-27 02:07:53 +00:00
Sean Callanan b27a62fd13 Fixed a bug in the IR transformer where we were
trying to do replaceUsesOfWith on a constant,
which doesn't work.  Turns out we don't need to
do anything for constants.

llvm-svn: 109477
2010-07-27 01:17:28 +00:00
Sean Callanan 8ade104a0a Changed SymbolContext so when you search for functions
it returns a list of functions as a SymbolContextList.

Rewrote the clients of SymbolContext to use this
SymbolContextList.

Rewrote some of the providers of the data to SymbolContext
to make them respect preferences as to whether the list
should be cleared first; propagated that change out.

ClangExpressionDeclMap and ClangASTSource use this new
function list to properly generate function definitions -
even for functions that don't have a prototype in the
debug information.

llvm-svn: 109476
2010-07-27 00:55:47 +00:00
Sean Callanan 138e74e347 Fixed a bug where we didn't restore thread and
frame state after running a function.  This
caused nondeterministic crashes in the expression
evaluation code.

llvm-svn: 109454
2010-07-26 22:14:36 +00:00
Stephen Wilson f921790e6e Missed an aspect of the previous makefile patch.
Thanks again to William Lynch!

llvm-svn: 109328
2010-07-24 05:18:16 +00:00
Stephen Wilson 4ec3fb9353 Fix makefiles to build properly on Darwin.
Patch by William Lynch!

llvm-svn: 109327
2010-07-24 04:10:59 +00:00
Stephen Wilson e6f9f66b39 Add a new Process plugin for Linux.
This component is still at an early stage, but allows for simple
breakpoint/step-over operations and basic process control.

The makefiles are set up to build the plugin under Linux only.

llvm-svn: 109318
2010-07-24 02:19:04 +00:00
Sean Callanan ddb46efcca Updated the IR converter for the target to eliminate
spurious guard variables on expression statics.

Updated the AST result synthesizer to eliminate the
unneeded result pointer.

Very rudimentary expressions now evaluate correctly
in the target using the new JIT-based mechanism.

llvm-svn: 109317
2010-07-24 01:37:44 +00:00
Greg Clayton 9fed0d85b2 Added needed breakpoint functionality to the public API that includes:
SBTarget:
    - get breakpoint count
    - get breakpoint at index
  SBBreakpoint:
    - Extract data from breakpoint events

llvm-svn: 109289
2010-07-23 23:33:17 +00:00
Greg Clayton 4eb82d9216 Get rid of using EXC_SOFT_SIGNAL define in host agnostic code.
llvm-svn: 109281
2010-07-23 22:50:09 +00:00
Sean Callanan 289e07b9d0 Added logging:
- 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
2010-07-23 22:19:18 +00:00
Stephen Wilson ebb84b243b Fix a typo.
llvm-svn: 109271
2010-07-23 21:47:22 +00:00
Benjamin Kramer 5ea4192b72 Remove useless typedef keyword, fix a clang warning.
llvm-svn: 109254
2010-07-23 18:59:12 +00:00
Greg Clayton aaa58c6679 Added a new utility class that I have wanted for a while. The CleanUp
class is a templatized class that allows you to have a cleanup function called
on a data value of type T when the value is set or when the object goes
out of scope. It has support for very rudimentary invalid value detection that
can be enabled by using the appropriate constructor. 

Anyone with template experience that can see ways of improving this class
please let me know. The example code shows a few typical scenarios in which
I would like to use it. It is currently coded with simple type T values
in mind (integer file descriptors, pointers, etc), but I am sure some 
specialization might help out the class for more complex types.

There is a lot of documentation including examples in the CleanUp.h header 
file. 

llvm-svn: 109239
2010-07-23 17:42:15 +00:00
Greg Clayton 896dff661a Centralized the Mach exception stop info code by adding it as a first
class citizen on the StopInfo class. 

llvm-svn: 109235
2010-07-23 16:45:51 +00:00
Greg Clayton 572404311a Remove a deadlock condition. A bit of explanation is needed: When calling
ThreadCancel in Host::WillTerminate g_monitor_thread may be blocked on a call
to pthread_cond_wait (for example, line 640).  Now, by default, when a 
cancellation request is serviced g_monitor_thread will again own the mutex
guarding the condition variable it was waiting on.  This causes the call to 
SetValue in Host::WillTerminate to hit a deadlock.

The call to SetValue does not appear to be needed, so removing it solves
the issue.

Patch from Stephen Wilson.

llvm-svn: 109228
2010-07-23 15:47:19 +00:00
Greg Clayton 26661bca20 Remove a premature invalidation of a threads pthread_t handle, thus avoiding
a segfault when calling pthread_cancel.  Also, sets m_read_thread_enabled if
the thread is actually spawned.

Patch from Stephen Wilson.

llvm-svn: 109227
2010-07-23 15:43:25 +00:00
Greg Clayton 19503a2a78 Warnings cleanup patch from Jean-Daniel Dupas.
llvm-svn: 109226
2010-07-23 15:37:46 +00:00
Greg Clayton 5b9a1ea9c6 Added Mach exception stop descriptions. The chunk of code I just added needs to be placed into a utility location so it can be used by ProcessMacOSX and debugserver.
llvm-svn: 109214
2010-07-23 03:40:38 +00:00
Sean Callanan 6dde30e964 Added extensive logging of the code that is actually going
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
2010-07-23 02:19:15 +00:00
Sean Callanan 88f0e04e6f Whoops, fixed the LLVM_CONFIGURATION.
llvm-svn: 109200
2010-07-23 00:16:53 +00:00
Sean Callanan ebf7707e53 Modified TaggedASTType to inherit from ClangASTType
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
2010-07-23 00:16:21 +00:00
Greg Clayton 49182ed65a This patch changes the point at which Process::m_private_state_thread is
invalidated.  There was a race condition where the private thread would
invalidate its own pthread_t object before the parent could perform a
pthread_cancel/pthread_join sequence.

Patch from Stephen Wilson.

llvm-svn: 109131
2010-07-22 18:34:21 +00:00
Greg Clayton 8cf0593c87 Added a new enumeration named "ClangASTContext::AccessType" that abstracts the type creation from the various access enumerations in Clang. Currently there are clang::AccessSpecifier and the objective C ivars have their own enumeration. So I added a new enumeration that will allow a consistent interface when creating types through ClangASTContext.
I also added new functions to create an Objective C class, ivar and set an objective C superclass. They aren't hooked up in the DWARF parser yet. That is the next step, though I am unsure if I will do this in the DWARF parser or try and do it generically in the existing Record manipulation functions.

llvm-svn: 109130
2010-07-22 18:30:50 +00:00
Greg Clayton 4ceb9980c8 Modified both the ObjectFileMachO and ObjectFileELF to correctly set the
SectionType for Section objects for DWARF.

Modified the DWARF plug-in to get the DWARF sections by SectionType so we
can safely abstract the LLDB core from section names for the various object
file formats.

Modified the SectionType definitions for .debug_pubnames and .debug_pubtypes
to use the correct case.

llvm-svn: 109054
2010-07-21 22:54:26 +00:00
Greg Clayton e1a916a74d Change over to using the definitions for mach-o types and defines to the
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
2010-07-21 22:12:05 +00:00
Greg Clayton 8c920840a4 Add new SectionType enumerations for all DWARF sections. ObjectFile parsers should start properly setting the section types for DWARF sections, then we can move the DWARF SymbolFile parser over to finding the sections by the appropriate SectionType.
llvm-svn: 109041
2010-07-21 21:51:36 +00:00
Greg Clayton 70e33eb06e Allow searching for a section by SectionType.
llvm-svn: 109040
2010-07-21 21:49:46 +00:00
Greg Clayton d1daf00b28 Updated LLVM and Clang to July 20 at 16:00.
llvm-svn: 109016
2010-07-21 16:57:26 +00:00
Greg Clayton a0e7f0c1b1 Avoid std::bitset<64>::to_string() since it is missing in earlier C++
libraries (from William Lynch).

llvm-svn: 108976
2010-07-21 01:08:41 +00:00
Sean Callanan b3706e6dd2 Whoops, forgot to guard ASTType.h. Fixed.
llvm-svn: 108970
2010-07-20 23:53:01 +00:00
Sean Callanan 1d18066411 Added functionality to dematerialize values that were
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
2010-07-20 23:31:16 +00:00
Greg Clayton ede0585ec2 Fixing a crashing bug in multiword commands from William Lynch.
llvm-svn: 108958
2010-07-20 22:54:09 +00:00
Greg Clayton 471b31ce62 Remove use of STL collection class use of the "data()" method since it isn't
part of C++'98. Most of these were "std::vector<T>::data()" and 
"std::string::data()".

llvm-svn: 108957
2010-07-20 22:52:08 +00:00
Stephen Wilson 4ab47682bb Fix assertion conditions.
llvm-svn: 108879
2010-07-20 18:41:11 +00:00
Stephen Wilson 645767aeca Add missing include.
llvm-svn: 108878
2010-07-20 18:40:23 +00:00
Greg Clayton 044672b076 Logic fix to properly determine when a symbol is not from the current
symbol table (from William Lynch).

llvm-svn: 108871
2010-07-20 18:30:17 +00:00
Benjamin Kramer 40e155dfc2 More constructor warning fixes from William Lynch.
llvm-svn: 108840
2010-07-20 14:37:45 +00:00
Stephen Wilson 50bd94f961 Have Process::CreateBreakpointSite return a break_id_t instead of a user_id_t.
Also, update BreakpointLocation::ResolveBreakpointSite to check for invalid
breakpoint ID's using the proper magic constant.

llvm-svn: 108598
2010-07-17 00:56:13 +00:00
Sean Callanan 6b4067c14e Added the necessary code to copy variables used by
an expression into the struct prepared for the JIT
compiled code to use.

llvm-svn: 108596
2010-07-17 00:43:37 +00:00
Jim Ingham 6185accf3b Patch from Mattias to specify the system sed on Mac OS X.
llvm-svn: 108580
2010-07-17 00:25:08 +00:00
Greg Clayton ea3b0ae8ed Fixed a copyright header.
llvm-svn: 108544
2010-07-16 18:28:27 +00:00
Benjamin Kramer 1ee0d4f7f3 Fix constructor initialization order. Patch by Bill Lynch.
llvm-svn: 108524
2010-07-16 12:32:33 +00:00
Sean Callanan ea22d4288a Wrote the code that looks at a context to see
if the variables in that context allow a particular
JIT compiled expression to run in that context.

llvm-svn: 108485
2010-07-16 00:09:46 +00:00
Sean Callanan 23a3027a67 Oops, didn't define AreTypesSame correctly.
llvm-svn: 108483
2010-07-16 00:00:27 +00:00
Sean Callanan 4dcca262f4 Added a function to test whether two types are
the same.

llvm-svn: 108467
2010-07-15 22:30:52 +00:00
Sean Callanan 7618f4ebaf Fixes to the IR generator in the expression parser
to correctly unfold constant-folded global variables.
Also added code to JIT the expression.  Simple 
expressions are now JIT compiled successfully.

llvm-svn: 108380
2010-07-14 23:40:29 +00:00
Jim Ingham a3241c1bf5 Don't call PrepareForResume on threads that aren't going to get a chance to run this time around.
llvm-svn: 108312
2010-07-14 02:27:20 +00:00
Jim Ingham 9d790c5d12 Stepping through a trampoline should do "stop others" unless All Threads is requested.
llvm-svn: 108311
2010-07-14 02:25:06 +00:00
Greg Clayton ec00f12a22 Fixed Xcode project to deal with recent ELF plug-in changes.
llvm-svn: 108300
2010-07-14 00:20:31 +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
Stephen Wilson 11e8f3ba37 Remove our local ELF definitions and rely on llvm/Support/ELF.h instead.
llvm-svn: 108293
2010-07-13 23:09:42 +00:00
Stephen Wilson f325ba9d45 Combine 32 and 64 bit ELF readers.
This patch provides a generic ELF reader plugin to handle both 32 and 64 bit
formats.

llvm-svn: 108292
2010-07-13 23:07:23 +00:00
Greg Clayton b6f75dfd96 Removed unused variable "log".
Fixed the llvm build for Mac OS X builds to look in llvm/lib/Release+Asserts 
output directory for all configurations (Debug, Release, BuildAndIntegration).

llvm-svn: 108289
2010-07-13 22:26:45 +00:00
Greg Clayton f6cc9dde46 Updated to latest llvm from July 13th, 2010 at 13:00.
llvm-svn: 108285
2010-07-13 22:06:06 +00:00
Sean Callanan 549c9f7f9a "expr -i" now performs the required transforms to
prepare the IR for JIT compilation.  We still need
to do the JIT compilation and move the arguments
in/out of target memory.

llvm-svn: 108279
2010-07-13 21:41:46 +00:00
Greg Clayton d764ecc0de Removed Xcode project files that aren't needed right now.
llvm-svn: 108271
2010-07-13 20:57:41 +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
Greg Clayton 0428b7dcc8 Don't build the SymbolVendor/MacOSX when not building on Darwin.
llvm-svn: 108208
2010-07-12 23:11:00 +00:00
Jim Ingham a56c800607 Add an "Avoid Frames matching this regular expression" to ThreadPlanStepInRange.
This relies on ThreadPlanStepOut working correctly, which it doesn't currently for Inlined functions, so this feature is only partially useful until we take care of Stepping Out of inlined functions.
Added an option to "thread step-in" to set the avoid regular expression.  This is mostly for testing, once the Setting code is redone, we'll move this to a general setting.

llvm-svn: 108036
2010-07-10 02:27:39 +00:00
Jim Ingham 35b21fef65 Properly set the PlanKind for the ThreadPlanStepRange derived classes.
llvm-svn: 108035
2010-07-10 02:23:31 +00:00
Eli Friedman 07a2437a91 A few more misc warning fixes.
llvm-svn: 108030
2010-07-09 23:04:08 +00:00
Eli Friedman 8878f87fb6 Misc warning fixes.
llvm-svn: 108029
2010-07-09 22:53:18 +00:00
Eli Friedman 2066e3ed47 Comment out test targets; they don't work on Linux because test/Makefile uses
a bunch of BSD-isms.

llvm-svn: 108027
2010-07-09 22:36:15 +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
Eli Friedman 78ed6b7469 Remove unnecessary directory (accidentally committed with r108009).
llvm-svn: 108024
2010-07-09 22:03:05 +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
Johnny Chen 364b0e72d1 Add a test case (incomplete) to check that settings and readings of program
variabes work.

llvm-svn: 107914
2010-07-08 21:38:07 +00:00
Sean Callanan 246549c50b Moved NDEBUG from a global setting to a specific
hack.

llvm-svn: 107894
2010-07-08 18:16:16 +00:00
Sean Callanan 6015095608 Updated to build against the latest LLVM release.
Also fixed our build to define NDEBUG; code that
uses LLVM headers without NDEBUG is
binary-incompatible with libraries built with
NDEBUG.

llvm-svn: 107853
2010-07-08 02:13:18 +00:00
Johnny Chen acfbeff17e Test that debug symbols have the correct order as specified by the order file.
llvm-svn: 107844
2010-07-08 00:17:29 +00:00
Johnny Chen 529728e82a Fixed typos in the comments.
llvm-svn: 107829
2010-07-07 22:49:43 +00:00
Greg Clayton 51dc188216 64 bit ELF support from Stephen Wilson.
llvm-svn: 107817
2010-07-07 21:52:01 +00:00
Johnny Chen 41a3c9a5f8 Test that breakpoint by symbol name works correctly dlopen'ing a dynamic lib.
llvm-svn: 107812
2010-07-07 21:10:55 +00:00
Greg Clayton a624358728 Added some comments to clarify where "init_lldb" comes from.
llvm-svn: 107801
2010-07-07 18:40:03 +00:00
Greg Clayton 69b518f6ef typedef fixups, patch from Jean-Daniel Dupas.
llvm-svn: 107794
2010-07-07 17:07:17 +00:00
Greg Clayton 72db59664f Fixed "#endif"s followed by non comments, patch from Jean-Daniel Dupas.
llvm-svn: 107793
2010-07-07 17:06:20 +00:00
Benjamin Kramer 59d9a5c209 Declare LLDBVersionNumber extern "C" to make sure clang++ mangles it properly. Patch from Jean-Daniel Dupas!
llvm-svn: 107765
2010-07-07 09:33:41 +00:00
Benjamin Kramer 3f3ff5cc87 Fix build for newer versions of GCC that don't include cstring implicitly. Based on a patch by Pawel Wodnicki!
llvm-svn: 107763
2010-07-07 09:19:50 +00:00
Jim Ingham 6f80bc5602 Remove includes for removed files...
llvm-svn: 107753
2010-07-07 03:39:43 +00:00
Jim Ingham ebc09c36e9 Fix GetRepeatCommand so it works with multi-word commands.
Move the "source", "alias", and "unalias" commands to "commands *".
Move "source-file" to "source list".
Added a "source info" command but it isn't implemented yet.

llvm-svn: 107751
2010-07-07 03:36:20 +00:00
Jim Ingham 1308bb2791 Added a "GetRepeatCommand" to the command object. The Interpreter uses this
instead of the last history item to provide a command for the "empty" command.
Use this in the source-file command to make <RETURN> continue the listing rather
than relist the first listing...

llvm-svn: 107736
2010-07-06 23:48:33 +00:00
Johnny Chen 51991b549b Enable a test clause since rdar://problem/8163668 is fixed by http://llvm.org/viewvc/llvm-project?rev=107729&view=rev.
llvm-svn: 107733
2010-07-06 23:41:17 +00:00
Greg Clayton 364f1167cb Fixed an issue with looking up line table entries by address where internal
line table entries that were termination entries (ones that define the bounds
of the previous entry) could be found when looking up line table entries.
We now properly skip these termination entries and check the next entry to
try for a match.

llvm-svn: 107729
2010-07-06 23:34:08 +00:00
Johnny Chen f031b71f7e if -1 => evaluates to True
oops!

llvm-svn: 107724
2010-07-06 23:26:16 +00:00
Johnny Chen 0e38f42f0a Test that breakpoint works correctly in the presence of dead-code stripping.
llvm-svn: 107719
2010-07-06 22:52:00 +00:00
Jim Ingham 279a6c2669 Hide the logic for command resolution for commands, aliases & user commands behind a single
interface so everybody does it the same way.  Add an "exact" lookup for internal uses.

Fix up a few little cases where we weren't reporting command lookup errors correctly.

Added "b" as an alias for "breakpoint" so it doesn't collide with "bt".

llvm-svn: 107718
2010-07-06 22:46:59 +00:00
Jason Molenda ea84e76479 Switch over to using llvm's dwarf constants file.
llvm-svn: 107716
2010-07-06 22:38:03 +00:00
Greg Clayton 6b6742b08e Remove extraneous semicolon after if condition (from Jean-Daniel Dupas).
llvm-svn: 107694
2010-07-06 20:30:35 +00:00
Greg Clayton 5f067820ba Avoid duplicate names (something else that clang++ really doesn't like) in
function prototype (from Jean-Daniel Dupas).

llvm-svn: 107693
2010-07-06 20:29:25 +00:00
Greg Clayton 3afe8a9f1d Applied pid.patch from Jean-Daniel Dupas.
llvm-svn: 107692
2010-07-06 20:27:00 +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 a08073565a Jean-Daniel Dupas patch that fixes a bad if statement with assignment.
llvm-svn: 107671
2010-07-06 16:11:44 +00:00
Eric Christopher 2159b4ae6d Change order of initialization.
Patch by Stephen Wilson!

llvm-svn: 107623
2010-07-05 19:13:23 +00:00
Johnny Chen f02ec12796 Make it fail fast if 'mydir' attribute is not overridden by subclasses of
lldbtest.TestBase.

Also removed some debug prints.

llvm-svn: 107575
2010-07-03 20:41:42 +00:00
Johnny Chen bf6ffa3b89 Abstracted the lldb-specific unittest.TestCase.setUp()/tearDown() in a separate
module lldbtest.py and refactored the existing test cases to derive from the
abstract base class lldbtest.TestBase.

MOdified the test driver (dotest.py and dotest.pl) to set up additional
PYTHONPATH component for locating the lldbtest module, which sits in the same
directory.

llvm-svn: 107563
2010-07-03 03:41:59 +00:00
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
Johnny Chen f1d2ac7c01 Test variable with function ptr type and that break on the function works.
llvm-svn: 107545
2010-07-02 23:50:37 +00:00
Greg Clayton 13a177aeb8 Plugged 4 more leaks in the libunwind code. One leaks is still left in as it
is quite gnarly code and there is no good way to clean it up. I will have
Jason look at a fix for this.

llvm-svn: 107539
2010-07-02 23:23:14 +00:00
Sean Callanan 248e64b5b8 Fixes to improve logging (by printing basic
block labels) and produce cleaner IR (by removing
the thread-safe statics guards)

llvm-svn: 107528
2010-07-02 22:22:28 +00:00
Johnny Chen 03813ec687 Also verified the values of global variables.
llvm-svn: 107525
2010-07-02 22:12:25 +00:00
Johnny Chen 85d6948f3d Add a test to show global variables and to verify that they do display as having
global scopes.

llvm-svn: 107522
2010-07-02 22:04:42 +00:00
Sean Callanan 177909a350 Small fixes to the DWARF relocator.
llvm-svn: 107518
2010-07-02 21:28:35 +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
Johnny Chen c653d4c574 Fixed logic error; checking return status and raising exception should only be
done if the environment variable LLDB_LOG is defined.

llvm-svn: 107508
2010-07-02 20:35:23 +00:00
Eli Friedman b6c9e103a1 Implement GetProgramFileSpec().
llvm-svn: 107502
2010-07-02 19:38:10 +00:00
Eli Friedman 5423ebff13 Add hacky, incomplete Linux host implementation; barely enough to allow
compiling lldb.  Someone else might try to improve it, though. :)

llvm-svn: 107501
2010-07-02 19:28:44 +00:00
Eli Friedman feaeebfb5d Add const qualification; fixes error on gcc 4.4.
llvm-svn: 107499
2010-07-02 19:15:50 +00:00
Greg Clayton d2d60ce388 Updated to llvm/clang from July 2, 2010 at 8:00AM.
llvm-svn: 107494
2010-07-02 18:39:06 +00:00
Sean Callanan 609f8c584a Added a method to get a stream's byte order.
llvm-svn: 107460
2010-07-02 02:43:42 +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
Jim Ingham 4fdf181a00 Remember to save first...
llvm-svn: 107457
2010-07-02 01:03:49 +00:00
Jim Ingham a302bb1608 Resolve dueling commits... Plus add docs for Resolve & ResolveUsername.
llvm-svn: 107456
2010-07-02 00:57:26 +00:00
Jim Ingham 7cc478b9a2 Remove duplicate def'n from FileSpec.h.
Add user name completion to the file completer.

llvm-svn: 107455
2010-07-02 00:45:55 +00:00
Greg Clayton c228ebba77 Removed the thread specific data that was being used for demangling since
removing it didn't cause any performance loss, and leaks were showing up
when run under instruments when we tried to re-use the buffer. We are now leak
free and still just as performant.

llvm-svn: 107453
2010-07-02 00:29:31 +00:00
Johnny Chen 3d7e687245 A dumber way to invoke the test suite.
Use this script to visit each python test case under the specified directory and
run python unittest.main() on each test case.

llvm-svn: 107447
2010-07-01 23:01:23 +00:00
Johnny Chen 119b53ea6d Turn on logging for debugging purposes if ${LLDB_LOG} environment variable is
is defined.  Use ${LLDB_LOG} to specify the log file.

Create a singleton SBDebugger in the lldb namespace, that gets used when running
the entire test suite.

llvm-svn: 107445
2010-07-01 22:52:57 +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 735753d19c Undid extra changes I already checked in.
llvm-svn: 107413
2010-07-01 18:31:14 +00:00