Using correct debug settings?

Technical questions regarding the XTC tools and programming with XMOS.
User avatar
Interactive_Matter
XCore Addict
Posts: 216
Joined: Wed Feb 10, 2010 10:26 am

Using correct debug settings?

Post by Interactive_Matter »

Hi,

I am trying to debug my led tile application. But something is strange.

In the make file I got two different xcc compiler flags, one for production (which looks fine too me):

Code: Select all

XCC_FLAGS = -O3 -g -report -DMAC_CUSTOM_FILTER
I don't know if O2 or O3 is better (gcc discuss this in detail, all I got is that often O2 ist better - but let's ignore that for a second).

And one setting for debug (Same as above, but including all neccessary debug information in the binary:

Code: Select all

XCC_FLAGS = -O0 -g -report -DMAC_CUSTOM_FILTER 
Somehow it works, I can set break points, and most often the debugger halts on these break points. But somehow I got some problems inspecting variables. I always get messages like this in XDE:

Code: Select all

mi_cmd_var_create: unable to create variable object
Is this some oddity I have to live with or did I forget to tell the compiler or linker to include all necessary debug information?

Thanks for your help

Marcus


User avatar
XMatt
XCore Addict
Posts: 147
Joined: Tue Feb 23, 2010 6:55 pm

Post by XMatt »

Interactive_Matter wrote:

Code: Select all

mi_cmd_var_create: unable to create variable object
Is this some oddity I have to live with or did I forget to tell the compiler or linker to include all necessary debug information?
The eclipse IDE can sometime be a little verbose, this is the message it displays when a variable a user is looking for is not available for display (this could be due to optimization or lack of debug info). If you compile at -O0 with -g you should get all debug information for your variables. What are you doing to generate the message?
User avatar
Interactive_Matter
XCore Addict
Posts: 216
Joined: Wed Feb 10, 2010 10:26 am

Post by Interactive_Matter »

Hmm,

as you can see above I use -O0 & -g for my debugging version. It is very strange since the variable show up in the 'variables' tab in XDE. But they do not work as wathc expressions nor can I get their value as tool tip. Something strange with my installation?

Thanks for your help.

Marcus
User avatar
XMatt
XCore Addict
Posts: 147
Joined: Tue Feb 23, 2010 6:55 pm

Post by XMatt »

Doesnt sound quite right, what types are the variables that you cannot get tooltips for? And is this a multi-core application?
User avatar
Interactive_Matter
XCore Addict
Posts: 216
Joined: Wed Feb 10, 2010 10:26 am

Post by Interactive_Matter »

This is from the ap_led_tile on Mac OS X 10.7.2 wtih the 11.2 tools: https://github.com/xcore/sw_led_tile_controller

https://github.com/xcore/sw_led_tile_controller

You can check the source there on github. And yes, it is a multithreaded application. Perhaps I have not correctly switched to the thread in the debugger?

As far as I can see I have never seen any variable in the watch expression or tooltip. But all variables (from the first glance) are correctly displayed in the 'variables' tab. OK XDE has problems with channels and ports. Arrays references are also not handled correctly, but this is no big deal.

But I still suspect that it is something strange with my setup or Mac OS X (not so common).
ArtemisRodent
Junior Member
Posts: 6
Joined: Fri Mar 20, 2015 9:40 am

Post by ArtemisRodent »

Was this ever resolved? Sorry to dig this thread up but it seems silly to create a new thread in this case.

I am seeing the exact same problem on my project, and I have -O0 and -g set in my make file also.

On variable mouse over (when halted at a breakpoint) I get the "No symbol (whatever) in current context" message, and when I try to add a watch expression I get the "mi_cmd_var_create: unable to create variable object" Marcus described.

Oddly, when stepping through other sections of code, the variable window/panel will sometimes populate itself just fine, and in those cases I'm able to examine the variables.

Is there a known solution, or do I need to hit my keyboard harder?

If it matters, everything runs on a single core (combinable tasks) and it runs properly, so I'm not abusing anything as far as I can see.

If this doesn't match the original issue, I'll create a new thread. Thanks in advance.