summaryrefslogtreecommitdiffstats
path: root/lldb/source/Breakpoint
Commit message (Collapse)AuthorAgeFilesLines
...
* Refactor BreakpointResolver::SetSCMatchesByLine() to make it easier toAdrian Prantl2018-08-291-115/+97
| | | | | | | | | | | | read/understand/maintain. As a side-effect, this should also improve the performance by avoiding costly vector element removals and switching from a std::map to a SmallDenseSet. Differential Revision: https://reviews.llvm.org/D51453 llvm-svn: 340994
* If a function starts with line number 0, don't try to check if a breakpoint ↵Jim Ingham2018-08-071-1/+5
| | | | | | | | | | crossed function boundaries. clang doesn't use line number 0 (to mean artifically generated code) very often, but swift does it quite often. We were rejecting all by line breakpoints in functions that started at line 0. But that's a special marker so we can just not do this test in that case. llvm-svn: 339182
* Add missing constness.Tatyana Krasnukha2018-06-271-1/+1
| | | | llvm-svn: 335711
* BreakpointIDList: Use llvm::ArrayRef instead of pointer+length pairPavel Labath2018-06-201-6/+5
| | | | | | NFC llvm-svn: 335102
* [FileSpec] Make style argument mandatory for SetFile. NFCJonas Devlieghere2018-06-131-1/+1
| | | | | | | | | | | | | | | | SetFile has an optional style argument which defaulted to the native style. This patch makes that argument mandatory so clients of the FileSpec class are forced to think about the correct syntax. At the same time this introduces a (protected) convenience method to update the file from within the FileSpec class that keeps the current style. These two changes together prevent a potential pitfall where the style might be forgotten, leading to the path being updated and the style unintentionally being changed to the host style. llvm-svn: 334663
* Reflow paragraphs in comments.Adrian Prantl2018-04-3014-169/+144
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Always normalize FileSpec paths.Greg Clayton2018-04-271-1/+1
| | | | | | | | Always normalizing lldb_private::FileSpec paths will help us get a consistent results from comparisons when setting breakpoints and when looking for source files. This also removes a lot of complexity from the comparison routines. Modified the DWARF line table parser to use the normalized compile unit directory if needed. Differential Revision: https://reviews.llvm.org/D45977 llvm-svn: 331049
* Move Args.cpp from Interpreter to UtilityPavel Labath2018-04-171-1/+1
| | | | | | | | | | | | | | | | | | | | | Summary: The Args class is used in plenty of places besides the command interpreter (e.g., anything requiring an argc+argv combo, such as when launching a process), so it needs to be in a lower layer. Now that the class has no external dependencies, it can be moved down to the Utility module. This removes the last (direct) dependency from the Host module to Interpreter, so I remove the Interpreter module from Host's dependency list. Reviewers: zturner, jingham, davide Subscribers: mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D45480 llvm-svn: 330200
* Make sure deleting all breakpoints clears their sites firstEugene Zemtsov2018-04-161-5/+7
| | | | | | | | Bug: https://bugs.llvm.org/show_bug.cgi?id=36430 Differential Revision: https://reviews.llvm.org/D45554 llvm-svn: 330163
* Allow relative file paths when settings source breakpointsGreg Clayton2018-04-131-4/+29
| | | | | | | | | | | | | | | | | Many IDEs set breakpoints using absolute paths and this causes problems when the full path of the source file path doesn't match what is in the debug info. This can be due to different build systems and do or do not resolve symlinks. This patch allows relative breakpoint to be set correctly without needing to do any target.source-map tricks. If IDEs want to, they can send down relative paths like: ./main.c ./src/main.c src/main.c foo/bar/src/main.c I used the breakpoint resolver to match on the file basename and then we weed out anything whose relative paths don't match. This will be a huge improvement for IDEs as they can specify as much of a relative path as desired to uniquely identify a source file in the current project. Differential Revision: https://reviews.llvm.org/D45592 llvm-svn: 330028
* Re-add change for https://reviews.llvm.org/D42582 with added directories.Jim Ingham2018-03-121-0/+8
| | | | llvm-svn: 327331
* Revert "Improve prologue handling to support functions with multiple entry ↵Vedant Kumar2018-03-121-8/+0
| | | | | | | | | | | | | | | points." This reverts commit r327318. It breaks the Xcode and CMake Darwin builders: clang: error: no such file or directory: '.../source/Plugins/Architecture/PPC64/ArchitecturePPC64.cpp' clang: error: no input files More details are in https://reviews.llvm.org/D42582. llvm-svn: 327327
* Improve prologue handling to support functions with multiple entry points.Jim Ingham2018-03-121-0/+8
| | | | | | | | https://reviews.llvm.org/D42582 Patch from Leandro Lupori. llvm-svn: 327318
* [lldb] Unbreak lldb builds due to r327219Mandeep Singh Grang2018-03-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | Summary: r327219 adds wrappers to sort which shuffle the container before sorting. This causes lldb bots to break as the call to sort is now ambiguous: http://lab.llvm.org:8011/builders/lldb-x86_64-ubuntu-14.04-buildserver/builds/20725/steps/ninja%20build%20local/logs/stdio So we need use llvm::sort instead of sort to avoid ambiguity with std::sort. Note: This patch is just to unbreak the bots. I plan to have subsequent patches which will convert all calls to std::sort to llvm::sort. Reviewers: RKSimon, k8stone, jingham, labath, zturner Subscribers: andreadb, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D44354 llvm-svn: 327224
* Fix breakpoint thread name conditionals after breakpoint options refactor.Jim Ingham2018-02-231-4/+13
| | | | | | PR36435 llvm-svn: 325958
* Fix Breakpoint::RemoveInvalidLocations to fix the exec testcase.Jim Ingham2018-01-122-8/+37
| | | | | | | | | | | | | | | | | RemoveInvalidLocations was clearing out the m_locations in the breakpoint by hand, and it wasn't also clearing the locations from the address->location map, which confused us when we went to update breakpoint locations. I also made Breakpoint::ModulesChanged check the Location's Section to make sure it hadn't been deleted. This shouldn't strictly be necessary, but if the DynamicLoaderPlugin doesn't do it's job right (I'm looking at you new Darwin DynamicLoader...) then it can end up leaving stale locations on rerun. It doesn't hurt to clean them up here as a backstop. <rdar://problem/36134350> llvm-svn: 322348
* Move ArchSpec to the Utility modulePavel Labath2017-11-131-1/+1
| | | | | | | | | | | | | The rationale here is that ArchSpec is used throughout the codebase, including in places which should not depend on the rest of the code in the Core module. This commit touches many files, but most of it is just renaming of #include lines. In a couple of cases, I removed the #include ArchSpec line altogether, as the file was not using it. In one or two places, this necessitated adding other #includes like lldb-private-defines.h. llvm-svn: 318048
* Fix some warnings found by ToT clangPavel Labath2017-11-021-1/+0
| | | | | | | | These fall into two categories: - unused variables - (uint8_t *)NULL + X -- changed to reinterpret_cast(X) llvm-svn: 317270
* Wire up the breakpoint name help string.Jim Ingham2017-09-151-0/+3
| | | | llvm-svn: 313327
* Add new files to the cmake lists.Jim Ingham2017-09-141-0/+1
| | | | llvm-svn: 313293
* Make breakpoint names real entities.Jim Ingham2017-09-146-32/+245
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When introduced, breakpoint names were just tags that you could apply to breakpoints that would allow you to refer to a breakpoint when you couldn't capture the ID, or to refer to a collection of breakpoints. This change makes the names independent holders of breakpoint options that you can then apply to breakpoints when you add the name to the breakpoint. It adds the "breakpoint name configure" command to set up or reconfigure breakpoint names. There is also full support for then in the SB API, including a new SBBreakpointName class. The connection between the name and the breakpoints sharing the name remains live, so if you reconfigure the name, all the breakpoint options all change as well. This allows a quick way to share complex breakpoint behavior among a bunch of breakpoints, and a convenient way to iterate on the set. You can also create a name from a breakpoint, allowing a quick way to copy options from one breakpoint to another. I also added the ability to make hidden and delete/disable protected names. When applied to a breakpoint, you will only be able to list, delete or disable that breakpoint if you refer to it explicitly by ID. This feature will allow GUI's that need to use breakpoints for their own purposes to keep their breakpoints from getting accidentally disabled or deleted. <rdar://problem/22094452> llvm-svn: 313292
* Add an auto-continue flag to breakpoints & locations.Jim Ingham2017-08-033-7/+52
| | | | | | | | | | | | | | You can get a breakpoint to auto-continue by adding "continue" as a command, but that has the disadvantage that if you hit two breakpoints simultaneously, the continue will force the process to continue, and maybe even forstalling the commands on the other. The auto-continue flag means the breakpoints can negotiate about whether to stop. Writing tests, I wanted to supply some commands when I made the breakpoints, so I also added that ability. llvm-svn: 309969
* Fix a mis-feature with propagation of breakpoint options -> location options.Jim Ingham2017-08-023-71/+124
| | | | | | | | | | | | | | When an option was set at on a location, I was just copying the whole option set to the location, and letting it shadow the breakpoint options. That was wrong since it meant changes to unrelated options on the breakpoint would no longer take on this location. I added a mask of set options and use that for option propagation. I also added a "location" property to breakpoints, and added SBBreakpointLocation.{G,S}etCommandLineCommands since I wanted to use them to write some more test cases. <rdar://problem/24397798> llvm-svn: 309772
* Fix error string set in AddName to take a StringRef.Ted Woodward2017-05-171-2/+2
| | | | llvm-svn: 303278
* Update StructuredData::String to return StringRefs.Zachary Turner2017-05-127-23/+23
| | | | | | | | It was returning const std::string& which was leading to unnecessary copies all over the place, and preventing people from doing things like Dict->GetValueForKeyAsString("foo", ref); llvm-svn: 302875
* Rename Error -> Status.Zachary Turner2017-05-1212-23/+24
| | | | | | | | | | | | | | | 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
* iwyu fixes for lldbCore.Zachary Turner2017-04-061-0/+1
| | | | | | | | | | | | | | This adjusts header file includes for headers and source files in Core. In doing so, one dependency cycle is eliminated because all the includes from Core to that project were dead includes anyway. In places where some files in other projects were only compiling due to a transitive include from another header, fixups have been made so that those files also include the header they need. Tested on Windows and Linux, and plan to address failures on OSX and FreeBSD after watching the bots. llvm-svn: 299714
* Move StringList from Core -> Utility.Zachary Turner2017-03-212-2/+2
| | | | llvm-svn: 298412
* BreakpointResolverFileLine: Restrict move-to-nearest-code from moving across ↵Pavel Labath2017-03-151-16/+77
| | | | | | | | | | | | | | | | | | | | | | | | | function boundaries Summary: This fixes the case where a user tries to set a breakpoint on a source line outside of any function (e.g. because that code is #ifdefed out, or the compiler did not emit code for the function, etc.) and we would silently move the breakpoint to the next function. Now we check whether the line range of the resolved symbol context function matches the original line number. We reject any breakpoint locations that appear to move the breakpoint into a new function. This filtering only happens if we have full debug info available (e.g. in case of -gline-tables-only compilation, we still set the breakpoint on the nearest source line). Reviewers: jingham Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D30817 llvm-svn: 297817
* Move Log from Core -> Utility.Zachary Turner2017-03-037-7/+7
| | | | | | | | | All references to Host and Core have been removed, so this class can now safely be lowered into Utility. Differential Revision: https://reviews.llvm.org/D30559 llvm-svn: 296909
* [CMake] Adding API dependency on UtilityChris Bieneman2017-02-131-0/+1
| | | | | | Utility is directly referenced from Breakpoint. llvm-svn: 294987
* Move classes from Core -> Utility.Zachary Turner2017-02-0213-16/+16
| | | | | | | | | | | | | | | | | | | | | | | 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
* [CMake] Add accurate dependency specificationsChris Bieneman2017-01-311-0/+12
| | | | | | | | | | | | | | | | | Summary: This patch adds accurate dependency specifications to the mail LLDB libraries and tools. In all cases except lldb-server, these dependencies are added in addition to existing dependencies (making this low risk), and I performed some code cleanup along the way. For lldb-server I've cleaned up the LLVM dependencies down to just the minimum actually required. This is more than lldb-server actually directly references, and I've left a todo in the code to clean that up. Reviewers: labath, zturner Subscribers: lldb-commits, danalbert, srhines, ki.stfu, mgorny, jgosnell Differential Revision: https://reviews.llvm.org/D29333 llvm-svn: 293686
* Add methods to enable using formatv syntax in LLDB.Zachary Turner2016-12-161-2/+2
| | | | | | | | | | | | | This adds formatv-backed formatting functions in various places in LLDB such as StreamString, logging, constructing error messages, etc. A couple of callsites are changed from Printf style syntax to formatv style syntax to illustrate its usage. Additionally, a FileSpec formatter is introduced so that FileSpecs can be formatted natively. Differential Revision: https://reviews.llvm.org/D27632 llvm-svn: 289922
* Re-add "demonstrate new Args API"Zachary Turner2016-11-221-10/+7
| | | | | | This fixes the build breakage due to the use of C++14. llvm-svn: 287647
* Fix build failure on Linux and BSD by reverting r287597Omair Javaid2016-11-221-7/+10
| | | | | | Linux and BSD builds failing after this changes from rev 287597. llvm-svn: 287631
* Add the new Args / entry-access API.Zachary Turner2016-11-211-10/+7
| | | | | | | | | | | | The long-term goal here is to get rid of the functions GetArgumentAtIndex() and GetQuoteCharAtIndex(), instead replacing them with operator based access and range-based for enumeration. There are a lot of callsites, though, so the changes will be done incrementally, starting with this one. Differential Revision: https://reviews.llvm.org/D26883 llvm-svn: 287597
* Make ValueObjectMemory::Create accept StringRefs.Zachary Turner2016-11-121-3/+3
| | | | llvm-svn: 286726
* Convert some Expression parser functions to StringRef.Zachary Turner2016-11-082-2/+2
| | | | llvm-svn: 286208
* Fix Clang-tidy readability-redundant-string-cstr warningsMalcolm Parsons2016-11-022-2/+2
| | | | | | | | | | Reviewers: zturner, labath Subscribers: tberghammer, danalbert, lldb-commits Differential Revision: https://reviews.llvm.org/D26233 llvm-svn: 285855
* Fix a race condition between the "ephemeral watchpoint disabling" and ↵Jim Ingham2016-10-251-1/+1
| | | | | | | | commands the continue the process. This closes https://reviews.llvm.org/D25875. llvm-svn: 285114
* Revert "Fix a race condition between "ephemeral watchpoint disable/enable" ↵Pavel Labath2016-10-211-1/+1
| | | | | | | | | | | | | | | | | and continue in commands." This reverts commit r284795, as it breaks watchpoint handling on arm (and presumable all architectures that report watchpoint hits without executing the tripping instruction). There seems to be something fundamentally wrong with this patch: it uses process_sp->AddPreResumeAction to re-enable the watchpoint, but the whole point of the step-over-watchpoint logic (which AFAIK is the only user of this class) is to disable the watchpoint *after* we resume to do the single step. I have no idea how to fix this except by reverting the offending patch. llvm-svn: 284817
* Fix a race condition between "ephemeral watchpoint disable/enable" and ↵Jim Ingham2016-10-211-1/+1
| | | | | | | | | | continue in commands. Also, watchpoint commands, like breakpoint commands, need to run in async mode. This was causing intermittent failures in TestWatchpointCommandPython.py, which is now solid. llvm-svn: 284795
* Fix some test failures due to the recent Breakpoint patch.Zachary Turner2016-10-051-9/+3
| | | | llvm-svn: 283358
* Try to fix Android build.Zachary Turner2016-10-051-1/+1
| | | | | | | Seems it doesn't like the implicit conversion from StringRef[] to ArrayRef<StringRef>. llvm-svn: 283351
* Convert some breakpoint code to use StringRef.Zachary Turner2016-10-052-237/+178
| | | | | | Differential revision: https://reviews.llvm.org/D25158 llvm-svn: 283345
* Fix serialization of Python breakpoint commands.Jim Ingham2016-09-262-14/+58
| | | | | | | | | | | CommandData breakpoint commands didn't know whether they were Python or Command line commands, so they couldn't serialize & deserialize themselves properly. Fix that. I also changed the "breakpoint list" command to note in the output when the commands are Python commands. Fortunately only one test was relying on this explicit bit of text output. llvm-svn: 282432
* Add the ability to deserialize only breakpoints matching a given name.Jim Ingham2016-09-221-0/+35
| | | | | | Also tests for this and the ThreadSpec serialization. llvm-svn: 282207
* Serilize the thread options within the breakpoint options.Jim Ingham2016-09-221-4/+31
| | | | llvm-svn: 282205
* Make lldb::Regex use StringRef.Zachary Turner2016-09-214-13/+11
| | | | | | | | | | This updates getters and setters to use StringRef instead of const char *. I tested the build on Linux, Windows, and OSX and saw no build or test failures. I cannot test any BSD or Android variants, however I expect the required changes to be minimal or non-existant. llvm-svn: 282079
OpenPOWER on IntegriCloud