Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Extending CDT so that "Details" variable format is the default format.

I’m not 100% of the best way, but look at how the constants defined in IDebugVMConstants are used.

There should be an easy way for you to set those to the setting you want.

 

From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Bruno Medeiros
Sent: Tuesday, April 08, 2014 12:17 PM
To: cdt-dev@xxxxxxxxxxx
Subject: [cdt-dev] Extending CDT so that "Details" variable format is the default format.

 

Hello. I'm having another go at improving the CDT debugger integration in both a D and Go IDE.

 

I want to make it so that the default _expression_/variable format in the Variables view (and in the debug editor hover) is the "Details" format. (org.eclipse.cdt.dsf.mi.service.MIExpressions.DETAILS_FORMAT )

The reason for this is that in these languages there are several variables/types that when debugged in GDB, show meaningful values under the "Details" format, but non-meaningful or less useful values in other formats. See for example this screenshot:
http://i.imgur.com/EoHJloH.png

Here we have a variable declared like this:
  string[3] staticArray = [ "one", "two", "three" ];

The details show up as: {"one", "two", "three"} , but the default format shows just the address of the variable.

A similar thing happens the "var" variable, for which the default is the useless {...} , but details is "blah" which is the contents of the var.

 

I tried to find a way to change this behavior but couldn't find any. I was looking at
https://wiki.eclipse.org/CDT/cdt-debug-dsf-gdb-extensibility

and while extending GdbLaunchDelegate eventually allows to customize most core debug behavior, I couldn't find a way to easily customize UI related behavior.

Particularly, I looked at these classes/entry-points in the CDT code, to try to see if I could extend/customize them, but didn't find a way:
org.eclipse.cdt.dsf.gdb.internal.ui.viewmodel.GdbViewModelAdapter
org.eclipse.cdt.dsf.gdb.internal.ui.viewmodel.GdbVariableVMProvider
org.eclipse.cdt.dsf.debug.ui.viewmodel.numberformat.FormattedValueRetriever#doUpdateWithAvailableFormats

Any ideas? Did I miss something or is this not supported?


--
Bruno Medeiros


Back to the top