Commit Graph

6998 Commits

Author SHA1 Message Date
Pavel Labath b84141a6fe Add real time signals support to LinuxSignals
Summary: This enables correct handling of real time signals by lldb.

Test Plan: Added a test that verifies handling of SIGRTMIN

Reviewers: tberghammer, ovyalov

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D9911

llvm-svn: 238009
2015-05-22 08:46:18 +00:00
Greg Clayton e034a04e4f Added a new command in ProcessGDBRemote that can figure out the performance characterisitics of your GDB remote server.
To addess this, attach to any GDB server and when stopped type:

(lldb) process plugin packet speed-test

The default will send a variety of packets with different amounts of data to send/receive and print the performance of each packet type:

Testing sending 1000 packets of various sizes:
qSpeedTest(send=0      , recv=0      ) in 0.057837000 sec for  17289.97 packets/sec (  0.057837 ms per packet) with standard deviation of   0.007705 ms
qSpeedTest(send=0      , recv=4      ) in 0.056162000 sec for  17805.63 packets/sec (  0.056162 ms per packet) with standard deviation of   0.004439 ms
qSpeedTest(send=0      , recv=8      ) in 0.057687000 sec for  17334.93 packets/sec (  0.057687 ms per packet) with standard deviation of   0.008135 ms
qSpeedTest(send=0      , recv=16     ) in 0.058547000 sec for  17080.29 packets/sec (  0.058547 ms per packet) with standard deviation of   0.005884 ms
qSpeedTest(send=0      , recv=32     ) in 0.058289000 sec for  17155.89 packets/sec (  0.058289 ms per packet) with standard deviation of   0.004057 ms
qSpeedTest(send=0      , recv=64     ) in 0.061324000 sec for  16306.83 packets/sec (  0.061324 ms per packet) with standard deviation of   0.010838 ms
qSpeedTest(send=0      , recv=128    ) in 0.065688000 sec for  15223.48 packets/sec (  0.065688 ms per packet) with standard deviation of   0.006997 ms
qSpeedTest(send=0      , recv=256    ) in 0.070621000 sec for  14160.09 packets/sec (  0.070621 ms per packet) with standard deviation of   0.006188 ms
qSpeedTest(send=0      , recv=512    ) in 0.086738000 sec for  11528.97 packets/sec (  0.086738 ms per packet) with standard deviation of   0.007867 ms
qSpeedTest(send=0      , recv=1024   ) in 0.146375000 sec for   6831.77 packets/sec (  0.146375 ms per packet) with standard deviation of   0.010313 ms
qSpeedTest(send=4      , recv=0      ) in 0.057807000 sec for  17298.94 packets/sec (  0.057807 ms per packet) with standard deviation of   0.009702 ms
....

It will then also use various sizes to receive 4MB of data from the GDB server and print out the stats:

Testing receiving 4.0MB of data using varying receive packet sizes:
qSpeedTest(send=0      , recv=32     ) 131072 packets needed to receive 4.0MB in 7.721290000 sec for 0.518048 MB/sec for  16975.40 packets/sec (  0.058909 ms per packet)
qSpeedTest(send=0      , recv=64     )  65536 packets needed to receive 4.0MB in 4.029236000 sec for 0.992744 MB/sec for  16265.12 packets/sec (  0.061481 ms per packet)
qSpeedTest(send=0      , recv=128    )  32768 packets needed to receive 4.0MB in 2.233854000 sec for 1.790627 MB/sec for  14668.82 packets/sec (  0.068172 ms per packet)
qSpeedTest(send=0      , recv=256    )  16384 packets needed to receive 4.0MB in 1.160024000 sec for 3.448204 MB/sec for  14123.84 packets/sec (  0.070802 ms per packet)
qSpeedTest(send=0      , recv=512    )   8192 packets needed to receive 4.0MB in 0.701603000 sec for 5.701230 MB/sec for  11676.12 packets/sec (  0.085645 ms per packet)
qSpeedTest(send=0      , recv=1024   )   4096 packets needed to receive 4.0MB in 0.596786000 sec for 6.702570 MB/sec for   6863.43 packets/sec (  0.145700 ms per packet)

There is a JSON mode so we can use this in the test suite to track GDB server performance for each platform:

