bugGNU Octave - Bugs: bug #46451, unable to set breakpoints within...

 
 

bug #46451: unable to set breakpoints within classdef classes

Submitter:  Carnë Draug <carandraug>
Submitted:  Sun 15 Nov 2015 07:15:32 PM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Feature Request
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  9.1.0 Planned Release:  9.1.0
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Thu 18 Apr 2024 05:38:20 PM UTC, comment #65: 

OK.  I will start a new report.  Please modify the contents as needed.  Thanks.

Liang Tang <lt1234>
Thu 18 Apr 2024 05:12:28 PM UTC, comment #64: 

I can confirm that issue.
It looks like it is still not possible to add breakpoints in get or set methods.

Could you please open a new report for that?

Markus Mützel <mmuetzel>
Group administrator
Thu 18 Apr 2024 04:43:40 PM UTC, comment #63: 

I repeated step-by-step what you have in comment #62.  I can reproduce what you showed, in win 10.   Thanks. 

But I still cannot set a break point in the class file I had issue with.  The files were downloaded from https://github.com/GiMo84/mOP2

I edited mOP2block_OES and picked the line 78.  Nothing happened. dbstatus is empty.

Liang Tang <lt1234>
Thu 18 Apr 2024 04:10:47 PM UTC, comment #62: 

Works for me with Octave 9.1.0 on Windows 11.
E.g.:

>> edit inputParser
>> dbstatus
>> # Then, click on the left sidebar left of the line number (must be a line with code).
>> dbstatus
breakpoint in @inputParser/addParamValue at line 311


Markus Mützel <mmuetzel>
Group administrator
Thu 18 Apr 2024 03:53:44 PM UTC, comment #61: 

I just downloaded and installed win64 9.1.0.  I still cannot set a break point in class file using GUI editor.  Thanks.

Liang Tang <lt1234>
Fri 12 Jan 2024 09:42:18 PM UTC, comment #60: 

Marking as Fixed and closing report.

Rik <rik5>
Group administrator
Sat 28 Oct 2023 11:32:13 AM UTC, comment #59: 

I pushed the changes from comment #58 to the default branch:
https://hg.savannah.gnu.org/hgweb/octave/rev/9296e2b74d0b

Keeping status at ready for test for a while longer.


Markus Mützel <mmuetzel>
Group administrator
Tue 17 Oct 2023 06:03:51 PM UTC, comment #58: 

I'm attaching an updated patch that uses "@class_name/method_name" for the name reported by `dbstatus`.
That is still incompatible with Matlab. But at least it is consistent to how we report debug break points in legacy classes.

It also fixes a couple other issues with the previous patch.


