Commit Graph

11819 Commits

Author SHA1 Message Date
Ed Maste 0e978481e1 Correct type in for loop to remove signedness warning
llvm-svn: 239918
2015-06-17 17:29:56 +00:00
Enrico Granata 443844c474 Revert r239873 - I actually want to think some more about this
llvm-svn: 239874
2015-06-17 02:11:48 +00:00
Enrico Granata ca201238ae Fix an issue where the oneliner printing of variables would ignore custom formatting
Because vector types use their formats in special ways (i.e. children get generated based on them), this change by itself would cause a regression in printing vector types with some custom formats
Work around that issue by special casing vector types out of this format-passdown mode. I believe there is a more general feature to be designed in this space, but until I see more cases of interest, I am going to leave this as a special case

Fixes rdar://20810062

llvm-svn: 239873
2015-06-17 02:06:24 +00:00
Enrico Granata 55d36e2b83 Add a ThreadSafe adapter over llvm::DenseSet
llvm-svn: 239865
2015-06-16 23:20:12 +00:00
Greg Clayton f7d163a8ea Clear the "thread-format" setting after mucking with it.
llvm-svn: 239863
2015-06-16 23:09:37 +00:00
Dawn Perchik 86e90b3cfa Fix comments (MI).
llvm-svn: 239861
2015-06-16 22:53:27 +00:00
Jim Ingham 637338543f Fix a typo in the help.
llvm-svn: 239854
2015-06-16 21:39:56 +00:00
Enrico Granata 84afb21563 Add a .parent property to SBFrame's Python interface which allows easy access to the caller frame of the current frame
llvm-svn: 239853
2015-06-16 21:07:52 +00:00
Enrico Granata 7569f23330 Fixing a potential issue where the NSIndexPath formatter could try to access stale data
No test because I did not see this happen - it has been found by code inspection as a response to seeing crash logs about this

llvm-svn: 239851
2015-06-16 20:48:49 +00:00
Enrico Granata 3b00e35b10 Enable 'command script import' to accept multiple modules to import in one invocation
Fixes rdar://21388472

llvm-svn: 239839
2015-06-16 18:31:04 +00:00
Tamas Berghammer 7ac23c3ae0 Fix compile error in TestCxxWCharT on Linux
llvm-svn: 239830
2015-06-16 16:58:34 +00:00
Ewan Crawford fab40d3911 Add Read Thread to GDBRemoteCommunication
In order to support asynchronous notifications for non-stop mode this patch adds a packet read thread. This is done by implementing AppendBytesToCache() from the communications class, which continually reads packets into a packet queue. To initialize this thread StartReadThread() must be called by the client, so since llgs and platform tools use the GBDRemoteCommunicatos code they must also call this function as well as ProcessGDBRemote.

When the read thread detects an async notify packet it broadcasts this event, where the matching listener will be added in the next non-stop patch.

Packets are now accessed by calling ReadPacket() which pops a packet from the queue, instead of using WaitForPacketWithTimeoutMicroSecondsNoLock()

Reviewers: vharron, clayborg

Subscribers: lldb-commits, labath, ted, domipheus, deepak2427 

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

llvm-svn: 239824
2015-06-16 15:50:18 +00:00
Enrico Granata 3ab6669eeb If a candidate keyword contains quotes, it's clearly not a keyword, so bail out early
There are other characters we could optimize for (any non-letter pretty much), but keyword.iskeyword() will handle them, whereas quotes do have the potential to confuse us, so they actually need custom handling

Fixes rdar://problem/21022787

llvm-svn: 239779
2015-06-15 23:12:29 +00:00
Enrico Granata bc2c2b0115 Add a formatter for wchar_t[N] arrays
rdar://21299888

llvm-svn: 239777
2015-06-15 23:01:47 +00:00
Enrico Granata a44c0e3122 Fix a bug where passing a value of the type "A B" to settings set target.env-vars would cause LLDB to crash
Fixes rdar://problem/21241817

llvm-svn: 239766
2015-06-15 21:37:05 +00:00
Greg Clayton 49e9010ca3 Found an issue that was causing types to be completed much more often than they needed to be.
The problem is for lldb_private::Type instances that have encoding types (pointer/reference/const/volatile/restrict/typedef to type with user ID 0x123). If they started out with m_flags.clang_type_resolve_state being set to eResolveStateUnresolved (0), then when we would call Type::ResolveClangType(eResolveStateForward) we would complete the full type due to logic errors in the code. 

We now only complete the type if clang_type_resolve_state is eResolveStateLayout or eResolveStateFull and we correctly upgrade the type's current completion state to eResolveStateForward after we make a forward delcaration to the pointer/reference/const/volatile/restrict/typedef type instead of leaving it set to eResolveStateUnresolved.

llvm-svn: 239752
2015-06-15 20:17:18 +00:00
Mohit K. Bhakkad 056c45a4a1 [LLDB][MIPS] Getting correct signals for MIPS Host
Patch by Nitesh Jain

Reviewers: clayborg, ovyalov.
Subscribers: jaydeep, bhushan, dsanders, mohit.bhakkad, sagar, labath, lldb-commits.
Differential Revision: http://reviews.llvm.org/D10180

llvm-svn: 239463
2015-06-10 10:02:21 +00:00
Oleksiy Vyalov 18f4c9f5a0 Mark TestMultithreaded as XTIMEOUT on Linux.
llvm-svn: 239450
2015-06-10 01:34:25 +00:00
Chaoren Lin 372e9067a7 Rename `FileSpec::IsRelativeToCurrentWorkingDirectory` to `IsRelative`.
Summary:
`IsRelativeToCurrentWorkingDirectory` was misleading, because relative paths
are sometimes appended to other directories, not just the cwd. Plus, the new
name is shorter. Also added `IsAbsolute` for completeness.

Reviewers: clayborg, ovyalov

Reviewed By: ovyalov

Subscribers: tberghammer, lldb-commits

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

llvm-svn: 239419
2015-06-09 17:54:27 +00:00
Chaoren Lin f7160f3fba XFail pexpect tests for Windows hosts.
Reviewers: vharron, zturner

Subscribers: lldb-commits

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

llvm-svn: 239414
2015-06-09 17:39:27 +00:00
Sagar Thakur 0e179ae7b7 [lldb-server][MIPS64] Assigning generic register numbers in register info for mips64
Use generic register numbers for argument registers, fp, ra and flag register in register info.

llvm-svn: 239394
2015-06-09 10:29:29 +00:00
Pavel Labath c7c30eb528 Revert "Introduce a TypeSystem interface to support adding non-clang languages."
This seems to break expression evaluation on the linux build.

llvm-svn: 239366
2015-06-08 23:38:06 +00:00
Pavel Labath c33ae024a6 Introduce a TypeSystem interface to support adding non-clang languages.
Reviewers: clayborg

Reviewed By: clayborg

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D8712
Original Author: Ryan Brown <ribrdb@google.com>

llvm-svn: 239360
2015-06-08 22:27:10 +00:00
Chaoren Lin e6eea5d055 Skip TestInferiorChanged if host platform is windows.
Summary: Opened files on Windows cannot be modified, so this test doesn't make sense.

Reviewers: ovyalov, zturner, flackr, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits

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

llvm-svn: 239359
2015-06-08 22:13:28 +00:00
Chaoren Lin 7d2f62dacc Fix TestSymbolContext for remote Windows to Android.
Summary: Denormalize path returned by SBFileSpec::GetDirectory().

Reviewers: zturner, clayborg

Reviewed By: clayborg

Subscribers: tberghammer, lldb-commits

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

llvm-svn: 239358
2015-06-08 22:12:58 +00:00
Greg Clayton 0734737b65 If we have a MachO file loaded from memory, make sure we can always get the symbol table even if we don't have the __LINKEDIT load address set in the target.
<rdar://problem/21208168>

llvm-svn: 239354
2015-06-08 21:53:11 +00:00
Oleksiy Vyalov 37ff6c4207 Switch from setPrintImmHex to setPrintHexStyle to follow changes from r239263.
llvm-svn: 239310
2015-06-08 17:10:27 +00:00
Bruce Mitchener 1425b47773 [LLDB-MI] Properly detect missing mandatory arguments to MI commands
Summary:
Previously if an MI command had **X** mandatory and **Y** optional arguments you could provide **X** or more optional arguments without providing any of the mandatory arguments, and the argument validation code wouldn't complain.

For example this would pass argument validation even though the mandatory **address** and **count** arguments are missing:

-data-read-memory-bytes --thread 1 --frame 0

Part of the problem was that an empty string was considered a valid value for a mandatory argument, which didn't make much sense.

Patch by Vadim Macagon. Thanks!

Test Plan:
./dotest.py -A x86_64 -C clang --executable $BUILDDIR/bin/lldb tools/lldb-mi/

