summaryrefslogtreecommitdiffstats
path: root/lldb/tools/debugserver/source/MacOSX/MachThreadList.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2013-06-12 00:46:38 +0000
committerGreg Clayton <gclayton@apple.com>2013-06-12 00:46:38 +0000
commitd8cf1a119d4c38e59ade90018a4df015dff63383 (patch)
tree606b745e59a29f527781d29bd8709ff5e8a814f1 /lldb/tools/debugserver/source/MacOSX/MachThreadList.cpp
parentec36f9a73429dda07049473625d3354b209cc5b7 (diff)
downloadbcm5719-llvm-d8cf1a119d4c38e59ade90018a4df015dff63383.tar.gz
bcm5719-llvm-d8cf1a119d4c38e59ade90018a4df015dff63383.zip
Huge performance improvements when one breakpoint contains many locations.
325,000 breakpoints for running "breakpoint set --func-regex ." on lldb itself (after hitting a breakpoint at main so that LLDB.framework is loaded) used to take up to an hour to set, now we are down under a minute. With warm file caches, we are at 40 seconds, and that is with setting 325,000 breakpoint through the GDB remote API. Linux and the native debuggers might be faster. I haven't timed what how much is debug info parsing and how much is the protocol traffic to/from GDB remote. That there were many performance issues. Most of them were due to storing breakpoints in the wrong data structures, or using the wrong iterators to traverse the lists, traversing the lists in inefficient ways, and not optimizing certain function name lookups/symbol merges correctly. Debugging after that is also now very efficient. There were issues with replacing the breakpoint opcodes in memory that was read, and those routines were also fixed. llvm-svn: 183820
Diffstat (limited to 'lldb/tools/debugserver/source/MacOSX/MachThreadList.cpp')
-rw-r--r--lldb/tools/debugserver/source/MacOSX/MachThreadList.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/lldb/tools/debugserver/source/MacOSX/MachThreadList.cpp b/lldb/tools/debugserver/source/MacOSX/MachThreadList.cpp
index 2ac171374f1..f549b4707d9 100644
--- a/lldb/tools/debugserver/source/MacOSX/MachThreadList.cpp
+++ b/lldb/tools/debugserver/source/MacOSX/MachThreadList.cpp
@@ -499,9 +499,9 @@ MachThreadList::EnableHardwareBreakpoint (const DNBBreakpoint* bp) const
{
if (bp != NULL)
{
- MachThreadSP thread_sp (GetThreadByID (bp->ThreadID()));
- if (thread_sp)
- return thread_sp->EnableHardwareBreakpoint(bp);
+ const uint32_t num_threads = m_threads.size();
+ for (uint32_t idx = 0; idx < num_threads; ++idx)
+ m_threads[idx]->EnableHardwareBreakpoint(bp);
}
return INVALID_NUB_HW_INDEX;
}
@@ -511,9 +511,9 @@ MachThreadList::DisableHardwareBreakpoint (const DNBBreakpoint* bp) const
{
if (bp != NULL)
{
- MachThreadSP thread_sp (GetThreadByID (bp->ThreadID()));
- if (thread_sp)
- return thread_sp->DisableHardwareBreakpoint(bp);
+ const uint32_t num_threads = m_threads.size();
+ for (uint32_t idx = 0; idx < num_threads; ++idx)
+ m_threads[idx]->DisableHardwareBreakpoint(bp);
}
return false;
}
OpenPOWER on IntegriCloud