Commit Graph

4631 Commits

Author SHA1 Message Date
Michael Sartain 0b5e5f438d unused variable, typedef requires name warning cleanup
llvm-svn: 189231
2013-08-26 17:07:34 +00:00
Virgile Bello a4fe3a1259 PECOFF: Add support for export table.
llvm-svn: 189192
2013-08-25 13:27:20 +00:00
Virgile Bello 8452cb5486 Fix DWARF for 0-length CIE (data after the length should not be read if length is 0).
llvm-svn: 189191
2013-08-25 13:24:48 +00:00
Virgile Bello b2f1fb2943 MingW compilation (windows). Includes various refactoring to improve portability.
llvm-svn: 189107
2013-08-23 12:44:05 +00:00
Jason Molenda a609fe1576 Add link to Darwin iOS arm ABI docs in ABIMacOSX_arm.cpp.
llvm-svn: 189082
2013-08-23 01:31:25 +00:00
Sean Callanan ffc12850cf Make sure that ClangExpressionDeclMap doesn't
live beyont parsing.  This is important because
all the ClangASTImporter::Minions for a parser's
ASTContext are cleared when ClangExpressionDeclMap
is deleted.

This resolves many hard-to-reproduce crashes,
especially ones involving breakpoint conditions.

<rdar://problem/14775391>

llvm-svn: 189080
2013-08-23 00:36:14 +00:00
Jason Molenda 4a561c16f5 Fix ABIMacOSX_arm::RegisterIsVolatile() so it identifies r12 as a volatile reg.
llvm-svn: 189077
2013-08-22 23:53:14 +00:00
Jason Molenda 9f9c963e47 Simplify the CreateFunctionEntryUnwindPlan () and CreateDefaultUnwindPlan()
methods in the ABIs.  Specify the register numbering of the UnwindPlan
we're creating and use those only register numbers.

llvm-svn: 189074
2013-08-22 23:13:43 +00:00
Jason Molenda cbe9862305 Update ABISysV_x86_64::CallFrameAddressIsValid() to check for
16-byte alignment of stack frames.

llvm-svn: 189073
2013-08-22 22:51:48 +00:00
Michael Sartain f7899545ad Round plt entsize to addralign
llvm-svn: 189066
2013-08-22 21:25:53 +00:00
Michael Sartain 6e33ae64c4 add register name to UnwindLog error message
llvm-svn: 189062
2013-08-22 21:00:35 +00:00
Michael Sartain 093bf45f9c A clang::Type::Decayed type to kill compile warning
llvm-svn: 189061
2013-08-22 20:50:18 +00:00
Michael Sartain b1e159257c add error checking and messages to 'target modules show-unwind' command
llvm-svn: 189058
2013-08-22 20:42:30 +00:00
Andrew Kaylor 30787d1448 Fixing build errors from r188952
llvm-svn: 188955
2013-08-21 22:53:15 +00:00
Andrew Kaylor 53386dc836 Introducing a temporary work-around for a register mapping problem with 32-bit Linux targets.
llvm-svn: 188954
2013-08-21 22:46:02 +00:00
Andrew Kaylor a90d44061b Adding separate cfa alignment check for Darwin and non-Darwin targets in 32-bit ABI.
llvm-svn: 188952
2013-08-21 22:40:46 +00:00
Ed Maste a6b4c77123 Include checksum in non-ack mode
Patch from Abid, Hafiz.

llvm-svn: 188801
2013-08-20 14:12:58 +00:00
Ed Maste 0584d7fc34 Fix crash when connecting to gdbserver without loading a file first.
Patch from Abid, Hafiz.

llvm-svn: 188776
2013-08-20 09:17:13 +00:00
Richard Mitton f2bef0b15d Fixed DataExtractor to correctly display Intel extended doubles.
This means that "register read stmm0 --format f" actually works now.

This is a little messy but LLDB assumes 'long double' is portable, when it is not.

llvm-svn: 188698
2013-08-19 19:39:03 +00:00
Jason Molenda 5894a73862 Follow-up to the checkin of r188532 -- make sure that
we've read the ObjectFile's Symtab before we change the
File addresses in the Sections.

llvm-svn: 188604
2013-08-17 03:39:52 +00:00
Jason Molenda 20eb31b907 Add a new Section::SetFileAddress method to change a Section's file
address.

When loading a dSYM, and the file addresses of the dSYM Sections are
different than the executable binary Sections' file addresses, the
debug info won't be remapped to the actual load addresses correctly.
This only happens with binaries on the in-memory shared cache binaries
where their File addresses have been set to their actual load address
(outside an offset value) whereas the original executable and dSYM
have 0-based File addresses.

I think this patch will not be activated for other cases -- this is
the only case we know of where the dSYM and the executable's File
addresses differ -- but if this causes other problems we can restrict
it more carefully.

<rdar://problem/12335086> 

llvm-svn: 188532
2013-08-16 03:20:42 +00:00
Greg Clayton 86eac940b4 <rdar://problem/14717184>
Improve the documentation for the new target.memory-module-load-level setting, and also return an error when there is no nlist data when appropriate.

