Commit Graph

15347 Commits

Author SHA1 Message Date
Chris Bieneman f817bae161 [Test Suite] Pull generateSource into lldbtest
Summary:
Convert tests using LLDB headers to use generateSource to put the right include paths in place regardless of whether or not you're building a framework.

This also abstracted generateSource out of TestPublicAPIHeaders.py into lldbtest.py.

Reviewers: tfiala, zturner

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D25887

llvm-svn: 285357
2016-10-27 22:52:32 +00:00
Chris Bieneman 91967bd301 [CMake] Rename lldb-launcher to darwin-debug
Summary: This tool is only built on Darwin, and the name darwin-debug matches the Xcode project. We should have this in sync unless there is a good reason not to.

Reviewers: zturner, tfiala, labath

Subscribers: labath, mgorny, lldb-commits

Differential Revision: https://reviews.llvm.org/D25745

llvm-svn: 285356
2016-10-27 22:51:41 +00:00
Enrico Granata c046497bf0 Add support for "type lookup" to find C and C++ types
This is an important first step in closing the functionality gap between "type lookup" and "images lookup -t"

rdar://28971388

llvm-svn: 285332
2016-10-27 18:44:45 +00:00
Enrico Granata 73418dfe61 Fix an issue where frame variable -s <varname> would not show the scope even though the user asked for it
Part of rdar://28434047

llvm-svn: 285226
2016-10-26 19:17:49 +00:00
Enrico Granata 0cd95447db Actually use = delete to mark constructors and operators we want to not exist. Just declaring them as private works, but it can confuse certain tools as it doesn't actually declare intent, and the C++11 way is more expressive anyway, so this is pure win
rdar://28960209

llvm-svn: 285216
2016-10-26 18:12:52 +00:00
Pavel Labath 42eb6908e0 Don't set a software stepping breakpoint at 0 on arm or mips.
Summary:
Check whether the setting the breakpoint failed during instruction emulation. If
it did, the next pc is likely in unmapped memory, and the inferior will crash
anyway after the next instruction. Do not return an error in this case, but just
continue stepping.
Reenabled the crash during step test for android/linux.

Reviewers: labath

Subscribers: aemerson, rengolin, tberghammer, danalbert, srhines, lldb-commits

Differential Revision: https://reviews.llvm.org/D25926
Author: Jason Majors <jmajors@google.com>

llvm-svn: 285187
2016-10-26 11:13:56 +00:00
Jason Molenda a3b7527ccb Enable the use of the new dyld SPI on the current
generation macosx/ios/tvos/watchos.

llvm-svn: 285172
2016-10-26 04:48:41 +00:00
Jim Ingham f2673d6480 SBWatchpoint::Disable doesn't actually work. Add a test that shows this.
Next to fix it!

llvm-svn: 285153
2016-10-26 01:09:21 +00:00
Jim Ingham 209a77d8d9 Fix a race condition between the "ephemeral watchpoint disabling" and commands the continue the process.
This closes https://reviews.llvm.org/D25875.

llvm-svn: 285114
2016-10-25 20:34:32 +00:00
Jim Ingham 8bd8e463b7 Fixing up the project file for the removal of LibStdcppSmartPointer.cpp.
llvm-svn: 285113
2016-10-25 20:32:26 +00:00
Pavel Labath e7dd397209 Revert "Improve the libstdc++ smart pointer formatters"
This reverts commit r284828, as it causes an infinite loop in
TestPrintStackTraces (funnily enough, only when logging is enabled).

llvm-svn: 285068
2016-10-25 13:24:53 +00:00
Todd Fiala 409252fcef remove xfail from TestObjCNewSyntax.py test_expr_gmodules()
Fixes:
rdar://27792848

llvm-svn: 285032
2016-10-24 21:46:46 +00:00
Pavel Labath b0f359e610 Use shorter names in TestConcurrentEvents tests
Otherwise, they tend to generate filename too long errors.

They already contain the same test name in the directory, file, and class names,
so no information is really lost here.

llvm-svn: 284987
2016-10-24 16:20:43 +00:00
Pavel Labath 7a8ba4ffbe Fix arm64 sub-register definitions
The "value regs" field was filled incorrectly. It is supposed to list the
registers that *this* register is a sub-register of, not the other way around.
This manifested itself in "register read" showing only the smaller sub-registers
(and a bunch of tests not passing). I am not sure if the "invalidates" field is
correct either, but it's usage seems to be inconsistent, so I'll leave that as-is
for now.