(file #55249)

Markus Mützel <mmuetzel>
Group administrator
Tue 17 Oct 2023 04:10:25 PM UTC, comment #57: 

The names of +package folders seem to be ignored entirely in the names that are returned by `dbstatus`. That's the same for function, scripts and classes.

Markus Mützel <mmuetzel>
Group administrator
Tue 17 Oct 2023 02:58:18 PM UTC, comment #56: 

Your list doesn't include functions in +package folders, which Octave also doesn't handle properly in many places. I mean lime in which, and the test of shadowing for example.

Richard <crobar>
Tue 17 Oct 2023 07:39:41 AM UTC, comment #55: 

I don't know if function names are displayed consistently everywhere. But for the names displayed in the returned structure of `dbstatus` in Matlab (on Windows):

  • script: my_script
  • function: my_fcn
  • local function: my_fcn>my_local_fcn
  • nested function: my_fcn>my_nested_fcn
  • private function: my_folder\private\my_private_fcn
  • classdef constructor: my_class.my_class>my_class.my_class
  • classdef method in same file: my_class.my_class>my_class.my_method
  • classdef method in different file in @-folder: my_class.my_method2
  • local function in classdef: my_class>my_local_fcn
  • nested function in classdef constructor: my_class>my_class.my_class/my_local_fcn
  • nested function in classdef method (same file): my_class>my_class.my_method/my_local_fcn
  • local function in classdef method in different file in @-folder: my_class.my_method>my_local_fcn
  • nested function in classdef method in different file in @-folder: my_class.my_method>my_nested_fcn
  • legacy class constructor: my_legacy_class.my_legacy_class
  • local function in legacy class constructor: my_legacy_class.my_legacy_class>my_local_fcn
  • nested function in legacy class constructor: my_legacy_class.my_legacy_class>my_nested_fcn
  • legacy class method: my_legacy_class.my_method
  • local function in legacy class method: my_legacy_class.my_method>my_local_fcn
  • nested function in legacy class method: my_legacy_class.my_method>my_nested_fcn


Afaict, it's not possible to set breakpoints in built-in functions or .mex files. So, I don't know how to get the function names for those.

Markus Mützel <mmuetzel>
Group administrator
Mon 16 Oct 2023 06:18:53 PM UTC, comment #54: 

Does Matlab have a consistent and documented way that it displays function names?  That includes built-in, .m file, .mex file, classdef and legacy class methods, nested and sub-functions.  Did I forget any different types?

John W. Eaton <jwe>
Group administrator
Mon 16 Oct 2023 05:02:36 PM UTC, comment #53: 

See also the part of the patch that modifies the BIST in debug.cc:

@@ -538,13 +549,23 @@
 %!   dbstop @audioplayer/set 75;
 %!   dbstop quantile>__quantile__;
 %!   dbstop ls;
-%!   s = dbstatus;
+%!   dbstop in inputParser at addOptional
+%!   dbstop in inputParser at 285
+%!   s = dbstatus ();
 %!   dbclear all;
 %!   assert (s(1).name, "@audioplayer/set>setproperty");
 %!   assert (s(2).name, "@ftp/dir");
+%!   assert (s(2).file(end-10:end), [filesep "@ftp" filesep "dir.m"]);
 %!   assert (s(3).name, "ls");
 %!   assert (s(4).name, "quantile>__quantile__");
-%!   assert (s(2).file(end-10:end), [filesep "@ftp" filesep "dir.m"]);
+%!   ## For Matlab compatibility the following two names should be:
+%!   ## inputParser.inputParser>inputParser.addOptional
+%!   assert (s(5).name, "inputParser");
+%!   assert (s(5).line, 278);
+%!   assert (s(6).name, "inputParser");
+%!   assert (s(6).line, 285);
+%!   s = dbstatus ();
+%!   assert (isempty (s));
 %! unwind_protect_cleanup
 %!   if (isguirunning ())
 %!     __event_manager_gui_preference__ ("editor/show_dbg_file", orig_show_dbg);


Markus Mützel <mmuetzel>
Group administrator
Mon 16 Oct 2023 04:58:25 PM UTC, comment #52: 

Matlab's format is really odd. E.g. for a stop point in a method "my_method" of a classdef "my_class", the name would be: "my_class.my_class>my_class.my_method"

The name with the proposed patch would be "my_class" (matching the name of the file in which the stop point is). It would probably be not too hard to change that to "@my_class/my_method". But to match Matlab, we'd probably need more elaborate changes.

I'm not sure if our names match for stop points in other kinds of functions. So, this might not really be a regression. It might be better to keep that overhaul for a separate bug though.

Markus Mützel <mmuetzel>
Group administrator
Mon 16 Oct 2023 03:00:16 PM UTC, comment #51: 

That's unfortunate. What's the difference between the current format and matlab?

hackdev
Sun 15 Oct 2023 07:39:21 PM UTC, comment #50: 

There still is an error when trying to list breakpoints in classdef classes. E.g.:

>> dbstop in inputParser at addOptional
ans = 278
>> s = dbstatus
error: add_breakpoints_in_function: unable to find function 'addOptional'
>> dbclear in inputParser at addOptional
>>


The attached patch fixes that for me.

Even if the breakpoint names are not compatible with Matlab with that change, it's still an improvement over the current behavior imho.

I still haven't checked if this would work with a classdef that consists of multiple files in a common @-folder.


(file #55240)

Markus Mützel <mmuetzel>
Group administrator
Fri 13 Oct 2023 03:23:56 PM UTC, comment #49: 

I pushed that patch with you as author here:
https://hg.savannah.gnu.org/hgweb/octave/rev/d82d9e06fc50

Markus Mützel <mmuetzel>
Group administrator
Sun 08 Oct 2023 02:29:50 PM UTC, comment #48: 

I think the empty string used when we don't have class name should be fine. I didn't test it, but if it works it's great news. :)

hackdev
Sun 08 Oct 2023 11:24:02 AM UTC, comment #47: 

Oops. Failed to include the change to one additional file in the patch.
See attachment with that update.

(file #55220)

Markus Mützel <mmuetzel>
Group administrator
Sun 08 Oct 2023 09:41:34 AM UTC, comment #46: 

Thank you very much for the diff.
Like you suspected, it didn't compile as-is. But with a couple of modifications it allows clearing breakpoints in classdef methods by name for me.

Does the attached modified version of the patch look reasonable to you?

I left you as the author of the patch. I used the same identification as for the last patch. Please, let us know if that is correct.

(file #55219)

Markus Mützel <mmuetzel>
Group administrator
Fri 06 Oct 2023 12:42:00 PM UTC, comment #45: 

I imagine yes. I don't have time to look at this right now. I sketched a patch which I didn't even try to compile, but it if doesn't work right away, it should at least point us in the right direction. I do have to say that I'm not a fan of "carrying around" the class name like this.

(file #55210)

hackdev
Wed 04 Oct 2023 04:07:51 PM UTC, comment #44: 

Prompted by recent comments in bug #45404:
Clearing break points from the command line using method names doesn't work yet. Clearing via line numbers does seem to work:

>> dbstop in inputParser at addOptional
ans = 278
'addOptional'
>> dbclear in inputParser at addOptional
error: add_breakpoints_in_function: unable to find function 'addOptional'
>> dbclear in inputParser at 278
>>


Could that be solved with a related change?

Markus Mützel <mmuetzel>
Group administrator
Sun 27 Aug 2023 09:23:48 AM UTC, comment #43: 

Thank you again for your contributions. And sorry for the long delay.

I pushed your latest patch (mostly as-is) to the default branch of Octave:
https://hg.savannah.gnu.org/hgweb/octave/rev/fbd7e00d3e6e

It should be part of Octave 9 when it will be released probably some time early next year.

Marking as ready for test.

Please, leave a note here if you'd like to be added to the list of contributors at the start of the manual.

Markus Mützel <mmuetzel>
Group administrator
Sun 09 Jul 2023 11:02:11 PM UTC, comment #42: 

just a review status check, i think @jwe was doing a code review before pushing?

Nicholas Jankowski <nrjank>
Group Member
Sun 11 Jun 2023 01:41:27 PM UTC, comment #41: 

This patch shouldn't lead to any warnings. It is in git format, so please tweak it as needed. I believe there's enough benefit to the octave users to justify not dragging this much longer. Thanks, and sorry for the slow responsiveness. Took longer to fix a couple of integers than it took to implement the whole thing. :)

(file #54827)

hackdev
Thu 01 Jun 2023 03:43:16 AM UTC, comment #40: 

hm, after looking at the patch again, I believe I might have left out the size_t changes... Will post a fixed patch later. Independently, we should create another bug to handle subfuntions in classdef files.

hackdev
Thu 01 Jun 2023 03:36:17 AM UTC, comment #39: 

Hi, I'm uploading another patch, v3, which fixes the warning mentioned in comment #34. However, after looking at the subfunctions in classdef files, as it turns out it's not as easy as I thought. The parser doesn't parse subfuctions for classdefs. So, the parser needs to be changed. I say we leave that for another patch/bug/RFE.

As for contribution attribution, comment #33, you can use the info contained in the patch. You can add that mail/name.

ps: the patch has been tested on top of commit 18e7ce5888.

(file #54803)

hackdev
Tue 23 May 2023 05:55:47 AM UTC, comment #38: 

Thank you. That is what I meant. 👍

I haven't tested that. But it might be worth adding a test case for adding a stop point in nested functions inside a member function of a classdef class.

I might also be a good idea to add test cases for private and static functions.

Does setting breakpoints in member functions that are defined in a separate file (inside an @-folder) also work?

Markus Mützel <mmuetzel>
Group administrator
Tue 23 May 2023 02:12:06 AM UTC, comment #37: 
Nicholas Jankowski <nrjank>
Group Member
Tue 23 May 2023 02:09:36 AM UTC, comment #36: 

@markus, do you mean in a functions block within the class? or, as @hackdev says, is it possible to write subfunctions in m-files outside of the classdef definition block?

Nicholas Jankowski <nrjank>
Group Member
Tue 23 May 2023 12:55:10 AM UTC, comment #35: 

I didn't know if there could be subfunctions in classdef functions, so I deliberately chose to lead them out. I don't know what matlab does in this scenario. Does anyone know? The change is easy though.

hackdev
Sun 21 May 2023 02:48:40 PM UTC, comment #34: 

I'm seeing the following warning during compilation (that I forgot to mention before):

  CXX      libinterp/octave-value/liboctave_value_la-cdef-class.lo
../libinterp/octave-value/cdef-class.cc: In member function 'octave_value octave::cdef_class::cdef_class_rep::get_method(size_t) const':
../libinterp/octave-value/cdef-class.cc:734:16: warning: comparison of integer expressions of different signedness: 'size_t' {aka 'long long unsigned int'} and 'const int' [-Wsign-compare]
  734 |       if (line <= e && e <= closest_match_end_line && pfcn->is_defined ()
      |           ~~~~~^~~~


Many functions that are added by this patch seem to be using `int` as the type for line numbers. But `cdef_class::cdef_class_rep::get_method` uses `size_t`.
Would it make sense to use the same type for all these functions?

Markus Mützel <mmuetzel>
Group administrator
Sun 21 May 2023 01:27:23 PM UTC, comment #33: 

Thank you for your contribution.

I locally tested the patch on top of a current head (hg id 501730f07abc).
It seems to be doing the right thing for me (mostly).

Please, find the attached patch where I tried to adapt the coding style to Octave's guidelines.

One thing that I noticed is that it doesn't seem to be possible to set a breakpoint in a local function in the classdef .m file. But that might be an unrelated issue. I added a test for that (known) issue.

Overall this adds a feature that could make it a lot easier to debug functions in classdef files. I'd like to push it to the default branch of the Octave repository if no one opposes.

To assign the copyright, we'd need a valid email address. Usually, the full name is also used.
Which email address and name could I use to correctly attribute this contribution to you?

Would you like to be added to the list of contributors at the beginning of the manual? Which name could I use for that?

(file #54771)

Markus Mützel <mmuetzel>
Group administrator
Mon 01 May 2023 02:24:21 PM UTC, comment #32: 

Updated the patch to include proper tests, and simplified it a bit.

(file #54695)

hackdev
Wed 26 Apr 2023 05:07:26 PM UTC, comment #31: 

Ok, as soon as I have some time I'll do it. Maybe by the end of the week.

hackdev
Tue 25 Apr 2023 02:57:51 PM UTC, comment #30: 

(file attached)

(file #54666)

Nicholas Jankowski <nrjank>
Group Member
Tue 25 Apr 2023 02:56:39 PM UTC, comment #29: 

ok, attached a new complete patch with that last addition.

I attempted to add a placeholder header to this patch file that follows Octave's code documentation best practices. See
https://wiki.octave.org/Commit_message_guidelines

note that mine is still inadequate.  It would help review if you could add a few lines to each modified file line that summarizes changes made.  (note i also don't properly call out functions as specified in the guidelines, that could be fixed too).

I also noticed that your test function has some printf echo statements.  if you look at other examples in the test folder, you'll see that each should contain a .tst script file that will be executed by octaves self test scripts. These shouldn't echo anything to the console. Notes can be kept internally as comments if desired.

Would you be able to help make some of these changes and provide a revised rolled up patch? (the easiest way is to work from a clone not including any of your changes, apply this patch with the --no-commit option, make any other changes, then do a single commit with the changes and export it.)

Nicholas Jankowski <nrjank>
Group Member
Tue 25 Apr 2023 04:27:42 AM UTC, comment #28: 

Added a patch to skip null user functions. Do add that to the previous patch.

(file #54661)

hackdev
Mon 24 Apr 2023 06:21:57 PM UTC, comment #27: 

haven't reviewed the code itself yet (don't generally work in compiled code to catch proper code style, syntax, etc.)

But can confirm that with the patch applied I'm able to set and use breakpoints within a classdef, both from the CLI using the dbstop command and within the GUI by using the line numbers.

appreciate the patch, hopefully it can get a thorough review soon.

Nicholas Jankowski <nrjank>
Group Member
Fri 21 Apr 2023 06:25:23 PM UTC, comment #26: 

as most developers find it easier to apply and test a single patch, I've rolled up your patch set into the single file attached here. 

Marking as Patch Submitted.

(file #54648)

Nicholas Jankowski <nrjank>
Group Member
Fri 21 Apr 2023 05:13:22 PM UTC, comment #25: 

ignore last comment. didn't realize its creation is part of the 00 patch

Nicholas Jankowski <nrjank>
Group Member
Fri 21 Apr 2023 05:12:24 PM UTC, comment #24: 

i don't see a test_classdef_breakpoints script? am i misunderstanding?

Nicholas Jankowski <nrjank>
Group Member
Fri 21 Apr 2023 04:10:19 PM UTC, comment #23: 

Check the attachments for a zip with 5 patches. Specifically: "Several patches that add support to set breakpoints in classdefs using line numbers."
You should be able to patch on top of default's 6d479d2024 commit. Apply the commits from 00~04. Running the included test_classdef_breakpoints should allow you to test the breakpoints.  Looking forward to having this functionality available to the public. Obviously, let me know of any bugs. Also, I tried to follow coding style used in each file, but it might not be exactly right.

(file #54647)

hackdev
Fri 21 Apr 2023 02:48:30 AM UTC, comment #22: 

you can attach the patch file to this bug report. scroll down to the bottom you'll see "Attached Files" with fields for attaching your own one.  I don't think just attaching triggers a notification to the developers though, so always leave a comment with the file.

Nicholas Jankowski <nrjank>
Group Member
Fri 21 Apr 2023 01:57:54 AM UTC, comment #21: 

I have a patch to add/list/remove breakpoints to classdefs using the pattern `dbstop in myclass at 14`.
How do I share it?
This is also related to both bug 45404 and 46451.

hackdev
Thu 06 Apr 2023 01:50:07 AM UTC, comment #20: 

that's long known bug #46451.  Octave's classdef is not a complete implementation.  see https://wiki.octave.org/Classdef

best suggestion is to manually add 'keyboard' statements in the code in place of breakpoints.

Nicholas Jankowski <nrjank>
Group Member
Wed 05 Apr 2023 07:23:55 PM UTC, comment #19: 

At the moment it is not possible to use the editor to set / clear breakpoints in classes. This is really painful. Is there a possibility to fix this?

Steve <alzi123>
Fri 12 Nov 2021 04:47:23 AM UTC, comment #18: 

Octave 6.4.0 produces the comment #17 output.

attempting to set a GUI breakpoint at the same spot still produces:

error: add_breakpoint: unable to find function 'test_class'


so is this bug fixed, or should it just be renamed 'unable to set gui breakpoints in classdef classes'? or is there more missing?

Nicholas Jankowski <nrjank>
Group Member
Tue 16 Jun 2020 08:57:55 PM UTC, comment #17: 

The changes described in comment #14 were made on the default branch after Octave 5.x.  So they will appear in version 6 and later.

Here is what I see with the current sources on the stable branch that should soon be released as Octave 6.1:


octave:1> dbstop in test_class at bar
ans = 7
octave:2> x = test_class
x =

  test_class object with properties:

      foo: [1x1 double]

octave:3> x.bar ()
stopped in bar at line 7 [/net/devnull/scratch/jwe/build/octave-stable/test_class.m]
7:   this.foo = 9999;
debug> this
this =

  test_class object with properties:

      foo: [1x1 double]

debug> this.foo
ans = 123.45
debug> dbstep
stopped in bar at line 8 [/net/devnull/scratch/jwe/build/octave-stable/test_class.m]
8: end
debug> this.foo
ans = 9999
debug> dbcont
octave:4>


John W. Eaton <jwe>
Group administrator
Tue 16 Jun 2020 04:46:06 AM UTC, comment #16: 

Regarding comment #15, as workaround you can add a `keyboard()` command [1] to your code and start using the debugger (with stepping, etc.) from there.

[1] https://www.octave.org/doc/v5.2.0/XREFkeyboard.html

Kai Torben Ohlhus <siko1056>
Group Member
Tue 16 Jun 2020 03:32:45 AM UTC, comment #15: 

Just wanted to say this is quite a painful 5-year-old problem. 

The latest discussion says that it should be possible to at least use dbstop to set a breakpoint at the start of a class method. I tried various permutations in Octave 5.2 with no luck:

dbstop in test_class at bar -- too many function names
dbstop in test_class@bar -- unable to find function

Perhaps this feature is in a later Octave version?

For reference here's what test_class looks like:


classdef test_class
properties
foo = 123.45;
end
methods
function bar(this)
  this.foo = 9999;
end
end
end



Neil Konzen <waterdog1>
Tue 26 Mar 2019 03:16:22 AM UTC, comment #14: 

The problem with command syntax mentioned in comment #3 was fixed in

http://hg.savannah.gnu.org/hgweb/octave/rev/236d8f52cbb3

See also bug #55891.

After changeset

http://hg.savannah.gnu.org/hgweb/octave/rev/de826e69a5ea

setting breakpoints in classdef methods using dbstop commands like


dbstop in MYCLASS at MYMETHOD


Some additional changes will be needed to accept filenames in addition to class names and to support parsing class names or methods names when they are prefixed by package names and to also allow breakpoints in classdef methods to be set from inside the GUI editor.  But this change is a good start.

See also bug #45404.

John W. Eaton <jwe>
Group administrator
Tue 12 Feb 2019 02:56:41 PM UTC, comment #13: 

After the fixes to bug #47680, command-style function calls of the form


dbstop @ftp/dir


no longer work.

I'd like to make dbstop compatible with Matlab for setting breakpoints in classdef methods.  In addition to the syntax shown in comment #12, does anything else work?  The Matlab docs show


dbstop in file
dbstop in file at location
dbstop in file if expression
dbstop in file at location if expression


and also say that FILE may be of the form "file>function".  Does that syntax work for class methods or local functions in a classdef file?

The docs also say that LOCATION may be the name of a local function in the file, but they don't explicitly state that the function name may be in the form shown in comment #12 or explain that "local function" may be a classdef method.

John W. Eaton <jwe>
Group administrator
Tue 15 May 2018 10:10:11 AM UTC, comment #12: 

FYI, none of the syntax options for this mentioned by the original poster work in Matlab either. What does work in Matlab is something the following:


dbstop method_debug_test at method_debug_test.bar


where method_debug_test.m is the classdef file and it has a method called bar

See also: https://stackoverflow.com/questions/19523965/how-to-place-a-breakpoint-at-the-start-of-a-method-programmatically

Richard <crobar>
Sun 02 Apr 2017 10:40:21 PM UTC, comment #11: 

Hi,
I had the same problem on Octave when testing pmtk3 package, on Ubuntu 16.04
error: remove_breakpoint: unable to find the requested function

I tried to apply the patch but it did not work. Can you please publish the Ubuntu patch?

Multiple thanks!!

Sammy Jankis <piux>
Sun 19 Jun 2016 11:30:50 AM UTC, comment #10: 

Hi there,

I am new to Octave and I was wondering if I can apply the patch mentioned below in order to repair my Octave 4.0.2 on Windows.

Can someone give some hint about how I can find out to proceed?

Thanks,
Daniel

Daniel <darim>
Mon 08 Feb 2016 12:27:55 AM UTC, comment #9: 

Unfortunately I'm not that familiar with the internals of classdef. About who wrote it, I believe it was mostly Michael Goffioul.

Carnë Draug <carandraug>
Group Member
Sun 27 Dec 2015 01:46:37 AM UTC, comment #8: 

Carnë, the attached patch allows breakpoints to be set with the syntax
dbstop  classname>method
Could you please give it a try?

It has a memory leak.  The problem is that the classdef framework doesn't seem to keep   octave_user_function  objects around, but instead creates  octave_function  objects on the fly.  In order to keep them around long enough for the dbstatus and dbclear commnds, I'm just allocating them on the heap :(  The patch is clearly not ready to be applied, but I hope it may help someone who knows more about  classdef.  Do you know who wrote that code?

Thanks

(file #35861)

Lachlan Andrew <lachlan>
Wed 23 Dec 2015 11:24:59 PM UTC, comment #7: 

I now see that I had old class definitions in my path.  Without thme, I get the same problem.  It turns out that it does find the constructor, but that it is not considered "user code" (it is not of type octave_user_function) and so doesn't set the breakpoint.

Unfortunately, the classdef framework doesn't seem to have clear "tree_statement_list" objects into which the breakpoint can be placed.  I'm intrigued by this and will keep looking into it.

Lachlan Andrew <lachlan>
Mon 21 Dec 2015 03:56:05 AM UTC, comment #6: 

Carenë, it's odd that it works for me but not for you.  Bug #46468 reports the same problem, so I'm the odd one out.  Are you using Windows?

Lachlan Andrew <lachlan>
Tue 15 Dec 2015 02:12:39 PM UTC, comment #5: 

I tried at a88142abca36 like you and continue to see "add_breakpoint: unable to find the requested function"

This is the same I saw on 4.0.0 and 8da80da1ac37 (current tip of default branch).

Carnë Draug <carandraug>
Group Member
Tue 15 Dec 2015 03:48:26 AM UTC, comment #4: 

Carnë,

I just re-checked it on the default branch at changeset a88142abca36 ("Remove spurious tick labels occurring when setting ticks and removing tick labels")

Even though it doesn't appear in dbstatus, it does appear to stop in that function:

>> dbstop ("@inputParser/inputParser")
ans =  130
>> inputParser
stopped in /usr/share/octave/packages/general-1.3.2/@inputParser/inputParser.m atline 130
130:   if (nargin != 0)
debug>


Running  dbstatus  clears the breakpoint, as described in bug #41190.

Lachlan Andrew <lachlan>
Mon 14 Dec 2015 07:27:37 PM UTC, comment #3: 

What octave version are you using that returns:



>> dbstop ("@inputParser/inputParser")

ans = 130


Carnë Draug <carandraug>
Group Member
Sat 12 Dec 2015 10:18:22 PM UTC, comment #2: 

Oops.  I spoke too soon.  Although it reported a line number, it didn't show up in dbstatus.  I'll keep investigating.

Lachlan Andrew <lachlan>
Sat 12 Dec 2015 09:53:57 AM UTC, comment #1: 

Carnë,

>> dbstop ("@inputParser/inputParser")

ans =  130

I think the bug is in the documentation.  Should I post a patch?

Lachlan Andrew <lachlan>
Sun 15 Nov 2015 07:15:32 PM UTC, original submission:  

It seems that it is not possible to set a breakpoint within a classdef class.


octave> dbstop ("inputParser")
error: add_breakpoint: unable to find the requested function

octave> dbstop ("inputParser.inputParser")
error: unknown package `inputParser'
error: add_breakpoint: unable to find the requested function

octave> dbstop ("inputParser/inputParser")
error: add_breakpoint: unable to find the requested function

octave> dbstop ("inputParser/inputParser")
error: add_breakpoint: unable to find the requested function

octave> dbstop ("inputParser.addRequired")
error: add_breakpoint: unable to find the requested function

octave> dbstop ("inputParser/addRequired")
error: add_breakpoint: unable to find the requested function


This may be related with not being able to define a classdef on the interpreter or why "which" does not associate it with a file.

Carnë Draug <carandraug>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #55210:  patch.diff added by hackdev (3KiB - application/octet-stream - Pseudo patch to support removing bp from class via func name.)
file #54827:  classdef_breakpoints_patch_v4.diff added by hackdev (19KiB - application/octet-stream)
file #54803:  classdef_breakpoint_support_v3.diff added by hackdev (19KiB - application/octet-stream)
file #54771:  bug46451-classdef-breakpoints-v2.patch added by mmuetzel (18KiB - application/octet-stream)
file #54695:  patch_classdef_breakpoints.diff added by hackdev (20KiB - application/octet-stream - Adds support for classdef breakpoints using line numbers.)
file #54666:  classdef_breakpoints_bug46451_v2.diff added by nrjank (18KiB - application/octet-stream - rollup patch v2 with incomplete/placeholder commit message)
file #54661:  skip_null_functions.diff added by hackdev (801B - application/octet-stream - Skips null user code.)
file #54648:  classdef_breakpoints_bug46451.diff added by nrjank (17KiB - application/octet-stream - single patch rollup of classdef_breakpoint_support.zip files)
file #54647:  classdef_breakpoint_support.zip added by hackdev (8KiB - application/zip - Several patches that add support to set breakpoints in classdefs using line numbers. )
file #35861:  bug_46451.patch added by lachlan (5KiB - text/x-diff)

 

Carbon-Copy List
  • -email is unavailable- added by lt1234 (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by mmuetzel (Updated the item)
  • -email is unavailable- added by hackdev (Posted a comment)
  • -email is unavailable- added by alzi123 (Posted a comment)
  • -email is unavailable- added by nrjank (Posted a comment)
  • -email is unavailable- added by siko1056 (Posted a comment)
  • -email is unavailable- added by waterdog1 (Posted a comment)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by crobar (Posted a comment)
  • -email is unavailable- added by piux (Posted a comment)
  • -email is unavailable- added by darim (Posted a comment)
  • -email is unavailable- added by lachlan (Posted a comment)
  • -email is unavailable- added by carandraug (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 24 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-01-12 rik5 StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2023-10-17 mmuetzel Attached File- Added bug46451-classdef-dbstatus-v2.patch, #55249
    2023-10-15 mmuetzel Attached File- Added bug46451-classdef-dbstatus.patch, #55240
    2023-10-08 mmuetzel Attached File- Added bug46451-dbclear-classdef-method-v2.patch, #55220
    2023-10-08 mmuetzel Attached File- Added bug46451-dbclear-classdef-method.patch, #55219
    2023-10-06 hackdev Attached File- Added patch.diff, #55210
    2023-08-27 mmuetzel StatusPatch Reviewed Ready For Test
        Fixed ReleaseNone 9.1.0
        Planned ReleaseNone 9.1.0
    2023-06-11 hackdev Attached File- Added classdef_breakpoints_patch_v4.diff, #54827
    2023-06-01 hackdev Attached File- Added classdef_breakpoint_support_v3.diff, #54803
    2023-05-21 mmuetzel Attached File- Added bug46451-classdef-breakpoints-v2.patch, #54771
        StatusPatch Submitted Patch Reviewed
    2023-05-01 hackdev Attached File- Added patch_classdef_breakpoints.diff, #54695
    2023-04-25 nrjank Attached File- Added classdef_breakpoints_bug46451_v2.diff, #54666
    2023-04-25 hackdev Attached File- Added skip_null_functions.diff, #54661
    2023-04-21 nrjank Attached File- Added classdef_breakpoints_bug46451.diff, #54648
        StatusIn Progress Patch Submitted
    2023-04-21 hackdev Attached File- Added classdef_breakpoint_support.zip, #54647
    2020-01-31 mtmiller Dependencies- bugs #57711 is dependent
    2019-03-26 jwe StatusNone In Progress
    2015-12-27 lachlan Attached File- Added bug_46451.patch, #35861
    2015-11-19 pantxo Dependencies- bugs #46468 is dependent

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code