summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target
Commit message (Collapse)AuthorAgeFilesLines
...
* Move some functions from source/lldb.cpp to Utility.Zachary Turner2015-03-183-0/+3
| | | | | | | | | | Specifically, there were some functions for converting enums to strings and a function for matching a string using a specific matching algorithm. This moves those functions to more appropriate headers in lldb/Utility and updates references to include the new headers. llvm-svn: 232673
* Move lldb-log.cpp to core/Logging.cppZachary Turner2015-03-1814-19/+0
| | | | | | | | | So that we don't have to update every single #include in the entire codebase to #include this new header (which used to get included by lldb-private-log.h, we automatically #include "Logging.h" from within "Log.h". llvm-svn: 232653
* Remove ScriptInterpreterObject.Zachary Turner2015-03-171-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | This removes ScriptInterpreterObject from the codebase completely. Places that used to rely on ScriptInterpreterObject now use StructuredData::Object and its derived classes. To support this, a new type of StructuredData object is introduced, called StructuredData::Generic, which stores a void*. Internally within the python library, StructuredPythonObject subclasses this StructuredData::Generic class so that it can addref and decref the python object on construction and destruction. Additionally, all of the classes in PythonDataObjects.h such as PythonList, PythonDictionary, etc now provide a method to create an instance of the corresponding StructuredData type. For example, there is PythonDictionary::CreateStructuredDictionary. To eliminate dependencies on PythonDataObjects for external callers, all ScriptInterpreter methods now return only StructuredData classes The rest of the changes in this CL are focused on fixing up users of PythonDataObjects classes to use the new StructuredData classes. llvm-svn: 232534
* Fix broadcasters for interpreter and process:Ilia K2015-03-171-1/+1
| | | | | | | | # Fix CommandInterpreter.Broadcaster name (it should be the same as CommandInterpreter::GetStaticBroadcasterClass()) # Prevent the same error in Process.Broadcaster # Fix SBCommandInterpreter::GetBroadcasterClass (it should call CommandInterpreter::GetStaticBroadcasterClass(), was Communication::GetStaticBroadcasterClass()) llvm-svn: 232500
* Extend Platform(s) in order to cache remote executables using ModuleCache ↵Oleksiy Vyalov2015-03-131-0/+37
| | | | | | | | and make POSIX dynamic loader to use this flow when attaching to a remote target. http://reviews.llvm.org/D8306 llvm-svn: 232194
* Fix fetching the architecture of the target on process launchTamas Berghammer2015-03-131-0/+24
| | | | | | | | | | Previously it was fetched only if the architecture isn't valid, but the architecture can be valid without containing all information about the current target (e.g. missing os). Differential revision: http://reviews.llvm.org/D8057 llvm-svn: 232153
* Make ModuleCache::Get to return instantiated ModuleSP instance so already ↵Oleksiy Vyalov2015-03-121-21/+8
| | | | | | | | created in-memory instance can be returned instead of creating a new one. http://reviews.llvm.org/D8270 llvm-svn: 232075
* Remove unused FileSpec variable from Target::GetSharedModuleIlia K2015-03-121-1/+0
| | | | llvm-svn: 232060
* Fix ProcessIO test failuresPavel Labath2015-03-121-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: There was a race condition regarding the output of the inferior process. The reading of the output is performed on a separate thread, and there was no guarantee that the output will get eventually consumed. Because of that, it was happening that calling Process::GetSTDOUT was not returning anything even though the process was terminated and would definitely not produce any further output. This was usually happening only under very heavy system load, but it can be reproduced by placing an usleep in the stdio thread (Process::STDIOReadThreadBytesReceived). This patch addresses this by adding synchronization capabilities to the Communication thread. After calling Communication::SynchronizeWithReadThread one can be sure that all pending input has been processed by the read thread. This function is then called after every public event which stops the process to obtain the entire process output. Test Plan: TestProcessIO.py should now succeed every time instead of flaking in and out. Reviewers: clayborg, jingham Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D8246 llvm-svn: 232023
* Add =shlibs-added/=shlibs-removed notifications (MI)Ilia K2015-03-101-75/+69
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds =shlibs-added/=shlibs-removed notifications in lldb-mi. In more detail: # Add Target::ModulesDidLoad/ModulesDidUnload notifications # Improve Target::TargetEventData: ## Refactoring ## Move it back to include/lldb/Target/Target.h ## Add Target::{GetModuleListFromEvent,GetModuleList}; Add Target::m_module_list # Add SBModule::{GetSymbolVendorMainFileSpec,GetObjectFileHeaderAddress} # Add SBTarget::{EventIsTaretEvent,GetTargetFromEvent,GetNumModulesFromEvent,GetModuleAtIndexFromEvent} All tests pass on OS X. Reviewers: abidh, zturner, jingham, clayborg Reviewed By: clayborg Subscribers: jingham, zturner, lldb-commits, clayborg, abidh Differential Revision: http://reviews.llvm.org/D8201 llvm-svn: 231858
* Add Utility/ModuleCache class and integrate it with PlatformGDBRemoteServer ↵Oleksiy Vyalov2015-03-101-10/+266
| | | | | | | | - in order to allow modules caching from remote targets. http://reviews.llvm.org/D8037 llvm-svn: 231734
* Fix race condition with -o "process launch" on linuxPavel Labath2015-03-061-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | Summary: starting a debug session on linux with -o "process launch" lldb parameter was failing since Target::Launch (in sychronous mode) is expecting to be able to receive public process events. However, PlatformLinux did not set up event hijacking on process launch, which caused these events to be processed elsewhere and left Target::Launch hanging. This patch enables event interception in PlatformLinux (which was commented out). Upon enabling event interception, I noticed an issue, which I traced back to the inconsistent state of public run lock, which remained false even though public and private process states were "stopped". I addressed this by making sure the run lock is "stopped" upon exit from WaitForProcessToStop (which already had similar provisions for other return paths). Test Plan: This should fix the intermittent TestFormats failure we have been experiencing on Linux. Reviewers: jingham, clayborg, vharron Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D8079 llvm-svn: 231460
* Don't #include clang headers from BreakpointLocation.hZachary Turner2015-03-041-1/+1
| | | | llvm-svn: 231263
* Further reduce header footprint of Debugger.h.Zachary Turner2015-03-042-0/+3
| | | | llvm-svn: 231202
* Fix errors building on linux.Zachary Turner2015-03-031-0/+4
| | | | llvm-svn: 231169
* Don't #include FormatManager.h from Debugger.hZachary Turner2015-03-033-0/+6
| | | | | | | | Debugger.h is a huge file that gets included everywhere, and FormatManager.h brings in a ton of unnecessary stuff and doesn't even use anything from it in the header. llvm-svn: 231161
* Further reduce the header footprint of Process.hZachary Turner2015-03-032-1/+62
| | | | | | | No functional change here, only deletes unnecessary headers and moves one function's body from the .h file to the .cpp. llvm-svn: 231145
* Don't #include ClangPersistentVariables.h from Process.hZachary Turner2015-03-033-0/+3
| | | | | | | Nothing from this header file was even being referenced in Process.h anyway, so it was a completely unnecessary include. llvm-svn: 231131
* Reduce header footprint of Target.hZachary Turner2015-03-036-61/+91
| | | | | | | | | | | | This continues the effort to reduce header footprint and improve build speed by removing clang and other unnecessary headers from Target.h. In one case, some headers were included solely for the purpose of declaring a nested class in Target, which was not needed by anybody outside the class. In this case the definition and implementation of the nested class were isolated in the .cpp file so the header could be removed. llvm-svn: 231107
* Remove duplicated code for synthetic array members.Bruce Mitchener2015-02-261-1/+1
| | | | | | | | | | | | | | | | | Summary: The code for GetSyntheticArrayMemberFromPointer and GetSyntheticArrayMemberFromArray was identical, so just collapse the the methods into one. Reviewers: granata.enrico, clayborg Reviewed By: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D7911 llvm-svn: 230708
* Revert "Fix warnings found with clang-cl."Zachary Turner2015-02-251-1/+1
| | | | | | | SWIG doesn't like enum : unsigned. Revert this until I can fix this in a way that swig likes. llvm-svn: 230531
* Fix warnings found with clang-cl.Zachary Turner2015-02-251-1/+1
| | | | | | | | | | | Earlier this week I was able to get clang-cl on Windows to be able to self host. This opened the door to being able to get a whole new slew of warnings for the Windows build. This patch fixes all of the warnings, many of which were real bugs. llvm-svn: 230522
* Add missing "return" statements.Hafiz Abid Qadeer2015-02-251-2/+2
| | | | | | | ExecutionContext::GetAddressByteSize() was calling GettAddressByteSize () on Target and Process class but was ignoring the return type. I have added the missing return. No regression in the test suite. Committed as obvious. llvm-svn: 230502
* Add null RegisterContext assertionsEd Maste2015-02-232-0/+2
| | | | | | | | This makes these failures slightly more obvious, avoiding the need to run LLDB under a debugger or rely on a LLDB core. I encountered these while bringing up a new OS/arch combination. llvm-svn: 230236
* Set error status when failed to catch stop after launchTamas Berghammer2015-02-231-0/+1
| | | | | | | | | | | Process::Launch try to catch a stop signal after launching a process. If it is unsuccessful it destroy the process but previously still reported that the process launched successfully. This behavior caused a deadlock. With thic change the process launch error reported correctly. Differential revision: http://reviews.llvm.org/D7784 llvm-svn: 230212
* Rename the "glob arguments" feature to "shell expand arguments"Enrico Granata2015-02-203-14/+14
| | | | | | This should not bring any feature change, except changing names of things here and there llvm-svn: 230077
* Make sure the public state is eStateStopped when we return from ↵Greg Clayton2015-02-201-2/+2
| | | | | | SBTarget::LoadCore() by hijacking the public event queue so we can ensure that the event gets consumed and the public state of the process (StateType SBProcess::GetState()) returns eStateStopped. llvm-svn: 230066
* Start the refactoring of globbingEnrico Granata2015-02-201-80/+10
| | | | | | | | | | | | | - Add Host::GlobArguments() to perform local-globbing I implemented this on OSX and Windows in terms of argdumper (Windows implementation is essentially the same as the OSX version + a change in binary name and some string magic) Other platforms did not specifically chime in, so I left it unimplemented for them for the time being. Please feel free to fill in the blanks - Add Platform::GlobArguments() to support remote-globbing For now, no feature change here - but now we have infrastructure to help GDBRemote targets to support globbing - and patches to that effect will follow No visible feature change llvm-svn: 230065
* Avoid a race condition when loading core files where the process might still ↵Greg Clayton2015-02-201-1/+17
| | | | | | | | be handling the eStateStopped event we post to the private state thread causing us to return from SBTarget::LoadCore() before the process is ready to have API calls used on it. This fixes a crasher that could happen when loading core files from scripts. llvm-svn: 230060
* A few minor path fixes for Windows.Zachary Turner2015-02-181-1/+7
| | | | | | | | | | | | When launching argdumper, there are a few problems with the current logic. First, on Windows, the file is called argdumper.exe, not argdumper. Second, Windows paths have backslashes in them, and JSON treats <backslash><char> as an escape sequence. To fix the second problem, on Windows we convert backslashes to forward slashes, since backslash isn't a valid filename character anyway this shouldn't be a problem. llvm-svn: 229784
* Use CloseOnExec in Platform::PutFilePavel Labath2015-02-171-2/+3
| | | | | | | | | | | | | | Summary: This does not fix any outstanding issue that I know of, but there is no reason these files should _not_ have CloseOnExec. Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D7694 llvm-svn: 229506
* Change the default disassembly format again. First attempt atJason Molenda2015-02-132-2/+5
| | | | | | | | | | | | | | | | changing it was in r219544 - after living on that for a few months, I wanted to take another crack at this. The disassembly-format setting still exists and the old format can be user specified with a setting like ${current-pc-arrow}${addr-file-or-load}{ <${function.name-without-args}${function.concrete-only-addr-offset-no-padding}>}: This patch was discussed in http://reviews.llvm.org/D7578 <rdar://problem/19726421> llvm-svn: 229186
* Fix Arg0 argument after r229110. The problem was that ↵Ilia K2015-02-131-1/+2
| | | | | | Arg0ValueChangedCallback isn't twitching when Arg0 was updated, therefore target was launched with empty 1st argument or without it at all. In this patch I update Arg0 by hand. llvm-svn: 229125
* Add -exec-arguments commandIlia K2015-02-131-1/+147
| | | | | | | | | | | | | | | | | Summary: This patch adds -exec-arguments command for lldb-mi. -exec-arguments command allows to specify arguments for executable file in MI mode. Also it contains tests for that command. Btw, new added files was formatted by clang-format. Reviewers: abidh, zturner, clayborg Reviewed By: clayborg Subscribers: zturner, emaste, clayborg, jingham, lldb-commits Differential Revision: http://reviews.llvm.org/D6965 llvm-svn: 229110
* Add Initialize/Terminate method to Platform base pluginTamas Berghammer2015-02-121-1/+22
| | | | | | | | | | | | | Platform holds a smart pointer to each platform object created in a static variable what cause the platform destructors called only on program exit when other static variables are not availables. With this change the destructors are called on lldb_private::Terminate() + Fix DebuggerRefCount handling in ScriptInterpreterPython Differential Revision: http://reviews.llvm.org/D7590 llvm-svn: 228944
* Make a more complete fix for always supplying an execution context when ↵Greg Clayton2015-02-121-10/+21
| | | | | | | | | | getting byte sizes from types. There was a test in the test suite that was triggering the backtrace logging output that requested that the client pass an execution context. Sometimes we need the process for Objective C types because our static notion of the type might not align with the reality when being run in a live runtime. Switched from an "ExecutionContext *" to an "ExecutionContextScope *" for greater ease of use. llvm-svn: 228892
* Add extra check that target was stopped before the *stopped is sent.Ilia K2015-02-111-1/+1
| | | | | | This patch fixes r228417. It's required because eStateCrushed case wasn't investigated. llvm-svn: 228824
* Introduce the notion of "runtime support values"Enrico Granata2015-02-111-1/+18
| | | | | | | | | | | | A runtime support value is a ValueObject whose only purpose is to support some language runtime's operation, but it does not directly provide any user-visible benefit As such, unless the user is working on the runtime support, it is mostly safe for them not to see such a value when debugging It is a language runtime's job to check whether a ValueObject is a support value, and that - in conjunction with a target setting - is used by frame variable and target variable SBFrame::GetVariables gets a new overload with yet another flag to dictate whether to return those support values to the caller - that which defaults to the setting's value rdar://problem/15539930 llvm-svn: 228791
* As part of the cleanup when a process dies, tell watchpoints to forget their ↵Enrico Granata2015-02-111-0/+21
| | | | | | | | | | | previously recorded values Because types are not reliably protected against the death of their owners, having ValueObjects lurking around like that past the useful lifetime of their owner processes is a potential source of crashes That is - in itself - worth fixing at some point, but for this case, watchpoints holding on to old values don't offer enough value to make the larger fix worth Fixes rdar://19788756 llvm-svn: 228777
* Extract attach core logic from SBTarget::Attach* methods into unified ↵Oleksiy Vyalov2015-02-101-0/+77
| | | | | | | | SBTarget::AttachToProcess and make it work with platform for remote attach purposes. http://reviews.llvm.org/D7471 llvm-svn: 228757
* Fix 'process launch -i' for remote processesVince Harron2015-02-101-2/+2
| | | | | | | | | | | | | | | | | | We want to forward stdin when stdio is not disabled and when we're not redirecting stdin from a file. renamed m_stdio_disable to m_stdin_forward and inverted value because that's what we want to remember. There was previously a bug that if you redirected stdin from a file, stdout and stderr would also be redirected to /dev/null Adds support for remote target to TestProcessIO.py Fixes ProcessIOTestCase.test_stdin_redirection_with_dwarf for remote Linux targets llvm-svn: 228744
* Add a "launch with globber" mode that lets you launch a process after having ↵Enrico Granata2015-02-103-2/+100
| | | | | | globbed the command line arguments via argdumper instead of routing via /bin/sh llvm-svn: 228658
* Add support for SBProcess::PutSTDIN to remote processesVince Harron2015-02-061-0/+2
| | | | | | | | | | | | | | Processes running on a remote target can already send $O messages to send stdout but there is no way to send stdin to a remote inferior. This allows processes using the API to pump stdin into a remote inferior process. It fixes a hang in TestProcessIO.py when running against a remote target. llvm-svn: 228419
* Fix a missing "*stopped" notification in LLDB-MI after "process launch -s" ↵Ilia K2015-02-061-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in case of remote-macosx Summary: This patch fixes *stopped notification for remote target when started with eLaunchFlagStopAtEntry (for example, using "process launch -s"). See explanation below: ``` Target::Launch (ProcessLaunchInfo &launch_info, Stream *stream) { ... if (state != eStateConnected && platform_sp && platform_sp->CanDebugProcess ()) { ... } else { ... if (m_process_sp) error = m_process_sp->Launch (launch_info); } if (error.Success()) { if (launch_info.GetFlags().Test(eLaunchFlagStopAtEntry) == false) { .... } -- missing event if eLaunchFlagStopAtEntry is set -- m_process_sp->RestoreProcessEvents (); } ... return error ``` Also this patch contains tests and you can check how it works. Reviewers: zturner, clayborg, abidh Reviewed By: clayborg Subscribers: clayborg, abidh, zturner, lldb-commits Differential Revision: http://reviews.llvm.org/D7273 llvm-svn: 228417
* Add additional DWARF 5 language constants.Bruce Mitchener2015-02-061-0/+3
| | | | | | | | | This also hooks up the new C++14 language constant to be treated the same as the other C++ language constants. Differential Revision: http://reviews.llvm.org/D7429 llvm-svn: 228386
* Extend SBPlatform with capability to launch/terminate a process remotely. ↵Oleksiy Vyalov2015-02-041-0/+14
| | | | | | | | Integrate this change into test framework in order to spawn processes on a remote target. http://reviews.llvm.org/D7263 llvm-svn: 228230
* Get rid of Debugger::FormatPrompt() and replace it with the new FormatEntity ↵Greg Clayton2015-02-043-9/+15
| | | | | | | | | | | | | | | | | | | class. Why? Debugger::FormatPrompt() would run through the format prompt every time and parse it and emit it piece by piece. It also did formatting differently depending on which key/value pair it was parsing. The new code improves on this with the following features: 1 - Allow format strings to be parsed into a FormatEntity::Entry which can contain multiple child FormatEntity::Entry objects. This FormatEntity::Entry is a parsed version of what was previously always done in Debugger::FormatPrompt() so it is more efficient to emit formatted strings using the new parsed FormatEntity::Entry. 2 - Allows errors in format strings to be shown immediately when setting the settings (frame-format, thread-format, disassembly-format 3 - Allows auto completion by implementing a new OptionValueFormatEntity and switching frame-format, thread-format, and disassembly-format settings over to using it. 4 - The FormatEntity::Entry for each of the frame-format, thread-format, disassembly-format settings only replaces the old one if the format parses correctly 5 - Combines all consecutive string values together for efficient output. This means all "${ansi.*}" keys and all desensitized characters like "\n" "\t" "\0721" "\x23" will get combined with their previous strings 6 - ${*.script:} (like "${var.script:mymodule.my_var_function}") have all been switched over to use ${script.*:} "${script.var:mymodule.my_var_function}") to make the format easier to parse as I don't believe anyone was using these format string power user features. 7 - All key values pairs are defined in simple C arrays of entries so it is much easier to add new entries. These changes pave the way for subsequent modifications where we can modify formats to do more (like control the width of value strings can do more and add more functionality more easily like string formatting to control the width, printf formats and more). llvm-svn: 228207
* Fix broken windows build due to use of O_CLOEXEC.Zachary Turner2015-02-041-1/+8
| | | | llvm-svn: 228171
* Avoid leakage of file descriptors in LLDB and LLGSPavel Labath2015-02-041-1/+1
| | | | | | | | | | | | | | | Summary: Both LLDB and LLGS are leaking file descriptors into the debugged process. This plugs the leak by closing the unneeded descriptors. In one case I use O_CLOEXEC, which I hope is supported on relevant platforms. I also added a regression test and plugged a fd leak in dosep.py. Reviewers: vharron, clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D7372 llvm-svn: 228130
* Moving header files from source/Host/common to proper location.Chaoren Lin2015-02-033-522/+0
| | | | llvm-svn: 227929
OpenPOWER on IntegriCloud