summaryrefslogtreecommitdiffstats
path: root/lldb/source/Breakpoint
Commit message (Collapse)AuthorAgeFilesLines
...
* Optimized the way breakpoint conditions are evaluated.Sean Callanan2013-04-192-23/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the options for a breakopint or its locations stored only the text of the breakpoint condition (ironically, they used ClangUserExpression as a glorified std::string) and, each time the condition had to be evaluated in the StopInfo code, the expression parser would be invoked via a static method to parse and then execute the expression. I made several changes here: - Each breakpoint location now has its own ClangUserExpressionSP containing a version of the breakpoint expression compiled for that exact location. - Whenever the breakpoint is hit, the breakpoint condition expression is simply re-run to determine whether to stop. - If the process changes (e.g., it's re-run) or the source code of the expression changes (we use a hash so as to avoid doing string comparisons) the ClangUserExpressionSP is re-generated. This should improve performance of breakpoint conditions significantly, and takes advantage of the recent expression re-use work. llvm-svn: 179838
* Since we use C++11, we should switch over to using std::unique_ptr when ↵Greg Clayton2013-04-182-5/+5
| | | | | | | | C++11 is being used. To do this, we follow what we have done for shared pointers and we define a STD_UNIQUE_PTR macro that can be used and it will "do the right thing". Due to some API differences in std::unique_ptr and due to the fact that we need to be able to compile without C++11, we can't use move semantics so some code needed to change so that it can compile with either C++. Anyone wanting to use a unique_ptr or auto_ptr should now use the "STD_UNIQUE_PTR(TYPE)" macro. llvm-svn: 179779
* <rdar://problem/13506727> Greg Clayton2013-04-031-57/+97
| | | | | | | | | | | | Symbol table function names should support lookups like symbols with debug info. To fix this I: - Gutted the way FindFunctions is used, there used to be way too much smarts only in the DWARF plug-in - Made it more efficient by chopping the name up once and using simpler queries so that SymbolFile and Symtab plug-ins don't need to do as much - Filter the results at a higher level - Make the lldb_private::Symtab able to chop up C++ mangled names and make as much sense out of them as possible and also be able to search by basename, fullname, method name, and selector name. llvm-svn: 178608
* <rdar://problem/13521159>Greg Clayton2013-03-276-8/+8
| | | | | | | | LLDB is crashing when logging is enabled from lldb-perf-clang. This has to do with the global destructor chain as the process and its threads are being torn down. All logging channels now make one and only one instance that is kept in a global pointer which is never freed. This guarantees that logging can correctly continue as the process tears itself down. llvm-svn: 178191
* For file & line breakpoints, if there are subsets of contiguous line table ↵Jim Ingham2013-03-121-51/+67
| | | | | | | | entries for the specified line, set the breakpoint on the first one of each of the contiguous sub-sets of entries, and not all the others. llvm-svn: 176846
* Adding CMake build system to LLDB. Some known issues remain:Daniel Malea2013-02-211-0/+25
| | | | | | | | | | | | | | - generate-vers.pl has to be called by cmake to generate the version number - parallel builds not yet supported; dependency on clang must be explicitly specified Tested on Linux. - Building on Mac will require code-signing logic to be implemented. - Building on Windows will require OS-detection logic and some selective directory inclusion Thanks to Carlo Kok (who originally prepared these CMakefiles for Windows) and Ben Langmuir who ported them to Linux! llvm-svn: 175795
* Probably should return that value we took the trouble to compute.Jim Ingham2013-02-141-1/+1
| | | | llvm-svn: 175125
* <rdar://problem/9141269>Greg Clayton2013-01-301-4/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cleaned up the objective C name parsing code to use a class. Now breakpoints that are set by name that are objective C methods without the leading '+' or '-' will resolve. We do this by expanding all the objective C names for a given string. For example: (lldb) b [MyString cStringUsingEncoding:] Will set a breakpoint with multiple possible names: -[MyString cStringUsingEncoding:] +[MyString cStringUsingEncoding:] Also if you have a category, it will strip the category and set a breakpoint in all variants: (lldb) [MyString(my_category) cStringUsingEncoding:] Will resolve to the following names: -[MyString(my_category) cStringUsingEncoding:] +[MyString(my_category) cStringUsingEncoding:] -[MyString cStringUsingEncoding:] +[MyString cStringUsingEncoding:] Likewise when we have: (lldb) b -[MyString(my_category) cStringUsingEncoding:] It will resolve to two names: -[MyString(my_category) cStringUsingEncoding:] -[MyString cStringUsingEncoding:] llvm-svn: 173858
* Add "target.process.stop-on-shared-library-events" setting, and make it work.Jim Ingham2013-01-263-4/+38
| | | | | | | | | | | Add the ability to give breakpoints a "kind" string, and have the StopInfoBreakpoint print that in the brief description if set. Also print the kind - if set - in the breakpoint listing. Give kinds to a bunch of the internal breakpoints. We were deleting the Mac OS X dynamic loader breakpoint as though the id we had stored away was a breakpoint site ID, but in fact it was a breakpoint id, so we never actually deleted it. Fixed that. llvm-svn: 173555
* <rdar://problem/13069948>Greg Clayton2013-01-259-38/+35
| | | | | | | | | | | | 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
* Check for NULL breakpoint option thread name & queue name before comparing ↵Jim Ingham2013-01-231-2/+4
| | | | | | | | their values to the new value. <rdar://problem/13065198> llvm-svn: 173308
* <rdar://problem/12953853>Greg Clayton2013-01-081-2/+1
| | | | | | | | | | Setting breakpoints using "breakpoint set --selector <SEL>" previously didn't when there was no dSYM file. Also fixed issues in the test suite that arose after fixing the bug. Also fixed the log channels to properly ref count the log streams using weak pointers to the streams. This fixes a test suite problem that would happen when you specified a full path to the compiler with the "--compiler" option. llvm-svn: 171816
* Adding events when watchpoints are set or changed.Jim Ingham2012-12-183-8/+159
| | | | | | <rdar://problem/11597849> llvm-svn: 170400
* Fix Linux build warnings due to redefinition of macros:Daniel Malea2012-12-051-0/+2
| | | | | | | | | - add new header lldb-python.h to be included before other system headers - short term fix (eventually python dependencies must be cleaned up) Patch by Matt Kopec! llvm-svn: 169341
* Resolve printf formatting warnings on Linux:Daniel Malea2012-11-299-15/+15
| | | | | | | | - use macros from inttypes.h for format strings instead of OS-specific types Patch from Matt Kopec! llvm-svn: 168945
* Turns out there are 8 bits in a byte.Jim Ingham2012-10-231-1/+9
| | | | llvm-svn: 166502
* Watchpoints remember the type of the expression or variable they were set ↵Jim Ingham2012-10-231-89/+43
| | | | | | | | | | with, and use it to print the old and new values. Temporarily disable the "out of scope" checking since it didn't work correctly, and was not what people generally expected watchpoints to be doing. llvm-svn: 166472
* Add one-shot breakpoints (-o option to "break set") and a tbreak alias for ↵Jim Ingham2012-10-052-28/+19
| | | | | | our gdb friends. llvm-svn: 165328
* Ran the sources through the compiler with -Wshadow warningsJason Molenda2012-10-041-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | enabled after we'd found a few bugs that were caused by shadowed local variables; the most important issue this turned up was a common mistake of trying to obtain a mutex lock for the scope of a code block by doing Mutex::Locker(m_map_mutex); This doesn't assign the lock object to a local variable; it is a temporary that has its dtor called immediately. Instead, Mutex::Locker locker(m_map_mutex); does what is intended. For some reason -Wshadow happened to highlight these as shadowed variables. I also fixed a few obivous and easy shadowed variable issues across the code base but there are a couple dozen more that should be fixed when someone has a free minute. <rdar://problem/12437585> llvm-svn: 165269
* Change the new breakpoint creation output (primarily from "break set") to ↵Jim Ingham2012-09-222-14/+61
| | | | | | | | something more useful. <rdar://problem/11333623> llvm-svn: 164432
* Stop using the "%z" size_t modifier and cast all size_t values to uint64_t. ↵Greg Clayton2012-09-183-5/+5
| | | | | | Some platforms don't support this modification. llvm-svn: 164148
* Patch from info from Daniel Malea that should fix the build on linux after ↵Greg Clayton2012-09-041-0/+2
| | | | | | fixes committed with revision 162860. llvm-svn: 163139
* <rdar://problem/11757916>Greg Clayton2012-08-297-7/+17
| | | | | | | | | | | | 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
* Cope with the case where the user-supplied callbacks want the watchpoint ↵Johnny Chen2012-08-231-0/+12
| | | | | | | | | | | | itself to be disabled! Previously we put a WatchpointSentry object within StopInfo.cpp to disable-and-then-enable the watchpoint itself while we are performing the actions associated with the triggered watchpoint, which can cause the user-initiated watchpoint disabling action to be negated. Add a test case to verify that a watchpoint can be disabled during the callbacks. llvm-svn: 162483
* Fix test failures in TestWatchpointIter.py due to ↵Johnny Chen2012-08-211-1/+19
| | | | | | http://llvm.org/viewvc/llvm-project?rev=162322&view=rev. llvm-svn: 162328
* rdar://problem/12144930Johnny Chen2012-08-211-1/+3
| | | | | | | Watchpoint conditions were hitting watchpoint, smashing LLDB's stack. Make sure watchpoint is properly disabled and subsequently enabled while performing watchpoint actions. llvm-svn: 162322
* A little bit of refactoring.Johnny Chen2012-08-141-10/+13
| | | | llvm-svn: 161903
* When trying to take snapshots of a watched variable, if the frame is unable ↵Johnny Chen2012-08-141-0/+20
| | | | | | | | | to evaluate the variable expression, do not take the sanpshot and forget about the stop info. It is possible that the variable expression has gone out of scope, we'll revise the hit count due to the false alarms. llvm-svn: 161892
* Simplify the "Watchpoint ... hit" printout, make it more terse.Johnny Chen2012-08-131-6/+31
| | | | | | Change the test case, too. llvm-svn: 161806
* rdar://problem/12007576Johnny Chen2012-08-132-9/+105
| | | | | | | Record the snapshot of our watched value when the watchpoint is set or hit. And report the old/new values when watchpoint is triggered. Add some test scenarios. llvm-svn: 161785
* rdar://problem/11457143 [ER] need "watchpoint command ..."Johnny Chen2012-08-092-35/+274
| | | | | | Add 'watchpoint command add/delete/list' to lldb, plus two .py test files. llvm-svn: 161638
* Fix ignore counts on breakpoints so they actually work.Jim Ingham2012-06-262-1/+56
| | | | llvm-svn: 159233
* We were accessing the ModuleList in the target without locking it for tasks likeJim Ingham2012-05-301-6/+8
| | | | | | | | | | | setting breakpoints. That's dangerous, since while we are setting a breakpoint, the target might hit the dyld load notification, and start removing modules from the list. This change adds a GetMutex accessor to the ModuleList class, and uses it whenever we are accessing the target's ModuleList (as returned by GetImages().) <rdar://problem/11552372> llvm-svn: 157668
* Also push file & line breakpoints past the prologue. Also added a "-K" ↵Jim Ingham2012-05-221-3/+30
| | | | | | | | | | | argument to the relevant "break set" commands to set this per breakpoint. Also, some CreateBreakpoint API's in the lldb_private namespace had "internal" first and "skip_prologue" second. "internal should always be last. Fixed that. rdar://problem/11484729 llvm-svn: 157225
* If we notice that a module with a given file path is replaced by another ↵Jim Ingham2012-05-172-9/+43
| | | | | | | | | | | with the same file path on rerunning, evict the old module from the target module list, inform the breakpoints about this so they can do something intelligent as well. rdar://problem/11273043 llvm-svn: 157008
* Don't expose the pthread_mutex_t underlying the Mutex & Mutex::Locker classes. Jim Ingham2012-05-042-2/+2
| | | | | | | | | | | | | No one was using it and Locker(pthread_mutex_t *) immediately asserts for pthread_mutex_t's that don't come from a Mutex anyway. Rather than try to make that work, we should maintain the Mutex abstraction and not pass around the platform implementation... Make Mutex::Locker::Lock take a Mutex & or a Mutex *, and remove the constructor taking a pthread_mutex_t *. You no longer need to call Mutex::GetMutex to pass your mutex to a Locker (you can't in fact, since I made it private.) llvm-svn: 156221
* Jeeze... Remove two unneeded #include's of ThreadPlanTestCondition.h, and ↵Jim Ingham2012-05-022-2/+2
| | | | | | | | replace them with includes of ClangUserExpression that were being errantly dragged in through same. llvm-svn: 155970
* Cleanup - removing the ThreadPlanTestCondition and its helper functions. It ↵Jim Ingham2012-05-023-60/+0
| | | | | | | | | | is not needed, since we now run the condition in the StopInfoBreakpoint's PerformAction, and don't need to refer it to another "continue". Actually, we haven't needed to do this for a year or so, I just hadn't gotten around to deleting the dead wood. llvm-svn: 155967
* <rdar://problem/11282938>Greg Clayton2012-04-231-2/+5
| | | | | | Fixed an issue where we get NULL compile units back from the symbol vendor. We need symbol vendors to be able to quickly give an estimate of the compile units that they have without having to fully vette them first, so anyone getting compile units from a module should be able to deal with a NULL compile unit being returned for a given index. llvm-svn: 155398
* No functionality changes, mostly cleanup.Greg Clayton2012-04-112-2/+2
| | | | | | | | Cleaned up the Mutex::Locker and the ReadWriteLock classes a bit. Also cleaned up the GDBRemoteCommunication class to not have so many packet functions. Used the "NoLock" versions of send/receive packet functions when possible for a bit of performance. llvm-svn: 154458
* Initialize ivars in the order they are defined in the class.Bill Wendling2012-04-031-3/+3
| | | | llvm-svn: 153931
* First stage of implementing step by "run to next branch". Doesn't work yet, ↵Jim Ingham2012-03-091-0/+10
| | | | | | | | is turned off. <rdar://problem/10975912> llvm-svn: 152376
* <rdar://problem/10997402>Greg Clayton2012-03-071-4/+4
| | | | | | | | | | | This fix really needed to happen as a previous fix I had submitted for calculating symbol sizes made many symbols appear to have zero size since the function that was calculating the symbol size was calling another function that would cause the calculation to happen again. This resulted in some symbols having zero size when they shouldn't. This could then cause infinite stack traces and many other side affects. llvm-svn: 152244
* Add a command and an SB API to create exception breakpoints. Make the break ↵Jim Ingham2012-03-062-1/+22
| | | | | | output prettier for Exception breakpoints. llvm-svn: 152081
* First step to making an LanguageRuntime Exception breakpoint API.Jim Ingham2012-03-031-22/+55
| | | | | | <rdar://problem/10196277> llvm-svn: 151965
* Make the Watchpoint IDs unique per target, not across targets as before.Johnny Chen2012-02-252-61/+99
| | | | | | Now Each newly created target has its Watchpoint IDs as 1, 2, 3 ... llvm-svn: 151435
* <rdar://problem/10103468>Greg Clayton2012-02-242-13/+39
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* Make a nested if .. if .. else block nesting more explicit with some curly ↵Jason Molenda2012-02-231-0/+6
| | | | | | braces. llvm-svn: 151292
* Thread hardening part 3. Now lldb_private::Thread objects have std::weak_ptrGreg Clayton2012-02-211-4/+5
| | | | | | | | | | | | | | | | | objects for the backlink to the lldb_private::Process. The issues we were running into before was someone was holding onto a shared pointer to a lldb_private::Thread for too long, and the lldb_private::Process parent object would get destroyed and the lldb_private::Thread had a "Process &m_process" member which would just treat whatever memory that used to be a Process as a valid Process. This was mostly happening for lldb_private::StackFrame objects that had a member like "Thread &m_thread". So this completes the internal strong/weak changes. Documented the ExecutionContext and ExecutionContextRef classes so that our LLDB developers can understand when and where to use ExecutionContext and ExecutionContextRef objects. llvm-svn: 151009
* Extended function lookup to allow the user toSean Callanan2012-02-101-2/+5
| | | | | | | | | indicate whether inline functions are desired. This allows the expression parser, for instance, to filter out inlined functions when looking for functions it can call. llvm-svn: 150279
OpenPOWER on IntegriCloud