paulo-fernando-silva / vscOctaveDebugger

MIT License
35 stars 4 forks source link

Debugging Variables, stepping, watch #40

Closed Tweoss closed 3 years ago

Tweoss commented 3 years ago

While trying out the extension for a class, I was happy to see this extension providing debugging support for Octave. I tried the example provided in the readme.md and was able to stop on the first breakpoint and continue using dbcont. However, I am unable to

  1. View variables in the debug view (or watch view)
  2. View variable values via hovering over the variable in the editor
  3. Use the stepping debugging provided by VSCode while on a breakpoint.

Are these features from another extension? If not, how may I enable them?

Thank you for your hard work making this extension, it has already been very useful!

MacOS Catalina

Extensions: Octave Hacking, Octave (Toasty Technologies), and Octave Debugger

octave-cli does exist at the location specified in launch.json.

Sample.m

function output = Sample(input)
    x = [-10:0.1:10];
    y = rand(size(x));
    output = [x' y'];
end

launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "OctaveDebugger",
            "request": "launch",
            "name": "Sample",
            "program": "Sample",
            "octave": "/usr/local/bin/octave-cli",
            "sourceFolder": "${workspaceFolder}",
        },
    ]
}

All of the images are from the same time. (no interaction in between the pictures)

image image image

paulo-fernando-silva commented 3 years ago

Hi! I just tested it and it works fine on my side. I'm using octave-cli version 5.1. Can you check your octave version? Maybe something changed if you're using a newer version and it breaks the plugin. I'm just guessing.

Tweoss commented 3 years ago

Thank you so much for the quick response! I just checked, and I have octave-cli version 6.1. I'll try to download version 5.1 and get back to you as soon as I can.

Tweoss commented 3 years ago

I've downloaded octave-5.1.0 from https://github.com/octave-app/octave-app/releases/tag/v5.1.0-beta4 and am extremely happy to report that all the features do in fact work! Thank you so very much for helping me. For reference, I opened the dmg, moved /Applications/Octave-5.1.0.app/Contents/Resources/usr/opt/octave-octave-app@5.1.0/bin/octave to /usr/local/bin/octave-cli-5.1.0 and now have the following in launch.json.

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "OctaveDebugger",
            "request": "launch",
            "name": "Sample",
            "program": "Sample",
            "octave": "/usr/local/bin/octave-cli-5.1.0",
            "sourceFolder": "${workspaceFolder}",
        },
    ]
}
paulo-fernando-silva commented 3 years ago

Now the plugin should work with octave 6.1 too. If you would like you can test and let me know if it works for you too. Thanks for warning me about it.

Tweoss commented 3 years ago

I can confirm that the extension works beautifully with octave 6.1.0. Thank you for acting so quickly!