On 28-Jan-2010, Ryan Rusaw wrote:
| On Thu, Jan 28, 2010 at 12:11 AM, John W. Eaton <
address@hidden> wrote:
|
| > On 27-Jan-2010, Ryan Rusaw wrote:
| >
| > | This is a simple patch which lets subclasses of tree_evaluator override
| > the
| > | standard keyboard handler (do_keyboard) for breakpoints. In my use case I
| > | control the debug flow (ie dbstep, dbcont etc) via control messages from
| > a
| > | network socket.
| >
| > | diff --git a/src/pt-eval.h b/src/pt-eval.h
| > | --- a/src/pt-eval.h
| > | +++ b/src/pt-eval.h
| > | @@ -163,6 +163,9 @@
| > | void do_breakpoint (bool is_breakpoint,
| > | bool is_end_of_fcn_or_script = false) const;
| > |
| > | + virtual octave_value do_keyboard_impl (
| > | + const octave_value_list& args = octave_value_list ())
| > const;
| > | +
| > | // No copying!
| > |
| > | tree_evaluator (const tree_evaluator&);
| >
| > | diff --git a/src/pt-eval.cc b/src/pt-eval.cc
| > | --- a/src/pt-eval.cc
| > | +++ b/src/pt-eval.cc
| > | @@ -1154,7 +1154,14 @@
| > | }
| > |
| > | if (break_on_this_statement)
| > | - do_keyboard ();
| > | + do_keyboard_impl ();
| > | +
| > | +}
| > | +
| > | +octave_value
| > | +tree_evaluator::do_keyboard_impl (const octave_value_list& args) const
| > | +{
| > | + return do_keyboard(args);
| > | }
| >
| > How does your derived class work? Unless you are also providing a
| > replacement for do_breakpoint, then how is args anything bug an empty
| > list, in which case it seems better to just omit the argument.
| >
| >
| It just calls a different handler for instead of do_keyboard()
|
|
| octave_value
|
| dbgp_evaluator::do_keyboard_impl (const octave_value_list& args) const
|
| {
|
| return debugger.do_keyboard(args);
|
| }