No unexpected failures on my Ubuntu 14.10 64bit Virtualbox VM.

Reviewers: domipheus, ki.stfu, abidh

Reviewed By: ki.stfu, abidh

Subscribers: brucem, lldb-commits

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

llvm-svn: 239297
2015-06-08 11:15:09 +00:00
Chaoren Lin 0718c1a4d7 Silence warning on Windows.
llvm-svn: 239284
2015-06-08 04:39:24 +00:00
Chaoren Lin a4447b338c Update dosep to display dotest command invoked on failure.
llvm-svn: 239258
2015-06-07 18:50:40 +00:00
Chaoren Lin bcd2786a6d Use skipIf instead of skipUnless in TestTerminal for better readability.
llvm-svn: 239220
2015-06-06 14:51:34 +00:00
Chaoren Lin 5d76b1b56e Fix TestAttachDenied and TestChangeProcessGroup for remote Windows to Android.
Summary: Updated `append_to_remote_wd` to work for both remote and local.

Reviewers: clayborg, ovyalov

Reviewed By: ovyalov

Subscribers: tberghammer, lldb-commits

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

llvm-svn: 239203
2015-06-06 00:25:50 +00:00
Chaoren Lin 05763f5752 Update TestGdbRemoteAbort and TestGdbRemoteSegFault to use `get_signal_number`.
Reviewers: clayborg, ovyalov

Reviewed By: ovyalov

Subscribers: lldb-commits

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

llvm-svn: 239201
2015-06-06 00:19:01 +00:00
Pavel Labath 83a4b3f225 Remove unused editline includes
LLDB included editline in a couple of places, not respecting LLDB_DISABLE_LIBEDIT. As far as I can tell, these includes are not used, so I am removing them.

llvm-svn: 239199
2015-06-05 23:14:14 +00:00
Chaoren Lin 55c1c3495d Fix TestNamespace and TestThreadJump for remote Windows to Android.
Summary:
Update DYLDRendezvous and SOEntry to use FileSpecs instead of storing paths as
strings, which caused incorrect comparison results due to denormalization.

Reviewers: clayborg, vharron, ovyalov

Reviewed By: ovyalov

Subscribers: jwolfe, emaste, tberghammer, lldb-commits

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

llvm-svn: 239195
2015-06-05 22:03:19 +00:00
Chaoren Lin bb2cc9cf56 Unique file names for TestStarted and TestFinished.
Summary: This fixes the issue of multiple test suites opening the same file for writing.

Reviewers: clayborg, zturner

Subscribers: lldb-commits

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

llvm-svn: 239188
2015-06-05 21:08:24 +00:00
Siva Chandra 77f20fc8d3 [TestGdbRemoteAbort] Skip on API 16 Android devices
Summary:
This change also adds the infrastructure required to specify the API
levels for which tests should be skipped.

Reviewers: chying, labath

Reviewed By: labath

Subscribers: tberghammer, lldb-commits

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

llvm-svn: 239183
2015-06-05 19:54:49 +00:00
Ed Maste db6fd1ac25 Removed unused private fields in RegisterContextLinux_mips
llvm-svn: 239181
2015-06-05 18:50:33 +00:00
Siva Chandra 29e0392944 [lldbtest] Use netloc instead of hostname to look up Android device ID.
Summary:
urlparse.ParseResult.hostname has only lowercase characters even if the
input URL had uppercase characters. Since Android device IDs can have
uppercase characters as well, use urlparse.ParseResult.netloc instead
and extract the device ID from it.

This change also improves the error message when lookup of the Android
device's API fails.

Reviewers: chaoren

Reviewed By: chaoren

Subscribers: tberghammer, lldb-commits

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

llvm-svn: 239173
2015-06-05 18:07:10 +00:00
Ed Maste f6a1312f1b Improve OSType initialization in elf object file's arch_spec
Setting the OSType in the ArchSpec triple is needed to correctly setup
up the register context plugin. ArchSpec::SetArchitecture, for Mach-O
only, sets the OSType. For ELF it was left to the ObjectFileELF to fill
in the missing OSType.

This change moves the ObjectFileELF logic into ArchSpec.

A new optional 'os' parameter has been added to SetArchitecture.
For ELF, this value is the from the ELF header.e_ident[EI_OSABI].
The default value is 0 or ELFOSABI_NONE.

The real work of determining the OSType was done by the ObjectFileELF
helper function GetOsFromOSABI. This logic has been moved
SetArchitecture.

GetOsFromOSABI has been commented as being deprectated.  It is left in
to support asserts.

For ELF the vendor value returned from SetArchitecture should be
UnknownVendor.  An unneeded resetting in ObjectFileELF has been removed
and replaced with an assert.

This fixes a problem reading a core file on FreeBSD/ARM because the spec
triple was arm-unknown-unknown.

Patch by Tom Rix.

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

llvm-svn: 239148
2015-06-05 13:03:08 +00:00
Chaoren Lin 52cf8ecc23 Check before using platform specific attributes.
Summary: `os.uname` in TestUniversal and `os.geteuid` in TestTerminal.

Reviewers: clayborg, zturner

Subscribers: lldb-commits

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

llvm-svn: 239135
2015-06-05 06:28:43 +00:00
Sagar Thakur 0abe018c91 [lldb-server][MIPS] Read/Write FP registers in FR0 mode
Adding support for read/write FP registers in FR0 mode of mips.

Reviewers: clayborg, tberghammer, jaydeep
Subscribers: emaste, nitesh.jain, bhushan, mohit.bhakkad, lldb-commits
Differential Revision: http://reviews.llvm.org/D10242

llvm-svn: 239132
2015-06-05 05:47:54 +00:00
Oleksiy Vyalov 6002a31bb8 Fix error handling in AdbClient - PushFile and PullFile.
http://reviews.llvm.org/D10176

llvm-svn: 239130
2015-06-05 01:32:45 +00:00
Chaoren Lin 0c5a9c1476 Delegate path operations to FileSpec.
Summary:
- Added PrependPathComponent utility functions to FileSpec.
- Delegate path operations in ParseCompileUnit to FileSpec.
- Delegate path operations in ParseSupportFiles to FileSpec.

Reviewers: clayborg, vharron, ovyalov

Reviewed By: ovyalov

Subscribers: lldb-commits

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

llvm-svn: 239127
2015-06-05 00:28:06 +00:00
Siva Chandra 8af9166efe [TestChangeProcessGroup] Mark the test as xfail for Android API 16
Summary:
This change adds the infrastructure to mark tests as xfail for specific
Android API levels.

Test Plan: dotest.py TestChangeProcessGroup on an Android API 16 device.

Reviewers: chying, labath, chaoren

Reviewed By: labath, chaoren

Subscribers: tberghammer, lldb-commits

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

llvm-svn: 239126
2015-06-05 00:22:49 +00:00
Siva Chandra d772ef3d9f [TestGdbRemoteRegisterState] Do not flip ARM *psr register in the test
Summary:
Not all of that register is readable/writable in user mode. This means
that even if the inferior is stopped, parts of the register could be
changing. So, do not flip this register to check if its value can be
restored.

Reviewers: tberghammer, chaoren

Reviewed By: tberghammer

Subscribers: rengolin, aemerson, lldb-commits

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

llvm-svn: 239104
2015-06-04 22:04:04 +00:00
Bruce Mitchener bc46ec7da7 Fix doxygen warnings.
Summary:
Building the doxygen target presented some warnings which are now
addressed by this patch.

Test Plan: Ran doxygen build target and these warnings were no longer present.

Subscribers: lldb-commits

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

llvm-svn: 239055
2015-06-04 16:53:46 +00:00
Jason Molenda 294af5ce9c Make the function that parses the json packets in debugserver
a little more resilient to freely formatted json.  Greg's change
in r238279 made the json output from StructuredData unconditionally
pretty-printed and the spaces were confusing debugserver.

llvm-svn: 239013
2015-06-04 06:03:03 +00:00
Andrew Wilkins 7175f16cdb [lldb] Enable building with Cmake/BUILD_SHARED_LIBS
Summary:
Several changes to fix CMake builds of LLDB with the
BUILD_SHARED_LIBS setting on.

- Force all internal libraries to be built STATIC.
- Add additional library dependencies (pthread, dl,
  runtimedyld).
- modify finalisation of SWIG wrapper to symlink the
  "lib" dir into python/site-packages, so _lldb.so's
  RPATH resolves.

Test Plan: Verified one test case with "dotest.py".

Reviewers: sylvestre.ledru, zturner

Reviewed By: zturner

Subscribers: zturner, ted, tberghammer, emaste, lldb-commits

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

llvm-svn: 239007
2015-06-04 03:12:37 +00:00
Enrico Granata 600aee6b69 I make no claims that Mach ports work, but at least we should check the right thing
llvm-svn: 238984
2015-06-03 22:35:55 +00:00
Ed Maste 8eeb3e290d Skip test failing on FreeBSD buildbot due to pexepect issues
The pexpect exception is not handled by expectedFailureFreeBSD, so just
skip the test for now.

