Commit Graph

112803 Commits

Author SHA1 Message Date
Sean Callanan 3bfdaa2a47 This patch modifies the expression parser to allow it
to execute expressions even in the absence of a process.
This allows expressions to run in situations where the
target cannot run -- e.g., to perform calculations based
on type information, or to inspect a binary's static
data.

This modification touches the following files:

lldb-private-enumerations.h
  Introduce a new enum specifying the policy for
  processing an expression.  Some expressions should
  always be JITted, for example if they are functions
  that will be used over and over again.  Some
  expressions should always be interpreted, for
  example if the target is unsafe to run.  For most,
  it is acceptable to JIT them, but interpretation
  is preferable when possible.

Target.[h,cpp]
  Have EvaluateExpression now accept the new enum.

ClangExpressionDeclMap.[cpp,h]
  Add support for the IR interpreter and also make
  the ClangExpressionDeclMap more robust in the 
  absence of a process.

ClangFunction.[cpp,h]
  Add support for the new enum.

IRInterpreter.[cpp,h]
  New implementation.

ClangUserExpression.[cpp,h]
  Add support for the new enum, and for running 
  expressions in the absence of a process.

ClangExpression.h
  Remove references to the old DWARF-based method
  of evaluating expressions, because it has been
  superseded for now.

ClangUtilityFunction.[cpp,h]
  Add support for the new enum.

ClangExpressionParser.[cpp,h]
  Add support for the new enum, remove references
  to DWARF, and add support for checking whether
  the expression could be evaluated statically.

IRForTarget.[h,cpp]
  Add support for the new enum, and add utility
  functions to support the interpreter.

IRToDWARF.cpp
  Removed

CommandObjectExpression.cpp
  Remove references to the obsolete -i option.

Process.cpp 
  Modify calls to ClangUserExpression::Evaluate
  to pass the correct enum (for dlopen/dlclose)

SBValue.cpp
  Add support for the new enum.

SBFrame.cpp
  Add support for he new enum.

BreakpointOptions.cpp
  Add support for the new enum.

llvm-svn: 139772
2011-09-15 02:13:07 +00:00
Benjamin Kramer 5acab501de DWARF: Add basic support for line tables.
The llvm-dwarfdump output isn't very verbose yet.

llvm-svn: 139771
2011-09-15 02:12:05 +00:00
John McCall 3b201b7d5f Sorry, that assertion actually already exists.
llvm-svn: 139770
2011-09-15 01:55:23 +00:00
John McCall 8f8f8d67ea We don't generate null initializer expressions anymore, and
we don't need to.

llvm-svn: 139769
2011-09-15 01:54:21 +00:00
Eli Friedman 888bea0b95 Make demanded-elt simplification for shufflevector slightly stronger. Spotted by inspection.
llvm-svn: 139768
2011-09-15 01:14:29 +00:00
Johnny Chen 88c1b77f74 Modify MachThread::NotifyException() to allow the arch specific protocol to process
the passed in (MachException::Data &)exc first before possible reassignment of the
member m_stop_exception with exc.  This allows lldb to stop at the watchpoint of
a simple test program.

llvm-svn: 139767
2011-09-15 01:12:15 +00:00
Jim Ingham 4299fdb1a3 Take out all the separate places in Attach where we were getting the target architecture, and move that but of functionality into CompleteAttach.
llvm-svn: 139766
2011-09-15 01:10:17 +00:00
Andrew Trick 76a86d3d4c [regcoalescing] bug fix for RegistersDefinedFromSameValue.
An improper SlotIndex->VNInfo lookup was leading to unsafe copy removal.
Fixes PR10920 401.bzip2 miscompile with no IV rewrite.

llvm-svn: 139765
2011-09-15 01:09:33 +00:00
Jim Ingham 31412642a6 Change the "attach" command to always wait synchronously for the target to stop. It's not very useful to return the prompt in mid-attach, and it makes reporting the result of the attach hard to do.
llvm-svn: 139764
2011-09-15 01:08:57 +00:00
Anna Zaks 3a769bd996 [analyzer] Refactor: make PathDiagnosticLocation responsible for validation of SourceLocations (commit 2 of ?):
- Modify all PathDiagnosticLocation constructors that take Stmt to also requre LocationContext.
- Add a constructor which should be used in case there is no valid statement/location (it will grab the location of the enclosing function).

