Commit Graph

280 Commits

Author SHA1 Message Date
Greg Clayton 4eb82d9216 Get rid of using EXC_SOFT_SIGNAL define in host agnostic code.
llvm-svn: 109281
2010-07-23 22:50:09 +00:00
Sean Callanan 289e07b9d0 Added logging:
- When we JIT an expression, we print the disassembly
  of the generated code
- When we put the structure into the target, we print
  the individual entries in the structure byte for
  byte.

llvm-svn: 109278
2010-07-23 22:19:18 +00:00
Stephen Wilson ebb84b243b Fix a typo.
llvm-svn: 109271
2010-07-23 21:47:22 +00:00
Benjamin Kramer 5ea4192b72 Remove useless typedef keyword, fix a clang warning.
llvm-svn: 109254
2010-07-23 18:59:12 +00:00
Greg Clayton aaa58c6679 Added a new utility class that I have wanted for a while. The CleanUp
class is a templatized class that allows you to have a cleanup function called
on a data value of type T when the value is set or when the object goes
out of scope. It has support for very rudimentary invalid value detection that
can be enabled by using the appropriate constructor. 

Anyone with template experience that can see ways of improving this class
please let me know. The example code shows a few typical scenarios in which
I would like to use it. It is currently coded with simple type T values
in mind (integer file descriptors, pointers, etc), but I am sure some 
specialization might help out the class for more complex types.

There is a lot of documentation including examples in the CleanUp.h header 
file. 

llvm-svn: 109239
2010-07-23 17:42:15 +00:00
Greg Clayton 896dff661a Centralized the Mach exception stop info code by adding it as a first
class citizen on the StopInfo class. 

llvm-svn: 109235
2010-07-23 16:45:51 +00:00
Greg Clayton 572404311a Remove a deadlock condition. A bit of explanation is needed: When calling
ThreadCancel in Host::WillTerminate g_monitor_thread may be blocked on a call
to pthread_cond_wait (for example, line 640).  Now, by default, when a 
cancellation request is serviced g_monitor_thread will again own the mutex
guarding the condition variable it was waiting on.  This causes the call to 
SetValue in Host::WillTerminate to hit a deadlock.

The call to SetValue does not appear to be needed, so removing it solves
the issue.

Patch from Stephen Wilson.

llvm-svn: 109228
2010-07-23 15:47:19 +00:00
Greg Clayton 26661bca20 Remove a premature invalidation of a threads pthread_t handle, thus avoiding
a segfault when calling pthread_cancel.  Also, sets m_read_thread_enabled if
the thread is actually spawned.

Patch from Stephen Wilson.

llvm-svn: 109227
2010-07-23 15:43:25 +00:00
Greg Clayton 19503a2a78 Warnings cleanup patch from Jean-Daniel Dupas.
llvm-svn: 109226
2010-07-23 15:37:46 +00:00
Greg Clayton 5b9a1ea9c6 Added Mach exception stop descriptions. The chunk of code I just added needs to be placed into a utility location so it can be used by ProcessMacOSX and debugserver.
llvm-svn: 109214
2010-07-23 03:40:38 +00:00
Sean Callanan 6dde30e964 Added extensive logging of the code that is actually going
to be executed by the inferior.  This required explicit support
from RecordingMemoryManager for finding the address range
belonging to a particular function.

Also fixed a bug in DisassemblerLLVM where the disassembler
assumed there was an AddressRange available even when it was
NULL.

llvm-svn: 109209
2010-07-23 02:19:15 +00:00
Sean Callanan 88f0e04e6f Whoops, fixed the LLVM_CONFIGURATION.
llvm-svn: 109200
2010-07-23 00:16:53 +00:00
Sean Callanan ebf7707e53 Modified TaggedASTType to inherit from ClangASTType
and moved it to its own header file for cleanliness.

Added more logging to ClangFunction so that we can
diagnose crashes in the executing expression.

Added code to extract the result of the expression
from the struct that is passed to the JIT-compiled
code.

llvm-svn: 109199
2010-07-23 00:16:21 +00:00
Greg Clayton 49182ed65a This patch changes the point at which Process::m_private_state_thread is
invalidated.  There was a race condition where the private thread would
invalidate its own pthread_t object before the parent could perform a
pthread_cancel/pthread_join sequence.

Patch from Stephen Wilson.

