Commit Graph

16439 Commits

Author SHA1 Message Date
Eugene Zemtsov 37b1d7b36f Now a ppc64le binary is correctly detected:
(lldb) target create "tst"
Current executable set to 'tst' (powerpc64le).
(lldb) disassemble -n main
tst`main:
tst[0x7b0] <+0>: addis 2, 12, 2
tst[0x7b4] <+4>: addi 2, 2, 30544
tst[0x7b8] <+8>: mflr 0

Wihout the patch, the endianess was incorrect:
(lldb) target create "tst"
Current executable set to 'tst' (powerpc64).
(lldb) disassemble -n main
tst`main:
tst[0x7b0] <+0>: .long 0x02004c3c ; unknown opcode
tst[0x7b4] <+4>: rlwimi 23, 3, 8, 8, 28
tst[0x7b8] <+8>: lhzu 16, 2172(2)
tst[0x7bc] <+12>: .long 0x100001f8 ; unknown opcode

Simple binary used is identified as:
$ file tst
tst: ELF 64-bit LSB shared object, 64-bit PowerPC or cisco 7500, version
1 (SYSV), dynamically linked, interpreter /lib64/ld64.so.2, for
GNU/Linux 3.2.0, BuildID[sha1]=17a8fa2b24ce2837ba6625fabb34e6b29c6c5db7,
not stripped

Patch by Gustavo Serra Scalet <gustavo.scalet@eldorado.org.br>
Differential Revision: https://reviews.llvm.org/D36804

llvm-svn: 312151
2017-08-30 18:36:48 +00:00
Chris Bieneman c6f6aa441b [IPv6] Fix a bug in the IPv6 listen behavior
The socket bind address should either be localhost or anyaddress. This bug in the listen behavior was preventing lldb-server from opening sockets for non-localhost connections.

The added test verifies that opening an anyaddress socket works and has a non-zero port assignment.

This should resolve PR34183.

llvm-svn: 312008
2017-08-29 16:13:41 +00:00
Jason Molenda af6e7e2b0c update xpc service name.
llvm-svn: 311978
2017-08-29 04:28:48 +00:00
Jim Ingham 7fd34e4b80 Add the DWARF DWP files to the Xcode project.
llvm-svn: 311786
2017-08-25 17:48:01 +00:00
Tamas Berghammer 963ce483b8 Add support for the DWP debug info format
Summary:
The DWP (DWARF package) format is used to pack multiple dwo files
generated by split-dwarf into a single ELF file to make distributing
them easier. It is part of the DWARFv5 spec and can be generated by
dwp or llvm-dwp from a set of dwo files.

Caviats:
* Only the new version of the dwp format is supported (v2 in GNU
  numbering schema and v5 in the DWARF spec). The old version (v1) is
  already deprecated but binutils 2.24 still generates that one.
* Combining DWP files with module debugging is not yet supported.

Subscribers: emaste, mgorny, aprantl

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

llvm-svn: 311775
2017-08-25 13:56:14 +00:00
Jim Ingham 44ea319596 Fixed a typo in the example (getName -> GetName)
but while I was at it I converted the example to use
properties, since that's much nicer looking.

llvm-svn: 311679
2017-08-24 18:01:50 +00:00
Jason Molenda 9ff294f039 Change the ftag x87 register from being 8-bits wide to 16-bits wide
to match the changes Saleem Abdulrasool committed in r311579.  Fixes
a testsuite failure now that the testsuite expects a 16 bit return
value for thsi reg.

llvm-svn: 311627
2017-08-24 03:22:08 +00:00
Jason Molenda c064881a36 When parsing the DBGSourcePathRemapping plist entries
in a dSYM, and it's a version 2 DBGSourcePathRemapping,
in addition to the build/source paths specified, add 
build/source paths with the last two filename components
removed.  This more generic remapping can sometimes
help lldb to find the correct source file in complex
projects.
<rdar://problem/33973545> 