llvm.org/pr22784

llvm-svn: 238977
2015-06-03 21:21:40 +00:00
Ed Maste dc8dd07e17 XFAIL TestPlatformCommand test failing on the FreeBSD buildbot
llvm.org/pr23747

llvm-svn: 238976
2015-06-03 21:21:00 +00:00
Enrico Granata d595733617 Fix a bug where trying to Dump() a ValueObject would use the static/non-synthetic version of the value even if the ValueObject one actually called Dump() on turned out to be dynamic and/or synthetic
This was of course overridable by using DumpValueObjectOptions, but the default should be saner and the previous behavior made for a few fun investigations....

rdar://problem/21065149

llvm-svn: 238961
2015-06-03 20:43:54 +00:00
Sagar Thakur ce815e4588 [MIPS][lldb-server] Add 32-bit register context and read/write FP registers on mips64
- Added support for read/write FP registers in FR1 mode.
    - Added 32 bit register context for mips32.

Reviewers: clayborg, tberghammer, jaydeep
Subscribers: emaste, nitesh.jain, bhushan, mohit.bhakkad, lldb-commits
Differential Revision: http://reviews.llvm.org/D10029

llvm-svn: 238914
2015-06-03 10:14:24 +00:00
Greg Clayton b2e0c11982 Fixed "format-string" based settings so they can have quotes on them without leaving the quotes in the format string:
(lldb) settings set thread-format "abc"
(lldb) settings set thread-format 'abc'
(lldb) settings set thread-format abc

We strip the quotes before processing the format string and return an "error: mismatched quotes" if mismatched quotes are given.

<rdar://problem/21210789>

llvm-svn: 238896
2015-06-03 02:02:48 +00:00
Greg Clayton 23d54f4eac Fixed a deadlock that was slowing down processes when they shut down. A 3 second delay could occur sometimes when a process exits, now that delay is gone.
llvm-svn: 238893
2015-06-03 00:34:01 +00:00
Greg Clayton 5a27195b1a Fix LLDB so that it can correctly track down dependent shared libraries that use @rpath.
<rdar://problem/8371885>

llvm-svn: 238886
2015-06-02 22:43:29 +00:00
Chaoren Lin e79b472162 Update TestConcurrentEvents to use UnixSignals instead of python signals.
Reviewers: clayborg, ovyalov

Reviewed By: ovyalov

Subscribers: lldb-commits

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

llvm-svn: 238872
2015-06-02 21:54:22 +00:00
Greg Clayton 5e3f20d791 Fixed the logic to determine the TRIPLE_VERSION correctly when it isn't specified.
llvm-svn: 238871
2015-06-02 21:42:31 +00:00
Greg Clayton 315b88d0cf Added the ability for the "make" command to take a triple:
% cd lldb/test/lang/c/array_types
% make TRIPLE=x86_64-apple-ios
% make clean
% make TRIPLE=x86_64-apple-ios8.1
% make clean
% make TRIPLE=armv7-apple-ios
% make clean
% make TRIPLE=armv7-apple-ios8.1
% make clean

The TRIPLE variable will automatically set the following variables:
    SDKROOT if it isn't specified manually
    ARCH will be set to the architecture from the triple
    CFLAGS will include the extras needed for the triple which are set in TRIPLE_CFLAGS
    TRIPLE_VENDOR set to the triple vendor ("apple" in the above cases)
    TRIPLE_OS set to the triple OS ("ios" in the above cases)
    TRIPLE_VERSION set to the version that was specified, or automatically set to the SDK version if it is missing

This allows you to change directory into any test case on MacOSX and quickly build for desktop:

% make

iOS simulator:

% make TRIPLE=x86_64-apple-ios

or iOS device:

% make TRIPLE=armv7-apple-ios

llvm-svn: 238869
2015-06-02 21:38:10 +00:00
Jim Ingham acbea8fb37 Fix up some comments to be more explicit. Remove some long-commented out code.
llvm-svn: 238862
2015-06-02 20:26:13 +00:00
Oleksiy Vyalov 17701b5929 Fix PlatformAndroid::PutFile to support relative destination paths.
llvm-svn: 238860
2015-06-02 19:29:48 +00:00
Chaoren Lin c168c92b78 Use wildcard instead of relying on shell globbing.
Reviewers: clayborg, zturner

Subscribers: lldb-commits

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

llvm-svn: 238859
2015-06-02 19:07:26 +00:00
Chaoren Lin 264e542083 Check that debugger is valid before enumerating targets.
Reviewers: sivachandra

Subscribers: lldb-commits

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

llvm-svn: 238857
2015-06-02 18:31:57 +00:00
Ed Maste e1abaf870f TestGlobalVariables no longer fails on FreeBSD
It has passed since ~ r223393.

llvm.org/21599

llvm-svn: 238856
2015-06-02 18:29:42 +00:00
Chaoren Lin 677acee503 Use new get_signal_number utility function for tests.
Summary:
This fixes TestLldbGdbServer and TestSendSignal from Windows to Android.
This change depends on D10171.

Reviewers: clayborg, ovyalov

Reviewed By: clayborg, ovyalov

Subscribers: tberghammer, lldb-commits

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

llvm-svn: 238852
2015-06-02 17:01:13 +00:00
Chaoren Lin f59d050968 Added utility function to get correct signal number from remote platform.
Summary:
This change adds a utility that uses the `kill -l` command to get the
correct signal number. Falls back to using `SBUnixSignals`, and finally
`signal.SIG<signal>` if all else fails.

Reviewers: tberghammer, clayborg, ovyalov

Reviewed By: clayborg, ovyalov

Subscribers: tberghammer, lldb-commits

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

llvm-svn: 238850
2015-06-02 16:46:28 +00:00
Chaoren Lin 7d76a13bf3 Fix OBJCOPY and AR for Android.
Summary:
Previously, OBJCOPY was empty because of the missing comma,
and ar was just `ar`.

Reviewers: ovyalov, tberghammer

Subscribers: tberghammer, lldb-commits

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

llvm-svn: 238849
2015-06-02 16:43:19 +00:00
Tamas Berghammer 0b11db50dd Mark TestHelloWorld as XTIMEOUT for Linux
It is times out on the build bot ~10% of the times

llvm-svn: 238836
2015-06-02 14:45:25 +00:00
Ed Maste c5603ec44c Skip TestChangeProcessGroup on FreeBSD for now
It consistently times out. The test is already XTIMEOUT'd, but causes
tests to take an extra 5 minutes waiting for the timeout to expire.

llvm.org/pr23731

llvm-svn: 238833
2015-06-02 14:11:25 +00:00
Pavel Labath 8e9c266a77 Un-enable TestEvents test on linux
Test still seems to fail about 1/10 runs. Skipping the test, but it a more greppable fashion.

llvm-svn: 238826
2015-06-02 12:50:25 +00:00
Mohit K. Bhakkad d37be6374b [LLDB][MIPS] MIPS64 Branch instruction emulation for SW single stepping
Patch by Jaydeep Patil

Reviewers: clayborg, jasonmolenda
Subscribers: bhushan, mohit.bhakkad, sagar, lldb-commits.
Differential Revision: http://reviews.llvm.org/D10155

llvm-svn: 238820
2015-06-02 11:22:29 +00:00
Aidan Dodds 7f7b61dc53 Change use of keyword 'or' to '||' as keyword not supported by visual studio 2013.
llvm-svn: 238819
2015-06-02 11:20:44 +00:00
Pavel Labath e0f9708410 Enable TestEvents test on linux
This test was very inconspicuosly skipped on linux, when it was crashing for local debugging. It
seems to work fine with LLGS, so I'm enabling it.

llvm-svn: 238816
2015-06-02 10:19:33 +00:00
Greg Clayton 81e2b6bbe7 Fix a race condition where 2 threads might try to call Process::SetExitStatus() at the same time.
The problem was the mutex was only protecting the setting of m_exit_string and m_exit_string, but this function relies on the m_private_state being set to eStateExited in order to prevent more than 1 client setting the exit status. We want to only allow the first caller to succeed.

On MacOSX we have a thread that reaps the process we are debugging, and we also have a thread that monitors the debugserver process. When a process exists, the ProcessGDBRemote::AsyncThread() would set the exit status to the correct value and then another thread would reap the debugserver process and they would often both end up in Process::SetExitStatus() at the same time. With the mutex at the top we allow all variables to be set and the m_private_state to be set to eStateExited _before_ the other thread (debugserver reaped) can try to set th exist status to -1 and "lost connection to debugserver" being set as the exit status.

This was probably an issue for lldb-server as well and could very well cleanup some tests that might have been expecting a specific exit status from the process being debugged.

