Commit Graph

878 Commits

Author SHA1 Message Date
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
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
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
Pavel Labath 38d0632e6a Move Timer and TraceOptions from Core to Utility
Summary:
The classes have no dependencies, and they are used both by lldb and
lldb-server, so it makes sense for them to live in the lowest layers.

Reviewers: zturner, jingham

Subscribers: emaste, mgorny, lldb-commits

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

llvm-svn: 306682
2017-06-29 14:32:17 +00:00
Pavel Labath f9d1647657 Remove an expensive lock from Timer
The Timer destructor would grab a global mutex in order to update
execution time. Add a class to define a category once, statically; the
class adds itself to an atomic singly linked list, and thus subsequent
updates only need to use an atomic rather than grab a lock and perform a
hashtable lookup.

Differential Revision: https://reviews.llvm.org/D32823
Patch by Scott Smith <scott.smith@purestorage.com>.

llvm-svn: 303058
2017-05-15 13:02:37 +00:00
Zachary Turner 97206d5727 Rename Error -> Status.
This renames the LLDB error class to Status, as discussed
on the lldb-dev mailing list.

A change of this magnitude cannot easily be done without
find and replace, but that has potential to catch unwanted
occurrences of common strings such as "Error".  Every effort
was made to find all the obvious things such as the word "Error"
appearing in a string, etc, but it's possible there are still
some lingering occurences left around.  Hopefully nothing too
serious.

llvm-svn: 302872
2017-05-12 04:51:55 +00:00
Pavel Labath 4d35d6b3b3 Change UniqueCStringMap to use ConstString as the key
Summary:
UniqueCStringMap "sorts" the entries for fast lookup, but really it only cares about uniqueness.  ConstString can be compared by pointer alone, rather than with strcmp, resulting in much faster comparisons.  Change the interface to take ConstString instead, and propagate use of the type to the callers where appropriate.

Reviewers: #lldb, clayborg

Reviewed By: clayborg

Subscribers: labath, jasonmolenda, lldb-commits

Differential Revision: https://reviews.llvm.org/D32316
Patch by Scott Smith <scott.smith@purestorage.com>.

llvm-svn: 301908
2017-05-02 10:17:30 +00:00
Chris Bieneman 51978f5ba2 Update GDB remote command regex for IPv6
This updates the regular expression used to match host/port pairs for the gdb-remote command to also match IPv6 addresses.

The IPv6 address matcher is very generic and does not really check for structural validity of the address. It turns out that IPv6 addresses are very complicated.

llvm-svn: 301559
2017-04-27 16:13:58 +00:00
Jim Ingham aab5be0505 Fix !N and !-N commands and add a test case.
<rdar://problem/31713267>

llvm-svn: 300785
2017-04-19 23:21:04 +00:00
Davide Italiano cf8a8294e5 [Interpreter] Make a static func a lambda and remove always_inline.
The attribute was fairly dubious as: a) we shouldn't tell the compiler
when to inline functions, b) GCC complains that the function may be
not always inlinable.

llvm-svn: 300377
2017-04-14 22:36:08 +00:00
Zachary Turner 3eb2b44d31 Delete some more dead includes.
This breaks the cycle between Target and PluginLanguageC++, reducing
the overall cycle count from 43 to 42.

llvm-svn: 298561
2017-03-22 23:33:16 +00:00
Zachary Turner 5713a05b5b Move FileSpec from Host -> Utility.
llvm-svn: 298536
2017-03-22 18:40:07 +00:00
Zachary Turner 573ab909d3 Move StringList from Core -> Utility.
llvm-svn: 298412
2017-03-21 18:25:04 +00:00
Zachary Turner 4eb8449d6c Fix up some enumerate() callsites in LLDB.
llvm-svn: 297640
2017-03-13 17:12:12 +00:00
Zachary Turner 7f6a7a3752 Remove FileSpec::ReadFileContents.
This functionality is subsumed by DataBufferLLVM, which is
also more efficient since it will try to mmap.  However, we
don't yet support mmaping writable private sections, and in
some cases we were using ReadFileContents and then modifying
the buffer.  To address that I've added a flag to the
DataBufferLLVM methods that allow you to map privately, which
disables the mmaping path entirely.  Eventually we should teach
DataBufferLLVM to use mmap with writable private, but that is
orthogonal to this effort.

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

llvm-svn: 297095
2017-03-06 23:42:14 +00:00
Zachary Turner 6f9e690199 Move Log from Core -> Utility.
All references to Host and Core have been removed, so this
class can now safely be lowered into Utility.

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

