Commit Graph

14126 Commits

Author SHA1 Message Date
Jim Ingham 190636bcc1 Let's not convert from UINT32_MAX to the std::numeric_limits version.
llvm-svn: 263333
2016-03-12 03:33:36 +00:00
Jim Ingham 8d94ba0fb1 This change introduces a "ExpressionExecutionThread" to the ThreadList.
Turns out that most of the code that runs expressions (e.g. the ObjC runtime grubber) on
behalf of the expression parser was using the currently selected thread.  But sometimes,
e.g. when we are evaluating breakpoint conditions/commands, we don't select the thread
we're running on, we instead set the context for the interpreter, and explicitly pass
that to other callers.  That wasn't getting communicated to these utility expressions, so
they would run on some other thread instead, and that could cause a variety of subtle and
hard to reproduce problems.  

I also went through the commands and cleaned up the use of GetSelectedThread.  All those
uses should have been trying the thread in the m_exe_ctx belonging to the command object
first.  It would actually have been pretty hard to get misbehavior in these cases, but for
correctness sake it is good to make this usage consistent.

<rdar://problem/24978569>

llvm-svn: 263326
2016-03-12 02:45:34 +00:00
Eugene Zelenko 0e28a19683 Fix Clang-tidy modernize-use-nullptr warnings in some files in source/Core; other minor fixes.
llvm-svn: 263312
2016-03-12 00:31:13 +00:00
Eugene Zelenko 8918372dd3 Fix Clang-tidy modernize-use-nullptr warnings in some files in source/Core; other minor fixes.
llvm-svn: 263300
2016-03-11 21:55:47 +00:00
Eugene Zelenko c5dac77ad8 Fix Clang-tidy modernize-use-nullptr warnings in some files in source/Core; other minor fixes.
llvm-svn: 263289
2016-03-11 20:20:38 +00:00
Jim Ingham e78ca659d6 Remove the skip if Darwin since I fixed the crash.
llvm-svn: 263283
2016-03-11 19:15:03 +00:00
Jim Ingham c134810cfb Check for a NULL input filehandle before referencing it.
<rdar://problem/25105824>

llvm-svn: 263274
2016-03-11 18:49:38 +00:00
Marianne Mailhot-Sarrasin 7a4eed280a Fixed MemoryCache L1 cache flush
Use the same method to find the cache line as in Read().

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

llvm-svn: 263233
2016-03-11 13:50:10 +00:00
Pavel Labath d81b2ccb4f Fix a bunch of signedness warnings in unittests
llvm-svn: 263209
2016-03-11 09:00:23 +00:00
Pavel Labath cc0e87cdae Fix a couple of cornercases in FileSpec + tests
Summary:
This fixes a couple of corner cases in FileSpec, related to AppendPathComponent and
handling of root directory (/) file spec. I add a bunch of unit tests for the new behavior.

Summary of changes:
FileSpec("/bar").GetCString(): before "//bar", after "/bar".
FileSpec("/").CopyByAppendingPathComponent("bar").GetCString(): before "//bar", after "/bar".
FileSpec("C:", ePathSyntaxWindows).CopyByAppendingPathComponent("bar").GetCString(): before "C:/bar", after "C:\bar".

Reviewers: clayborg, zturner

Subscribers: lldb-commits

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

llvm-svn: 263207
2016-03-11 08:44:44 +00:00
Todd Fiala 91b4bd4b12 skip newly segfaulting test on OS X public CI
llvm-svn: 263205
2016-03-11 08:12:36 +00:00
Jim Ingham d815c9ab88 Fix SBDebugger.GetOutputFileHandle() on OS X.
The swig typemaps had some magic for output File *'s on OS X that made:

SBDebugger.GetOutputFileHandle() 

actually work.  That was protected by a "#ifdef __MACOSX__", but the corresponding define
got lost going from the Darwin shell scripts to the python scripts for running
swig, so the code was elided.  I need to pass the define to SWIG, but only when
targetting Darwin.

So I added a target-platform argument to prepare_bindings, and if that 
is Darwin, I pass -D__APPLE__ to swig, and that activates this code again, and
GetOutputFileHandle works again.  Note, I only pass that argument for the Xcode
build.  I'm sure it is possible to do that for cmake, but my cmake-foo is weak.

I should have been able to write a test for this by creating a debugger, setting the 
output file handle to something file, writing to it, getting the output file handle 
and reading it.  But SetOutputFileHandle doesn't seem to work from Python, so I'd 
have to write a pexpect test to test this, which I'd rather not do.

