octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: New class method for tree_evaluator.


From: John W. Eaton
Subject: Re: New class method for tree_evaluator.
Date: Thu, 28 Jan 2010 02:31:08 -0500

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);
| 
| }

I guess I'm still confused, because the only call to your
do_keyboard_impl function calls it with no arguments, so isn't args
always just an empty octave_value_list object?

jwe


reply via email to

[Prev in Thread] Current Thread [Next in Thread]