Commit Graph

4551 Commits

Author SHA1 Message Date
Ed Maste deb0506790 elf-core: Support FreeBSD at compile-time
Compile-time #ifdef-ery isn't right, but this makes core debugging work on
FreeBSD and highlights the parts that will need to be changed for runtime
arch support.

llvm-svn: 186534
2013-07-17 20:13:39 +00:00
Ashok Thirumurthi 4f01ff8bfe Re-introduces ELF core file support for Linux x86-64
Usage: 'lldb a.out -c core'.
  TODO: FreeBSD support.
  TODO: Support for AVX registers.
  TODO: Refactor so that RegisterContextCore* don't inherit from classes that use ProcessMonitor
  to fix the build on OS/X.

llvm-svn: 186516
2013-07-17 16:06:12 +00:00
Ed Maste a56115f785 Correct comment to match class name
llvm-svn: 186509
2013-07-17 14:30:26 +00:00
Ed Maste 819e39901f FreeBSD: Replace GetSignalInfo with GetLwpInfo
For thread support we are going to need other members of struct
ptrace_lwpinfo.

llvm-svn: 186505
2013-07-17 14:02:20 +00:00
Michael Sartain 3cf443ddd6 simple plugin now works with Linux fix assert in SetPluginInfo implement Linux ePathTypeLLDBSystemPlugins and ePathTypeLLDBUserPlugins implement Linux Host::Backtrace and Host::GetEnvironment add .gnu_debugdata comment
Differential Revision: http://llvm-reviews.chandlerc.com/D1159

llvm-svn: 186475
2013-07-17 00:26:30 +00:00
Michael Sartain c87e752bb5 Fix Rendezvous breakpoint to only be set once, resolve addr in BreakpointLocationList::FindByAddress
Differential Revision: http://llvm-reviews.chandlerc.com/D1145

llvm-svn: 186458
2013-07-16 21:22:53 +00:00
Sean Callanan 0e016fe31b Fixed a problem in IRForTarget where we would not
delete a constant after we replaced it with a
dynamically-computed value.  Also ensured that we
replace all users of the constant if there are
multiple ones.  Added a testcase.

<rdar://problem/14379043>

llvm-svn: 186363
2013-07-15 23:31:47 +00:00
Enrico Granata ea9f9e8e06 Disabling the introspecting summary for __NSCFSet (essentially, for CF*SetRef)
llvm-svn: 186362
2013-07-15 23:17:32 +00:00
Greg Clayton 7f98240df6 <rdar://problem/13793059>
Added a setting to control timeout for kdp response packets. While I was at it, I also added a way to control the response timeout for gdb-remote packets.

KDP defaults to 5 seconds, and GDB defaults to 1 second. These were the default values that were in the code prior to adding these settings.

(lldb) settings set plugin.process.gdb-remote.packet-timeout 10
(lldb) settings set plugin.process.kdp-remote.packet-timeout 10

llvm-svn: 186360
2013-07-15 22:54:20 +00:00
Greg Clayton 109f86860a Fix issues with GCC debugging. GCC emits DWARF in unique ways that LLDB wasn't handling. This fix will fix cases where classes are forward declared using DW_TAG_structure_type and then actually defined using DW_TAG_class_type. LLDB, when it finds a forward declaration, would try and find and parse the complete type. It does this by:
1 - looking up the type basename in the type index
2 - iterate through all matches and look for decl contexts (namespace/class hierarchy) that match

The issue was the decl context matching wasn't watching for DW_TAG_class_type/DW_TAG_structure_type mismatches, and it wasn't also getting the name for DIE's that didn't have a DW_AT_name, but did have a DW_AT_specification that had a name.

llvm-svn: 186347
2013-07-15 21:10:17 +00:00
Sean Callanan f35bbbcd87 Actually use the return value we get back when
creating a persistent variable, rather than making
a (potentially expensive) lookup by name.

<rdar://problem/14337653>

llvm-svn: 186337
2013-07-15 18:43:36 +00:00
Jason Molenda 17da171f1a Bump version number to 310.99.0.
llvm-svn: 186304
2013-07-15 04:47:33 +00:00
Jason Molenda d6cfc16ffa Commit Timothee Besset's patch to update Host/linux/Host.cpp to keep up
with the changes in r186211.

llvm-svn: 186299
2013-07-15 03:25:21 +00:00
Sean Callanan d2a507a6e6 Modified the expression parser to only try to
write to registers if they were modified in the
expression.  This eliminates spurious errors if
the register can't be written to but the
expression didn't write to it anyway.

Also improved error handling for the materializer
to make "couldn't materialize struct" errors more
informative.

<rdar://problem/14322579>

llvm-svn: 186228
2013-07-12 23:35:21 +00:00
Greg Clayton 3deb0e7ca5 Revert the ELF core file support until a few things can be worked out:
RegisterContextCoreLinux_x86_64 inherits from RegisterContextLinux_x86_64 which inherits from RegisterContext_x86_64 which uses has:

   ProcessMonitor &GetMonitor();

This register context used by the core file can't use this since the process plug-in will be ProcessElfCore and the implementation of GetMonitor() does:

