Commit Graph

1250 Commits

Author SHA1 Message Date
Greg Clayton ce02552b6a Added missing file.
llvm-svn: 119709
2010-11-18 17:29:15 +00:00
Greg Clayton 3af9ea56d3 Fixed Process::Halt() as it was broken for "process halt" after recent changes
to the DoHalt down in ProcessGDBRemote. I also moved the functionality that
was in ProcessGDBRemote::DoHalt up into Process::Halt so not every class has
to implement a tricky halt/resume on the internal state thread. The 
functionality is the same as it was before with two changes:
- when we eat the event we now just reuse the event we consume when the private
  state thread is paused and set the interrupted bool on the event if needed
- we also properly update the Process::m_public_state with the state of the
  event we consume.
  
Prior to this, if you issued a "process halt" it would eat the event, not 
update the process state, and then produce a new event with the interrupted
bit set and send it. Anyone listening to the event would get the stopped event
with a process that whose state was set to "running".

Fixed debugserver to not have to be spawned with the architecture of the
inferior process. This worked fine for launching processes, but when attaching
to processes by name or pid without a file in lldb, it would fail.

Now debugserver can support multiple architectures for a native debug session
on the current host. This currently means i386 and x86_64 are supported in
the same binary and a x86_64 debugserver can attach to a i386 executable.
This change involved a lot of changes to make sure we dynamically detect the
correct registers for the inferior process.

llvm-svn: 119680
2010-11-18 05:57:03 +00:00
Sean Callanan 19ca5608db Instructions for building LLDB with a debug LLVM
build under Xcode.

llvm-svn: 119679
2010-11-18 03:56:17 +00:00
Sean Callanan 79439e86d1 Updated to the LLVM/Clang of 2010-11-17 at 3:30pm.
llvm-svn: 119677
2010-11-18 02:56:27 +00:00
Jim Ingham 773d981ce2 The thread plan destructors may call Thread virtual methods. That means they have to get cleaned up in the derived class's destructor. Make sure that happens.
llvm-svn: 119675
2010-11-18 02:47:07 +00:00
Sean Callanan afe16a71f7 Added support for constant strings of the form @"this-is-a-string".
They are replaced with calls to the CoreFoundation function 
CFStringCreateWithBytes() by a portion of the IRForTarget pass.

