diff options
author | Greg Clayton <gclayton@apple.com> | 2013-06-12 00:46:38 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2013-06-12 00:46:38 +0000 |
commit | d8cf1a119d4c38e59ade90018a4df015dff63383 (patch) | |
tree | 606b745e59a29f527781d29bd8709ff5e8a814f1 /lldb/tools/debugserver/source/MacOSX/MachProcess.h | |
parent | ec36f9a73429dda07049473625d3354b209cc5b7 (diff) | |
download | bcm5719-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/MachProcess.h')
-rw-r--r-- | lldb/tools/debugserver/source/MacOSX/MachProcess.h | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/lldb/tools/debugserver/source/MacOSX/MachProcess.h b/lldb/tools/debugserver/source/MacOSX/MachProcess.h index ee2642ee474..7a52eaa54ae 100644 --- a/lldb/tools/debugserver/source/MacOSX/MachProcess.h +++ b/lldb/tools/debugserver/source/MacOSX/MachProcess.h @@ -114,22 +114,20 @@ public: //---------------------------------------------------------------------- // Breakpoint functions //---------------------------------------------------------------------- - nub_break_t CreateBreakpoint (nub_addr_t addr, nub_size_t length, bool hardware, thread_t thread); - bool DisableBreakpoint (nub_break_t breakID, bool remove); - nub_size_t DisableAllBreakpoints (bool remove); - bool EnableBreakpoint (nub_break_t breakID); - void DumpBreakpoint(nub_break_t breakID) const; + DNBBreakpoint * CreateBreakpoint (nub_addr_t addr, nub_size_t length, bool hardware); + bool DisableBreakpoint (nub_addr_t addr, bool remove); + void DisableAllBreakpoints (bool remove); + bool EnableBreakpoint (nub_addr_t addr); DNBBreakpointList& Breakpoints() { return m_breakpoints; } const DNBBreakpointList& Breakpoints() const { return m_breakpoints; } //---------------------------------------------------------------------- // Watchpoint functions //---------------------------------------------------------------------- - nub_watch_t CreateWatchpoint (nub_addr_t addr, nub_size_t length, uint32_t watch_type, bool hardware, thread_t thread); - bool DisableWatchpoint (nub_watch_t watchID, bool remove); - nub_size_t DisableAllWatchpoints (bool remove); - bool EnableWatchpoint (nub_watch_t watchID); - void DumpWatchpoint(nub_watch_t watchID) const; + DNBBreakpoint * CreateWatchpoint (nub_addr_t addr, nub_size_t length, uint32_t watch_type, bool hardware); + bool DisableWatchpoint (nub_addr_t addr, bool remove); + void DisableAllWatchpoints (bool remove); + bool EnableWatchpoint (nub_addr_t addr); uint32_t GetNumSupportedHardwareWatchpoints () const; DNBBreakpointList& Watchpoints() { return m_watchpoints; } const DNBBreakpointList& Watchpoints() const { return m_watchpoints; } @@ -263,7 +261,6 @@ private: void Clear (); void ReplyToAllExceptions (); void PrivateResume (); - nub_size_t RemoveTrapsFromBuffer (nub_addr_t addr, nub_size_t size, uint8_t *buf) const; uint32_t Flags () const { return m_flags; } nub_state_t DoSIGSTOP (bool clear_bps_and_wps, bool allow_running, uint32_t *thread_idx_ptr); |