Commit Graph

928 Commits

Author SHA1 Message Date
Greg Clayton e02b850483 Modified the "breakpoint set --name NAME" to be the auto breakpoint set
function. It will inspect NAME and do the following:
- if the name contains '(' or starts with "-[" or "+[" then a full name search
  will happen to match full function names with args (C++ demangled names) or
  full objective C method prototypes.
- if the name contains "::" and no '(', then it is assumed to be a qualified
  function name that is in a namespace or class. For "foo::bar::baz" we will
  search for any functions with the basename or method name of "baz", then
  filter the results to only those that contain "foo::bar::baz". This allows
  setting breakpoint on C++ functions and methods without having to fully
  qualify all of the types that would appear in C++ mangled names.
- if the name contains ":" (not "::"), then NAME is assumed to be an ObjC
  selector.
_ otherwise, we assume just a plain function basename.

Now that "--name" is our "auto" mode, I introduced the new "--basename" option
("breakpoint set --basename NAME") to allow for function names that aren't 
methods or selectors, just basenames. This can also be used to ignore C++
namespaces and class hierarchies for class methods.

Fixed clang enumeration promotion types to be correct.

llvm-svn: 116293
2010-10-12 04:29:14 +00:00
Greg Clayton 450e3f3c77 Fixed the Objective C method prototypes to be correct (the selectors weren't
being chopped up correctly). The DWARF plug-in also keeps a map of the ObjC
class names to selectors for easy parsing of all class selectors when we parse
the class type.

llvm-svn: 116290
2010-10-12 02:24:53 +00:00
Johnny Chen cd9b7779f3 Avoid using hardcoded line number to break on. Use the line_number() utility
function to get the line number to break on during setUp().

llvm-svn: 116275
2010-10-12 00:09:25 +00:00
Jim Ingham 30f9b21bf4 Add a way to temporarily divert events from a broadcaster to a private listener.
llvm-svn: 116271
2010-10-11 23:53:14 +00:00
Johnny Chen 47ceb03210 Add a utility function to lldbtest.py to return the line number of a matched string
within a file.  This is to be used within the test case to avoid hardcoded line number.

array_types/TestArrayTypes.py is modified first to use this pattern.  Other test modules
to follow.

rdar://problem/8537816
Testsuite: don't set breakpoints by exact file & line number

llvm-svn: 116270
2010-10-11 23:52:19 +00:00
Johnny Chen 707b3c9c73 Added the capability for the test driver to relocate the tests and the intermediate
files to a different top level directory than those specified on the command line.

When relocated, the test clanups normally performed afterwards after each test method
and after each test class will not be exercised at all.  This allows for an easier
postmortem analysis of test failures.

Example:

./dotest.py -v -t -r /tmp/lldbtest types

will create a /tmp/lldbtest directory which houses the types directory and its supported
files.

Files modified:

o dotest.py, lldbtest.py:

  Add logic to process '-r dir' option to support relocating the tests to a different
  top level directory instead of exected in place.

o darwin.py, test/types/Makefile:

  The 'make clean' should only clean the minimum .o and .d files.

llvm-svn: 116255
2010-10-11 22:25:46 +00:00
Johnny Chen afef640a9a Help text modification.
llvm-svn: 116206
2010-10-11 16:19:48 +00:00
Greg Clayton aaf99e04ca Fixed an issue where objc types weren't ever getting fully resolved (beyond
forward declarations).

llvm-svn: 116181
2010-10-11 02:25:34 +00:00
Greg Clayton e46dd32b69 Exit if the command line is started with "--help".
llvm-svn: 116180
2010-10-11 01:13:37 +00:00
Greg Clayton 6eee5aa067 Added a "--no-lldbinit" option (-n for short (which magically matches
what gdb uses)) so we can tell our "lldb" driver program to not automatically
parse any .lldbinit files. 

llvm-svn: 116179
2010-10-11 01:05:37 +00:00
Greg Clayton 46747022d2 Added the ability to get error strings back from failed
lldb_private::RegularExpression compiles and matches with:

    size_t
    RegularExpression::GetErrorAsCString (char *err_str, 
                                          size_t err_str_max_len) const;
    
