Commit Graph

7658 Commits

Author SHA1 Message Date
Adrian McCarthy ab59a0f6e7 Get the process ID from a minidump.
llvm-svn: 247939
2015-09-17 20:52:29 +00:00
Zachary Turner 8d8033c3b4 Fix a race condition when terminating inferiors on Windows.
If a breakpoint was hit in the inferior after shutdown had
started but before it was complete, it would cause an unclean
terminate of the inferior, leading to various problems the most
visible of which is that handles to the inferior executable would
remain locked, and the test suite would fail to run subsequent
tests because it could not recompile the inferior.

This fixes a major source of flakiness in the test suite.

llvm-svn: 247929
2015-09-17 20:18:50 +00:00
Paul Herman f6681b4ace Fix caching for clang::Decl in DWARFASTParserClang
Reviewers: sivachandra, chaoren, clayborg, tberghammer

Subscribers: lldb-commits

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

llvm-svn: 247923
2015-09-17 19:32:02 +00:00
Bruce Mitchener 59b5a37db0 DataFormatters: Rename clang_type to compiler_type.
Reviewers: granata.enrico

Subscribers: lldb-commits

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

llvm-svn: 247915
2015-09-17 18:43:40 +00:00
Sean Callanan c608d206c7 Removed a needless cast to ClangExpressionVariable.
llvm-svn: 247910
2015-09-17 18:19:12 +00:00
Dawn Perchik 554a85711c Fix LLDB RSP client to decode '$O' packets incorrectly
Character with ASCII code 0 is incorrectly treated by LLDB as the end of
RSP packet. The left of the debugger server output is silently ignored.

Patch from evgeny.leviant@gmail.com
Reviewed by: clayborg
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D12523

llvm-svn: 247908
2015-09-17 17:55:32 +00:00
Enrico Granata fa6b278f9c Add the ability for formatter categories to be bound to one or more languages
What that does is it restricts formatters in those categories to only match to types coming from "compatible" source languages

llvm-svn: 247872
2015-09-17 00:14:50 +00:00
Ryan Brown 65d4d5c3c6 Add an OperatingSystem plugin to support goroutines
The Go runtime schedules user level threads (goroutines) across real threads.
This adds an OS plugin to create memory threads for goroutines.
It supports the 1.4 and 1.5 go runtime.

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

llvm-svn: 247852
2015-09-16 21:20:44 +00:00
Zachary Turner ddf0661b38 Fix log disable command in ProcessWindowsLog.
The implications of this bug where that "log disable windows" would
not actually disable the log, and worse it would lock the file handle
making it impossible to delete the file until lldb was shut down.

This was then causing the test suite to fail, because the test suite
tries to delete log files in certain situations.

llvm-svn: 247841
2015-09-16 20:13:53 +00:00
Paul Herman ea188fc318 Add using directives to the clang::DeclContext and fix decls for variables inside namespaces
Summary: Supports the parsing of the "using namespace XXX" and "using XXX::XXX" directives. Added ambiguity errors when it two decls with the same name are encountered (see comments in TestCppNsImport). Fixes using directives being duplicated for anonymous namespaces. Fixes GetDeclForUID for specification DIEs.

Reviewers: sivachandra, chaoren, clayborg

Subscribers: lldb-commits

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

llvm-svn: 247836
2015-09-16 18:48:30 +00:00
Enrico Granata 7cb59e1a0f Move hardcoded formatters from the FormatManager to the Language plugins
llvm-svn: 247831
2015-09-16 18:28:11 +00:00
Zachary Turner dd07e00dbc Silence compiler warnings about unhandled switch cases.
llvm-svn: 247826
2015-09-16 18:08:45 +00:00
Greg Clayton 62c01ff9ca Add newline at end of file to avoid compiler warning.
llvm-svn: 247823
2015-09-16 18:05:08 +00:00
Oleksiy Vyalov eff9ad2e6e Add plugin.jit-loader.gdb.enable-jit-breakpoint property to make JIT loader breakpoint optional.
http://reviews.llvm.org/D12890

llvm-svn: 247821
2015-09-16 17:38:36 +00:00
Tamas Berghammer 1f5e4483a4 Add support for the DWARFLocationList used by split-dwarf
Split-dwarf uses a different header format to specify the address range
for the elements of the location lists.

Differential revision: http://reviews.llvm.org/D12880

llvm-svn: 247789
2015-09-16 12:37:06 +00:00
Tamas Berghammer 6127f03358 Fix prologue end handling when code compiled by gcc
GCC don't use the is_prologue_end flag to mark the first instruction
after the prologue. Instead of it it is issuing a line table entry for
the first instruction of the prologue and one for the first instruction
after the prologue. If the size of the prologue is 0 instruction then
the 2 line entry will have the same file address.

We remove these duplicates entries as they are violating the dwarf spec
and can cause confusion in the debugger. To prevent the lost of
information about the end of prologue we should set the prologue end
flag for the line entries what are representing more then 1 entry.

