Live Variables Unable to Start

Sysprogs forums Forums VisualGDB Live Variables Unable to Start

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #12275
    codex653
    Participant

    I am trying to get up and running with live variables on the embedded version of gdb (5.2R9) and continually keep getting this error:

    VisualGDB version: 5.2.15.1452
    —————— System.Exception ——————
    System.Exception: Cannot evaluate ‘&(echo)’: -var-create: unable to create variable object
    at e51.e3(String b, Boolean a)
    at e51.t2(String a)
    at zd.AddLiveVariableCmd.<>c__DisplayClass3_0.<Execute>b__0(e51 w)

    I’ve been unable to find anything useful on the forums or elsewhere on the internet so far. Any ideas on how to get me up and running?

     

    #12288
    support
    Keymaster

    Hi,

    It looks like you are trying to create a live variable for an expression that is not valid in the current context. Is it a global variable visible from all the source files or a local variable inside a function/method?

    #12293
    codex653
    Participant

    It’s just a local variable inside of my primary .cpp file that has the main(void) function. This variable, shown below as “flag”, is only accessed by the main  function and a callback function from TIM2_IRQHandler().

     

    /*****************UartTesting.cpp************************/

    #include <stm32f7xx_hal.h>
    #include “core.h”
    #include “definitions.h”
    #include “gpio.h”
    #include “uart.h”
    #include “event.h”

    /****************

    *Some setup code went here

    ****************/

    //Variable I am trying to watch live
    volatile bool flag = false;

    int main(void)
    {
    HAL_Init();
    SystemClockConfig();

    /****************

    *Place holder for  non-important code here…

    ****************/
    for (;;)
    {
    if (flag)
    //Do a thing
    }
    }

    void testCallback()
    {
    testPin.toggle();
    ledPin_Blue.toggle();
    flag = true;
    }

    void TIM2_IRQHandler()
    {
    uint32_t isrflags = READ_REG(TIM2->SR);
    isrflags &= ~(1 << 1u);

    testCallback();

    WRITE_REG(TIM2->SR, isrflags);
    HAL_NVIC_DisableIRQ(TIM2_IRQn);
    }

    #12294
    support
    Keymaster

    Hi,

    This should normally work. Please try adding the variable manually by typing “flag” in the Live Variables window instead of using the right-click. If you still get the “echo” error, please try renaming the variable to something unique. As VisualGDB always expands the preprocessor macros in the Live Variables, it could accidentally expand a macro with the same name that would resolve to an invalid name like “echo”.

    #12306
    codex653
    Participant

    Manually adding it worked. In the past when I’ve tried to manually add the variable it did not work, so I’m a tad perplexed. Oh well. It works now and that’s all that matters!

    #12308
    support
    Keymaster

    Hi,

    Good to know it works. If you ever decide to diagnose this, let us know and we will help you understand why right-click adding does not work.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.