Commit Graph

2311 Commits

Author SHA1 Message Date
Greg Clayton ffc922e389 More moving things around for the unwind plan and assembly unwind plug-ins.
llvm-svn: 130154
2011-04-25 21:05:07 +00:00
Johnny Chen fc87e2dd5c Make SBBreakpointLocation::GetDescription() API to be consistent with SBTarget,
i.e., with 'SBStream &description' first, followed by 'DescriptionLevel level'.

Modify lldbutil.py so that get_description() for a target or breakpoint location
can just take the lldb object itself without specifying an option to mean option
lldb.eDescriptionLevelBrief.  Modify TestTargetAPI.py to exercise this logic path.

llvm-svn: 130147
2011-04-25 20:23:05 +00:00
Greg Clayton dc5eb693bd Put plug-ins into the correct directories as they were incorrectly located
in a Utility directory.

llvm-svn: 130135
2011-04-25 18:36:36 +00:00
Johnny Chen 6b2a27c777 Fix test failure for '-A i386'.
llvm-svn: 130134
2011-04-25 18:20:52 +00:00
Johnny Chen 2b14d9b3f6 Update startstr argument of self.expect() to "a.out`sum(int, int)" to respond to recent change.
llvm-svn: 130133
2011-04-25 17:40:47 +00:00
Greg Clayton 7e14f91dbd Fixed the SymbolContext::DumpStopContext() to correctly indent and dump
inline contexts when the deepest most block is not inlined.

Added source path remappings to the lldb_private::Target class that allow it
to remap paths found in debug info so we can find source files that are elsewhere
on the current system.

Fixed disassembly by function name to disassemble inline functions that are
inside other functions much better and to show enough context before the
disassembly output so you can tell where things came from.

Added the ability to get more than one address range from a SymbolContext 
class for the case where a block or function has discontiguous address ranges.

llvm-svn: 130044
2011-04-23 02:04:55 +00:00
Johnny Chen 9ae982053f Convert the rest of the test suite to use the lldbutil.get_description() utility function.
llvm-svn: 130041
2011-04-23 00:34:56 +00:00
Johnny Chen 90256cdaba Add a simple utility function get_description(lldb_obj, option=None) to lldbutil.py
and use it from TestTargetAPI.py.

llvm-svn: 130038
2011-04-23 00:13:34 +00:00
Jim Ingham 58b59f9522 Fix up how the ValueObjects manage their life cycle so that you can hand out a shared
pointer to a ValueObject or any of its dependent ValueObjects, and the whole cluster will
stay around as long as that shared pointer stays around.

llvm-svn: 130035
2011-04-22 23:53:53 +00:00
Johnny Chen 787f71f269 Add test cases for the SBTarget.GetDescription() API which takes an extra lldb::DescriptionLevel enum.
llvm-svn: 130029
2011-04-22 23:20:17 +00:00
Johnny Chen ea0d135d37 We are only interested in logging the child's output to sys.stdout.
llvm-svn: 130017
2011-04-22 21:56:22 +00:00
Johnny Chen 35c3ae9639 Fix comment.
llvm-svn: 130016
2011-04-22 21:50:08 +00:00
Johnny Chen ea76c4f229 Make test_connect_remote() more robust by waiting on the server ready message
before issuing the 'process connect ...' command.

test_comand_regex(): assign the spawned child to self.child so it gets automatically
shutdown during TestBase.tearDown(self).

llvm-svn: 130015
2011-04-22 21:47:07 +00:00
Greg Clayton 8a51be9e1b Reroute the blog link to the LLVM blog site.
llvm-svn: 130014
2011-04-22 21:03:40 +00:00
Greg Clayton a348259b3d Erase from a string instead of using substr when you don't really need to.
llvm-svn: 130013
2011-04-22 20:58:45 +00:00
Johnny Chen a2abf701e2 Fix a typo.
llvm-svn: 130011
2011-04-22 20:40:26 +00:00
Caroline Tice 6a4f755a2b Remove old emulation test data files.
llvm-svn: 129993
2011-04-22 16:29:23 +00:00
Caroline Tice 526f9ad25e Modify to use the new test files.
llvm-svn: 129992
2011-04-22 16:05:13 +00:00
Caroline Tice 8401cdbd0e Reformat the emulation test data files.
llvm-svn: 129991
2011-04-22 16:03:05 +00:00
Caroline Tice de2fb9cf76 Change code for reading emulation data files to read the new file
format.  (The newly formatted files will go in as a separate commit in a
few minutes).

llvm-svn: 129981
2011-04-22 05:08:45 +00:00
Greg Clayton 385aa28cf6 Did some work on the "register read" command to only show the first register
set by default when dumping registers. If you want to see all of the register
sets you can use the "--all" option:

(lldb) register read --all

If you want to just see some register sets, you can currently specify them
by index:

(lldb) register read --set 0 --set 2

We need to get shorter register set names soon so we can specify the register
sets by name without having to type too much. I will make this change soon.