(lldb) process plugin packet speed-test --json
{ "packet_speeds" : {
    "num_packets" : 1000,
    "results" : [
     {"send_size" :      0, "recv_size" :      0, "total_time_nsec" :     64516000, "standard_deviation_nsec" :     20566 },
     {"send_size" :      0, "recv_size" :      4, "total_time_nsec" :     59648000, "standard_deviation_nsec" :     10493 },
     {"send_size" :      0, "recv_size" :      8, "total_time_nsec" :     56894000, "standard_deviation_nsec" :      5480 },
     {"send_size" :      0, "recv_size" :     16, "total_time_nsec" :     59422000, "standard_deviation_nsec" :      6557 },
     {"send_size" :      0, "recv_size" :     32, "total_time_nsec" :     61159000, "standard_deviation_nsec" :     12384 },
     {"send_size" :      0, "recv_size" :     64, "total_time_nsec" :     61386000, "standard_deviation_nsec" :      9208 },
     {"send_size" :      0, "recv_size" :    128, "total_time_nsec" :     64768000, "standard_deviation_nsec" :      4737 },
     {"send_size" :      0, "recv_size" :    256, "total_time_nsec" :     71046000, "standard_deviation_nsec" :      5904 },
     {"send_size" :      0, "recv_size" :    512, "total_time_nsec" :     87233000, "standard_deviation_nsec" :      8967 },
     {"send_size" :      0, "recv_size" :   1024, "total_time_nsec" :    146629000, "standard_deviation_nsec" :      9526 },
     {"send_size" :      4, "recv_size" :      0, "total_time_nsec" :     57131000, "standard_deviation_nsec" :      7884 },
     {"send_size" :      4, "recv_size" :      4, "total_time_nsec" :     56772000, "standard_deviation_nsec" :      6064 },
     {"send_size" :      4, "recv_size" :      8, "total_time_nsec" :     57450000, "standard_deviation_nsec" :      6341 },
     {"send_size" :      4, "recv_size" :     16, "total_time_nsec" :     58279000, "standard_deviation_nsec" :      5998 },
     {"send_size" :      4, "recv_size" :     32, "total_time_nsec" :     59995000, "standard_deviation_nsec" :      6294 },
     {"send_size" :      4, "recv_size" :     64, "total_time_nsec" :     61632000, "standard_deviation_nsec" :      7838 },
     {"send_size" :      4, "recv_size" :    128, "total_time_nsec" :     66535000, "standard_deviation_nsec" :      8026 },
     {"send_size" :      4, "recv_size" :    256, "total_time_nsec" :     72754000, "standard_deviation_nsec" :      9519 },
     {"send_size" :      4, "recv_size" :    512, "total_time_nsec" :     87072000, "standard_deviation_nsec" :      9268 },
     {"send_size" :      4, "recv_size" :   1024, "total_time_nsec" :    147221000, "standard_deviation_nsec" :      9702 },
     {"send_size" :      8, "recv_size" :      0, "total_time_nsec" :     57900000, "standard_deviation_nsec" :      7356 },
     {"send_size" :      8, "recv_size" :      4, "total_time_nsec" :     58116000, "standard_deviation_nsec" :      7630 },
     {"send_size" :      8, "recv_size" :      8, "total_time_nsec" :     57745000, "standard_deviation_nsec" :      8541 },
     {"send_size" :      8, "recv_size" :     16, "total_time_nsec" :     59091000, "standard_deviation_nsec" :      7851 },
     {"send_size" :      8, "recv_size" :     32, "total_time_nsec" :     59943000, "standard_deviation_nsec" :      6761 },
     {"send_size" :      8, "recv_size" :     64, "total_time_nsec" :     62097000, "standard_deviation_nsec" :      8580 },
     {"send_size" :      8, "recv_size" :    128, "total_time_nsec" :     69942000, "standard_deviation_nsec" :     16645 },
     {"send_size" :      8, "recv_size" :    256, "total_time_nsec" :     72927000, "standard_deviation_nsec" :     11031 },
     {"send_size" :      8, "recv_size" :    512, "total_time_nsec" :     87221000, "standard_deviation_nsec" :      8002 },
     {"send_size" :      8, "recv_size" :   1024, "total_time_nsec" :    148696000, "standard_deviation_nsec" :     10383 },
     {"send_size" :     16, "recv_size" :      0, "total_time_nsec" :     59890000, "standard_deviation_nsec" :     15160 },
     {"send_size" :     16, "recv_size" :      4, "total_time_nsec" :     56664000, "standard_deviation_nsec" :      4650 },
     {"send_size" :     16, "recv_size" :      8, "total_time_nsec" :     57574000, "standard_deviation_nsec" :      7787 },
     {"send_size" :     16, "recv_size" :     16, "total_time_nsec" :     59312000, "standard_deviation_nsec" :      8104 },
     {"send_size" :     16, "recv_size" :     32, "total_time_nsec" :     59764000, "standard_deviation_nsec" :      7496 },
     {"send_size" :     16, "recv_size" :     64, "total_time_nsec" :     61644000, "standard_deviation_nsec" :      8331 },
     {"send_size" :     16, "recv_size" :    128, "total_time_nsec" :     66476000, "standard_deviation_nsec" :      9251 },
     {"send_size" :     16, "recv_size" :    256, "total_time_nsec" :     72386000, "standard_deviation_nsec" :      8627 },
     {"send_size" :     16, "recv_size" :    512, "total_time_nsec" :     87810000, "standard_deviation_nsec" :     12318 },
     {"send_size" :     16, "recv_size" :   1024, "total_time_nsec" :    146918000, "standard_deviation_nsec" :     11595 },
     {"send_size" :     32, "recv_size" :      0, "total_time_nsec" :     56493000, "standard_deviation_nsec" :      6577 },
     {"send_size" :     32, "recv_size" :      4, "total_time_nsec" :     57069000, "standard_deviation_nsec" :      5931 },
     {"send_size" :     32, "recv_size" :      8, "total_time_nsec" :     57563000, "standard_deviation_nsec" :      8157 },
     {"send_size" :     32, "recv_size" :     16, "total_time_nsec" :     59694000, "standard_deviation_nsec" :      6932 },
     {"send_size" :     32, "recv_size" :     32, "total_time_nsec" :     60852000, "standard_deviation_nsec" :      8010 },
     {"send_size" :     32, "recv_size" :     64, "total_time_nsec" :     61926000, "standard_deviation_nsec" :      8372 },
     {"send_size" :     32, "recv_size" :    128, "total_time_nsec" :     66734000, "standard_deviation_nsec" :      8047 },
     {"send_size" :     32, "recv_size" :    256, "total_time_nsec" :     72000000, "standard_deviation_nsec" :      8103 },
     {"send_size" :     32, "recv_size" :    512, "total_time_nsec" :     88268000, "standard_deviation_nsec" :     12289 },
     {"send_size" :     32, "recv_size" :   1024, "total_time_nsec" :    147946000, "standard_deviation_nsec" :     12122 },
     {"send_size" :     64, "recv_size" :      0, "total_time_nsec" :     58126000, "standard_deviation_nsec" :      5895 },
     {"send_size" :     64, "recv_size" :      4, "total_time_nsec" :     58927000, "standard_deviation_nsec" :      8933 },
     {"send_size" :     64, "recv_size" :      8, "total_time_nsec" :     58163000, "standard_deviation_nsec" :      6663 },
     {"send_size" :     64, "recv_size" :     16, "total_time_nsec" :     59901000, "standard_deviation_nsec" :      8340 },
     {"send_size" :     64, "recv_size" :     32, "total_time_nsec" :     60365000, "standard_deviation_nsec" :      6319 },
     {"send_size" :     64, "recv_size" :     64, "total_time_nsec" :     61776000, "standard_deviation_nsec" :      7461 },
     {"send_size" :     64, "recv_size" :    128, "total_time_nsec" :     66984000, "standard_deviation_nsec" :      6810 },
     {"send_size" :     64, "recv_size" :    256, "total_time_nsec" :     73913000, "standard_deviation_nsec" :      8826 },
     {"send_size" :     64, "recv_size" :    512, "total_time_nsec" :     88134000, "standard_deviation_nsec" :      8356 },
     {"send_size" :     64, "recv_size" :   1024, "total_time_nsec" :    146932000, "standard_deviation_nsec" :      7571 },
     {"send_size" :    128, "recv_size" :      0, "total_time_nsec" :     57616000, "standard_deviation_nsec" :      6158 },
     {"send_size" :    128, "recv_size" :      4, "total_time_nsec" :     59091000, "standard_deviation_nsec" :      7458 },
     {"send_size" :    128, "recv_size" :      8, "total_time_nsec" :     60263000, "standard_deviation_nsec" :     11999 },
     {"send_size" :    128, "recv_size" :     16, "total_time_nsec" :     59238000, "standard_deviation_nsec" :      6102 },
     {"send_size" :    128, "recv_size" :     32, "total_time_nsec" :     60783000, "standard_deviation_nsec" :      6244 },
     {"send_size" :    128, "recv_size" :     64, "total_time_nsec" :     62975000, "standard_deviation_nsec" :      8947 },
     {"send_size" :    128, "recv_size" :    128, "total_time_nsec" :     65742000, "standard_deviation_nsec" :      5907 },
     {"send_size" :    128, "recv_size" :    256, "total_time_nsec" :     72402000, "standard_deviation_nsec" :      6601 },
     {"send_size" :    128, "recv_size" :    512, "total_time_nsec" :     87457000, "standard_deviation_nsec" :      9004 },
     {"send_size" :    128, "recv_size" :   1024, "total_time_nsec" :    148412000, "standard_deviation_nsec" :     10532 },
     {"send_size" :    256, "recv_size" :      0, "total_time_nsec" :     58705000, "standard_deviation_nsec" :      7274 },
     {"send_size" :    256, "recv_size" :      4, "total_time_nsec" :     58818000, "standard_deviation_nsec" :      5453 },
     {"send_size" :    256, "recv_size" :      8, "total_time_nsec" :     59451000, "standard_deviation_nsec" :      6926 },
     {"send_size" :    256, "recv_size" :     16, "total_time_nsec" :     60237000, "standard_deviation_nsec" :      5781 },
     {"send_size" :    256, "recv_size" :     32, "total_time_nsec" :     61456000, "standard_deviation_nsec" :      5591 },
     {"send_size" :    256, "recv_size" :     64, "total_time_nsec" :     62615000, "standard_deviation_nsec" :      7588 },
     {"send_size" :    256, "recv_size" :    128, "total_time_nsec" :     68554000, "standard_deviation_nsec" :      7766 },
     {"send_size" :    256, "recv_size" :    256, "total_time_nsec" :     74557000, "standard_deviation_nsec" :      8748 },
     {"send_size" :    256, "recv_size" :    512, "total_time_nsec" :     87929000, "standard_deviation_nsec" :      9510 },
     {"send_size" :    256, "recv_size" :   1024, "total_time_nsec" :    148522000, "standard_deviation_nsec" :     11394 },
     {"send_size" :    512, "recv_size" :      0, "total_time_nsec" :     59697000, "standard_deviation_nsec" :      7825 },
     {"send_size" :    512, "recv_size" :      4, "total_time_nsec" :     59427000, "standard_deviation_nsec" :      5706 },
     {"send_size" :    512, "recv_size" :      8, "total_time_nsec" :     59538000, "standard_deviation_nsec" :      6863 },
     {"send_size" :    512, "recv_size" :     16, "total_time_nsec" :     61139000, "standard_deviation_nsec" :      7645 },
     {"send_size" :    512, "recv_size" :     32, "total_time_nsec" :     62203000, "standard_deviation_nsec" :      7985 },
     {"send_size" :    512, "recv_size" :     64, "total_time_nsec" :     62577000, "standard_deviation_nsec" :      8118 },
     {"send_size" :    512, "recv_size" :    128, "total_time_nsec" :     68722000, "standard_deviation_nsec" :     10581 },
     {"send_size" :    512, "recv_size" :    256, "total_time_nsec" :     74290000, "standard_deviation_nsec" :      8931 },
     {"send_size" :    512, "recv_size" :    512, "total_time_nsec" :     88635000, "standard_deviation_nsec" :      7771 },
     {"send_size" :    512, "recv_size" :   1024, "total_time_nsec" :    149589000, "standard_deviation_nsec" :     11456 },
     {"send_size" :   1024, "recv_size" :      0, "total_time_nsec" :     63243000, "standard_deviation_nsec" :      6331 },
     {"send_size" :   1024, "recv_size" :      4, "total_time_nsec" :     64381000, "standard_deviation_nsec" :      8372 },
     {"send_size" :   1024, "recv_size" :      8, "total_time_nsec" :     63481000, "standard_deviation_nsec" :      5608 },
     {"send_size" :   1024, "recv_size" :     16, "total_time_nsec" :     65549000, "standard_deviation_nsec" :      8826 },
     {"send_size" :   1024, "recv_size" :     32, "total_time_nsec" :     65485000, "standard_deviation_nsec" :      6822 },
     {"send_size" :   1024, "recv_size" :     64, "total_time_nsec" :     67125000, "standard_deviation_nsec" :      9829 },
     {"send_size" :   1024, "recv_size" :    128, "total_time_nsec" :     72680000, "standard_deviation_nsec" :      7641 },
     {"send_size" :   1024, "recv_size" :    256, "total_time_nsec" :     79206000, "standard_deviation_nsec" :      9854 },
     {"send_size" :   1024, "recv_size" :    512, "total_time_nsec" :     92418000, "standard_deviation_nsec" :      9107 },
     {"send_size" :   1024, "recv_size" :   1024, "total_time_nsec" :    152392000, "standard_deviation_nsec" :     11124 }
    ]
  },
  "download_speed" : {
    "byte_size" : 4194304,
    "results" : [
     {"send_size" :      0, "recv_size" :     32, "total_time_nsec" :   7735630000 },
     {"send_size" :      0, "recv_size" :     64, "total_time_nsec" :   3985169000 },
     {"send_size" :      0, "recv_size" :    128, "total_time_nsec" :   2128791000 },
     {"send_size" :      0, "recv_size" :    256, "total_time_nsec" :   1172077000 },
     {"send_size" :      0, "recv_size" :    512, "total_time_nsec" :    703833000 },
     {"send_size" :      0, "recv_size" :   1024, "total_time_nsec" :    594966000 }
    ]
  }
}