Differential revision: http://reviews.llvm.org/D12757

llvm-svn: 247788
2015-09-16 12:36:37 +00:00
Pavel Labath 11bb848ddc Revert "[LLDB][MIPS] Debug bare-iron targets lacking support for qC /qfThreadInfo"
This reverts commit r247773, because it breaks remote debugging support for lldb-server.

llvm-svn: 247783
2015-09-16 10:27:57 +00:00
Ewan Crawford 54782db7bc Add names to RenderScript kernel breakpoints.
Use Breakpoint::AddName to mark all RenderScript kernel breakpoints with the name 'RenderScriptKernel'.
Also update logging channels to include LIBLLDB_LOG_BREAKPOINT where appropriate. 

llvm-svn: 247782
2015-09-16 10:02:57 +00:00
Jaydeep Patil 003615b772 [LLDB][MIPS] Debug bare-iron targets lacking support for qC /qfThreadInfo
SUMMARY:
    Refer to http://lists.llvm.org/pipermail/lldb-dev/2015-August/008024.html for discussion
    on this topic. Bare-iron target like YAMON gdb-stub does not support qProcessInfo, qC,
    qfThreadInfo, Hg and Hc packets. Reply from ? packet is as simple as S05. There is no 
    packet which gives us process or threads information. In such cases, assume pid=tid=1.

    Reviewers: clayborg
    Subscribers: nitesh.jain, mohit.bhakkad, sagar, bhushan and lldb-commits
    Differential Revision: http://reviews.llvm.org/D12876

llvm-svn: 247773
2015-09-16 04:04:01 +00:00
Chaoren Lin 3ca7a3eb41 Fix off-by-one size check.
llvm-svn: 247766
2015-09-16 01:20:34 +00:00
Bruce Mitchener 778e7ab5a3 Return false, not 0, for bools.
Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 247755
2015-09-16 00:00:16 +00:00
Paul Herman d628cbb999 Search variables based on clang::DeclContext and clang::Decl tree
Summary: SymbolFileDWARF now creates VarDecl and BlockDecl and adds them to the Decl tree. Then, in ClangExpressionDeclMap it uses the Decl tree to search for a variable. This fixes lots of variable scoping problems.

Reviewers: sivachandra, chaoren, spyffe, clayborg

Subscribers: tberghammer, jingham, lldb-commits

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

llvm-svn: 247746
2015-09-15 23:44:17 +00:00
Jason Molenda 63bd0db071 Clean up register naming conventions inside lldb.
"gcc" register numbers are now correctly referred to as "ehframe"
register numbers.  In almost all cases, ehframe and dwarf register
numbers are identical (the one exception is i386 darwin where ehframe
regnums were incorrect).

The old "gdb" register numbers, which I incorrectly thought were
stabs register numbers, are now referred to as "Process Plugin"
register numbers.  This is the register numbering scheme that the
remote process controller stub (lldb-server, gdbserver, core file
support, kdp server, remote jtag devices, etc) uses to refer to the
registers.  The process plugin register numbers may not be contiguous
- there are remote jtag devices that have gaps in their register
numbering schemes.

I removed all of the enums for "gdb" register numbers that we had
in lldb - these were meaningless - and I put LLDB_INVALID_REGNUM
in all of the register tables for the Process Plugin regnum slot.

This change is almost entirely mechnical; the one actual change in
here is to ProcessGDBRemote.cpp's ParseRegisters() which parses the
qXfer:features:read:target.xml response.  As it parses register
definitions from the xml, it will assign sequential numbers as the
eRegisterKindLLDB numbers (the lldb register numberings must be
sequential, without any gaps) and if the xml file specifies register
numbers, those will be used as the eRegisterKindProcessPlugin
register numbers (and those may have gaps).  A J-Link jtag device's
target.xml does contain a gap in register numbers, and it only 
specifies the register numbers for the registers after that gap.
The device supports many different ARM boards and probably selects
different part of its register file as appropriate.

http://reviews.llvm.org/D12791
<rdar://problem/22623262> 

llvm-svn: 247741
2015-09-15 23:20:34 +00:00
Enrico Granata c1c9896ff4 Teach the ObjC data formatters to use the correct language when printing strings
llvm-svn: 247727
2015-09-15 22:11:20 +00:00
Jim Ingham 151c032c86 This patch makes Clang-independent base classes for all the expression types that lldb currently vends.
Before we had:

ClangFunction
ClangUtilityFunction
ClangUserExpression

and code all over in lldb that explicitly made Clang-based expressions. This patch adds an Expression 
base class, and three pure virtual implementations for the Expression kinds:

FunctionCaller
UtilityFunction
UserExpression

You can request one of these expression types from the Target using the Get<ExpressionType>ForLanguage. 
The Target will then consult all the registered TypeSystem plugins, and if the type system that matches 
the language can make an expression of that kind, it will do so and return it.

