Commit Graph

11542 Commits

Author SHA1 Message Date
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