llvm-svn: 311622
2017-08-24 00:58:14 +00:00
Jim Ingham a4bb80b211 Log whether we found a step out plan or not.
llvm-svn: 311590
2017-08-23 19:40:21 +00:00
Saleem Abdulrasool 5b7cc3600a test: fix missed test
I had built without python bindings and did not find this in the grep
output.  Adjust the test output for the printing format update.

llvm-svn: 311582
2017-08-23 18:05:19 +00:00
Saleem Abdulrasool bf2a8a2878 Process: fix FXSAVE on x86
The FXSAVE member `ftw` (FPU Tag Word) was given the wrong size (8-bit)
instead of the correct width (16-bit) as per the x87 Programmer's
Manual.  Adjust this to ensure that we print out the complete value for
the register.

llvm-svn: 311579
2017-08-23 17:23:12 +00:00
Saleem Abdulrasool fe3a5bfb25 ObjC: fix some -Wpedantic warnings by removing ';'
Remove some stray ';' that were in the source code.  NFC.

llvm-svn: 311577
2017-08-23 17:00:14 +00:00
Kuba Mracek 5adc46ca3e Fixup for r311483: Use correct path to StreamString.h
llvm-svn: 311484
2017-08-22 19:09:39 +00:00
Kuba Mracek 20bce855ca [lldb] Correctly escape newlines and backslashes in the JSON serializer
JSON serializer fails to escape newlines and backslashes. Let's fix that.

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

llvm-svn: 311483
2017-08-22 18:36:12 +00:00
Bruce Mitchener 416bc3d70a lldb-argdumper doesn't need lldbCore.
Summary: lldb-argdumper only needs lldbUtility to successfully build and link.

Reviewers: beanz, zturner, labath

Subscribers: mgorny, lldb-commits

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

llvm-svn: 311399
2017-08-21 22:54:49 +00:00
Michal Gorny d5ac1812b7 [unittests] Build LLVMTestingSupport for out-of-source builds
The Process/gdb-remote test now requires the LLVMTestingSupport library
that is not installed by LLVM. As a result, when doing an out-of-source
build it fails being unable to find the library. To solve that, build
a local copy of the library when building LLDB with unittests and LLVM
sources available. This is based on how we deal with bundled gtest
sources.

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

llvm-svn: 311355
2017-08-21 17:41:39 +00:00
Michal Gorny 7e1c51e0c1 [cmake] Explicitly link dependency libraries in the Host library
Add explicit linkage to the necessary system libraries in the Host
library. Otherwise, the library fails to build with -Wl,--as-needed.
The system libraries ended up being listed on the linker command-line
before the static libraries needing them, resulting in --as-needed
stripping them.

Listing the dependent libraries explicitly is the canonical way of
declaring libraries in CMake. It guarantees that the system library
dependencies will be correctly propagated to reverse dependencies.

The code used to link libraries reuses existing EXTRA_LIBS variable,
copying code from other parts of LLDB. We might eventually remove
the direct use of system libraries in the programs; however, I would
prefer if we focused on fixing the build regressions in 5.0 branch
first, and went further after the release.

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

llvm-svn: 311354
2017-08-21 17:41:33 +00:00
Davide Italiano 7e930d12df [Plugins/ObjC] Remove more semicolons to placate -Wpedantic. NFCI.
llvm-svn: 311245
2017-08-19 16:32:19 +00:00
Davide Italiano c8bee2ced2 [Plugins/ObjC] Remove unneded semicolon(s) to placate GCC -Wpedantic.
llvm-svn: 311244
2017-08-19 16:30:47 +00:00
Jason Molenda fba547d7e7 Commiting Christopher Brook's patch for
"Prevent negative chars from being sign-extended into isprint and isspace which take and int and crash if the int is negative"

https://reviews.llvm.org/D36620

llvm-svn: 311207
2017-08-18 22:57:59 +00:00
Michal Gorny 8e58ad5182 [cmake] Add explicit linkage from Core to curses
The Core library calls functions provided by the curses library. Add
an appropriate explicit LINK_LIBS to ${CURSES_LIBRARIES} to propagate
the dependency correctly within the build system.