llvm-svn: 237953
2015-05-21 20:52:06 +00:00
Zachary Turner 3c1c5b9d88 Fix race condition when detaching/killing an inferior.
llvm-svn: 237945
2015-05-21 19:56:26 +00:00
Robert Flack ab78164ad8 Only check for matching arch and UUID when looking for dsym in vincinity of executable.
ModuleSpecs::FindMatchingModuleSpec looks for matching filenames but when
looking for the dSYM we should only be looking for a matching architecture and
and UUID. Jason pointed out this mistake in http://reviews.llvm.org/D9174 when
this function was incorrectly converted to not be Mac specific.

Test Plan:
Running LLDB on test/lang/c/shared_lib_stripped_symbols/a.out in a debugger I've
verified LocateDSYMInVincinityOfExecutable correctly locates the matching dSYM.

Differential Revision: http://reviews.llvm.org/D9896

llvm-svn: 237907
2015-05-21 15:44:24 +00:00
Tamas Berghammer 9691518143 Handle aggregate return types in SysV-arm ABI
Differential revision: http://reviews.llvm.org/D9910

llvm-svn: 237901
2015-05-21 13:44:40 +00:00
Tamas Berghammer 350d8b311b Add float/double return value handling to SysV-arm ABI
This is neccessary for evaluating expressions with float/double return
value and for displaying float/double return values in case of a thread
step out.

