Commit Graph

18640 Commits

Author SHA1 Message Date
Kuba Mracek 92369dcffd [lldb] Make frame recognizers vend synthesized eValueTypeVariableArgument values
llvm-svn: 353363
2019-02-07 01:49:10 +00:00
Jonas Devlieghere 9a7356a60f [Driver] Don't try to replay reproducer in the driver.
Because the macros for the SBReproducers have not been committed yet,
the driver should not attempt to replay a reproducer this way.

llvm-svn: 353362
2019-02-07 01:49:07 +00:00
Jonas Devlieghere 9c18978825 Fix my mistake adding SBReproducer the Xcode project
llvm-svn: 353361
2019-02-07 01:42:47 +00:00
Davide Italiano 6c27a06302 [testsuite] Convert a pexpect test to lit.
Summary:

Reviewers: JDevlieghere, friss, zturner, labath, jingham, serge-sans-paille

Subscribers: llvm-commits, lldb-commits

Tags: #llvm

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

llvm-svn: 353345
2019-02-06 21:48:01 +00:00
Jonas Devlieghere e98f590c3e Add SBReproducer to Xcode project
llvm-svn: 353326
2019-02-06 19:05:43 +00:00
Jonas Devlieghere 58947cf854 [Reproducers] SBReproducer framework: Capture & Replay
This is part two of the reproducer instrumentation framework. It
contains the code to capture and replay function calls. The main user of
this framework will be the SB API layer.

For all the details refer to the RFC on the mailing list:
http://lists.llvm.org/pipermail/lldb-dev/2019-January/014530.html

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

llvm-svn: 353324
2019-02-06 18:57:42 +00:00
Aleksandr Urakov 823c66b617 [x64] Process the B field of the REX prefix correctly for the PUSH and POP
instructions

Summary: This patch makes `x86AssemblyInspectionEngine` to process zero value of
the `B` field of the `REX` prefix in a correct way for `PUSH` and `POP`
instructions. MSVC sometimes emits `pushq %rbp` instruction as `0x40 0x55`, and
it was not parsed correctly before.

Reviewers: jasonmolenda, labath

Reviewed By: jasonmolenda, labath

Subscribers: abidh, lldb-commits

Tags: #lldb

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

llvm-svn: 353281
2019-02-06 08:48:30 +00:00
Jan Kratochvil bb3609e49d Fix strlen() of unbound array undefined behavior
LLDB testsuite fails when built by GCC8 on:
  LLDB :: SymbolFile/DWARF/find-basic-namespace.cpp

This is because this code in LLDB codebase has undefined behavior:

  #include <algorithm>
  #include <string.h>
  // lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp:1731
  static struct section_64 {
    char sectname[16];
    char segname[16];
  } sect64 = { {'_','_','a','p','p','l','e','_','n','a','m','e','s','p','a','c'}, "__DWARF" };
  int main() {
    return std::min<size_t>(strlen(sect64.sectname), sizeof(sect64.sectname));
  }

It has been discussed as a (false) bugreport to GCC:
  wrong-code: LLDB testcase fails: SymbolFile/DWARF/find-basic-namespace.cpp
  https://bugzilla.redhat.com/show_bug.cgi?id=1672436

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

llvm-svn: 353280
2019-02-06 08:44:13 +00:00
Jonas Devlieghere edff5f4b21 [Reproducers] lldb-instr: tool to generate instrumentation macros.
This patch introduces a new tool called 'lldb-instr'. It automates the
workflow of inserting LLDB_RECORD and LLDB_REGSITER macros for
instrumentation.

Because the tool won't be part of the build process, I didn't want to
over-complicate it. SB_RECORD macros are inserted in place, while
SB_REGISTER macros are printed to stdout, and have to be manually copied
into the Registry's constructor. Additionally, the utility makes no
attempt to properly format the inserted macros. Please use clang-format
to format the changes after running the tool.

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

llvm-svn: 353271
2019-02-06 04:33:14 +00:00
Jason Molenda 8130bf67ba Add a warning to GDBRemoteRegisterContext (if packet logging enabled)
if the size of the g packet response was smaller than expected and is
going to be ignored.