llvm-svn: 284981
2016-10-24 14:57:50 +00:00
Pavel Labath 183098ca47 Reformat RegisterInfos_arm64 into a table. NFC
llvm-svn: 284976
2016-10-24 14:01:52 +00:00
Pavel Labath 16706dcbd4 Add the new arm64 sub-register definitions to NativeRegisterContextLinux
It's quite sad that we have to edit so many files just to add a register. I am
going to investigate how to merge these definitions somehow, but for now this
should at least get arm64 linux working again.

llvm-svn: 284970
2016-10-24 12:59:20 +00:00
Jason Molenda bc22c8d8d8 Add some additional logging to
DynamicLoaderDarwinKernel::CheckForKernelImageAtAddress to debug
corefiles that may not be correctly formed.

<rdar://problem/28884846> 

llvm-svn: 284900
2016-10-21 23:45:07 +00:00
Chris Bieneman 7ba5581b84 [Test Suite] Allow overriding codesign identity
Summary: Not everyone names their code sign identity "lldb_codesign", so it is nice to allow this to be overridden.

Reviewers: zturner, tfiala

Subscribers: labath, mgorny, lldb-commits

Differential Revision: https://reviews.llvm.org/D25714

llvm-svn: 284893
2016-10-21 22:13:55 +00:00
Chris Bieneman 1bd5f52e68 [CMake] Fix standalone build
not and FileCheck targets may not be defined in standalone builds.

llvm-svn: 284854
2016-10-21 18:38:44 +00:00
Jim Ingham e3b7ba2ffe Add the new stdcpp formatters to the Xcode project.
llvm-svn: 284851
2016-10-21 18:18:25 +00:00
Enrico Granata 5a75a0d8f5 I hadn't fixed all the instances of the old marker for scripted format strings; do so now
llvm-svn: 284847
2016-10-21 18:03:55 +00:00
Tamas Berghammer de2cc6e4b4 Fix incorrect header order introduced in rL284830
llvm-svn: 284831
2016-10-21 15:05:03 +00:00
Tamas Berghammer d161b2147b Add data formatter for libstdc++ unique_ptr
Differential revision: https://reviews.llvm.org/D25734

llvm-svn: 284830
2016-10-21 15:02:44 +00:00
Tamas Berghammer 7f15dba16d Add data formatter for libstdc++ tuple
Differential revision: https://reviews.llvm.org/D25733

llvm-svn: 284829
2016-10-21 15:02:38 +00:00
Tamas Berghammer 0789722d85 Improve the libstdc++ smart pointer formatters
* Display the strong/weak count in the summary
* Display the pointed object as a synthetic member
* Create synthetic children for weak/strong count

Differential revision: https://reviews.llvm.org/D25726

llvm-svn: 284828
2016-10-21 15:02:32 +00:00
Pavel Labath eb01a169c2 Add TestMultipleHits.py
This tests that lldb handles the situation when a single instruction triggers
multiple watchpoint hits. It currently fails on arm due to what appears to be a
lldb-server bug (pr30758).

llvm-svn: 284819
2016-10-21 11:14:04 +00:00
Pavel Labath 2e8fe80447 Revert "Fix a race condition between "ephemeral watchpoint disable/enable" and continue in commands."
This reverts commit r284795, as it breaks watchpoint handling on arm (and
presumable all architectures that report watchpoint hits without executing the
tripping instruction).

There seems to be something fundamentally wrong with this patch: it uses
process_sp->AddPreResumeAction to re-enable the watchpoint, but the whole point
of the step-over-watchpoint logic (which AFAIK is the only user of this class) is
to disable the watchpoint *after* we resume to do the single step.

I have no idea how to fix this except by reverting the offending patch.

llvm-svn: 284817
2016-10-21 10:52:11 +00:00
Jason Molenda 14699cf1c6 Guard GetEscapedHostname against a nullptr hostname.
This can happen if you debug an iOS corefile on
a mac, where PlatformPOSIX::GetHostname ends up
not providing a hostname because we're working 
with a platform of remote-ios.

llvm-svn: 284799
2016-10-21 02:32:08 +00:00
Jim Ingham 94bd575c73 Fix a race condition between "ephemeral watchpoint disable/enable" and continue in commands.
Also, watchpoint commands, like breakpoint commands, need to run in async mode.

This was causing intermittent failures in TestWatchpointCommandPython.py, which is now solid.