llvm-svn: 238794
2015-06-01 23:14:09 +00:00
Adrian McCarthy 3ae7492b2d Fix TestJoinAfterBreak test on Windows
llvm-svn: 238787
2015-06-01 21:51:50 +00:00
Chaoren Lin 273aea894f Dump error if dotest itself fails and no tests were run.
Reviewers: zturner, clayborg

Subscribers: lldb-commits

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

llvm-svn: 238771
2015-06-01 19:06:01 +00:00
Oleksiy Vyalov dd5313a5cc Don't close handle returned by _get_osfhandle.
http://reviews.llvm.org/D9931

llvm-svn: 238770
2015-06-01 18:52:16 +00:00
Colin Riley 4640cde19b Additional RenderScript debug features.
Base framework for inspecting RenderScript runtime details and helpers for various runtime actions on x86 and arm targets.

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

llvm-svn: 238768
2015-06-01 18:23:41 +00:00
Chaoren Lin b79863c2cc Fix TestPaths.
Reviewers: vharron, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits

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

llvm-svn: 238767
2015-06-01 18:04:10 +00:00
Chaoren Lin 5e3ab2b95f Updated dosep.py to output progress and dump std{out,err} on test failure.
Reviewers: vharron, clayborg, zturner

Subscribers: lldb-commits

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

llvm-svn: 238765
2015-06-01 17:49:25 +00:00
Greg Clayton 811051e3d6 Fix types.py to actually be able to run check_padding_command() without erroring out.
<rdar://problem/21071347>

llvm-svn: 238764
2015-06-01 17:28:45 +00:00
Hafiz Abid Qadeer bfca0d7f7b Initialize 3 variables which were being used un-initialized.
No regression on testsuite. Comitted as obvious.

llvm-svn: 238761
2015-06-01 17:08:30 +00:00
Ed Maste 41fba2b5d0 Refactor many file functions to use FileSpec over strings.
This is the FreeBSD change for r238604.

llvm-svn: 238752
2015-06-01 15:24:37 +00:00
Tamas Berghammer 0f8452ba2e Fix address adjusment in stack frame inline block lookup
When the current address is pointing 1 (unit) over the end of a
section the we have to do a section lookup after making the adjusment
of the current address.

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

llvm-svn: 238737
2015-06-01 10:38:23 +00:00
Chaoren Lin 0dba2b399e Remove "%zu" format specifier for MSVC.
Reviewers: zturner

Subscribers: lldb-commits

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

llvm-svn: 238722
2015-06-01 04:28:12 +00:00
Adrian McCarthy e1adc7bc3a Fix inferior's i/o connections to its console window on Windows 7.
llvm-svn: 238629
2015-05-29 23:01:25 +00:00
Oleksiy Vyalov 32a9da5668 Use FileSpec::IsRelativeToCurrentWorkingDirectory instead of llvm::sys::path::is_relative in PlatformAndroid::GetFile.
http://reviews.llvm.org/D10141

llvm-svn: 238624
2015-05-29 22:54:45 +00:00
Oleksiy Vyalov 817f40a7fa Leave OS type and vendor as unspecified unknowns.
http://reviews.llvm.org/D10080

llvm-svn: 238623
2015-05-29 22:45:47 +00:00
Ed Maste 85f84e0b74 XFAIL additional signal vs exception tests failing on FreeBSD
We need to apply to FreeBSD a change equivalent to r238549.

llvm.org/pr23699

llvm-svn: 238616
2015-05-29 21:42:53 +00:00
Ed Maste 0b8bbc6dfd XFAIL TestHandleSegv on FreeBSD
We need to apply to FreeBSD a change equivalent to r238549.

llvm.org/pr23699

llvm-svn: 238615
2015-05-29 21:34:12 +00:00
Oleksiy Vyalov 671a194d88 Fix build - GetRemoteWorkingDirectory returns FileSpec instead of ConstString.
llvm-svn: 238610
2015-05-29 20:32:26 +00:00
Oleksiy Vyalov 291f59c582 Fix PlatformAndroid::GetFile - check for relative source path and concatenate it with current working directory if needed.
llvm-svn: 238606
2015-05-29 20:02:07 +00:00
Chaoren Lin 44145d79cc Working directory FileSpec should use remote path syntax to display correctly.
Summary: Depends on D9728.

Reviewers: ovyalov, zturner, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits

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

llvm-svn: 238605
2015-05-29 19:52:37 +00:00
Chaoren Lin d3173f34e8 Refactor many file functions to use FileSpec over strings.
Summary:
This should solve the issue of sending denormalized paths over gdb-remote
if we stick to GetPath(false) in GDBRemoteCommunicationClient, and let the
server handle any denormalization.

Reviewers: ovyalov, zturner, vharron, clayborg

Reviewed By: clayborg

Subscribers: tberghammer, emaste, lldb-commits

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

llvm-svn: 238604
2015-05-29 19:52:29 +00:00
Ed Maste 375432e4d8 Improve test for g++ 4.6
Skip the g++ 4.6 test if we're not going to build any C++ source.
If a test has C++ source files we automatically determine which C++
compiler to use based on $CC (for example, clang++ if CC=clang).
However, this is not done for tests without C++ source and CXX will
be GNU make's default of g++.  This produces suprious "g++: not found"
errors in testrun output on systems without a gcc/g++.

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

llvm-svn: 238603
2015-05-29 19:52:02 +00:00
Ed Maste 36cbc0901f TestHandleSegv: also assert that we have a thread
If get_stopped_thread(... eStopReasonSignal) returns no thread, the
thread.IsValid assertion would throw AttributeError: 'NoneType' object
has no attribute 'IsValid'.

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

llvm-svn: 238600
2015-05-29 19:38:41 +00:00
Chaoren Lin 0ef0027a0b Implement snprintf for MSVC with correct return value.
Reviewers: zturner

Subscribers: lldb-commits

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

llvm-svn: 238599
2015-05-29 19:34:57 +00:00
Ying Chen 223dd95f24 Add '+' sign at the end of echo message for debugserver
Summary:
-ammend to r238538
-Fix test failure of TestGdbRemoteAuxvSupport.py and TestLldbGdbServer.py on MacOSX

Test Plan:
./dotest -p TestGdbRemoteAuxvSupport.py
./dotest -p TestLldbGdbServer.py

Reviewers: chaoren, clayborg

Subscribers: lldb-commits

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

llvm-svn: 238595
2015-05-29 18:44:08 +00:00
Chaoren Lin 9d2b7f982c Fix hanging test suite when dosep.py is invoked directly.
Reviewers: zturner, sivachandra

Subscribers: lldb-commits

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

llvm-svn: 238594
2015-05-29 18:43:46 +00:00
Greg Clayton c8a8b5c243 Unbreak mac build.
llvm-svn: 238590
2015-05-29 18:28:01 +00:00
Zachary Turner 365dc291b1 Re-add #include "lldb-python.h" back in two places.
Fixing these two instances will require some work, so for now
I'm adding these 2 includes back to get the build working.

llvm-svn: 238587
2015-05-29 18:18:26 +00:00
Zachary Turner 1124045ac7 Don't #include "lldb-python.h" from anywhere.
Since interaction with the python interpreter is moving towards
being more isolated, we won't be able to include this header from
normal files anymore, all includes of it should be localized to
the python library which will live under source/bindings/API/Python
after a future patch.

None of the files that were including this header actually depended
on it anyway, so it was just a dead include in every single instance.

llvm-svn: 238581
2015-05-29 17:41:47 +00:00
Hafiz Abid Qadeer ba9614f643 Improve handling of print value argument in -stack-list-* commands.
It was reviewed in http://reviews.llvm.org/D10106.
Patch by paulmaybee.

llvm-svn: 238572
2015-05-29 16:48:40 +00:00
Pavel Labath 674bc7b0c4 XFAIL two tests for android
bug #23694

llvm-svn: 238558
2015-05-29 14:54:46 +00:00
Pavel Labath 5b981ab9e5 [NativeProcessLinux] clean up #includes
llvm-svn: 238551
2015-05-29 12:53:54 +00:00
Pavel Labath c4e25c9648 Report inferior SIGSEGV as a signal instead of an exception on linux
Summary:
Previously, we reported inferior receiving SIGSEGV (or SIGILL, SIGFPE, SIGBUS) as an "exception"
to LLDB, presumably to match OSX behaviour. Beside the fact that we were basically lying to the
user, this was also causing problems with inferiors which handle SIGSEGV by themselves, since
LLDB was unable to reinject this signal back into the inferior.

This commit changes LLGS to report SIGSEGV as a signal. This has necessitated some changes in the
test-suite, which had previously used eStopReasonException to locate threads that crashed. Now it
uses platform-specific logic, which in the case of linux searches for eStopReasonSignaled with
signal=SIGSEGV.