Differential revision: http://reviews.llvm.org/D9907

llvm-svn: 237900
2015-05-21 13:34:46 +00:00
Pavel Labath 39036ac31d [NativeProcessLinux] Fix handling of SIGSTOP
Summary:
Previously, NPL tried to reinject SIGSTOP into the inferior in an attempt to get the process to
start in the group-stop state. This was:
a) wrong (reinjection should be controlled by "process handle" lldb setting)
b) racy (it should use Resume for transparent resuming instead of RequestResume)
c) broken (llgs crashed on inferior SIGSTOP)

With this change, SIGSTOP is handled just like any other signal delivered to the inferior: we
stop all threads and report signal reception to lldb. SIGSTOP reinjection does not behave the
same way as it would outside the debugger, but simulating this is a hard problem and is not
normally necessary.

Test Plan: I have added a test which verifies we get SIGSTOP reports and we do not crash.

Reviewers: ovyalov, chaoren

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D9852

llvm-svn: 237880
2015-05-21 08:32:18 +00:00
Jim Ingham 7ac5c86ba9 Fix the logic in DynamicLoaderMacOSXDYLD::Clear that would only remove the old dyld notification
breakpoint only  if the process it was for is still alive.  We need to always remove this because
it has a pointer to the old loader, and    if we ever hit it we will crash.  I also put in a sanity
check in the callback function to make sure we don't invoke it if the process is wrong.