It seems that so far the linkage was handled by some kind of implicit
magic LLDB_SYSTEM_LIBS variable. However, it stopped working for
unittests as the curses libraries are passed before the LLDBCore
library, resulting in `-Wl,--as-needed` stripping the yet-unused library
before it is required by LLDBCore, and effectively breaking the build.
I think it's better to focus on listing all the dependencies explicitly
and let CMake propagate them rather than trying to figure out why this
hack stopped working.

This is also more consistent with LLVM where the curses linkage
in LLVMSupport is expressed directly in the library rather than deferred
to the final programs.

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

llvm-svn: 311122
2017-08-17 20:33:21 +00:00
Ed Maste 83f0cd17eb convert hard tabs to spaces in PlatformOpenBSD.cpp
Another case of this was responsible for the whitespace conflict
in D34776.

llvm-svn: 311003
2017-08-16 13:10:07 +00:00
Ed Maste 37c40af712 Make i386-*-freebsd expression work on JIT path
* Enable i386 ABI creation for freebsd
* Added an extra argument in ABISysV_i386::PrepareTrivialCall for mmap
  syscall
* Unlike linux, the last argument of mmap is actually 64-bit(off_t).
  This requires us to push an additional word for the higher order bits.
* Prior to this change, ktrace dump will show mmap failures due to
  invalid argument coming from the 6th mmap argument.

Patch by Karnajit Wangkhem

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

llvm-svn: 311002
2017-08-16 12:55:02 +00:00
Tamas Berghammer bba2c83493 Remove the DWARFExpression -> Clang ExpressionParser dependency
It was completly unused and broke the part of the encapsulation that
common code shouldn't depend on specific plugins or language specific
features.

llvm-svn: 311000
2017-08-16 11:45:10 +00:00
Lang Hames ccfc80ccc7 Fix typo in variable name.
llvm-svn: 310984
2017-08-16 01:50:32 +00:00
Jason Molenda bb93483c11 Update NSArray/NSDictionary/NSSet formatters to handle new
macOS 10.13 - High Sierra - internal layouts.  Patch by 
Sean Callanan.

<rdar://problem/33282015>

llvm-svn: 310959
2017-08-15 21:23:14 +00:00
Chris Bieneman a944dd109b [CMake] Fixing an error in STREQUAL usage.
llvm-svn: 310955
2017-08-15 20:56:04 +00:00
Chris Bieneman 30f044b72c [CMake] Disable code sign entitlements when using lldb_codesign
Turns out self-signed certificates and entitlements don't always play well together...

llvm-svn: 310936
2017-08-15 17:42:20 +00:00
Nitesh Jain f7a5851d42 [LLDB][MIPS] Fix process load/unload on android.
To detect the correct function name based on the list of available symbols instead of the SDK version

Reviewers: tberghammer, clayborg

Subscribers: jaydeep, bhushan, lldb-commits

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

llvm-svn: 310856
2017-08-14 16:39:16 +00:00
Nitesh Jain 8ac63e8f9f [LLDB][MIPS] Set the Section's file address for
ELF section to LLDB_INVALID_ADDRESS if SHF_ALLOC is not set.

Reviewers: labath, clayborg

Subscribers: jaydeep, bhushan, lldb-commits

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

llvm-svn: 310855
2017-08-14 16:30:25 +00:00
Ed Maste 93cdee661c remove FreeBSD xfail decorator from TestCppNsImport
The Linux xfail decorator was removed in r272326 with the claim that the
test "runs reliably on the linux x86 buildbot." It also runs reliably on
FreeBSD for me.

llvm.org/pr25925

llvm-svn: 310644
2017-08-10 18:26:52 +00:00
Ed Maste 140dd57242 remove FreeBSD xfail decorator from TestCallStdStringFunction
This test is consistently reporting unexpected pass for me on FreeBSD
10 and 12. It was failing on the old FreeBSD buildbot which has now been
retired for some time. Will investigate further if this fails once a new
buildbot is configured and running tests.