llvm-svn: 263183
2016-03-11 01:57:45 +00:00
Eugene Zelenko a74f37a599 Fix Clang-tidy modernize-use-nullptr warnings in some files in source/Core; other minor fixes.
llvm-svn: 263174
2016-03-10 23:57:12 +00:00
Marianne Mailhot-Sarrasin 82a827de3b Fixed ValueObject::GetExpressionPath() for paths including anonymous struct/union
When the parent of an expression is anonymous, skip adding '.' or '->' before the expression name.

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

llvm-svn: 263166
2016-03-10 22:10:59 +00:00
Greg Clayton a31baf081b Fixed the python interpreter so that it correctly inherits the top IOHandler's files instead of always using stdin/out/err.
Removed lldb_private::File::Duplicate() and the copy constructor and the assignment operator that used to duplicate the file handles and made them private so no one uses them. Previously the lldb_private::File::Duplicate() function duplicated files that used file descriptors, (int) but not file streams (FILE *), so the lldb_private::File::Duplicate() function only worked some of the time. No one else excep thee ScriptInterpreterPython was using these functions, so that aren't needed nor desired. Previously every time you would drop into the python interpreter we would duplicate files, and now we avoid this file churn.

<rdar://problem/24877720>

llvm-svn: 263161
2016-03-10 20:49:32 +00:00
Aidan Dodds 67dc3e1575 [Renderscript] Add stack argument reading code for Mipsel 3
Fix a problem raised with the previous patches being applied in the wrong order.

Committed on behalf of: Dean De Leo <dean@codeplay.com>

llvm-svn: 263134
2016-03-10 17:50:01 +00:00
Aidan Dodds 6dd4b57987 [Renderscript] Add stack argument reading code for Mipsel 2
This commit implements the reading of stack spilled function arguments for little endian MIPS targets.

Committed on behalf of: Dean De Leo <dean@codeplay.com>

llvm-svn: 263131
2016-03-10 17:37:02 +00:00
Aidan Dodds 17e07c0ab4 [Renderscript] Add stack argument reading code for Mipsel
This commit implements the reading of stack spilled function arguments for little endian MIPS targets.

Committed on behalf of: Dean De Leo <dean@codeplay.com>

llvm-svn: 263130
2016-03-10 17:27:41 +00:00
Aidan Dodds 8433fdbedf [Renderscript] Explicitly set the language to evaluate allocations
Currently it is not specified, and since allocations are usually
requested once we hit a renderscript breakpoint, the language will be
inferred being as renderscript by the ExpressionParser.
Actually allocations attempt to invoke functions part of the RS runtime,
written in C/C++, so evaluating the calls in RenderScript could be
misleading.

In particular, in MIPS, the ABI between C/C++ (mips o32) and
renderscript (arm) might introduce subtle bugs when evaluating such
expressions.

This change explicitly sets the language used to evaluate the allocations
as C++.

Committed on behalf of: Dean De Leo <dean@codeplay.com>

llvm-svn: 263129
2016-03-10 17:23:33 +00:00
Adrian McCarthy 396e02a6e3 Eliminate the TestStarted-XXX and TestFinished-XXX files from check-lldb runs.
Nobody seems to know what purpose these files serve, yet they were accumulating by the thousands in the test traces directory.  I'm proposing we delete them.

Creating these files accounted for about 2.5% of the time to run ninja check-lldb on my machine, which isn't a lot, but it's something.

llvm-svn: 263122
2016-03-10 15:41:11 +00:00
Ewan Crawford 7648dd375f Revert "Track expression language from one place in ClangExpressionParser"
r263099 seems to have broken some OSX tests

llvm-svn: 263107
2016-03-10 12:38:55 +00:00
Ewan Crawford 6dc9db5244 Track expression language from one place in ClangExpressionParser
The current expression language is currently tracked in a few places within the ClangExpressionParser constructor. 
This patch adds a private lldb::LanguageType attribute to the ClangExpressionParser class and tracks the expression language from that one place.

Author: Luke Drummond <luke.drummond@codeplay.com>
Differential Revision: http://reviews.llvm.org/D17719

llvm-svn: 263099
2016-03-10 10:31:08 +00:00
Siva Chandra aaae5f87af [DWARFASTParserClang] Start with member offset of 0 for members of union types.
Summary:
GCC does not emit DW_AT_data_member_location for members of a union.
Starting with a 0 value for member locations helps is reading union types
in such cases.

Reviewers: clayborg

Subscribers: ldrumm, lldb-commits

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

llvm-svn: 263085
2016-03-10 01:15:17 +00:00
Enrico Granata 391075c38e Certain hardware architectures have registers of 256 bits in size
This patch extends Scalar such that it can support data living in such registers (e.g. float values living in the XMM registers)

