Commit Graph

9874 Commits

Author SHA1 Message Date
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
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
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 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
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
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
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
Vadim Macagon 141a6263da Expose process instance info via SB API
Summary:
Implement SBProcessInfo to wrap lldb_private::ProcessInstanceInfo,
and add SBProcess::GetProcessInfo() to retrieve info like parent ID,
group ID, user ID etc. from a live process.

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

llvm-svn: 309664
2017-08-01 07:34:26 +00:00
Eugene Zemtsov 9c410c1b21 Fix incorrect use of std::unique
llvm-svn: 309648
2017-08-01 01:29:55 +00:00
Jan Kratochvil b14f1da23c Fix LLDB crash accessing unknown DW_FORM_* attributes
Current LLDB (that is without DWZ support) crashes accessing Fedora debug info:
READ of size 8 at 0x60200000ffc8 thread T0
    #0 in DWARFDebugInfoEntry::BuildAddressRangeTable(SymbolFileDWARF*, DWARFCompileUnit const*, DWARFDebugAranges*) const tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp:1336

Greg Clayton: We will need a warning to be emitted in
SymbolFileDWARF::CalculateAbilities() stating we won't parse the DWARF due to
"unsupported DW_FORM value of 0x1f20".

Patch has been mostly written by Greg Clayton.

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

llvm-svn: 309581
2017-07-31 17:02:52 +00:00
Tamas Berghammer 15cf379519 Add support for base address entries in the .debug_ranges section
Summary:
Clang recently started to emit base address entries into the
.debug_ranges section to reduce the number of relocations needed. Lets
make sure LLDB can read them.

llvm-svn: 309554
2017-07-31 10:26:19 +00:00
Chris Bieneman 20f45a3e73 [CMake] Add SharingPtr.h to the Framework header list
lldb-forward.h which is a public header uses SharingPtr, so we need to include that header as well.

llvm-svn: 309429
2017-07-28 20:27:38 +00:00
Chris Bieneman 8c01cc54eb [CMake] Add checks for libcompression
This enables libcompression when available in the CMake build system.

llvm-svn: 309395
2017-07-28 15:39:51 +00:00
Chris Bieneman 0025f3f6ba [CMake] Cleanup of header fixup and installation
This patch does the following:

* Gets the header copy step to re-run whenever header change
* Gets the header fix-up step to re-run whenever headers are copied
* Removes lldb-private*.h headers from the installed headers

llvm-svn: 309394
2017-07-28 15:39:51 +00:00
Nitesh Jain d055b8f808 [LLDB][MIPS] Fix emulation of Instruction for MIPS64R6 target.
Subscribers: jaydeep, bhushan, lldb-commits, slthakur
llvm-svn: 309250
2017-07-27 05:34:33 +00:00
Jim Ingham a81bd7f101 Fix the formatting for help on option value types.
Patch by Jessica Han <jessicah@juniper.net>

https://reviews.llvm.org/D35525

llvm-svn: 309238
2017-07-27 00:18:18 +00:00
Chris Bieneman 3769777f11 [CMake] Update Framework construction for iOS
On iOS frameworks don't have versions or resources, they are flatter bundles. This updates the LLDB framework build to accommodate the flatter bundles.

llvm-svn: 309025
2017-07-25 20:31:15 +00:00
Chris Bieneman 7f47b85c52 [CMake] Rework construction of framework bundle
This adds an explicit step for processing the headers and restructures how the framework bundles are constructed. This should make the frameworks more reliably constructed.

llvm-svn: 309024
2017-07-25 20:30:58 +00:00
Adrian Prantl 4b2113036d Improve the fix for PR33875 by not hardcoding the section name.
This is a follow-up to r308905.

llvm-svn: 309019
2017-07-25 20:12:25 +00:00
Sean Callanan afc70ab3e2 [TypeSystem] Guard the global `ASTSourceMap` with a mutex
s_source_map in ClangExternalASTSourceCommon.cpp is unguarded 
and therefore can break in multithreaded conditions. This can 
cause crashes in particular if multiple targets are being set
up at once.

This patch wraps s_source_map in a function that ensures 
exclusivity, and makes every user of it use that function
instead.

<rdar://problem/33429774> lldb crashes after "resume_off"

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

llvm-svn: 308993
2017-07-25 17:33:37 +00:00
Eugene Zemtsov 7cff7d4664 Extend 'target symbols add' to load symbols from a given module
Now -shlib flag can be provided alongside with names of symbols files:

(lldb) target symbols add --shlib stripper-lib.so unstripper-lib.so

This is helpful when default matching mechanisms by name and UUID
can't find a module, and the user needs to explicitly specify
which module the given symbol file belongs to.

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

llvm-svn: 308933
2017-07-24 22:52:39 +00:00
Greg Clayton ea5df1049b Don't allow .debug_types to be parsed as LLDB can crash when enums are not able to be found.
Differential Revision: https://reviews.llvm.org/D35734

llvm-svn: 308911
2017-07-24 18:40:33 +00:00
Adrian Prantl 8bbb130793 RFix PR33875 by distinguishing between DWO and clang modules.
This reapplies https://reviews.llvm.org/D35740 with a tweak to find
the section by name rather than type. Section types don't distinguish
between regular sections and their DWO counterparts.

llvm-svn: 308905
2017-07-24 18:06:39 +00:00
Greg Clayton 2434d45b85 Don't crash when hostname is empty. StringRef will assert and kill your program.
llvm-svn: 308896
2017-07-24 16:47:04 +00:00
Adrian Prantl ed6f69c111 Revert "Fix PR33875 by distinguishing between DWO and clang modules"
This reverts commit r308850.

llvm-svn: 308851
2017-07-23 20:24:41 +00:00
Adrian Prantl 651166c2d2 Fix PR33875 by distinguishing between DWO and clang modules
The DWO handling code can get confused by clang modules which also use
skeleton CUs to point to the object file with the full debug
info. This patch detects whether an object is a "real" DWO or a clang
module and prevents LLDB from interpreting clang modules as DWO. This
fixes the regression in TestWithModuleDebugging.

http://llvm.org/bugs/show_bug.cgi?id=33875

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

llvm-svn: 308850
2017-07-23 17:59:07 +00:00
Greg Clayton 5b075d636f Added a missing "break;" after seeing a clang warning about potential fall through annotation.
llvm-svn: 308776
2017-07-21 20:20:25 +00:00
Bruce Mitchener 2b13913b12 Fix typo in error message in 'platform status'.
llvm-svn: 308716
2017-07-21 07:08:20 +00:00
Jim Ingham d030991600 Add help text for "expression" telling how to enter multi-line mode.
This seemed natural to us, but wasn't documented anywhere and was
not clear to everybody.

<rdar://problem/33316164>

llvm-svn: 308549
2017-07-19 23:25:42 +00:00
Chris Bieneman 04f3910537 Fix GreenDragon bots
This commit removes a very old deprecated API that was causing compile failures for LLDB on Darwin. Since the comment says we only needed to keep the old API around for a few Xcode builds, and the comment was written 6 years ago... I think this can safely go away.

Failure URL:
http://lab.llvm.org:8080/green/view/LLDB/job/lldb_build_test/29936/console

llvm-svn: 308509
2017-07-19 18:57:16 +00:00
Saleem Abdulrasool f76e099ca7 silence a couple of -Wqual-cast warning from GCC (NFC)
Cast to `const uint8_t *` instead of `uint8_t *` to avoid the warning
from GCC.

  EmulationStateARM.cpp:206:34: warning: cast from type 'const void*' to type 'uint8_t* {aka unsigned char*}' casts away qualifiers [-Wcast-qual]

Cast to `const uint32_t *` and the explicitly cast away the const-ness
of the value.  This seems pretty sketchy as the `DataExtractor` holds a
const reference to the data.  However, this is no worse than before.

  ObjectFilePECOFF.cpp:540:78: warning: cast from type 'const uint8_t* {aka const unsigned char*}' to type 'uint32_t* {aka unsigned int*}' casts away qualifiers [-Wcast-qual]

llvm-svn: 308489
2017-07-19 15:46:21 +00:00
Bruce Mitchener ccbf7987a3 Expose hit count via SBBreakpointLocation.
Summary:
SBBreakpointLocation exposed the ignore count, but didn't expose
the hit count. Both values were exposed by SBBreakpoint and
SBWatchpoint, so this makes things a bit more consistent.

Reviewers: lldb-commits

Subscribers: lldb-commits

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

llvm-svn: 308480
2017-07-19 14:31:19 +00:00
Chris Bieneman f6b8ac28ab [CMake] A few fixups to support building LLDB for iOS
These changes enable proper configuration of LLDB targeting iOS.