llvm.org/pr17807

llvm-svn: 310626
2017-08-10 17:01:51 +00:00
Ed Maste e3842476de remove FreeBSD xfail decorator from TestExitDuringBreak
This test passes for me on FreeBSD 10 and 12(-CURRENT).

llvm.org/pr18190

llvm-svn: 310624
2017-08-10 16:48:36 +00:00
Ed Maste 5e82ca353d Report inferior signals as signals, not exceptions, on FreeBSD
This is the FreeBSD equivalent of r238549.

This serves 2 purposes:

* LLDB should handle inferior process signals SIGSEGV/SIGILL/SIGBUS/
  SIGFPE the way it is suppose to be handled. Prior to this fix these
  signals will neither create a coredump, nor exit from the debugger
  or work for signal handling scenario.
* eInvalidCrashReason need not report "unknown crash reason" if we have
  a valid si_signo

llvm.org/pr23699

Patch by Karnajit Wangkhem

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

llvm-svn: 310591
2017-08-10 13:47:17 +00:00
Tim Hammerquist 118a928931 Add remainder of unittests to Xcode project
Resolves a few build settings required to run DWARF tests as well.

rdar://problem/33664378

llvm-svn: 310512
2017-08-09 19:44:18 +00:00
Tim Hammerquist 5706f1e6f6 Fix VASprintfTest.cpp for Darwin, add checks
Summary:
The EncodingError test ensures that trying to encode a multibyte wchar
with a given codepage fails. If setlocale() fails, the encoding is
performed using the current locale, which may or may not fail.

This patch asserts that both setlocale() operations are successful, as
well as falling back to a widely available unibyte encoding for
non-Windows systems.

<rdar://problem/33782806>

Reviewers: zturner, labath, lhames

Reviewed By: zturner

Subscribers: lldb-commits

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

llvm-svn: 310499
2017-08-09 17:27:02 +00:00
Vadim Macagon 48df75fc65 Fix PlatformPythonTestCase.test_platform_list for the build bots
llvm-svn: 310488
2017-08-09 15:49:15 +00:00
Vadim Macagon c10e34d07c Expose active and available platform lists via SBDebugger API
Summary:
The available platform list was previously only accessible via the
`platform list` command, this patch makes it possible to access that
list via the SBDebugger API. The active platform list has likewise
been exposed via the SBDebugger API.

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

llvm-svn: 310452
2017-08-09 09:20:40 +00:00
Tim Hammerquist 3666adf2f2 Add existing unit tests to Xcode project
Summary:
This adds gtest test files to the Xcode project which were
previously only in the cmake config. This is the first of several
planned merges.

Reviewers: beanz, spyffe, jingham

Reviewed By: jingham

Subscribers: lldb-commits

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

llvm-svn: 310417
2017-08-08 20:59:20 +00:00
Abhishek Aggarwal 95bd95c075 Checking in files accidentally missed in later diffs of revision r310261
-- 2 files were missing in this commit which should have been there.
    These files were submitted initially for review and were reviewed.
    However, while updating the revision with newer diffs, I accidentally
    forgot to include them in newer diffs. So commiting now.
    

llvm-svn: 310341
2017-08-08 09:25:50 +00:00
Abhishek Aggarwal a8af18ac1d Fixed build failure for revision r310261
-- Was failing for Linux

llvm-svn: 310270
2017-08-07 17:15:26 +00:00
Abhishek Aggarwal 96bea51234 Fixed build failure for revision r310261
-- Build was failing for freebsd

llvm-svn: 310266
2017-08-07 15:53:30 +00:00
Abhishek Aggarwal 307db0f897 Tool for using Intel(R) Processor Trace hardware feature
Summary:
1. Provide single library for all Intel specific hardware features instead
    of individual libraries for each feature
