Commit Graph

4743 Commits

Author SHA1 Message Date
Benjamin Kramer c2b5c67df3 Linux/ProcessMonitor: include sys/user.h for user_regs_struct and user_fpregs_struct.
llvm-svn: 154255
2012-04-07 09:13:49 +00:00
Jason Molenda 7a2f433367 Version bump to lldb-138.
llvm-svn: 154252
2012-04-07 06:18:20 +00:00
Jason Molenda b9e88d4186 Fix a integer trauction issue - calculating the current time in
nanoseconds in 32-bit expression would cause pthread_cond_timedwait
to time out immediately.  Add explicit casts to the TimeValue::TimeValue
ctor that takes a struct timeval and change the NanoSecsPerSec etc
constants defined in TimeValue to be uint64_t so any other calculations
involving these should be promoted to 64-bit even when lldb is built
for 32-bit.

<rdar://problem/11204073>, <rdar://problem/11179821>, <rdar://problem/11194705>.

llvm-svn: 154250
2012-04-07 04:55:02 +00:00
Greg Clayton 7b70be3970 Removed redundant isxdigit checks and added the ability to GetHexU8() so it can extract an 8 bit hex value if one is available. It will set EOF if "set_eof_on_fail" is true or if out of data. This allows a string decoder to grab a string without losing the last part of the packet with a packet like "414243,abc" (it can extract "ABC" and leave the file position set to the comma).
llvm-svn: 154239
2012-04-07 00:42:53 +00:00
Sean Callanan bf81ea5a9f Hardened the struct layout code to eliminate a
potential crash if the underlying type couldn't
be completed.

llvm-svn: 154234
2012-04-07 00:06:00 +00:00
Jim Ingham 372787fc19 We sometimes need to be able to call functions (via Process::RunThreadPlan) from code run on the private state thread. To do that we have to
spin up a temporary "private state thread" that will respond to events from the lower level process plugins.  This check-in should work to do
that, but it is still buggy.  However, if you don't call functions on the private state thread, these changes make no difference.

