summaryrefslogtreecommitdiffstats
path: root/lldb/source/Breakpoint
Commit message (Collapse)AuthorAgeFilesLines
...
* Adds tests for breakpoint names, and a FindBreakpointsByName.Jim Ingham2016-09-211-0/+17
| | | | | | | | Also if you set a breakpoint with an invalid name, we'll refuse to set the breakpoint rather than silently ignoring the name. llvm-svn: 282043
* Add some more tests for breakpoint serialization.Jim Ingham2016-09-202-10/+74
| | | | | | | | | | Serialize breakpoint names & the hardware_requested attributes. Also added a few missing affordances to SBBreakpoint whose absence writing the tests pointed out. <rdar://problem/12611863> llvm-svn: 282036
* Fix more functions in Args to use StringRef.Zachary Turner2016-09-191-6/+6
| | | | | | | | | | | | | | | This patch also marks the const char* versions as =delete to prevent their use. This has the potential to cause build breakages on some platforms which I can't compile. I have tested on Windows, Linux, and OSX. Best practices for fixing broken callsites are outlined in Args.h in a comment above the deleted function declarations. Eventually we can remove these =delete declarations, but for now they are important to make sure that all implicit conversions from const char * are manually audited to make sure that they do not invoke a conversion from nullptr. llvm-svn: 281919
* Fix boolean logic error in BreakpointID.Zachary Turner2016-09-171-1/+1
| | | | llvm-svn: 281804
* Convert many functions to use StringRefs.Zachary Turner2016-09-174-10/+18
| | | | | | | | | | | | | Where possible, remove the const char* version. To keep the risk and impact here minimal, I've only done the simplest functions. In the process, I found a few opportunities for adding some unit tests, so I added those as well. Tested on Windows, Linux, and OSX. llvm-svn: 281799
* First tests for serializing breakpoints.Jim Ingham2016-09-161-1/+1
| | | | | | Plus a few bug fixes I found along the way. llvm-svn: 281690
* Make the keys enumerations for options and resolvers enum classes.Jim Ingham2016-09-152-7/+8
| | | | | | | This keeps them from conflicting with other symbols names, so it's worth their being less convenient to use for indexing. llvm-svn: 281569
* Fix some const-ness issues with BreakpointID & BreakpointIDList.Jim Ingham2016-09-141-4/+6
| | | | llvm-svn: 281519
* Some more pointer safety in Breakpoint.Zachary Turner2016-09-135-17/+31
| | | | | | | | | | | Plumb unique_ptrs<> all the way through the baton interface. NFC, this is a minor improvement to remove the possibility of an accidental pointer ownership issue. Reviewed By: jingham Differential Revision: https://reviews.llvm.org/D24495 llvm-svn: 281360
* Add a few const's (thanks Zachary) and return shared or unique pointersJim Ingham2016-09-137-27/+29
| | | | | | in places where they help prevent leaks. llvm-svn: 281288
* This is the main part of a change to add breakpoint save and restore to lldb.Jim Ingham2016-09-127-56/+810
| | | | | | | | | | | | | | | Still to come: 1) SB API's 2) Testcases 3) Loose ends: a) serialize Thread options b) serialize Exception resolvers 4) "break list --file" should list breakpoints contained in a file and "break read -f 1 3 5" should then read in only those breakpoints. <rdar://problem/12611863> llvm-svn: 281273
* *** This commit represents a complete reformatting of the LLDB source codeKate Stone2016-09-0621-4805/+3758
| | | | | | | | | | | | | | | | | | | | | | | *** 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
* Errors compiling breakpoint conditions will cause the breakpoint not to be hitJim Ingham2016-08-031-2/+3
| | | | | | | | | This was a shadowed variable error from the big Expression Parser plugin-ification. I also added a test case for this. <rdar://problem/27682376> llvm-svn: 277662
* Centralize the way symbol and functions are looked up by making a ↵Greg Clayton2016-07-131-44/+18
| | | | | | | | | | | | | | Module::LookupInfo class that does all of the heavy lifting. Background: symbols and functions can be looked up by full mangled name and by basename. SymbolFile and ObjectFile are expected to be able to do the lookups based on full mangled name or by basename, so when the user types something that is incomplete, we must be able to look it up efficiently. For example the user types "a::b::c" as a symbol to set a breakpoint on, we will break this down into a 'lookup "c"' and then weed out N matches down to just the ones that match "a::b::c". Previously this was done manaully in many functions by calling Module::PrepareForFunctionNameLookup(...) and then doing the lookup and manually pruning the results down afterward with duplicated code. Now all places use Module::LookupInfo to do the work in one place. This allowed me to fix the name lookups to look for "func" with eFunctionNameTypeFull as the "name_type_mask", and correctly weed the results: "func", "func()", "func(int)", "a::func()", "b::func()", and "a::b::func()" down to just "func", "func()", "func(int)". Previously we would have set 6 breakpoints, now we correctly set just 3. This also extends to the expression parser when it looks up names for functions it needs to not get multiple results so we can call the correct function. <rdar://problem/24599697> llvm-svn: 275281
* Lock the access to the BreakpointLocationCollection.Jim Ingham2016-05-261-1/+9
| | | | | | | | | | | | I was investigating an odd crash in lldb when the breakpoint site goes to bump the hit counts of the locations it implements. I noticed that the BreakpointLocationCollection wasn't locking itself for access and modification. I don't see how that can cause the crash I'm seeing, but still this is the right thing to do... <rdar://problem/25178205> llvm-svn: 270939
* second pass over removal of Mutex and ConditionSaleem Abdulrasool2016-05-194-65/+52
| | | | llvm-svn: 270024
* remove use of Mutex in favour of std::{,recursive_}mutexSaleem Abdulrasool2016-05-183-61/+52
| | | | | | | | | | This is a pretty straightforward first pass over removing a number of uses of Mutex in favor of std::mutex or std::recursive_mutex. The problem is that there are interfaces which take Mutex::Locker & to lock internal locks. This patch cleans up most of the easy cases. The only non-trivial change is in CommandObjectTarget.cpp where a Mutex::Locker was split into two. llvm-svn: 269877
* Keep original source path and mapped path in LineEntryTed Woodward2016-05-111-1/+4
| | | | | | | | | | | | | | | | | Summary: The "file" variable in a LineEntry was mapped using target.source-map, except when stepping through inlined code. This patch adds a new variable to LineEntry, "original_file", that contains the original file from the debug info. "file" will continue to (possibly) be mapped. Some code has been changed to use "original_file". This is code dealing with symbols. Code dealing with source files will still use "file". Reviewers, please confirm that these particular changes are correct. Tests run on Ubuntu 12.04 show no regression. Reviewers: clayborg, jingham Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D20135 llvm-svn: 269250
* Add the ability to limit "source regexp" breakpoints to a particular functionJim Ingham2016-04-281-2/+36
| | | | | | | | | | | | within a source file. This isn't done, I need to make the name match smarter (right now it requires an exact match which is annoying for methods of a class in a namespace. Also, though we use it in tests all over the place, it doesn't look like we have a test for Source Regexp breakpoints by themselves, I'll add that in a follow-on patch. llvm-svn: 267834
* Breakpoint conditions were making result variables, which they should not do. Jim Ingham2016-04-121-0/+1
| | | | | | | | | | | | | | The result variables aren't useful, and if you have a breakpoint on a common function you can generate a lot of these. So I changed the code that checks the condition to set ResultVariableIsInternal in the EvaluateExpressionOptions that we pass to the execution. Unfortunately, the check for this variable was done in the wrong place (the static UserExpression::Evaluate) which is not how breakpoint conditions execute expressions (UserExpression::Execute). So I moved the check to UserExpression::Execute (which Evaluate also calls) and made the overridden method DoExecute. llvm-svn: 266093
* Add a DiagnosticManager replace error streams in the expression parser.Sean Callanan2016-03-191-26/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We want to do a better job presenting errors that occur when evaluating expressions. Key to this effort is getting away from a model where all errors are spat out onto a stream where the client has to take or leave all of them. To this end, this patch adds a new class, DiagnosticManager, which contains errors produced by the compiler or by LLDB as an expression is created. The DiagnosticManager can dump itself to a log as well as to a string. Clients will (in the future) be able to filter out the errors they're interested in by ID or present subsets of these errors to the user. This patch is not intended to change the *users* of errors - only to thread DiagnosticManagers to all the places where streams are used. I also attempt to standardize our use of errors a bit, removing trailing newlines and making clients omit 'error:', 'warning:' etc. and instead pass the Severity flag. The patch is testsuite-neutral, with modifications to one part of the MI tests because it relied on "error: error:" being erroneously printed. This patch fixes the MI variable handling and the testcase. <rdar://problem/22864976> llvm-svn: 263859
* Add an "offset" option to "break set -n" and "break set -f -l". Jim Ingham2016-03-094-16/+46
| | | | | | | | | | | | That way you can set offset breakpoints that will move as the function they are contained in moves (which address breakpoints can't do...) I don't align the new address to instruction boundaries yet, so you have to get this right yourself for now. <rdar://problem/13365575> llvm-svn: 263049
* Remove autoconf support from source directories.Eugene Zelenko2016-01-281-14/+0
| | | | | | Differential revision: http://reviews.llvm.org/D16662 llvm-svn: 259098
* Make the Language print the description of the Exception Breakpoint ↵Jim Ingham2015-12-181-1/+4
| | | | | | | | | | | resolver. Also have the breakpoint description print the precondition description if one exists. No behavior change. <rdar://problem/22885189> llvm-svn: 255972
* Rework breakpoint language filtering to use the symbol context's language.Dawn Perchik2015-12-161-28/+5
| | | | | | | | | | | | | | | | This patch reworks the breakpoint filter-by-language patch to use the symbol context instead of trying to guess the language solely from the symbol's name. This has the advantage that symbols compiled with debug info will have their actual language known. Symbols without debug info will still do the same "guess"ing because Symbol::GetLanguage() is implemented using Mangled::GuessLanguage(). The recognition of ObjC names was merged into Mangled::GuessLanguage. Reviewed by: jingham, clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D15326 llvm-svn: 255808
* Fix watchpoint check to use watchpoint rangesTed Woodward2015-12-071-1/+6
| | | | | | | | | | | | Summary: Watchpoints, unlike breakpoints, have an address range. This patch changes WatchpointList::FindByAddress() to match on any address in the watchpoint range, instead of only matching on the watchpoint's base address. Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D14932 llvm-svn: 254931
* Fix breakpoint language filtering for other C variants (like C99) and Pascal.Dawn Perchik2015-12-041-2/+9
| | | | | | | | | | | | | | | This patch fixes setting breakpoints on symbol for variants of C and Pascal where the language is "unknown" within the filter-by-language process added in r252356. It also renames GetLanguageForSymbolByName to GuessLanguageForSymbolByName and adds comments explaining the pitfalls of the flawed assumption that the language can be determined solely from the name and target. Reviewed by: jingham Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D15175 llvm-svn: 254753
* Add the ability (through the SB API & command line) to specify an addressJim Ingham2015-11-171-17/+73
| | | | | | | | breakpoint as "file address" so that the address breakpoint will track that module even if it gets loaded in a different place. Also fixed the Address breakpoint resolver so that it handles this tracking correctly. llvm-svn: 253308
* Make the language specifier to "break set" actually filter the names by ↵Jim Ingham2015-11-061-3/+43
| | | | | | | | | | | | | their language. So for instance: break set -l c++ -r Name will only break on C++ symbols that match Name, not ObjC or plain C symbols. This also works for "break set -n" and there are SB API's to pass this as well. llvm-svn: 252356
* [LLDB][Watchpoint] Change ignore_count condition location to fix watchpoint ↵Mohit K. Bhakkad2015-11-031-3/+0
| | | | | | | | | | ignore feature for architectures with watchpoint_exceptions_received=before Reviewers: jingham. Subscribers: clayborg, jaydeep, bhushan, sagar, nitesh.jain, lldb-commits. Differential Revision: http://reviews.llvm.org/D13296 llvm-svn: 251905
* Add the ability to pass an EvaluateExpressionOptions when you make a ↵Jim Ingham2015-11-032-0/+2
| | | | | | | | UserExpression. This isn't used in this commit but will be in a future commit. llvm-svn: 251887
* Abstract the notion of the truth value of an expression result, for useJim Ingham2015-10-311-9/+11
| | | | | | in breakpoint conditions. llvm-svn: 251727
* Fix Clang-tidy modernize-use-nullptr warnings in source/Breakpoint; other ↵Eugene Zelenko2015-10-3011-209/+142
| | | | | | minor fixes. llvm-svn: 251716
* [LLDB] Fix display of value of a vector variables in watchpoint operationsMohit K. Bhakkad2015-10-091-3/+20
| | | | | | | | Reviewers: clayborg, zturner. Subscribers: jaydeep, bhushan, sagar, nitesh.jain, brucem,lldb-commits. Differential Revision: http://reviews.llvm.org/D13202 llvm-svn: 249838
* Further reduction of Clang-related header inclusion.Bruce Mitchener2015-09-211-0/+1
| | | | | | | | | | Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13018 llvm-svn: 248176
* This patch makes Clang-independent base classes for all the expression types ↵Jim Ingham2015-09-154-9/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | that lldb currently vends. Before we had: ClangFunction ClangUtilityFunction ClangUserExpression and code all over in lldb that explicitly made Clang-based expressions. This patch adds an Expression base class, and three pure virtual implementations for the Expression kinds: FunctionCaller UtilityFunction UserExpression You can request one of these expression types from the Target using the Get<ExpressionType>ForLanguage. The Target will then consult all the registered TypeSystem plugins, and if the type system that matches the language can make an expression of that kind, it will do so and return it. Because all of the real expression types need to communicate with their ExpressionParser in a uniform way, I also added a ExpressionTypeSystemHelper class that expressions generically can vend, and a ClangExpressionHelper that encapsulates the operations that the ClangExpressionParser needs to perform on the ClangExpression types. Then each of the Clang* expression kinds constructs the appropriate helper to do what it needs. The patch also fixes a wart in the UtilityFunction that to use it you had to create a parallel FunctionCaller to actually call the function made by the UtilityFunction. Now the UtilityFunction can be asked to vend a FunctionCaller that will run its function. This cleaned up a lot of boiler plate code using UtilityFunctions. Note, in this patch all the expression types explicitly depend on the LLVM JIT and IR, and all the common JIT running code is in the FunctionCaller etc base classes. At some point we could also abstract that dependency but I don't see us adding another back end in the near term, so I'll leave that exercise till it is actually necessary. llvm-svn: 247720
* This patch separates the generic portion of ClangExpressionVariable, whichSean Callanan2015-09-041-1/+1
| | | | | | | | | stores information about a variable that different parts of LLDB use, from the compiler-specific portion that only the expression parser cares about. http://reviews.llvm.org/D12602 llvm-svn: 246871
* [cmake] Remove LLVM_NO_RTTI.Bruce Mitchener2015-09-031-2/+0
| | | | | | | | | | | | | | Summary: This doesn't exist in other LLVM projects any longer and doesn't do anything. Reviewers: chaoren, labath Subscribers: emaste, tberghammer, lldb-commits, danalbert Differential Revision: http://reviews.llvm.org/D12586 llvm-svn: 246749
* Move more functionality from the LanguageRuntimes to the Languages.Jim Ingham2015-09-021-2/+2
| | | | llvm-svn: 246616
* Final bit of type system cleanup that abstracts declaration contexts into ↵Greg Clayton2015-08-241-1/+0
| | | | | | | | | | | | | | | | | | | | lldb_private::CompilerDeclContext and renames ClangType to CompilerType in many accessors and functions. Create a new "lldb_private::CompilerDeclContext" class that will replace all direct uses of "clang::DeclContext" when used in compiler agnostic code, yet still allow for conversion to clang::DeclContext subclasses by clang specific code. This completes the abstraction of type parsing by removing all "clang::" references from the SymbolFileDWARF. The new "lldb_private::CompilerDeclContext" class abstracts decl contexts found in compiler type systems so they can be used in internal API calls. The TypeSystem is required to support CompilerDeclContexts with new pure virtual functions that start with "DeclContext" in the member function names. Converted all code that used lldb_private::ClangNamespaceDecl over to use the new CompilerDeclContext class and removed the ClangNamespaceDecl.cpp and ClangNamespaceDecl.h files. Removed direct use of clang APIs from SBType and now use the abstract type systems to correctly explore types. Bulk renames for things that used to return a ClangASTType which is now CompilerType: "Type::GetClangFullType()" to "Type::GetFullCompilerType()" "Type::GetClangLayoutType()" to "Type::GetLayoutCompilerType()" "Type::GetClangForwardType()" to "Type::GetForwardCompilerType()" "Value::GetClangType()" to "Value::GetCompilerType()" "Value::SetClangType (const CompilerType &)" to "Value::SetCompilerType (const CompilerType &)" "ValueObject::GetClangType ()" to "ValueObject::GetCompilerType()" many more renames that are similar. llvm-svn: 245905
* ClangASTType is now CompilerType.Greg Clayton2015-08-111-1/+1
| | | | | | This is more preparation for multiple different kinds of types from different compilers (clang, Pascal, Go, RenderScript, Swift, etc). llvm-svn: 244689
* Add a function to make a mutex-protected copy of a breakpoint site'sJim Ingham2015-07-291-0/+11
| | | | | | | | | | owners list, so the StopInfo machinery can get the list of owners without some other thread being able to mess up the list by deleting/disabline one of its locations in the process of doing so. <rdar://problem/18685197> llvm-svn: 243541
* Lock the owners mutex in the BreakpointSite before updating the hitJim Ingham2015-07-291-0/+1
| | | | | | | | | | counts. If you delete a breakpoint belonging to a site just as you are processing a hit on that site, you could cause the BreakpointSite loop to access a now deleted location. <rdar://problem/19310323> llvm-svn: 243507
* Add support for specifying a language to use when parsing breakpoints.Dawn Perchik2015-07-211-1/+10
| | | | | | | | | | | | | | | | | | | | Target and breakpoints options were added: breakpoint set --language lang --name func settings set target.language pascal These specify the Language to use when interpreting the breakpoint's expression (note: currently only implemented for breakpoints on identifiers). If the breakpoint language is not set, the target.language setting is used. This support is required by Pascal, for example, to set breakpoint at 'ns.foo' for function 'foo' in namespace 'ns'. Tests on the language were also added to Module::PrepareForFunctionNameLookup for efficiency. Reviewed by: clayborg Subscribers: jingham, lldb-commits Differential Revision: http://reviews.llvm.org/D11119 llvm-svn: 242844
* Make many mangled functions that might demangle a name be allowed to specify ↵Greg Clayton2015-07-081-2/+2
| | | | | | a language to use in order to soon support Pascal and Java demangling. Dawn Perchik will take care of making this so. llvm-svn: 241751
* Don't #include "lldb-python.h" from anywhere.Zachary Turner2015-05-291-2/+0
| | | | | | | | | | | | | Since interaction with the python interpreter is moving towards being more isolated, we won't be able to include this header from normal files anymore, all includes of it should be localized to the python library which will live under source/bindings/API/Python after a future patch. None of the files that were including this header actually depended on it anyway, so it was just a dead include in every single instance. llvm-svn: 238581
* Fix BreakpointLocationCollection::ShouldStop to handle breakpoint removalTamas Berghammer2015-05-271-2/+8
| | | | | | Differential revision: http://reviews.llvm.org/D9886 llvm-svn: 238308
* Add --move-to-nearest-code / target.move-to-nearest-code options (attempt 2)Ilia K2015-05-182-11/+15
| | | | | | | | | | | | This patch initially was committed in r237460 but later it was reverted (r237479) due to 4 new failures: * TestExitDuringStep.py * TestNumThreads.py * TestThreadExit.py * TestThreadStates.py This patch also fixes these tests. llvm-svn: 237566
* Reverting r237460 to fix test failures introduced on OSX & LinuxVince Harron2015-05-152-15/+11
| | | | | | | | | TestExitDuringStep.py TestNumThreads.py TestThreadExit.py TestThreadStates.py llvm-svn: 237479
* Add --move-to-nearest-code / target.move-to-nearest-code optionsIlia K2015-05-152-11/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This option forces to only set a source line breakpoint when there is an exact-match This patch includes the following commits: # Add the -m/--exact-match option in "breakpoint set" command ## Add exact_match arg in BreakpointResolverFileLine ctor ## Add m_exact_match field in BreakpointResolverFileLine ## Add exact_match arg in BreakpointResolverFileRegex ctor ## Add m_exact_match field in BreakpointResolverFileRegex ## Add exact_match arg in Target::CreateSourceRegexBreakpoint ## Add exact_match arg in Target::CreateBreakpoint ## Add -m/--exact-match option in "breakpoint set" command # Add target.exact-match option to skip BP if source line doesn't match ## Add target.exact-match global option ## Add Target::GetExactMatch ## Refactor Target::CreateSourceRegexBreakpoint to accept LazyBool exact_match (was bool) ## Refactor Target::CreateBreakpoint to accept LazyBool exact_match (was bool) # Add target.exact-match test in SettingsCommandTestCase # Add BreakpointOptionsTestCase tests to test --skip-prologue/--exact-match options # Fix a few typos in lldbutil.check_breakpoint_result func # Rename --exact-match/m_exact_match/exact_match/GetExactMatch to --move-to-nearest-code/m_move_to_nearest_code/move_to_nearest_code/GetMoveToNearestCode # Add exact_match field in BreakpointResolverFileLine::GetDescription and BreakpointResolverFileRegex::GetDescription, for example: was: ``` 1: file = '/Users/IliaK/p/llvm/tools/lldb/test/functionalities/breakpoint/breakpoint_command/main.c', line = 12, locations = 1, resolved = 1, hit count = 2 1.1: where = a.out`main + 20 at main.c:12, address = 0x0000000100000eb4, resolved, hit count = 2 ``` now: ``` 1: file = '/Users/IliaK/p/llvm/tools/lldb/test/functionalities/breakpoint/breakpoint_command/main.c', line = 12, exact_match = 0, locations = 1, resolved = 1, hit count = 2 1.1: where = a.out`main + 20 at main.c:12, address = 0x0000000100000eb4, resolved, hit count = 2 ``` Test Plan: ./dotest.py -v --executable $BUILDDIR/bin/lldb functionalities/breakpoint/ ./dotest.py -v --executable $BUILDDIR/bin/lldb settings/ ./dotest.py -v --executable $BUILDDIR/bin/lldb tools/lldb-mi/breakpoint/ Reviewers: jingham, clayborg Reviewed By: clayborg Subscribers: lldb-commits, clayborg, jingham Differential Revision: http://reviews.llvm.org/D9273 llvm-svn: 237460
OpenPOWER on IntegriCloud