ProcessMonitor &
RegisterContext_x86_64::GetMonitor()
{
   ProcessSP base = CalculateProcess();
   ProcessPOSIX *process = static_cast<ProcessPOSIX*>(base.get());
   return process->GetMonitor();
}

ProcessELFCore doesn't, nor should it inherit from ProcessPOSIX and any call to GetMonitor() will fail for ELF core files.

Suggested cleanups:
- Make a register context class that is a base class that doesn't have any reading smarts, then make one that uses ProcessPOSIX and the has the GetMonitor() call, and one that gets its data straight from the core file. 

llvm-svn: 186223
2013-07-12 22:52:22 +00:00
Greg Clayton 090b591d82 Missed a checking that should have been checked in with 186211.
llvm-svn: 186221
2013-07-12 22:40:04 +00:00
Greg Clayton 2540a8a7bc Fixed GetModuleSpecifications() to work better overall:
- MachO files now correctly extract the UUID all the time
- More file size and offset verification done for universal mach-o files to watch for truncated files
- ObjectContainerBSDArchive now supports enumerating all objects in BSD archives (.a files)
- lldb_private::Module() can not be properly constructed using a ModuleSpec for a .o file in a .a file
- The BSD archive plug-in shares its cache for GetModuleSpecifications() and the create callback
- Improved printing for ModuleSpec objects

llvm-svn: 186211
2013-07-12 22:07:46 +00:00
Ashok Thirumurthi c037383aff Introduces core file support for Linux x86-64 using 'lldb a.out -c core'.
TODO: Support for RegisterContext_x86_64::ReadFPR.

Patch by Samuel Jacob!

llvm-svn: 186207
2013-07-12 21:25:02 +00:00
Enrico Granata b8b0bf9b81 Added Repr() and Str() member functions to our PythonObject class to allow easy conversion to-string of every PythonObject
llvm-svn: 186205
2013-07-12 21:11:02 +00:00
Greg Clayton 2965971091 Fix the linux gcc 4.6.3 buildbot failures that happened after my recent types checkin.
llvm-svn: 186195
2013-07-12 20:08:35 +00:00
Ashok Thirumurthi e5cae05f49 Handle BreakNotify for threads whose tid doesn't match the ThreadSpec of the BreakpointSite
to avoid asserts when stepping in a multi-threaded application.

Note: Test to follow shortly.
llvm-svn: 186190
2013-07-12 19:19:15 +00:00
Ed Maste 9895ac1119 TypeHierarchyNavigator was removed in r186130
llvm-svn: 186160
2013-07-12 13:41:18 +00:00
Greg Clayton 1341baf515 Unblock buildbot.
llvm-svn: 186133
2013-07-11 23:36:31 +00:00
Greg Clayton 57ee306789 Huge change to clean up types.
A long time ago we start with clang types that were created by the symbol files and there were many functions in lldb_private::ClangASTContext that helped. Later we create ClangASTType which contains a clang::ASTContext and an opauque QualType, but we didn't switch over to fully using it. There were a lot of places where we would pass around a raw clang_type_t and also pass along a clang::ASTContext separately. This left room for error.

This checkin change all type code over to use ClangASTType everywhere and I cleaned up the interfaces quite a bit. Any code that was in ClangASTContext that was type related, was moved over into ClangASTType. All code that used these types was switched over to use all of the new goodness.

llvm-svn: 186130
2013-07-11 22:46:58 +00:00
Ashok Thirumurthi 4822d9263a Adds methods to ObjectFileELF to access data in ELF segments
in preparation to add support for ELF core files.

Patch by Samuel Jacob!

llvm-svn: 186114
2013-07-11 20:39:00 +00:00
Matt Kopec 4a32bf58d1 Fix unhandled SIGTRAP signal on Linux causing assertion.
llvm-svn: 186112
2013-07-11 20:01:22 +00:00
Michael Sartain cc791bbfab Fix "source list -n printf" on Linux (printf is symbol alias for __printf)
Differential Revision: http://llvm-reviews.chandlerc.com/D1109

llvm-svn: 186104
2013-07-11 16:40:56 +00:00
Ed Maste 889865fb69 Add stub GetThreadName for FreeBSD, missed in r186033.
On FreeBSD inferior thread names are available through ptrace, so we won't
use Host::GetThreadName anyway.

llvm-svn: 186086
2013-07-11 14:12:16 +00:00
Jim Ingham bf22b96dd1 Add a -remote-file option to “target create” to specify the location of the executable on a remote system (if debugging remotely using debugserver on the target system.) This gets us closer to being able to set up a remote debugging session from the lldb command line.
llvm-svn: 186050
2013-07-11 01:47:46 +00:00
Andrew Kaylor bc68b431ba Stop process monitor from ProcessPOSIX::Finalize
llvm-svn: 186039
2013-07-10 21:57:27 +00:00
Matt Kopec fb6ab54000 Add support for listing inferior thread names on Linux.
llvm-svn: 186033
2013-07-10 20:53:11 +00:00
Enrico Granata e602fe1e7f Adding a summary for ObjC blocks
llvm-svn: 186023
2013-07-10 18:25:45 +00:00
Greg Clayton a063c810a0 Fixed an issue introduced with my last fix where the command and sequence ID extraction were moved causing them to be reversed.
llvm-svn: 186020
2013-07-10 17:58:19 +00:00
Jim Ingham 9f35cfaf08 Call xmlFree on the node contents returned by xmlNodeGetContent, as the docs say to do.
<rdar://problem/14391836>

