summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target
Commit message (Collapse)AuthorAgeFilesLines
...
* Change over the broadcaster/listener process to hold shared or weak pointersJim Ingham2016-03-075-71/+75
| | | | | | | | | | | | | | to each other. This should remove some infrequent teardown crashes when the listener is not the debugger's listener. Processes now need to take a ListenerSP, not a Listener&. This required changing over the Process plugin class constructors to take a ListenerSP, instead of a Listener&. Other than that there should be no functional change. <rdar://problem/24580184> CrashTracer: [USER] Xcode at …ework: lldb_private::Listener::BroadcasterWillDestruct + 39 llvm-svn: 262863
* Add reverse file remapping for breakpoint setTamas Berghammer2016-03-042-3/+31
| | | | | | | | | | | | | | LLDB can remap a source file to a new directory based on the "target.sorce-map" to handle the usecase when the source code moved between the compliation and the debugging. Previously the remapping was only used to display the content of the file. This CL fixes the scenario when a breakpoint is set based on the new an absolute path with adding an inverse remapping step before looking up the breakpoint location. Differential revision: http://reviews.llvm.org/D17848 llvm-svn: 262711
* Fix MSVC build failure in source/Target/Process.cpp.Eugene Zelenko2016-03-011-1/+1
| | | | | | Will be good idea to introduce macro/constexpr for NULL thread_result_t. llvm-svn: 262287
* Fix Clang-tidy modernize-use-nullptr warnings in some files in ↵Eugene Zelenko2016-03-011-194/+182
| | | | | | source/Target/Process.cpp; other minor fixes. llvm-svn: 262281
* Make LLDB safer to use with respect to the global destructor chain.Greg Clayton2016-02-263-12/+15
| | | | llvm-svn: 262090
* Make sure to #include <atomic> for the std::atomic<bool> that was recently ↵Greg Clayton2016-02-261-0/+1
| | | | | | added. llvm-svn: 262055
* Make sure the Target, Process and Thread GetGlobalProperties() static ↵Greg Clayton2016-02-263-8/+18
| | | | | | | | methods are thread safe. <rdar://problem/22595283> llvm-svn: 262053
* The IOHandlerProcessSTDIO is the _only_ IOHandler that gets pushed and ↵Greg Clayton2016-02-261-3/+22
| | | | | | | | | | | | | | popped from functions that are run due to something that is NOT input from the user. All other IOHandler objects result from input from the user. An issue rose up where if a command caused the process to resume and stop and process state changed, where state changed Event objects were broadcast, it would cause the IOHandlerProcessSTDIO to have its IOHandlerProcessSTDIO::Cancel() function called. This used to always write a byte to the control pipe (IOHandlerProcessSTDIO::m_pipe) even if the IOHandlerProcessSTDIO::Run() was never called. What would happen is: (lldb) command_that_steps_process_thousands_of_times As the "command_that_steps_process_thousands_of_times" could be a python command that resumed the process thousands of times and in doing so the IOHandlerProcessSTDIO would get pushed when the process resumed, and popped when it stoppped, causing the call to IOHandlerProcessSTDIO::Cancel(). Since the IOHandler thread is currently in IOHandlerEditline::Run() for the command interpreter handling the "command_that_steps_process_thousands_of_times" command, IOHandlerProcessSTDIO::Run() would never get called, even though the IOHandlerProcessSTDIO is on the top of the stack. This caused the command pipe to keep getting 1 bytes written each time the IOHandlerProcessSTDIO::Cancel() was called and eventually we will deadlock since the write buffer is full. The fix here is to make sure we are in IOHandlerProcessSTDIO::Run() before we write anything to the command pipe, and just call SetIsDone(true) if we are not. <rdar://problem/22361364> llvm-svn: 262040
* Add mips32 software breakpoints into ↵Aidan Dodds2016-02-261-0/+2
| | | | | | | | | | platform::GetSoftwareBreakpointTrapOpcode(). The software breakpoint definitions for mips32 should have been included in my recent patch that moved the software breakpoint definitions into the base platform class. llvm-svn: 262021
* Add support for DW_OP_push_object_address in dwarf expressionsTamas Berghammer2016-02-261-2/+9
| | | | | | | | | Additionally fix the type of some dwarf expression where we had a confusion between scalar and load address types after a dereference. Differential revision: http://reviews.llvm.org/D17604 llvm-svn: 262014
* Fix all of the unannotated switch cases to annotate the fall through or do ↵Greg Clayton2016-02-261-0/+1
| | | | | | the right thing and break. llvm-svn: 261950
* Handle the case when a variable is only valid in part of the enclosing scopeTamas Berghammer2016-02-251-1/+6
| | | | | | | | | | | DWARF stores this information in the DW_AT_start_scope attribute. This CL add support for this attribute and also changes the functions displaying frame variables to only display the variables currently in scope. Differential revision: http://reviews.llvm.org/D17449 llvm-svn: 261858
* Refactor GetSoftwareBreakpointTrapOpcodeAidan Dodds2016-02-221-0/+103
| | | | | | | | This patch aims to reduce the code duplication among all of the platforms in GetSoftwareBreakpointTrapOpcode by pushing all common code into the Platform base class. Differential Revision: http://reviews.llvm.org/D17395 llvm-svn: 261536
* This patch stops lldb from loading a .lldbinit file from the currentJason Molenda2016-02-191-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | working directory by default -- a typical security problem that we need to be more conservative about. It adds a new target setting, target.load-cwd-lldbinit which may be true (always read $cwd/.lldbinit), false (never read $cwd/.lldbinit) or warn (warn if there is a $cwd/.lldbinit and don't read it). The default is set to warn. If this is met with unhappiness, we can look at changing the default to true (to match current behavior) on a different platform. This does not affect reading of ~/.lldbinit - that will still be read, as before. If you run lldb in your home directory, it will not warn about the presence of a .lldbinit file there. I had to add two SB API - SBHostOS::GetUserHomeDirectory and SBFileSpec::AppendPathComponent - for the lldb driver code to be able to get the home directory path in an OS neutral manner. The warning text is There is a .lldbinit file in the current directory which is not being read. To silence this warning without sourcing in the local .lldbinit, add the following to the lldbinit file in your home directory: settings set target.load-cwd-lldbinit false To allow lldb to source .lldbinit files in the current working directory, set the value of this variable to true. Only do so if you understand and accept the security risk. <rdar://problem/24199163> llvm-svn: 261280
* Fix Clang-tidy modernize-use-nullptr warnings in some files in ↵Eugene Zelenko2016-02-189-200/+155
| | | | | | source/Target; other minor fixes. llvm-svn: 261242
* Fix Clang-tidy modernize-use-nullptr warnings; other minor fixes.Eugene Zelenko2016-02-1811-253/+170
| | | | llvm-svn: 261179
* Add -Wimplicit-fallthrough command line option to clang inJason Molenda2016-02-162-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | the xcode project file to catch switch statements that have a case that falls through unintentionally. Define LLVM_FALLTHROUGH to indicate instances where a case has code and intends to fall through. This should be in llvm/Support/Compiler.h; Peter Collingbourne originally checked in there (r237766), then reverted (r237941) because he didn't have time to mark up all the 'case' statements that were intended to fall through. I put together a patch to get this back in llvm http://reviews.llvm.org/D17063 but it hasn't been approved in the past week. I added a new lldb-private-defines.h to hold the definition for now. Every place in lldb where there is a comment that the fall-through is intentional, I added LLVM_FALLTHROUGH to silence the warning. I haven't tried to identify whether the fallthrough is a bug or not in the other places. I haven't tried to add this to the cmake option build flags. This warning will only work for clang. This build cleanly (with some new warnings) on macosx with clang under xcodebuild, but if this causes problems for people on other configurations, I'll back it out. llvm-svn: 260930
* Objective-C++ is a kind of C++.Sean Callanan2016-02-121-0/+1
| | | | llvm-svn: 260715
* Make Target::CalculateProcess() return a sensible result.Sean Callanan2016-02-121-1/+1
| | | | | | | | The Calculate* functions in general should not derive any information that isn't implicit, but for Target the process pointer is a member so it's fine to return it for CalculateProcess(). llvm-svn: 260713
* Now that SymbolFileDWARF supports having types in completely separate .pcm ↵Greg Clayton2016-02-101-1/+4
| | | | | | | | | | | | | | file with "-fmodules -gmodules", each SymbolFileDWARF can reference module DWARF info by looking in other DWARF files. Then if you have 1000 .o files that each reference one or more .pcm files in their debug info, a simple Module::FindTypes(...) call can end up searching the same .pcm file over and over and over. Now all internal FindTypes methods in classes (ModuleList, Module, SymbolFile) now take an extra argument: llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files Each time a SymbolFile::FindTypes() is called, it needs to check the searched_symbol_files list to make sure it hasn't already been asked to find the type and return immediately if it has been checked. This will stop circular dependencies from also crashing LLDB during type queries. This has proven to be an issue when debugging large applications on MacOSX that use DWARF in .o files. <rdar://problem/24581488> llvm-svn: 260434
* Per Jim's suggestion, move checks that we're not mixing and matching ↵Enrico Granata2016-02-061-1/+0
| | | | | | | | Debuggers and Commands deeper in the bowels of LLDB NFC llvm-svn: 259972
* Fix an issue where certain CommandObjects (or Options thereof) were being ↵Enrico Granata2016-02-061-0/+4
| | | | | | | | | | created once, bound to a specific CommandInterpreter (and hence a specific Debugger), and then cached for reuse across different Debugger instances Obviously, if the original Debugger goes away, those commands are holding on to now stale memory, which has the potential to cause crashes Fixes rdar://24460882 llvm-svn: 259964
* Fix a little threading thinko in StartPrivateStateThread - don't pass stack ↵Jim Ingham2016-02-041-4/+5
| | | | | | | | | | variables as args to a pthread_create function... <rdar://problem/24485206> llvm-svn: 259738
* Remove a stray ;.Jim Ingham2016-02-031-1/+0
| | | | llvm-svn: 259685
* The SetStopInfo from a Mach Exception was setting the stopJim Ingham2016-02-031-1/+2
| | | | | | | | | | reason to None when we stop due to a trace, then noticed that we were on a breakpoint that was not valid for the current thread. That should actually have set it back to trace. This was pr26441 (<rdar://problem/24470203>) llvm-svn: 259684
* Fix a thinko in StackFrame::GetInScopeVariableList.Siva Chandra2016-02-021-1/+1
| | | | | | | | | | Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D16745 llvm-svn: 259607
* Fixed a couple of places where we were getting the module from aJim Ingham2016-01-291-4/+16
| | | | | | | section and using it w/o checking that it was valid. This can cause crashes - usually when tearing down a target. llvm-svn: 259237
* Remove autoconf support from source directories.Eugene Zelenko2016-01-281-14/+0
| | | | | | Differential revision: http://reviews.llvm.org/D16662 llvm-svn: 259098
* [LLDB][MIPS] A small fix in GetBreakableLoadAddress() for MIPSBhushan D. Attarde2016-01-271-9/+9
| | | | | | | | | | | | | SUMMARY: Get the load address for the address given by symbol and function. Earlier, this was done for function only, this patch does it for symbol too. This patch also adds TestAvoidBreakpointInDelaySlot.py to test this change. Reviewers: clayborg Subscribers: labath, zturner, mohit.bhakkad, sagar, jaydeep, lldb-commits Differential Revision: http://reviews.llvm.org/D16049 llvm-svn: 258919
* Revert r258546.Saleem Abdulrasool2016-01-261-1/+0
| | | | | | | | | Seems that the patch was rebased on top of another change which obsoleted the change but wasnt caught. Thanks to nbjoerg for pointing this out! llvm-svn: 258821
* Target: fix -Wcast-qual warningSaleem Abdulrasool2016-01-221-1/+1
| | | | | | | We were unnecessarily stripping the const qualifier on the temporary variable. Restore the constness to avoid the warning. NFC. llvm-svn: 258547
* Silence -Wreturn-type warningsSaleem Abdulrasool2016-01-221-0/+1
| | | | | | | | Address a couple of instances of -Wreturn-type warning from GCC. The switches are covered, add an llvm_unreachable to the end of the functions to silence the warning. NFC. llvm-svn: 258546
* Placate MVSC after my last commit.Davide Italiano2016-01-191-6/+2
| | | | | | | | Zachary introduced the 'default' case explicitly to placate a warning in the Microsoft compiler but that broke clang with -Werror. The new code should keep both compilers happy. llvm-svn: 258212
* [Process] Remove dead code. All the switch cases are already covered.Davide Italiano2016-01-191-2/+0
| | | | llvm-svn: 258199
* Implementing the method Target::TargetEventData::Dump (Stream *s) so that ↵Oleksiy Vyalov2016-01-191-0/+6
| | | | | | | | | | its clients can easily dump it out for informational messages. http://reviews.llvm.org/D16244 Submitting on behalf of vishwesh@google.com. llvm-svn: 258150
* Enable the use of modules in the expression parser by default.Sean Callanan2016-01-141-1/+1
| | | | | | | | | | If your program refers to modules (as indicated in DWARF) we will now try to load these modules and give you access to their types in expressions. This used to be gated by a setting ("settings set target.auto-import-clang-modules true") but that setting defaulted to false. Now it defaults to true -- but you can disable it by toggling the setting to false. llvm-svn: 257812
* Fix some compiler warnings with MSVC 2015.Zachary Turner2016-01-131-0/+2
| | | | llvm-svn: 257671
* Re-apply r257117 (reverted in r257138 temporarily),Jason Molenda2016-01-085-9/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | with the one change that ThreadPlanStepOut::ThreadPlanStepOut will now only advance the return address breakpoint to the end of a source line, if we have source line debug information. It will not advance to the end of a Symbol if we lack source line information. This, or the recognition of the LEAVE instruction in r257209, would have fixed the regression that Siva was seeing. Both were good changes, so I've made both. Original commit message: Performance improvement: Change lldb so that it puts a breakpoint on the first branch instruction after a function return (or the end of a source line), instead of a breakpoint on the return address, to skip an extra stop & start of the inferior process. I changed Process::AdvanceAddressToNextBranchInstruction to not take an optional InstructionList argument - no callers are providing a cached InstructionList today, and if this function was going to do that, the right thing to do would be to fill out / use a DisassemblerSP which is a disassembler with the InstructionList for this address range. http://reviews.llvm.org/D15708 <rdar://problem/23309838> llvm-svn: 257210
* Revert r257117 "Performance improvement: Change lldb so that itJason Molenda2016-01-085-106/+9
| | | | | | | | puts a breakpoint" it is causing a regression in the TestStepNoDebug test case on ubuntu 14.04 with gcc 4.9.2. Thanks for the email Siva. I'll recommit when I've figured out the regression. llvm-svn: 257138
* Performance improvement: Change lldb so that it puts a breakpointJason Molenda2016-01-085-9/+106
| | | | | | | | | | | | | | | | | | | on the first branch instruction after a function return (or the end of a source line), instead of a breakpoint on the return address, to skip an extra stop & start of the inferior process. I changed Process::AdvanceAddressToNextBranchInstruction to not take an optional InstructionList argument - no callers are providing a cached InstructionList today, and if this function was going to do that, the right thing to do would be to fill out / use a DisassemblerSP which is a disassembler with the InstructionList for this address range. http://reviews.llvm.org/D15708 <rdar://problem/23309838> llvm-svn: 257117
* Fix a typo in Process.cppPavel Labath2016-01-051-1/+1
| | | | llvm-svn: 256852
* Fix formatting for last commit.Jim Ingham2015-12-181-3/+3
| | | | llvm-svn: 255973
* Make the Language print the description of the Exception Breakpoint ↵Jim Ingham2015-12-183-5/+20
| | | | | | | | | | | resolver. Also have the breakpoint description print the precondition description if one exists. No behavior change. <rdar://problem/22885189> llvm-svn: 255972
* Set the minimum stack size for private state thread to 8MBKate Stone2015-12-171-1/+1
| | | | | | Demangling complex Boost symbols can exhaust the default stack size. In practice, any thread that calls into LLDB functionality that touches symbols runs this risk. Guaranteeing a reasonable minimum for our own private state thread addressees some known scenarios debugging processes that make use of cpp-netlib. llvm-svn: 255868
* Rework breakpoint language filtering to use the symbol context's language.Dawn Perchik2015-12-162-25/+51
| | | | | | | | | | | | | | | | This patch reworks the breakpoint filter-by-language patch to use the symbol context instead of trying to guess the language solely from the symbol's name. This has the advantage that symbols compiled with debug info will have their actual language known. Symbols without debug info will still do the same "guess"ing because Symbol::GetLanguage() is implemented using Mangled::GuessLanguage(). The recognition of ObjC names was merged into Mangled::GuessLanguage. Reviewed by: jingham, clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D15326 llvm-svn: 255808
* Fix Clang-tidy modernize-use-nullptr and readability-simplify-boolean-expr ↵Eugene Zelenko2015-12-1517-376/+213
| | | | | | | | warnings in some files in source/Target/. Simplify smart pointers checks in conditions. Other minor fixes. llvm-svn: 255598
* Welcome to NetBSD signalsKamil Rytarowski2015-12-151-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Signals 1-32 are matching the default UNIX platform. There are platform specific ones above 32. From the `/usr/include/sys/signal.h` header: ``` #define SIGPWR 32 /* power fail/restart (not reset when caught) */ #ifdef _KERNEL #define SIGRTMIN 33 /* Kernel only; not exposed to userland yet */ #define SIGRTMAX 63 /* Kernel only; not exposed to userland yet */ #endif ``` Reviewers: emaste, joerg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D15482 llvm-svn: 255592
* When constructing an address range to "step" or "next" through,Jason Molenda2015-12-152-4/+39
| | | | | | | | | | | | | | find the largest address range (possibly combining multiple LineEntry's for this line number) that is contiguous. This allows lldb's fast-step stepping algorithm to potentially run for a longer address range than if we have to stop at every LineEntry indicating a subexpression in the source line. http://reviews.llvm.org/D15407 <rdar://problem/23270882> llvm-svn: 255590
* Fix the L1 cache search in MemoryCache::Read to use the Jason Molenda2015-12-121-17/+9
| | | | | | | | | | | | | | | | | | | | | stl upper_bound method instead of lower_bound - we were failing to find some cached data in the L1 cache resulting in extra memory read packets while stepping. The bug with the existing code looked like this: If the L1 cache has 8 bytes at address 0x1000 and 8 bytes at address 0x2000 and we are searching for 4 bytes at 0x2004, the use of lower_bound would return the end() of the container and so we would incorrectly treat the memory as uncached. (the L1 cache is memory seeded from debugserver in the T aka questionmark packet, where debugserver will send up the stack memory that likely contains the caller's stack pointer and frame pointer values.) <rdar://problem/23869227> llvm-svn: 255421
* Fix Clang-tidy modernize-use-nullptr and readability-simplify-boolean-expr ↵Eugene Zelenko2015-12-111-191/+177
| | | | | | | | warnings in source/Target/Target.cpp. Simplify smart pointers checks in conditions. llvm-svn: 255364
OpenPOWER on IntegriCloud