summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/Debugger.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Make log options uniform betwwen lldb-platform and lldb-gdbserverTamas Berghammer2015-05-271-29/+1
| | | | | | | | | | This change also get rid of an unused Debugger instance in GDBRemoteCommunicationServerLLGS and the command interpreter from lldb-platform what was used only for enabling logging. Differential revision: http://reviews.llvm.org/D9876 llvm-svn: 238319
* Improve LLDB prompt handlingPavel Labath2015-05-271-111/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: There is an issue in lldb where the command prompt can appear at the wrong time. The partial fix we have in for this is not working all the time and is introducing unnecessary delays. This change does: - Change Process:SyncIOHandler to use integer start id's for synchronization to avoid it being confused by quick start-stop cycles. I picked this up from a suggested patch by Greg to lldb-dev. - coordinates printing of asynchronous text with the iohandlers. This is also based on a (different) Greg's patch, but I have added stronger synchronization to it to avoid races. Together, these changes solve the prompt problem for me on linux (both with and without libedit). I think they should behave similarly on Mac and FreeBSD and I think they will not make matters worse for windows. Test Plan: Prompt comes out alright. All tests still pass on linux. Reviewers: clayborg, emaste, zturner Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D9823 llvm-svn: 238313
* Fix Debugger::HandleProcessEvent in case when ProcessIOHandler doesn't existIlia K2015-04-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Previously the Debugger::HandleProcessEvent hid a top IOHandler if the process's IOHandler was inactive and later refreshed it. Usually the IOHandler.Refresh() prints the (lldb) prompt. The problem was in case of iOS remote platform when trying to execute 'command source' command. On this platform the process's IOHandler is empty, therefore the Debugger::HandleProcessEvent hid a top IOHandler and later refreshed it. So that the (lldb) prompt was printed with a program output in mixed order: was: ``` longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong longlonglonglonglonglonglonglonglonglonglonglonglonglonglon(lldb) glonglonglonglonglonglonglonglonglonglonglonglong string ``` now: ``` longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong longlonglonglonglonglonglonglonglong string ``` Reviewers: zturner, jingham, clayborg Reviewed By: clayborg Subscribers: lldb-commits, jingham, zturner, clayborg Differential Revision: http://reviews.llvm.org/D8929 llvm-svn: 234517
* Rework LLDB system initialization.Zachary Turner2015-03-311-30/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | In an effort to reduce binary size for components not wishing to link against all of LLDB, as well as a parallel effort to reduce link dependencies on Python, this patch splits out the notion of LLDB initialization into "full" and "common" initialization. All code related to initializing the full LLDB suite lives directly in API now. Previously it was only referenced from API, but because it was defined in lldbCore, it would get implicitly linked against by everything including lldb-server, causing a considerable increase in binary size. By moving this to the API layer, it also creates a better layering for the ongoing effort to make the embedded interpreter replacable with one from a different language (or even be completely removeable). One semantic change necessary to get this all working was to remove the notion of a shared debugger refcount. The debugger is either initialized or uninitialized now, and calling Initialize() multiple times will simply have no effect, while the first Terminate() will now shut it down no matter how many times Initialize() was called. This behaves nicely with all of our supported usage patterns though, and allows us to fix a number of nasty hacks from before. Differential Revision: http://reviews.llvm.org/D8462 llvm-svn: 233758
* Support for truncate/append on log filesPavel Labath2015-03-201-1/+6
| | | | | | | | | | | | | | | Summary: Presently, if a log file already exists, lldb simply starts overwriting bits of it, without truncating or anything. This patch makes it use eFileOptionFileTruncate by default. It also adds an --append option, which will append to the file without truncating. A test is included. Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D8450 llvm-svn: 232801
* Move LLDB initialization/shutdown to Initialization.Zachary Turner2015-03-191-24/+5
| | | | | | | | | | | | | | | | This creates a new top-level folder called Initialization which is intended to hold code specific to LLDB system initialization. Currently this holds the Initialize() and Terminate() functions, as well as the fatal error handler. This provides a means to break the massive dependency cycle which is caused by the fact that Debugger depends on Initialize and Terminate which then depends on the entire LLDB project. With this structure, it will be possible for applications to invoke lldb_private::Initialize() directly, and have that invoke Debugger::Initialize. llvm-svn: 232768
* Add Debugger::InitializeForLLGS to allow ref counted LLGS initialization.Robert Flack2015-03-101-3/+22
| | | | | | | | | | | | | | After http://reviews.llvm.org/D8133 landed as r231550 process launch on remote platform stopped working. This adds Debugger::InitializeForLLGS and tracks whether one or both of Initialize and InitializeForLLGS have been called, calling only the corresponding lldb_private::Terminate* methods as necessary. Since lldb_private::Terminate calls lldb_private::TerminateForLLGS, the latter method may be called twice if Initialize was called for both however the terminate methods ensure they are only called once after being initialized. This still maintains the reduced binary size, though it does now technically link in lldb_private::Terminate on lldb-server even though this should never be called. This should resolve the issue raised in http://reviews.llvm.org/D8133 where Debugger::Terminate assumed that there were 0 references to debugger and terminated early. Differential Revision: http://reviews.llvm.org/D8183 llvm-svn: 231808
* Add Utility/ModuleCache class and integrate it with PlatformGDBRemoteServer ↵Oleksiy Vyalov2015-03-101-0/+4
| | | | | | | | - in order to allow modules caching from remote targets. http://reviews.llvm.org/D8037 llvm-svn: 231734
* Further reduce header footprint of Debugger.h.Zachary Turner2015-03-041-0/+1
| | | | llvm-svn: 231202
* Fix a typo Debugger::ExecuteIOHanders to Debugger::ExecuteIOHandlers.Siva Chandra2015-02-261-2/+2
| | | | | | | | | | | | | | Test Plan: Build LLDB. Reviewers: zturner, vharron, clayborg Reviewed By: vharron, clayborg Subscribers: jingham, lldb-commits Differential Revision: http://reviews.llvm.org/D7894 llvm-svn: 230663
* Change the default disassembly format again. First attempt atJason Molenda2015-02-131-1/+15
| | | | | | | | | | | | | | | | 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
* Get rid of Debugger::FormatPrompt() and replace it with the new FormatEntity ↵Greg Clayton2015-02-041-1702/+36
| | | | | | | | | | | | | | | | | | | 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
* Three related changes to help:Kate Stone2015-01-151-0/+12
| | | | | | | | | | | | | | | | The default help display now shows the alias collection by default, and hides commands whose named begin with an underscore. Help is primarily useful to those unfamiliar with LLDB and should aim to answer typical questions while still being able to provide more esoteric answers when required. To that latter end an argument to include the hidden commands in help has been added, and instead of having a help flag to show aliases there is now one to hide them. This final change might be controversial as it repurposes the -a shorthand as the opposite of its original meaning. The previous implementation of OutputFormattedHelpText was easily confused by embedded newlines. The new algorithm correctly breaks on the FIRST newline or LAST space/tab before the target column count rather than treating all whitespace interchangeably. Command interpreters now have the ability to specify help prologue text and a command prefix string. Neither are used in the current LLDB sources but are required to support REPL-like extensions where LLDB commands must be prefixed and additional help text is required to explain how to access traditional debugging commands. <rdar://problem/17751929> <rdar://problem/16953815> <rdar://problem/16953841> <rdar://problem/16930173> <rdar://problem/16879028> llvm-svn: 226068
* Add the ability to set breakpoints with conditions, commands, etc,Jim Ingham2014-12-061-5/+9
| | | | | | | | | | | | | | in the "dummy-target". The dummy target breakpoints prime all future targets. Breakpoints set before any target is created (e.g. breakpoints in ~/.lldbinit) automatically get set in the dummy target. You can also list, add & delete breakpoints from the dummy target using the "-D" flag, which is supported by most of the breakpoint commands. This removes a long-standing wart in lldb... <rdar://problem/10881487> llvm-svn: 223565
* Fix the behavior of ${current-pc-arrow} in the default disassemblyJason Molenda2014-12-021-7/+8
| | | | | | | | | | | | format for the not-current-stack-frame. This was causing test/functionalities/inferior-assert to fail. Also document the new additions to the format specifications used in the disassembly-format changes to formats.html. <rdar://problem/19102757> llvm-svn: 223096
* lldb can deadlock when launched with an non-existing executable:Greg Clayton2014-12-011-10/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | % lldb /bin/nonono (lldb) target create "/bin/nonono" error: unable to find executable for '/usr/bin/nonono' <deadlock> The problem was the initial commands 'target create "/bin/nonono"' were put into a pipe and the command interpreter was being run with: void CommandInterpreter::RunCommandInterpreter(bool auto_handle_events, bool spawn_thread, CommandInterpreterRunOptions &options) { // Always re-create the command intepreter when we run it in case // any file handles have changed. bool force_create = true; m_debugger.PushIOHandler(GetIOHandler(force_create, &options)); m_stopped_for_crash = false; if (auto_handle_events) m_debugger.StartEventHandlerThread(); if (spawn_thread) { m_debugger.StartIOHandlerThread(); } else { m_debugger.ExecuteIOHanders(); if (auto_handle_events) m_debugger.StopEventHandlerThread(); } } If "auto_handle_events" was set to true and "spawn_thread" was false, we would execute: m_debugger.StartEventHandlerThread(); m_debugger.ExecuteIOHanders(); m_debugger.StopEventHandlerThread(); The problem was there was no synchonization in Debugger::StartEventHandlerThread() to ensure the event handler was listening to events and the the call to "m_debugger.StopEventHandlerThread()" would do: void Debugger::StopEventHandlerThread() { if (m_event_handler_thread.IsJoinable()) { GetCommandInterpreter().BroadcastEvent(CommandInterpreter::eBroadcastBitQuitCommandReceived); m_event_handler_thread.Join(nullptr); } } The problem was that the event thread might not be listening for the CommandInterpreter::eBroadcastBitQuitCommandReceived event yet. The solution is to make sure the Debugger::DefaultEventHandler() is listening to events before we return from Debugger::StartEventHandlerThread(). Once we have this synchonization we remove the race condition. This fixes radar: <rdar://problem/19041192> llvm-svn: 223083
* This is the first step of making lldb able to create target-specific thingsJim Ingham2014-11-221-0/+15
| | | | | | | | | | | | | (e.g. breakpoints, stop-hooks) before we have any targets - for instance in your ~/.lldbinit file. These will then get copied over to any new targets that get created. So far, you can only make stop-hooks. Breakpoints will have to learn to move themselves from target to target for us to get them from no-target to new-target. We should also make a command & SB API way to prime this ur-target. llvm-svn: 222600
* Put the current pc arrow back into the default disassembly format.Jason Molenda2014-11-111-1/+1
| | | | | | | | | I went back and forth on removing this - and tried dropping it for a few weeks. But when you're working at an assembly language, it really is helpful to have this displayed to show where the current pc is. llvm-svn: 221682
* This is a large, but clearical, commit that enables the C++ formatters to ↵Enrico Granata2014-11-061-1/+1
| | | | | | take on the additional TypeSummaryOptions argument. It is still not used for anything, but it is now there. Adding support for this extra argument to Python formatters will follow suit llvm-svn: 221486
* Add a setting escape-non-printables that drives whether the StringPrinter ↵Enrico Granata2014-11-051-2/+15
| | | | | | | | | | | should or should not escape sequences such as \t, \n, .. and generally any non-printing character The recent StringPrinter changes made this behavior the default, and the setting defaults to yes If you want to change this behavior and see non-printables unescaped (e.g. "a\tb" as "a b"), set it to false Fixes rdar://12969594 llvm-svn: 221399
* Update default disassembly format string so we getJason Molenda2014-10-311-2/+1
| | | | | | | | | | | | | | | | | better output when we don't have any symbol name. It looked like this: 0x1097fd029 <ud2 0x1097fd02b <addb %al, (%rax) now, like this: 0x10cdd3064: ud2 0x10cdd3066: addb %al, (%rax) <rdar://problem/18833391> llvm-svn: 220948
* Add a feature where a string data formatter can now be partially composed of ↵Enrico Granata2014-10-281-0/+9
| | | | | | | | | | | | | | Python summary functions This works similarly to the {thread/frame/process/target.script:...} feature - you write a summary string, part of which is ${var.script:someFuncName} someFuncName is expected to be declared as def someFuncName(SBValue,otherArgument) - essentially the same as a summary function Since . -> [] are the only allowed separators, and % is used for custom formatting, .script: would not be a legitimate symbol anyway, which makes this non-ambiguous llvm-svn: 220821
* Implement explicit thread stack size specification on Windows.Zachary Turner2014-10-241-5/+4
| | | | llvm-svn: 220596
* Fix a problem where summary strings could not use a synthetically generated ↵Enrico Granata2014-10-221-0/+1
| | | | | | value as part of themselves llvm-svn: 220414
* Expose the type-info flags at the public API layer. These flags provide much ↵Enrico Granata2014-10-211-2/+2
| | | | | | more informational content to consumers of the LLDB API than the existing TypeClass. Part of the fix for rdar://18517593 llvm-svn: 220322
* Make the "synchronous" mode actually work without race conditions.Greg Clayton2014-10-211-172/+8
| | | | | | There were many issues with synchronous mode that we discovered when started to try and add a "batch" mode. There was a race condition where the event handling thread might consume events when in sync mode and other times the Process::WaitForProcessToStop() would consume them. This also led to places where the Process IO handler might or might not get popped when it needed to be. llvm-svn: 220254
* Allow ThreadLauncher::LaunchThread() to specify a minimum stack byte size ↵Greg Clayton2014-10-151-2/+12
| | | | | | | | | | | | when launching threads. This defaults to zero, which means to use the system default. NOTE: Windows will need to implement this. <rdar://problem/18644448> llvm-svn: 219821
* Don't lock the IOHandlerList::m_mutex in Debugger::RunIOHandler(...) since ↵Greg Clayton2014-10-131-1/+0
| | | | | | | | if a process is resumed or halted, it will try to push/pop the process IOHandler and it will deadlock. <rdar://problem/18610852> llvm-svn: 219620
* Reinstate setting addr_width to the result of the computation,Eric Christopher2014-10-111-1/+1
| | | | | | but in the conditional rather than at initialization time. llvm-svn: 219549
* LLDB AddressSanitizer instrumentation runtime plugin, breakpint on error and ↵Kuba Brecka2014-10-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | report data extraction Reviewed at http://reviews.llvm.org/D5592 This patch gives LLDB some ability to interact with AddressSanitizer runtime library, on top of what we already have (historical memory stack traces provided by ASan). Namely, that's the ability to stop on an error caught by ASan, and access the report information that are associated with it. The report information is also exposed into SB API. More precisely this patch... adds a new plugin type, InstrumentationRuntime, which should serve as a generic superclass for other instrumentation runtime libraries, these plugins get notified when modules are loaded, so they get a chance to "activate" when a specific dynamic library is loaded an instance of this plugin type, AddressSanitizerRuntime, which activates itself when it sees the ASan dynamic library or founds ASan statically linked in the executable adds a collection of these plugins into the Process class AddressSanitizerRuntime sets an internal breakpoint on __asan::AsanDie(), and when this breakpoint gets hit, it retrieves the report information from ASan this breakpoint is then exposed as a new StopReason, eStopReasonInstrumentation, with a new StopInfo subclass, InstrumentationRuntimeStopInfo the StopInfo superclass is extended with a m_extended_info field (it's a StructuredData::ObjectSP), that can hold arbitrary JSON-like data, which is the way the new plugin provides the report data the "thread info" command now accepts a "-s" flag that prints out the JSON data of a stop reason (same way the "-j" flag works now) SBThread has a new API, GetStopReasonExtendedInfoAsJSON, which dumps the JSON string into a SBStream adds a test case for all of this I plan to also get rid of the original ASan plugin (memory history stack traces) and use an instance of AddressSanitizerRuntime for that purpose. Kuba llvm-svn: 219546
* Add a new disassembly-format specification so that the disassemblerJason Molenda2014-10-101-15/+162
| | | | | | | | | | | | | | | | | | | | | output style can be customized. Change the built-in default to be more similar to gdb's disassembly formatting. The disassembly-format for a gdb-like output is ${addr-file-or-load} <${function.name-without-args}${function.concrete-only-addr-offset-no-padding}>: The disassembly-format for the lldb style output is {${function.initial-function}{${module.file.basename}`}{${function.name-without-args}}:\n}{${function.changed}\n{${module.file.basename}`}{${function.name-without-args}}:\n}{${current-pc-arrow} }{${addr-file-or-load}}: The two backticks in the lldb style formatter triggers the sub-expression evaluation in CommandInterpreter::PreprocessCommand() so you can't use that one as-is ... changing to use ' characters instead of ` would work around that. <rdar://problem/9885398> llvm-svn: 219544
* Move ConnectionFileDescriptor to platform-specific Host directory.Zachary Turner2014-10-061-1/+1
| | | | | | | | | | | | As part of getting ConnectionFileDescriptor working on Windows, there is going to be alot of platform specific work to be done. As a result, the implementation is moving into Host. This patch performs the code move and fixes up call-sites appropriately. Reviewed by: Greg Clayton Differential Revision: http://reviews.llvm.org/D5548 llvm-svn: 219143
* Fix up the HostThread interface, making the interface simpler.Zachary Turner2014-09-231-8/+6
| | | | | | | Reviewed by: Greg Clayton Differential Revision: http://reviews.llvm.org/D5417 llvm-svn: 218325
* Test suite runs better again after recent fixes that would select a platform ↵Greg Clayton2014-09-191-1/+1
| | | | | | | | | | | | | if a "file a.out" auto selected a different platform than the selected one. Changes include: - fix it so you can select the "host" platform using "platform select host" - change all callbacks that create platforms to returns shared pointers - fix TestImageListMultiArchitecture.py to restore the "host" platform by running "platform select host" - Add a new "PlatformSP Platform::Find(const ConstString &name)" method to get a cached platform - cache platforms that are created and re-use them instead of always creating a new one llvm-svn: 218145
* Fix the ctor ivar initialization formatting for Debugger,Jason Molenda2014-09-121-16/+16
| | | | | | | TypeValidatorImpl, FileAction, and ProcessLaunchInfo to match the lldb coding convention. llvm-svn: 217653
* Create a HostThread abstraction.Zachary Turner2014-09-091-30/+29
| | | | | | | | | | | | | This patch moves creates a thread abstraction that represents a thread running inside the LLDB process. This is a replacement for otherwise using lldb::thread_t, and provides a platform agnostic interface to managing these threads. Differential Revision: http://reviews.llvm.org/D5198 Reviewed by: Jim Ingham llvm-svn: 217460
* Update LLDB to use LLVM's DynamicLibrary.Zachary Turner2014-08-271-4/+5
| | | | | | | | | LLDB had implemented its own DynamicLibrary class for plugin support. LLVM has an equivalent mechanism, so this patch deletes the duplicated code in LLDB and updates LLDB to reference the mechanism provided by LLVM. llvm-svn: 216606
* Move Host::GetLLDBPath to HostInfo.Zachary Turner2014-08-211-3/+4
| | | | | | | | This continues the effort to get Host code moved over to HostInfo, and removes many more instances of preprocessor defines along the way. llvm-svn: 216195
* When attempting to print function names with arguments in frame formatting, ↵Enrico Granata2014-08-161-1/+23
| | | | | | attempt to detect templated functions, and replace the argument list with values outside the template marking. Turns C::f<(this=0x00007fff5fbffb70, x=2, y=1)0>(int, int) into C::f<(C::V)0>(this=0x00007fff5fbffb70, x=2, y=1), which definitely looks more like the real thing. Fixes rdar://14882237 llvm-svn: 215800
* If a hand-called function is interrupted by hitting a breakpoint, then Jim Ingham2014-07-081-0/+14
| | | | | | | when you continue to finish off the function call, the expression result will be included as part of the thread stop info. llvm-svn: 212506
* Fix a few typos.Bruce Mitchener2014-06-271-3/+3
| | | | llvm-svn: 211851
* Command files that switch input handlers didn't work, now they do.Greg Clayton2014-06-201-3/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The issue was when we called Debugger::RunIOHandler(), it would run the current IOHandler by activating it, and running it and then try to pop it and exit regardless of wether it was on top or not. The new code will push the IOHandler that was passed in, and run the IOHandlers until the one passed in is successfully popped. This allows files for the "command source" to switch input handlers: % cat /tmp/commands br s -S alignLeftEdges: br command add bt frame var po self DONE b s -n main br command add bt frame var DONE Note above we set a breakpoint, then add commands do it. The "br command add" will push the breakpoint comment gatherer until it sees "DONE" and then pop itself off the stack. The a new breakpoint will be set and it does the same thing again. Now this file can be sourced from the command line: % lldb -s /tmp/commands /path/to/a.out And your breakpoints will be correctly setup! <rdar://problem/17081650> llvm-svn: 211329
* Initial merge of some of the iOS 8 / Mac OS X Yosemite specificJason Molenda2014-06-131-0/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | lldb support. I'll be doing more testing & cleanup but I wanted to get the initial checkin done. This adds a new SBExpressionOptions::SetLanguage API for selecting a language of an expression. I added adds a new SBThread::GetInfoItemByPathString for retriving information about a thread from that thread's StructuredData. I added a new StructuredData class for representing key-value/array/dictionary information (e.g. JSON formatted data). Helper functions to read JSON and create a StructuredData object, and to print a StructuredData object in JSON format are included. A few Cocoa / Cocoa Touch data formatters were updated by Enrico to track changes in iOS 8 / Yosemite. Before we query a thread's extended information, the system runtime may provide hints to the remote debug stub that it will use to retrieve values out of runtime structures. I added a new SystemRuntime method AddThreadExtendedInfoPacketHints which allows the SystemRuntime to add key-value type data to the initial request that we send to the remote stub. The thread-format formatter string can now retrieve values out of a thread's extended info structured data. The default thread-format string picks up two of these - thread.info.activity.name and thread.info.trace_messages. I added a new "jThreadExtendedInfo" packet in debugserver; I will add documentation to the lldb-gdb-remote.txt doc soon. It accepts JSON formatted arguments (most importantly, "thread":threadnum) and it returns a variety of information regarding the thread to lldb in JSON format. This JSON return is scanned into a StructuredData object that is associated with the thread; UI layers can query the thread's StructuredData to see if key-values are present, and if so, show them to the user. These key-values are likely to be specific to different targets with some commonality among many targets. For instance, many targets will be able to advertise the pthread_t value for a thread. I added an initial rough cut of "thread info" command which will print the information about a thread from the jThreadExtendedInfo result. I need to do more work to make this format reasonably. Han Ming added calls into the pmenergy and pmsample libraries if debugserver is run on Mac OS X Yosemite to get information about the inferior's power use. I added support to debugserver for gathering the Genealogy information about threads, if it exists, and returning it in the jThreadExtendedInfo JSON result. llvm-svn: 210874
* Make sure that the CommandInterpreter::m_command_io_handler_sp gets reset ↵Greg Clayton2014-04-251-0/+2
| | | | | | | | | | when we quit. Currently if you run _any_ python, python has the "lldb.debugger" global variable and it has a strong reference to a lldb_private::Debugger since it is a lldb::SBDebugger object with a shared pointer. This makes sure that your LLDB command interpreter history is saved each time you quit command line LLDB. llvm-svn: 207164
* <rdar://problem/14862302>Enrico Granata2014-03-251-3/+18
| | | | | | | For small structs, the frame format now prints them as one-liners This follows the same definition that frame variable does for deciding what a "small struct" is, and as such should be fairly consistent with the variable display in general llvm-svn: 204762
* Core: preprocess out TestPromptFormatsSaleem Abdulrasool2014-03-201-0/+2
| | | | | | | | | | TestPromptFormats appears as though it may be a useful unit test. Unfortunately, there is no invocation mechanism in place right now. It is unclear how to add a unit test for this scenario to the existing tests. It would be ideal to remove this entirely, but I am hopeful that this can/will be pulled out into a test still since it uses a user accessible interface. llvm-svn: 204309
* After doing all the work to compute the target ValueObject we want to ↵Jim Ingham2014-03-111-0/+7
| | | | | | | | | | evaluate, make sure we actually got something before proceeding. <rdar://problem/16282875> llvm-svn: 203591
* Don't hold the ThreadList lock over calls to the GetStatus (Process or ↵Jim Ingham2014-03-071-53/+58
| | | | | | | | | | Thread) calls or the lower levels of the Process won't be able to restart. <rdar://problem/16244835> llvm-svn: 203233
* "size_t" isn't always 64 bit, it is 32 bit on 32 bit systems. All printf ↵Greg Clayton2014-03-031-1/+4
| | | | | | | | style statements that were assuming size_t were 64 bit were changed, and they were also changed to display them as unsigned values as "size_t" isn't signed. If you print anything with 'size_t', please cast it to "uint64_t" in the printf and use PRIu64 or PRIx64. llvm-svn: 202738
* Fixed all overlapping prompt issues.Greg Clayton2014-02-281-53/+81
| | | | | | | | I carefully reviewed exactly how the IOHandlers interact and found places where we weren't properly controlling things. There should be no overlapping prompts and all output should now come out in a controlled fashion. <rdar://problem/16111293> llvm-svn: 202525
OpenPOWER on IntegriCloud