I have also added the ability to set the description of StopInfoUnixSignal using the description
field of the gdb-remote packet. The linux stub uses this to display additional information about
the segfault (invalid address, address access protected, etc.).

Test Plan: All tests pass on linux and osx.

Reviewers: ovyalov, clayborg, emaste

Subscribers: emaste, lldb-commits

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

llvm-svn: 238549
2015-05-29 10:13:03 +00:00
Greg Clayton aeb3b8b1c0 Change ProcessEventData over to use a std::weak_ptr to a process intead of a std::shared_ptr. Anyone consuming events for a process should have the process around long enough to grab the event and anyone that holds onto an event for too long won't keep the process around.
llvm-svn: 238541
2015-05-29 03:20:37 +00:00
Ying Chen 5340683e7a Add '+' sign at the end of echo package
Summary:
-Fix lldb test failures introduced by r238530
-This fix TestGdbRemoteAuxvSupport.py and TestLldbGdbServer.py

Test Plan:
./dotest -p TestGdbRemoteAuxvSupport.py
./dotest -p TestLldbGdbServer.py

Reviewers: clayborg, chaoren, vharron

Subscribers: lldb-commits

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

llvm-svn: 238535
2015-05-29 01:02:07 +00:00
Greg Clayton 420562aa82 Add support for the qEcho command to lldb-server in the common packets.
llvm-svn: 238533
2015-05-29 00:15:15 +00:00
Siva Chandra de4c598ccf [TestLldbGdbServer and TestGdbRemoteXXX] Use "ls -l" instead of "readlink"
Summary:
Old Android devices, for example API 16, do not have the "readlink"
command. To take care of such devices, this commit changes to use "ls -l"
instead of "readlink" to get the lldb-server exe path.

The tests fixed with this change for an Android API 16 arm device are:

TestGdbRemoteAttach
TestGdbRemoteAuxvSupport
TestGdbRemoteExpeditedRegisters
TestGdbRemoteKill
TestGdbRemoteProcessInfo
TestGdbRemoteSegFault
TestGdbRemoteThreadsInStopReply
TestGdbRemote_qThreadStopInfo

Further, all tests in TestLldbGdbServer pass (previously erroring out),
except one which times out.

Test Plan:
Run dosep.py with 8 test threads targetting Android API 16
device.

Reviewers: vharron, ovyalov

Reviewed By: ovyalov

Subscribers: tberghammer, aemerson, lldb-commits

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

llvm-svn: 238532
2015-05-29 00:14:16 +00:00
Greg Clayton b30c50c8fa Add a new "qEcho" packet with the following format:
qEcho:%s

where '%s' is any valid string. The response to this packet is the exact packet itself with no changes, just reply with what you received!

This will help us to recover from packets timing out much more gracefully. Currently if a packet times out, LLDB quickly will hose up the debug session. For example, if we send a "abc" packet and we expect "ABC" back in response, but the "abc" command takes longer than the current timeout value this will happen:


--> "abc"
<-- <<<error: timeout>>>

Now we want to send "def" and get "DEF" back:

--> "def"
<-- "ABC"

We got the wrong response for the "def" packet because we didn't sync up with the server to clear any current responses from previously issues commands.

The fix is to modify GDBRemoteCommunication::WaitForPacketWithTimeoutMicroSecondsNoLock() so that when it gets a timeout, it syncs itself up with the client by sending a "qEcho:%u" where %u is an increasing integer, one for each time we timeout. We then wait for 3 timeout periods to sync back up. So the above "abc" session would look like:

--> "abc"
<-- <<<error: timeout>>> 1 second
--> "qEcho:1"
<-- <<<error: timeout>>> 1 second
<-- <<<error: timeout>>> 1 second
<-- "abc"
<-- "qEcho:1"

The first timeout is from trying to get the response, then we know we timed out and we send the "qEcho:1" packet and wait for 3 timeout periods to get back in sync knowing that we might actually get the response for the "abc" packet in the mean time...

In this case we would actually succeed in getting the response for "abc". But lets say the remote GDB server is deadlocked and will never response, it would look like:

--> "abc"
<-- <<<error: timeout>>> 1 second
--> "qEcho:1"
<-- <<<error: timeout>>> 1 second
<-- <<<error: timeout>>> 1 second
<-- <<<error: timeout>>> 1 second

We then disconnect and say we lost connection.

We might also have a bad GDB server that just dropped the "abc" packet on the floor. We can still recover in this case and it would look like:

--> "abc"
<-- <<<error: timeout>>> 1 second
--> "qEcho:1"
<-- "qEcho:1"

Then we know our remote GDB server is still alive and well, and it just dropped the "abc" response on the floor and we can continue to debug.

<rdar://problem/21082939>

llvm-svn: 238530
2015-05-29 00:01:55 +00:00
Chaoren Lin 9acea45e19 Fix TestMultithreaded.
llvm-svn: 238529
2015-05-29 00:01:15 +00:00
Ying Chen 10ed1a9ce7 Add "Failing Tests .." line to dosep logs
Summary:
-Buildbot parser depends on this line as start flag
-Will remove the dependency from buildbot parser, but it takes some time to take effect
-Will remove this line from printout after buildbot master reconfig

Reviewers: chaoren, vharron

Subscribers: lldb-commits

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

llvm-svn: 238527
2015-05-28 23:51:49 +00:00
Chaoren Lin 45c17ff6c2 Remove warning when testing for timeout command.
llvm-svn: 238522
2015-05-28 23:00:10 +00:00
Sean Callanan cc3489f662 Added a test that makes sure that structs returned
from expressions return intact.

<rdar://problem/21146609>

llvm-svn: 238512
2015-05-28 21:58:52 +00:00
Chaoren Lin 842b214ac1 Simplify regex in TestDataFormatterUnordered.py for better readability.
Summary:
Using `(match){3}` instead of `matchmatchmatch`.
This is an update to D10078.

Test Plan: no change in test behavior.

Reviewers: clayborg, sivachandra

Reviewed By: sivachandra

Subscribers: lldb-commits

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

llvm-svn: 238510
2015-05-28 21:52:07 +00:00
Chaoren Lin 7f9511409b Resubmitting r238459 and r238460 with fix for Linux.
llvm-svn: 238499
2015-05-28 21:19:31 +00:00
Ying Chen b6762734f0 Revert "Move inlined cxa_demangle.cpp to a separate file."
This reverts commit 8cb47a2140f3e93a34597fc9f11c8cd96130076d.

llvm-svn: 238497
2015-05-28 21:06:36 +00:00
Ying Chen fd6c7ad3ce Revert "Allow both MSVC and Itanium mangling schemes."
Cause build break.

This reverts commit 6d986061393f2863fec739e04412281148acc1f3.

llvm-svn: 238496
2015-05-28 21:06:33 +00:00
Ying Chen 1135e709c0 Skip ThreadStateTestCase.test_state_after_continue_with_dwarf on Darwin
Summary:
- This test cause Python crash randomly on darwin builder
- Tracked by bug 'llvm.org/pr23669'

Test Plan: ./dotest.py -m --executable /Users/lldb_build/testSlave/buildDir/lldb.src/build/Debug/lldb --framework /Users/lldb_build/testSlave/buildDir/lldb.src/build/Debug/LLDB.framework -A x86_64 -C clang -p TestThreadStates.py

Reviewers: chaoren, vharron

Subscribers: lldb-commits

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

llvm-svn: 238495
2015-05-28 21:03:26 +00:00
Greg Clayton 2d7ab874c1 Fix the Xcode build after the recent new demangling files were added.
llvm-svn: 238493
2015-05-28 20:57:55 +00:00
Sean Callanan 8ebc973133 If we see an external function in the symbols, make
it an extern "C" function instead of a C++ function
so that Clang doesn't emit a mangled function reference.

Also removed the hack in ClangExpressionDeclMap that
works around this.

llvm-svn: 238476
2015-05-28 20:07:44 +00:00
Sean Callanan 235de0aed3 Don't crash if we don't have a process and need
to check for alternate manglings.

llvm-svn: 238475
2015-05-28 20:06:40 +00:00
Zachary Turner 386aafa6e3 Remove unused #includes of ScriptInterpreterPython.h
llvm-svn: 238470
2015-05-28 19:57:03 +00:00
Zachary Turner c48ec9d0ff Including <thread> with MSVC is buggy, use a workaround here.
llvm-svn: 238469
2015-05-28 19:56:43 +00:00
Zachary Turner c7a7c8acca Refactor test runner to print sub-test-case pass/fail rate.
llvm-svn: 238467
2015-05-28 19:56:26 +00:00
Chaoren Lin fd13d97dfd Allow both MSVC and Itanium mangling schemes.
Summary:
LLDB on Windows should now be able to demangle Linux/Android symbols.

Also updated CxaDemangle.cpp to be compatible with MSVC.

Depends on D9949, D9954, D10048.