llvm-svn: 139763
2011-09-15 01:08:34 +00:00
Jim Ingham 4d9695a2b6 Fix ArchSpec::operator== to take the Triple into account as well as the Core. Also make the constructors explicit.
llvm-svn: 139762
2011-09-15 01:07:30 +00:00
Jim Ingham e76b036ebf Fix ArchSpec::operator== to take the Triple into account as well as the Core. Also make the constructors explicit.
llvm-svn: 139761
2011-09-15 01:07:28 +00:00
Jason Molenda 995cd3a514 Have the FuncUnwinder object request & provide an architecture-defined
UnwindPlan for unwinding from the first instruction of an otherwise
unknown function call (GetUnwindPlanArchitectureDefaultAtFunctionEntry()).

Update RegisterContextLLDB::GetFullUnwindPlanForFrame() to detect the
case of a frame 0 at address 0x0 which indicates that we jumped through
a NULL function pointer.  Use the ABI's FunctionEntryUnwindPlan to
find the caller frame.

These changes make it so lldb can identify the calling frame correctly
in code like

int main ()
{
  void (*f)(void) = 0;
  f();
}

llvm-svn: 139760
2011-09-15 00:44:34 +00:00
Greg Clayton e1dadb831a Set the OS in the triple correctly in response to the qHostInfo packet.
llvm-svn: 139759
2011-09-15 00:21:03 +00:00
Eli Friedman da5f010177 Fix the code creating VZEXT_LOAD so that it creates the right memoperand. Issue spotted in -debug output. I can't think of any practical effects at the moment, but it might matter if we start doing more aggressive alias analysis in CodeGen.
llvm-svn: 139758
2011-09-14 23:42:45 +00:00
Jim Grosbach 16680e1d33 Thumb2 assembly parsing and encoding for PLI.
llvm-svn: 139757
2011-09-14 23:29:05 +00:00
Jim Grosbach 2e2f6db24b Thumb2 assembly parsing and encoding for PLD.
llvm-svn: 139756
2011-09-14 23:26:12 +00:00
Douglas Gregor 8b74454619 Update the comment for system_temp_directory() to indicate when it
will ignore the erasedOnReboot option, and properly escape the
backslash in "C:\TEMP". Thanks to Aaron and Francois.

llvm-svn: 139755
2011-09-14 23:21:47 +00:00
Jim Grosbach 801e06b768 Thumb2 assembly parsing and encoding for PKH.
llvm-svn: 139754
2011-09-14 23:16:41 +00:00
Jim Grosbach 521526845c ARMv7a has the PKH instructions.
llvm-svn: 139753
2011-09-14 23:16:34 +00:00
Devang Patel ecaf9ac0bb Emit debug info for c++0x nullptr.
llvm-svn: 139752
2011-09-14 23:14:14 +00:00
Devang Patel 04d6d47865 Add support to emit debug info for C++0x nullptr type.
llvm-svn: 139751
2011-09-14 23:13:28 +00:00
Douglas Gregor 21931efc4d Make -E work with module imports
llvm-svn: 139750
2011-09-14 23:13:09 +00:00
Jim Grosbach 25ca53b268 ARM tighten up the register classes for the PKH instructions.
llvm-svn: 139748
2011-09-14 22:52:14 +00:00
Owen Anderson d7791b961c Fix a crasher in Thumb2 MOV-immediate encoding for certain inputs.
llvm-svn: 139747
2011-09-14 22:46:14 +00:00
Johnny Chen 45e541f0ed Fix a bug where re-use of the same existing target-wise watchpoint did not work correctly.
llvm-svn: 139746
2011-09-14 22:20:15 +00:00
Douglas Gregor d7910e95bd Don't try to write a macro offset for an identifier that names a non-exported macro, for real this time
llvm-svn: 139745
2011-09-14 22:14:14 +00:00
Bill Wendling bdaa57fe6d Include limits.h to make sure PATH_MAX is known on Solaris 10.
Patch by Joakim Johansson!