llvm-svn: 284795
2016-10-21 00:06:38 +00:00
Jim Ingham ffd9175f74 Add an API to remove an action from the Process PreResumeActions.
llvm-svn: 284792
2016-10-20 22:50:00 +00:00
Jim Ingham 1d9284c3bc Remove an unnecessary and incorrect check for num locations of a breakpoint
by grubbing the break list output.  If you pass a number of locations into
the run_break_* functions, they will check that this is right for you.

llvm-svn: 284791
2016-10-20 22:49:06 +00:00
Enrico Granata f3a8803b76 frame.script became script.frame a while ago; fix up the docs
llvm-svn: 284788
2016-10-20 22:10:07 +00:00
Enrico Granata c8af52df86 This debugging message has been left in the code for years, until one day it randomly hit on some corrupted memory
It is misleading to users in its current form, and only interesting to me - remove it

rdar://28812568

llvm-svn: 284787
2016-10-20 22:05:21 +00:00
Chris Bieneman 53a7844383 Re-landing a cleaned up implementation of r284550
This time it should actually work. The previous implementaiton was not
getting the linker or compiler flag set correctly in all the right
situations. By moving the check down and basing it of whether or not CXX
is set I we can have the logic to add the flags exist only once for the
linker and once for the compiler instead of duplicating it.

llvm-svn: 284756
2016-10-20 18:01:19 +00:00
Dimitar Vlahovski 039983b915 Minidump plugin: redesign the x86_64 register context
Summary:
I misunderstood the format of the register context layout.
I thought it was a dynamically changing structure, and that it's size
depended on context_flags.
It turned out that it always has the same fixed layout and size,
and the context_flags says which fields of the
struct have valid values.
This required a minor redesign of the register context class.

The layout inconsistency, however, was not a "problem" before (e.g. the plugin was working)
because there also was a bug with checking context_flags - the code was
parsing the entire struct regardless of context_flags.
This bug is also fixed in this commit.

Reviewers: labath, zturner

Subscribers: lldb-commits, amccarth

Differential Revision: https://reviews.llvm.org/D25677

llvm-svn: 284741
2016-10-20 16:01:36 +00:00
Tamas Berghammer 5ac6e91c4f Re-generate the python and cpp reference documentation
They haven't been updated since July 2013 so they missed a lot of new
function added to the SB API since.

Bug: llvm.org/pr30603
llvm-svn: 284725
2016-10-20 13:04:32 +00:00
Omair Javaid 05ac4c445c Fix ARM/AArch64 Step-Over watchpoint issue remove provision for duplicate watchpoints
This patch fixes ARM/AArch64 watchpoint bug which was taking inferior out of control while stepping over watchpoints.
Also adds a test case that tests above problem.

Differential revision: https://reviews.llvm.org/D25057

llvm-svn: 284706
2016-10-20 09:07:26 +00:00
Sean Callanan 7ef7b449a0 Added a decorator for the macOS version and switched over testcases that used platform.release
llvm-svn: 284674
2016-10-20 00:03:39 +00:00
Jason Molenda 0b5102fd7e Add lldb register definitions for w0-w28, s0-s31, and d0-d31 to
RegisterInfos_arm64.h.  These register definitions include the
offset into the register context, which will vary depending on the
endianness of the arm64 target system (e.g. s8 is at offset 0 in
v8 on little-endian, it is at offset 12 on big-endian) and I've
only added the little-endian definitions to the table.  If we want
to add a big-endian arm64 target, we'll need a separate table which
uses the big-endian offsets for these registers.  I changed the
name of the register table from g_register_infos_arm64 to
g_register_infos_arm64_le to make it explicit that this is the
little-endian version of that table, and updated users of the table
to use the new name.

I added support for the "w", "s", and "d" registers to
RegisterContextDarwin_arm64 but it was more an example than anything
useful -- this plugin is only used when working with core files and
darwin core files do not (today) include the floating point register
context, so it only added the support for the "w" pseudo registers.
When we're connected to a real arm64 device, we use the ProcessGDBRemote
code.

llvm-svn: 284666
2016-10-19 23:38:38 +00:00
Pavel Labath 5f05ea84d5 Simplify GetGlobalProperties functions of Thread/Process/Target
Summary:
"Initialization of function-local statics is guaranteed to occur only once even when called from
multiple threads, and may be more efficient than the equivalent code using std::call_once."
<http://en.cppreference.com/w/cpp/thread/call_once>

I'd add that it's also more readable.

Reviewers: clayborg, zturner

Subscribers: lldb-commits

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