<rdar://problem/21006189>

llvm-svn: 237866
2015-05-21 00:27:01 +00:00
Greg Clayton 07b5899367 Fixed an issue with expressions that define types in the expression. We must currently touch the members of the struct in the right order or our ClangASTImporter::DeportType() will copy the resulting type into the target AST incorrectly. This is a work around for <rdar://problem/21049838> which the copy type issue so that it doesn't happen.
<rdar://problem/20902950>

llvm-svn: 237865
2015-05-21 00:26:58 +00:00
Chaoren Lin 2bf454021c Default dst value for platform put-file.
Summary: It should default to working-dir/src-filename if dst is not specified.

Reviewers: clayborg, flackr

Reviewed By: flackr

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D9890

llvm-svn: 237831
2015-05-20 20:23:23 +00:00
Jim Ingham 40d66e6108 Since the asan report function doesn't gather bp or sp,
don't put those values in the Structured Data we make up
from the report.

<rdar://problem/21038887>

llvm-svn: 237824
2015-05-20 19:15:43 +00:00
Zachary Turner c62733b0de Implement attach to process on Windows.
Differential Revision: http://reviews.llvm.org/D9801
Reviewed by: Adrian McCarthy

llvm-svn: 237817
2015-05-20 18:31:17 +00:00
Ilia K 38810f430b Fix handling of hijacked events in synchronous mode
Summary:
This patch includes the following changes:
* Fix Target::Launch to handle hijacked event in synchronous mode
* Improve MiStartupOptionsTestCase tests to expect *stopped (MI)
* Add SBProcess::GetStopEventForStopID
* Add ProcessModID::SetStopEventForLastNaturalStopID/GetStopEventForStopID
* Add const qualifier to ProcessModID::GetLastNaturalStopID
* Add SBProcess::GetStopEventForStopID
* Don't broadcast hijacked event in Target::Launch
* Add CMICmnLLDBDebugger::CheckIfNeedToRebroadcastStopEvent/RebroadcastStopEvent

Test Plan: ./dotest.py -v --executable $BUILDDIR/bin/lldb tools/lldb-mi/startup_options/

Reviewers: zturner, jingham, clayborg, abidh

Reviewed By: clayborg

Subscribers: abidh, zturner, lldb-commits, clayborg, jingham

Differential Revision: http://reviews.llvm.org/D9371

llvm-svn: 237781
2015-05-20 10:15:47 +00:00
Siva Chandra 8fd94c9e68 [GDBRemoteCommunicationClient] Increase timeout for qfProcessInfo packet.
Summary:
The test in TestPlatformCommand which runs "platform process list" has
been timing out for Android when running running dosep.py with
LLDB_TEST_THREADS=8. This patch increases the packet timeout to a large
value of 1min to accommodate the long time required for a response for
the qfProcessInfo packet on Android.

Test Plan: LLDB_TEST_THREADS=8 ./dosep.py on Android.

Reviewers: chaoren

Reviewed By: chaoren

Subscribers: tberghammer, lldb-commits

Differential Revision: http://reviews.llvm.org/D9866

llvm-svn: 237752
2015-05-20 00:30:31 +00:00
Chaoren Lin 70e0cbb3ed Remove trailing slash from dumping directory FileSpec.
Reviewers: domipheus, ovyalov

