Commit Graph

3784 Commits

Author SHA1 Message Date
Jason Molenda f385f12e17 Add "stepi" as an alias for thread step-inst in addition to "si".
Add "nexti" an "ni" as aliases for thread step-inst-over.

llvm-svn: 142707
2011-10-22 00:47:41 +00:00
Sean Callanan 2e2b8b844c Enabled dedicated debugger support in Clang, meaning
that Objective-C methods returning types incompatible
with "id" can be properly cast.

llvm-svn: 142702
2011-10-21 23:40:00 +00:00
Greg Clayton 7c6d7b83c1 Fixed a missing quote.
llvm-svn: 142698
2011-10-21 23:04:20 +00:00
Sean Callanan b226916528 Implemented an extension to the namespace map that
permits a namespace map to be created and populated
when the namespace is imported, not just when it is
requested via FindExternalVisibleDecls().

llvm-svn: 142690
2011-10-21 22:18:07 +00:00
Greg Clayton 596ed24e43 If a process plug-in was specified by name, always let the plug-in get used.
llvm-svn: 142688
2011-10-21 21:41:45 +00:00
Johnny Chen 31fdfb1f33 Add a benchmark for measuring the response time of the 'frame variable' command.
Example (start the lldb inferior, break at the Driver::MainLoop() function, and
issue 'frame variable'):

 $ ./dotest.py -v +b -x '-F Driver::MainLoop()' -n -p TestFrameVariableResponse.py
----------------------------------------------------------------------
Collected 1 test

1: test_startup_delay (TestFrameVariableResponse.FrameVariableResponseBench)
   Test response time for the 'frame variable' command. ... 
lldb frame variable benchmark: Avg: 1.636897 (Laps: 20, Total Elapsed Time: 32.737944)
ok

----------------------------------------------------------------------
Ran 1 test in 65.105s

OK

llvm-svn: 142678
2011-10-21 20:19:51 +00:00
Johnny Chen 99904b33b7 Rephrase benchmark output display.
llvm-svn: 142676
2011-10-21 20:11:40 +00:00
Johnny Chen 4d4363ba56 Add a '-n' option to turn off printings of build dir, lldb version, svn info, and other headers
which happen before the listingings of test cases.

llvm-svn: 142668
2011-10-21 18:33:27 +00:00
Johnny Chen f7a0062869 Fix the compilation warning while running the test case.
llvm-svn: 142663
2011-10-21 17:57:04 +00:00
Sean Callanan 8a518d5b54 Updated LLVM/Clang to pull in a variety of type
importation fixes, reducing the amount of requests
made to LLDB for unknown types and increasing 
fidelity of the expression parser.

llvm-svn: 142639
2011-10-21 05:19:47 +00:00
Sean Callanan 80c48c10d0 Made the IR interpreter more robust in the presence
of arbitrary pointers, allowing direct dereferences
of literal addresses.  Also disabled special-cased
generation of certain expression results (especially
casts), substituting the IR interpreter.

llvm-svn: 142638
2011-10-21 05:18:02 +00:00
Jim Ingham 8f07716139 Lock the Unwinder before accessing it.
llvm-svn: 142632
2011-10-21 01:49:48 +00:00
Johnny Chen edb677c3c7 Fix wrong directory name.
llvm-svn: 142629
2011-10-21 01:09:29 +00:00
Johnny Chen 7f63fdaa74 Add a benchmark for measuring start up delays of lldb, including:
o create a fresh target; and
o set the first breakpoint