2. Added Intel(R) Processor Trace hardware feature in this single library.
    Details about the tool implementing this feature is as follows:

     Tool developed on top of LLDB to provide its users the execution
     trace of the debugged inferiors. Tool's API are exposed as C++ object
     oriented interface in a shared library. API are designed especially to be
     easily integrable with IDEs providing LLDB as an application debugger.
     Entire API is also available as Python functions through a script bridging
     interface allowing development of python modules.

     This patch also provides a CLI wrapper to use the Tool through LLDB's command
     line. Highlights of the Tool and the wrapper are given below:

  ******************************
  Intel(R) Processor Trace Tool:
  ******************************
       - Provides execution trace of the debugged application
       - Uses Intel(R) Processor Trace hardware feature (already implemented inside LLDB)
         for this purpose
           -- Collects trace packets generated by this feature from LLDB, decodes and
              post-processes them
           -- Constructs the execution trace of the application
           -- Presents execution trace as a list of assembly instructions
       - Provides 4 APIs (exposed as C++ object oriented interface)
           -- start trace with configuration options for a thread/process,
           -- stop trace for a thread/process,
           -- get the execution flow (assembly instructions) for a thread,
           -- get trace specific information for a thread
       - Easily integrable into IDEs providing LLDB as application debugger
       - Entire API available as Python functions through script bridging interface
           -- Allows developing python apps on top of Tool
       - README_TOOL.txt provides more details about the Tool, its dependencies, building
         steps and API usage
       - Tool ready to use through LLDB's command line
           -- CLI wrapper has been developed on top of the Tool for this purpose

  *********************************
  CLI wrapper: cli-wrapper-pt.cpp
  *********************************
       - Provides 4 commands (syntax similar to LLDB's CLI commands):
           -- processor-trace start
           -- processor-trace stop
           -- processor-trace show-trace-options
           -- processor-trace show-instr-log
       - README_CLI.txt provides more details about commands and their options

Signed-off-by: Abhishek Aggarwal <abhishek.a.aggarwal@intel.com>

Reviewers: clayborg, jingham, lldb-commits, labath

Reviewed By: clayborg

Subscribers: ravitheja, emaste, krytarowski, mgorny

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

llvm-svn: 310261
2017-08-07 15:26:11 +00:00
Jim Ingham 1c7dc829bc Cut and paste error from r23162.
llvm-svn: 309977
2017-08-03 19:38:38 +00:00
Jim Ingham f08f5c9926 Add an auto-continue flag to breakpoints & locations.
You can get a breakpoint to auto-continue by adding "continue"
as a command, but that has the disadvantage that if you hit two
breakpoints simultaneously, the continue will force the process
to continue, and maybe even forstalling the commands on the other.
The auto-continue flag means the breakpoints can negotiate about
whether to stop.

Writing tests, I wanted to supply some commands when I made the
breakpoints, so I also added that ability.

llvm-svn: 309969
2017-08-03 18:13:24 +00:00
Rafael Espindola 86b875fc08 Update for llvm api change.
llvm-svn: 309916
2017-08-03 02:45:01 +00:00
Vadim Macagon 59e8ab5112 Fix ProcessAPITestCase.test_get_process_info
llvm-svn: 309803
2017-08-02 10:12:12 +00:00
Jim Ingham af26b22cd2 Fix a mis-feature with propagation of breakpoint options -> location options.
When an option was set at on a location, I was just copying the whole option set 
to the location, and letting it shadow the breakpoint options.  That was wrong since
it meant changes to unrelated options on the breakpoint would no longer take on this
location.  I added a mask of set options and use that for option propagation.

I also added a "location" property to breakpoints, and added SBBreakpointLocation.{G,S}etCommandLineCommands
since I wanted to use them to write some more test cases.

<rdar://problem/24397798>

llvm-svn: 309772
2017-08-02 00:16:10 +00:00
Sean Callanan 4115b36100 xfail test_get_process_info pending bot fixes
llvm-svn: 309714
2017-08-01 17:43:54 +00:00
Jim Ingham 11b8731f6b Remember to make API headers Public in the LLDB target.
llvm-svn: 309709
2017-08-01 17:19:59 +00:00