llvm-svn: 188317
2013-08-13 21:32:34 +00:00
Greg Clayton 540fbbfa7a When adding a dSYM file, don't remove all sections for the Module's object file if the symbol vendor used the same object file.
llvm-svn: 188289
2013-08-13 16:46:35 +00:00
Sean Callanan a424181eec Fixed a problem where "image lookup -t" was printing
a bunch of semicolons where the IndirectFieldDecls
were.  These IndirectFieldDecls should have been
implicit.

<rdar://problem/14628784>

llvm-svn: 188247
2013-08-13 01:42:34 +00:00
Greg Clayton fd814c5a64 <rdar://problem/14717184>
LLDB needs in memory module load level settings to control how much information is read from memory when loading in memory modules. This change adds a new setting:

(lldb) settings set target.memory-module-load-level [minimal|partial|complete]

minimal will load only sections (no symbols, or function bounds via function starts or EH frame)
partial will load sections + bounds
complete will load sections + bounds + symbols

llvm-svn: 188246
2013-08-13 01:42:25 +00:00
Greg Clayton 83b162d87f Change PowerPC to have the correct byte order.
llvm-svn: 188189
2013-08-12 18:34:04 +00:00
Greg Clayton 0ec71a0c01 Fixed a case where GCC was emitting a DW_TAG_class_type that has a DW_AT_declaration set to true, yet the class actually contains a definition for the class in that DIE.
llvm-svn: 188124
2013-08-10 00:09:35 +00:00
Matt Kopec f8cfe6b73a Handle SI_KERNEL signal code for SIGSEGV exceptions.
Patch by Richard Mitton.

llvm-svn: 188075
2013-08-09 15:26:56 +00:00
Sean Callanan 9ba6eaec57 Check for division by zero when performing modulus
operations.

<rdar://problem/14656908>

llvm-svn: 187996
2013-08-08 17:57:00 +00:00
Matt Kopec 9c2f9cdec0 Remove unreachable code when thread exits on Linux.
llvm-svn: 187995
2013-08-08 17:55:16 +00:00
Daniel Malea d79ae05080 New settings: target.use-hex-immediates and target.hex-immediates-style
- Immediates can be shown as hex (either Intel or MASM style)
- See TestSettings.py for usage examples
- Verified to cause no regressions on Linux x86_64 (Ubuntu 12.10)

Patch by Richard Mitton!

llvm-svn: 187921
2013-08-07 21:54:09 +00:00
Michael Sartain 89c862f298 clean up about 22 warnings messages
llvm-svn: 187900
2013-08-07 19:05:15 +00:00
Jason Molenda 3f032ff2c5 Test to see if logging is enabled before printing
to a log channel in StopInfoBreakpoint::PerformAction().
<rdar://problem/14651751> 

llvm-svn: 187833
2013-08-06 23:08:59 +00:00
Michael Sartain 6fea779c29 Initialize m_leak member variable.
llvm-svn: 187822
2013-08-06 22:21:08 +00:00
Daniel Malea fa7425d1af Fix bug in Host::getLLDBPath() due to misusing Twine
- use SmallString instead
- original implementation resulted in incorrect behaviour of lldb -P

Fix by Kal Conley!

llvm-svn: 187818
2013-08-06 21:40:08 +00:00
Jason Molenda 975abffee7 Re-enable fast stepping for arm targets. The issue being worked
around was fixed in llvm commit r186846.
<rdar://problem/14489274> 

llvm-svn: 187620
2013-08-01 21:50:20 +00:00
Michael Sartain c205243e8b Fix Linux Host::GetCurrentThreadID() to return real tid (not pthread_t).
This fixes threadname logging (--thread-name)
Add "-t" to TestLogging.py script to enable threadsafe and disable threadname logging

llvm-svn: 187599
2013-08-01 18:51:08 +00:00
Michael Sartain 9f822cd1ec Fix thread name updating in Linux. "thread list" should report correct names always now.
Created new LinuxThread class inherited from POSIXThread and removed linux / freebsd ifdefs
Removed several un-needed set thread name calls

CR (and multiple suggestions): mkopec

llvm-svn: 187545
2013-07-31 23:27:46 +00:00
Michael Sartain 98d599c2c0 Optimize Host::GetThreadName() to read from /proc/$TID per Matt's suggestion.
CR: mkopec
llvm-svn: 187542
2013-07-31 23:19:14 +00:00
Daniel Malea a012d3a68e Fix lock hierarchy violation in Process (lock ordering of ThreadList mutex and StackFrameList mutex)
- this fix ensures the ThreadList mutex is always locked before the StackFrameList mutex

Situation where deadlock could occur (without this fix):
Thread 1 is in Process::WillResume and locks the ThreadList mutex (on entry), and subsequently calls StackFrameList::Clear() which locks the StackFrameList mutex.
Meanwhile, thread 2 is in Process::RunThreadPlan and calls Thread::SetSelectedFrame() (which locks the StackFrameList mutex) before calling GetSelectedThread (which attempts to lock the ThreadList mutex)