Because all of the real expression types need to communicate with their ExpressionParser in a uniform way, 
I also added a ExpressionTypeSystemHelper class that expressions generically can vend, and a ClangExpressionHelper 
that encapsulates the operations that the ClangExpressionParser needs to perform on the ClangExpression types. 
Then each of the Clang* expression kinds constructs the appropriate helper to do what it needs.

The patch also fixes a wart in the UtilityFunction that to use it you had to create a parallel FunctionCaller 
to actually call the function made by the UtilityFunction. Now the UtilityFunction can be asked to vend a 
FunctionCaller that will run its function. This cleaned up a lot of boiler plate code using UtilityFunctions.

Note, in this patch all the expression types explicitly depend on the LLVM JIT and IR, and all the common 
JIT running code is in the FunctionCaller etc base classes. At some point we could also abstract that dependency 
but I don't see us adding another back end in the near term, so I'll leave that exercise till it is actually necessary.

llvm-svn: 247720
2015-09-15 21:13:50 +00:00
Jim Ingham 0ca778eb2e Make the source-map help grammatical.
llvm-svn: 247709
2015-09-15 18:03:00 +00:00
Daniel Sanders 32764b5917 Fix build after llvm r247683 was reverted.
llvm-svn: 247703
2015-09-15 16:33:17 +00:00
Pavel Labath 360a543d04 Fix build after llvm r247683
llvm-svn: 247687
2015-09-15 13:49:10 +00:00
Tamas Berghammer 41b1f73122 Add support for DW_OP_GNU_const_index to dwarf expression
DW_OP_GNU_const_index is a new opcode used when split dwarf is enabled

Differential revision: http://reviews.llvm.org/D12849

llvm-svn: 247672
2015-09-15 10:33:54 +00:00
Tamas Berghammer d536a6d9dc Fix several issues arount dwo symbol file handling
Differential revision: http://reviews.llvm.org/D12804

llvm-svn: 247671
2015-09-15 10:33:41 +00:00
Bhushan D. Attarde 1bcc7bac8f [LLDB][MIPS] Add support for DT_MIPS_RLD_MAP_REL
SUMMARY:
    This patch provides support for MIPS specific DT_MIPS_RLD_MAP_REL tag in LLDB.
    This tag allows debugging of MIPS position independent executables and provides access to shared library information.

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

llvm-svn: 247666
2015-09-15 05:45:29 +00:00
Bruce Mitchener b0f54b8b31 Coding style fix.
llvm-svn: 247663
2015-09-15 04:50:56 +00:00
Bruce Mitchener 500737e694 Use uint64_t for GoArray size.
Summary:
This was int64_t, but all usages of it came from code that was passing
in unsigned values. The usages of the array size, except for one, were
also treating it as an unsigned value.  The usage that treated it as
signed was to try to figure out if it was a complete type or not, but
the callers creating the array didn't seem to be aware of using -1 as
an indicator for an incomplete array.

Reviewers: ribrdb, clayborg

Subscribers: lldb-commits

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

llvm-svn: 247662
2015-09-15 04:33:48 +00:00
Ryan Brown d03c2e0051 Fix error on windows:
c:\buildbot\lldb-windows-x86\lldb-windows-x86\llvm\tools\lldb\source\symbol\goastcontext.cpp(906) : warning C4715: 'lldb_private::GoASTContext::GetBitSize' : not all control paths return a value
c:\buildbot\lldb-windows-x86\lldb-windows-x86\llvm\tools\lldb\source\symbol\goastcontext.cpp(1175) : error C4716: 'lldb_private::GoASTContext::ConvertStringToFloatValue' : must return a value

llvm-svn: 247647
2015-09-15 00:50:43 +00:00
Greg Clayton 4bc6f19e77 Darwin has a debug info format that stores module types in stand alone files and it uses some of the DWO attributes. Don't assert in SymbolFileDWARFDwo, just return null so everything works.
llvm-svn: 247638
2015-09-14 23:34:26 +00:00
Greg Clayton c892672ffd Remove include that isn't needed.
llvm-svn: 247630
2015-09-14 22:56:46 +00:00
Ryan Brown 57bee1edfc Add a TypeSystem for Go
Add GoASTContext and DWARFASTParserGo to support go.

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

llvm-svn: 247629
2015-09-14 22:45:11 +00:00
Chaoren Lin 3e13005031 Fix CMake build.
- Typo: Coca.cpp -> Cocoa.cpp
- Missing include.

llvm-svn: 247628
2015-09-14 22:39:34 +00:00
Enrico Granata 170c395e70 Move Objective-C data formatters to the Objective-C language plugin where they belong
llvm-svn: 247627
2015-09-14 22:18:32 +00:00
Sean Callanan 85aabaf935 ClangExpressionDeclMap should only disable the Clang parser-specific state on
Clang persistent variables.