llvm-svn: 296909
2017-03-03 20:56:28 +00:00
Zachary Turner 24ae6294a4 Finish breaking the dependency from Utility.
Differential Revision: https://reviews.llvm.org/D29964

llvm-svn: 295368
2017-02-16 19:38:21 +00:00
Zachary Turner 01c3243fc1 Remove dependencies from Utility to Core and Target.
With this patch, the only dependency left is from Utility
to Host.  After this is broken, Utility will finally be
standalone.

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

llvm-svn: 295088
2017-02-14 19:06:07 +00:00
Zachary Turner bf9a77305f Move classes from Core -> Utility.
This moves the following classes from Core -> Utility.

ConstString
Error
RegularExpression
Stream
StreamString

The goal here is to get lldbUtility into a state where it has
no dependendencies except on itself and LLVM, so it can be the
starting point at which to start untangling LLDB's dependencies.
These are all low level and very widely used classes, and
previously lldbUtility had dependencies up to lldbCore in order
to use these classes.  So moving then down to lldbUtility makes
sense from both the short term and long term perspective in
solving this problem.

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

llvm-svn: 293941
2017-02-02 21:39:50 +00:00
Zachary Turner df44988b87 Break some dependencies in lldbUtility.
Differential Revision: https://reviews.llvm.org/D29359

llvm-svn: 293806
2017-02-01 19:45:14 +00:00
Chris Bieneman 494f277af5 [CMake] Add accurate dependency specifications
Summary:
This patch adds accurate dependency specifications to the mail LLDB libraries and tools.

In all cases except lldb-server, these dependencies are added in addition to existing dependencies (making this low risk), and I performed some code cleanup along the way.

For lldb-server I've cleaned up the LLVM dependencies down to just the minimum actually required. This is more than lldb-server actually directly references, and I've left a todo in the code to clean that up.

Reviewers: labath, zturner

Subscribers: lldb-commits, danalbert, srhines, ki.stfu, mgorny, jgosnell

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

llvm-svn: 293686
2017-01-31 20:43:05 +00:00
Jason Molenda a1609ff658 Jim unintentionally had the gdb-format specifiers falling through
after r276132 so that 'x/4b' would print out a series of 4 8-byte
quantities.  Fix that, add a test case.

<rdar://problem/29930833> 

llvm-svn: 293002
2017-01-25 01:41:48 +00:00
David Blaikie a322f36cfd Make lldb -Werror clean for -Wstring-conversion
Also found/fixed one bug identified by this warning in
RenderScriptx86ABIFixups.cpp where a string literal was being used in an
effort to provide a name for an instruction/register, but was instead
being passed as the bool 'isVolatile' parameter.

llvm-svn: 291198
2017-01-06 00:38:06 +00:00
Luke Drummond 63dea59104 Fix a couple of incorrect format string warnings
This patch fixes use of incorrect `%zi` to format a plain `int`, and using
`%llu` to format a `uint64_t`. The fix is to use the new typesafe
`llvm::Formatv` based API.

Differential Revision: https://reviews.llvm.org/D28028
Subscribers: lldb-commits

llvm-svn: 290359
2016-12-22 19:15:07 +00:00
Jim Ingham 8f7db52d9d Fix incorrectly named variables.
llvm-svn: 289746
2016-12-15 00:30:30 +00:00
Sean Callanan 237c3ed95e Adopt PrettyStackTrace in LLDB
LLDB needs some minor changes to adopt PrettyStackTrace after https://reviews.llvm.org/D27683.
We remove our own SetCrashDescription() function and use LLVM-provided RAII objects instead.
We also make sure LLDB doesn't define __crashtracer_info__ which would collide with LLVM's definition.

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

llvm-svn: 289711
2016-12-14 21:31:31 +00:00
Zachary Turner 2c84f908af Remove some more uses of Args::GetArgumentAtIndex.
llvm-svn: 289188
2016-12-09 05:46:41 +00:00
Greg Clayton 7904046c33 Calling SBDebugger::CeeateTarget being called on multiple threads was crashing LLDB.
I found the race condition in:

ScriptInterpreter *CommandInterpreter::GetScriptInterpreter(bool can_create);

More than one "ScriptInterpreter *" was being returned due to the race which caused any clients with the first one to now be pointing to freed memory and we would quickly crash.

Added a test to catch this so we don't regress.

<rdar://problem/28356584> 

llvm-svn: 289169
2016-12-09 01:21:14 +00:00
Zachary Turner 14f6b2c035 Modernize the Args access pattern in a few more commands.
llvm-svn: 289164
2016-12-09 01:08:29 +00:00
Pavel Labath 43d354182f Use Timeout<> in EvaluateExpressionOptions class
llvm-svn: 288797
2016-12-06 11:24:51 +00:00
Alexander Shaposhnikov 696bd63550 [lldb] Fix typos in file headers
This diff fixes typos in file headers (incorrect file names).

