Sysprogs forums › Forums › VisualGDB › Live Variables Unable to Start
Tagged: live variables broken
- This topic has 5 replies, 2 voices, and was last updated 8 years, 3 months ago by
support.
-
AuthorPosts
-
September 3, 2017 at 21:42 #12275
codex653
ParticipantI 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?
September 4, 2017 at 20:32 #12288support
KeymasterHi,
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?
September 5, 2017 at 02:54 #12293codex653
ParticipantIt’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);
}September 5, 2017 at 04:03 #12294support
KeymasterHi,
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”.
September 6, 2017 at 03:56 #12306codex653
ParticipantManually 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!
September 6, 2017 at 05:39 #12308support
KeymasterHi,
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.
-
AuthorPosts
- You must be logged in to reply to this topic.