Commit Graph

609 Commits

Author SHA1 Message Date
Sean Callanan 10af7c430a Re-enabled LLDB's pointer checkers, and moved the
implementation of the Objective-C object checkers
into the Objective-C language runtime.

llvm-svn: 118226
2010-11-04 01:51:38 +00:00
Jason Molenda 5976200d43 Handle the case where no eh_frame section is present.
RegisterContextLLDB holds a reference to the SymbolContext
in the vector of Cursors that UnwindLLDB maintains.  Switch
UnwindLLDB to hold a vector of shared pointers of Cursors
so this reference doesn't become invalid.

Correctly falling back from the "fast" UnwindPlan to the
"full" UnwindPlan when additional registers need to be
retrieved.

llvm-svn: 118218
2010-11-04 00:53:20 +00:00
Sean Callanan f211510ff6 Factored the code that implements breakpoints on
exceptions for different languages out of 
ThreadPlanCallFunction and put it into the 
appropriate language runtimes.

llvm-svn: 118200
2010-11-03 22:19:38 +00:00
Sean Callanan c98aca605f Modified ThreadPlanCallFunction to perform the
exception checks at the right time, and modified
ClangFunction so that it doesn't misinterpret the
stop as a timeout stop.

llvm-svn: 118189
2010-11-03 19:36:28 +00:00
Greg Clayton 6ba508507e Fixed shared library unloads when the unloaded library doesn't come off
the end of the list. We had an issue in the MacOSX dynamic loader where if
we had shlibs:
1 - a.out
2 - a.dylib
3 - b.dylib

And then a.dylib got unloaded, we would unload b.dylib due to the assumption
that only shared libraries could come off the end of the list. We now properly
search and find which ones get loaded.

Added a new internal logging category for the "lldb" log channel named "dyld".
This should allow all dynamic loaders to use this as a generic log channel so
we can track shared library loads and unloads in the logs without having to 
have each plug-in make up its own logging channel.

llvm-svn: 118147
2010-11-03 04:08:06 +00:00
Sean Callanan 6db73ca5e2 Modified the thread plan that calls functions to
set breakpoints at the different locations where
an exception could be thrown, so that exceptions
thrown by expressions are properly caught.

llvm-svn: 118142
2010-11-03 01:37:52 +00:00
Sean Callanan 951f6ce903 Fixed a bug where we left a definition hanging
for a global variable that we had replaced with
a reference to a slot in the input array.

llvm-svn: 118123
2010-11-02 23:51:17 +00:00
Sean Callanan c2afd25ea1 Fixed a bug that was confusing the code generator
on i386 platforms, leading to crashes on simple
expressions.

llvm-svn: 118114
2010-11-02 23:20:00 +00:00
Greg Clayton df797c12e7 Fixed a case where children of pointers or references that had had multiple
children always incorrectly displayed the child at offset zero.

llvm-svn: 118070
2010-11-02 21:21:20 +00:00
Caroline Tice f415eeb4d3 Fix error message when attempting to generate invalid alias.
llvm-svn: 118036
2010-11-02 19:00:04 +00:00
Greg Clayton 3bcbf84235 Fixed a missing newline when you type "apropos somethingthatdoesnotexist".
llvm-svn: 118033
2010-11-02 18:23:13 +00:00
Caroline Tice 5d7be2e617 Fix problem where "process detach" was not working properly. The
ptrace thread update that was replying to the SIGSTOP was also causing the
process to not really be sigstop'd any more so then the call to ptrace
detach was failing, and when debugserver exited the attached process
was being killed.  Now the ptrace thread update does not disturb the sigstop
state of the thread, so the detach works properly.

llvm-svn: 118018
2010-11-02 16:16:53 +00:00
Greg Clayton 19de37f730 Fixed cases where we were translating "long long" types to use the "long"
types when they are the same size. The new code will use the correct type 
now when converting DWARF built-in types into clang types.

llvm-svn: 118003
2010-11-02 03:48:39 +00:00
Greg Clayton 2856d46252 Fixed the default file and line breakpoints to include inlined breakpoints.
llvm-svn: 118002
2010-11-02 03:02:38 +00:00
Greg Clayton 315d2cab27 Fixed our overly verbose stop reasons which by default included the thread
name and thread queue. Users can modify the thread-format strings to add these
back if needed.

llvm-svn: 118000
2010-11-02 01:53:21 +00:00
Greg Clayton 7c8a966442 Print better error messages when memory reads fail when displaying variable
values.

Always show the variable types for the top level items when dumping program
variables.