llvm-svn: 353269
2019-02-06 04:08:09 +00:00
Petr Hosek 23fdd5a37f [CMake] Unify scripts for generating VCS headers
Previously, there were two different scripts for generating VCS headers:
one used by LLVM and one used by Clang and lldb. They were both similar,
but different. They were both broken in their own ways, for example the
one used by Clang didn't properly handle monorepo resulting in an
incorrect version information reported by Clang.

This change unifies two the scripts by introducing a new script that's
used from both LLVM, Clang and lldb, ensures that the new script
supports both monorepo and standalone SVN and Git setups, and removes
the old scripts.

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

llvm-svn: 353268
2019-02-06 03:51:00 +00:00
Jonas Devlieghere 7b3a0f17a5 [Reproducers] Add instrumentation to Xcode project
llvm-svn: 353259
2019-02-06 01:31:00 +00:00
Jonas Devlieghere cf26117095 Sort Xcode project
llvm-svn: 353258
2019-02-06 01:30:45 +00:00
Jim Ingham 1a377ca4cd Little more cleanup on https://reviews.llvm.org/D57552
Thanks Jonas...  One more early continue and using
a range where we had an iterator.

NFC

llvm-svn: 353257
2019-02-06 01:27:45 +00:00
Jim Ingham 78449f009a Add the source directory for https://reviews.llvm.org/D57552.
llvm-svn: 353251
2019-02-06 00:52:04 +00:00
Jim Ingham 052f7ff96a Fix PathMappingList::FindFile to handle relative incoming FileSpecs.
An equivalent change was made to RemapPaths, but it needed to be made 
here as well.  Also added a test for this and made the setup a little
more complex to avoid false successes.

<rdar://problem/47642498>

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

llvm-svn: 353243
2019-02-05 23:48:10 +00:00
Jonas Devlieghere 53ae55a207 Remove accidentally commited file in xcshareddata
llvm-svn: 353239
2019-02-05 23:35:01 +00:00
Davide Italiano 76046abbfa [Py3/TestAppleOSSimulator] Another byte<->str interoperability issue.
llvm-svn: 353226
2019-02-05 22:24:53 +00:00
Jonas Devlieghere 3e30062acb [unittests] Fix warning
warning: comparison of integers of different signs: 'const int' and
'const unsigned long' [-Wsign-compare]

llvm-svn: 353196
2019-02-05 18:46:37 +00:00
Jonas Devlieghere 494fd8f84f [Reproducers] Instrumentation Framework: Serialization
This is the is serialization/deserialization part of the reproducer
instrumentation framework.

For all the details refer to the RFC on the mailing list:
http://lists.llvm.org/pipermail/lldb-dev/2019-January/014530.html

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

llvm-svn: 353195
2019-02-05 18:46:36 +00:00
Davide Italiano 0d98b771b0 [Obj-C] Fix undefined behaviour(s) in the new NSTaggedDate formatter.
Type punning through a union -> no good.
double to uint64 to double again -> no good either.

The nice side effect, other than silencing the sanitizer bot
is that it fixes the formatting of some dates, e.g. Jan 1st 1970.

<rdar://problem/47617983>

llvm-svn: 353191
2019-02-05 17:30:53 +00:00
Stefan Granitz 26693b909c Update Xcode project after r353047
llvm-svn: 353174
2019-02-05 14:41:26 +00:00
Krasimir Georgiev 7ffc4681ca [Expressions] Fix -Wreorder warning from r353149
Summary:
```
ClangExpressionDeclMap.cpp:72:60: error: field 'm_struct_vars' will be initialized after field 'm_ctx_obj' [-Werror,-Wreorder]
      m_result_delegate(result_delegate), m_parser_vars(), m_struct_vars(),
```

Reviewers: bkramer, aleksandr.urakov

Reviewed By: aleksandr.urakov

Subscribers: aleksandr.urakov

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

llvm-svn: 353161
2019-02-05 11:35:45 +00:00
Aleksandr Urakov 40624a085c [Expressions] Add support of expressions evaluation in some object's context
Summary:
This patch adds support of expression evaluation in a context of some object.
Consider the following example:
```
struct S {
  int a = 11;
  int b = 12;
};

int main() {
  S s;
  int a = 1;
  int b = 2;
  // We have stopped here
  return 0;
}
```
This patch allows to do something like that:
```
lldb.frame.FindVariable("s").EvaluateExpression("a + b")
```
and the result will be `33` (not `3`) because fields `a` and `b` of `s` will be
used (not locals `a` and `b`).

