[Lldb-commits] [lldb] r211329 - Command files that switch input handlers didn't work, now they do.
gclayton at apple.com
Thu Jun 19 17:23:58 PDT 2014
Date: Thu Jun 19 19:23:57 2014
New Revision: 211329
Command files that switch input handlers didn't work, now they do.
The issue was when we called Debugger::RunIOHandler(), it would run the current IOHandler by activating it, and running it and then try to pop it and exit regardless of wether it was on top or not.
The new code will push the IOHandler that was passed in, and run the IOHandlers until the one passed in is successfully popped. This allows files for the "command source" to switch input handlers:
% cat /tmp/commands
br s -S alignLeftEdges:
br command add
b s -n main
br command add
Note above we set a breakpoint, then add commands do it. The "br command add" will push the breakpoint comment gatherer until it sees "DONE" and then pop itself off the stack. The a new breakpoint will be set and it does the same thing again.
Now this file can be sourced from the command line:
% lldb -s /tmp/commands /path/to/a.out
And your breakpoints will be correctly setup!
--- lldb/trunk/source/Core/Debugger.cpp (original)
+++ lldb/trunk/source/Core/Debugger.cpp Thu Jun 19 19:23:57 2014
@@ -902,9 +902,29 @@ Debugger::RunIOHandler (const IOHandlerS
Mutex::Locker locker (m_input_reader_stack.GetMutex());
- PopIOHandler (reader_sp);
+ IOHandlerSP top_reader_sp = reader_sp;
+ while (top_reader_sp)
+ if (top_reader_sp.get() == reader_sp.get())
+ if (PopIOHandler (reader_sp))
+ while (1)
+ top_reader_sp = m_input_reader_stack.Top();
+ if (top_reader_sp && top_reader_sp->GetIsDone())
More information about the lldb-commits