llvm-svn: 247615
2015-09-14 21:03:44 +00:00
Jim Ingham a2fcee9cba Remove a debugging printf that got left in SymbolFileDWARFDebugMap.
llvm-svn: 247589
2015-09-14 18:28:28 +00:00
Stephane Sezer e0f603fad5 Use SI_KERNEL on platforms defining it
Summary:
Linux and FreeBSD occasionally send SI_KERNEL codes, nonexistent on other platforms.

Problem caught on NetBSD.

Reviewers: joerg, sas

Subscribers: sas, lldb-commits, emaste

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

Change by Kamil Rytarowski <n54@gmx.com>

llvm-svn: 247579
2015-09-14 16:51:58 +00:00
Tamas Berghammer f8fd9b5263 Fix a possible SEGV in SymbolFileDWARF
The iterator pointing to an element of a dense map was used after
the element from was removed from the map what isn't guaranteed to be
valid at that time.

llvm-svn: 247571
2015-09-14 15:44:29 +00:00
Ed Maste 37366e5698 The pipe2(2) call is supported on NetBSD
Patch by Kamil Rytarowski.

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

llvm-svn: 247568
2015-09-14 15:12:49 +00:00
Ed Maste 1b3f13d776 Move RegisterContextPOSIX.h to FreeBSD subdir
It is now used only by the FreeBSD in-process ptrace implementation.

llvm-svn: 247561
2015-09-14 14:20:56 +00:00
Ed Maste fee8ace132 Limit scope of RegisterContextPOSIX.h header
RegisterContextPOSIX.h is poorly named and contains only the declaration
of POSIXBreakpointProtocol, which is used for in-process live kernel
debugging. It is now relevant only to FreeBSD.

In source/Plugins/Process/Utility/RegisterContext*.h (after assorted
rework and refactoring) it only served the purpose of #including other
necessary headers as a side-effect. Remove it from them and just include
the required headers directly.

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

llvm-svn: 247558
2015-09-14 13:16:59 +00:00
Pavel Labath d6a8ca6ec3 Switch default disposition of realtime signals
Summary:
Realtime signals generally do not represent an error condition in an application but are more
like a regular means of IPC. As such, we shouldn't interrupt an application whenever it recieves
one. If any application will use these signals, it will probably use them a lot, rendering it's
debugging tiresome if we stopped at every signal. Furthermore, these signals are likely to be used
in a low level library, and the programmer may not even be aware of their presence.

For these reasons, I am switching the default disposition of realtime signals on all supported
platforms (i.e. Linux and Freebsd) to no-stop, no-notify. Any user still wishing to receive these
signals can always change the default to suit his needs.

Reviewers: ovyalov, emaste

Subscribers: lldb-commits, emaste

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

llvm-svn: 247537
2015-09-14 09:05:43 +00:00
Stephane Sezer 9187e73bda Fix a small typo in ObjectFileELF.cpp.
llvm-svn: 247452
2015-09-11 18:56:59 +00:00
Bruce Mitchener 82fd1f7d6c Clean up build of JITLoader/GDB in autoconf build.
Summary:
This builds on all platforms, so remove duplication in build
configuration.

Reviewers: labath, clayborg, emaste

Subscribers: lldb-commits

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

llvm-svn: 247402
2015-09-11 10:37:17 +00:00
Tamas Berghammer c7776e4139 Improve the arm/aarch64 mapping symbol handling
Change the mapping symbol handling to handle the case when the mapping
symbols are prefixed with an arbitrary prefix. This isn't strictly standard
compliance, but if all symbols in an object file is prefixed with objcopy
then the prefix will be added to the mapping symbol also. We still want to
treat these symbols as mapping symbols to get the correct address class data.

Differential revision: http://reviews.llvm.org/D12755

llvm-svn: 247400
2015-09-11 10:04:00 +00:00
Bruce Mitchener b56c8bce32 Clean up building & linking of Process/elf-core.
Summary:
* cmake/LLDBDependencies.cmake: elf-core is already included
  globally in LLDB_USED_LIBS, so it doesn't need to be re-added
  on individual platforms.

* lib/Makefile: elf-core is linked on each platform, so move it
  to the global list of used libraries.

* source/Plugins/Makefile: elf-core is built on each platform, so
  move it to the global list of things to build.

Reviewers: clayborg, labath

Subscribers: lldb-commits

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

llvm-svn: 247366
2015-09-11 00:31:33 +00:00
Bruce Mitchener 809b860bd3 Build Plugin/JITLoader/GDB on all platforms.
Summary:
We currently link to this on all platforms, so don't need to re-include
it into the LLDB_USED_LIBS. Also don't need to special case building
it for every supported platform.

Reviewers: clayborg, labath

Subscribers: lldb-commits

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

llvm-svn: 247284
2015-09-10 14:28:49 +00:00
Ewan Crawford 7dc7771cd5 New RenderScript command to break on all kernels
Patch adds a command to RenderScript plugin allowing users to automatically set breakpoints on every RS kernel.