This is achieved by replacing of `this` type and object for the expression. This
has some limitations: an expression can be evaluated only for values located in
the debuggee process memory (they must have an address of `eAddressTypeLoad`
type).

Reviewers: teemperor, clayborg, jingham, zturner, labath, davide, spyffe, serge-sans-paille

Reviewed By: jingham

Subscribers: abidh, lldb-commits, leonid.mashinskiy

Tags: #lldb

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

llvm-svn: 353149
2019-02-05 09:14:36 +00:00
Davide Italiano 60731071de [Python2 to Python 3] Fix print -> print().
llvm-svn: 353130
2019-02-05 00:59:57 +00:00
Jonas Devlieghere c0f00a1f38 Update stale comment in lang/c/struct_types/main.c
rdar://47322760

llvm-svn: 353087
2019-02-04 20:33:35 +00:00
Pavel Labath e7404d99d2 Fixes for the ProcessLaunchInfo move
llvm-svn: 353049
2019-02-04 15:03:06 +00:00
Pavel Labath eef758e949 Move FileAction, ProcessInfo and ProcessLaunchInfo from Target to Host
Summary:
These classes describe the details of the process we are about to
launch, and so they are naturally used by the launching code in the Host
module. Previously they were present in Target because that is the most
important (but by far not the only) user of the launching code.

Since the launching code has other customers, must of which do not care
about Targets, it makes sense to move these classes to the Host layer,
next to the launching code.

This move reduces the number of times that Target is included from host
to 8 (it used to be 14).

Reviewers: zturner, clayborg, jingham, davide, teemperor

Subscribers: emaste, mgorny, lldb-commits

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

llvm-svn: 353047
2019-02-04 14:28:08 +00:00
Stefan Granitz da8fe66cb4 Fix the xcode build for r352845, attempt #2
llvm-svn: 352902
2019-02-01 19:31:02 +00:00
Stefan Granitz 5c49a3f4cc Revert "Fix the xcode build for r352845."
This reverts commit 72c1213a5e901b80c0f1d2794e5088d7f71a3632.

llvm-svn: 352901
2019-02-01 19:30:57 +00:00
Thomas Anderson 7ba2d3e872 [lldb] Relax libc++ ABI version checking
libc++ has programmable ABI versioning controllable with the _LIBCPP_ABI_VERSION
macro.  Currently there are at least 3 settings used in real systems (1 as the
default, ndk1 for Anroid, Cr for Chromium).

Only the 1 and ndk1 cases were handled.  This change relaxes the check to allow
any ABI version.

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

llvm-svn: 352899
2019-02-01 19:10:39 +00:00
Jim Ingham 5c6544409a Fix the xcode build for r352845.
llvm-svn: 352894
2019-02-01 18:26:08 +00:00
Aleksandr Urakov 2c15fc56f8 [PDB] Fix build after r352845
llvm-svn: 352858
2019-02-01 11:10:28 +00:00
Aleksandr Urakov 758657e565 [PDB] Fix location retrieval for function local variables and arguments that are
stored relative to VFRAME

Summary:
This patch makes LLDB able to retrieve proper values for function arguments and
local variables stored in PDB relative to VFRAME register.

Patch contains retrieval of corresponding FPO table entries from PDB and a
generic translator from FPO programs to DWARF expressions to get correct VFRAME
value.

Patch also improves variables-locations.test and makes this test passable on
x86.

Patch By: leonid.mashinsky

Reviewers: zturner, asmith, stella.stamenova, aleksandr.urakov

Reviewed By: zturner

Subscribers: arphaman, labath, mgorny, aprantl, JDevlieghere, lldb-commits

Tags: #lldb

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

llvm-svn: 352845
2019-02-01 10:01:18 +00:00
Jonas Devlieghere 043ff33362 [unittest] Fix scalar unit test.
The test was using ASSERT_EQ instead of ASSERT_STREQ which meant we were
comparing string addresses instead of the actual string. This caused the
test to fail with with the sanitizers enabled.

llvm-svn: 352780
2019-01-31 18:48:17 +00:00
Shafik Yaghmour d03bf06883 Fix use of non-existing variable in crashlog.py
Summary:
The method find_matching_slice(self) uses uuid_str on one of the paths but the variable does not exist and so this results in a NameError exception if we take that path.

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

