summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter/CommandReturnObject.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Don't stop execution in batch mode when process stops with SIGINT or SIGSTOPTatyana Krasnukha2019-09-261-2/+1
| | | | | | | | Summary: Usually, SIGINT and SIGSTOP don't imply a crash, e.g. SIGSTOP is sent on process launch and attach on some platforms. Differential Revision: https://reviews.llvm.org/D67776 llvm-svn: 372961
* 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
* 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
* Reflow paragraphs in comments.Adrian Prantl2018-04-301-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is intended as a clean up after the big clang-format commit (r280751), which unfortunately resulted in many of the comment paragraphs in LLDB being very hard to read. FYI, the script I used was: import textwrap import commands import os import sys import re tmp = "%s.tmp"%sys.argv[1] out = open(tmp, "w+") with open(sys.argv[1], "r") as f: header = "" text = "" comment = re.compile(r'^( *//) ([^ ].*)$') special = re.compile(r'^((([A-Z]+[: ])|([0-9]+ )).*)|(.*;)$') for line in f: match = comment.match(line) if match and not special.match(match.group(2)): # skip intentionally short comments. if not text and len(match.group(2)) < 40: out.write(line) continue if text: text += " " + match.group(2) else: header = match.group(1) text = match.group(2) continue if text: filled = textwrap.wrap(text, width=(78-len(header)), break_long_words=False) for l in filled: out.write(header+" "+l+'\n') text = "" out.write(line) os.rename(tmp, sys.argv[1]) Differential Revision: https://reviews.llvm.org/D46144 llvm-svn: 331197
* Rename Error -> Status.Zachary Turner2017-05-121-3/+3
| | | | | | | | | | | | | | | 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
* Don't allow direct access to StreamString's internal buffer.Zachary Turner2016-11-161-2/+2
| | | | | | | | | | | | | | | This is a large API change that removes the two functions from StreamString that return a std::string& and a const std::string&, and instead provide one function which returns a StringRef. Direct access to the underlying buffer violates the concept of a "stream" which is intended to provide forward only access, and makes porting to llvm::raw_ostream more difficult in the future. Differential Revision: https://reviews.llvm.org/D26698 llvm-svn: 287152
* Make CommandReturnObject methods accept StringRefs.Zachary Turner2016-11-121-20/+23
| | | | llvm-svn: 286728
* *** This commit represents a complete reformatting of the LLDB source codeKate Stone2016-09-061-184/+120
| | | | | | | | | | | | | | | | | | | | | | | *** to conform to clang-format’s LLVM style. This kind of mass change has *** two obvious implications: Firstly, merging this particular commit into a downstream fork may be a huge effort. Alternatively, it may be worth merging all changes up to this commit, performing the same reformatting operation locally, and then discarding the merge for this particular commit. The commands used to accomplish this reformatting were as follows (with current working directory as the root of the repository): find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} + find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ; The version of clang-format used was 3.9.0, and autopep8 was 1.2.4. Secondly, “blame” style tools will generally point to this commit instead of a meaningful prior commit. There are alternatives available that will attempt to look through this change and find the appropriate prior commit. YMMV. llvm-svn: 280751
* Fix a glitch in the Driver's batch mode when used with "attach". Jim Ingham2016-01-081-1/+2
| | | | | | | | | | | | | | Batch mode is supposed to stop execution and return control to the user when an exceptional stop occurs (crash, signal or instrumentation). But attach always stops with a SIGSTOP on OSX (maybe on Linux too?) which would short circuit the rest of the commands given. This change allows a command result object to indicate that it expected to leave the process stopped with an exceptional stop reason, and it is okay for batch mode to keep going. <rdar://problem/22243143> llvm-svn: 257120
* Any commands that are executed through the public interface using ↵Greg Clayton2014-07-151-1/+17
| | | | | | | | | | | | | | SBCommandInterpreter::HandleCommand() are assumed to be in non-interactive mode. Any commands that want interactivity (stdin) will need to be executed through the normal command interpreter using the debugger's in/out/err file handles, or by using "command source". Individual commands through the API will have their STDIN disabled. The STDOUT and STDERR will be redirected into the SBCommandReturnObject argument to SBCommandInterpreter::HandleCommand() as usual. This helps with a deadlock situation in an IDE (Xcode) where the IDE was managing the breakpoint actions by setting a breakpoint callback and doing things manually. <rdar://problem/17386271> llvm-svn: 213023
* Switch NULL to C++11 nullptr in source/InterpreterEd Maste2014-04-201-1/+1
| | | | | | Patch by Robert Matusewicz llvm-svn: 206711
* Second attempt at getting the PyCallable changes in trunkEnrico Granata2013-07-091-2/+12
| | | | | | Thanks to Daniel Malea for helping test this patch for Linux happiness! llvm-svn: 185965
* Revert commits that cause broken builds on GCC buildbotsDaniel Malea2013-07-031-12/+2
| | | | | | | | - build fails due to PyCallable template definition inside an extern "C" scope This commit reverts 185240, 184893 and 184608. llvm-svn: 185560
* <rdar://problem/14266411>Enrico Granata2013-06-251-2/+12
| | | | | | | | | | | | The semi-unofficial way of returning a status from a Python command was to return a string (e.g. return "no such variable was found") that LLDB would pick as a clue of an error having happened This checkin changes that: - SBCommandReturnObject now exports a SetError() call, which can take an SBError or a plain C-string - script commands now drop any return value and expect the SBCommandReturnObject ("return object") to be filled in appropriately - if you do nothing, a success will be assumed If your commands were relying on returning a value and having LLDB pick that up as an error, please change your commands to SetError() through the return object or expect changes in behavior llvm-svn: 184893
* Change CommandReturnObject::AppendMessage to print an empty line ifJason Molenda2013-05-011-1/+1
| | | | | | | | | AppendMessage("") is called. This idiom is used in a handful of places right now (e.g. to put space between different threads in 'bt all') but the empty newline is being omitted instead of emitted. <rdar://problem/13753830> llvm-svn: 180841
* <rdar://problem/13069948>Greg Clayton2013-01-251-12/+6
| | | | | | | | | | | | Major fixed to allow reading files that are over 4GB. The main problems were that the DataExtractor was using 32 bit offsets as a data cursor, and since we mmap all of our object files we could run into cases where if we had a very large core file that was over 4GB, we were running into the 4GB boundary. So I defined a new "lldb::offset_t" which should be used for all file offsets. After making this change, I enabled warnings for data loss and for enexpected implicit conversions temporarily and found a ton of things that I fixed. Any functions that take an index internally, should use "size_t" for any indexes and also should return "size_t" for any sizes of collections. llvm-svn: 173463
* Remove the “len” defaulted parameter from ↵Jim Ingham2012-12-151-16/+9
| | | | | | CommandReturnObject::AppendMessage, AppendWarning and AppendError. Nobody was using them, and it meant if you accidentally used the AppendWarning when you meant AppendWarningWithFormat with an integer in the format string, it would compile and then return your string plus some unknown amount of junk. llvm-svn: 170266
* Made it so changes to the prompt via "settings set prompt" get noticed by ↵Greg Clayton2012-09-011-3/+4
| | | | | | | | | | the command line. Added the ability for OptionValueString objects to take flags. The only flag is currently for parsing escape sequences. Not the prompt string can have escape characters translate which will allow colors in the prompt. Added functions to Args that will parse the escape sequences in a string, and also re-encode the escape sequences for display. This was looted from other parts of LLDB (the Debugger::FormatString() function). llvm-svn: 163043
* Work in progress for:Johnny Chen2011-12-191-1/+14
| | | | | | | | | rdar://problem/10577182 Audit lldb API impl for places where we need to perform a NULL check Add NULL checks for SBCommandReturnObject.AppendMessage(). llvm-svn: 146911
* Added a new class to Process.h: ProcessAttachInfo. This class contains enoughGreg Clayton2011-11-151-0/+10
| | | | | | | | | | | | | | | | | | | | | info for us to attach by pid, or by name and will also allow us to eventually do a lot more powerful attaches. If you look at the options for the "platform process list" command, there are many options which we should be able to specify. This will allow us to do things like "attach to a process named 'tcsh' that has a parent process ID of 123", or "attach to a process named 'x' which has an effective user ID of 345". I finished up the --shell implementation so that it can be used without the --tty option in "process launch". The "--shell" option now can take an optional argument which is the path to the shell to use (or a partial name like "sh" which we will find using the current PATH environment variable). Modified the Process::Attach to use the new ProcessAttachInfo as the sole argument and centralized a lot of code that was in the "process attach" Execute function so that everyone can take advantage of the powerful new attach functionality. llvm-svn: 144615
* Cleanup errors that come out of commands and make sure they all have newlinesGreg Clayton2011-07-021-1/+31
| | | | | | | | | | | | | _only_ in the resulting stream, not in the error objects (lldb_private::Error). lldb_private::Error objects should always just have an error string with no terminating newline characters or periods. Fixed an issue with GDB remote packet detection that could end up deadlocking if a full packet wasn't received in one chunk. Also modified the packet checking function to properly toss one or more bytes when it detects bad data. llvm-svn: 134357
* Don't limit StreamTee to just two streams. It now can containGreg Clayton2011-02-201-8/+10
| | | | | | | | | | | | | | | | | | | | | | | | | N streams by making the stream a vector of stream shared pointers that is protected by a mutex. Streams can be get/set by index which allows indexes to be defined as stream indentifiers. If a stream is set at index 3 and there are now streams in the collection, then empty stream objects are inserted to ensure that stream at index 3 has a valid stream. There is also an append method that allows a stream to be pushed onto the stack. This will allow our streams to be very flexible in where the output goes. Modified the CommandReturnObject to use the new StreamTee functionality. This class now defines two StreamTee indexes: 0 for the stream string stream, and 1 for the immediate stream. This is used both on the output and error streams. Added the ability to get argument types as strings or as descriptions. This is exported through the SBCommandInterpreter API to allow external access. Modified the Driver class to use the newly exported argument names from SBCommandInterpreter::GetArgumentTypeAsCString(). llvm-svn: 126067
* - Changed all the places where CommandObjectReturn was exporting a ↵Jim Ingham2011-02-191-23/+14
| | | | | | | | | | | | | | | | StreamString to just exporting a Stream, and then added GetOutputData & GetErrorData to get the accumulated data. - Added a StreamTee that will tee output to two provided lldb::StreamSP's. - Made the CommandObjectReturn use this so you can Tee the results immediately to the debuggers output file, as well as saving up the results to return when the command is done executing. - HandleCommands now uses this so that if you have a set of commands that continue the target you will see the commands come out as they are processed. - The Driver now uses this to output the command results as you go, which makes the interface more reactive seeming. llvm-svn: 126015
* Initial checkin of lldb code from internal Apple repo.Chris Lattner2010-06-081-0/+175
llvm-svn: 105619
OpenPOWER on IntegriCloud