Command syntax is 'language renderscript kernel breakpoint all <enable/disable>.'
Enable sets breakpoints on all currently loaded kernels, and any kernels which will be loaded in future.
Disable results in breakpoints no longer being set on loaded kernels, but doesn't affect existing breakpoints.

Current command 'language renderscript kernel breakpoint' is changed to 'language renderscript kernel breakpoint set'

Reviewed by: clayborg, jingham
Subscribers: lldb-commits, ADodds, domipheus
Differential Revision: http://reviews.llvm.org/D12728

llvm-svn: 247262
2015-09-10 10:08:48 +00:00
Stephane Sezer eee657045f Fix a small comment typo in Windows Process code.
llvm-svn: 247206
2015-09-09 22:58:23 +00:00
Enrico Granata ac49453b58 Introduce the notion of an escape helper. Different languages have different notion of what to print in a string and how to escape non-printable things. The escape helper is where this notion is provided to LLDB
This is NFC, other than a code re-org

llvm-svn: 247200
2015-09-09 22:30:24 +00:00
Greg Clayton 13f11bba7d Remove unused function.
llvm-svn: 247197
2015-09-09 22:13:36 +00:00
Greg Clayton 34e2180a00 Now that CompilerType uses a "TypeSystem *" and a "void *" instead of a "clang::ASTContext *" and a "void *", we need to know if anyone is trying to create a CompilerType from a clang::ASTContext that has no backing ClangASTContext.
This assert will fire if this is the case and we will need to fix the offending code.

llvm-svn: 247196
2015-09-09 22:13:01 +00:00
Greg Clayton 51c63e3b30 Remove a call to deleted function.
llvm-svn: 247193
2015-09-09 21:34:32 +00:00
Enrico Granata ad650a189c Preparatory work for letting language plugins help the StringPrinter with formatting special characters
llvm-svn: 247189
2015-09-09 20:59:49 +00:00
Greg Clayton aa61a1563b Make sure to flush the stream to make sure the string is up to date when we query its size.
llvm-svn: 247175
2015-09-09 18:41:50 +00:00
Zachary Turner 84f5b0df8e Fix some compiler warnings.
llvm-svn: 247164
2015-09-09 17:25:43 +00:00
Mohit K. Bhakkad 9514a383c8 [LLDB][MIPS] Added support for the debugging of N32/O32 applications on MIPS64 target.
Patch by Nitesh Jain

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

llvm-svn: 247134
2015-09-09 10:32:20 +00:00
Tamas Berghammer 025103cc61 Change the looping stack detection code
In some special case (e.g. signal handlers, hand written assembly) it is
valid to have 2 stack frame with the same CFA value. This CL change the
looping stack detection code to report a loop only if at least 3
consecutive frames have the same CFA.

Differential revision: http://reviews.llvm.org/D12699

llvm-svn: 247133
2015-09-09 10:26:50 +00:00
Tamas Berghammer eb882fc1f8 Add basic fission support to SymbolFileDWARF
* Create new dwo symbol file class
* Add handling for .dwo sections
* Change indexes in SymbolFileDWARF to store compile unit offset next to
  DIE offset
* Propagate queries from dwarf compile unit to the dwo compile unit
  where applicable

Differential revision: http://reviews.llvm.org/D12291

llvm-svn: 247132
2015-09-09 10:20:48 +00:00
Tamas Berghammer 715cbe8939 Code cleanup in preparation of adding split dwarf support
* Remove some unused code
* Remove usage of DWARFDebugInfoEntry::Attributes where usage isn't
  reasonable
* Cleanup DWARFMappedHash with separating it to header and implementation
  file and fixing the visibility of the functions

Differential revision: http://reviews.llvm.org/D12374

llvm-svn: 247131
2015-09-09 10:20:36 +00:00
Mohit K. Bhakkad a73239f860 [LLDB][MIPS] MIPS load/store instruction emulation for hardware watchpoints
Reviewers: clayborg.
Subscribers: jaydeep, bhushan, sagar, nitesh.jain, lldb-commits.
Differential Revision: http://reviews.llvm.org/D12670

llvm-svn: 247129
2015-09-09 10:17:58 +00:00
Hafiz Abid Qadeer 87f4f413ba Remove an invalid check in DW_OP_piece processing.
Summary:
When lldb is processing a location containing DW_OP_piece, the result is being
stored in the 'pieces' variable. The location is popped from the 'stack' variable.
So this check to see that 'stack' is not empty was invalid and caused the pieces
after the first to not get processed.

I am working on an architecture which has 16-bit and 8-bit registers. So this
problem was quite easy to see. But I was able to re-produce this issue on x86
too with long long variable and compiling woth -m32. It resulted in following
location list.
00000014 08048496 080484b5 (DW_OP_reg6 (esi); DW_OP_piece: 4; DW_OP_reg7 (edi); DW_OP_piece: 4)

and lldb was only showing the contents of first register when I evaluated the
variable as it does not process the 2nd piece due to this check.

Reviewers: clayborg, aprantl

