summaryrefslogtreecommitdiffstats
path: root/lldb/source/Breakpoint/BreakpointLocationList.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove redundant ::get() for smart pointer. (NFC)Jonas Devlieghere2019-02-121-1/+1
| | | | | | | | This commit removes redundant calls to smart pointer’s ::get() method. https://clang.llvm.org/extra/clang-tidy/checks/readability-redundant-smartptr-get.html llvm-svn: 353795
* 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-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix Breakpoint::RemoveInvalidLocations to fix the exec testcase.Jim Ingham2018-01-121-6/+12
| | | | | | | | | | | | | | | | | 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
* *** This commit represents a complete reformatting of the LLDB source codeKate Stone2016-09-061-278/+225
| | | | | | | | | | | | | | | | | | | | | | | *** 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
* remove use of Mutex in favour of std::{,recursive_}mutexSaleem Abdulrasool2016-05-181-25/+20
| | | | | | | | | | 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
* Fix Clang-tidy modernize-use-nullptr warnings in source/Breakpoint; other ↵Eugene Zelenko2015-10-301-11/+5
| | | | | | minor fixes. llvm-svn: 251716
* Rework how resetting breakpoints in changed modules works. Try to match up oldJim Ingham2014-09-101-0/+27
| | | | | | | | locations with new ones if possible. Next up some test cases... llvm-svn: 217551
* sweep up -Wformat warnings from gccSaleem Abdulrasool2014-04-041-1/+1
| | | | | | | This is a purely mechanical change explicitly casting any parameters for printf style conversion. This cleans up the warnings emitted by gcc 4.8 on Linux. llvm-svn: 205607
* Get the breakpoint setting, and the Mac OS X DYLD trampolines and expression ↵Jim Ingham2014-01-101-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | evaluator to handle Indirect symbols correctly. There were a couple of pieces to this. 1) When a breakpoint location finds itself pointing to an Indirect symbol, when the site for it is created it needs to resolve the symbol and actually set the site at its target. 2) Not all breakpoints want to do this (i.e. a straight address breakpoint should always set itself on the specified address, so somem machinery was needed to specify that. 3) I added some info to the break list output for indirect symbols so you could see what was happening. Also I made it clear when we re-route through re-exported symbols. 4) I moved ResolveIndirectFunction from ProcessPosix to Process since it works the exact same way on Mac OS X and the other posix systems. If we find a platform that doesn't do it this way, they can override the call in Process. 5) Fixed one bug in RunThreadPlan, if you were trying to run a thread plan after a "running" event had been broadcast, the event coalescing would cause you to miss the ThreadPlan running event. So I added a way to override the coalescing. 6) Made DynamicLoaderMacOSXDYLD::GetStepThroughTrampolinePlan handle Indirect & Re-exported symbols. <rdar://problem/15280639> llvm-svn: 198976
* For logical backtrace work, lldb needs to track Module unloads etc & ↵Greg Clayton2013-12-061-0/+2
| | | | | | | | | | symoblicate an address based on a point in time <rdar://problem/15314403> This patch adds a new lldb_private::SectionLoadHistory class that tracks what shared libraries were loaded given a process stop ID. This allows us to keep a history of the sections that were loaded for a time T. Many items in history objects will rely upon the process stop ID in the future. llvm-svn: 196557
* <rdar://problem/15566148>Greg Clayton2013-12-031-8/+5
| | | | | | Fix use of std::lower_bound to check for equality if a match is found to ensure we don't return the next breakpoint with an ID greater than the break_id that was asked for. llvm-svn: 196298
* Remove the bad assumption that breakpoint locations won't get deleted in ↵Jim Ingham2013-12-031-8/+14
| | | | | | | | BreakpointLocationList::FindByID. <rdar://problem/15566148> llvm-svn: 196197
* Fixed the the breakpoint test case failures. Greg Clayton2013-11-091-1/+38
| | | | | | There were 6 on darwin. All of these were related to the recent changes for exec. llvm-svn: 194298
* <rdar://problem/13635174>Greg Clayton2013-10-111-1/+1
| | | | | | | | Added a way to set hardware breakpoints from the "breakpoint set" command with the new "--hardware" option. Hardware breakpoints are not a request, they currently are a requirement. So when breakpoints are specified as hardware breakpoints, they might fail to be set when they are able to be resolved and should be used sparingly. This is currently hooked up for GDB remote debugging. Linux and FreeBSD should quickly enable this feature if possible, or return an error for any breakpoints that are hardware breakpoint sites in the "virtual Error Process::EnableBreakpointSite (BreakpointSite *bp_site);" function. llvm-svn: 192491
* Fix Rendezvous breakpoint to only be set once, resolve addr in ↵Michael Sartain2013-07-161-1/+20
| | | | | | | | BreakpointLocationList::FindByAddress Differential Revision: http://llvm-reviews.chandlerc.com/D1145 llvm-svn: 186458
* <rdar://problem/13069948>Greg Clayton2013-01-251-2/+2
| | | | | | | | | | | | 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
* Resolve printf formatting warnings on Linux:Daniel Malea2012-11-291-1/+1
| | | | | | | | - use macros from inttypes.h for format strings instead of OS-specific types Patch from Matt Kopec! llvm-svn: 168945
* Stop using the "%z" size_t modifier and cast all size_t values to uint64_t. ↵Greg Clayton2012-09-181-1/+1
| | | | | | Some platforms don't support this modification. llvm-svn: 164148
* <rdar://problem/11757916>Greg Clayton2012-08-291-2/+1
| | | | | | | | | | | | Make breakpoint setting by file and line much more efficient by only looking for inlined breakpoint locations if we are setting a breakpoint in anything but a source implementation file. Implementing this complex for a many reasons. Turns out that parsing compile units lazily had some issues with respect to how we need to do things with DWARF in .o files. So the fixes in the checkin for this makes these changes: - Add a new setting called "target.inline-breakpoint-strategy" which can be set to "never", "always", or "headers". "never" will never try and set any inlined breakpoints (fastest). "always" always looks for inlined breakpoint locations (slowest, but most accurate). "headers", which is the default setting, will only look for inlined breakpoint locations if the breakpoint is set in what are consudered to be header files, which is realy defined as "not in an implementation source file". - modify the breakpoint setting by file and line to check the current "target.inline-breakpoint-strategy" setting and act accordingly - Modify compile units to be able to get their language and other info lazily. This allows us to create compile units from the debug map and not have to fill all of the details in, and then lazily discover this information as we go on debuggging. This is needed to avoid parsing all .o files when setting breakpoints in implementation only files (no inlines). Otherwise we would need to parse the .o file, the object file (mach-o in our case) and the symbol file (DWARF in the object file) just to see what the compile unit was. - modify the "SymbolFileDWARFDebugMap" to subclass lldb_private::Module so that the virtual "GetObjectFile()" and "GetSymbolVendor()" functions can be intercepted when the .o file contenst are later lazilly needed. Prior to this fix, when we first instantiated the "SymbolFileDWARFDebugMap" class, we would also make modules, object files and symbol files for every .o file in the debug map because we needed to fix up the sections in the .o files with information that is in the executable debug map. Now we lazily do this in the DebugMapModule::GetObjectFile() Cleaned up header includes a bit as well. llvm-svn: 162860
* Initialize ivars in the order they are defined in the class.Bill Wendling2012-04-031-3/+3
| | | | llvm-svn: 153931
* <rdar://problem/10103468>Greg Clayton2012-02-241-4/+28
| | | | | | | | | | | | | | | | | | | | | | | | | I started work on being able to add symbol files after a debug session had started with a new "target symfile add" command and quickly ran into problems with stale Address objects in breakpoint locations that had lldb_private::Section pointers into modules that had been removed or replaced. This also let to grabbing stale modules from those sections. So I needed to thread harded the Address, Section and related objects. To do this I modified the ModuleChild class to now require a ModuleSP on initialization so that a weak reference can created. I also changed all places that were handing out "Section *" to have them hand out SectionSP. All ObjectFile, SymbolFile and SymbolVendors were inheriting from ModuleChild so all of the find plug-in, static creation function and constructors now require ModuleSP references instead of Module *. Address objects now have weak references to their sections which can safely go stale when a module gets destructed. This checkin doesn't complete the "target symfile add" command, but it does get us a lot clioser to being able to do such things without a high risk of crashing or memory corruption. llvm-svn: 151336
* Send Breakpoint Changed events for all the relevant changes to breakpoints.Jim Ingham2012-02-081-4/+48
| | | | | | | Also, provide and use accessors for the thread options on breakpoints so we can control sending the appropriate events. llvm-svn: 150057
* Update declarations for all functions/methods that accept printf-styleJason Molenda2011-09-201-1/+1
| | | | | | | | stdarg formats to use __attribute__ format so the compiler can flag incorrect uses. Fix all incorrect uses. Most of these are innocuous, a few were resulting in crashes. llvm-svn: 140185
* Silence the static analyzer.Johnny Chen2011-08-111-11/+2
| | | | llvm-svn: 137360
* Added more platform support. There are now some new commands:Greg Clayton2011-03-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | platform status -- gets status information for the selected platform platform create <platform-name> -- creates a new instance of a remote platform platform list -- list all available platforms platform select -- select a platform instance as the current platform (not working yet) When using "platform create" it will create a remote platform and make it the selected platform. For instances for iPhone OS debugging on Mac OS X one can do: (lldb) platform create remote-ios --sdk-version=4.0 Remote platform: iOS platform SDK version: 4.0 SDK path: "/Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.0" Not connected to a remote device. (lldb) file ~/Documents/a.out Current executable set to '~/Documents/a.out' (armv6). (lldb) image list [ 0] /Volumes/work/gclayton/Documents/devb/attach/a.out [ 1] /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.0/Symbols/usr/lib/dyld [ 2] /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.0/Symbols/usr/lib/libSystem.B.dylib Note that this is all happening prior to running _or_ connecting to a remote platform. Once connected to a remote platform the OS version might change which means we will need to update our dependecies. Also once we run, we will need to match up the actualy binaries with the actualy UUID's to files in the SDK, or download and cache them locally. This is just the start of the remote platforms, but this modification is the first iteration in getting the platforms really doing something. llvm-svn: 127934
* Fixed the BreakpointLocationList to be able to do O(1) lookups on breakpointGreg Clayton2011-02-051-114/+30
| | | | | | locations by ID. It used to be, worst case, O(N). llvm-svn: 124914
* Don't re-insert disabled breakpoint locations.Jim Ingham2010-10-201-1/+4
| | | | llvm-svn: 116908
* Added needed breakpoint functionality to the public API that includes:Greg Clayton2010-07-231-0/+11
| | | | | | | | | | SBTarget: - get breakpoint count - get breakpoint at index SBBreakpoint: - Extract data from breakpoint events llvm-svn: 109289
* Merged Eli Friedman's linux build changes where he added Makefile files thatGreg Clayton2010-07-091-19/+12
| | | | | | | enabled LLVM make style building and made this compile LLDB on Mac OS X. We can now iterate on this to make the build work on both linux and macosx. llvm-svn: 108009
* Initial checkin of lldb code from internal Apple repo.Chris Lattner2010-06-081-0/+305
llvm-svn: 105619
OpenPOWER on IntegriCloud