llvm-svn: 263079
2016-03-10 00:14:29 +00:00
Zachary Turner 7e8c7bea79 Fix SymbolFilePDB for discontiguous functions.
Previously line table parsing code assumed that the only gaps would
occur at the end of functions.  In practice this isn't true, so this
patch makes the line table parsing more robust in the face of
functions with non-contiguous byte arrangements.

llvm-svn: 263078
2016-03-10 00:06:26 +00:00
Ted Woodward eee554d86e Fix "ninja check-lldb" crash in IRExecutionUnit.cpp
Summary:
From Adrian McCarthy:

"Running ninja check-lldb now has one crash in a Python process, due to deferencing a null pointer in IRExecutionUnit.cpp:  candidate_sc.symbol is null, which leads to a call with a null this pointer."

Reviewers: zturner, spyffe, amccarth

Subscribers: ted, jingham, lldb-commits

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

llvm-svn: 263066
2016-03-09 22:05:17 +00:00
Jim Ingham 2411167fb5 Add an "offset" option to "break set -n" and "break set -f -l".
That way you can set offset breakpoints that will move as the function they are 
contained in moves (which address breakpoints can't do...)

I don't align the new address to instruction boundaries yet, so you have to get
this right yourself for now.

<rdar://problem/13365575>

llvm-svn: 263049
2016-03-09 18:59:13 +00:00
Enrico Granata 4643c01284 Last round of preliminary cleanup in my refactoring of aliases.
The next step is to actually turn CommandAlias into a full-blown CommandObject citizen.

This is tricky given the current architecture of the CommandInterpreter but I think I have found a reasonable path forward.
The current plan is to make class CommandAlias : public CommandObject, and have all the several GetCommand calls not actually traverse through the alias to the underlying command object
The only times that an alias will be traversed are:
a) execution; when time comes to run an alias, I will just grab the underlying command and options, and make the interpreter execute that according to its current algorithm
b) subcommand traversal; if one has an alias to a multiword command, grabbing a subcommand will see through to the subcommand

Other operations, e.g. command listing, command names, command helps, ..., will all use the alias directly. This will, in turn, lead to the removal of the separate alias dictionary, and just mix user commands and aliases in one map

llvm-svn: 262986
2016-03-09 02:27:57 +00:00
Siva Chandra b8d6db258e [TestRegisterVariables] Adjust compiler range in expected failure decorator.
Subscribers: lldb-commits

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

llvm-svn: 262970
2016-03-09 00:02:00 +00:00
Enrico Granata 7cf3b34d45 Add CommandAlias.cpp to CMakeLists
llvm-svn: 262959
2016-03-08 21:29:49 +00:00
Enrico Granata 937631cfdf Move CommandAlias to its own file; also
Store std::unique_ptr<CommandAlias> instead of instances

llvm-svn: 262958
2016-03-08 21:23:30 +00:00
Sean Callanan bbde9083ad Made self.expect() errors a little more readable in the testsuite.
self.expect() had two problems:

- If there was a substrs argument, then it overwrote the variable containing
  the command to run with the last substr.  That meant nonsense command text in
  testsuite errors.

- The actual output is not printed, which makes fixing testsuite failures a bit
  annoying (you end up having to use the -tv arguments to dotest).

This fixes both of these issues.  We could do even better, pretty-printing the
criteria for "correct" output, but this at least makes dealing with errors a bit
better.

llvm-svn: 262950
2016-03-08 18:58:48 +00:00
Adrian Prantl 6aeba89e89 Support floating point values in 128-bit SSE vector registers
The System-V x86_64 ABI requires floating point values to be passed
in 128-but SSE vector registers (xmm0, ...). When printing such a
variable this currently yields an <invalid load address>.

This patch makes LLDB's DWARF expression evaluator accept 128-bit
registers as scalars. It also relaxes the check that the size of the
result of the DWARF expression be equal to the size of the variable to a
greater-than. DWARF defers to the ABI how smaller values are being placed
in a larger register.

Implementation note: I found the code in Value::SetContext() that changes
the m_value_type after the fact to be questionable. I added a sanity check
that the Value's memory buffer has indeed been written to (this is
necessary, because we may have a scalar value in a vector register), but
really I feel like this is the wrong place to be setting it.

Reviewed by Greg Clayton.

http://reviews.llvm.org/D17897
rdar://problem/24944340