This patch also moves the code in the AppleObjCRuntime step-through-trampoline handler that might call functions (in the case where the debug
server doesn't support the memory allocate/deallocate packet) out to a safe place to do that call.

llvm-svn: 154230
2012-04-07 00:00:41 +00:00
Sean Callanan d13c23c393 Changed some tabs to spaces to make Python like
this file.

llvm-svn: 154222
2012-04-06 23:02:44 +00:00
Sean Callanan 1106434be3 The remaining time calculation didn't reflect the
--start argument.  Fixed that.

llvm-svn: 154221
2012-04-06 23:00:31 +00:00
Johnny Chen 7bba2c6d64 The final batch of adding @dsym_test/@dwarf_test decorators.
llvm-svn: 154211
2012-04-06 21:33:58 +00:00
Sean Callanan afc7b13e56 Removed a call to truncate() which slowed down
the stress test by a LOT.

llvm-svn: 154208
2012-04-06 21:04:20 +00:00
Sean Callanan ceabd2d712 Updated the disassembler stress tester with two
new features:

(1) it outputs the instruction currently being
    tested to a log file, if a path is provided

(2) if instructed, it prints the time remaining
    in the exhaustive test

llvm-svn: 154205
2012-04-06 20:53:23 +00:00
Johnny Chen 24086bc93b Second batch of adding @dsym_test/@dwarf_test decorators to existing test cases.
Plus some minor cleanup of test method names.
Third and final batch is coming.

llvm-svn: 154197
2012-04-06 19:54:10 +00:00
Greg Clayton 780af51505 Fixed ModuleList::FindTypes() so that when a symbol context is supplied that contains a valid module, it will search that module first, then if we are still looking for matches (we have found less that "max_matches"), search in all of the other modules as well.
llvm-svn: 154186
2012-04-06 18:09:43 +00:00
Sean Callanan 2b54db7664 Fixed a leak in the LLVM disassembler where we
did not destroy the underlying disassembler in 
our destructor.

llvm-svn: 154185
2012-04-06 17:59:49 +00:00
Greg Clayton 29399a24c6 In a prior commit, I changed the parameters around on a ModuleList::FindTypes where the old parameters that existing clients were using would have been compatible, so I renamed ModuleList::FindTypes to ModuleList::FindTypes2. Then I made fixes and verified I updated and fixed all client code, but I forgot to rename the function back to ModuleList::FindTypes(). I am doing that now and also cleaning up the C++ dynamic type code a bit.
llvm-svn: 154182
2012-04-06 17:41:13 +00:00
Greg Clayton 55995ebb58 Check if the two clang opaque type pointers are equal before doing anything more exhaustive comparison.
llvm-svn: 154181
2012-04-06 17:38:55 +00:00
Greg Clayton c9858e4d05 Added logging when API calls try to do something that shouldn't be done when the process is stopped by having logging calls that end with "error: process is running".
Also test for the process to be stopped when many SBValue API calls are made to make sure it is safe to evaluate values, children of values and much more.

llvm-svn: 154160
2012-04-06 02:17:47 +00:00
Johnny Chen f1548d4f74 Add a new option to the test driver, -N dsym or -N dwarf, in order to exclude tests decorated with
either @dsym_test or @dwarf_test to be executed during the testsuite run.  There are still lots of
Test*.py files which have not been decorated with the new decorator.

An example:

# From TestMyFirstWatchpoint.py ->
class HelloWatchpointTestCase(TestBase):

    mydir = os.path.join("functionalities", "watchpoint", "hello_watchpoint")

    @dsym_test
    def test_hello_watchpoint_with_dsym_using_watchpoint_set(self):
        """Test a simple sequence of watchpoint creation and watchpoint hit."""
        self.buildDsym(dictionary=self.d)
        self.setTearDownCleanup(dictionary=self.d)
        self.hello_watchpoint()

    @dwarf_test
    def test_hello_watchpoint_with_dwarf_using_watchpoint_set(self):
        """Test a simple sequence of watchpoint creation and watchpoint hit."""
        self.buildDwarf(dictionary=self.d)
        self.setTearDownCleanup(dictionary=self.d)
        self.hello_watchpoint()


# Invocation ->
[17:50:14] johnny:/Volumes/data/lldb/svn/ToT/test $ ./dotest.py -N dsym -v -p TestMyFirstWatchpoint.py
LLDB build dir: /Volumes/data/lldb/svn/ToT/build/Debug
LLDB-137
Path: /Volumes/data/lldb/svn/ToT
URL: https://johnny@llvm.org/svn/llvm-project/lldb/trunk
Repository Root: https://johnny@llvm.org/svn/llvm-project
Repository UUID: 91177308-0d34-0410-b5e6-96231b3b80d8
Revision: 154133
Node Kind: directory
Schedule: normal
Last Changed Author: gclayton
Last Changed Rev: 154109
Last Changed Date: 2012-04-05 10:43:02 -0700 (Thu, 05 Apr 2012)



Session logs for test failures/errors/unexpected successes will go into directory '2012-04-05-17_50_49'
Command invoked: python ./dotest.py -N dsym -v -p TestMyFirstWatchpoint.py
compilers=['clang']

Configuration: arch=x86_64 compiler=clang
----------------------------------------------------------------------
Collected 2 tests

1: test_hello_watchpoint_with_dsym_using_watchpoint_set (TestMyFirstWatchpoint.HelloWatchpointTestCase)
   Test a simple sequence of watchpoint creation and watchpoint hit. ... skipped 'dsym tests'
2: test_hello_watchpoint_with_dwarf_using_watchpoint_set (TestMyFirstWatchpoint.HelloWatchpointTestCase)
   Test a simple sequence of watchpoint creation and watchpoint hit. ... ok

----------------------------------------------------------------------
Ran 2 tests in 1.138s

OK (skipped=1)
Session logs for test failures/errors/unexpected successes can be found in directory '2012-04-05-17_50_49'
[17:50:50] johnny:/Volumes/data/lldb/svn/ToT/test $ 

llvm-svn: 154154
2012-04-06 00:56:05 +00:00
Bill Wendling c80efb418b Add flag to warn about ivar initialization reordering.
llvm-svn: 154153
2012-04-06 00:48:15 +00:00
Bill Wendling 04e7e0ba7a explicitly cast the value.
llvm-svn: 154148
2012-04-06 00:10:46 +00:00
Bill Wendling 7a4b007c65 Order ivar initializers to how they're declared in the class.
llvm-svn: 154147
2012-04-06 00:10:21 +00:00
Bill Wendling e6eeef0164 Order ivar initializers to how they're declared in the class.
llvm-svn: 154146
2012-04-06 00:09:59 +00:00
Bill Wendling 4fe443aa21 Silence unused warning.
llvm-svn: 154145
2012-04-06 00:09:21 +00:00
Sean Callanan d181730aa5 Added a stress-tester for LLDB's disassembler.
Right now it only works on Mac OS X, but other
platforms would just need to add their own
implementation of AddLLDBToSysPathOn*().

The stress-tester has two modes:

Used with --bytes N --random, the stress-tester
generates random instructions of length N and
runs them through the disassembler.  This is
suitable for architectures like Intel where it
is combinatorially infeasible to run through the
entire space of possible instructions.

Used with --bytes N and no arguments (or --start
S --stride T), the stress-tester tests the
disassembler with a monotonically increasing
sequence of instructions.

The --start and --stride arguments are intended
for use in multiprocessing environments.  Give
each core an ID from 0 .. T-1, pass the ID in as
the --start, and use T as the stride, and you
can launch one copy of the stress-tester on each
core you have available.

llvm-svn: 154143
2012-04-06 00:04:36 +00:00
Greg Clayton d84cec07c9 Enable building the POSIX-DYLD dynamic loader plug-in in the Makefile build since it can be used for remote debugging.
llvm-svn: 154109
2012-04-05 17:43:02 +00:00
Bill Wendling e50ab408e5 Revert r154086. It may be needed for Darwin. But the symbols are still missing in the dylib.
llvm-svn: 154108
2012-04-05 17:38:07 +00:00
Greg Clayton 7fdf9ef15d Added a new Host class: ReadWriteLock
This abstracts read/write locks on the current host system. It is currently backed by pthread_rwlock_t objects so it should work on all unix systems.

We also need a way to control multi-threaded access to the process through the public API when it is running. For example it isn't a good idea to try and get stack frames while the process is running. To implement this, the lldb_private::Process class now contains a ReadWriteLock member variable named m_run_lock which is used to control the public process state. The public process state represents the state of the process as the client knows it. The private is used to control the actual current process state. So the public state of the process can be stopped, yet the private state can be running when evaluating an expression for example. 

Adding the read/write lock where readers are clients that want the process to stay stopped, and writers are clients that run the process, allows us to accurately control multi-threaded access to the process.

Switched the SBThread and SBFrame over to us shared pointers to the ExecutionContextRef class instead of making their own class to track this. This fixed an issue with assigning on SBFrame to another and will also centralize the code that tracks weak references to execution context objects into one location.

llvm-svn: 154099
2012-04-05 16:12:35 +00:00
Bill Wendling e914660c0d The DynamicLoaderPOSIXDYLD calls aren't available on Apple systems.
llvm-svn: 154086
2012-04-05 06:21:02 +00:00
Bill Wendling de59fb02b9 Add Security framework to the list of frameworks needed for linking.
llvm-svn: 154085
2012-04-05 06:20:13 +00:00
Sean Callanan a03156fc66 Tolerate decimal points in the LLDB version number.
They are truncated when generating the version
numbers seen in the headers, so for example
lldb-100.1 would have #define LLDB_VERSION=100

llvm-svn: 154074
2012-04-05 01:30:56 +00:00
Sean Callanan a658226ac0 Fixed a problem where we did not read properties
correctly if the setter/getter were not present
in the debug information.  The fixes are as follows:

- We not only look for the method by its full name,
  but also look for automatically-generated methods
  when searching for a selector in an Objective-C
  interface.  This is necessary to find accessors.

- Extract the getter and setter name from the
  DW_TAG_APPLE_Property declaration in the DWARF
  if they are present; generate them if not.

llvm-svn: 154067
2012-04-05 00:12:52 +00:00
Bill Wendling c359aafc55 Order the initializations so that they reflect how they're declared in the class.
llvm-svn: 154055
2012-04-04 21:19:57 +00:00
Greg Clayton 0b88d815e3 <rdar://problem/11184458>
Found an issue where we might still have shared pointer references to lldb_private::Thread objects where the object itself is not valid and has been removed from the Process. When a thread is removed from a process, it will call Thread::DestroyThread() which well set a boolean member variable which is exposed now via:

bool
Thread::IsValid() const;

We then check the thread validity before handing out a shared pointer.

llvm-svn: 154048
2012-04-04 20:43:47 +00:00
Greg Clayton 7e8a601c56 Change SBAddress back to using a std::auto_ptr to a lldb_private::Address as the lldb_private::Address has a weak pointer to the section which has a weak pointer back to the module, so it is safe to have just a lldb_private::Address object now.
llvm-svn: 154045
2012-04-04 20:36:48 +00:00
Greg Clayton b8a54482b3 Use LLDB as the default debugger for launcherXPCService.
llvm-svn: 154043
2012-04-04 20:07:33 +00:00
Greg Clayton 3c18cd3de1 Fixed the C++11 #defines that wrap std::weak_ptr to actually use std::weak_ptr.
llvm-svn: 154041
2012-04-04 20:03:33 +00:00
Enrico Granata f18c03e49e Attempt at fixing a crasher where summary strings where looping endlessly.
llvm-svn: 154028
2012-04-04 17:34:10 +00:00
Enrico Granata 0249fba8c3 Fixing a potential crasher where Python would assume we have no thread state while clearing out an SBDebugger which was acquiring input from the interactive interpreter
llvm-svn: 154027
2012-04-04 17:31:29 +00:00
Enrico Granata 8d4a8010cf Adding a new --python-function (-F) option to breakpoint command add. The option allows the user to specify a Python function name instead of a Python oneliner or interactive script input as a breakpoint command
llvm-svn: 154026
2012-04-04 17:30:31 +00:00
Greg Clayton 3c2c4bb2ce Added a platform agnostic symbolication python module that can be used by any targets. Then modified the darwin "crashlog.py" to use this agnostic info and the new functionality and classes.
llvm-svn: 153969
2012-04-03 21:35:43 +00:00
Bill Wendling d53b5dedb2 Initialize ivars in the correct order.
llvm-svn: 153947
2012-04-03 08:46:13 +00:00
Bill Wendling 9e5bf87516 Possibly too soon for this commit.
llvm-svn: 153946
2012-04-03 08:45:33 +00:00
Bill Wendling 90de801caa Revert accidental checkin.
llvm-svn: 153945
2012-04-03 08:44:00 +00:00
Bill Wendling c08a5e7e8b Possibly too soon for this change.
llvm-svn: 153944
2012-04-03 08:41:55 +00:00
Bill Wendling f0146cb3d3 Use the path to the header file. Use an integer instead of NULL. And get rid of a superfluous 'default' label.
llvm-svn: 153943
2012-04-03 07:51:16 +00:00
Bill Wendling 84ddbc57ee The option is 'NoInlineDefine.'
llvm-svn: 153942
2012-04-03 07:50:37 +00:00
Bill Wendling ed24dcc05f Use integers instead of NULL.
llvm-svn: 153941
2012-04-03 07:50:11 +00:00
Bill Wendling 542f2429f3 Spell 'DW_TAG_APPLE_property' with the correct capitalization.
llvm-svn: 153940
2012-04-03 07:49:34 +00:00
Bill Wendling cac9d9b3f6 Use the correct class/struct keyword so that they match the declarations.
llvm-svn: 153932
2012-04-03 04:15:34 +00:00
Bill Wendling c9851e2630 Initialize ivars in the order they are defined in the class.
llvm-svn: 153931
2012-04-03 04:14:58 +00:00