summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/minidump/ProcessMinidump.h
Commit message (Collapse)AuthorAgeFilesLines
* lldb/minidump: Refactor memory region computation codePavel Labath2019-10-251-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The goal of this refactor is to enable ProcessMinidump to take into account the loaded modules and their sections when computing the permissions of various ranges of memory, as discussed in D66638. This patch moves some of the responsibility for computing the ranges from MinidumpParser into ProcessMinidump. MinidumpParser still does the parsing, but ProcessMinidump becomes responsible for answering the actual queries about memory ranges. This will enable it (in a follow-up patch) to augment the information obtained from the parser with data obtained from actual object files. The changes in the actual code are fairly straight-forward and just involve moving code around. MinidumpParser::GetMemoryRegions is renamed to BuildMemoryRegions to emphasize that it does no caching. The only new thing is the additional bool flag returned from this function. This indicates whether the returned regions describe all memory mapped into the target process. Data obtained from /proc/maps and the MemoryInfoList stream is considered to be exhaustive. Data obtained from Memory(64)List is not. This will be used to determine whether we need to augment the data or not. This reshuffle means that it is no longer possible/easy to test some of this code via unit tests, as constructing a ProcessMinidump instance is hard. Instead, I update the unit tests to only test the parsing of the actual data, and test the answering of queries through a lit test using the "memory region" command. The patch also includes some tweaks to the MemoryRegion class to make the unit tests easier to write. Reviewers: amccarth, clayborg Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D69035
* LLDB: Use LLVM's type for minidump ExceptionStream [NFC]Joseph Tremoulet2019-10-181-1/+1
| | | | | | | | | | | | | | | | Summary: The types defined for it in LLDB are now redundant with core types. Reviewers: labath, clayborg Reviewed By: clayborg Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D68658 llvm-svn: 375243
* Minidump: use ThreadList parsing code from llvm/ObjectPavel Labath2019-05-101-1/+1
| | | | llvm-svn: 360412
* Avoid two-stage initialization of MinidumpParserPavel Labath2019-02-221-2/+3
| | | | | | | | | remove the Initialize function, move the things that can fail into the static factory function. The factory function now returns Expected<Parser> instead of Optional<Parser> so that it can give a reason why creation failed. llvm-svn: 354668
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* Overload GetMemoryRegions for the ProcessMinidumpTatyana Krasnukha2018-12-201-0/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D55841 llvm-svn: 349767
* Add "dump" command as a custom "process plugin" subcommand when ↵Greg Clayton2018-12-181-0/+3
| | | | | | | | | | | | | | | | | ProcessMinidump is used. Each process plug-in can create its own custom commands. I figured it would be nice to be able to dump things from the minidump file from the lldb command line, so I added the start of the some custom commands. Currently you can dump: minidump stream directory all linux specifc streams, most of which are strings each linux stream individually if desired, or all with --linux The idea is we can expand the command set to dump more things, search for data in the core file, and much more. This patch gets us started. Differential Revision: https://reviews.llvm.org/D55727 llvm-svn: 349429
* Remove header grouping comments.Jonas Devlieghere2018-11-111-4/+0
| | | | | | | | This patch removes the comments grouping header includes. They were added after running IWYU over the LLDB codebase. However they add little value, are often outdates and burdensome to maintain. llvm-svn: 346626
* Restrict the set of plugins used for ProcessMinidumpLeonard Mosescu2018-08-231-1/+3
| | | | | | | | | | | | | | 1. The dynamic loaders should not be needed for loading minidumps and they may create problems (ex. the macOS loader resets the list of loaded sections, which for minidumps are already set up during minidump loading) 2. In general, the extra plugins can do extraneous work which hurts performance (ex. trying to set up implicit symbolic breakpoints, which in turn will trigger extra debug information loading) Differential Revision: https://reviews.llvm.org/D51176 llvm-svn: 340578
* Improve LLDB's handling of non-local minidumpsLeonard Mosescu2018-04-181-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Normally, LLDB is creating a high-fidelity representation of a live process, including a list of modules and sections, with the associated memory address ranges. In order to build the module and section map LLDB tries to locate the local module image (object file) and will parse it. This does not work for postmortem debugging scenarios where the crash dump (minidump in this case) was captured on a different machine. Fortunately the minidump format encodes enough information about each module's memory range to allow us to create placeholder modules. This enables most LLDB functionality involving address-to-module translations. Also, we may want to completly disable the search for matching local object files if we load minidumps unless we can prove that the local image matches the one from the crash origin. (not part of this change, see: llvm.org/pr35193) Example: Identify the module from a stack frame PC: Before: thread #1, stop reason = Exception 0xc0000005 encountered at address 0x164d14 frame #0: 0x00164d14 frame #1: 0x00167c79 frame #2: 0x00167e6d frame #3: 0x7510336a frame #4: 0x77759882 frame #5: 0x77759855 After: thread #1, stop reason = Exception 0xc0000005 encountered at address 0x164d14 frame #0: 0x00164d14 C:\Users\amccarth\Documents\Visual Studio 2013\Projects\fizzbuzz\Debug\fizzbuzz.exe frame #1: 0x00167c79 C:\Users\amccarth\Documents\Visual Studio 2013\Projects\fizzbuzz\Debug\fizzbuzz.exe frame #2: 0x00167e6d C:\Users\amccarth\Documents\Visual Studio 2013\Projects\fizzbuzz\Debug\fizzbuzz.exe frame #3: 0x7510336a C:\Windows\SysWOW64\kernel32.dll frame #4: 0x77759882 C:\Windows\SysWOW64\ntdll.dll frame #5: 0x77759855 C:\Windows\SysWOW64\ntdll.dll Example: target modules list Before: error: the target has no associated executable images After: [ 0] C:\Windows\System32\MSVCP120D.dll [ 1] C:\Windows\SysWOW64\kernel32.dll [ 2] C:\Users\amccarth\Documents\Visual Studio 2013\Projects\fizzbuzz\Debug\fizzbuzz.exe [ 3] C:\Windows\System32\MSVCR120D.dll [ 4] C:\Windows\SysWOW64\KERNELBASE.dll [ 5] C:\Windows\SysWOW64\ntdll.dll NOTE: the minidump format also includes the debug info GUID, so we can fill-in the module UUID from it, but this part was excluded from this change to keep the changes simple (the LLDB UUID is hardcoded to be either 16 or 20 bytes, while the CodeView GUIDs are normally 24 bytes) Differential Revision: https://reviews.llvm.org/D45700 llvm-svn: 330302
* Re-land r313210 - Fix for bug 34532 - A few rough corners related to ↵Adrian McCarthy2017-09-191-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | post-mortem debugging (core/minidump) The main change is to avoid setting the process state as running when debugging core/minidumps (details in the bug). Also included a few small, related fixes around how the errors propagate in this case. Fixed the FreeBSD/Windows break: the intention was to keep Process::WillResume() and Process::DoResume() "in-sync", but this had the unfortunate consequence of breaking Process sub-classes which don't override WillResume(). The safer approach is to keep Process::WillResume() untouched and only override it in the minidump and core implementations. patch by lemo Bug: https://bugs.llvm.org/show_bug.cgi?id=34532 Differential Revision: https://reviews.llvm.org/D37651 llvm-svn: 313655
* Rename Error -> Status.Zachary Turner2017-05-121-7/+7
| | | | | | | | | | | | | | | This renames the LLDB error class to Status, as discussed on the lldb-dev mailing list. A change of this magnitude cannot easily be done without find and replace, but that has potential to catch unwanted occurrences of common strings such as "Error". Every effort was made to find all the obvious things such as the word "Error" appearing in a string, etc, but it's possible there are still some lingering occurences left around. Hopefully nothing too serious. llvm-svn: 302872
* Move classes from Core -> Utility.Zachary Turner2017-02-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | This moves the following classes from Core -> Utility. ConstString Error RegularExpression Stream StreamString The goal here is to get lldbUtility into a state where it has no dependendencies except on itself and LLVM, so it can be the starting point at which to start untangling LLDB's dependencies. These are all low level and very widely used classes, and previously lldbUtility had dependencies up to lldbCore in order to use these classes. So moving then down to lldbUtility makes sense from both the short term and long term perspective in solving this problem. Differential Revision: https://reviews.llvm.org/D29427 llvm-svn: 293941
* Minidump plugin: Fix flaky testDimitar Vlahovski2016-11-011-2/+3
| | | | | | | | | | | | | | | | | | | Summary: One of the tests was flaky, because similarly to https://reviews.llvm.org/D18697 (rL265391) - if there is a process running which is with the same PID as in the core file, the minidump core file debugging will fail, because we get some information from the running process. The fix is routing the ProcessInfo requests through the Process class and overriding it in ProcessMinidump to return correct data. Reviewers: labath Subscribers: lldb-commits, beanz Differential Revision: https://reviews.llvm.org/D26193 llvm-svn: 285698
* Minidump plugin: Adding ProcessMinidump, ThreadMinidump and register the ↵Dimitar Vlahovski2016-10-311-0/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | plugin in SystemInitializerFull Summary: This plugin resembles the already existing Windows-only Minidump plugin. The WinMinidumpPlugin uses the Windows API for parsing Minidumps while this plugin is cross-platform because it includes a Minidump parser (which is already commited) It is able to produce a backtrace, to read the general puprose regiters, inspect local variables, show image list, do memory reads, etc. For now the only arches that this supports are x86_32 and x86_64. This is because I have only written register contexts for those. Others will come in next CLs. I copied the WinMinidump tests and adapted them a little bit for them to work with the new plugin (and they pass) I will add more tests, aiming for better code coverage. There is still functionality to be added, see TODOs in code. Reviewers: labath, zturner Subscribers: beanz, mgorny, modocache, lldb-commits, amccarth Differential Revision: https://reviews.llvm.org/D25905 llvm-svn: 285587
* Removing the new Minidump pluginDimitar Vlahovski2016-10-051-103/+0
| | | | | | | | | | | | | | | | | | | | | | | Tests are failing and build is failing on windows and darwin. Will fix and commit it later ------------------------------------------------------------- Revert "xfailing minidump tests again ... :(" This reverts commit 97eade002c9e43c1e0d11475a4888083a8965044. Revert "Fixing new Minidump plugin tests" This reverts commit 0dd93b3ab39c8288696001dd50b9a093b813b09c. Revert "Add the new minidump files to the Xcode project." This reverts commit 2f638a1d046b8a88e61e212220edc40aecd2ce44. Revert "xfailing tests for Minidump plugin" This reverts commit 99311c0b22338a83e6a00c4fbddfd3577914c003. Revert "Adding a new Minidump post-mortem debugging plugin" This reverts commit b09a7e4dae231663095a84dac4be3da00b03a021. llvm-svn: 283352
* Adding a new Minidump post-mortem debugging pluginDimitar Vlahovski2016-10-041-0/+103
Summary: This plugin resembles the already existing Windows-only Minidump plugin. The WinMinidumpPlugin uses the Windows API for parsing Minidumps while this plugin is cross-platform because it includes a Minidump parser (which is already commited) It is able to produce a backtrace, to read the general puprose regiters, inspect local variables, show image list, do memory reads, etc. For now the only arch that this supports is x86 64 bit This is because I have only written a register context for that arch. Others will come in next CLs. I copied the WinMinidump tests and adapted them a little bit for them to work with the new plugin (and they pass) I will add more tests, aiming for better code coverage. There is still functionality to be added, see TODOs in code. Reviewers: labath, zturner Subscribers: beanz, mgorny, amccarth, lldb-commits, modocache Differential Revision: https://reviews.llvm.org/D25196 llvm-svn: 283259
OpenPOWER on IntegriCloud