llvm-svn: 262947
2016-03-08 18:35:09 +00:00
Tamas Berghammer 77b93ad471 Fix log in Broadcaster causing a crash
llvm-svn: 262925
2016-03-08 13:33:14 +00:00
Tamas Berghammer 65fa0b5169 Try to fix windows build after rL262863
llvm-svn: 262923
2016-03-08 11:43:56 +00:00
Ewan Crawford 1ab4adb1d3 Use c_str() instead of GetCString() to fix build
llvm-svn: 262920
2016-03-08 10:03:23 +00:00
Enrico Granata 443923b72d This is actually a FileSpec, so use .GetCString() instead
llvm-svn: 262914
2016-03-08 05:59:47 +00:00
Enrico Granata c8fd719e21 Use .c_str() here to unbreak the Linux build
llvm-svn: 262913
2016-03-08 05:57:52 +00:00
Enrico Granata 212130ac4d A few more improvements on the way to the command alias refactoring
- move alias help generation to CommandAlias, out of CommandInterpreter
- make alias creation use argument strings instead of OptionArgVectorSP; the former is a more reasonable currency than the latter
- remove m_is_alias from CommandObject, it wasn't actually being used

llvm-svn: 262912
2016-03-08 05:37:15 +00:00
Enrico Granata 002ab61a47 Turn GetAliasOptions() into GetAlias()
Eventually, there will be more things that CommandAlias contains, and I don't want accessors for each of them on the CommandIntepreter
Eventually, we also won't pass around copies of CommandAlias, but that's for a later patch

llvm-svn: 262909
2016-03-08 03:56:12 +00:00
Enrico Granata 4a795920e3 Attempt to fix the Ubuntu buildbot by making FindLongestCommandWord a free template function in lldb_private
llvm-svn: 262905
2016-03-08 03:48:41 +00:00
Jason Molenda 5df5402f94 Unbreak linux build broken by r262901
llvm-svn: 262904
2016-03-08 03:24:13 +00:00
Enrico Granata 5e5503099b Move ProcessAliasOptionsArgs to be a static on CommandAlias; it wasn't using any instance data on the CommandInterpreter anyway
This small step removes one piece of alias machinery from the CommandInterpreter into the CommandAlias

llvm-svn: 262901
2016-03-08 03:00:27 +00:00
Enrico Granata 308f73c5a3 Change the way command aliases are stored. Go from a model where a map holds the alias -> underlying command binding and another map holds the alias -> options, to a model where one single map holds the alias -> (all useful data) combination
Right now, obviously, this is just the pair of (CommandObjectSP,OptionArgVectorSP), so NFC

This is step one of a larger - and tricky - refactoring which will turn command aliases into interesting objects instead of passive storage that the command interpreter does smart things to
This refactoring, in turn, will allow us to do interesting things with aliases, such as intelligent and customizable help

llvm-svn: 262900
2016-03-08 02:49:15 +00:00
Jim Ingham 583bbb1dd4 Change over the broadcaster/listener process to hold shared or weak pointers
to each other.  This should remove some infrequent teardown crashes when the
listener is not the debugger's listener.

Processes now need to take a ListenerSP, not a Listener&.

This required changing over the Process plugin class constructors to take a ListenerSP, instead
of a Listener&.   Other than that there should be no functional change.
 
<rdar://problem/24580184> CrashTracer: [USER] Xcode at …ework: lldb_private::Listener::BroadcasterWillDestruct + 39

llvm-svn: 262863
2016-03-07 21:50:25 +00:00
Mohit K. Bhakkad 8f47909a8e [LLDB][MIPS] Fix TestDisassembleBreakpoint
Patch by Nitesh Jain

Reviewers: clayborg, jaydeep.
Subscribers: bhushan, mohit.bhakkad, sagar, lldb-commits.
Differential Revision: http://reviews.llvm.org/D17597

llvm-svn: 262819
2016-03-07 09:12:49 +00:00
Jason Molenda 578610c983 Move SBLanguageRuntime.cpp from the lldb-core group to the LLDB
group to fix a build time issue.
<rdar://problem/24287153> 

llvm-svn: 262816
2016-03-07 08:04:49 +00:00
James Y Knight dc395b9d2b Update after r262737 in clang changed the accessor.
llvm-svn: 262739
2016-03-04 19:30:53 +00:00
Pavel Labath 21d12f5aa3 Add a log statement
llvm-svn: 262715
2016-03-04 12:43:05 +00:00
Pavel Labath 19f937ae92 Resumbit "Fetch remote log files from LLGS tests"
The problem with the original patch (and my first attempt to fix) was that the value debug
monitor flags could persist from one test to another. Resetting the value in the setUp() function
fixes the problem.

llvm-svn: 262713
2016-03-04 11:27:00 +00:00