Summary:
Implementation of assembly profiler for MIPS32 using EmulateInstruction which currently scans only prologue/epilogue assembly instructions. It uses llvm::MCDisassembler to decode assembly instructions.
Reviewers: clayborg, jasonmolenda
Differential Revision: http://reviews.llvm.org/D9769
llvm-svn: 237420
Remove the m_description ivar from the StopInfoBreakpoint
and StopInfoWatchpoint subclasses of StopInfo. Also,
initialize the m_description ivar in the StopInfo ctor.
<rdar://problem/20902950>
llvm-svn: 237411
This API has been present since XP, and I think it's safe to
drop support for XP (since other things have been introduced long
ago which already don't work on XP anyway).
With this patch, we can statically bind against the exports and
not bother falling back to a CRITICAL_SECTION if we can't load
the API.
llvm-svn: 237402
Summary:
Android API-9 does not have sys/signal.h. However, all sys/signal.h
has when present is an include of signal.h.
Test Plan: dotest.py -p TestSendSignal on linux and Android.
Reviewers: chaoren
Reviewed By: chaoren
Subscribers: tberghammer, lldb-commits
Differential Revision: http://reviews.llvm.org/D9779
llvm-svn: 237381
Summary:
One cannot use mknod or mkfifo on user Android devices. This commit
changes the use of pipe to a file to synchronize between the inferior
and the test.
Test Plan: dotest.py -P TestAttachDenied
Reviewers: ovyalov, chaoren
Reviewed By: chaoren
Subscribers: tberghammer, lldb-commits
Differential Revision: http://reviews.llvm.org/D9768
llvm-svn: 237328
lock imports fcntl, which doesn't exist on Windows. If we need
to use this class on Windows, we will need to implement something
based on the CreateMutex API.
llvm-svn: 237292
Select expected remote libc++ library name based on remote platform. This is
used to verify libc++ is in the loaded image list by various tests which use it.
Test Plan:
Passes the following tests mac -> linux with this patch:
TestDataFormatterLibccIterator.py
TestDataFormatterLibccMap.py
TestDataFormatterLibccMultiMap.py
TestDataFormatterLibcxxMultiSet.py
TestDataFormatterLibcxxSet.py
TestDataFormatterUnordered.py
Differential Revision: http://reviews.llvm.org/D9759
llvm-svn: 237288
Someone must have changed the behavior of FileSpec slightly
relating to whether or not there is a trailing backslash when calling
GetPath() and GetDirectory(). This caused ScriptInterpreterPython
to find the wrong values when initializing sys.path, and as a result
we couldn't find the lldb module.
This patch fixes the issue, and also adds a test to make sure that
GetDirectory() does not return a string containing a trailing slash.
llvm-svn: 237282
There were two versions of DoAttachToprocessWithId. One that takes
a pid_t, and the other which takes a pid_t and a ProcessAttachInfo.
There were no callers of the former version, and all of the
implementations of this version were simply forwarding calls to
one version or the other.
llvm-svn: 237281
Summary:
This was originally http://reviews.llvm.org/D8709 , but I didn't commit it correctly.
Since then GetSupportedArchitectureAtIndex() has been changed. That change, http://reviews.llvm.org/D9511 , breaks non-x86 linux implementations, so this change goes back to the old implementation and adds remote linux support from D8709.
D8709 summary:
The Linux Platform currently will only say the Host architecture is supported. This patch retains that behavior for the Host Platform, but adds a list of architectures for the Remote Platform.
Reviewers: clayborg, flackr
Reviewed By: clayborg
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D9683
llvm-svn: 237278
Checks the host platform to determine logging channel to test in
TestRegisters.py as the logging runs host side.
Test Plan:
./dotest.py $DOTEST_OPTS -v -t -p TestRegisters.py
This passes mac -> linux as it's logging the correct channel.
Differential Revision: http://reviews.llvm.org/D9755
llvm-svn: 237271
all hosts.
We require a workaround to be able to locate global and anonymous namespace
functions in the dwarf symbols on linux binaries. This patch enables this code
on all platforms so that we can still find these symbols when debugging from a
different host platform.
Test Plan:
The following tests begin passing when running with a mac host to linux client:
TestCallCPPFunction.py
TestCallStopAndContinue.py
TestExprs.py
TestExprsChar.py
TestNamespace.py
TestOverloadedFunctions.py
TestRvalueReferences.py
TestThreadExit.py
Differential Revision: http://reviews.llvm.org/D9754
llvm-svn: 237270
Summary:
This patch fixes/cleans code around of (gdb) prompt:
# Add CMICmnStreamStdout::WritePrompt
# Clean up CMICmnStreamStdout::TextToStdout (don't lock
the m_mutex twice because it will be locked in CMICmnStreamStdout::WritePriv)
# Remove unused CMICmnStreamStdin::m_bShowPrompt field
# Refactor CMICmnLLDBDebuggerHandleEvents to use CMICmnStreamStdout::WritePrompt
instead of TextToStdout("(gdb)")
# Refactor CMIDriver to use CMICmnStreamStdout::WritePrompt instead of
```
if (bOk && m_rStdin.GetEnablePrompt())
bOk = m_rStdOut.WriteMIResponse(m_rStdin.GetPrompt());
```
Test Plan: ./dotest.py -v --executable $BUILDDIR/bin/lldb tools/lldb-mi/
Reviewers: abidh
Reviewed By: abidh
Subscribers: lldb-commits, abidh
Differential Revision: http://reviews.llvm.org/D9737
llvm-svn: 237248
Summary:
This patch is the beginnings of support for Non-stop mode in the remote protocol. Letting a user examine stopped threads, while other threads execute freely.
Non-stop mode is enabled using the setting target.non-stop-mode, which sends a QNonStop packet when establishing the remote connection.
Changes are also made to treat the '?' stop reply packet differently in non-stop mode, according to spec https://sourceware.org/gdb/current/onlinedocs/gdb/Remote-Non_002dStop.html#Remote-Non_002dStop.
A setting for querying the remote for default thread on setup is also included.
Handling of '%' async notification packets will be added next.
Reviewers: clayborg
Subscribers: lldb-commits, ADodds, ted, deepak2427
Differential Revision: http://reviews.llvm.org/D9656
llvm-svn: 237239
Summary:
"import crashinfo" was probably failing because multiple dotest invocations
are all trying to compile crashinfo.so at the same time.
I've put a mutex around the compile step to prevent this.
Reviewers: clayborg, chying
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D9732
llvm-svn: 237230
A dummy target is used by TargetList::CreateTargetInternal to prime newly
created targets. the first time this is done it creates the dummy target. The
dummy target is created with the host platform (See
TargetList::CreateDummyTarget) which results in switching the selected platform
back to the host platform even when creating a target for a different platform.
This change avoids changing the selected platform while creating the dummy
target to prevent this side effect.
Test Plan:
./dotest.py $DOTEST_OPTS -t -p TestCreateAfterAttach.py
Tests using process attach (e.g. TestCreateAfterAttach.py, TestHelloWorld.py)
now run successfully mac -> linux.
Differential Revision: http://reviews.llvm.org/D9712
llvm-svn: 237221
Removed some unused variables, added some consts, changed some casts
to const_cast. I don't think any of these changes are very
controversial.
Differential Revision: http://reviews.llvm.org/D9674
llvm-svn: 237218
Ideally, this would be put in the individual test files.
Unfortunately, I'm not sure how to do that quickly/easily.
I'm open to suggestions.
In the meantime, I'll submit this to stabilze the build server.
llvm-svn: 237206
Summary:
GetCurrentDirectory() returns the number of characters copied; 0 is a failure, not a success.
Add implementation for chdir().
Reviewers: zturner
Reviewed By: zturner
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D9300
llvm-svn: 237162
Updated PlatformLinux::GetSupportedArchitectureAtIndex to call the
PlatformRemoteGdbServer::GetSupportedArchitectureAtIndex if connected remotely.
This should return the correct thing for android (to fix those failing tests),
and is also working for mac to linux.
Test Plan:
./dotest.py $DOTEST_OPTS -t -p TestCallStdStringFunction.py
The above still passes when running mac->linux indicating it successfully
identified PlatformLinux as the target platform and converted the mmap options
correctly.
Differential Revision: http://reviews.llvm.org/D9672
llvm-svn: 237128
This patch adds new default flag -fno-builtin which forces gcc to not optimize builtin functions.
For example, without this flag GCC replaces printf("hello\n") -> puts("hello") even if -O0 was specified
Also this patch fixes the MiDataTestCase.test_lldbmi_data_disassemble test on Linux/gcc.
llvm-svn: 237118
The defult implementation falls back to GetRegisterCount what
includes the debug registers also what shouldn't be displayed to
the user.
llvm-svn: 237111
Summary:
NPL::Resume attempted to handle eStateStopped as a resume action. However:
- GDBRemoteCommunicationServerLLGS (the only user of NPL) never sets this action
- it could set this action in response to a vCont:t packet, but LLDB never produces this packet
- gdb-remote protocol documentation says vCont:t packet is used only in non-stop mode, but LLDB
does not support non-stop mode
- even if LLDB supported non-stop mode, this implementation of eStateStopped does something
different from what the spec says it should (according to spec, it should stop the specified
thread, but this seems to want to stop all threads).
Given the facts above, I believe we should remove this unused and untested code, as it probably
doesn't even work and removing it makes the rest of the code noticably simpler.
Reviewers: ovyalov, chaoren
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D9657
llvm-svn: 237103
Summary:
Since the former-TSC events are now processed synchronously, there is no need for to protect them
with a separate mutex - all the actions are now guarded by the big m_threads_mutex.
With the mutex gone, the following functions, no longer have any purpose and were removed:
NotifyThreadCreate: replaced by direct calls to ThreadWasCreated
NotifyThreadStop: replaced by direct calls to ThreadDidStop
NotifyThreadDeath: folded into StopTrackingThread
ResetForExec: inlined as it consisted of a single line of code
RequestThreadResume(AsNeeded): replaced by direct calls to ResumeThread
StopThreads: removed, as it was never called
Test Plan: tests continue to pass
Reviewers: ovyalov, chaoren
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D9603
llvm-svn: 237101
Summary:
When -var-create fails, we will now show the error message from the failed evaluation if it is available.
Patch from chuckr@microsoft.com
Test Plan: I fixed the MiVarTestCase.test_lldbmi_eval test to expect the new error string. All MI tests passing on OS X.
Reviewers: abidh, ChuckR
Subscribers: greggm, lldb-commits, paulmaybee
Differential Revision: http://reviews.llvm.org/D9691
llvm-svn: 237094
Added missing SBLanguageRuntime.h to lldb.xcodeproj, set to Public (fixed compile error in TestPublicAPIHeaders)
Removed reference to (temporarily) missing gtest.xcodeproj
Fixed TestDeadStrip compile error
XFAIL TestPublicAPIHeaders - test passes but teardown command 'settings remove target.env-vars DYLD_LIBRARY_PATH' fails
XFAIL TestCModules - use of undeclared identifier 'MIN'
XFAIL TestModulesAutoImport - clang: error: unknown argument: '-gmodules'
XFAIL TestObjCNewSyntax - expr -- @((char*)"Hello world" + 6) cannot box a string value because NSString has not been declared
http://reviews.llvm.org/D9643
llvm-svn: 237085
This is a very minor change.
Just reshuffle the elements of the log filename so that the test name
comes before the arch/compiler
Before:
Failure-x86_64-clang-TestCModules.CModulesTestCase.test_expr_with_dwarf.log
After:
Failure-TestCModules.CModulesTestCase.test_expr_with_dwarf-x86_64-clang.log
This way, results are grouped by test name, not by arch. I think this
is much more useful.
Differential Revision: http://reviews.llvm.org/D9648
llvm-svn: 237076
Summary:
TargetList::CreateTargetInternal() will only select the current Platform. A previous patch always sets platform_sp to the current Platform, so a check later to see if platform_sp was not defined always failed, and the current Platform was used. This patch removes that check, so if the current Platform is not compatible with the target architecture, CreateTargetInternal() will call Platform::GetPlatformForArchitecture() to select a compatible Platform.
Vince, remote linux tests (Ubuntu -> remote Ubuntu) pass the same with and without this patch.
Reviewers: vharron, clayborg
Reviewed By: clayborg
Subscribers: jingham, lldb-commits
Differential Revision: http://reviews.llvm.org/D8749
llvm-svn: 237053
Summary: The Linux Platform shouldn't care about the Vendor field in the Triple. Currently it allows a value of "PC", or "unknown" if LLDB was built on Linux. This patch removes that check, so the Vendor field isn't touched. This will allow the Linux Platform to be created when using a Triple of *-*-Linux.
Reviewers: vharron, clayborg, sas, tberghammer
Reviewed By: clayborg, sas, tberghammer
Subscribers: tberghammer, sas, lldb-commits
Differential Revision: http://reviews.llvm.org/D8742
llvm-svn: 237052
Summary:
Hexagon is a VLIW processor. It can execute multiple instructions at once, called a packet. Breakpoints need to be alone in a packet. This patch will make sure that temporary breakpoints used for stepping are set at the start of a packet, which will put the breakpoint in a packet by itself.
Patch by Deepak Panickal of CodePlay and Ted Woodward of Qualcomm.
Reviewers: deepak2427, clayborg
Reviewed By: clayborg
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D9437
llvm-svn: 237047
Summary:
Since we don't yet have remote windows debugging, it should be safe to assume
that the remote target uses unix path separators.
Reviewers: ovyalov, zturner, clayborg, vharron
Reviewed By: vharron
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D9633
llvm-svn: 237006
When there is two brekapoint on two consecutive instruction then
the second breakpoint is ignored by lldb. This test check for the
correct behaviour in this scenario.
Differential revision: http://reviews.llvm.org/D9661
llvm-svn: 236997
For some reason this happens only when running the full test suite
(e.g., via ninja check-lldb), but not when running the
TestStaticVariables.py tests in isolation. XFAIL for now while
investigating, in an attempt to bring the bot to green and reduce noise.
llvm.org/pr20550
llvm-svn: 236993
Summary:
Now that all thread events are processed synchronously, there is no need to have separate records
of whether a thread is running. This changes the (ever-dwindling) remains of the TSC to use
NativeThreadLinux as the authoritative source of the state of threads. The rest of the
ThreadContext we need has been moved to a member of NTL.
Test Plan: ninja check-lldb continues to pass
Reviewers: chaoren, ovyalov
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D9562
llvm-svn: 236983
Test Plan: run tests with/without python debugger
Tested on OSX & Linux with PyCharm
Reviewers: chying, clayborg
Differential Revision: http://reviews.llvm.org/D9593
llvm-svn: 236957
Summary:
New dotest options that allow arbitrary log channels and
categories to be enabled. Also enables logging for locally run
debug servers.
Log messages are separated into separate files per test case.
(this makes it possible to log in dosep runs)
These new log files are stored side-by-side with trace files in the
session directory.
These files are deleted by default if the test run is successful.
If --log-success is specified, even successful logs are retained.
--log-success is useful for creating reference log files.
Test Plan:
add '--channel "lldb all" --channel "gdb-remote packets" --log-success'
to your dotest options
Tested on OSX and Linux
Differential Revision: http://reviews.llvm.org/D9594
llvm-svn: 236956
Converts the MAP_PRIVATE and MAP_ANON options to the target platform constants
(on which the call runs) rather than using those of the compiled host.
Test Plan:
Run test suite, the following tests requiring memory allocation / JIT support
begin passing when running mac -> linux:
Test11588.py
TestAnonymous.py
TestBreakpointConditions.py
TestCPPStaticMethods.py
TestCStrings.py
TestCallStdStringFunction.py
TestDataFormatterCpp.py
TestDataFormatterStdList.py
TestExprDoesntBlock.py
TestExprHelpExamples.py
TestFunctionTypes.py
TestPrintfAfterUp.py
TestSBValuePersist.py
TestSetValues.py
Differential Revision: http://reviews.llvm.org/D9511
llvm-svn: 236933
XFAILing these does not work because the timeout is caught by the
top-level test infrastucture instead.
Some might be llvm.org/pr22784
llvm-svn: 236924
Summary:
This seems to be sufficient to get the tests taking longer than the
previous timeout of 5m to run to completion on Android to pass instead
of timing out.
Reviewers: chaoren
Reviewed By: chaoren
Subscribers: tberghammer, lldb-commits
Differential Revision: http://reviews.llvm.org/D9627
llvm-svn: 236913
Thread-safe logging had been disabled because of a deadlock,
possibly due to a lock acquired during a signal handler.
This patch turns thread safe logging back on and also greatly
reduces the scope of the lock, confining it only to the code that
affects the underlying output stream, instead of all the code that
builds up the formatted log message. this should resolve the
issue surrounding the deadlock.
llvm-svn: 236892
For PIE executables the type of the main executable is shared object
so we can't force that the main executable should have the type of
executable.
llvm-svn: 236870
I'm not yet sure what's wrong with pexpect and I cannot reproduce this
problem locally. XFAIL these tests for now to reduce buildbot noise so
I can track down the remaining buildbot failures.
llvm.org/pr22784
llvm-svn: 236857
It's reported to pass consistently on Linux now, and it passed for me
in local testing on FreeBSD. Remove the expectedFailureFreeBSD decorator
for now.
llvm.org/pr20274
llvm-svn: 236853
If no temp directory specified by the user on android then fall back
to /data/local/tmp what is always present on the device. It removes
the dependency of specifying TMPDIR for executing platform commands
on android.
Differential revision: http://reviews.llvm.org/D9569
llvm-svn: 236843
This patch includes the following changes:
# Add CMIUtilString::ConvertToASCII to convert unicode to ASCII (MI)
# Rework CMICmnLLDBUtilSBValue::GetSimpleValue to print wide/unicode char (MI)
## Add CMICmnLLDBUtilSBValue::GetSimpleValueChar
## Extend CMICmnLLDBUtilSBValue::IsCharType to accept char16_t/char32_t
## Don't ignore the fail_value in SBValue::GetValueAsUnsigned
# Rework CMIUtilString::ConvertToASCII (MI)
## Don't use templates
## Change the function signature to convert signle characters (was std::basic_string)
## Rename CMIUtilString::ConvertToASCII to CMIUtilString::ConvertToPrintableASCII
# Add CMIUtilString::ConvertToPrintableASCII for char (MI)
## Refactor CMIUtilString::Escape
## Simplify CMICmnLLDBUtilSBValue::GetSimpleValueChar for char
# Add char16_t* and char32_t* support in CMICmnLLDBUtilSBValue::GetSimpleValue (MI)
## Add CMICmnLLDBUtilSBValue::GetSimpleValueCStringPointer
## Add CMICmnLLDBUtilSBValue::ReadCStringFromHostMemory2
(it's extended version of CMICmnLLDBUtilSBValue::ReadCStringFromHostMemory)
# Improve error checking in CMICmnLLDBUtilSBValue::GetSimpleValueChar (MI)
# Refactor CMICmnLLDBUtilSBValue (MI)
## Remove CMICmnLLDBUtilSBValue::ReadCStringFromHostMemory
(use CMICmnLLDBUtilSBValue::ReadCStringFromHostMemory2 instead)
## Rename CMICmnLLDBUtilSBValue::ReadCStringFromHostMemory2 to
CMICmnLLDBUtilSBValue::ReadCStringFromHostMemory
## Move CMICmnLLDBUtilSBValue::GetValueCString to private methods
## Rename CMICmnLLDBUtilSBValue::GetValueCString to
CMICmnLLDBUtilSBValue::GetSimpleValueCStringArray
## Remove CMICmnLLDBUtilSBValue::GetChildValueCString
# Improve MiGdbSetShowTestCase.test_lldbmi_gdb_set_show_print_char_array_as_string test to check char16_t/char32_t (MI)
# Fix CMICmnLLDBUtilSBValue::GetSimpleValueCStringArray for Unicode (MI)
## Fix handling of char16_t and char32_t
## Improve CMICmnLLDBUtilSBValue::ReadCStringFromHostMemory to read
variables of type char[]: add vnMaxLen argument
## Turn on few cases to check char16_t[] and char32_t[] output in
MiGdbSetShowTestCase.test_lldbmi_gdb_set_show_print_char_array_as_string
# Remove unnecessary checks in CMICmnLLDBUtilSBValue (MI)
llvm-svn: 236827