Added the ability to search a variable list for variables whose names match
a regular expression:

    size_t
    VariableList::AppendVariablesIfUnique (const RegularExpression& regex, 
                                           VariableList &var_list, 
                                           size_t& total_matches);


Also added the ability to append a variable to a VariableList only if it is 
not already in the list:

    bool
    VariableList::AddVariableIfUnique (const lldb::VariableSP &var_sp);

Cleaned up the "frame variable" command:
- Removed the "-n NAME" option as this is the default way for the command to
  work.
- Enable uniqued regex searches on variable names by fixing the "--regex RE"
  command to work correctly. It will match all variables that match any
  regular expressions and only print each variable the first time it matches.
- Fixed the option type for the "--regex" command to by eArgTypeRegularExpression
  instead of eArgTypeCount

llvm-svn: 116178
2010-10-10 23:55:27 +00:00
Greg Clayton 864174e100 Added a new test case to test signals with.
Added frame relative frame selection to "frame select". You can now select
frames relative to the current frame (which defaults to zero if the current
frame hasn't yet been set for a thread):

The gdb "up" command can be done as:
(lldb) frame select -r 1
The gdb "down" command can be done as:
(lldb) frame select -r -1

Place the following in your ~/.lldbinit file for "up" and "down":

command alias up frame select -r 1
command alias down frame select -r -1

llvm-svn: 116176
2010-10-10 22:28:11 +00:00
Greg Clayton 222f5700c2 Plugged memory leak.
llvm-svn: 116175
2010-10-10 22:07:18 +00:00
Greg Clayton 6d7e77b9dc Added new options to memory read to allow saving memory to disk
as binary bytes or as an ASCII text dump. 
- The output file is specified with the  "--outfile FILE" option.
- The memory can be appended to an existing file using the "--append" option. 
- The memory will be written as an ASCII text dump by default, or as 
  binary with the "--binary" option. 

Added new options to memory write to allow writing all or part of
a file on disk to target memory:
- The input file is specified using the "--infile FILE" option
- The offset at which to start in the file defaults to zero, but
  can be overridden using the "--offset OFFSET" option. If the
  size is not specified, the remaining number of bytes in the file
  will be used as the default byte size.
- The number of bytes to write defaults to the entire file byte
  size, but can be changed with the "--size COUNT" option.
 

llvm-svn: 116172
2010-10-10 20:52:20 +00:00
Johnny Chen 493b526bf7 Simplify the generator adaptor to a Python function instead of a class definition,
with the function name 'lldb_iter'.  Example:

def disassemble_instructions (insts):
    from lldbutil import lldb_iter
    for i in lldb_iter(insts, 'GetSize', 'GetInstructionAtIndex'):
        print i

llvm-svn: 116171
2010-10-10 20:25:10 +00:00
Greg Clayton 237cd90620 Fixed process.gdb-remote to be able to properly propagate the signals and
obey the UnixSignals table that we have in the process.

llvm-svn: 116139
2010-10-09 01:40:57 +00:00
Johnny Chen f4de10d290 Add a generator adaptor class named 'Iterator' which turns lldb aggregate data
structures into an iterable Python object.

Example:

    def disassemble_instructions (insts):
        from lldbutil import Iterator
        for i in Iterator(insts, 'GetSize', 'GetInstructionAtIndex'):
            print i

llvm-svn: 116137
2010-10-09 01:31:09 +00:00
Greg Clayton b7c046248c Fixed a missing space when using the "apropos" command and you don't find any matches.
llvm-svn: 116133
2010-10-09 00:51:35 +00:00
Greg Clayton 74f6e9f523 Fixed a typo from my previous "Added support for LC_LOAD_UPWARD_DYLIB in mach-o files".
llvm-svn: 116132
2010-10-09 00:48:53 +00:00
Greg Clayton f9f78e3aae Added support for LC_LOAD_UPWARD_DYLIB in mach-o files.
llvm-svn: 116128
2010-10-09 00:16:01 +00:00
Johnny Chen 701edc1546 Minor change.
llvm-svn: 116127
2010-10-09 00:15:46 +00:00
Johnny Chen bfde8dc627 Update do_conditional_break() method impl to use all lldb Python APIs.
llvm-svn: 116117
2010-10-08 22:51:03 +00:00
Johnny Chen 277c8f0f1d Wrap the rest of file reading operations inside a with block and convert a assertTrue()
usage to self.expect() which is more descriptive.

llvm-svn: 116115
2010-10-08 22:10:42 +00:00
Johnny Chen e6acf35582 Emit a diagnostic message instead of crashing when an argument entry is missing.
llvm-svn: 116114
2010-10-08 22:01:52 +00:00
Johnny Chen be7da21d33 Convert two instances of assertTrue() and string matching usages to self.expect()
which is more descriptive.  And wrap the file open operation inside a with block
so that close() is automatically called upon exiting the block.

llvm-svn: 116096
2010-10-08 20:01:03 +00:00
Johnny Chen 65045f2168 o TestStdCXXDisassembly.py:
Update the expected match string.

o lldbtest.py:

  Indicate when a command fails, even if there is nothing in the error stream.

o TestHelp.py:

  Add a regression test case for 'help image dump symtab'.

o CommandObjectHelp.cpp:

  Some of the logic branches with successful help command results were not tagged
  with a Success Status.  They are fixed now.  This is important for Python
  interaction.

llvm-svn: 116062
2010-10-08 17:21:27 +00:00
Johnny Chen e5e2b0c307 Fixed a crasher when doing 'help image dump symtab'. Supply the entry to the global arguments table.
llvm-svn: 116058
2010-10-08 16:36:25 +00:00
Greg Clayton 8087ca2160 Added mutex protection to the Symtab class.
Added a new SortOrder enumeration and hooked it up to the "image dump symtab"
command so we can dump symbol tables in the original order, sorted by address, 
or sorted by name.

llvm-svn: 116049
2010-10-08 04:20:14 +00:00
Sean Callanan 6b1b95376f Added extra logging, and made sure that the argument
struct for expressions is deallocated when the
ClangExpressionDeclMap is taken down.

llvm-svn: 116028
2010-10-08 01:58:41 +00:00
Johnny Chen 06b89fe646 Pass '-f' option to rm command so that it won't report an error if the file to
be removed does not exist for any reason.

llvm-svn: 116025
2010-10-08 00:50:36 +00:00
Johnny Chen 138532af06 The expected term-width output string should be put within a list, not as a list of characters.
Also uncomment the cleanup of "stdout.txt" file as part of the class cleanup routine even though
test_set_output_path() is failing right now.

llvm-svn: 116023
2010-10-08 00:47:30 +00:00
Greg Clayton 09f2265eac Bumped versions to lldb-26 and debugserver-114 for a build.
llvm-svn: 116019
2010-10-08 00:23:57 +00:00
Greg Clayton 8941142af8 Hooked up ability to look up data symbols so they show up in disassembly
if the address comes from a data section. 

Fixed an issue that could occur when looking up a symbol that has a zero
byte size where no match would be returned even if there was an exact symbol
match.

Cleaned up the section dump output and added the section type into the output.

llvm-svn: 116017
2010-10-08 00:21:05 +00:00
Sean Callanan 5c67a628b0 Fixed a launching issue.
llvm-svn: 115999
2010-10-07 22:51:14 +00:00
Johnny Chen 28ae29420a Move the enum to string utility functions from lldbtest.py to lldbuti.py and
update the affected API clients.

llvm-svn: 115995
2010-10-07 22:15:58 +00:00
Greg Clayton 68f4b4f2a2 Make sure to lock down the sequence mutex and select the thread we want when read or write all registers.
llvm-svn: 115992
2010-10-07 22:06:19 +00:00
Johnny Chen 7ea9aee9be Add a test case which uses the SBProcess and SBThread APIs to iterate through
the threads and print their stack traces when stopped on a breakpoint.

Add a PrintStackTraces(process) utility function into the lldbutil.py module.

llvm-svn: 115983
2010-10-07 21:38:28 +00:00
Johnny Chen 6c70499030 Add a keyword argument string_buffer (with a default value of False) to the
PrintStackTrace(thread) function.  If string_buffer is True, PrintStackTrace()
will return the content of the stack trace as a string, instead.

llvm-svn: 115960
2010-10-07 18:52:48 +00:00
Johnny Chen 28f5dd8525 Minor cleanup with added comment.
llvm-svn: 115955
2010-10-07 18:49:04 +00:00
Sean Callanan 4451136102 Changed the timeout for expressions from 10
milliseconds to 10 seconds, which was the
original intent.

llvm-svn: 115942
2010-10-07 18:17:31 +00:00
Greg Clayton c6ed542c90 More SWIG cleanup. Moved the breakpoint callback function back to the
ScriptInterpreterPython class and made a simple callback function that
ScriptInterpreterPython::BreakpointCallbackFunction() now calls so we don't
include any internal API stuff into the cpp file that is generated by SWIG.

Fixed a few build warnings in debugserver.

llvm-svn: 115926
2010-10-07 17:14:24 +00:00
Johnny Chen c5b06ebe82 Clean up the StateType and StopReason enums now that they reside in the lldb module.
llvm-svn: 115922
2010-10-07 16:51:56 +00:00
Johnny Chen 9ac4482d78 Updated expected match strings because the print representations of SBProcess, SBThread, SBBreakpoint, and SBFrame have changed.
llvm-svn: 115918
2010-10-07 16:23:37 +00:00
Johnny Chen b792cc1d50 Use the updated process launch API.
llvm-svn: 115917
2010-10-07 16:06:12 +00:00
Johnny Chen fbfba899a6 Fix logic error of the option processing loop.
llvm-svn: 115916
2010-10-07 15:41:55 +00:00
Greg Clayton 05faeb7135 Cleaned up the SWIG stuff so all includes happen as they should, no pulling
tricks to get types to resolve. I did this by correctly including the correct
files: stdint.h and all lldb-*.h files first before including the API files.
This allowed me to remove all of the hacks that were in the lldb.swig file
and it also allows all of the #defines in lldb-defines.h and enumerations
in lldb-enumerations.h to appear in the lldb.py module. This will make the
python script code a lot more readable.

Cleaned up the "process launch" command to not execute a "process continue"
command, it now just does what it should have with the internal API calls
instead of executing another command line command.

Made the lldb_private::Process set the state to launching and attaching if
WillLaunch/WillAttach return no error respectively.

llvm-svn: 115902
2010-10-07 04:19:01 +00:00
Johnny Chen 0ed37c9615 o SBtarget.cpp/.h:
Temporarily commenting out the deprecated LaunchProcess() method.
  SWIG is not able to handle the overloaded functions.

o dotest.py/lldbtest.py:

  Add an '-w' option to insert some wait time between consecutive test cases.

o TestClassTypes.py:

  Make the breakpoint_creation_by_filespec_python() test method more robust and
  more descriptive by printing out a more insightful assert message.

o lldb.swig: Coaches swig to treat StateType as an int type, instead of a C++ class.

llvm-svn: 115899
2010-10-07 02:04:14 +00:00
Greg Clayton 524e60b4e4 Expose the error contained within an SBValue.
Move anything that creates a new process into SBTarget. Marked some functions
as deprecated. I will remove them after our new API changes make it through
a build cycle.

llvm-svn: 115854
2010-10-06 22:10:17 +00:00
Johnny Chen 56e6cbdaf0 Enhance the test driver with a '-f filterspec' option to specify the
testclass.testmethod to be run and with a '-g' option which instructs the test
driver to only admit the module which satisfy the filterspec condition to the
test suite.

Example:

# This only runs the test case under the array_types directory which has class
# name of 'ArrayTypesTestCase' and the test method name of 'test_with_dwarf_and_run_command'.

/Volumes/data/lldb/svn/trunk/test $ ./dotest.py -v -f 'ArrayTypesTestCase.test_with_dwarf_and_run_command' -g array_types
----------------------------------------------------------------------
Collected 1 test

test_with_dwarf_and_run_command (TestArrayTypes.ArrayTypesTestCase)
Test 'frame variable var_name' on some variables with array types. ... ok

----------------------------------------------------------------------
Ran 1 test in 1.353s

OK

# And this runs the test cases under the array_types and the hello_world directories.
# If the module discovered has the 'ArrayTypesTestCase.test_with_dwarf_and_run_command'
# attribute, only the test case specified by the filterspec for the module will be run.
# If the module does not have the said attribute, e.g., the module under hello_world,
# the whole module is still admitted to the test suite.

/Volumes/data/lldb/svn/trunk/test $ ./dotest.py -v -f 'ArrayTypesTestCase.test_with_dwarf_and_run_command' array_types hello_world
----------------------------------------------------------------------
Collected 3 tests

test_with_dwarf_and_run_command (TestArrayTypes.ArrayTypesTestCase)
Test 'frame variable var_name' on some variables with array types. ... ok
test_with_dsym_and_run_command (TestHelloWorld.HelloWorldTestCase)
Create target, breakpoint, launch a process, and then kill it. ... ok
test_with_dwarf_and_process_launch_api (TestHelloWorld.HelloWorldTestCase)
Create target, breakpoint, launch a process, and then kill it. ... ok

----------------------------------------------------------------------
Ran 3 tests in 4.964s

OK

llvm-svn: 115832
2010-10-06 20:40:56 +00:00
Johnny Chen 2bdb0575ab Remove the @expectedFailure decorator since the SBTarget.LaunchProcess() race
condition has been fixed.

llvm-svn: 115826
2010-10-06 20:13:28 +00:00
Johnny Chen 1a5d93d589 Use the SBTarget process launch API for api testings.
llvm-svn: 115822
2010-10-06 20:03:28 +00:00
Johnny Chen 2c2d69dff5 Change the regular expression used to grok the data type associated the output of
expression parser in light of the recent check ins.

Example:
    runCmd: expr a
    output: (double) $0 = 1100.12

llvm-svn: 115821
2010-10-06 20:00:48 +00:00
Johnny Chen bcbb69856d Change the expected term-width output string to be a substring instead of a startstring
for the test case test_set_term_width() after the recent changes.

llvm-svn: 115820
2010-10-06 19:42:37 +00:00
Johnny Chen 77d8fa362b Modification of the expected start strings for simple 'expr' output involving persistent variables.
llvm-svn: 115819
2010-10-06 19:38:08 +00:00
Johnny Chen 7731457ac9 Modification of the expected pattern for 'expr this->m_c_int' output.
llvm-svn: 115818
2010-10-06 19:32:50 +00:00
Greg Clayton b4fb2a991c Leaving in deprecated functions until we can get a clean build with the new APIs in place before removing the deprecated functions.
llvm-svn: 115815
2010-10-06 18:44:26 +00:00
Johnny Chen df2dc0f6f2 Modification of the expected substrings for the print representations of SBProcess and SBThread.
llvm-svn: 115804
2010-10-06 18:16:19 +00:00
Greg Clayton cf4f56c4cb Fixed a few issues with the example script.
llvm-svn: 115801
2010-10-06 17:33:30 +00:00
Greg Clayton 5d5028b54e Added the first of hopefully many python example scripts that show how to
use the python API that is exposed through SWIG to do some cool stuff.

Also fixed synchronous debugging so that all process control APIs exposed
through the python API will now wait for the process to stop if you set
the async mode to false (see disasm.py).

llvm-svn: 115738
2010-10-06 03:53:16 +00:00
Greg Clayton 1d27316606 Added the ability to get the disassembly instructions from the function and
symbol.

llvm-svn: 115734
2010-10-06 03:09:58 +00:00
Greg Clayton 32c4085ba2 Restored the ability to set the format for expressions after changing the expression results over to ValueObjectSP objects.
llvm-svn: 115733
2010-10-06 03:09:11 +00:00
Greg Clayton f4abd0db15 Fixed an issue with the mach-o file parser when parsing indirect symbol stubs
where the symbol index was set to INDIRECT_SYMBOL_ABS and was causing an
assertion to fire when we loaded older Mac OS X binaries.

llvm-svn: 115729
2010-10-06 01:26:32 +00:00
Sean Callanan 2ab40fecf6 Updated the expression parser to ignore non-external
functions it finds in libraries unless it cannot find
an external function with the desired name.

llvm-svn: 115721
2010-10-06 00:10:07 +00:00
Johnny Chen 36e40a8449 Modified to accomodate gcc, llvm-gcc, and clang as compilers.
Add a comment for 'breakpoint set -M C' not working correctly for clang.

llvm-svn: 115712
2010-10-05 23:15:41 +00:00
Sean Callanan 85a0a83a26 Added handling for external variables in function
arguments to the expression parser.  This means that
structs can be returned from the "expr" command.

llvm-svn: 115698
2010-10-05 22:26:43 +00:00
Sean Callanan f4b9bd3e74 Added support for (de)materializing values in registers,
so that expressions can use them.

llvm-svn: 115658
2010-10-05 20:18:48 +00:00
Johnny Chen 1d4cc2f06c Add a test class to call lldb 'disassemble -n function' command on each call frame when stopped on C's ctor.
This is not a long running test so it shall always be exercised.

llvm-svn: 115653
2010-10-05 19:34:06 +00:00
Johnny Chen 67af43f04f Make the test module with unique name instead of just the generic name TestDisassembly.
Add a utility function to lldbtest.py to get the native pointer size of the host os.

llvm-svn: 115652
2010-10-05 19:27:32 +00:00
Johnny Chen 68e37439a9 Filename renamings.
llvm-svn: 115636
2010-10-05 17:34:07 +00:00
Greg Clayton b71f384455 Added the notion that a value object can be constant by adding:
bool ValueObject::GetIsConstant() const;
    void ValueObject::SetIsConstant();

This will stop anything from being re-evaluated within the value object so
that constant result value objects can maintain their frozen values without
anything being updated or changed within the value object.

Made it so the ValueObjectConstResult can be constructed with an 
lldb_private::Error object to allow for expression results to have errors.

Since ValueObject objects contain error objects, I changed the expression
evaluation in ClangUserExpression from 

    static Error
    ClangUserExpression::Evaluate (ExecutionContext &exe_ctx, 
                                  const char *expr_cstr, 
                                  lldb::ValueObjectSP &result_valobj_sp);

to:

    static lldb::ValueObjectSP
    Evaluate (ExecutionContext &exe_ctx, const char *expr_cstr);
    
Even though expression parsing is borked right now (pending fixes coming from
Sean Callanan), I filled in the implementation for:
    
    SBValue SBFrame::EvaluateExpression (const char *expr);
    
Modified all expression code to deal with the above changes.

llvm-svn: 115589
2010-10-05 03:13:51 +00:00
Greg Clayton 0184f01936 Moved expression evaluation from CommandObjectExpression into
ClangUserExpression::Evaluate () as a public static function so anyone can
evaluate an expression.

llvm-svn: 115581
2010-10-05 00:31:29 +00:00
Johnny Chen 57e5efa2e3 Move two files to the 'attic'.
llvm-svn: 115579
2010-10-05 00:08:08 +00:00
Greg Clayton 1d3afba3a3 Added a new ValueObject type that will be used to freeze dry expression
results. The clang opaque type for the expression result will be added to the
Target's ASTContext, and the bytes will be stored in a DataBuffer inside
the new object. The class is named: ValueObjectConstResult

Now after an expression is evaluated, we can get a ValueObjectSP back that
contains a ValueObjectConstResult object.

Relocated the value object dumping code into a static function within
the ValueObject class instead of being in the CommandObjectFrame.cpp file
which is what contained the code to dump variables ("frame variables").

llvm-svn: 115578
2010-10-05 00:00:42 +00:00
Johnny Chen bb5f078ce0 Do 'disassemble -s start_addr -e end_addr' on stdc++ library function entries.
llvm-svn: 115574
2010-10-04 23:03:34 +00:00
Jim Ingham 3bcdb29cab Add an "auto-confirm" setting to the debugger so you can turn off the confirmations if you want to.
llvm-svn: 115572
2010-10-04 22:44:14 +00:00
Caroline Tice 405fe67f14 Modify existing commands with arguments to use the new argument mechanism
(for standardized argument names, argument help, etc.)

llvm-svn: 115570
2010-10-04 22:28:36 +00:00
Chris Lattner 69d23282b4 Use the LLVM Macho.h header instead of relying on the system one,
patch by Arvid Picciani!

llvm-svn: 115563
2010-10-04 21:24:01 +00:00
Jim Ingham 97a6dc7e16 Add a "Confirm" function to the CommandInterpreter so you can confirm potentially dangerous operations in a generic way.
llvm-svn: 115546
2010-10-04 19:49:29 +00:00
Jim Ingham 4b9395ca82 Have to friend SBFrame or it can't make symbols for the frame.
llvm-svn: 115543
2010-10-04 19:38:50 +00:00
Johnny Chen fe9f456291 Initial version of a test case meant to disassemble each and every function from
the stdc++ library module.  Right now, it doesn't do any disassembly at all.  It
merely locates the stdc++ library.  Also tests the SBProcess object description
and verifies it is in a 'Stopped' state.

llvm-svn: 115536
2010-10-04 18:39:14 +00:00
Greg Clayton 3b06557e4f Added GetSymbol to the frame.
llvm-svn: 115535
2010-10-04 18:37:52 +00:00
Greg Clayton 0d9c993401 Fixed and issue where we weren't seeing inlined functions anymore. We also now show the correct pc-offset within the inlined function.
llvm-svn: 115522
2010-10-04 17:26:49 +00:00
Greg Clayton cf4b9078f2 Added file and line back to the default thread format.
llvm-svn: 115519
2010-10-04 17:04:23 +00:00
Johnny Chen 262d619be7 Remove file:lineno from the expected substrings. Matching 'a_function, i.e.,
the {function.name}, is sufficient for this test case.

Plus added @expectedfailure decorator for a filed bug.

llvm-svn: 115517
2010-10-04 16:58:16 +00:00
Johnny Chen f32a446bc8 Remove file:lineno from the expected substrings. Matching 'a.out`string_not_empty', i.e.,
${module.file.basename}{`${function.name}, is sufficient for this test case.

llvm-svn: 115514
2010-10-04 16:38:12 +00:00
Johnny Chen 33e1313a01 The 'thread list' command no longer displays the file:lineno after the recent check-in.
Remove file:lineno from the expected substrings.

llvm-svn: 115512
2010-10-04 16:23:16 +00:00
Greg Clayton 7a98e5b4e5 Clarified some caveats for thread format strings.
llvm-svn: 115491
2010-10-04 03:06:05 +00:00
Greg Clayton bb562b13db Fixed an issue with the default frame format settings string where if a frame
was stopped in a module, yet had no valid function for the PC, no module would
be displayed.

llvm-svn: 115490
2010-10-04 02:44:26 +00:00
Greg Clayton 877b59dc9c Added documentation for the new frame and thread format strings.
llvm-svn: 115488
2010-10-04 02:33:45 +00:00
Greg Clayton 0603aa9dc8 There are now to new "settings set" variables that live in each debugger
instance:

settings set frame-format <string>
settings set thread-format <string>

This allows users to control the information that is seen when dumping
threads and frames. The default values are set such that they do what they
used to do prior to changing over the the user defined formats.

This allows users with terminals that can display color to make different
items different colors using the escape control codes. A few alias examples
that will colorize your thread and frame prompts are:

settings set frame-format 'frame #${frame.index}: \033[0;33m${frame.pc}\033[0m{ \033[1;4;36m${module.file.basename}\033[0;36m ${function.name}{${function.pc-offset}}\033[0m}{ \033[0;35mat \033[1;35m${line.file.basename}:${line.number}}\033[0m\n'

settings set thread-format 'thread #${thread.index}: \033[1;33mtid\033[0;33m = ${thread.id}\033[0m{, \033[0;33m${frame.pc}\033[0m}{ \033[1;4;36m${module.file.basename}\033[0;36m ${function.name}{${function.pc-offset}}\033[0m}{, \033[1;35mstop reason\033[0;35m = ${thread.stop-reason}\033[0m}{, \033[1;36mname = \033[0;36m${thread.name}\033[0m}{, \033[1;32mqueue = \033[0;32m${thread.queue}}\033[0m\n'

A quick web search for "colorize terminal output" should allow you to see what
you can do to make your output look like you want it.

The "settings set" commands above can of course be added to your ~/.lldbinit
file for permanent use.

Changed the pure virtual 
    void ExecutionContextScope::Calculate (ExecutionContext&);
To:
    void ExecutionContextScope::CalculateExecutionContext (ExecutionContext&);
    
I did this because this is a class that anything in the execution context
heirarchy inherits from and "target->Calculate (exe_ctx)" didn't always tell
you what it was really trying to do unless you look at the parameter.

llvm-svn: 115485
2010-10-04 01:05:56 +00:00
Johnny Chen 2f71831ceb Remove the @skip() and @expectedFaiure decorators, the previously affected tests
have now all passed.

rdar://problem/8502549 and rdar://problem/8493023 are fixed

llvm-svn: 115399
2010-10-02 01:46:20 +00:00
Greg Clayton 90a2acd441 One final patch for all of this class constructor, destructor, and conversion
operator naming stuff. We now get the constructor and destructor names right
after passing in the type, and we get the correct conversion operator name
after passing in the return type when getting the DeclarationNameInfo.

llvm-svn: 115398
2010-10-02 01:40:05 +00:00
Johnny Chen 1e190a552f Use a more robust regexp to search for the 'Code' symbol. Plus compile the
regexp once and use it within the for loop for some speedup.

llvm-svn: 115397
2010-10-02 01:23:40 +00:00
Sean Callanan 9c5fe130e1 Update to the latest Clang, which fixes a problem
with importing class/struct types.

llvm-svn: 115394
2010-10-02 01:07:50 +00:00
Johnny Chen 7fce877aa5 I committed too fast. Both "struct objc_selector *" and "SEL" are possible,
depending on the compiler used.  Former if gcc/llvm-gcc, and latter if clang.

llvm-svn: 115380
2010-10-01 23:34:28 +00:00
Johnny Chen 9eaa69699a Updated the expected match string when stopped on an objc instance method from:
ARG: (struct objc_selector *) _cmd

to

    ARG: (SEL) _cmd

The change most likely resulted from an update from the llvm tot with a newer clang.

llvm-svn: 115372
2010-10-01 23:21:20 +00:00
Greg Clayton a3c444ac23 Get the declaration names for C++ ctors, dtors, and operators from the
right name pools.

llvm-svn: 115371
2010-10-01 23:13:49 +00:00
Johnny Chen b781cf0022 Commented out two debug prints.
llvm-svn: 115369
2010-10-01 23:05:03 +00:00
Johnny Chen da88434b39 o Added a new feature to the test framework to skip long running tests conditionally.
To not skip long running tests, pass '-l' to the test driver (dotest.py).

  An example:

    @unittest2.skipIf(TestBase.skipLongRunningTest(), "Skip this long running test")
    def test_foundation_disasm(self):
        ...

o Added a long running disassemble test to the foundation directory, which iterates
  the code symbols from Foundation.framework and kicks off a disassemble command for
  for the named function symbol.  Found a crasher: rdar://problem/8504895.

o Plus added/updated some comments for the TestBase class.

llvm-svn: 115368
2010-10-01 22:59:49 +00:00
Caroline Tice 8d88020e92 Uncomment/fix "-f" command option for disassemble command.
llvm-svn: 115351
2010-10-01 21:34:54 +00:00