llvm-svn: 119582
2010-11-17 23:00:36 +00:00
Sean Callanan ac6429fc9a Whitespace fix.
llvm-svn: 119581
2010-11-17 23:00:07 +00:00
Jim Ingham 978e071f16 Add a missing newline to the ThreadPlanAssemblyTracer output.
llvm-svn: 119553
2010-11-17 20:40:29 +00:00
Jim Ingham a80ef35902 Add a ThreadPlanAssemblyTracer that takes just a thread (since that's how we call it from ThreadPlanBase...)
llvm-svn: 119549
2010-11-17 20:19:50 +00:00
Jim Ingham 0d8bcc79f4 Added an "Interrupted" bit to the ProcessEventData. Halt now generates an event
with the Interrupted bit set.  Process::HandlePrivateEvent ignores Interrupted events.
DoHalt is changed to ensure that the stop even is processed, and an event with
the Interrupted event is posted.  Finally ClangFunction is rationalized to use this
facility so the that Halt is handled more deterministically.

llvm-svn: 119453
2010-11-17 02:32:00 +00:00
Johnny Chen 80e6db9c79 Make the string matching for 'frame variable' more stringent with respect to
output from clang and llvm-gcc compiled program; both generate the correct debug
info with respect to the typedef scoped inside a namespace.

Add a TestBase.getCompiler(self) method which returns the compiler in effect the
test suite is now running with.  Subclasses (like TestNamespace) can use it to
distinguish among different compilers.

llvm-svn: 119445
2010-11-17 00:52:41 +00:00
Johnny Chen ecb072d840 Add an option '-# count' to run the specified test suite for a said number of times.
This is not to be used during normal test suite run, but to be used to stress test
specific test sequences repeatedly.

Example:

./dotest.py -# 3 -v breakpoint_conditions

will repeat the test suite 3 times for tests under the breakpoint_conditions directory.

llvm-svn: 119399
2010-11-16 22:42:58 +00:00
Greg Clayton 47fbf1aecb Use different qualifier enums on the request of a clang engineer.
llvm-svn: 119396
2010-11-16 22:09:25 +00:00
Johnny Chen 43b3bad58b Initial check-in of a Python utility to run the lldb test suite and send the
result including the session logs of test failures/errors as a MIME message.

llvm-svn: 119371
2010-11-16 19:44:50 +00:00
Johnny Chen 7826b0a721 Disambiguate the name lookup for the data type of anon_uint variable.
llvm-svn: 119353
2010-11-16 18:11:55 +00:00
Caroline Tice ef5c6d02f5 Make processes use InputReaders for their input. Move the process
ReadThread stuff into the main Process class (out of the Process Plugins).
This has the (intended) side effect of disabling the command line tool
from reading input/commands while the process is running (the input is
directed to the running process rather than to the command interpreter).

llvm-svn: 119329
2010-11-16 05:07:41 +00:00
Jason Molenda 5920333be1 Add an UnwindPlan Row for the last instruction of a function when
we're using the stack pointer to define the CFA again.  Makes unwinds
while sitting at the 'ret' instruction work, assuming we have accurate
function address bounds.

llvm-svn: 119327
2010-11-16 03:01:20 +00:00
Greg Clayton 7fedea2c6f First attempt and getting "const" C++ method function signatures correct.
It currently isn't working, but it should be close. I will work on this more
when I figure out what I am not doing correctly.

llvm-svn: 119324
2010-11-16 02:10:54 +00:00
Johnny Chen 13e64a7411 Check in a test case for rdar://problem/8668740:
'frame variable' output for namespace variables look wrong

llvm-svn: 119172
2010-11-15 19:10:53 +00:00
Johnny Chen 8ed80e6360 Add radar info for failed expression command test sequences which are now commented out.
llvm-svn: 119171
2010-11-15 18:49:03 +00:00
Johnny Chen 913af510c7 Also add a test for "frame variable '(anonymous namespace)::i'",
plus expression command using fully qualified names.

llvm-svn: 119168
2010-11-15 18:40:06 +00:00
Johnny Chen 6ba9d1f944 Add test sequences for 'frame variable' address-of operator and 'frame variable' fully-qualified name variable.
Also add some comments.

llvm-svn: 119165
2010-11-15 18:27:57 +00:00
Johnny Chen 92dac7ae1b Add test sequence for 'frame variable this' and 'expression this' when stopped
inside a ctor.

llvm-svn: 119162
2010-11-15 18:04:54 +00:00
Johnny Chen deac523f7c Remove the @expectedFailure decorator and uncomment 'expression -- i + j" test,
as both rdar://problem/8659840 and rdar://problem/8660275 have been fixed.

llvm-svn: 119160
2010-11-15 17:42:22 +00:00
Greg Clayton cb7e3b3505 Added quotes around names that are being lookup up or inspected in the
expression logging.

Added some properties to the "objc" test. The expression parser can currently
display properties that are backed by the default functions "expr myStr.string"
will work. But it won't currently work when the property is backed by a 
different function such as "expr myStr.date".

llvm-svn: 119103
2010-11-15 01:47:11 +00:00
Greg Clayton 471da24dfa Added recursive name lookup logging with depth which is commented out and is currently only enabled when we blow the stack.
llvm-svn: 119101
2010-11-15 01:34:18 +00:00
Greg Clayton ce5c9a8f31 Added the address of operator for the "frame variable" command.
llvm-svn: 119100
2010-11-15 01:32:26 +00:00
Greg Clayton 5a2c6d583d Fixed the initWithNSString: function to properly initialize self.
llvm-svn: 119091
2010-11-14 23:12:29 +00:00
Greg Clayton 83c5cd9dfd Just like functions can have a basename and a mangled/demangled name, variable
can too. So now the lldb_private::Variable class has support for this.

Variables now have support for having a basename ("i"), and a mangled name 
("_ZN12_GLOBAL__N_11iE"), and a demangled name ("(anonymous namespace)::i").

Nowwhen searching for a variable by name, users might enter the fully qualified
name, or just the basename. So new test functions were added to the Variable 
and Mangled classes as:

	bool NameMatches (const ConstString &name);
	bool NameMatches (const RegularExpression &regex);

I also modified "ClangExpressionDeclMap::FindVariableInScope" to also search
for global variables that are not in the current file scope by first starting
with the current module, then moving on to all modules.

Fixed an issue in the DWARF parser that could cause a varaible to get parsed
more than once. Now, once we have parsed a VariableSP for a DIE, we cache
the result even if a variable wasn't made so we don't do any re-parsing. Some
DW_TAG_variable DIEs don't have locations, or are missing vital info that 
stops a debugger from being able to display anything for it, we parse a NULL
variable shared pointer for these DIEs so we don't keep trying to reparse it.

llvm-svn: 119085
2010-11-14 22:13:40 +00:00
Greg Clayton 32d2a48369 Fixed an issue where we were trying to resolve lldb_private::Type encoding
types to their full definitions more than we needed to. This caused an assertion
in the DWARF parser to fire -- which is an indication that we are parsing too much.

llvm-svn: 119020
2010-11-14 01:03:55 +00:00
Greg Clayton d7e054694e Fixed a crasher (an assert was firing in the DWARF parser) when setting
breakpoints on inlined functions by name. This involved fixing the DWARF parser
to correctly back up and parse the concrete function when we find inlined
functions by name, then grabbing any appropriate inlined blocks and returning
symbol contexts with the block filled in. After this was fixed, the breakpoint
by name resolver needed to correctly deal with symbol contexts that had the
inlined block filled in in the symbol contexts.

llvm-svn: 119017
2010-11-14 00:22:48 +00:00
Greg Clayton ba2d22d8ee Fixed an issue where we might not find global variables by name when we have
a debug map with DWARF in the .o files due to the attemted shortcut that was
being taken where the global variables were being searched for by looking in
the symbol table. The problem with the symbols in the symbol table is we don't
break apart the symbol names for symbols when they are mangled into basename
and the fully mangled name since this would take a lot of CPU time to chop up
the mangled names and try and find the basenames. The DWARF info typically has
this broken up for us where the basename of the variable is in a the DW_AT_name
attribute, and the mangled name is in the DW_AT_MIPS_linkage_name attribute.
Now we correctly find globals by searching all OSO's for the information so we
can take advantage of this split information. 

llvm-svn: 119012
2010-11-13 22:57:37 +00:00
Greg Clayton 580c5dacd0 Got namespace lookup working and was able to print a complex "this" as an
expression. This currently takes waaaayyyyy too much time to evaluate. We will
need to look at the expression parser and find ways to optimize the info we
provide and get this to evaluate quicker. I believe the performance issue is
currently related to us always providing a complete C++ class type when asked
about a C++ class which can cause a lot of information to be pulled since all
classes will be fully created (methods, base classes, members, all their 
types). We will need to give the classes back the parser and mark them as 
having external sources and get parser (Sema) to query us when it needs more
info. This should bring things up to an acceptable level.

llvm-svn: 118979
2010-11-13 04:18:24 +00:00
Greg Clayton 526e5afb2d Modified the lldb_private::Type clang type resolving code to handle three
cases when getting the clang type:
- need only a forward declaration
- need a clang type that can be used for layout (members and args/return types)
- need a full clang type

This allows us to partially parse the clang types and be as lazy as possible.
The first case is when we just need to declare a type and we will complete it
later. The forward declaration happens only for class/union/structs and enums.
The layout type allows us to resolve the full clang type _except_ if we have
any modifiers on a pointer or reference (both R and L value). In this case
when we are adding members or function args or return types, we only need to
know how the type will be laid out and we can defer completing the pointee
type until we later need it. The last type means we need a full definition for
the clang type.

Did some renaming of some enumerations to get rid of the old "DC" prefix (which
stands for DebugCore which is no longer around).

Modified the clang namespace support to be almost ready to be fed to the
expression parser. I made a new ClangNamespaceDecl class that can carry around
the AST and the namespace decl so we can copy it into the expression AST. I
modified the symbol vendor and symbol file plug-ins to use this new class.

llvm-svn: 118976
2010-11-13 03:52:47 +00:00
Johnny Chen 27e50be528 Implement TODO's of using expression command to set vaiables and to verify that
they are displayed correctly.

llvm-svn: 118930
2010-11-12 21:50:28 +00:00
Jason Molenda cabd1b71c7 I'm not thrilled with how I structured this but RegisterContextLLDB
needs to use the current pc and current offset in two ways:  To 
determine which function we are currently executing, and the decide
how much of that function has executed so far.  For the former use,
we need to back up the saved pc value by one byte if we're going to
use the correct function's unwind information -- we may be executing
a CALL instruction at the end of a function and the following instruction
belongs to a new function, or we may be looking at unwind information
which only covers the call instruction and not the subsequent instruction.

But when we're talking about deciding which row of an UnwindPlan to
execute, we want to use the actual byte offset in the function, not the
byte offset - 1.

Right now RegisterContextLLDB is tracking both the "real" offset and
an "offset minus one" and different parts of the class have to know 
which one to use and they need to be updated/set in tandem.  I want
to revisit this at some point.

The second change made in looking up eh_frame information; it was
formerly done by looking for the start address of the function we
are currently executing.  But it is possible to have unwind information
for a function which only covers a small section of the function's
address range.  In which case looking up by the start pc value may not
find the eh_frame FDE.

The hand-written _sigtramp() unwind info on Mac OS X, which covers
exactly one instruction in the middle of the function, happens to
trigger both of these issues.

I still need to get the UnwindPlan runner to handle arbitrary dwarf
expressions in the FDE but there's a good chance it will be easy to
reuse the DWARFExpression class to do this.

llvm-svn: 118882
2010-11-12 05:23:10 +00:00
Sean Callanan 8c9e538384 Added a thread plan tracer that prints lines of
assembly as well as registers that changed.

llvm-svn: 118879
2010-11-12 03:22:21 +00:00
Greg Clayton 0dd2c6277a Fixed more thread suspend/resume issues.
llvm-svn: 118877
2010-11-12 02:37:39 +00:00
Jim Ingham 929937286b Added OnStart and OnEnd methods to the tracer.
llvm-svn: 118876
2010-11-12 02:30:38 +00:00
Sean Callanan c126acc1a9 Temporary extension of the timeout for Objective-C
object diagnostic expressions while we work on the
logic for handling the timeout.

llvm-svn: 118873
2010-11-12 01:49:03 +00:00
Sean Callanan 6f86aa630f Removed redundant code for object introspection.
llvm-svn: 118872
2010-11-12 01:41:35 +00:00
Sean Callanan 36695cdecd Excised a version of the low-level function calling
logic that supported calling functions with arbitrary
arguments.  We use ClangFunction for this, and the
low-level logic is only required to support one or two
pointer arguments.

llvm-svn: 118871
2010-11-12 01:37:02 +00:00
Johnny Chen 6df2cd3fbf Add information for two bugs exposed by this test file.
llvm-svn: 118869
2010-11-12 01:00:56 +00:00
Johnny Chen 99ff489086 Run commands 'expression self->str' and 'expression self->date'.
They should not fail.

llvm-svn: 118868
2010-11-12 00:55:31 +00:00
Johnny Chen 064d7f5e4e Fix the @expectedFailure usage error and add a commented out section of code to
exercise 'expression' command on namespaced variables.

llvm-svn: 118867
2010-11-12 00:50:45 +00:00
Greg Clayton 1b946bf636 Fixed an issue with the MachThread class where we might not get the initial
thread basic info state and not realize that a thread was already suspended
or if a thread was starting up and not ready to be displayed to the user
(in an uninterruptable state). If it is not user ready yet, we don't add it
to our list of threads that can be played with.

llvm-svn: 118866
2010-11-12 00:49:23 +00:00
Johnny Chen 1e57493196 Add @expectedFailure decorator for test_with_dwarf_and_run_command() test method:
rdar://problem/8659840
    test failure: ./dotest.py -v -t -f NamespaceTestCase.test_with_dwarf_and_run_command

llvm-svn: 118861
2010-11-12 00:00:15 +00:00
Johnny Chen 285371e32a The session log entry containing the command to rerun the same test now also includes
the architecture and compiler specs.

llvm-svn: 118860
2010-11-11 23:54:12 +00:00
Johnny Chen 3d57ee7b43 Add TestNamespace.py to exercise printing of anonymous and named namespace variables.
llvm-svn: 118856
2010-11-11 23:29:54 +00:00
Johnny Chen 667429d6b1 Simplify Makefile.
llvm-svn: 118851
2010-11-11 22:58:37 +00:00