llvm-svn: 308378
2017-07-18 21:15:53 +00:00
Pavel Labath f40f8fc415 Fix NetBSD/FreeBSD build after r308304
llvm-svn: 308307
2017-07-18 14:03:47 +00:00
Pavel Labath b6dbe9a99c Clean up lldb-types.h
Summary:
It defined a couple of types (condition_t) which we don't use anymore,
as we have c++11 goodies now. I remove these definitions.

Also it unnecessarily included a couple of headers which weren't
necessary for it's operation. I remove these, and place the includes in
the relevant files (usually .cpp, usually in Host code) which use them.
This allows us to reduce namespace pollution in most of the lldb files
which don't need the OS-specific definitions.

Reviewers: zturner, jingham

Subscribers: ki.stfu, lldb-commits

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

llvm-svn: 308304
2017-07-18 13:14:01 +00:00
Pavel Labath 4e138e1d8c Fix linux arm and mips builds broken by r308282
llvm-svn: 308292
2017-07-18 10:42:36 +00:00
Pavel Labath 82abefa4b1 Remove shared pointer from NativeProcessProtocol
Summary:
The usage of shared_from_this forces us to separate construction and
initialization phases, because shared_from_this() is not available in
the constructor (or destructor). The shared semantics are not necessary,
as we always have a clear owner of the native process class
(GDBRemoteCommunicationServerLLDB object). Even if we need shared
semantics in the future (which I think we should strongly avoid),
reverting this will not be necessary -- the owners can still easily
store the native process object in a shared pointer if they really want
to -- this just prevents the knowledge of that from leaking into the
class implementation.

After this a NativeThread object will hold a reference to the parent
process (instead of a weak_ptr) -- having a process instance always
available allows us to simplify some logic in this class (some of it was
already simplified because we were asserting that the process is
available, but this makes it obvious).

Reviewers: krytarowski, eugene, zturner

Subscribers: lldb-commits

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

llvm-svn: 308282
2017-07-18 09:24:48 +00:00
Eugene Zemtsov 20d28a168e Fixing LLDB build after refactoring of clang's MacroInfo
llvm-svn: 308219
2017-07-17 20:50:21 +00:00
Chris Bieneman 7dc58b238d Fix debugserver accepting remote connections
While adding IPv6 support to debugserver I broke handling wildcard addresses and fully qualified address filtering. This patch resolves that bug and adds a test for matching the address "*".

<rdar://problem/32947613>

llvm-svn: 307957
2017-07-13 20:58:13 +00:00
Jim Ingham 055e65f0d4 Enable parsing C++ names generated by lambda functions.
https://reviews.llvm.org/D34911 from Weng Xuetian.

llvm-svn: 307944
2017-07-13 19:48:43 +00:00
Jim Ingham 30bac79162 Fix a deadlock in the Python interpreter vrs. SIGINT.
The interpreter gets invoked in the sigint handler to cancel
long-running Python operations.  That requires the interpreter
lock, but that may be held by the Python operation that's getting
interrupted, so the mutex needs to be recursive.

<rdar://problem/33179086>

llvm-svn: 307942
2017-07-13 19:45:54 +00:00
Kuba Mracek b244c2bafe Upstreaming a patch from Github: When evaluation user expressions, ignore InstrumentationRuntime breakpoints. (#235)
llvm-svn: 307881
2017-07-13 04:35:27 +00:00
Petr Pavlu 8c5dafde49 [MainLoop] Fix possible use of an invalid iterator
Store file descriptors from loop.m_read_fds (if FORCE_PSELECT is
defined) and signals from loop.m_signals that need to be processed in
MainLoop::RunImpl::ProcessEvents() into a separate vector and then
iterate over this container to invoke the callbacks.

This prevents a problem where when the code iterated directly over
m_read_fds/m_signals, a callback invoked from within the loop could
modify these variables and invalidate the loop iterator. This would then
result in an assertion failure in llvm::DenseMapIterator::operator++().

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

llvm-svn: 307782
2017-07-12 12:38:31 +00:00
Ravitheja Addepally fa73e34082 Fixing Android builder
llvm-svn: 307773
2017-07-12 11:54:17 +00:00
Ravitheja Addepally dab1d5f3cd Adding Support for Error Strings in Remote Packets
Summary:
This patch adds support for sending strings along with
error codes in the reply packets. The implementation is
based on the feedback recieved in the lldb-dev mailing
list. The patch also adds an extra packet for the client
to query if the server has the capability to provide
strings along with error replys.

Reviewers: labath, jingham, sas, lldb-commits, clayborg

Reviewed By: labath, clayborg

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

llvm-svn: 307768
2017-07-12 11:15:34 +00:00