Subscribers: lldb-commits

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

llvm-svn: 247124
2015-09-09 09:06:05 +00:00
Jason Molenda 21586c8385 When lldb gets the register definitions from the response of a
qXfer:features:read:target.xml packet, or via the
plugin.process.gdb-remote.target-definition-file setting, if the
register definition doesn't give us eh_frame or DWARF register
numbers for that register, try to get that information from the ABI
plugin.

The DWARF/eh_frame register numbers are defined in the ABI
standardization documents - so getting this from the ABI plugin is
reasonable.  There's little value in having the remote stub inform
us of this generic information, as long as we can all agree on the
names of the registers.

There's some additional information we could get from the ABI.  For
instance, on ABIs where function arguments are passed in registers,
lldb defines alternate names like "arg1", "arg2", "arg3" for these
registers so they can be referred to that way by the user.  We could
get this from the ABI if the remote stub doesn't provide that.  That
may be something worth doing in the future - but for now, I'm keeping
this a little more minimal.

Thinking about this, what we want/need from the remote stub at a
minimum are:

 1. The names of the register
 2. The number that the stub will use to refer to the register with
    the p/P packets and in the ? response packets (T/S) where 
    expedited register values are provided
 3. The size of the register in bytes
   
(nice to have, to remove any doubt)
 4. The offset of the register in the g/G packet if we're going to
    use that for reading/writing registers.

debugserver traditionally provides a lot more information in
addition to this via the qRegisterInfo packet, and debugserver 
augments its response to the qXfer:features:read:target.xml
query to include this information.  Including:

DWARF regnum, eh_frame regnum, stabs regnum, encoding (ieee754,
Uint, Vector, Sint), format (hex, unsigned, pointer, vectorof*,
float), registers that should be marked as invalid if this 
register is modified, and registers that contain this register.

We might want to get all of this from the ABI - I'm not convinced
that it makes sense for the remote stub to provide any of these 
details, as long as the ABI and remote stub can agree on register
names.

Anyway, start with eh_frame and DWARF coming from the ABI if 
they're not provided by the remote stub.  We can look at doing
more in the future.

<rdar://problem/22566585> 

llvm-svn: 247121
2015-09-09 03:36:24 +00:00
Jason Molenda 0ace3f5c73 A change I'm open to reverting if there is disagreement:
When lldb receives a gdb-remote protocol packet that has
nonprintable characters, it will print the packet in
gdb-remote logging with binary-hex encoding so we don't 
dump random 8-bit characters into the packet log.

I'm changing this check to allow whitespace characters
(newlines, linefeeds, tabs) to be printed if those are
the only non-printable characters in the packet. 

This is primarily to get the response to the 
qXfer:features:read:target.xml packet to show up in the
packet logs in human readable form.  Right now we just
get a dozen kilobytes of hex-ascii and it's hard to 
figure out what register number scheme is being used.

llvm-svn: 247120
2015-09-09 03:24:52 +00:00
Stephane Sezer 851f23db94 NetBSD doesn't provide struct statfs, make use of struct statvfs
Reviewers: joerg, sas

Subscribers: labath, lldb-commits

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

Change by Kamil Rytarowski <n54@gmx.com>

llvm-svn: 247115
2015-09-09 01:19:05 +00:00
Stephane Sezer 4d640f2e3b Prevent from a redefinition of _GLIBCXX_USE_NANOSLEEP
Summary: Build warning caught on NetBSD.

Reviewers: joerg, sas

Subscribers: lldb-commits

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

Change by Kamil Rytarowski <n54@gmx.com>

llvm-svn: 247114
2015-09-09 01:17:24 +00:00
Enrico Granata d3233c1ed7 Data formatter candidate matches can be generated in a number of ways; language-based dynamic type discovery being one of them (for instance, this is what takes an 'id' and discovers that it truly is an __NSArrayI, so it should probably use the NSArray formatter)
This used to be hardcoded in the FormatManager, but in a pluginized world that is not the right way to go

So, move this step to the Language plugin such that appropriate language plugins for a type get a say about adding candidates to the formatters lookup tables

llvm-svn: 247112
2015-09-09 01:10:46 +00:00
Bruce Mitchener 1ef6e4c870 Fix log message warning in SBThread.
Summary:
The format string was not set up correctly as it was missing the %.
This resulted in a warning (correctly) that the data arguments were
not all used.

Reviewers: clayborg, jingham

Subscribers: lldb-commits

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

llvm-svn: 247111
2015-09-09 00:56:25 +00:00
Sean Callanan 3820e9cd17 ExpressionVariable now uses llvm::cast() instead of As...() for RTTI.
As part of our overall switch from hand-rolling RTTI to using LLVM-compatible
methods, I've done the same for ExpressionVariable.  The main documentation for
how to do this is in TypeSystem.h, so I've simply referred to that.