Reviewed By: ovyalov

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D9862

llvm-svn: 237741
2015-05-19 23:11:58 +00:00
Enrico Granata 4518586234 A previous patch made it so that ValueObjects could update themselves even in the face of an invalid execution context (which was required for the dynamic and synthetic values of const objects)
It turns out, child values also need similar provisions

This patch simplifies things a bit allowing ValueObject subclasses to just declare whether they can accept an invalid context at update time, and letting the update machinery in the EvaluationPoint to the rest
Also, this lets ValueObjectChild proclaim that its parent chooses whether such blank-slate updates are possible

llvm-svn: 237714
2015-05-19 18:53:13 +00:00
Oleksiy Vyalov 09e9079d5c Use ADB pull to download modules from android target.
http://reviews.llvm.org/D9816

llvm-svn: 237640
2015-05-18 23:44:06 +00:00
Adrian McCarthy 2f8e4c3bf9 Enable debugging of multithreaded programs on Windows.
llvm-svn: 237637
2015-05-18 23:24:32 +00:00
Tamas Berghammer f4553e014e Fix encoding of BX instrucion in EmulateInstructionARM
llvm-svn: 237570
2015-05-18 14:55:51 +00:00
Ilia K 055ad9beba Add --move-to-nearest-code / target.move-to-nearest-code options (attempt 2)
This patch initially was committed in r237460 but later it was reverted (r237479) due to 4 new failures:
* TestExitDuringStep.py
* TestNumThreads.py
* TestThreadExit.py
* TestThreadStates.py

This patch also fixes these tests.

llvm-svn: 237566
2015-05-18 13:41:01 +00:00
Enrico Granata bb642e5456 Constant result ValueObjects are - well - constant
And they also do not have a thread/frame attached to them

That makes dynamic and synthetic values attached to them impossible to update - which, among other things, makes it impossible to properly display persistent variables of types that could have such dynamic/persistent values

Fix this by making it so that a ValueObject can control its constantness (hint: dynamic and synthetic values cannot be constant) and whether it wants to let itself be updated when an invalid thread is around

llvm-svn: 237504
2015-05-16 01:27:00 +00:00
Vince Harron 341eda4ca7 Fixed arm64 build error
llvm-svn: 237493
2015-05-16 00:26:20 +00:00
Greg Clayton 898c1b2cfe Don't crash if we have bad debug info that has a DW_TAG_inheritance with a bad DW_AT_type reference. Emit an error with instructions to file a bug.
<rdar://problem/20944860>

llvm-svn: 237485
2015-05-15 22:31:18 +00:00
Greg Clayton 9438056b83 Don't crash if a function has no name by calling 'strcmp(name, "main")'.
<rdar://problem/20925061>

llvm-svn: 237484
2015-05-15 22:20:29 +00:00
Vince Harron a66c695340 Reverting r237460 to fix test failures introduced on OSX & Linux
TestExitDuringStep.py
TestNumThreads.py
TestThreadExit.py
TestThreadStates.py

llvm-svn: 237479
2015-05-15 21:43:26 +00:00
Greg Clayton 67d49488a7 Don't allow infininte recursion when trying to resolve re-exported symbols.
<rdar://problem/20821289>

llvm-svn: 237477
2015-05-15 21:27:16 +00:00
Robert Flack eb83fabfa0 Only check _ZN function prefix in Linux and FreeBSD targets in SymbolFileDWARF
In http://reviews.llvm.org/D9754 I enabled the mangled symbol name lookup
workaround used to find global and anonymous namespace symbols in linux binaries
for all platforms, however we should still only check for these symbols when
processing Linux or FreeBSD binaries where they are relevant. This patch makes
this change.

Test Plan: The tests from the original revision still pass:
TestCallCPPFunction.py
TestCallStopAndContinue.py
TestExprs.py
TestExprsChar.py
TestNamespace.py
TestOverloadedFunctions.py
TestRvalueReferences.py
TestThreadExit.py

Differential Revision: http://reviews.llvm.org/D9782

llvm-svn: 237467
2015-05-15 18:59:59 +00:00
Greg Clayton 1548440c45 OperatingSystem plug-ins need to avoid running code when fetching thread lists. This patch helps with that by making all SBValue objects that are fetched not try to do dynamic type resolution. Objective C can end up running code to fetch a list of all ISA pointers so we can tell when something is dynamic and this running code could cause the OS plug-in to continue the target.
This fix disabled dynamic types, fetches the new threads from the OS plug-in, then restores the setting.

<rdar://problem/20768407> 

llvm-svn: 237465
2015-05-15 18:40:24 +00:00
Ilia K d9f1a78aa0 Add --move-to-nearest-code / target.move-to-nearest-code options
Summary:
This option forces to only set a source line breakpoint when there is an exact-match