In my testing on both Linux and Mac OS X, I was unable to reproduce any hangs with this patch applied.

llvm-svn: 187522
2013-07-31 20:21:20 +00:00
Ashok Thirumurthi 3e0afb87b2 Reverts r187449 (report_fatal_error) in favor of a log message since
the extra check introduces 22 new test failures with the LLDB clang buildbot.

Note that the unhandled DWARF_OP codes in DWARFExpression::Evaluate don't cause test failures if the check is ignored.

llvm-svn: 187480
2013-07-31 03:56:45 +00:00
Jim Ingham 56d404281f The DisassemblerLLVMC has a retain cycle - the InstructionLLVMC's contained in its instruction
list have a shared pointer back to their DisassemblerLLVMC.  This checkin force clears the InstructionList
in all the places we use the DisassemblerSP to stop the leaking for now.  I'll go back and fix this
for real when I have time to do so.

<rdar://problem/14581918>

llvm-svn: 187473
2013-07-31 02:19:15 +00:00
Daniel Malea 8f0c446ce2 Add a default case to the LLVM expression opcode switch statement
- better than failing silently next time the DWARF standard introduces new opcodes!

llvm-svn: 187449
2013-07-30 21:26:24 +00:00
Sean Callanan 4b388c9e16 Send a stop event when an expression stops at a breakpoint
in an expression and doesn't ignore the stop.

Patch by Jim Ingham.

<rdar://problem/14583884>

llvm-svn: 187434
2013-07-30 19:54:09 +00:00
Michael Sartain 0769b2b1f3 Add format specifiers to various format ids so we can print thread ids in decimal on Linux and FreeBSD.
CC: emaste

Differential Revision: http://llvm-reviews.chandlerc.com/D1234

llvm-svn: 187425
2013-07-30 16:44:36 +00:00
Ashok Thirumurthi a4658a5c86 Updates the DW_AT_data_member_location handlers for the LLDB DWARF plugin
to handle the case of an integer constant (DWARF 3 and later).

- Fixes tests that assert in RecordLayoutBuilder::updateExternalFieldOffset
because LLDB was providing an external AST source with missing member offsets.

llvm-svn: 187423
2013-07-30 14:58:39 +00:00
Ed Maste 5334ed2d25 Run-time reg context selection for POSIX targets
Instantiate RegisterContext... based on getOS() instead of with
compile-time #ifdef-ery.

The assert() here is unfortunate, but better than crashing with no
explanation.

This change is equivalent to r186865 for elf-core.

llvm-svn: 187422
2013-07-30 14:40:59 +00:00
Greg Clayton 6e10f149c4 <rdar://problem/14526890>
Fixed a crasher when using memory threads where a thread is sticking around too long and was causing problems when it didn't have a thread plan. 

llvm-svn: 187395
2013-07-30 00:23:06 +00:00
Ed Maste 64fad60e34 Use flag instead of rwlock state to track process running state
LLDB requires that the inferior process be stopped before, and remain
stopped during, certain accesses to process state.

Previously this was achieved with a POSIX rwlock which had a write lock
taken for the duration that the process was running, and released when
the process was stopped.  Any access to process state was performed with
a read lock held.

However, POSIX requires that pthread_rwlock_unlock() be called from the
same thread as pthread_rwlock_wrlock(), and lldb needs to stop and start
the process from different threads.  Violating this constraint is
technically undefined behaviour, although as it happens Linux and Darwin
result in the unlock proceeding in this case.  FreeBSD follows POSIX
more strictly, and the unlock would fail, resulting in a hang later upon
the next attempt to take the lock.

All read lock consumers use ReadTryLock() and handle failure to obtain
the lock (typically by logging an error "process is running").  Thus,
instead of using the lock state itself to track the running state, this
change adds an explicit m_running flag.  ReadTryLock tests the flag, and
if the process is not running it returns with the read lock held.

WriteLock and WriteTryLock are renamed to SetRunning and TrySetRunning,
and (if successful) they set m_running with the lock held.  This way,
read consumers can determine if the process is running and act
appropriately, and write consumers are still held off from starting the
process if read consumers are active.

Note that with this change there are still some curious access patterns,
such as calling WriteUnlock / SetStopped twice in a row, and there's no
protection from multiple threads trying to simultaneously start the
process.  In practice this does not seem to be a problem, and was
exposing other undefined POSIX behaviour prior to this change.

llvm-svn: 187377
2013-07-29 20:58:06 +00:00
Ashok Thirumurthi 6e264d39dc Adds a DW_OP_call_frame_cfa handler when evaluating DWARF 3/4 expressions
in LLDB that load the canonical frame address rather than a location list.

- Handles the simple case where a CFA can be pulled from the current stack frame.
- Fixes more than one hundred failing tests with gcc 4.8!

TODO: Use UnwindPlan::GetRowForFunctionOffset if the DWARFExpression needs
to be evaluated in a context analogous to a virtual unwind (perhaps using RegisterContextLLDB).

- Also adds some comments to DWARFCallFrameInfo whenever I got confused.

llvm-svn: 187361
2013-07-29 16:05:11 +00:00