Reviewers: zturner, emaste, clayborg

Reviewed By: clayborg

Subscribers: tberghammer, lldb-commits

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

llvm-svn: 238460
2015-05-28 19:15:31 +00:00
Chaoren Lin b41354c9d0 Move inlined cxa_demangle.cpp to a separate file.
Summary: In preparation for some changes to make this compatible with MSVC.

Reviewers: emaste, zturner, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits

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

llvm-svn: 238459
2015-05-28 19:15:15 +00:00
Ed Maste 08948137fd XTIMEOUT new TestChangeProcessGroup.py on FreeBSD
llvm-svn: 238454
2015-05-28 18:45:30 +00:00
Oleksiy Vyalov 0b5ebef7cd Refactor AdbClient and make PlatformAndroid::GetFile to use "adb pull".
http://reviews.llvm.org/D10082

llvm-svn: 238442
2015-05-28 17:42:48 +00:00
Ed Maste 5f5b1e99aa Add explicit dependency on headers to swig wrapper (cmake build)
This should avoid issues like that described in llvm.org/pr23686

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

llvm-svn: 238441
2015-05-28 17:25:34 +00:00
Chaoren Lin 1c614fedf9 Make FileSpec::Dump use FileSpec::GetPath(), not the other way around.
Summary:
Fix FileSpec::Dump() to output denormalized path.

See D9942 for previous discussions.

Reviewers: zturner

Reviewed By: zturner

Subscribers: lldb-commits

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

llvm-svn: 238440
2015-05-28 17:02:45 +00:00
Ed Maste 39db0f6213 Add a comment explaining the eCommandRequiresTarget test
llvm.org/pr23686

llvm-svn: 238438
2015-05-28 16:06:48 +00:00
Ed Maste 8e45371307 Revert r238425, it undoes the purpose of the test
llvm.org/pr23686

llvm-svn: 238437
2015-05-28 15:58:10 +00:00
Aidan Dodds 5f2d0c3c23 Fix THUMB function detection when function name is not prefixed.
Differential Revision: http://reviews.llvm.org/D10062

llvm-svn: 238433
2015-05-28 15:37:01 +00:00
Tamas Berghammer 034980681d Fix write register context in EmulateInstructionARM::EmulateMOVRdRm
llvm-svn: 238431
2015-05-28 15:09:45 +00:00
Ed Maste 7daee53732 Fix TestCommandScript: return an error if target executable is not set
The test invokes the 'targetname' test command before setting a
target executable, which caused Python to raise TypeError: cannot
concatenate 'str' and 'NoneType' objects.

llvm.org/pr23686

llvm-svn: 238425
2015-05-28 14:22:57 +00:00
Pavel Labath fb7d5b8384 Fix race in IOHandlerProcessSTDIO
Summary:
IOHandlerProcessSTDIO::Run() was opening the pipe for interrupt requests lazily. This was racing
with another thread executing IOHandlerProcessSTDIO::Cancel() simultaneously. I fix this by
opening the pipe in the object constructor. The pipe will be automatically closed when the object
is destroyed.

Test Plan: Tests pass on linux.

Reviewers: clayborg, ribrdb

Subscribers: lldb-commits

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

llvm-svn: 238423
2015-05-28 13:41:08 +00:00
Pavel Labath b1f24ad3cf Cleanup the forked child in TestChangeProcessGroup
if the test fails for some reason, we can end up leaking a process. This has a tendency to
confuse the buildbots. I have added a cleanup hook to make sure we cleanup the child.

llvm-svn: 238421
2015-05-28 13:12:48 +00:00
Ed Maste 3d3c60117f Add thumb breakpoint for FreeBSD (currently disabled)
Patch by Tom Rix, with additional changes to sync whitespace/style with
PlatformLinux.cpp.

It is currently disabled pending kernel support.

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

llvm-svn: 238420
2015-05-28 13:06:09 +00:00
Pavel Labath e749b20171 Don't check breakpoint location count in TestChangeProcessGroup
apparently, we get two locations for the breakpoint on android.

llvm-svn: 238417
2015-05-28 12:46:13 +00:00
Tamas Berghammer 157e84f5a9 Fix breakpoint setting in gdb remote test cases on arm
llvm-svn: 238411
2015-05-28 10:55:01 +00:00
Tamas Berghammer 64d807e95d Fix write register context in EmulateInstructionARM::EmulateADDRdSPImm
llvm-svn: 238410
2015-05-28 10:38:32 +00:00
Pavel Labath b9d6e89931 Move prctl call in TestChangeProcessGroup to the child
I was hoping the enable-tracing flag will be inherited from the parent. It is not.

llvm-svn: 238408
2015-05-28 10:28:34 +00:00
Pavel Labath 05a1f2ac4c [NativeProcessLinux] Support inferiors which change their process group
Summary:
Previously, we wait()ed for events from the inferiors process group. This is resulted in a
failure if the inferior changed its process group in the middle of execution. To avoid this, I
pass -1 to the wait() call. The flag __WNOTHREAD makes sure we don't actually wait for events
from any process, but only the processes(threads) which are our children (or traced by us). Since
this happens on the monitor thread, which is dedicated to monitoring a single inferior, we will
be getting events only from this inferior.

Test Plan: All tests pass on linux. I have added a test to check the new functionality.

Reviewers: chaoren, ovyalov

Subscribers: lldb-commits

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

llvm-svn: 238405
2015-05-28 08:59:21 +00:00
Jason Molenda de905773ae Add quick bit of doc about SBFrame::GetCFA().
llvm-svn: 238395
2015-05-28 04:55:53 +00:00
Greg Clayton 424a5dbc73 Added a new API to SBFrame:
lldb::addr_t SBFrame::GetCFA();

This gets the CFA (call frame address) of the frame so it allows us to take an address that is on the stack and figure out which thread it comes from.

Also modified the heap.py module to be able to find out which variable in a frame's stack frame contains an address. This way when ptr_refs finds a match on the stack, it get then report which variable contains the pointer.

llvm-svn: 238393
2015-05-28 03:27:22 +00:00
Greg Clayton 08765fac3f I finally found the strong reference that was keeping all lldb_private::Process instances from ever destroying themselves: ProcessModID.m_mod_id was holding onto the last stop event with ProcessModID::SetStopEventForLastNaturalStopID(EventSP). This is a bad idea because ProcessEventData contains a strong refereence to the process. This is now fixed by calling ProcessModID::SetStopEventForLastNaturalStopID(EventSP()) to clear this event in Process::SetExitStatus() and in Process::Finalize().
This was the original cause of the file descriptor leaks that would cause the test suite to die after running a few hundred processes since no process would ever get destroyed and the communication channel in ProcessGDBRemote and the ProcessIOHandler would never close their pipes. 

This process leak was previously worked around by closing the pipes when the communication channel was disconnected.

This was found by using "ptr_refs" from the heap.py in the lldb.macosx.heap module. It was able to find all strong references to the Process and helped me to figure out who was holding this extra reference.

llvm-svn: 238392
2015-05-28 03:24:30 +00:00
Siva Chandra b100a34cfb [TestDataFormatterUnordered] Use patterns to match unordered_<multi>set elements
Summary: This fixes the test for i386 targets.

Test Plan: dotest.py -C clang --arch i386 TestDataFormatterUnordered

Reviewers: chying, chaoren, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits

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

llvm-svn: 238385
2015-05-28 01:18:11 +00:00
Siva Chandra 825a7681db [TestNamespace] Fix an accidentally committed local change.
Test Plan: dotest.py -p TestNamespace

Reviewers: sivachandra

Subscribers: lldb-commits

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

