The test was flaky on the android buildbot, because the 10ms test completed before we got a
chance to interrupt it. I increase the duration to 50ms to hopefully get more consistent results.
llvm-svn: 245555
Summary:
There was a bug in NativeProcessLinux, where doing an instruction-level single-step over the
thread-creation syscall resulted in loss of control over the inferior. This happened because
after the inferior entered the thread-creation maintenance stop, we unconditionally performed a
PTRACE_CONT, even though the original intention was to do a PTRACE_SINGLESTEP. This is fixed by
storing the original state of the thread before the stop (stepping or running) and then
performing the appropriate action when resuming.
I also get rid of the callback in the ThreadContext structure, which stored the lambda used to
resume the thread, but which was not used consistently.
A test verifying the correctness of the new behavior is included.
Reviewers: ovyalov, tberghammer
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D12104
llvm-svn: 245545
the test was failing on android because processing 30 signals involved a lot of round-trips,
which was not possible in the 0.5s default timeout. After the increase the test seems to pass
reliably.
llvm-svn: 245448
Summary:
Due to fork()/execve(), the launched inferior inherits the signal mask of its parent (lldb-server). But because lldb-server modifies its signal mask (It blocks SIGCHLD, for example), the inferior starts with some signals being initially blocked.
One consequence is that TestCallThatRestarts.ExprCommandThatRestartsTestCase (test/expression_command/call-restarts) fails because sigchld_handler() in lotta-signals.c is not called, due to the SIGCHLD signal being blocked.
To prevent the signal masking done by lldb-server from affecting the created inferior, the signal mask of the inferior is now cleared before the execve().
Patch by: Yacine Belkadi
Reviewers: ovyalov, labath
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D12138
llvm-svn: 245436
Whether or not frames print their tid in hex or decimal is apparently
hardcoded to depend on the operating system. For now a comment was
added that this should be changed to a more sane check (for example
a setting), and the OS check is updated to do the right thing for
Windows.
llvm-svn: 245371
Name lookup doesn't work properly with Windows targets. This is
most likely due to issues with name mangling, although there is at
least one set of debug info related issues as well, since some of
the name lookup requests appear to be failing on types rather than
symbols.
Specifically, this patch XFAILS the following set of tests:
TestChar1632T.py
TestRdar12991846.py
TestConstVariables.py
TestCallCPPFunction.py
TestCallStopAndContinue.py
TestCallUserDefinedFunction.py
TestCModules.py
TestCPPThis.py
TestExprs2.py
TestOverloadedFunctions.py
TestRvalueReferences.py
And fixing the underlying issue is tracked in http://llvm.org/pr24489
llvm-svn: 245338
TestExprDoesntBlock started failing because deadlocks behave differently with
pthread_mutex and std::mutex.
This reverts part of commit r245234.
llvm-svn: 245262
This eliminates portability issues among platforms that don't have
a pthreads implementation.
Differential Revision: http://reviews.llvm.org/D12043
Reviewed By: Greg Clayton
llvm-svn: 245234
Neither of these libraries has been ported to Windows. Eventually
if they are ever ported we can re-enable these tests. But more
immediately what we need to do is add new data formatters for
MSVC's STL implementation. This is tracked in
http://llvm.org/pr24460.
llvm-svn: 245125
This was caused by a bug in the PTVS source file editor, which has
since been fixed and awaiting a new release. For now people using
this editor need to remember to manually remove this before
committing a file.
llvm-svn: 244963
Most were already XFAIL'ed, but the reason for the XFAIL is that
we don't have a suitable pexpect implementation on Windows. This
isn't going to change unintentionally, so there is no reason to
XFAIL them as opposed to just skip them.
llvm.org/pr22274 tracks finding a suitable pexpect module for
Windows, which should fix many of these issues. llvm.org/pr24452
tracks the larger issue of making the entire lldb-mi test suite
work on Windows, of which finding a pexpect module is just one
component.
llvm-svn: 244951
Summary:
For Linux x86 based environments the orig_eax/orig_rax
register should be set to -1 to prevent the instruction pointer
to be decremented, which was the cause for the SIGILL exception.
Fix for Bug 23659
Reviewers: zturner, ashok.thirumurthi, mikesart, jingham, clayborg
Subscribers: clayborg, labath
Differential Revision: http://reviews.llvm.org/D11411
llvm-svn: 244875
Summary:
(This revision supersedes the abandon: http://reviews.llvm.org/D9716)
Size field is used to let the debugger attribute an address to a specific library when symbols are not available.
For example:
OpenGLESApp4.app!Cube_draw() Line 74 C
OpenGLESApp4.app!-[GameViewController glkView:drawInRect:](GameViewController * self, SEL _cmd, GLKView * view, CGRect rect) Line 89 C++
GLKit!<redacted>
QuartzCore!<redacted>
QuartzCore!<redacted>
QuartzCore!<redacted>
QuartzCore!<redacted>
QuartzCore!<redacted>
UIKit!<redacted>
UIKit!<redacted>
UIKit!<redacted>
UIKit!<redacted>
FrontBoardServices!<redacted>
CoreFoundation!<redacted>
Patch from paulmay@microsoft.com
Reviewers: ChuckR, abidh, ki.stfu
Subscribers: greggm, lldb-commits
Differential Revision: http://reviews.llvm.org/D11574
llvm-svn: 244573
Previously all test output was reported by each individual
instance of dotest.py. After a recent patch, dosep gets dotest
outptu via a pipe, and selectively decides which output to
print.
This breaks certain scripts which rely on having full output
of each dotest instance to do various parsing and/or log-scraping.
While we make no promises about the format of dotest output, it's
easy to restore this to the old behavior for now, although it is
behind a flag. To re-enable full output, run dosep.py with the -s
option.
Differential Revision: http://reviews.llvm.org/D11816
Reviewed By: Chaoren Lin
llvm-svn: 244469
Move code in CMICmdCmdVarListChildren::Execute() up so that the child
object will always be added when the MI command -var-list-children is
entered (instead of only when the print-value was all or simple). This
patch fixes evaluation of expressions like varobj.member for a created
varobj with children.
Reviewed by: abidh
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D11659
llvm-svn: 243782
Expression evaluation error messages may have embedded new lines
and tabs. These should be escaped in the result string.
Patch by paulmaybee. Reviewed in http://reviews.llvm.org/D11570.
llvm-svn: 243741
Summary:
Currently if the "first child" of the pointer is a char type then the pointer is displayed as a string. This test succeeds incorrectly when the pointer is to a structured type with a char type as its first field. Fix this by switching the test to retrieve the pointee type and checking that it is a char type.
Reviewers: abidh, ChuckR, ki.stfu
Subscribers: greggm, lldb-commits
Differential Revision: http://reviews.llvm.org/D11488
llvm-svn: 243619
The command "-break-insert ns::foo" for function 'foo' in namespace 'ns'
was being parsed as file:function. This patch fixes these cases by adding
checks for '::'. (Note: '::func' is not parsed correctly by lldb due to
llvm.org/pr24271).
Reviewed by: ki.stfu
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D11396
llvm-svn: 243281
This patch adds the option -l/--language to the expression command, for
use when setting the language options or choosing an alternate FE. If
not specified, the target.language setting is used.
Reviewed by: clayborg
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D11447
llvm-svn: 243187
Summary:
For certain data structures, when the synthetic child provider returns
zero children, a summary like "Empty instance of <typename>" could be
more appropriate than something like "size=0 {}". This new option helps
hide the trailing "{}".
This is also exposed with a -h option for the command "type summary add".
Reviewers: granata.enrico
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D11473
llvm-svn: 243166
If the function is a template then the return type is part of the
function name. This CL fixes the parsing of these function names in
the case when the return type contains ':'.
The name of free functions in C++ don't have context part. Fix the
logic geting the function name without arguments out from a full
function name to handle this case.
Change the handling of step-in-avoid-regexp to match the value against
the function name without it's arguments and return value. This is
required because the default regex ("^std::") would match any template
function returning an std object.
Fifferential revision: http://reviews.llvm.org/D11461
llvm-svn: 243099
This is required to print out the rerun value of funcions returning
types with the following attributes:
__attribute__((__vector_size__(8)));
__attribute__((ext_vector_type(2)));
Differential revision: http://reviews.llvm.org/D11416
llvm-svn: 242903
For use-after-free bugs caught by ASan, we show an allocation and a deallocation stack trace. Let's display them in a "most recent event first" order, this patch does that.
Differential Revision: http://reviews.llvm.org/D11295
llvm-svn: 242902
Originally, the source for the hidden lib_d and the regular lib_d were the same
file, so we always got the "correct" source for each. Splitting them up in
D11367 exposed a bug of showing the incorrect source file for the hidden lib_d.
llvm-svn: 242862
Target and breakpoints options were added:
breakpoint set --language lang --name func
settings set target.language pascal
These specify the Language to use when interpreting the breakpoint's
expression (note: currently only implemented for breakpoints on
identifiers). If the breakpoint language is not set, the target.language
setting is used.
This support is required by Pascal, for example, to set breakpoint at 'ns.foo'
for function 'foo' in namespace 'ns'.
Tests on the language were also added to Module::PrepareForFunctionNameLookup
for efficiency.
Reviewed by: clayborg
Subscribers: jingham, lldb-commits
Differential Revision: http://reviews.llvm.org/D11119
llvm-svn: 242844
Summary:
The current Makefile scheme only allows one dylib to be specified in each make
invocation, so TestLoadUnload had a custom Makefile that's unrelated to the
base Makefile.rules. This change uses recursive make invocations to bypass the
single dylib restriction. See D11202 for more context.
Reviewers: clayborg
Subscribers: chaoren, lldb-commits
Differential Revision: http://reviews.llvm.org/D11367
llvm-svn: 242813
Summary: - launch dotest with gtimeout if found on Windows
Reviewers: chaoren
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D11368
llvm-svn: 242699
for a CXXRecordDecl gets pointed at that record. This can happen when a type is
imported out of and then into the target's AST context without being laid out.
Also added a testcase that covers this scenario.
<rdar://problem/21844453>
llvm-svn: 242687
Don't chane the CFI information when a conditional instruction
is emulated (eg.: popeq {r0, pc}) because the CFI for the next
instruction should be the same as the CFI for the current instruction.
Differential revision: http://reviews.llvm.org/D11258
llvm-svn: 242519
Summary:
This commit adds initial support for the jThreadsInfo packet to lldb-server. The current
implementation does not expedite inferior memory. I have also added a description of the new
packet to our protocol documentation (mostly taken from Greg's earlier commit message).
Reviewers: clayborg, ovyalov, tberghammer
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D11187
llvm-svn: 242402
Summary:
Other changes around the main change include:
1. Add a method Cast to ValueObjectConstResult, ValueObjectConstResultImpl
and ValueObjectConstResultChild.
2. Add an argument |live_address| of type lldb::addr_t to the constructor
of ValueObjectConstResultChild. This is passed on to the backing
ValueObjectConstResultImpl object constructor so that the address of the
child value can be calculated properly.
Reviewers: granata.enrico, clayborg
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D11203
llvm-svn: 242374
For Hexagon we want to be able to call functions during debugging, however currently lldb only supports this when there is JIT support.
Although emulation using IR interpretation is an alternative, it is currently limited in that it can't make function calls.
In this patch we have extended the IR interpreter so that it can execute a function call on the target using register manipulation.
To do this we need to handle the Call IR instruction, passing arguments to a new thread plan and collecting any return values to pass back into the IR interpreter.
The new thread plan is needed to call an alternative ABI interface of "ABI::PerpareTrivialCall()", allowing more detailed information about arguments and return values.
Reviewers: jingham, spyffe
Subscribers: emaste, lldb-commits, ted, ADodds, deepak2427
Differential Revision: http://reviews.llvm.org/D9404
llvm-svn: 242137
Summary:
- Consolidate Unix signals selection in UnixSignals.
- Make Unix signals available from platform.
- Add jSignalsInfo packet to retrieve Unix signals from remote platform.
- Get a copy of the platform signal for each remote process.
- Update SB API for signals.
- Update signal utility in test suite.
Reviewers: ovyalov, clayborg
Subscribers: chaoren, jingham, labath, emaste, tberghammer, lldb-commits
Differential Revision: http://reviews.llvm.org/D11094
llvm-svn: 242101
pointed into the artificial function constructed for the expression. I now make
anything that pointed to the function as its DeclContext be global while the
copy occurs; afterward I restored the old DeclContext.
Added a testcase that make sure that this works properly and doesn't crash
anything.
<rdar://problem/21049838>
llvm-svn: 241695
We don't need to do the fancy dance with checking whether the iterator
represents a #define -- in fact, that's the wrong thing to do. The thing to do
is check whether the highest-priority module that did something to the module
#defined or #undefd it. If it #defined it, then the MacroInfo* will be non-NULL
and we're good to go.
llvm-svn: 241651
The summary is - quite simply - a one-line printout of the vector elements
We still need synthetic children:
a) as a source of the elements to print in the summary
b) for graphical IDEs that display structure regardless of the summary settings
rdar://5429347
llvm-svn: 241531
Summary: $PPID is not available on old shells.
Reviewers: tberghammer, ovyalov
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D10968
llvm-svn: 241486
Summary:
On windows, global python variables are not automatically passed to child processes. This commit
makes sure the default timeout value is available to child processes by passing it directly.
I pass the whole dotest_opts value to the children, so we can use the other members as well if we
need to do it in the future.
Reviewers: amccarth
Subscribers: lldb-commits-list
Differential Revision: http://reviews.llvm.org/D10895
llvm-svn: 241459
Summary: The long name causes problems with some shells.
Reviewers: sivachandra
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D10888
llvm-svn: 241222
Summary:
If test is decorated with expectedFlakey*, run teardown and setup before retry
Don't run retry if the test is already decorated with xfail or skip
Test Plan:
Mark TestMultithreaded.test_sb_api_listener_event_process_state as expectedFlakey
Run ./dotest.py -p TestMultithreaded.py -A x86_64 -C gcc4.9.2
Reviewers: vharron, tberghammer
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D10830
llvm-svn: 241202
These instructions confusing the unwind code because in case of a
push it assumes that the original valu of a register is pushed to
the stack what is not neccessarily true in case of SP. The same is
true for the pop (in the opposite way).
Differential revision: http://reviews.llvm.org/D10806
llvm-svn: 241051
This reverts commit a4f5f4da7e164b7ac358a75f2e4254c25718ad4b.
This test fails 100% with gcc4.9.2, revert it first. Will find out why xfail is overruled by xflaky.
llvm-svn: 241014
The random module in Python 2.7.8 and later leaks /dev/[u]random into
children. The test is expected to fail, not be flakey.
This will be fixed in Python 2.7.10 for some operating systems, but not
all e.g. OS X 10.4.
llvm.org/pr23983
bugs.freebsd.org/197376
bugs.python.org/issue23458
llvm-svn: 240958
Summary:
Current default is 10 minutes, which causes the test suite to run very long in
case of test timeouts. On local linux, each test completes in under 90 seconds in the
slowest configuration (debug build of lldb, using debug clang to build
inferiors). I am changing the default to 4m on local targets, while retaining
the 10m timeout for remote ones.
Reviewers: sivachandra, vharron
Subscribers: tberghammer, lldb-commits
Differential Revision: http://reviews.llvm.org/D10527
llvm-svn: 240946
SUMMARY
Flakey tests get two chances to pass
Also, switched a bunch of tests to use new decorator.
TEST PLAN
Add one of these decorators to a test
Edit a test to pass on the first invocation, confirm test appears as pass
Edit a test to pass on the first invocation, pass on the second, confirm test appears as xfail
Edit a test to fail on two consecutive runs, confirm test appears in results as fail/error
Differential Revision: http://reviews.llvm.org/D10721
llvm-svn: 240789
The emulation of the branches are required by the new stack
unwinding logic to reinstantiate the prologue at the right place.
Differential revision: http://reviews.llvm.org/D10702
llvm-svn: 240769
The expression parser mode allows UnknownAnyTy to make it all the way through, but that is bad for ivars because it means type layout fails horribly (as in, clang crashes)
This patch fixes the issue by using the "variables view mode", which masks UnknownAnyTy as empty-type, and pointer-to UnknownAnyTy as void*
This, in turn, allows LLDB to properly reconstruct ivars of IMP type in ObjC type - as per accompanying test case
Fixes rdar://21471326
llvm-svn: 240677
Summary:
the original bug was fixed (a rogue breakpoint messing up inferior data structures) and the tests
seems to pass now. Since android has a default SEGV handler, I have had to alter the test
expectation in this case.
Test Plan: Tests pass on android arm.
Reviewers: tberghammer
Subscribers: tberghammer, aemerson, lldb-commits
Differential Revision: http://reviews.llvm.org/D10733
llvm-svn: 240638
The tested functionality is implemented now. The test remains XTIMEOUTed, because it times out
occasionally, probably due to test suite deficiencies.
llvm-svn: 240632
Summary:
Currently, the local-only path fails about 50% of the tests, which means that: a) nobody is using
it; and b) the remote debugging path is much more stable. This commit removes the local-only
linux debugging code (ProcessLinux) and makes remote-loopback the only way to debug local
applications (the same architecture as OSX). The ProcessPOSIX code is moved to the FreeBSD
directory, which is now the only user of this class. Hopefully, FreeBSD will soon move to the new
architecture as well and then this code can be removed completely.
Test Plan: Test suite passes via remote stub.
Reviewers: emaste, vharron, ovyalov, clayborg
Subscribers: tberghammer, emaste, lldb-commits
Differential Revision: http://reviews.llvm.org/D10661
llvm-svn: 240543
Enable ${language} to be specified in the frame-format string to see
the current frame's compile unit language in "frame info".
Test Plan:
debug a C++ program, run to main, and run the lldb commands:
settings set frame-format "frame lang=${language}\n"
frame info
you should see:
frame lang=c++
test case added in:
./dotest.py --executable lldb -f SettingsCommandTestCase.test_set_frame_format
Reviewers: clayborg
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D10561
llvm-svn: 240440
This test case generates new tests from the source files dropped into
its directory. For stress testing stack unwinding it steps through the
code line by line and then tests unwinding from each instruction.
llvm-svn: 240030
Summary: The test is XFAILed for Linux x86_64 and i386 because of bug #23659.
Test Plan: NFC
Reviewers: tberghammer
Subscribers: lldb-commits, emaste
Differential Revision: http://reviews.llvm.org/D10519
llvm-svn: 239973
Summary:
This change adds all the necessary infrastructure required to
selectively enable and make TestLoadUnload work for Android. One test,
which tests the module search paths, is still kept disabled for remote
as search paths (because of module caching) are local anyway.
Reviewers: tberghammer
Reviewed By: tberghammer
Subscribers: emaste, lldb-commits, tberghammer
Differential Revision: http://reviews.llvm.org/D10469
llvm-svn: 239965
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
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
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
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
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
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
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
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
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
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
(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
% 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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
`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
SUMMARY
dosep.py starts lots and lots of dotest instances.
This option helps you find if two (or more) dotest instances are using
the same directory at the same time.
Enable it to cause test failures and stderr messages if dotest
instances try to run in the same directory simultaneously.
It is disabled by default because it litters the test directories with
".dirlock" files
TEST PLAN
Set lldbtest.debug_confirm_directory_exclusivity = True
run ./dosep.py
Differential Revision: http://reviews.llvm.org/D9868
llvm-svn: 237935
Depends on r237932
"Fixed intermittent failures in TestGdbRemote*/TestLldbGdbServer"
Test Plan:
Ran dosep 100x, no failures in these tests
Differential Revision: http://reviews.llvm.org/D9892
llvm-svn: 237933
test/tools/lldb-server/commandline/Test* were actually executing in
their parent directory. This looks fine at first because they aren't
compiling an inferior executable.
Unfortunately, they still call "make clean" during their cleanup,
which is likely causing all kinds of havok in tests running in the
parent directory
Differential Revision: http://reviews.llvm.org/D9869
llvm-svn: 237932
That way, if the test gets killed (by a dosep timeout) we get to see the session
trace
Test Plan:
Run dotest.py
Kill it while it's running, check the session dir for Test* files
Differential Revision: http://reviews.llvm.org/D9845
llvm-svn: 237926
If an expected timeout test times out, touch
<session-dir>/ExpectedTimeout-<test-name>
If an expected timeout test passes, touch
<session-dir>/UnexpectedCompletion-<test-name>
Differential Revision: http://reviews.llvm.org/D9843
llvm-svn: 237925
This ensures that all spawned dotest instances store their traces
in the same location.
Test Plan:
run dosep.py with and without a -s option for dotest
cd lldb/test
./dosep.py
./dosep.py -o '-s /tmp/traces'
Differential Revision: http://reviews.llvm.org/D9839
llvm-svn: 237923
Summary:
Previously, NPL tried to reinject SIGSTOP into the inferior in an attempt to get the process to
start in the group-stop state. This was:
a) wrong (reinjection should be controlled by "process handle" lldb setting)
b) racy (it should use Resume for transparent resuming instead of RequestResume)
c) broken (llgs crashed on inferior SIGSTOP)
With this change, SIGSTOP is handled just like any other signal delivered to the inferior: we
stop all threads and report signal reception to lldb. SIGSTOP reinjection does not behave the
same way as it would outside the debugger, but simulating this is a hard problem and is not
normally necessary.
Test Plan: I have added a test which verifies we get SIGSTOP reports and we do not crash.
Reviewers: ovyalov, chaoren
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D9852
llvm-svn: 237880