llvm-svn: 117999
2010-11-02 01:50:16 +00:00
Sean Callanan 53078294ed Improved logging and cleaned up a redundant return
statement.  Now when ClangExpressionDeclMap returns
a variable for a name, it pretty-prints that
variable to the log instead of printing a (fairly
useless) NamedDecl pointer.

llvm-svn: 117972
2010-11-01 23:22:47 +00:00
Greg Clayton 4b3dc10e65 Fixed globals not showing up for any but the first compile unit due to a
mismatch: I was using the compile unit user ID (the compile unit offset in
the DWARF) as the compile unit index.

llvm-svn: 117948
2010-11-01 20:32:12 +00:00
Sean Callanan 57bbc6ecc6 Print notes for expressions as well as errors
and warnings.

llvm-svn: 117947
2010-11-01 20:28:09 +00:00
Sean Callanan 7c0962dc89 Fixed StackFrame::GetVariableList to add global
variables to the list of found variables if they
have not yet been added.

llvm-svn: 117896
2010-11-01 04:38:59 +00:00
Greg Clayton 38adbbb88b Fixed an include so case sensitive builders can build.
llvm-svn: 117864
2010-10-31 19:57:43 +00:00
Greg Clayton cfd1aced7e Cleaned up the API logging a lot more to reduce redundant information and
keep the file size a bit smaller.

Exposed SBValue::GetExpressionPath() so SBValue users can get an expression
path for their values.

llvm-svn: 117851
2010-10-31 03:01:06 +00:00
Greg Clayton 92ef573550 Fixed the copy constructor for SBThread.
llvm-svn: 117825
2010-10-30 18:26:59 +00:00
Greg Clayton 4838131baf Improved API logging.
llvm-svn: 117772
2010-10-30 04:51:46 +00:00
Sean Callanan 5a477cfd90 Added a hack that allows expressions to ignore
Objective-C member accessibility restrictions.
Ultimately Clang should have a flag that ignores
accessibility for Objective-C like it has one
for C++.

llvm-svn: 117768
2010-10-30 01:56:10 +00:00
Sean Callanan 0d546439b9 Using proper Objective-C types doesn't seem to
make the sky fall.

llvm-svn: 117767
2010-10-30 01:46:19 +00:00
Johnny Chen 2a9177c3de These two casts are up casts, no need to use dynamic_cast.
llvm-svn: 117725
2010-10-29 22:18:43 +00:00
Caroline Tice 7149fab4d3 Update arguments & help information for "log disable" command.
llvm-svn: 117717
2010-10-29 21:56:41 +00:00
Caroline Tice eec5877a31 Missed a file in my last commit.
llvm-svn: 117716
2010-10-29 21:49:29 +00:00
Caroline Tice 20ad3c40f4 Add the ability to disable individual log categories, rather
than just the entire log channel.

Add checks, where appropriate, to make sure a log channel/category has 
not been disabled before attempting to write to it.

llvm-svn: 117715
2010-10-29 21:48:37 +00:00
Sean Callanan e35831a23c Overloading is not broken any more. No need for
an #ifndef.

llvm-svn: 117706
2010-10-29 20:30:26 +00:00
Johnny Chen dabefd0120 ClangUserExpression ctor should not crash if given a null expr_prefix char*.
llvm-svn: 117700
2010-10-29 20:19:44 +00:00
Johnny Chen 8ceb8ba2fb The r117616 check in broken these two test cases:
1. FoundationDisassembleTestCase.test_simple_disasm_with_dsym; and
2. FoundationDisassembleTestCase.test_simple_disasm_with_dwarf

the reason being the test was issuing 'disassemble' command to disassemble the current
frame function when stopped.  The 'disassemble' command worked previously but it was a
result of bad option specification.

Fix the disassemble command so that it will require 'disassemble -f' for disassembly of
the current frame function.

llvm-svn: 117688
2010-10-29 19:33:40 +00:00
Sean Callanan 31e851c9f3 Updated LLVM to latest version as of 10/28 at
7pm, and made minor integration fixes.

llvm-svn: 117680
2010-10-29 18:38:40 +00:00
Greg Clayton 93aa84e83b Modified the lldb_private::TypeList to use a std::multimap for quicker lookup
by type ID (the most common type of type lookup).

Changed the API logging a bit to always show the objects in the OBJECT(POINTER)
format so it will be easy to locate all instances of an object or references
to it when looking at logs.

llvm-svn: 117641
2010-10-29 04:59:35 +00:00
Sean Callanan 322f529b37 Added a user-settable variable, 'target.expr-prefix',
which holds the name of a file whose contents are
prefixed to each expression.  For example, if the file
~/lldb.prefix.header contains:

typedef unsigned short my_type;

then you can do this:

(lldb) settings set target.expr-prefix '~/lldb.prefix.header'
(lldb) expr sizeof(my_type)
(unsigned long) $0 = 2

When the variable is changed, the corresponding file
is loaded and its contents are fetched into a string
that is stored along with the target.  This string
is then passed to each expression and inserted into
it during parsing, like this:

typedef unsigned short my_type;
                             
void                           
$__lldb_expr(void *$__lldb_arg)          
{                              
    sizeof(my_type);                        
}

llvm-svn: 117627
2010-10-29 00:29:03 +00:00
Caroline Tice e79417951b Add alias information, including aliased command options &
arguments, to help text for alias commands.

llvm-svn: 117617
2010-10-28 23:17:48 +00:00
Caroline Tice dbaf18361e Comment out uninmplemented command option (-f) for disassemble
command.

llvm-svn: 117616
2010-10-28 22:19:36 +00:00
Caroline Tice 3cc8751d59 Remove references to particular Python version (use the system default
version);  change include statements to use Python.h in the Python framework
on Mac OS X systems; leave it using regular Python.h on other systems.

Note:  I think this *ought* to work properly on Linux systems, but I don't have
a system to test it on...

llvm-svn: 117612
2010-10-28 21:51:20 +00:00
Sean Callanan 48ae719dc5 Explicatory comment for folks that may not be
familiar with the ownership relationships
involving Diagnostic.

llvm-svn: 117573
2010-10-28 18:43:33 +00:00
Sean Callanan fb8b7098a1 Logging fixes. Added a simple class to handle
logging for type importing, making errors much
easier to diagnose.  Also removed some Objective-C
related logging.

llvm-svn: 117568
2010-10-28 18:19:36 +00:00
Johnny Chen b7234e4014 Check in an initial implementation of the "breakpoint clear" command, whose purpose is clear
the breakpoint associated with the (filename, line_number) combo when an arrow is pointing to
a source position using Emacs Grand Unified Debugger library to interact with lldb.

The current implmentation is insufficient in that it only asks the breakpoint whether it is
associated with a breakpoint resolver with FileLine type and whether it matches the (filename, line_number)
combo.  There are other breakpoint resolver types whose breakpoint locations can potentially
match the (filename, line_number) combo.

The BreakpointResolver, BreakpointResolverName, BreakpointResolverAddress, and BreakpointResolverFileLine
classes have extra static classof methods to support LLVM style type inquiry through isa, cast, and dyn_cast.

The Breakpoint class has an API method bool GetMatchingFileLine(...) which is invoked from CommandObjectBreak.cpp
to implement the "breakpoint clear" command.

llvm-svn: 117562
2010-10-28 17:27:46 +00:00
Caroline Tice be484f413d Add warning if no actual locations were resolved when attempting
to set a breakpoint.

llvm-svn: 117555
2010-10-28 16:28:56 +00:00
Greg Clayton bcf1217e28 Fixed the "frame variable -G NAME" that would print global
variables by name. It was accidentally getting all the globals
for the compile unit that contained the global variable named
NAME.

llvm-svn: 117516
2010-10-28 00:56:11 +00:00
Jim Ingham 517b3b21ca Replace unnecessary dynamic_cast with static_cast.
llvm-svn: 117503
2010-10-27 22:58:34 +00:00
Caroline Tice 7d54a2e8d5 Make SBFrame::GetDescription a little more descriptive.
llvm-svn: 117497
2010-10-27 22:07:28 +00:00
Caroline Tice 7b9da4a550 Fix bugs attempting to write to API log after it has been
disabled.

llvm-svn: 117493
2010-10-27 21:23:37 +00:00
Caroline Tice 04a339a084 Flush the prompts immediately in the breakpoint command input readers, to make
sure they come out at the correct times.

llvm-svn: 117470
2010-10-27 18:34:42 +00:00
Greg Clayton 90f90cdae1 Don't include the ":" character when building the selector identifiers
when making objective C classes from the DWARF.

llvm-svn: 117438
2010-10-27 04:01:14 +00:00
Greg Clayton 73b472d42a Updated the lldb_private::Flags class to have better method names and made
all of the calls inlined in the header file for better performance.

Fixed the summary for C string types (array of chars (with any combo if
modifiers), and pointers to chars) work in all cases.

Fixed an issue where a forward declaration to a clang type could cause itself
to resolve itself more than once if, during the resolving of the type itself
it caused something to try and resolve itself again. We now remove the clang
type from the forward declaration map in the DWARF parser when we start to 
resolve it and avoid this additional call. This should stop any duplicate
members from appearing and throwing all the alignment of structs, unions and
classes.

llvm-svn: 117437
2010-10-27 03:32:59 +00:00