llvm-svn: 238368
2015-05-27 22:39:21 +00:00
Greg Clayton 4e1042e1bf Allow expresions to have unique expression prefixes:
expr_options = lldb.SBExpressionOptions()
expr_options.SetPrefix('''
struct Foo {
   int a;
   int b;
   int c;
}
'''
expr_result = frame.EvaluateExpression ("Foo foo = { 1, 2, 3}; foo", expr_options)

This fixed a current issue with ptr_refs, cstr_refs and malloc_info so that they can work. If expressions define their own types and then return expression results that use those types, those types get copied into the target's AST context so they persist and the expression results can be still printed and used in future expressions. Code was added to the expression parser to copy the context in which types are defined if they are used as the expression results. So in the case of types defined by expressions, they get defined in a lldb_expr function and that function and _all_ of its statements get copied. Many types of statements are not supported in this copy (array subscript, lambdas, etc) so this causes expressions to fail as they can't copy the result types. To work around this issue I have added code that allows expressions to specify an expression specific prefix. Then when you evaluate the expression you can pass the "expr_options" and have types that can be correctly copied out into the target. I added this as a way to work around an issue, but I also think it is nice to be allowed to specify an expression prefix that can be reused by many expressions, so this feature is very useful.

<rdar://problem/21130675>

llvm-svn: 238365
2015-05-27 22:32:39 +00:00
Siva Chandra 3154aa23f3 [TestBase.runCmd] Better error message when runCmd fails.
Summary:
Before:
    AssertionError: False is not True : Process is launched successfully

After:
    AssertionError: False is not True : Command 'run a.out' failed.
    >>> error: invalid target, create a target using the 'target create' command
    >>> Process could not be launched successfully

Reviewers: clayborg

Reviewed By: clayborg

Subscribers: lldb-commits, vharron

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

llvm-svn: 238363
2015-05-27 22:27:41 +00:00
Siva Chandra 27ab2b3143 [TestDataFormatterUnordered] Fix a few typos in the test.
Summary: The typos were exposed by http://reviews.llvm.org/D9948.

Test Plan: dotest.py -p TestDataFormatterUnordered

Reviewers: vharron, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits

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

llvm-svn: 238361
2015-05-27 22:03:09 +00:00
Ed Maste bfd05631da XTIMEOUT another test timing out on the FreeBSD buildbot
llvm-svn: 238348
2015-05-27 19:11:29 +00:00
Greg Clayton dead71a829 Make sure we print timestamps correctly to 9 places since we are printing nanoseconds.
<rdar://problem/21090231>

llvm-svn: 238334
2015-05-27 16:25:01 +00:00
Ewan Crawford 9aa2da0025 Change ProcessGDBRemote last stop packet to a container.
In ProcessGDBRemote we currently have a single packet, m_last_stop_packet, used to set the thread stop info.
However in non-stop mode we can receive several stop reply packets in a sequence for different threads. As a result we need to use a container to hold them before they are processed.

This patch also changes the return type of CheckPacket() so we can detect async notification packets.

Reviewers: clayborg

Subscribers: labath, ted, deepak2427, lldb-commits

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

llvm-svn: 238323
2015-05-27 14:12:34 +00:00
Tamas Berghammer 0cb78b3b2a Fix xcode project after r238319
llvm-svn: 238321
2015-05-27 14:04:26 +00:00
Tamas Berghammer 9c9ecce077 Make log options uniform betwwen lldb-platform and lldb-gdbserver
This change also get rid of an unused Debugger instance in
GDBRemoteCommunicationServerLLGS and the command interpreter from
lldb-platform what was used only for enabling logging.

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

llvm-svn: 238319
2015-05-27 13:34:04 +00:00
Ed Maste efa25c2836 Add real time signals support to FreeBSDSignals
Apply r238009 to FreeBSD as well.

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

llvm-svn: 238316
2015-05-27 13:19:46 +00:00
Colin Riley d6aa9bab21 Add a language log category.
Differential Revision: http://reviews.llvm.org/D9994

llvm-svn: 238314
2015-05-27 12:48:14 +00:00
Pavel Labath 4446487d71 Improve LLDB prompt handling
Summary:
There is an issue in lldb where the command prompt can appear at the wrong time. The partial fix
we have in for this is not working all the time and is introducing unnecessary delays. This
change does:
- Change Process:SyncIOHandler to use integer start id's for synchronization to avoid it being
  confused by quick start-stop cycles. I picked this up from a suggested patch by Greg to
  lldb-dev.
- coordinates printing of asynchronous text with the iohandlers. This is also based on a
  (different) Greg's patch, but I have added stronger synchronization to it to avoid races.

Together, these changes solve the prompt problem for me on linux (both with and without libedit).
I think they should behave similarly on Mac and FreeBSD and I think they will not make matters
worse for windows.

Test Plan: Prompt comes out alright. All tests still pass on linux.

Reviewers: clayborg, emaste, zturner

Subscribers: lldb-commits

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

llvm-svn: 238313
2015-05-27 12:40:32 +00:00
Tamas Berghammer bed77de002 Fix write register context in EmulateInstructionARM::EmulateMOVRdRm
llvm-svn: 238312
2015-05-27 12:32:28 +00:00
Tamas Berghammer 729dcfb7ee Fix BreakpointLocationCollection::ShouldStop to handle breakpoint removal
Differential revision: http://reviews.llvm.org/D9886

llvm-svn: 238308
2015-05-27 09:46:47 +00:00
Tamas Berghammer 3afb2527ce Parse function name from DWARF DW_AT_abstract_origin
A DW_TAG_subprogram entry can contain a reference to a
DW_AT_abstract_origin entry instead of duplicating the information
from it (e.g.: name) when the same function is inlined in some case
and not inlined in other cases.

This CL fixes name parsing for the case when the DW_TAG_subprogram
for the non inlined version contains just a reference to the
DW_AT_abstract_origin entry instead of the full information.

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

llvm-svn: 238307
2015-05-27 09:43:44 +00:00
Enrico Granata e87764f247 Add support for custom commands to set flags on themselves
This works for Python commands defined via a class (implement get_flags on your class) and C++ plugin commands (which can call SBCommand::GetFlags()/SetFlags())

Flags allow features such as not letting the command run if there's no target, or if the process is not stopped, ...
Commands could always check for these things themselves, but having these accessible via flags makes custom commands more consistent with built-in ones

llvm-svn: 238286
2015-05-27 05:04:35 +00:00
Vince Harron 9b7f6677d9 www - updated build server URLs
llvm-svn: 238284
2015-05-27 04:55:31 +00:00
Vince Harron 4c7b8c8476 Changed Flags::clang_type_resolve_state to unsigned for gcc
to work around a very noisy gcc warning

llvm-svn: 238283
2015-05-27 04:54:36 +00:00
Vince Harron 847e261e5d test Makefile.rules - pick a more sensible default CC on Linux
Differential Revision: http://reviews.llvm.org/D9920

llvm-svn: 238282
2015-05-27 04:42:54 +00:00
Vince Harron dcc2b9f7f5 dosep - force timeout processes to dump core when they timeout
move all core files to the session dir after all tests have completed

TEST PLAN
Run tests. Force a timeout by decreasing a timeout
export LLDB_EVENTS_TIMEOUT=10s
./dosep.py

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

llvm-svn: 238281
2015-05-27 04:40:36 +00:00
Greg Clayton 2a2949cf47 Allow clients to get parsing errors and also fix the ApplePropertyList so it parses the structured data correctly.
llvm-svn: 238280
2015-05-27 03:24:17 +00:00
Greg Clayton 66b8294cae Make StructureData objects dump themselves with correct indentation.
llvm-svn: 238279
2015-05-27 03:23:26 +00:00
Greg Clayton b1ca494b6e Add StructuredData.h to the Xcode project.
llvm-svn: 238278
2015-05-27 03:22:42 +00:00
Robert Flack 62efb1f6d0 Implement and use adb push for PlatformAndroid::PutFile
Using the adb push protocol is significantly faster than the current method of
sending the hex encoded file data for the remote to write to the file.

Test Plan:
Tests continue to pass - and much faster (e.g. TestSBValuePersist.py takes 10s
down from 4m51s on mac -> android)

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

llvm-svn: 238274
2015-05-27 02:18:50 +00:00
Ying Chen 294c92651c Add 'qXfer:features:read' to known stub list
Summary:
-Fix darwin bot failure "unknown qSupported stub feature reported: qXfer:features:read"
-TestGdbRemoteAuxvSupport.py and TestLldbGdbServer.py were affected by this problem

Test Plan:
dotest.py -m --executable /Users/lldb_build/testSlave/buildDir/lldb.src/build/Debug/lldb --framework /Users/lldb_build/testSlave/buildDir/lldb.src/build/Debug/LLDB.framework -A x86_64 -C clang -p TestLldbGdbServer.py
dotest.py -m --executable /Users/lldb_build/testSlave/buildDir/lldb.src/build/Debug/lldb --framework /Users/lldb_build/testSlave/buildDir/lldb.src/build/Debug/LLDB.framework -A x86_64 -C clang -p TestGdbRemoteAuxvSupport.py

Reviewers: clayborg, sivachandra, vharron

Subscribers: lldb-commits

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

llvm-svn: 238262
2015-05-26 23:08:09 +00:00
Greg Clayton ee8f994077 Modify the ApplePropertyList to be able to create StructuredData objects from the plist XML.
llvm-svn: 238260
2015-05-26 22:49:19 +00:00
Zachary Turner ffc7d6fe6e Have lldb-mi tests import pexpect at a narrower scope.
The tests are xfail'ed on Windows, but would still error out since
they were importing pexpect at global scope.  This way the tests
will correctly report as unsupported.

llvm-svn: 238249
2015-05-26 20:26:43 +00:00
Zachary Turner 306278ff0d Also don't try to copy a logfile if it doesn't exist.
In some cases no log file will be written, so don't attempt to
call os.rename() with a non-existent source path.

llvm-svn: 238248
2015-05-26 20:26:29 +00:00
Ed Maste 6b414edbcb Sync PlatformFreeBSD::GetSupportedArchitectureAtIndex with PlatformLinux
Reviewed by Ted Woodward
Differential Revision:	http://reviews.llvm.org/D9764

llvm-svn: 238246
2015-05-26 20:23:20 +00:00
Zachary Turner 5de068bf31 On Windows, delete existing log file before renaming temp file.
On non-Windows platforms, os.rename() will silently replace the
destination file if it already exists.  On Windows, it doesn't do
this, and the filesystem has no mechanism to simulate the same type
of atomic rename operation.  So on Windows, delete the file first
before calling os.rename().

llvm-svn: 238239
2015-05-26 19:52:24 +00:00
Greg Clayton df9f6364b2 Fix some logic where we used to have char arrays, but we now use std::string. Use the correctly API to detect if they are not empty.
<rdar://problem/21090173>

llvm-svn: 238231
2015-05-26 18:29:03 +00:00
Greg Clayton d04f0edad9 Added XML to the host layer.
We know have on API we should use for all XML within LLDB in XML.h. This API will be easy back the XML parsing by different libraries in case libxml2 doesn't work on all platforms. It also allows the only place for #ifdef ...XML... to be in XML.h and XML.cpp. The API is designed so it will still compile with or without XML support and there is a static function "bool XMLDocument::XMLEnabled()" that can be called to see if XML is currently supported. All APIs will return errors, false, or nothing when XML isn't enabled.

Converted all locations that used XML over to using the host XML implementation.

Added target.xml support to debugserver. Extended the XML register format to work for LLDB by including extra attributes and elements where needed. This allows the target.xml to replace the qRegisterInfo packets and allows us to fetch all register info in a single packet.

<rdar://problem/21090173>

llvm-svn: 238224
2015-05-26 18:00:51 +00:00
Tamas Berghammer 068f8a7e2d Move register reading form NativeProcessLinux to NativeRegisterContextLinux*
This change reorganize the register read/write code inside lldb-server on Linux
with moving the architecture independent code into a new class called
NativeRegisterContextLinux and all of the architecture dependent code into the
appropriate NativeRegisterContextLinux_* class. As part of it the compilation of
the architecture specific register contexts are only compiled on the specific
architecture because they can't be used in other cases.

The purpose of this change is to remove a lot of duplicated code from the different
register contexts and to remove the architecture dependent codes from the global
NativeProcessLinux class.

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

llvm-svn: 238196
2015-05-26 11:58:52 +00:00
Vince Harron ebf2b2a10b revert files unintentionally checked in
llvm-svn: 238174
2015-05-26 03:10:41 +00:00
Vince Harron 218353d847 Print port number that lldb-server binds to in platform mode
If binding to port 0 is selected, the actual port is printed.

This improves the reliability of platform startup by ensuring that
a free port can be found.

TEST PLAN
./lldb-server platform --listen *:0

Listening for a connection from <port-number>...

Will appear on stdout (with other stuff potentially)

llvm-svn: 238173
2015-05-26 03:08:05 +00:00
Greg Clayton 654e0ca650 Quiet compiler warnings about virtual and override not being consistent.
llvm-svn: 238128
2015-05-25 02:58:29 +00:00
Greg Clayton 5cf342d7aa Fix compiler warnings regarding size_t not always being 64 bit in the printf.
llvm-svn: 238127
2015-05-25 02:55:21 +00:00
Greg Clayton 5df78fa35b Did some cleanup to stop us from leaking Pipe file descriptors.
The main issue was the Communication::Disconnect() was calling its Connection::Disconnect() but this wouldn't release the pipes that the ConnectionFileDescriptor was using. We also have someone that is holding a strong reference to the Process so that when you re-run, target replaces its m_process_sp, but it doesn't get destructed because someone has a strong reference to it. I need to track that down. But, even if we have a strong reference to the a process that is outstanding, we need to call Process::Finalize() to have it release as much of its resources as possible to avoid memory bloat. 

Removed the ProcessGDBRemote::SetExitStatus() override and replaced it with ProcessGDBRemote::DidExit().

Now we aren't leaking file descriptors and the stand alone test suite should run much better.

llvm-svn: 238089
2015-05-23 03:54:53 +00:00
Oleksiy Vyalov 755d58a463 Use target's SIGSTOP and SIGINT when making decision about continue after async packet.
http://reviews.llvm.org/D9857

llvm-svn: 238068
2015-05-22 23:14:39 +00:00
Greg Clayton 25f82aae57 Fix this module to work with current packects and also to be able to figure out average packets speed and standard deviation.
llvm-svn: 238065
2015-05-22 23:00:59 +00:00
Vince Harron 8994fedc2b dotest.py - fixed a bug displaying usage
./dotest.py --help

llvm-svn: 238043
2015-05-22 19:49:23 +00:00
Zachary Turner 279a2b7575 Implement PlatformWindows::GetEnvironment.
This fixes a couple of tests that rely on being able to get the
host's environment or spawn an inferior with specific arguments.

llvm-svn: 238042
2015-05-22 19:34:17 +00:00
Zachary Turner 4f2a9726d4 Fix use-after-free in OptionValueString.
We were assigning a temporary std::string to a StringRef.  Somehow
this worked on every platform but Windows.

llvm-svn: 238041
2015-05-22 19:33:54 +00:00
Zachary Turner 101a82bf8b Disable TestConcurrentEvents.py on Windows.
This test takes over 5 minutes to run just by itself, and everything
fails anyway, so it doesn't make sense to keep it running for now.

llvm-svn: 238040
2015-05-22 19:33:32 +00:00
Siva Chandra 0b0106bb9b [TestRaise] Skip the SIGRTMIN test on Android.
Summary:
Running "kill -l" on nexus player (i386) device results in this:

    1    HUP Hangup                        33     33 Signal 33
    2    INT Interrupt                     34     34 Signal 34
    3   QUIT Quit                          35     35 Signal 35
    4    ILL Illegal instruction           36     36 Signal 36
    5   TRAP Trap                          37     37 Signal 37
    6   ABRT Aborted                       38     38 Signal 38
    7    BUS Bus error                     39     39 Signal 39
    8    FPE Floating point exception      40     40 Signal 40
    9   KILL Killed                        41     41 Signal 41
   10   USR1 User signal 1                 42     42 Signal 42
   11   SEGV Segmentation fault            43     43 Signal 43
   12   USR2 User signal 2                 44     44 Signal 44
   13   PIPE Broken pipe                   45     45 Signal 45
   14   ALRM Alarm clock                   46     46 Signal 46
   15   TERM Terminated                    47     47 Signal 47
   16 STKFLT Stack fault                   48     48 Signal 48
   17   CHLD Child exited                  49     49 Signal 49
   18   CONT Continue                      50     50 Signal 50
   19   STOP Stopped (signal)              51     51 Signal 51
   20   TSTP Stopped                       52     52 Signal 52 
   21   TTIN Stopped (tty input)           53     53 Signal 53
   22   TTOU Stopped (tty output)          54     54 Signal 54
   23    URG Urgent I/O condition          55     55 Signal 55
   24   XCPU CPU time limit exceeded       56     56 Signal 56
   25   XFSZ File size limit exceeded      57     57 Signal 57
   26 VTALRM Virtual timer expired         58     58 Signal 58
   27   PROF Profiling timer expired       59     59 Signal 59
   28  WINCH Window size changed           60     60 Signal 60
   29     IO I/O possible                  61     61 Signal 61
   30    PWR Power failure                 62     62 Signal 62
   31    SYS Bad system call               63     63 Signal 63
   32     32 Signal 32                     64     64 Signal 64

The signals from 33-64 are missing symbolic names.

Test Plan: dotest.py -p TestRaise on Android

Reviewers: labath

Subscribers: tberghammer, aemerson, lldb-commits

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

llvm-svn: 238039
2015-05-22 19:00:33 +00:00
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
Siva Chandra e8208ce065 [TestLldbGdbServer] Up sleep duration to 1min in the inferior thread_func.
Summary:
The current sleep duration is not sufficient for Android.

[[ Its a completely different investigation as to why Android needs longer
   sleep durations for this test. ]]

Test Plan: dotest.py -p TestLldbGdbServer on Android and local linux.

Reviewers: chaoren

Reviewed By: chaoren

Subscribers: tberghammer, lldb-commits

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

llvm-svn: 237981
2015-05-22 00:52:41 +00:00
Chaoren Lin 9afad0e954 Fix lldb-platform usage string.
llvm-svn: 237966
2015-05-21 22:43:43 +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 b48b40405e Don't import module `lock` at global scope.
`lock` depends on `fcntl`, which doesn't exist on Windows.  Until
someone implements an equivalent locking mechanism on Windows, we
can't have lock imported globally.

llvm-svn: 237946
2015-05-21 20:16:02 +00:00