This patch includes the following commits:
# Add the -m/--exact-match option in "breakpoint set" command
## Add exact_match arg in BreakpointResolverFileLine ctor
## Add m_exact_match field in BreakpointResolverFileLine
## Add exact_match arg in BreakpointResolverFileRegex ctor
## Add m_exact_match field in BreakpointResolverFileRegex
## Add exact_match arg in Target::CreateSourceRegexBreakpoint
## Add exact_match arg in Target::CreateBreakpoint
## Add -m/--exact-match option in "breakpoint set" command
# Add target.exact-match option to skip BP if source line doesn't match
## Add target.exact-match global option
## Add Target::GetExactMatch
## Refactor Target::CreateSourceRegexBreakpoint to accept LazyBool exact_match (was bool)
## Refactor Target::CreateBreakpoint to accept LazyBool exact_match (was bool)
# Add target.exact-match test in SettingsCommandTestCase
# Add BreakpointOptionsTestCase tests to test --skip-prologue/--exact-match options
# Fix a few typos in lldbutil.check_breakpoint_result func
# Rename --exact-match/m_exact_match/exact_match/GetExactMatch to --move-to-nearest-code/m_move_to_nearest_code/move_to_nearest_code/GetMoveToNearestCode
# Add exact_match field in BreakpointResolverFileLine::GetDescription and BreakpointResolverFileRegex::GetDescription, for example:
was:
```
1: file = '/Users/IliaK/p/llvm/tools/lldb/test/functionalities/breakpoint/breakpoint_command/main.c', line = 12, locations = 1, resolved = 1, hit count = 2
  1.1: where = a.out`main + 20 at main.c:12, address = 0x0000000100000eb4, resolved, hit count = 2
```
now:
```
1: file = '/Users/IliaK/p/llvm/tools/lldb/test/functionalities/breakpoint/breakpoint_command/main.c', line = 12, exact_match = 0, locations = 1, resolved = 1, hit count = 2
  1.1: where = a.out`main + 20 at main.c:12, address = 0x0000000100000eb4, resolved, hit count = 2
```

Test Plan:
./dotest.py -v --executable $BUILDDIR/bin/lldb functionalities/breakpoint/
./dotest.py -v --executable $BUILDDIR/bin/lldb settings/
./dotest.py -v --executable $BUILDDIR/bin/lldb tools/lldb-mi/breakpoint/

Reviewers: jingham, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits, clayborg, jingham

Differential Revision: http://reviews.llvm.org/D9273

llvm-svn: 237460
2015-05-15 18:16:15 +00:00
Pavel Labath 9eb1ecb9af [NativeProcessLinux] Fix removal of temporary breakpoints
Summary:
There was an issue in NPL, where we attempted removal of temporary breakpoints (used to implement
software single stepping), while some threads of the process were running. This is a problem
since we currently always use the main thread's ID in the removal ptrace call. Therefore, if the
main thread was still running, the ptrace call would fail, and the software breakpoint would
remain, causing all kinds of problems. This change removes the breakpoints after all threads have
stopped. This fixes TestExitDuringStep on Android arm and can also potentially help in other
situations, as previously the breakpoint would not get removed if the thread stopped for another
reason.

Test Plan: TestExitDuringStep passes, other tests remain unchanged.

Reviewers: tberghammer

Subscribers: tberghammer, aemerson, lldb-commits

Differential Revision: http://reviews.llvm.org/D9792

llvm-svn: 237448
2015-05-15 13:49:01 +00:00
Pavel Labath 6e35163cca [NativeProcessLinux] Fix potential race during thread exit
Summary:
This is the same issue as we had in D9145 for thread creation. Going through the full
ThreadDidStop/RequestResume cycle can cause a deferred notification to fire, which is not correct
when we are ignoring an event and resuming the thread. In this case it doesn't matter much since
the thread will die after that anyway, but for correctness, we should do the same thing here.
Also treating the SIGTRAP case the same way.

Test Plan: Tests continue to pass.

Reviewers: chaoren, ovyalov

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D9696

llvm-svn: 237445
2015-05-15 13:30:59 +00:00
Pavel Labath 48fca3b982 Fix StopInfoWatchpoint handling after r237411
r237411 exposed the following issue: ProcessGDBRemote used the description field in the
stop-reply to set the description of the StopInfo. In the case of watchpoints, the packet
description contains the raw address that got hit, which is not exactly the information we want
to display to the user as the stop info. Therefore, I have changed the code to use the packet
description only if the StopInfo does not already have a description. This makes the behavior
equivalent to the pre-r237411 behavior as then the SetDecription call got ignored for
watchpoints.

llvm-svn: 237436
2015-05-15 10:14:51 +00:00
Tamas Berghammer 69fc298a94 Fix virtual step handling in ThreadPlanStepInRange
Differential revision: http://reviews.llvm.org/D9773

llvm-svn: 237435
2015-05-15 10:14:15 +00:00
Ilia K 06d2855fb3 Fix a reason of *stopped notifications due to SIGINT/SIGSTOP signals (MI)
# Add SBProcess::GetInterruptedFromEvent
# Add vrEvent arg in CMICmnLLDBDebuggerHandleEvents::HandleProcessEventStateStopped
  and CMICmnLLDBDebuggerHandleEvents::HandleProcessEventStopSignal
