breakpoints in VSC

I just started using Visual Studio Code a couple of months ago. I really like it, after years in Eclipse.

It seems to be missing the Manifest Editor that Eclipse has, but not a big deal. I can manually edit it. Am I missing something?

I've gotten away with coding and using "println" to debug. Time to step up my game. Any quick tips on how to run code and have it stop (breakpoint) when a specific variable changes value to any new value, or changes to a specific value? I'm sure this is a basic capability of VSC, just have never done it.  At first glance, the breakpoint feature seems to want a function, not a variable.

Thanks!

  • To edit the manifest, it's not a single editor.

    You have

    Configure Money Barrels

    Edit Permissions

    Edit Products 

    Regenerate UUID

    Edit Application

    etc.

    You shouldn't need to edit the manifest manually

  • code.visualstudio.com/.../debugging

    Click on the margin to the left of a line number to set a breakpoint. Or press F9 to set a breakpoint on the current line.

    As far as the manifest editor goes, I do wish Garmin had used a webview / property sheet for certain things (similar to what microsoft did for C/C++ extension settings *), but to be fair, using the command palette for everything is the "VS Code way".

    (*) e.g.

    I asked for something like this 2 years ago, so at this point I'm sure it's not going to happen.

  • If you do a "New Project" in VSC, the manifest.xml has comments about what to use to change stpecif parts of it:

    <?xml version="1.0"?>
    <!-- This is a generated file. It is highly recommended that you DO NOT edit this file. -->
    <iq:manifest version="3" xmlns:iq="http://www.garmin.com/xml/connectiq">
        <!--
            Use "Monkey C: Edit Application" from the Visual Studio Code command palette
            to update the application attributes.
        -->
        <iq:application id="183e49d4-1234-9999-8bd1-129056df1ee5" type="watchface" name="@Strings.AppName" entry="ComplexWFApp" launcherIcon="@Drawables.LauncherIcon" minApiLevel="1.2.0">
            <!--
                Use the following from the Visual Studio Code comand palette to edit
                the build targets:
                "Monkey C: Set Products by Product Category" - Lets you add all products
                                           that belong to the same product category
                "Monkey C: Edit Products" - Lets you add or remove any product
            -->
            <iq:products>
                <iq:product id="fenix5plus"/>
                <iq:product id="fr245"/>
                <iq:product id="fr245m"/>
                <iq:product id="fr255"/>
                <iq:product id="fr255m"/>
                <iq:product id="fr255s"/>
                <iq:product id="fr255sm"/>
                <iq:product id="fr265"/>
                <iq:product id="fr265s"/>
                <iq:product id="fr945"/>
                <iq:product id="fr955"/>
                <iq:product id="fr965"/>
                <iq:product id="venu2"/>
                <iq:product id="venu2plus"/>
                <iq:product id="venu2s"/>
                <iq:product id="venu3"/>
                <iq:product id="venu3s"/>
                <iq:product id="vivoactive5"/>
            </iq:products>
            <!--
                Use "Monkey C: Edit Permissions" from the Visual Studio Code command
                palette to update permissions.
            -->
            <iq:permissions>
                <iq:uses-permission id="Background"/>
                <iq:uses-permission id="ComplicationSubscriber"/>
            </iq:permissions>
            <!--
                Use "Monkey C: Edit Languages" from the Visual Studio Code command
                palette to edit your compatible language list.
            -->
            <iq:languages/>
            <!--
                Use "Monkey C: Configure Monkey Barrel" from the Visual Studio Code
                command palette to edit the included barrels.
            -->
            <iq:barrels/>
        </iq:application>
    </iq:manifest>

  • Thank you. What I'm looking for is a Data Breakpoint, not tied to any particular line of code, but tagging a variable and breaking anytime that variable changes (or changes to a specific value). I see these are available in GDB, which seems to be a VSC Extension that supports a bunch of languages (but not Monkey C). I see I can set a breakpoint at a particular line and then edit that breakpoint as an Expression, but I believe that will fire only on that specific line of code.

    Do you know if any way to stop execution when a specified variable changes value anywhere. A global changed in any module, for example.

    Thanks!

  • Sorry, my bad for not reading the OP thoroughly.

    It doesn't look like the Monkey C extension supports data breakpoints in VS Code (as you've found), or the equivalent watchpoint feature in Eclipse.

    I see these are available in GDB, which seems to be a VSC Extension that supports a bunch of languages

    GDB is a debugger that predates VS Code by decades. Regardless of whether you use GDB via the VS Code extension or the command line, data breakpoints will be supported.

    Conversely, the Monkey C debugger itself (not just VS Code or the VS Code extension) would have to support data breakpoints (but it apparently doesn't).

    Your best bet is to submit a feature request to Garmin.