llvm-svn: 139743
2011-09-14 21:49:42 +00:00
Jim Grosbach 61326e08ec Thumb2 assembly parsing and encoding for ORR.
llvm-svn: 139742
2011-09-14 21:43:57 +00:00
Jim Grosbach 1fdddf767f Thumb2 assembly parsing and encoding for ORN.
llvm-svn: 139741
2011-09-14 21:29:54 +00:00
Jim Grosbach 36acc8e984 Thumb2 assembly parsing and encoding for NOP.W.
llvm-svn: 139740
2011-09-14 21:26:25 +00:00
Jim Grosbach 752d6fd529 Thumb2 assembly parsing and encoding for MVN.
llvm-svn: 139739
2011-09-14 21:24:41 +00:00
Daniel Dunbar 2682897e11 platform/clang_darwin: Allow use of an RC_SUPPORTED_ARCHS variable to limit the
architectures we try to build for.

llvm-svn: 139738
2011-09-14 21:19:45 +00:00
Owen Anderson f1e384421a Nested IT blocks are UNPREDICTABLE. Mark them as such when disassembling them.
llvm-svn: 139736
2011-09-14 21:06:21 +00:00
Jim Grosbach 9c8b9932d6 Thumb2 assembly parsing and encoding for MUL.
llvm-svn: 139735
2011-09-14 21:00:40 +00:00
Douglas Gregor 4fe9b18182 Revert my exported-macro hackery. Something is amiss
llvm-svn: 139734
2011-09-14 20:57:14 +00:00
Caitlin Sadowski dcd60104c6 Thread safety: small fixes in comments
llvm-svn: 139733
2011-09-14 20:54:57 +00:00
Benjamin Kramer 3266493603 DWARF: Generate the address lookup table from the DIE tree if .debug_aranges is not available.
Ported from LLDB.

llvm-svn: 139732
2011-09-14 20:52:27 +00:00
Douglas Gregor d48ed128e0 Make sure that we actually keep the key length and data length in sync when dealing with non-exported macros
llvm-svn: 139731
2011-09-14 20:51:12 +00:00
Douglas Gregor af3ccaf22c Disable this test on win32. My "sleep 2" trick didn't seem to work
llvm-svn: 139729
2011-09-14 20:38:11 +00:00
Douglas Gregor 4184ab0b26 Don't try to write a macro offset for an identifier that names a non-exported macro
llvm-svn: 139728
2011-09-14 20:36:30 +00:00
Douglas Gregor e162dd46f6 Add test for the driver's handling of modules
llvm-svn: 139727
2011-09-14 20:29:10 +00:00
Douglas Gregor f936f782f5 Teach the driver to always pass down a module cache path. If none is
supplied, use something derived from the system's temporary
directory. Depends on LLVM r139725.

llvm-svn: 139726
2011-09-14 20:28:46 +00:00
Douglas Gregor 123dc70c50 Add a simple routine to determine the typical system directory for
temporary data. 

llvm-svn: 139725
2011-09-14 20:27:01 +00:00
Johnny Chen 0c40637012 Add logging to Target::CreateWatchpointLocation() and fix some bug of using the wrong variable.
Plus simplify WatchpointLocation::Dump() output.

llvm-svn: 139724
2011-09-14 20:23:45 +00:00
Caitlin Sadowski e50d8c3415 Thread safety: reverting to use separate warning for requirement to hold any lock
llvm-svn: 139723
2011-09-14 20:09:09 +00:00
Caitlin Sadowski 5b34a2fd6e Thread safety: adding additional documentation to the main thread safety interface, and making the destructor for the thread safety handler pure virtual
llvm-svn: 139722
2011-09-14 20:05:09 +00:00
Jim Grosbach 0ecd395095 Thumb2 assembly parsing and encoding for MSR/MRS.
Fix a bug in handling default flags for both ARM and Thumb encodings.

llvm-svn: 139721
2011-09-14 20:03:46 +00:00
Caitlin Sadowski 787c2a1b09 Thread safety: adding test cases for unparseable lock expressions and expanding the handling of these expressions
llvm-svn: 139720
2011-09-14 20:00:24 +00:00
Kaelyn Uhrain 7fbe2f78d7 Plug an abstraction leak and fix a crasher in DiagnoseInvalidRedeclaration
llvm-svn: 139718
2011-09-14 19:37:32 +00:00