Example (using lldb to set a breakpoint on lldb's Driver::MainLoop function):

./dotest.py -v +b -x '-F Driver::MainLoop()' -p TestStartupDelays.py

...

1: test_startup_delay (TestStartupDelays.StartupDelaysBench)
   Test start up delays creating a target and setting a breakpoint. ... 
lldb startup delays benchmark:
create fresh target: Avg: 0.106732 (Laps: 15, Total Elapsed Time: 1.600985)
set first breakpoint: Avg: 0.102589 (Laps: 15, Total Elapsed Time: 1.538832)
ok

llvm-svn: 142628
2011-10-20 22:37:45 +00:00
Greg Clayton 97fbc34276 Fixed some issues where we might not have one of the new apple accelerator
tables (like the .apple_namespaces) and it would cause us to index DWARF that
didn't need to be indexed.

Updated the MappedHash.h (generic Apple accelerator table) and the DWARF
specific one (HashedNameToDIE.h) to be up to date with the latest and
greatest hash table format.

llvm-svn: 142627
2011-10-20 22:30:33 +00:00
Johnny Chen ff7fc9cfa4 Breakpoint specification can have the form '-n main', so it's not a good idea to
check that the option arg in '-x opt_arg' does not start with a '-' char.

llvm-svn: 142625
2011-10-20 22:16:24 +00:00
Johnny Chen 8241d378f8 Directory renaming: example -> expression.
llvm-svn: 142602
2011-10-20 18:58:28 +00:00
Johnny Chen f4ca4b5f57 Directory renaming: example -> expression.
llvm-svn: 142601
2011-10-20 18:57:04 +00:00
Johnny Chen 38f9daa303 Parameterize the iteration count used when running benchmarks, instead of hard-coded inside the test case.
Add a '-y count' option to the test driver for this purpose.  An example:

 $  ./dotest.py -v -y 25 +b -p TestDisassembly.py

...

----------------------------------------------------------------------
Collected 2 tests

1: test_run_gdb_then_lldb (TestDisassembly.DisassembleDriverMainLoop)
   Test disassembly on a large function with lldb vs. gdb. ... 
gdb benchmark: Avg: 0.226305 (Laps: 25, Total Elapsed Time: 5.657614)
lldb benchmark: Avg: 0.113864 (Laps: 25, Total Elapsed Time: 2.846606)
lldb_avg/gdb_avg: 0.503146
ok
2: test_run_lldb_then_gdb (TestDisassembly.DisassembleDriverMainLoop)
   Test disassembly on a large function with lldb vs. gdb. ... 
lldb benchmark: Avg: 0.113008 (Laps: 25, Total Elapsed Time: 2.825201)
gdb benchmark: Avg: 0.225240 (Laps: 25, Total Elapsed Time: 5.631001)
lldb_avg/gdb_avg: 0.501723
ok

----------------------------------------------------------------------
Ran 2 tests in 41.346s

OK

llvm-svn: 142598
2011-10-20 18:43:28 +00:00
Johnny Chen 5a328cc8c6 Remove stale code.
llvm-svn: 142595
2011-10-20 17:49:44 +00:00
Johnny Chen 29b3f6b616 Remove stale code.
llvm-svn: 142594
2011-10-20 17:45:39 +00:00
Johnny Chen 2a6eab04b1 Up until now, we have been using pexpect to spawn an lldb process and use lldb commands to
bring the debugger to the desired state.

This patch makes BenchBase inherit from TestBase, instead of Base (which is a parent class of
TestBase).  This is so that we can also enjoy the Pythonic way of bringing the lldb debugger
to a desired state before running the benchmark and collect statistics.

llvm-svn: 142562
2011-10-20 01:35:57 +00:00
Greg Clayton 64bc6ca595 Modified the ASTDumper to return a "const char *" instead of a copy of the
std::string and modified all places that used the std::string it returned
to use the "const char *".

Also modified the expression parser to not crash when a function type fails
to copy into the expression AST context.

llvm-svn: 142561
2011-10-20 00:47:21 +00:00
Johnny Chen c54de2ca54 Missed this file when doing r142543 to temporarily relax the expected substrings for watchpoint creation output.
llvm-svn: 142549
2011-10-19 22:17:06 +00:00
Johnny Chen d72b178a45 Temporarily relax the expected substrings for watchpoint creation output
due a bug in the decl file info of a global variable emitted by clang.

llvm-svn: 142543
2011-10-19 20:51:28 +00:00
Greg Clayton 81c22f6104 Moved lldb::user_id_t values to be 64 bit. This was going to be needed for
process IDs, and thread IDs, but was mainly needed for for the UserID's for
Types so that DWARF with debug map can work flawlessly. With DWARF in .o files
the type ID was the DIE offset in the DWARF for the .o file which is not
unique across all .o files, so now the SymbolFileDWARFDebugMap class will
make the .o file index part (the high 32 bits) of the unique type identifier
so it can uniquely identify the types.

llvm-svn: 142534
2011-10-19 18:09:39 +00:00
Johnny Chen 2a80858903 Modify lldbtest.Base.runHooks() to now take the following keyword arguments:
child=None, child_prompt=None, use_cmd_api=False

By default, expect a pexpect spawned child and child prompt to be
supplied (use_cmd_api=False).  If use_cmd_api is true, ignore the child
and child prompt and use self.runCmd() to run the hooks one by one.

Modify existing client to reflect the change.

llvm-svn: 142532
2011-10-19 16:48:07 +00:00
Johnny Chen a737ba55af Extract the run hooks functionality into the base class lldbtest.Base.
llvm-svn: 142469
2011-10-19 01:06:21 +00:00
Greg Clayton 85ae2e1349 Changed lldb_private::Type over to use the intrusive ref counted pointers
so we don't have to lookup types in a type list by ID.

Changed the DWARF parser to remove the "can externally complete myself" bits
from the type when we are in the process of completing the type itself to
avoid an onslaught of external visible decl requests from the 
clang::ExternalASTSource.

llvm-svn: 142461
2011-10-18 23:36:41 +00:00
Johnny Chen f5df537d26 Fix build under gcc.
Patch from Dawn.

llvm-svn: 142402
2011-10-18 19:28:30 +00:00
Johnny Chen 85ced807f5 Add docstrings for SetCondition() and GetCondition() APIs.
llvm-svn: 142396
2011-10-18 19:13:06 +00:00
Johnny Chen 9e320909f5 Remove stale comment.
llvm-svn: 142392
2011-10-18 18:33:33 +00:00
Johnny Chen 7d97b1c274 Modify the help text for watching a variable or its pointee.
llvm-svn: 142391
2011-10-18 18:31:06 +00:00
Johnny Chen 0d5f2d425a This patch fixes debugging of single threaded apps on Linux.
It also adds some asserts and additional logging support.

from dawn@burble.org

llvm-svn: 142384
2011-10-18 18:09:30 +00:00
Sean Callanan 80a3f3c8a9 Removed some debug support I accidentally
committed.

llvm-svn: 142376
2011-10-18 17:45:25 +00:00
Sean Callanan 35c7f98734 Improved logging, replacing the old ASTDumper (which
we never used) with a much simpler class that wraps
the relevant dump functions in Clang.  This class also
knows to disable external lookups on DeclContexts
being dumped so it should be safe to print incomplete
Decls.

llvm-svn: 142359
2011-10-18 16:46:55 +00:00
Jason Molenda e858e33200 Add code to RegisterContextLLDB::InitializeNonZerothFrame to detect a multiple stack frames
with the same CFA (or an alternating sequence between two CFA values) to catch a handful of
unwind cases where lldb will inf loop trying to unwind a stack.

llvm-svn: 142331
2011-10-18 02:57:27 +00:00
Johnny Chen fc79b400b2 This patch alloows lldb to build under GCC.
from dawn@burble.org

llvm-svn: 142305
2011-10-17 23:18:19 +00:00
Johnny Chen 9df05592f0 Add test cases for setting condition on a watchpoint for both command and API.
llvm-svn: 142291
2011-10-17 22:17:47 +00:00
Enrico Granata a9dbf4325e this patch introduces a new command script import command which takes as input a filename for a Python script and imports the module contained in that file. the containing directory is added to the Python path such that dependencies are honored. also, the module may contain an __lldb_init_module(debugger,dict) function, which gets called after importing, and which can somehow initialize the module's interaction with lldb
llvm-svn: 142283
2011-10-17 21:45:27 +00:00
Johnny Chen 9c7b04cb26 Rename test file.
llvm-svn: 142242
2011-10-17 20:28:39 +00:00
Johnny Chen 8289e36506 Fix wrong docstring.
llvm-svn: 142241
2011-10-17 20:26:07 +00:00
Johnny Chen 16dcf718d3 Add a commnad to set a condition for a watchpoint. Example:
watchpoint modify -c 'global==5'

modifies the last created watchpoint so that the condition expression
is evaluated at the stop point to decide whether we should proceed with
the stopping.

Also add SBWatchpont::SetCondition(const char *condition) to set condition
programmatically.

Test cases to come later.

llvm-svn: 142227
2011-10-17 18:58:00 +00:00
Sean Callanan 6d9f5db468 Handled the call operator properly.
llvm-svn: 142033
2011-10-15 01:15:07 +00:00
Jim Ingham a5ce6c88f9 Make "next" and "step-out" work when in stepping over or out of inlined functions.
llvm-svn: 142031
2011-10-15 00:57:28 +00:00
Jim Ingham c4c9fedc72 Make the step range plans capable of supporting multiple ranges. Also make their constructors public, there isn't any good reason why you shouldn't be able to make these plans.
llvm-svn: 142026
2011-10-15 00:24:48 +00:00
Jim Ingham 10c4b249fc Make the "log enable lldb-step" output easier to parse.
llvm-svn: 142025
2011-10-15 00:23:43 +00:00
Jim Ingham 37cfeab3c0 Quiet the default "log enable lldb step" output down a little bit.
llvm-svn: 142024
2011-10-15 00:21:37 +00:00
Greg Clayton 147e1fa298 Add function decls to their parent decl context.
llvm-svn: 142011
2011-10-14 22:47:18 +00:00
Sean Callanan 4b4f9b40fa Added a buildbot script that automatically checks
out the latest LLDB, LLVM and Clang and makes sure
they work okay together.  The buildbot is currently
Mac OS X only because it uses xcodebuild.

Right now, the portion that runs the LLDB test
suite is commented out because of code-signing
problems (specifically, on Mac OS 10.7 a UI dialog
appears asking for the user's permission to attach
to the inferior process).

You can use the buildbot like this:

./scripts/buildbot.py -b /tmp/lldb-build -l /tmp/lldb.log

/tmp/lldb-build and /tmp/lldb.log should not exist
when the script is run.

/tmp/lldb-build is a temporary directory and is
removed at the end of a normal execution.

/tmp/lldb.log is a log file that sticks around.

The buildbot does not require built versions of anything;
it will do the building itself.

llvm-svn: 142006
2011-10-14 21:43:51 +00:00
Greg Clayton 030a204664 Make sure we create only unique one namespace per AST when parsing the DWARF.
llvm-svn: 142005
2011-10-14 21:34:45 +00:00
Sean Callanan 7dd9812675 Improved expression logging. Now all calls to
FindExternalVisibleDecls and FindExternalLexicalDecls
are marked and given unique IDs, so that all logging
done as part of their execution can be traced back to
the proper call.

Also there was some logging that really wasn't helpful
in most cases so I disabled it unless verbose logging
(log enable -v lldb expr) is enabled.

llvm-svn: 141987
2011-10-14 20:34:21 +00:00
Johnny Chen ed456eb0a9 Add SBWatchpoint::GetError() API, which is not currently populated as yet.
llvm-svn: 141979
2011-10-14 19:15:48 +00:00
Johnny Chen 6283f4b67a Remove debug 'print watchpoint' statement.
llvm-svn: 141965
2011-10-14 18:10:00 +00:00
Johnny Chen fc807f84ed Rename directory command_python to command_script, and the test file, too.
llvm-svn: 141963
2011-10-14 17:37:38 +00:00
Greg Clayton 5a31471e72 Added the ability to run expressions in any command. Expressions can be
inserted in commands by using backticks:

(lldb) memory read `$rsp-16` `$rsp+16`
(lldb) memory read  -c `(int)strlen(argv[0])` `argv[0]`

The result of the expression will be inserted into the command as a sort of
preprocess stage where this gets done first. We might need to tweak where this
preprocess stage goes, but it is very functional already.

Added ansi color support to the Debugger::FormatPrompt() so you can use things
like "${ansi.fg.blue}" and "${ansi.bold}" many more. This helps in adding 
colors to your prompts without needing to know the ANSI color code strings.

llvm-svn: 141948
2011-10-14 07:41:33 +00:00
Johnny Chen f5be9e3759 Add a test case to exercise the newly added SB API:
lldb::SBWatchpoint
SBTarget::WatchAddress (lldb::addr_t addr, size_t size, bool read, bool write)

llvm-svn: 141931
2011-10-14 01:16:39 +00:00
Sean Callanan 187de46132 Improved logging for FindExternalLexicalDecls to
make it easier to track down which members belong
to which structs (and which call to 
FindExternalLexicalDecls is doing the reporting).

llvm-svn: 141930
2011-10-14 01:15:27 +00:00
Johnny Chen 4c3e140247 Fix wrong docstring with respect to API usage.
llvm-svn: 141928
2011-10-14 00:56:28 +00:00
Johnny Chen 01a678603a SBValue::Watch() and SBValue::WatchPointee() are now the official API for creating
a watchpoint for either the variable encapsulated by SBValue (Watch) or the pointee
encapsulated by SBValue (WatchPointee).

Removed SBFrame::WatchValue() and SBFrame::WatchLocation() API as a result of that.

Modified the watchpoint related test suite to reflect the change.

Plus replacing WatchpointLocation with Watchpoint throughout the code base.

There are still cleanups to be dome.  This patch passes the whole test suite.
Check it in so that we aggressively catch regressions.

llvm-svn: 141925
2011-10-14 00:42:25 +00:00
Greg Clayton cb5860a70b Modified the DWARF parser to take care of a 1 clang::DeclContext to many
DIEs. Prior to this fix, there was a 1 to 1 mapping.

llvm-svn: 141917
2011-10-13 23:49:28 +00:00
Greg Clayton 20568dd981 Fixed a case where we might end up trying to parse a type in the DWARF parser for a method whose class isn't currently in the process of completing itself. Currently, methods of a class, must be parsed when the class type that contains the method is asked to complete itself through the clang::ExternalASTSource virtual functions. Now we "do the right thing" by checking if the class is being defined, and if so we parse it, else we tell the class to complete itself so everything happens correctly.
llvm-svn: 141908
2011-10-13 23:13:20 +00:00
Sean Callanan c6bba3e46d Cleaned up a few functions that never get used.
Specifically, the expression parser used to use
functions attached to SymbolContext to do lookups,
but nowadays it searches a ModuleList or Module
directly instead.  These functions had no
remaining clients so I removed them to prevent
bit rot.

I also removed a stray callback function from
ClangExpressionDeclMap.

llvm-svn: 141899
2011-10-13 22:18:56 +00:00
Sean Callanan ebe6067a8c Enabled the namespace-specific search functionality,
which had previously been commented out while I tested
it.  It's not fully working yet, but it doesn't break
our testsuite and it's an important piece of
functionality.

Also added some logging to SymbolFileDWARF to help
diagnose entities that are found in a symbol file,
but do not reside in the expected namespace.

llvm-svn: 141894
2011-10-13 21:50:33 +00:00
Sean Callanan c41e68b127 Moved the list of found namespaces into the search
context object.  Having it populated and registered
within a single FindExternalVisibleDecls call worked
fine when there was only one call (i.e., when we were
just looking in the global namespace).  

However, now FindExternalVisibleDecls is called for
nested namespaces as well, which means that it is
called not once but many times (once per module in
which the parent namespace appears).  This means that
the namespace mapping is built up across many calls
to the inferior FindExternalVisibleDecls, so I moved
it into a data structure (the search context) that is
shared by all calls.

I also added some logging to make it easier to see
what is happening during a namespace search, and 
cleaned up some existing logging.

llvm-svn: 141888
2011-10-13 21:08:11 +00:00
Greg Clayton 2a14f17a65 Revert the change to "target variable" that was causing test suite failures.
llvm-svn: 141879
2011-10-13 18:31:02 +00:00
Greg Clayton 1b282f9619 Cleaned up the SBWatchpoint public API.
llvm-svn: 141876
2011-10-13 18:08:26 +00:00
Sean Callanan b96ff33b0e Removed namespace qualification from symbol queries.
llvm-svn: 141866
2011-10-13 16:49:47 +00:00
Sean Callanan 213fdb8bf6 Completed the glue that passes a ClangNamespaceDecl *
down through Module and SymbolVendor into SymbolFile.
Added checks to SymbolFileDWARF that restrict symbol
searches when a namespace is passed in.

llvm-svn: 141847
2011-10-13 01:49:10 +00:00
Johnny Chen 7596f9373a Add 'cd -' feature to change to the previous working directory.
llvm-svn: 141846
2011-10-13 01:20:34 +00:00
Greg Clayton 4f76b23764 Always use the full variable name when dumping globals since they might
be in namespaces.

llvm-svn: 141845
2011-10-13 01:14:39 +00:00
Greg Clayton aa044960b5 Add a version of ResolveFunction that takes a "const DWARFDebugInfoEntry *"
and a "DWARFCompileUnit *" to avoid doing a DIE lookup twice and to prepare
for using namespaces in the lookups.

llvm-svn: 141843
2011-10-13 00:59:38 +00:00
Sean Callanan 8e5b8b9631 Now that we know the values are going to stick around,
we don't need to look them up again when materializing.

Switched over the materialization mechanism (for JIT
expressions) and the lookup mechanism (for interpreted
expressions) to use the VariableSP/Symbol that were
found during parsing.

llvm-svn: 141839
2011-10-13 00:09:20 +00:00
Greg Clayton bfe3dd4d8b Added a function to test if a ClangNamespaceDecl matches the current symbol
file. This will help us to minimize lookups that can't possibly match anything
in the current symbol file.

llvm-svn: 141838
2011-10-13 00:00:53 +00:00
Greg Clayton 2506a7a959 Added the ability to see if a DIE is contained in a namespace.
llvm-svn: 141832
2011-10-12 23:34:26 +00:00
Johnny Chen c6d3b6e7a6 Minor fix.
llvm-svn: 141826
2011-10-12 22:25:13 +00:00
Johnny Chen 4ffde88b42 Add pointer to the examples/customization directory for examples of lldb customizations.
llvm-svn: 141823
2011-10-12 22:22:09 +00:00
Sean Callanan e3aef1d063 Extended the lifetime of Clang parser objects to the
lifetime of ClangExpressionDeclMap.  This allows
ClangExpressionVariables found during parsing to be
queried for their containing namespaces during
expression execution.

Other clients (like ClangFunction) explicitly delete
this state, so they should not result in any memory
leaks.

llvm-svn: 141821
2011-10-12 22:20:02 +00:00
Johnny Chen 724e62bb4a Prepend '~' to the sys.path so that ~/utils.py takes precedence.
llvm-svn: 141817
2011-10-12 21:51:58 +00:00
Johnny Chen 7f01ac39b9 Patch by Enrico to provide an example of 'import' commnad for importing .py/.pyc files.
llvm-svn: 141810
2011-10-12 20:47:04 +00:00
Sean Callanan ca4e0fd7e6 Refactoring in preparation for having multiple
calls to the FindExternalVisibleDecls function.

FindExternalVisibleDecls was recording whether
it had found generic function symbols in variables
that were local to the function.  Now, however,
multiple calls occur in response to one request
from Clang, since we may be searching across
namespaces.  To support that, I moved the local
variables into a bitfield in NameSearchContext.

llvm-svn: 141808
2011-10-12 20:29:25 +00:00
Johnny Chen de2ff3b64e Add reference to ToT/examples/customization for more customization examples.
llvm-svn: 141800
2011-10-12 19:20:04 +00:00
Johnny Chen de6ade01d0 Add an examples/customization directory and add a subdirectory pwd-cd-and-system
which contains the lldb init file and a utils.py Python module in order to add
the 'pwd', 'cd', and 'system' lldb commands.

llvm-svn: 141799
2011-10-12 19:16:06 +00:00
Sean Callanan 1a2c5386cd Made the expression parser's type search call the
proper namespace-aware APIs.

llvm-svn: 141797
2011-10-12 18:44:30 +00:00
Sean Callanan 4c3977c278 Added support to ClagnExpressionDeclMap for finding
data symbols in namespaces.

llvm-svn: 141792
2011-10-12 18:00:53 +00:00
Johnny Chen 04a101d475 Add cleanups for 'command script add' to TestCommandPython.py.
llvm-svn: 141790
2011-10-12 17:50:41 +00:00
Sean Callanan 25ea08ef8c Changed FindExternalVisibleDecls() to use the module
level FindFunctions() where appropriate and not use
SymbolContext::FindFunctionsByName().

llvm-svn: 141789
2011-10-12 17:38:09 +00:00
Sean Callanan 03267a7068 Oops, committed my local build settings. Fixed that.
llvm-svn: 141784
2011-10-12 17:08:22 +00:00
Sean Callanan 1fd3f4f14c Made FindGlobalVariable() optionally search a specific
module and namespace.  Also made it use FindGlobalVariables()
instead of the more heavyweight 
GetVariablesForVariableExpressionPath().

llvm-svn: 141783
2011-10-12 16:59:31 +00:00
Sean Callanan b6d70ebc0a Added ClangNamespaceDecl * parameters to several
core Module functions that the expression parser
will soon be using.

llvm-svn: 141766
2011-10-12 02:08:07 +00:00
Sean Callanan 8897224363 Cleanups in preparation for making FindExternalVisibleDecls
look in individual modules rather than globally.

Also some whitespace fixes.

llvm-svn: 141765
2011-10-12 01:39:28 +00:00
Johnny Chen c79eec0c18 Add description of a more capable 'cd' command using 'command script add'.
llvm-svn: 141764
2011-10-12 01:28:23 +00:00
Greg Clayton d4e2552c73 Fix preprocessor warnings for no newline at the end of the source files.
llvm-svn: 141755
2011-10-12 00:53:29 +00:00
Sean Callanan 503aa525ea Implemented a namespace map that allows searching
of namespaces (only in the modules where they've
been found) for entities inside those namespaces.

For each NamespaceDecl that has been imported into
the parser, we maintain a map containing
[ModuleSP, ClangNamespaceDecl] pairs in the ASTImporter.
This map has one entry for each module in which the
namespace has been found.  When we later scan for an
entity inside a namespace, we search only the modules
in which that namespace was found.

Also made a small whitespace fix in 
ClangExpressionParser.cpp.

llvm-svn: 141748
2011-10-12 00:12:34 +00:00
Johnny Chen 8a7f3f5bac Add a more generic stepping benchmark, which uses the '-k' option of the test driver
to be able to specify the runhook(s) to bring the debug session to a certain state
before running the benchmarking logic.  An example,

./dotest.py -v -t +b -k 'process attach -n Mail' -k 'thread backtrace all' -p TestRunHooksThenSteppings.py

spawns lldb, attaches to the 'Mail' application, does a backtrace for all threads, and then
runs the benchmark to step the inferior multiple times.

llvm-svn: 141740
2011-10-11 23:22:02 +00:00
Johnny Chen 6dcbeaeecb Patch by Dawn to add the logging capabilities to ProcessLinux.cpp.
llvm-svn: 141712
2011-10-11 21:21:57 +00:00
Johnny Chen 54cb8f83d9 Fix a typo in ProcessKDP::DidAttach().
Patch by Dawn.

llvm-svn: 141711
2011-10-11 21:17:10 +00:00
Greg Clayton 199a0bb529 Added a missing file from a previous checkin.
llvm-svn: 141707
2011-10-11 20:23:29 +00:00
Johnny Chen ef9e2ef2a5 Add documentation on providing the 'cd' and 'pwd' commands to lldb with the help of the embedded Python interpreter and
the 'command regex' command.

llvm-svn: 141698
2011-10-11 19:39:48 +00:00
Greg Clayton f324a89c25 Patch from Dragos Tatulea to re-enable the PECOFF object file parser for all
builds on all systems.

llvm-svn: 141677
2011-10-11 16:42:21 +00:00
Jim Ingham 32fc9601a1 Added some simple testcases for figuring out breakpoints by name in
classes & namespaces.

llvm-svn: 141629
2011-10-11 01:43:50 +00:00
Jim Ingham d3238352c3 Remove a debugging printf...
llvm-svn: 141627
2011-10-11 01:30:59 +00:00
Johnny Chen 999f7ab9bd Add '-k' option to the test driver to be able to specify a runhook, which is an lldb command
for the debugger to execute for certain kind of tests (for example, a benchmark).
A list of runhooks can be used to steer the debugger into the desired state before more
actions can be performed.

llvm-svn: 141626
2011-10-11 01:30:27 +00:00
Jim Ingham 2dd7f7fb71 Add a SBTarget::BreakpointCreateByName API that allows you to specify the name
type mask.

llvm-svn: 141625
2011-10-11 01:18:55 +00:00
Jim Ingham ea8005a786 Fix a couple of places in FindFunctions where I was using the passed in name_type_mask
rather than the computed effective_name_type_mask.

llvm-svn: 141624
2011-10-11 01:18:11 +00:00
Johnny Chen 541b98517e Remove test logic to check for clang and skip the rest due to insufficient debug info.
Recent changes in lldb inlining robustness seem to have fixed it.

llvm-svn: 141595
2011-10-10 23:26:54 +00:00
Johnny Chen 48d042b659 Patch from dawn@burble.org to build on linux!
llvm-svn: 141593
2011-10-10 23:11:50 +00:00
Johnny Chen a10e6c1052 Add '-e' and '-x' options to the test driver to be able to specify an executable (full path)
and the breakpoint specification for the benchmark purpose.  This is used by TestSteppingSpeed.py
to benchmark the lldb stepping speed.  Without '-e' and 'x' specified, the test defaults to
run the built lldb against itself and stopped on Driver::MainLoop, then stepping for 50 times.

rdar://problem/7511193

llvm-svn: 141584
2011-10-10 22:03:44 +00:00
Johnny Chen a319b84f6a Modify sidebar.incl and remove files to reflect r141554 change.
llvm-svn: 141556
2011-10-10 18:06:09 +00:00
Johnny Chen 7571ba7015 Remove utils/emacs directory from lldb.
llvm-svn: 141554
2011-10-10 17:58:30 +00:00
Greg Clayton 995e10ac9b Patch from Dragos Tatulea regarding typedefs with the new RangeArray template class.
llvm-svn: 141546
2011-10-10 16:33:44 +00:00
Greg Clayton 2e9f7a0f01 Remove unneeded exports.
llvm-svn: 141504
2011-10-08 22:26:32 +00:00
Greg Clayton 2215230040 Changed RangeMap over to use llvm::SmallVector and updated the RangeArray and the RangeDataArray to have an extra "unsigned N" template parameter. Updated the lldb_private::Block to use a RangeArray with a uint32_t for both the function base offset and block range size, and then a 1 for the small vector size since most lexical blocks in DWARF only have 1 range. Updates the DWARFDebugRanges RangeArray to use an unsigned of 2 since most blocks that have more than one range usually have 2. Also updated a DWARFDebugAranges to default their RangeArray to use a SmallVector with unsigned size of 1 since this will take care of the .o files when doing DWARF in .o files and since there really isn't any good size we can guess with.
llvm-svn: 141480
2011-10-08 06:59:54 +00:00
Greg Clayton 892d898605 Added some debug code that can verify that all RangeMap.h maps are sorted when needed since RangeArray and RangeDataArray instantiations depend on it. I ran the test suite with ASSERT_RANGEMAP_ARE_SORTED defined and I got no assertions, so I disabled it prior to checkin.
llvm-svn: 141478
2011-10-08 03:59:55 +00:00
Greg Clayton 2e4b5c0d9d Removed unneeded content.
llvm-svn: 141477
2011-10-08 03:53:14 +00:00
Greg Clayton e7b6681863 Started on the export table for the MappedHash.
llvm-svn: 141469
2011-10-08 01:13:27 +00:00
Jim Ingham eb6ba39033 Fix the last testsuite regression from the apple-names stuff.
llvm-svn: 141468
2011-10-08 01:11:42 +00:00
Greg Clayton ea3e7d5ccf Added more functionality to Range template classes in RangeMap.h and converted remaining DWARF areas that were using ranges over to this class. Also converted lldb_private::Block to use it.
llvm-svn: 141460
2011-10-08 00:49:15 +00:00
Sean Callanan 2590b9ac6f Fixed a memory leak of ASTResultSynthesizers,
by attaching them to the ClangExpressionParser.

llvm-svn: 141452
2011-10-08 00:21:35 +00:00
Johnny Chen a4e8baeb33 Add fuzz call for SBBreakpointLocation.GetAddress().
llvm-svn: 141443
2011-10-07 23:54:04 +00:00
Sean Callanan 880e680fa3 Updated LLVM/Clang to pull in the latest ARM disassembler.
This involved minor changes to the way we report Objective-C
methods, as well as cosmetic changes and added parameters
for a variety of Clang APIs.

llvm-svn: 141437
2011-10-07 23:18:13 +00:00
Jim Ingham e71c18dff0 Remove some commented out code.
llvm-svn: 141431
2011-10-07 22:28:49 +00:00
Jim Ingham adedc1f48b Clean up some documentation.
llvm-svn: 141430
2011-10-07 22:28:29 +00:00
Jim Ingham 1b040c157a Mention SBBreakpointLocation::GetAddress in the Python .i file.
llvm-svn: 141429
2011-10-07 22:27:25 +00:00
Jim Ingham 4cda6e058b Move the responsibility for translating the various eFunctionNameType lookups to the
SymbolFIle (it was done mostly in the BreakpointResolverName resolver before.)  Then
tailor our searches to the way the indexed maps are laid out.  This removes a bunch 
of test case failures using indexed dSYM's.

llvm-svn: 141428
2011-10-07 22:23:45 +00:00
Jim Ingham 881ec8534e When a function calculates its module, make sure it returns the "real" module, not the linked .o file.
llvm-svn: 141424
2011-10-07 22:20:35 +00:00
Jim Ingham 4a6ae0f01a Fix the option lists that "--file" belongs to so the help won't come out whonky.
llvm-svn: 141423
2011-10-07 22:17:16 +00:00
Jim Ingham f3277750df Don't look up main to find the default source file till somebody actually asks for it.
llvm-svn: 141422
2011-10-07 22:16:04 +00:00
Greg Clayton c28416d777 Removed code that was left in during testing and debugging of an issue.
llvm-svn: 141387
2011-10-07 19:26:25 +00:00
Johnny Chen ebe51726b8 If we spawn an lldb process for test (via pexpect), do not load the init file unless told otherwise.
Set up self.lldbOption to be "--no-lldbibit" unless env variable NO_LLDBIBIT is defined and equals "NO".
Also add "-nx" to gdb spawned.

llvm-svn: 141384
2011-10-07 19:21:09 +00:00
Greg Clayton cf0e4f0daf Re-organized the contents of RangeMap.h to be more concise and also allow for a Range, RangeArray, RangeData (range + data), or a RangeDataArray. We have many range implementations in LLDB and I will be converting over to using the classes in RangeMap.h so we can have one set of code that does ranges and searching of ranges.
Fixed up DWARFDebugAranges to use the new range classes.

Fixed the enumeration parsing to take a lldb_private::Error to avoid a lot of duplicated code. Now when an invalid enumeration is supplied, an error will be returned and that error will contain a list of the valid enumeration values.

llvm-svn: 141382
2011-10-07 18:58:12 +00:00
Jim Ingham de4b919d27 Turn the EvaluateExpression (..., True) tests back on.
llvm-svn: 141375
2011-10-07 18:02:54 +00:00
Greg Clayton c26e445403 Since we use address ranges a lot I added a templatized class that allows us to easily control the base address type, the size type, and the data that is stored with each range. It is designed to be populated by appending all needed items, then sorting the resulting list, and optionally minimizing the list when done. I adopted this new list in the DWARFDebugAranges for even further memory savings.
llvm-svn: 141352
2011-10-07 03:58:56 +00:00
Greg Clayton 5f4c61e2d7 <rdar://problem/10226227>
Fixed the root cause of what was causing an assertion to fire during single stepping. We had an issue with the inlined stack frames where when we had inlined frames that were not in the first concrete frame where we passed the wrong PC down. We needed to decrement the PC by one for these frames to make
sure we are using the same address that did the symbol context lookup.

llvm-svn: 141349
2011-10-07 01:52:19 +00:00
Greg Clayton f8843bf5d1 Added better logging for the case where we don't find a PC in a block.
llvm-svn: 141348
2011-10-07 01:49:45 +00:00
Johnny Chen c12ec2f600 Add a simple scenario of emacs and lldb interaction.
llvm-svn: 141347
2011-10-07 01:06:37 +00:00
Johnny Chen 1c6c43f1dc Allow the crash log file path to contain an initial tilde component.
llvm-svn: 141340
2011-10-06 23:36:00 +00:00
Greg Clayton 70a11261ac <rdar://problem/10226227>
Fixed an assertion that was causing a crash. The bug describes a case where we have an inlined block that doesn't contain the frame PC that was used to lookup the symbol context in the first place. This really shouldn't happen, so
now we log if we run into this and don't assert.

llvm-svn: 141338
2011-10-06 23:32:32 +00:00
Johnny Chen e7e4ac4d8d Simplify code to print symbols and sections within a module using the built-in iterators.
llvm-svn: 141326
2011-10-06 22:48:56 +00:00
Johnny Chen 98a49d9b77 Simplify the verbose output of WatchpointLocation::DumpWithLevel().
llvm-svn: 141307
2011-10-06 20:27:05 +00:00
Jason Molenda c25e959dee ProcessGDBRemote::BuildDynamicRegisterInfo() - even if we don't have a Target architecture
set up yet, if we're talking to an Apple arm device set the register set based on the
arm device's attributes; this is a safe assumption to make in this particular environment.

llvm-svn: 141265
2011-10-06 01:45:46 +00:00
Johnny Chen 4f09a0f855 Add a test sequence for 'target variable' command when no arguments are given.
llvm-svn: 141264
2011-10-06 01:00:53 +00:00
Greg Clayton 21f2a4919b Added a new logging channel to the DWARF called "lookups":
(lldb) log enable dwarf lookups

This allows us to see when lookups are being done on functions, addresses,
and types by both name and regular expresssion.

llvm-svn: 141259
2011-10-06 00:09:08 +00:00
Johnny Chen fad6cde32a Add a page describing the emacs integration elisp code based on the Grand Unified Debugger.
An lldb-enhanced gud.el is located under utils/emacs.

llvm-svn: 141241
2011-10-05 22:53:08 +00:00
Greg Clayton 5cf58b9ba0 Stop spurious "DW_AT_specification(0x%8.8x) has no decl" warnings that were due to not parsing the function types when the function blocks are made and parsed.
Cached the Function object's m_type value after it has been calculated.

llvm-svn: 141225
2011-10-05 22:22:08 +00:00
Greg Clayton 8dd5c17d69 Stop empty C strings in summaries from showing "<data not available>" when a
"const char *" is NULL. Also cleaned up the display of strings when you have
an array of chars that are all NULL. Previously we were showing: ""...
We now show: ""

llvm-svn: 141223
2011-10-05 22:19:51 +00:00
Greg Clayton 9a5a934051 "target variable" will now display the current frame's compile unit globals
and statics when no arguments are given. 

llvm-svn: 141222
2011-10-05 22:17:32 +00:00
Johnny Chen 6cc60e8668 Add capability to set ignore count for watchpoint on the command line:
watchpoint ignore -i <count> [<watchpt-id | watchpt-id-list>]

Add tests of watchpoint ignore_count for command line as well as API.

llvm-svn: 141217
2011-10-05 21:35:46 +00:00
Greg Clayton 252d0ede74 Fixed a crasher where the m_frames collection was being accessed without
using the mutex.

llvm-svn: 141160
2011-10-05 03:14:31 +00:00
Johnny Chen 80fdd7c0b7 Fix a problem where the stop-hook command 'frame variable g_val' produces nothing
when newly created threads were subsequently stopped due to breakpoint hit.
The stop-hook mechanism delegates to CommandInterpreter::HandleCommands() to
execuet the commands.  Make sure the execution context is switched only once
at the beginning of HandleCommands() only and don't update the context while looping
on each individual command to be executed.

rdar://problem/10228156

llvm-svn: 141144
2011-10-05 00:42:59 +00:00
Greg Clayton c396749670 Added missing file.
llvm-svn: 141130
2011-10-04 22:56:35 +00:00
Greg Clayton 7f99513e8f Enable all the new accelerator tables if they are present and don't manually
index the DWARF. Also fixed an issue with memory accelerator tables with a
size of 1 where we would loop infinitely.

Added support for parsing the new .apple_namespaces section which gives us a
memory hash table for looking up namespaces.

llvm-svn: 141128
2011-10-04 22:41:51 +00:00
Johnny Chen ced9068603 Add more docstring to the Python interface file for SBSection.
llvm-svn: 141044
2011-10-03 23:06:33 +00:00
Johnny Chen 524e4ccb49 Add fuzz call for sub-section iteration for SBSection.
llvm-svn: 141041
2011-10-03 22:43:06 +00:00
Johnny Chen 3dc26e839c Add SBSection API to the fuzz testing.
llvm-svn: 141039
2011-10-03 22:30:56 +00:00
Johnny Chen 8c3dc3d0fd Add fuzz call for watchpoint location iterator, too.
llvm-svn: 141036
2011-10-03 22:08:35 +00:00
Johnny Chen b92574ffb9 Add fuzz calls for various iterators, too.
llvm-svn: 141035
2011-10-03 22:02:59 +00:00
Johnny Chen fdce6dc19d Add comment markers for in_range(symbol, section).
llvm-svn: 141033
2011-10-03 21:48:40 +00:00
Johnny Chen 44d6d2c526 Fix regression of test SourceManagerTestCase.test_display_source_python.
llvm-svn: 141021
2011-10-03 20:56:39 +00:00
Greg Clayton 9a37766e7c Removed lldb::SBSourceManager_impl. We export everything in the lldb namespace
and this implemenation that backs our lldb::SBSourceManager should not be
exported. 

llvm-svn: 140930
2011-10-01 02:59:24 +00:00
Greg Clayton d74713b18c Bumped Xcode project version for lldb-80 and debugserver-145.
llvm-svn: 140922
2011-10-01 02:01:36 +00:00
Greg Clayton bdf3162f53 Fixed an issue where a variable whose value is in a register might end up
not saying that its children are load addresses.

llvm-svn: 140921
2011-10-01 01:53:20 +00:00
Greg Clayton cfebbcfedd Print object names in case we have a .o file in a static archive when logging
DWARF errors and warnings.

llvm-svn: 140918
2011-10-01 01:37:20 +00:00
Jason Molenda 90455f3357 Fix segfault in UniqueDWARFASTTypeList::Find if we are comparing
an anonymous struct type (which lacks any name).

llvm-svn: 140917
2011-10-01 01:28:37 +00:00
Johnny Chen b49b7b53b1 Add SBFrame.WatchLocation() to find and watch the location pointed to by
a variable usng the frame as the scope.

Add TestSetWatchpoint.py to exercise this API.  Also fix some SWIG Python
docstrings.

llvm-svn: 140914
2011-10-01 01:19:45 +00:00
Greg Clayton 1ed54f50c5 Cleaned up the the code that figures out the inlined stack frames given a
symbol context that represents an inlined function. This function has been
renamed internally to:

bool
SymbolContext::GetParentOfInlinedScope (const Address &curr_frame_pc, 
                                        SymbolContext &next_frame_sc, 
                                        Address &next_frame_pc) const;
                                        
And externally to:

SBSymbolContext
SBSymbolContext::GetParentOfInlinedScope (const SBAddress &curr_frame_pc, 
                                          SBAddress &parent_frame_addr) const;

The correct blocks are now correctly calculated.

Switched the stack backtracing engine (in StackFrameList) and the address
context printing over to using the internal SymbolContext::GetParentOfInlinedScope(...) 
so all inlined callstacks will match exactly.

llvm-svn: 140910
2011-10-01 00:45:15 +00:00
Jason Molenda f56c0137e2 Small fix to "frame select" sans frame # feature added yesterday.
llvm-svn: 140901
2011-09-30 23:12:14 +00:00
Greg Clayton 6535dae3b7 Remove the "-feliminate-unused-debug-types" OTHER_CFLAGS.
llvm-svn: 140893
2011-09-30 22:08:47 +00:00
Johnny Chen 86268e4459 o lldbtest.py:
Add a keyword argument 'endstr' to TestBase.expect() method to assert that the output
will end with 'endstr'.

Add TestBase.switch_to_thread_with_stop_reason(stop_reason) to select the thread with
the stop reason = 'stop_reason' as the current thread.

o TestWatchLocation.py:

Modified to switch to the stopped thread with stop reason = watchpoint and to evaluate
an expression with expected output for stronger assertion.

llvm-svn: 140890
2011-09-30 21:48:35 +00:00
Greg Clayton 0bd4e1b8c9 Removed some commented out code from the DWARF parser.
Also reduce the size of the lldb_private::Symbol objects by removing the
lldb_private::Function pointer that was in each symbol. Running Instruments
has shown that when debugging large applications with DWARF in .o files that
lldb_private::Symbol objects are one of the highest users of memory. No one
was using the Symbol::GetFunction() call anyway.

llvm-svn: 140881
2011-09-30 20:52:25 +00:00
Greg Clayton 3360b411a5 Destroy a target when it is deleted.
llvm-svn: 140845
2011-09-30 04:14:52 +00:00
Greg Clayton 753406221b After deleting a target, clear the target object and remove orphaned modules.
llvm-svn: 140843
2011-09-30 03:29:05 +00:00
Greg Clayton 2bc22f83ad <rdar://problem/10212450>
Don't parse function types all the time, only parse them lazily.

llvm-svn: 140842
2011-09-30 03:20:47 +00:00
Johnny Chen b62a3be1a2 Add an accompanying option to the 'frame variable -w' command to, instead of watching the variable,
watch the location pointed to by the variable.  An example,

(lldb) frame variable -w write -x 1 -g g_char_ptr
(char *) g_char_ptr = 0x0000000100100860 ""...
Watchpoint created: WatchpointLocation 1: addr = 0x100100860 size = 1 state = enabled type = w
    declare @ '/Volumes/data/lldb/svn/trunk/test/functionalities/watchpoint/hello_watchlocation/main.cpp:21'

...

(lldb) c
Process 3936 resuming

...

rocess 3936 stopped
* thread #2: tid = 0x3403, 0x00000001000009b7 a.out`do_bad_thing_with_location(char*, char) + 23 at main.cpp:27, stop reason = watchpoint 1
    frame #0: 0x00000001000009b7 a.out`do_bad_thing_with_location(char*, char) + 23 at main.cpp:27
   24  	do_bad_thing_with_location(char *char_ptr, char new_val)
   25  	{
   26  	    *char_ptr = new_val;
-> 27  	}
   28  	
   29  	uint32_t access_pool (uint32_t flag = 0);
   30  	
(lldb) 

Also add TestWatchLocation.py test to exercise this functionality.

llvm-svn: 140836
2011-09-30 01:08:48 +00:00
Jim Ingham 2af4db5835 Remember to mark the OptionValueUUID as set in SetOptionValue.
llvm-svn: 140835
2011-09-30 01:05:23 +00:00
Johnny Chen 97b5083cd6 Add docstring to in_range() function residing in the lldb module.
llvm-svn: 140833
2011-09-30 00:49:02 +00:00
Johnny Chen 1887fce184 Fix extraneous import as a result of the last change.
llvm-svn: 140832
2011-09-30 00:46:24 +00:00
Johnny Chen c44e20cec0 Migrate the in_range(symbol, section) and symbol_iter(module, section) utility functions
from lldbutil.py to the lldb.py proper.  The in_range() function becomes a function in
the lldb module.  And the symbol_iter() function becomes a method within the SBModule
called symbol_in_section_iter().  Example:

        # Iterates the text section and prints each symbols within each sub-section.
        for subsec in text_sec:
            print INDENT + repr(subsec)
            for sym in exe_module.symbol_in_section_iter(subsec):
                print INDENT2 + repr(sym)
                print INDENT2 + 'symbol type: %s' % symbol_type_to_str(sym.GetType())

might produce this following output:

    [0x0000000100001780-0x0000000100001d5c) a.out.__TEXT.__text
        id = {0x00000004}, name = 'mask_access(MaskAction, unsigned int)', range = [0x00000001000017c0-0x0000000100001870)
        symbol type: code
        id = {0x00000008}, name = 'thread_func(void*)', range = [0x0000000100001870-0x00000001000019b0)
        symbol type: code
        id = {0x0000000c}, name = 'main', range = [0x00000001000019b0-0x0000000100001d5c)
        symbol type: code
        id = {0x00000023}, name = 'start', address = 0x0000000100001780
        symbol type: code
    [0x0000000100001d5c-0x0000000100001da4) a.out.__TEXT.__stubs
        id = {0x00000024}, name = '__stack_chk_fail', range = [0x0000000100001d5c-0x0000000100001d62)
        symbol type: trampoline
        id = {0x00000028}, name = 'exit', range = [0x0000000100001d62-0x0000000100001d68)
        symbol type: trampoline
        id = {0x00000029}, name = 'fflush', range = [0x0000000100001d68-0x0000000100001d6e)
        symbol type: trampoline
        id = {0x0000002a}, name = 'fgets', range = [0x0000000100001d6e-0x0000000100001d74)
        symbol type: trampoline
        id = {0x0000002b}, name = 'printf', range = [0x0000000100001d74-0x0000000100001d7a)
        symbol type: trampoline
        id = {0x0000002c}, name = 'pthread_create', range = [0x0000000100001d7a-0x0000000100001d80)
        symbol type: trampoline
        id = {0x0000002d}, name = 'pthread_join', range = [0x0000000100001d80-0x0000000100001d86)
        symbol type: trampoline
        id = {0x0000002e}, name = 'pthread_mutex_lock', range = [0x0000000100001d86-0x0000000100001d8c)
        symbol type: trampoline
        id = {0x0000002f}, name = 'pthread_mutex_unlock', range = [0x0000000100001d8c-0x0000000100001d92)
        symbol type: trampoline
        id = {0x00000030}, name = 'rand', range = [0x0000000100001d92-0x0000000100001d98)
        symbol type: trampoline
        id = {0x00000031}, name = 'strtoul', range = [0x0000000100001d98-0x0000000100001d9e)
        symbol type: trampoline
        id = {0x00000032}, name = 'usleep', range = [0x0000000100001d9e-0x0000000100001da4)
        symbol type: trampoline
    [0x0000000100001da4-0x0000000100001e2c) a.out.__TEXT.__stub_helper
    [0x0000000100001e2c-0x0000000100001f10) a.out.__TEXT.__cstring
    [0x0000000100001f10-0x0000000100001f68) a.out.__TEXT.__unwind_info
    [0x0000000100001f68-0x0000000100001ff8) a.out.__TEXT.__eh_frame

llvm-svn: 140830
2011-09-30 00:42:49 +00:00
Greg Clayton 6c7f56192f Fixed an issue where a lexical block or inlined function might have bad debug
information generated for it. Say we have a concrete function "foo" which
has inlined function "a" which calls another inlined function "b":

    foo
1   {
2       {
            a ()
3           {
                b ()
4               {
                
                }
            }
        }
    }
    
Sometimes we see the compiler generate an address range in the DWARF for "foo"
(block 1 above) as say [0x1000-0x1100). Then the range for "a" is something
like [0x1050-0x1060) (note that it is correctly scoped within the "foo" 
address range). And then we get "b" which is a child of "a", yet the debug
info says it has a range of [0x1060-0x1080) (not contained within "a"). We now
detect this issue when making our blocks and add an extra range to "a".

Also added a new "lldb" logging category named "symbol" where we can find out
about symbol file errors and warnings.

llvm-svn: 140822
2011-09-29 23:41:34 +00:00
Jason Molenda 82d4a2b91f Add an additional "frame select" usage where it will re-select the current frame
if no frame is specified.  This is useful to get the source context lines re-displayed
when you need a reminder of where you are in the source currently.

llvm-svn: 140819
2011-09-29 23:02:41 +00:00
Jason Molenda 560183fd2d Fix verbose logging of unwinders.
llvm-svn: 140817
2011-09-29 22:34:41 +00:00
Jim Ingham c1663048e0 Centralize the warning reporting and use ReportWarning & ReportError everywhere we were using fprintf(stderr directly.
llvm-svn: 140813
2011-09-29 22:12:35 +00:00
Johnny Chen a9b68f4dd6 Modify the delegation chain from MachThreadList -> MachThread -> DNBArchProtocol so that when
the watchpoint state is changed, not only does the change propagate to all the thread instances,
it also updates a global debug state, if chosen by the DNBArchProtocol derivative.

Once implemented, the DNBArchProtocol derivative, also makes sure that when new thread comes along,
it tries to inherit from the global debug state, if it is valid.

Modify TestWatchpointMultipleThreads.py to test this functionality.

llvm-svn: 140811
2011-09-29 21:48:52 +00:00
Greg Clayton 624784a987 Free up some space in lldb_private::Block by not requiring a sibling pointer.
The old way of storing blocks used to use the sibling pointer, but now all
blocks contain a collection of shared pointers to blocks so this isn't required
anymore and a parent can be asked to find the sibling block for a child block.

llvm-svn: 140808
2011-09-29 21:19:25 +00:00
Jim Ingham 6626447929 Missed one place where we should use the target's SourceManager, not the debugger's.
llvm-svn: 140804
2011-09-29 20:22:33 +00:00
Greg Clayton 4d01ace4fd If the new .apple_names and .apple_types DWARF accelerator tables
are available, we currently will still index the DWARF ourselves
and assert if the name lookups differ. This will help us transition
to the new accelerator tables and make sure they are workng before
we switch over entirely.

llvm-svn: 140788
2011-09-29 16:58:15 +00:00
Johnny Chen 825ea37835 Fix a bug in the current MacOSX MachThreadList::EnableHardwareWatchpoint() impl so that
it enables the hardware watchpoint for all existing threads.  Add a test file for that.
Also fix MachThreadList::DisableHardwareWatchpoint().

llvm-svn: 140757
2011-09-29 01:20:42 +00:00
Greg Clayton 2ed2b6bb44 Found a great optimization after speaking with Sean Callanan which cleans
up the implementation details of the on disk hash, these changed implement
the changes in the on disk table format.

llvm-svn: 140750
2011-09-29 00:58:11 +00:00
Johnny Chen 586e8ea46f Fix help string for "frame variable".
llvm-svn: 140714
2011-09-28 19:41:18 +00:00
Johnny Chen c0f53df8ff Modify lldbutil.in_range(symbol, section) to deal with the symbol whose
end address is an LLDB_INVALID_ADDRESS.  Modify the test case to dump
all the symbols in all the sections.

llvm-svn: 140710
2011-09-28 18:33:50 +00:00
Greg Clayton 1767440a72 Convert over to the latest and greatest on disc accelerator
hash tables. Renamed the DWARF sections to ".apple_names" and
".apple_types" until we get more buy in from other vendors.

llvm-svn: 140702
2011-09-28 17:06:40 +00:00
Johnny Chen a32a13d207 Add a test sequence of iterating through a module's symbols belonging to a section.
Add the relevant utility functions to the lldbutil.py file.

llvm-svn: 140669
2011-09-28 00:51:00 +00:00
Jim Ingham 32adcb2e8f Need to go to the containing inline block to get the inline name right.
llvm-svn: 140662
2011-09-27 23:59:35 +00:00
Johnny Chen b2c7825515 Add a simple test TestModuleAndSection.py to exercise some module/section-related APIs.
In particular, it iterates through the executable module's SBSections, looking for the
'__TEXT' section and further iterates on its subsections (of SBSection type, too).

llvm-svn: 140654
2011-09-27 23:15:58 +00:00
Johnny Chen 0f2ed0e5df Make the assignment of TestBase.mydir more portable.
llvm-svn: 140640
2011-09-27 21:49:34 +00:00
Johnny Chen 469683e98d SBWatchpointLocation.GetDescription() takes an additional description level arg.
Modify get_description() utility function in lldbutil.py to handle that.

llvm-svn: 140638
2011-09-27 21:27:19 +00:00
Johnny Chen 9d954d8665 Add SBTarget::GetLastCreatedWatchpointLocation() API and export to the Python interface.
Also add rich comparison methods (__eq__ and __ne__) for SBWatchpointLocation.
Modify TestWatchpointLocationIter.py to exercise the new APIs.

Add fuzz testings for the recently added SBTarget APIs related to watchpoint manipulations.

llvm-svn: 140633
2011-09-27 20:29:45 +00:00
Johnny Chen 4e6a4fa899 Add fuzz testing for newly added SBWatchpointLocation API.
llvm-svn: 140632
2011-09-27 20:23:43 +00:00
Jim Ingham 530a413c7b Added an API to SymbolContext to hide the complexity of getting the
function name from a symbol context.  Use that in CommandCompletions
to get the right name.

llvm-svn: 140628
2011-09-27 19:48:20 +00:00
Greg Clayton e241bad92b Enable the following CFLAGS in the Xcode project build:
-flimit-debug-info -feliminate-unused-debug-types -Wparentheses

This helps to trim down the debug information size a bit by omitting types
that aren't used.

llvm-svn: 140611
2011-09-27 17:26:03 +00:00