# Refactor CMICmnLLDBDebuggerHandleEvents::HandleProcessEventStopSignal
## Clean up and fix typos
## Remove vwrbShouldBrk arg
# Fix MiSignalTestCase.test_lldbmi_stopped_when_stopatentry_{local,remote}
  to expect SIGSTOP instead of SIGINT

llvm-svn: 237426
2015-05-15 09:29:09 +00:00
Ilia K d50ea2fc15 Fix a few compile warnings
llvm-svn: 237425
2015-05-15 09:15:27 +00:00
Omair Javaid cdad63b33d LLDB build broke after applying patch http://reviews.llvm.org/D9706
This patch fixes the issue.

llvm-svn: 237421
2015-05-15 08:30:29 +00:00
Bhushan D. Attarde 794a4d5a9f Assembly profiler for mips32
Summary:
Implementation of assembly profiler for MIPS32 using EmulateInstruction which currently scans only prologue/epilogue assembly instructions. It uses llvm::MCDisassembler to decode assembly instructions.

Reviewers: clayborg, jasonmolenda

Differential Revision: http://reviews.llvm.org/D9769

llvm-svn: 237420
2015-05-15 06:53:30 +00:00
Omair Javaid ea8c25a802 This patch adds support for setting/clearing hardware watchpoints and breakpoints on AArch64 (Arm v8) 64-bit hardware.
http://reviews.llvm.org/D9706

llvm-svn: 237419
2015-05-15 06:29:58 +00:00
Oleksiy Vyalov 9953f0886b Reverting r237392 since it broke TestNumThreads on ubuntu builder.
llvm-svn: 237415
2015-05-15 02:05:10 +00:00
Jason Molenda 0453be9bd9 The StopInfo base class has an m_description std::string.
Remove the m_description ivar from the StopInfoBreakpoint
and StopInfoWatchpoint subclasses of StopInfo.  Also,
initialize the m_description ivar in the StopInfo ctor.
<rdar://problem/20902950> 

llvm-svn: 237411
2015-05-15 00:19:28 +00:00
Zachary Turner 275806f90b Don't bother dynamic loading the Windows Slim RW Lock API.
This API has been present since XP, and I think it's safe to
drop support for XP (since other things have been introduced long
ago which already don't work on XP anyway).

With this patch, we can statically bind against the exports and
not bother falling back to a CRITICAL_SECTION if we can't load
the API.

llvm-svn: 237402
2015-05-14 22:50:19 +00:00
Adrian McCarthy d26b0c4d31 Enable multithreaded debugging on Windows.
llvm-svn: 237392
2015-05-14 21:07:59 +00:00
Enrico Granata b2d643146f Implement an objc tagged-pointer info command that will provide information about what LLDB thinks an ObjC tagged pointer represents
llvm-svn: 237322
2015-05-14 00:46:47 +00:00
Ed Maste da04cb2643 Add mips64el trap opcode to PlatformFreeBSD as well
llvm-svn: 237315
2015-05-13 23:12:51 +00:00
Ed Maste af0494f158 Restore breaks lost in shuffling GetSoftwareBreakpointTrapOpcode
llvm-svn: 237313
2015-05-13 23:09:43 +00:00
Ed Maste dfef0cecd4 Add AArch64 and MIPS breakpoint opcodes and sort cases
New opcodes from PlatformLinux.cpp

llvm-svn: 237306
2015-05-13 22:40:01 +00:00
Ed Maste a157bc8539 Initial FreeBSD/arm live debugging support
Patch by Tom Rix, except using the RegisterContextFreeBSD_arm files
added in r235305 instead.

llvm-svn: 237303
2015-05-13 22:33:12 +00:00
Ed Maste a928d9550c Rearrange PlatformFreeBSD to match PlatformLinux
No functional change, but this simplifies diffs of the two.

llvm-svn: 237302
2015-05-13 22:26:24 +00:00
Zachary Turner ff33eefcc7 Fix an issue with finding python on Windows.
Someone must have changed the behavior of FileSpec slightly
relating to whether or not there is a trailing backslash when calling
GetPath() and GetDirectory().  This caused ScriptInterpreterPython
to find the wrong values when initializing sys.path, and as a result
we couldn't find the lldb module.

This patch fixes the issue, and also adds a test to make sure that
GetDirectory() does not return a string containing a trailing slash.

llvm-svn: 237282
2015-05-13 19:44:57 +00:00
Zachary Turner 1aa755ce77 Remove DoAttachToProcessWithId(lldb::pid_t).
There were two versions of DoAttachToprocessWithId.  One that takes
a pid_t, and the other which takes a pid_t and a ProcessAttachInfo.
There were no callers of the former version, and all of the
implementations of this version were simply forwarding calls to
one version or the other.

llvm-svn: 237281
2015-05-13 19:44:44 +00:00