llvm-svn: 284601
2016-10-19 15:12:45 +00:00
Pavel Labath 37dabc2427 Remove IntervalTimer class
Summary:
it was added back in 2013, but there are no uses of it. I started refactoring
it, but then it occured to me it would better to delete it.

Reviewers: clayborg, zturner

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D25393

llvm-svn: 284599
2016-10-19 15:01:22 +00:00
Dimitar Vlahovski b52206decc Minidump plugin: functions parsing memory structures and filtering module list
Summary:
Now the Minidump parser can parse the:
1) MemoryInfoList - containing region info about memory ranges (readable,
writable, executable)
2) Memory64List - this is the stuct used when the Minidump is a
full-memory one.
3) Adding filtering of the module list (shared libraries list) - there
can be mutliple records in the module list under the same name but with
different load address (e.g. when the binary has non contigious
sections). FilterModuleList eliminates the duplicated modules, leaving
the one with the lowest load addr.

Added unit tests for everything.

Reviewers: labath, zturner

Subscribers: beanz, mgorny, modocache, lldb-commits, amccarth

Differential Revision: https://reviews.llvm.org/D25569

llvm-svn: 284593
2016-10-19 14:14:18 +00:00
Michal Gorny e2f4b25d04 [cmake] Use LLVM_CMAKE_PATH for GetSVN script
Use the LLVM_CMAKE_PATH variable to locate the GetSVN.cmake script.
The variable was already available in stand-alone builds, and is also
set by LLVM since r284581.

llvm-svn: 284584
2016-10-19 12:54:28 +00:00
Chris Bieneman e0dcd6d7f4 Revert back to the state before r284550
This patch is causing a lot of issues on bots that I didn't see in local testing. I'm going to have to work on this. Reverting for now while I sort it out.

llvm-svn: 284565
2016-10-19 02:44:20 +00:00
Chris Bieneman 716ac7684c Trying to fix a few more missing LDFLAGS.
llvm-svn: 284564
2016-10-19 02:31:31 +00:00
Chris Bieneman 87378bd21e Fixing the linux bots I broke in r284550
Need to gate cxx linker adding driver-mode flag based on the linker being clang.

llvm-svn: 284555
2016-10-19 00:13:56 +00:00
Chris Bieneman b47711ab27 When invoking Terminal, don't assume the default shell
Summary:
If a user has their shell set to a non-POSIX conferment shell the TestTerminal.py tests fail because the shell blurb constructed here may not work in their shell.

In my specific case fish-shell (The Friendly Interactive Shell - http://fishshell.com) does not support $?, it instead uses $status (because it is friendly).

This patch removes the assumption of your default shell by running the constructed bash command via "/bin/bash -c ...". This should be safer for users mutating their shell environment.

Reviewers: tfiala

Subscribers: joerg, lldb-commits

Differential Revision: https://reviews.llvm.org/D25750

llvm-svn: 284552
2016-10-18 23:55:34 +00:00
Chris Bieneman f50761f128 [CMake] Don't include LLDB_TEST_COMPILER in cached variable
Summary:
CMake has no builtin mechanism for cache invalidation. As a general convention you want to not expand user-specified variables in other cached variables because they will not get updated when the user changes their specified value.

This patch moves the "-C" option for dotest.py into the LLDB_TEST_COMMON_ARGS and out of the CMake cache. In order to prevent issues with out-of-date cache files on builders I've added code to scrub "-C ${LLDB_TEST_COMPILER}" out of the CMake caches, by Force writing the variable. This code can be removed in a few days once the change has trickled through CI systems.

Reviewers: tfiala, labath, zturner

Subscribers: lldb-commits, mgorny

Differential Revision: https://reviews.llvm.org/D25751

llvm-svn: 284551
2016-10-18 23:54:28 +00:00
Chris Bieneman e80f007dfb Use clang --driver-mode instead of guessing c++ compiler path
Summary:
When building the LLDB test programs, if your CC is clang it actually isn't safe to make CXX a string replace of "clang -> clang++". This falls down on unix configurations if your compiler is clang-${version}.

A safer approach is to use the "--driver-mode=g++" option to tell clang to act like clang++.

Reviewers: tfiala, zturner, labath

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D25753

llvm-svn: 284550
2016-10-18 23:53:24 +00:00
Todd Fiala af6ff2a91b xfail TestMiSyntax.py's test_lldbmi_output_grammar on macOS
Needs to be investigated.  This is failing locally and on the
Xcode CI.

rdar://28805064

llvm-svn: 284484
2016-10-18 15:15:24 +00:00