llvm-svn: 247085
2015-09-08 22:23:39 +00:00
Enrico Granata b5be2ffae5 Implement a Target::GetTypeSystemForLanguage API, as well as provide helpers on the TypeSystem to get numeric types of specific sizes and signedness
llvm-svn: 247082
2015-09-08 22:09:19 +00:00
Jim Ingham 989a7558b8 SBThread::StepOutOfFrame should check that the SBStackFrame it gets passed
is valid, and that its thread is the same as this SBThread.

llvm-svn: 247046
2015-09-08 18:40:59 +00:00
Greg Clayton f73034f99a Use LLVM casting for TypeSystem so you can cast it to subclasses.
This will keep our code cleaner and it removes the need for intrusive additions to TypeSystem like:

class TypeSystem
{
    virtual ClangASTContext *
    AsClangASTContext() = 0;
}

As you can now just use the llvm::dyn_cast and other casts.

llvm-svn: 247041
2015-09-08 18:15:05 +00:00
Oleksiy Vyalov f3cd18192f Fix debugger shutdown when Python interpreter is loaded.
http://reviews.llvm.org/D12683

llvm-svn: 247023
2015-09-08 16:26:32 +00:00
Tamas Berghammer e6408bb064 Fix assertion failure caused by a bug in 128bit register handling in RegisterValue
llvm-svn: 247022
2015-09-08 16:22:23 +00:00
Tamas Berghammer c40e7b1769 Fix the handling of FPR offsets in Linux arm/aarch64 register contexts
Differential revision: http://reviews.llvm.org/D12636

llvm-svn: 246959
2015-09-07 10:11:23 +00:00
Tamas Berghammer 25b9f7ebd3 Use eAddressClassCode for address lookup for opcodes for stack frames
It is required because of the following edge case on arm:

bx <addr>   Non-tail call in a no return function
[data-pool] Marked with $d mapping symbol

The return address of the function call will point to the data pool but
we have to treat it as code so the StackFrame can calculate the symbols
correctly.

Differential revision: http://reviews.llvm.org/D12556

llvm-svn: 246958
2015-09-07 09:58:09 +00:00
Abhishek Aggarwal 7f658edd61 Bug 24457 - X87 FPU Special Purpose Registers
Summary:
  - For 'register read --all' command on x86_64-Linux Platform:

      -- Provide correct values of X87 FPU Special Purpose Registers
      -- Both 32-bit & 64-bit inferiors give correct values on this
         Platform

  - Added a Test Vector:
      -- To verify the expected behaviour of the command

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

Reviewers: ashok.thirumurthi, granata.enrico, tfiala, clayborg

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

llvm-svn: 246955
2015-09-07 07:40:16 +00:00
Keno Fischer 311435dbb6 Fix Makefile build
llvm-svn: 246932
2015-09-05 20:01:56 +00:00
Greg Clayton ea4a5bb8bb Check for null compile unit so we don't crash.
llvm-svn: 246887
2015-09-04 22:29:46 +00:00
Enrico Granata 964211f25f Add a --language (-l) option to type category {enable|disable} to allow people to turn on and off formatters for a given language
llvm-svn: 246884
2015-09-04 22:07:48 +00:00
Enrico Granata c6bbb8b69a Never mind, I see what the problem is on the Windows build. Attempt a fix
llvm-svn: 246876
2015-09-04 21:22:54 +00:00
Enrico Granata 33e97e63a5 Move the C++ data formatters to the C++ language plugin
llvm-svn: 246873
2015-09-04 21:01:18 +00:00
Sean Callanan bc8ac34e61 This patch separates the generic portion of ClangExpressionVariable, which
stores information about a variable that different parts of LLDB use, from the
compiler-specific portion that only the expression parser cares about.

http://reviews.llvm.org/D12602

llvm-svn: 246871
2015-09-04 20:49:51 +00:00
Hafiz Abid Qadeer 23a4df27ab Use correct #ifdef check for ProcessWindowsLog::Terminate() call.
The call to ProcessWindowsLog::Initialize() is protected by #if defined(_MSC_VER).
But the call to ProcessWindowsLog::Terminate() was using __WIN32__. This commit
makes it use _MSC_VER too.

Committing as it seems obvious change.

llvm-svn: 246859
2015-09-04 16:34:19 +00:00
Tamas Berghammer 980662ee9d Fix TestLoadUnload.test_load_unload for android API > 21
* Change Module::MatchesModuleSpec to return true in case the file spec
  in the specified module spec matches with the platform file spec, but
  not with the local file spec
* Change the module_resolver used when resolving a remote shared module
  to always set the platform file spec to the file spec requested

Differential revision: http://reviews.llvm.org/D12601

llvm-svn: 246852
2015-09-04 12:42:41 +00:00
Pavel Labath a04668ff34 Move GetOptInc to the common namespace
Summary:
GetOptInc provides getopt(), getopt_long() and getopt_long_only().

Windows (for defined(_MSC_VER)) doesn't ship with all of the getopt(3) family members and needs all of them. NetBSD requires only getopt_long_only(3).