llvm-svn: 352772
2019-01-31 17:33:17 +00:00
David Carlier 4fda0720fe [LLDB] FreeBSD suppress compilation warning
Reviewers: labath, teemperor

Reviewed By: teemperor

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

M    source/Plugins/Process/FreeBSD/ProcessMonitor.cpp

llvm-svn: 352744
2019-01-31 11:54:58 +00:00
Petr Hosek 12062e0667 Revert "[CMake] Unify scripts for generating VCS headers"
This reverts commits r352729 and r352731: this broke Sanitizer Windows bots

llvm-svn: 352733
2019-01-31 07:12:43 +00:00
Petr Hosek 08c60c1894 [CMake] Migrate lldb to the new VCS script
This was accidentaly omitted from r352729 and broke lldb bots.

llvm-svn: 352731
2019-01-31 06:47:10 +00:00
Davide Italiano 46138cdb0d [testsuite] Fix TestAppleSimulator so that it works with Python 3.
llvm-svn: 352710
2019-01-31 01:17:47 +00:00
Davide Italiano 699bc17953 [Python] Fix gdb-remote and lldb-server utilities to work with Py3.
llvm-svn: 352709
2019-01-31 01:01:53 +00:00
Davide Italiano 96497da4ae [Python] Python 2 and Python 3 disagree on `/`.
One considers it integer division, the other doesn't.
Move to `//` (floor division) so that this test passes
independently from the version.

llvm-svn: 352706
2019-01-31 00:43:36 +00:00
Jonas Devlieghere 41287d511c Add Sphinx generated html files as output to the build phase.
This will ensure we don't rerun Sphinx when the files exist.

llvm-svn: 352703
2019-01-31 00:40:38 +00:00
Davide Italiano 0d298f5af5 [Python] String(s) and bytes are two different entities in 3.7.
So, we need an explicit call to decode() here to let it work with
both interpreters. Fixes TestXMMRegisters on 3.7.

llvm-svn: 352701
2019-01-31 00:11:33 +00:00
Jonas Devlieghere 732f455386 Add lldb-docs target to Xcode project
This patch adds the lldb-docs target which generates the Sphinx html
documentation.

llvm-svn: 352696
2019-01-30 23:56:55 +00:00
Shafik Yaghmour 1849dd4acc Fix handling of CreateTemplateParameterList when there is an empty pack
Summary:
When we are creating a ClassTemplateSpecializationDecl in ParseTypeFromDWARF(...) we are not handling the case where variadic pack is empty in the specialization. This patch handles that case and adds a test to prevent future regressions.

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

llvm-svn: 352677
2019-01-30 21:48:56 +00:00
Jonas Devlieghere edb874b231 Add LLDB website and documentation in reStructuredText for Sphinx
The current LLDB website is written in HTML which is hard to maintain.
We have quite a bit of HTML code checked in which can make it hard to
differentiate between documentation written by us and documentation
generated by a tool.

In line with the other LLVM projects, I propose generating the
documentation with Sphix. I think text/rst files provide a lower barrier
for new or casual contributors to fix or update.

This patch adds a copy of the LLDB website and documentation in
reStructuredText. It also adds a new ninja target `docs-lldb-html` when
-DLLVM_ENABLE_SPHINX:BOOL is enabled.

This is the first step in having the website and documentation being
generated from the repository, rather than having the output checked-in
under the www folder. During the hopefully short transition period,
please also update the reStructuredText files when modifying the
website.

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

llvm-svn: 352644
2019-01-30 18:51:40 +00:00
Davide Italiano 042f770738 [Scalar] Remove partially wrong and unused functions.
I originally thought about fixing them, but hey, nobody is
using them anyway.

llvm-svn: 352643
2019-01-30 18:40:05 +00:00
Davide Italiano 92a470edce [Scalar] Hoist a duplicated (and sometimes wrong) comment.
Pointed out by Zachary and Adrian.

llvm-svn: 352641
2019-01-30 18:24:16 +00:00
Davide Italiano 51d46bd4d2 [Scalar] Implement support for 512-bit values.
(useful, e.g. when reading 512-bits registers, a-la AVX-512).

<rdar://problem/46886288>

llvm-svn: 352639
2019-01-30 18:05:36 +00:00