Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates and clarifications to Debugging GMT on macOS with Visual Studio #8258

Open
PaulWessel opened this issue Jan 5, 2024 · 4 comments
Open
Assignees
Labels
documentation Improve documentation

Comments

@PaulWessel
Copy link
Member

After extreme procrastination I am finally trying to set up debugging using Visual Studio Code. I have the latest version 1.85.1 (Universal). Some edits are needed in the description, I think.

  1. Of course, the reference to the GMT_Call_Module near Line 112 is now presumably 122?
  2. OSX_DEPLOYMENT_TARGET could stay but might as well be updated to 14.0.
  3. Regarding "Click on the debug panel". I think this is called Debug Console now. Should we update Panel to Console throughout?
  4. Select gmt.begin from the debug drop-down menu. What dropdown menu? I've looked around and nothing obvious shows up. No green arrow to click either. Tell me how and I may add a picture to make this clear. Here is what I see and no obvious dropdown menu related to the Debug Console at the bottom:
vs

If I click on the Problems menu button for the debug console it tells me it cannot find gdal.h? But build/gmt6/bin seems OK.

Finally tried a regular terminal window outside of VSC and prepended /Users/pwessel/UH/RESEARCH/CVSPROJECTS/GMTdev/gmt-dev/vbuild/gmt6/bin to my $PATH and set the GMT_SESSION_NAME=vscodedebug parameter. I then added that stop point at L122 and run gmt --help. I expected to see VSC stop execution at line 122 but it just ran the whole command. Same if I opened a Terminal from VSC and set the same parameters before running gmt plot. Same result. So what am I missing? I think running a CLI command is simpler for me than to edit tasks.json all the time. With Xcode one must hook either python or julia to the process but here there is no such thing so how can VSC connect my gmt call via build to VSC stop points?

OK stopping here because I am stuck.

@PaulWessel PaulWessel added the documentation Improve documentation label Jan 5, 2024
@PaulWessel
Copy link
Member Author

PaulWessel commented Jan 5, 2024

Got debugging started using the Run menu and "Start Debugging" and Step into/over selections. Used F10 and F11 once I changed keyboard setting to let these not start playing music...
However, how do I inspect the value of a variable? Right-click no work, so how is it done in VSC? If similar to Windows then perhaps @joa-quim might be helpful here too?

@joa-quim
Copy link
Member

joa-quim commented Jan 5, 2024

Sorry, no idea. I use it as the Julia debugger where variables show on the left side pane. I guess that for C it should be somewhat similar but know no more. This typical of what I see from the Julia debugger.

image

@PaulWessel
Copy link
Member Author

I finally got that working too. But for a VSC rookie I think we need more info in the debugging section. Once Max and I wrap this up perhaps you could use that section for a Debugging GMT.jl with VSC since it is likely to be very similar.

@joa-quim
Copy link
Member

joa-quim commented Jan 5, 2024

Debugging .jl is trivial. What is really interesting is debugging the GMT C via GMT.jl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improve documentation
Projects
None yet
Development

No branches or pull requests

3 participants