While there fix the code for clang diagnostics.

Author: Kamil Rytarowski

Reviewers: joerg

Subscribers: labath, zturner, lldb-commits

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

llvm-svn: 246843
2015-09-04 09:06:15 +00:00
Ewan Crawford 9815658332 RenderScript pending kernel breakpoints.
Currently the RS breakpoint command can only find a kernel if it's in an already loaded RS module.
This patch allows users to set pending breakpoints on RenderScript kernels which will be loaded in the future.
Implemented by creating a RS breakpoint resolver, to limit search scope to only RS modules.

Reviewed by: clayborg, jingham
Subscribers: lldb-commits, ADodds, domipheus
Differential Revision: http://reviews.llvm.org/D12360

llvm-svn: 246842
2015-09-04 08:56:52 +00:00
Abhishek Aggarwal 2cf87a895d SysV ABI for i386 Architecture
Summary:
  - Capability to force return user specified values
    from inside of a function on lldb command terminal

  - Support for Integral, Pointer and Floating Point values

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

Reviewers: jingham, clayborg

Subscribers: tberghammer

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

llvm-svn: 246841
2015-09-04 07:44:05 +00:00
Jason Molenda 125adcf0aa Change the (internal to this file only) enum names from gcc_ to
ehframe_ & from gdb_ to stabs_ for clarity.

Also document the fact that i386 eh_frame on Darwin has the register
numbers swapped for ebp/esp from the DWARF register numbers so no one
copies these defines for other i386 ABI plugins.  This bug only ever
existed on Darwin.

No code changes, just renaming variables.

llvm-svn: 246834
2015-09-04 03:40:29 +00:00
Dawn Perchik 009d110de4 Set the default language to use when evaluating to that of the frame's CU.
* Use the frame's context (instead of just the target's) when evaluating,
  so that the language of the frame's CU can be used to select the
  compiler and/or compiler options to use when parsing the expression.
  This allows for modules built with mixed languages to be parsed in
  the context of their frame. 
* Add all C and C++ language variants when determining the language options
  to set.
* Enable C++ language options when language is C or ObjC as a workaround since
  the expression parser uses features of C++ to capture values.
* Enable ObjC language options when language is C++ as a workaround for ObjC
  requirements.
* Disable C++11 language options when language is C++03.
* Add test TestMixedLanguages.py to check that the language being used
  for evaluation is that of the frame.
* Fix test TestExprOptions.py to check for C++11 instead of C++ since C++ has
  to be enabled for C, and remove redundant expr --language test for ObjC.
* Fix TestPersistentPtrUpdate.py to not require C++11 in C.

Reviewed by: clayborg, spyffe, jingham
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D11102

llvm-svn: 246829
2015-09-04 01:02:30 +00:00
Enrico Granata 419d79189f Nuke CXXFormatterFunctions.cpp - split the contents of it across different files, so that things are better organized along the C++/ObjC line
This is preparatory work for moving these formatters into language categories

llvm-svn: 246827
2015-09-04 00:33:51 +00:00
Bruce Mitchener 3921fc7de7 Only export public symbols with the cmake build.
Summary:
This also moves the xcode support files to be near or the same
as the ones used for cmake.

The source/API/liblldb.xcodes.exports differs from the
source/API/liblldb.exports in that one contains the actual
symbol names (_ prefixed) while the other contains the symbol
names as they are in the code. The liblldb.exports file is
preprocessed by the cmake scripts into the correct per-platform
file needed (like a linker script on Linux).

This is not enabled on Windows as Windows doesn't use the same
name mangling and so it won't be valid there. Also, this is handled
already in a different way on Windows (via dll exports).

Reviewers: emaste, clayborg, labath, chaoren

Subscribers: lldb-commits

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

llvm-svn: 246822
2015-09-04 00:00:41 +00:00
Bruce Mitchener cfe7d6c486 SystemRuntime/MacOSX no longer need ObjCRuntime header.
Summary:
The AppleGetQueuesHandler code no longer needs to include a header
from the AppleObjCRuntime, so we can remove workarounds that were
present in the build systems.

Reviewers: clayborg, jasonmolenda

Subscribers: lldb-commits

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

llvm-svn: 246821
2015-09-03 23:57:09 +00:00
Siva Chandra 0f4873d7d0 Lookup function using full name if one with mangled name is not found.
Summary:
Remove expected failure decorators from tests which now should start
passing.

Reviewers: clayborg, spyffe

Subscribers: lldb-commits

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

llvm-svn: 246820
2015-09-03 23:27:10 +00:00
Stephane Sezer 5506a1d96e NetBSD ships with paccept(2), a superset of accept4(2)
Summary: accept4(2) and paccept(2) are nonstandard extensions.

Reviewers: joerg, sas

Subscribers: emaste, sas, lldb-commits

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

Change by Kamil Rytarowski <n54@gmx.com>

llvm-svn: 246787
2015-09-03 17:11:31 +00:00