Test plan:

Under llvm/tools/lldb/source:
find ./* -type f | grep -e '\(cpp\|h\)$' | while read F; do B=$(basename $F); echo $F head -n 1 $F | grep -v $B | wc -l ; done

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

llvm-svn: 287966
2016-11-26 05:23:44 +00:00
Zachary Turner d6a2475787 Re-add "demonstrate new Args API"
This fixes the build breakage due to the use of C++14.

llvm-svn: 287647
2016-11-22 17:10:15 +00:00
Omair Javaid 99a318e112 Fix build failure on Linux and BSD by reverting r287597
Linux and BSD builds failing after this changes from rev 287597.

llvm-svn: 287631
2016-11-22 09:47:00 +00:00
Zachary Turner 1c55c9b5bf Add the new Args / entry-access API.
The long-term goal here is to get rid of the functions
GetArgumentAtIndex() and GetQuoteCharAtIndex(), instead
replacing them with operator based access and range-based for
enumeration.  There are a lot of callsites, though, so the
changes will be done incrementally, starting with this one.

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

llvm-svn: 287597
2016-11-21 23:18:07 +00:00
Zachary Turner eb4a0cb16b Fix some build errors.
llvm-svn: 287409
2016-11-18 23:32:37 +00:00
Zachary Turner 53877afcb0 Convert CommandHistory functions to StringRef.
llvm-svn: 287401
2016-11-18 23:22:42 +00:00
Zachary Turner 31d97a5c8a Rewrite all Property related functions in terms of StringRef.
This was a bit tricky, especially for things like
OptionValueArray and OptionValueDictionary since they do some
funky string parsing.  Rather than try to re-write line-by-line
I tried to make the StringRef usage idiomatic, even though
it meant often re-writing from scratch large blocks of code
in a different way while keeping true to the original intent.

The finished code is a big improvement though, and often much
shorter than the original code.  All tests and unit tests
pass on Windows and Linux.

llvm-svn: 287242
2016-11-17 18:08:12 +00:00
Zachary Turner 0eb31a1d96 Fix warnings and errors introduced with UUID changes.
llvm-svn: 287208
2016-11-17 05:14:32 +00:00
Zachary Turner 245f7fdcfa Convert UriParser to use StringRef.
llvm-svn: 287190
2016-11-17 01:38:02 +00:00
Zachary Turner 4aa8753c81 Convert AutoComplete related code to StringRef.
Differential Revision: https://reviews.llvm.org/D26721

llvm-svn: 287188
2016-11-17 01:37:42 +00:00
Zachary Turner 067d1db139 Make Apropos functions accept StringRefs.
llvm-svn: 287157
2016-11-16 21:45:04 +00:00
Zachary Turner c156427ded Don't allow direct access to StreamString's internal buffer.
This is a large API change that removes the two functions from
StreamString that return a std::string& and a const std::string&,
and instead provide one function which returns a StringRef.

Direct access to the underlying buffer violates the concept of
a "stream" which is intended to provide forward only access,
and makes porting to llvm::raw_ostream more difficult in the
future.

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

llvm-svn: 287152
2016-11-16 21:15:24 +00:00
Zachary Turner e6f6d4c2f2 Change Property::GetName() and GetDescription() to return StringRef.
llvm-svn: 287055
2016-11-15 23:36:43 +00:00
Zachary Turner 0fe35b158f Fix some more Printf warnings.
llvm-svn: 286916
2016-11-15 00:45:23 +00:00
Zachary Turner 1e8016b2ea Fix some more StringRef printf warnings.
llvm-svn: 286915
2016-11-15 00:45:18 +00:00
Zachary Turner 03c9f3642a Fix some StringRef Printf warnings.
llvm-svn: 286906
2016-11-14 23:23:31 +00:00
Zachary Turner e706c1d9d9 Make OptionParser::Parse() take StringRef.
llvm-svn: 286747
2016-11-13 04:24:38 +00:00
Zachary Turner 7a120c8b3d Change IOHandlerConfirm to use StringRefs.
llvm-svn: 286743
2016-11-13 03:05:58 +00:00
Zachary Turner 988968394d Change some more CommandObject functions to StringRef.
llvm-svn: 286742
2016-11-13 02:50:32 +00:00
Zachary Turner e0038717b9 Change ArgumentHelpCallbackFunction to return a StringRef.
llvm-svn: 286740
2016-11-13 02:08:22 +00:00