You can also have any integer encoded registers resolve the address values
back to any code or data from the object files using the "--lookup" option.
Below is sample output when stopped in the libc function "puts" with some
const strings in registers:

Process 8973 stopped
* thread #1: tid = 0x2c03, 0x00007fff828fa30f libSystem.B.dylib`puts + 1, stop reason = instruction step into
  frame #0: 0x00007fff828fa30f libSystem.B.dylib`puts + 1
(lldb) register read --lookup 
General Purpose Registers:
  rax          = 0x0000000100000e98  "----------------------------------------------------------------------"
  rbx          = 0x0000000000000000
  rcx          = 0x0000000000000001  
  rdx          = 0x0000000000000000
  rdi          = 0x0000000100000e98  "----------------------------------------------------------------------"
  rsi          = 0x0000000100800000
  rbp          = 0x00007fff5fbff710
  rsp          = 0x00007fff5fbff280
  r8           = 0x0000000000000040  
  r9           = 0x0000000000000000
  r10          = 0x0000000000000000
  r11          = 0x0000000000000246  
  r12          = 0x0000000000000000
  r13          = 0x0000000000000000
  r14          = 0x0000000000000000
  r15          = 0x0000000000000000
  rip          = 0x00007fff828fa30f  libSystem.B.dylib`puts + 1
  rflags       = 0x0000000000000246  
  cs           = 0x0000000000000027  
  fs           = 0x0000000000000000
  gs           = 0x0000000000000000

As we can see, we see two constant strings and the PC (register "rip") is 
showing the code it resolves to.

I fixed the register "--format" option to work as expected.

Added a setting to disable skipping the function prologue when setting 
breakpoints as a target settings variable:

(lldb) settings set target.skip-prologue false

Updated the user settings controller boolean value handler funciton to be able
to take the default value so it can correctly respond to the eVarSetOperationClear
operation.

Did some usability work on the OptionValue classes.

Fixed the "image lookup" command to correctly respond to the "--verbose" 
option and display the detailed symbol context information when looking up
line table entries and functions by name. This previously was only working
for address lookups.

llvm-svn: 129977
2011-04-22 03:55:06 +00:00
Johnny Chen d545d9cbbc Make the test case more robust by installing a teardown hook to kill the inferior
rather than calling "process kill" explicitly at the end of the test.

The test might not even reach the end because it could have failed prematurely.

llvm-svn: 129963
2011-04-22 00:33:09 +00:00
Johnny Chen 13af1b55cd Conditionalize the self.expect("dis -f", ...) test scenario to check on Intel disassembly
only when the test is currently running against the relevant architecture.

llvm-svn: 129960
2011-04-22 00:13:28 +00:00
Johnny Chen 9ee96e7b40 Add a HideStdout() method to our TestBase class and call it from TestAbbreviations.py
and TestAliases.py.  Pass the keyword argument 'check=False' to:

    self.runCmd("script my.date()", check=False)

since we want to restore sys.stdout no matter what the outcome of the runCmd is.

llvm-svn: 129949
2011-04-21 22:50:23 +00:00
Greg Clayton 2048ea5eba Fixed a case where if a function, inlined function, or global with a mangled
name had a DW_AT_name that was the same string as the DW_AT_MIPS_linkage_name,
then it would get added twice to the DWARF index.

llvm-svn: 129942
2011-04-21 21:41:13 +00:00
Johnny Chen 72c40825dd Hopefully fix the last fallout of 'commands' to 'command' change.
llvm-svn: 129937
2011-04-21 20:55:57 +00:00
Johnny Chen 71aaf75e3d Use self.TraceOn() API.
llvm-svn: 129936
2011-04-21 20:48:32 +00:00
Johnny Chen ea80ba8b97 Use self.TraceOn() API to decide whether to print debug output.
llvm-svn: 129935
2011-04-21 20:27:45 +00:00
Greg Clayton 020b717f6a More iteration on the new option value stuff. We now define an
OptionValueCollection class that can be subclassed to provide access to 
internal settings that are stored as ObjectValue subclasses.

llvm-svn: 129926
2011-04-21 19:21:29 +00:00
Greg Clayton 9524f25b0f Made the constructors public for all OptionValue classes
so we can instantiate them, and also moved the code that
can get the specific subclass for a OptionValue into the 
OptionValue class.

llvm-svn: 129920
2011-04-21 17:46:10 +00:00
Greg Clayton e302c2c785 Added a blog page with a description and tutorial on using the new "command regex"
command.

llvm-svn: 129898
2011-04-21 01:09:42 +00:00
Johnny Chen b89982d696 Fixed some more 'commands' to 'command' change.
llvm-svn: 129897
2011-04-21 00:39:18 +00:00
Johnny Chen 21b2b7db76 Replace 'commands' with 'command', and update to the latest prompt.
llvm-svn: 129895
2011-04-21 00:05:59 +00:00
Johnny Chen 951e3b5618 Use self.TraceOn() API.
llvm-svn: 129890
2011-04-20 22:59:01 +00:00
Greg Clayton 0e5e5a798e Renamed the "commands" command to "command" as this is the way we were using
it everywhere internally.

Modified the "command regex" command to be able to specify all regular 
expressions on the command line. For example:

(lldb) command regex f s/^$/finish/ 's/([0-9]+)/frame select %1/'

Also improved the error reporting when an invalid 's/<regex>/<subst>/' argument
is given.

llvm-svn: 129889
2011-04-20 22:55:21 +00:00
Johnny Chen eab5e08f25 Use self.TraceOn() API.
llvm-svn: 129885
2011-04-20 22:30:17 +00:00
Johnny Chen f95a869647 Fix wrong comment.
llvm-svn: 129881
2011-04-20 22:13:23 +00:00
Johnny Chen b21a1b0a4b Use self.TraceOn() API.
llvm-svn: 129880
2011-04-20 22:01:48 +00:00
Johnny Chen cd8cf861d7 Add a simple test scenario for 'command regex' invocation and subsequent use.
llvm-svn: 129879
2011-04-20 21:51:31 +00:00
Johnny Chen dbee242518 Add a test scenario for 'source list -b' which shows the line table locations from
the debug information which indicates valid places to set source level breakpoints.

llvm-svn: 129871
2011-04-20 20:35:59 +00:00
Caroline Tice 51172bfcab Remove ARMDissasembler.framework from project (it accidentally got
included in a recent commit).

llvm-svn: 129868
2011-04-20 18:58:35 +00:00
Greg Clayton 3300d778ab Fixed an issue where breakpoint were being displayed when using the "source list"
command when the file was implicit or found from a symbol.

llvm-svn: 129867
2011-04-20 18:52:45 +00:00
Greg Clayton d828f316af Added the ability for arrays and dictionaries to contain only specific
types of values.

llvm-svn: 129863
2011-04-20 18:16:33 +00:00
Caroline Tice 061defd63d Fix typo (accidental second 'const' qualifier).
llvm-svn: 129859
2011-04-20 17:14:12 +00:00
Greg Clayton de164aaa09 Added the ability for users to create new regex commands.
To do this currently, it must be done in multi-line mode:

(lldb) commands regex --help "Help text for command" --syntax "syntax for command" <cmd-name>

Any example that would use "f" for "finish" when there are no arguments,
and "f <num>" to do a "frame select <num>" would be:
(lldb) commands regex f
Enter multiple regular expressions in the form s/find/replace/ then terminate with an empty line:
s/^$/finish/
s/([0-9]+)/frame select %1/

(lldb) f 11
frame select 12
...
(lldb) f
finish
...

Also added the string version of the OptionValue as OptionValueString.

llvm-svn: 129855
2011-04-20 16:37:46 +00:00
Greg Clayton 45fa8b36d5 Added the start of a new option value system that we can use for many things
around the debugger. The class isn't hooked into anything yet, but it will be
soon. 

llvm-svn: 129843
2011-04-20 01:33:38 +00:00
Caroline Tice 3ac6711aec Add the infrastructure to test instruction emulations automatically.
The idea is that the instruction to be emulated is actually executed
on the hardware to be emulated, with the before and after state of the
hardware being captured and 'freeze-dried' into .dat files.  The
emulation testing code then loads the before & after state from the
.dat file, emulates the instruction using the before state, and
compares the resulting state to the 'after' state.  If they match, the
emulation is accurate, otherwise there is a problem.

The final format of the .dat files needs a bit more work; the plan is
to generalize them a bit and to convert the plain values to key-value pairs. 
But I wanted to get this first pass committed.

This commit adds arm instruction emulation testing to the testsuite, along with
many initial .dat files.

It also fixes a bug in the llvm disassembler, where 32-bit thumb opcodes
were getting their upper & lower 16-bits reversed.

There is a new Instruction sub-class, that is intended to be loaded
from a .dat file rather than read from an executable.  There is also a
new EmulationStateARM class, for handling the before & after states.
EmulationStates for other architetures can be added later when we
emulate their instructions.

llvm-svn: 129832
2011-04-19 23:30:03 +00:00
Johnny Chen 0b8fd43397 Rename test/threads to python_api/lldbutil; it uses lldbutil functions to print stack traces.
llvm-svn: 129828
2011-04-19 22:44:20 +00:00
Johnny Chen 85866ba033 Use self.TraceOn() API.
llvm-svn: 129827
2011-04-19 22:32:57 +00:00
Greg Clayton 4c20717a8f General cleanup on the UserSettingsController stuff. There were 5 different
places that were dumping values for the settings. Centralized all of the
value dumping into a single place. When dumping values that aren't strings
we no longer surround the value with single quotes. When dumping values that
are strings, surround the string value with double quotes. When dumping array
values, assume they are always string values, and don't put quotes around
dictionary values.

llvm-svn: 129826
2011-04-19 22:32:36 +00:00