llvm-svn: 109131
2010-07-22 18:34:21 +00:00
Greg Clayton 8cf0593c87 Added a new enumeration named "ClangASTContext::AccessType" that abstracts the type creation from the various access enumerations in Clang. Currently there are clang::AccessSpecifier and the objective C ivars have their own enumeration. So I added a new enumeration that will allow a consistent interface when creating types through ClangASTContext.
I also added new functions to create an Objective C class, ivar and set an objective C superclass. They aren't hooked up in the DWARF parser yet. That is the next step, though I am unsure if I will do this in the DWARF parser or try and do it generically in the existing Record manipulation functions.

llvm-svn: 109130
2010-07-22 18:30:50 +00:00
Greg Clayton 4ceb9980c8 Modified both the ObjectFileMachO and ObjectFileELF to correctly set the
SectionType for Section objects for DWARF.

Modified the DWARF plug-in to get the DWARF sections by SectionType so we
can safely abstract the LLDB core from section names for the various object
file formats.

Modified the SectionType definitions for .debug_pubnames and .debug_pubtypes
to use the correct case.

llvm-svn: 109054
2010-07-21 22:54:26 +00:00
Greg Clayton e1a916a74d Change over to using the definitions for mach-o types and defines to the
defines that are in "llvm/Support/MachO.h". This should allow ObjectFileMachO
and ObjectContainerUniversalMachO to be able to be cross compiled in Linux.

Also did some cleanup on the ASTType by renaming it to ClangASTType and
renaming the header file. Moved a lot of "AST * + opaque clang type *"
functionality from lldb_private::Type over into ClangASTType.

llvm-svn: 109046
2010-07-21 22:12:05 +00:00
Greg Clayton 8c920840a4 Add new SectionType enumerations for all DWARF sections. ObjectFile parsers should start properly setting the section types for DWARF sections, then we can move the DWARF SymbolFile parser over to finding the sections by the appropriate SectionType.
llvm-svn: 109041
2010-07-21 21:51:36 +00:00
Greg Clayton 70e33eb06e Allow searching for a section by SectionType.
llvm-svn: 109040
2010-07-21 21:49:46 +00:00
Greg Clayton d1daf00b28 Updated LLVM and Clang to July 20 at 16:00.
llvm-svn: 109016
2010-07-21 16:57:26 +00:00
Greg Clayton a0e7f0c1b1 Avoid std::bitset<64>::to_string() since it is missing in earlier C++
libraries (from William Lynch).

llvm-svn: 108976
2010-07-21 01:08:41 +00:00
Sean Callanan b3706e6dd2 Whoops, forgot to guard ASTType.h. Fixed.
llvm-svn: 108970
2010-07-20 23:53:01 +00:00
Sean Callanan 1d18066411 Added functionality to dematerialize values that were
used by the JIT compiled expression, including the
result of the expression.

Also added a new class, ASTType, which encapsulates an
opaque Clang type and its associated AST context.

Refactored ClangExpressionDeclMap to use ASTTypes,
significantly reducing the possibility of mixups of
types from different AST contexts.

llvm-svn: 108965
2010-07-20 23:31:16 +00:00
Greg Clayton ede0585ec2 Fixing a crashing bug in multiword commands from William Lynch.
llvm-svn: 108958
2010-07-20 22:54:09 +00:00
Greg Clayton 471b31ce62 Remove use of STL collection class use of the "data()" method since it isn't
part of C++'98. Most of these were "std::vector<T>::data()" and 
"std::string::data()".

llvm-svn: 108957
2010-07-20 22:52:08 +00:00
Stephen Wilson 4ab47682bb Fix assertion conditions.
llvm-svn: 108879
2010-07-20 18:41:11 +00:00
Stephen Wilson 645767aeca Add missing include.
llvm-svn: 108878
2010-07-20 18:40:23 +00:00
Greg Clayton 044672b076 Logic fix to properly determine when a symbol is not from the current
symbol table (from William Lynch).

llvm-svn: 108871
2010-07-20 18:30:17 +00:00
Benjamin Kramer 40e155dfc2 More constructor warning fixes from William Lynch.
llvm-svn: 108840
2010-07-20 14:37:45 +00:00
Stephen Wilson 50bd94f961 Have Process::CreateBreakpointSite return a break_id_t instead of a user_id_t.
Also, update BreakpointLocation::ResolveBreakpointSite to check for invalid
breakpoint ID's using the proper magic constant.