llvm-svn: 185996
2013-07-10 02:21:57 +00:00
Greg Clayton 3046e66830 Cleanup on the unified section list changes. Main changes are:
- ObjectFile::GetSymtab() and ObjectFile::ClearSymtab() no longer takes any flags
- Module coordinates with the object files and contain a unified section list so that object file and symbol file can share sections when they need to, yet contain their own sections.

Other cleanups:
- Fixed Symbol::GetByteSize() to not have the symbol table compute the byte sizes on the fly
- Modified the ObjectFileMachO class to compute symbol sizes all at once efficiently
- Modified the Symtab class to store a file address lookup table for more efficient lookups
- Removed Section::Finalize() and SectionList::Finalize() as they did nothing
- Improved performance of the detection of symbol files that have debug maps by excluding stripped files and core files, debug files, object files and stubs
- Added the ability to tell if an ObjectFile has been stripped with ObjectFile::IsStripped() (used this for the above performance improvement)

llvm-svn: 185990
2013-07-10 01:23:25 +00:00
Greg Clayton 7ad05d136a Fixed the CommunicationKDP::SendRequestAndGetReply() to correctly be able to deal with getting a reply from a previous packet without resending the packet again.
llvm-svn: 185988
2013-07-10 01:05:05 +00:00
Michael Sartain 6098617412 Add silent option to command source.
Patch from Matthew Sorrels

llvm-svn: 185983
2013-07-09 23:22:53 +00:00
Andrew Kaylor 6578cb6478 Reverting ProcessMonitor shared pointer changes
llvm-svn: 185981
2013-07-09 22:36:48 +00:00
Enrico Granata eff81a471a Second attempt at getting the PyCallable changes in trunk
Thanks to Daniel Malea for helping test this patch for Linux happiness!

llvm-svn: 185965
2013-07-09 20:14:26 +00:00
Andrew Kaylor 214f3a8a78 Use shared pointers to hold the process in ProcessMonitor
llvm-svn: 185946
2013-07-09 16:44:27 +00:00
Matt Kopec b29104467f Fix signal handling for POSIX (only tested on Linux) processes in multi-threaded programs.
Also fix a related issue where if a thread exits after a thread continue, lldb would hang.

llvm-svn: 185944
2013-07-09 15:09:45 +00:00
Greg Clayton 4670d47fd0 Added missing SBModuleSpec.cpp file to the CMakeLists.txt
llvm-svn: 185878
2013-07-08 22:37:11 +00:00
Greg Clayton 226cce2511 Added a way to extract the module specifications from a file. A module specification is information that is required to describe a module (executable, shared library, object file, ect). This information includes host path, platform path (remote path), symbol file path, UUID, object name (for objects in .a files for example you could have an object name of "foo.o"), and target triple. Module specification can be used to create a module, or used to add a module to a target. A list of module specifications can be used to enumerate objects in container objects (like universal mach files and BSD archive files).
There are two new classes:

lldb::SBModuleSpec
lldb::SBModuleSpecList

The SBModuleSpec wraps up a lldb_private::ModuleSpec, and SBModuleSpecList wraps up a lldb_private::ModuleSpecList.

llvm-svn: 185877
2013-07-08 22:22:41 +00:00
Michael Sartain 4b2967ff9f Use target DisplaySource if available so we can get mixed source and assembly.
This fixes "disassemble -m -n __printf".

llvm-svn: 185845
2013-07-08 17:56:02 +00:00
Ed Maste 6f066412ac Pass tid through to ptrace operations
This change is equivalent to the Linux threading support.

llvm-svn: 185671
2013-07-04 21:47:32 +00:00
Ed Maste be0b55d121 Avoid crash if we fail to resolve process in attach
llvm-svn: 185661
2013-07-04 18:25:34 +00:00
Daniel Malea 9a71a7d81b Revert commits that cause broken builds on GCC buildbots
- build fails due to PyCallable template definition inside an extern "C" scope

This commit reverts 185240, 184893 and 184608.

llvm-svn: 185560
2013-07-03 17:58:31 +00:00
Ed Maste 4331ac7bd3 Remove empty files left behind from move to POSIX/
llvm-svn: 185559
2013-07-03 17:41:40 +00:00
Michael Sartain bf43d1ad26 Symbol prologue code checks if funciton lines up with symbol and uses function prologue code with line info if so.
Differential Revision: http://llvm-reviews.chandlerc.com/D1082

llvm-svn: 185553
2013-07-03 16:35:41 +00:00
Ed Maste 1875776e68 Update error message; detach-keeps-stopped is also not on FreeBSD
llvm-svn: 185549
2013-07-03 16:26:34 +00:00