llvm-svn: 108598
2010-07-17 00:56:13 +00:00
Sean Callanan 6b4067c14e Added the necessary code to copy variables used by
an expression into the struct prepared for the JIT
compiled code to use.

llvm-svn: 108596
2010-07-17 00:43:37 +00:00
Jim Ingham 6185accf3b Patch from Mattias to specify the system sed on Mac OS X.
llvm-svn: 108580
2010-07-17 00:25:08 +00:00
Greg Clayton ea3b0ae8ed Fixed a copyright header.
llvm-svn: 108544
2010-07-16 18:28:27 +00:00
Benjamin Kramer 1ee0d4f7f3 Fix constructor initialization order. Patch by Bill Lynch.
llvm-svn: 108524
2010-07-16 12:32:33 +00:00
Sean Callanan ea22d4288a Wrote the code that looks at a context to see
if the variables in that context allow a particular
JIT compiled expression to run in that context.

llvm-svn: 108485
2010-07-16 00:09:46 +00:00
Sean Callanan 23a3027a67 Oops, didn't define AreTypesSame correctly.
llvm-svn: 108483
2010-07-16 00:00:27 +00:00
Sean Callanan 4dcca262f4 Added a function to test whether two types are
the same.

llvm-svn: 108467
2010-07-15 22:30:52 +00:00
Sean Callanan 7618f4ebaf Fixes to the IR generator in the expression parser
to correctly unfold constant-folded global variables.
Also added code to JIT the expression.  Simple 
expressions are now JIT compiled successfully.

llvm-svn: 108380
2010-07-14 23:40:29 +00:00
Jim Ingham a3241c1bf5 Don't call PrepareForResume on threads that aren't going to get a chance to run this time around.
llvm-svn: 108312
2010-07-14 02:27:20 +00:00
Jim Ingham 9d790c5d12 Stepping through a trampoline should do "stop others" unless All Threads is requested.
llvm-svn: 108311
2010-07-14 02:25:06 +00:00
Greg Clayton ec00f12a22 Fixed Xcode project to deal with recent ELF plug-in changes.
llvm-svn: 108300
2010-07-14 00:20:31 +00:00
Greg Clayton b132097b45 I enabled some extra warnings for hidden local variables and for hidden
virtual functions and caught some things and did some general code cleanup.

llvm-svn: 108299
2010-07-14 00:18:15 +00:00
Stephen Wilson 11e8f3ba37 Remove our local ELF definitions and rely on llvm/Support/ELF.h instead.
llvm-svn: 108293
2010-07-13 23:09:42 +00:00
Stephen Wilson f325ba9d45 Combine 32 and 64 bit ELF readers.
This patch provides a generic ELF reader plugin to handle both 32 and 64 bit
formats.

llvm-svn: 108292
2010-07-13 23:07:23 +00:00
Greg Clayton b6f75dfd96 Removed unused variable "log".
Fixed the llvm build for Mac OS X builds to look in llvm/lib/Release+Asserts 
output directory for all configurations (Debug, Release, BuildAndIntegration).

llvm-svn: 108289
2010-07-13 22:26:45 +00:00
Greg Clayton f6cc9dde46 Updated to latest llvm from July 13th, 2010 at 13:00.
llvm-svn: 108285
2010-07-13 22:06:06 +00:00
Sean Callanan 549c9f7f9a "expr -i" now performs the required transforms to
prepare the IR for JIT compilation.  We still need
to do the JIT compilation and move the arguments
in/out of target memory.

llvm-svn: 108279
2010-07-13 21:41:46 +00:00
Greg Clayton d764ecc0de Removed Xcode project files that aren't needed right now.
llvm-svn: 108271
2010-07-13 20:57:41 +00:00
Greg Clayton c8e11e17aa Patch from Jean-Daniel Dupas:
Makefile patch to explicitly use PROJ_SRC_DIR when required. It fixes 
        build when obj dir is not source dir. 

I also fixed a build warning in ClangResultSynthesizer.cpp.

llvm-svn: 108210
2010-07-12 23:14:00 +00:00
Greg Clayton 0428b7dcc8 Don't build the SymbolVendor/MacOSX when not building on Darwin.
llvm-svn: 108208
2010-07-12 23:11:00 +00:00