Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[tcf-dev] Quick expressions support in TCF

Hello TCF dev,

I would like to contribute a new service to the TCF agent. This service can be used by client instead of the Expressions service to get basic information about expressions with few TCF requests. So, in the context of a connection with high network latencies, a client can visualize expressions quicker.

The service returns less information than the Expressions service; instead, it returns high level data that a UI client can display directly without extra requests. For example, it returns the value of the _expression_ as a string and gives a quick access to the children of the _expression_ (e.g. pointer, array, structure for C language).

For example, for a C structure like:

test.integer = 1234;
test.string = "A string";
test.floating = 3.14;
test.array[0] = 'A';

Evaluating the expressions with this service, it returns the info:

 {"Error":null,"TypeName":"struct TEST","TypeKind":6,"Value":"0x00007FFF9CFB81A0","HasChildren":true,"ID":"WREXPR.10.FP0.P18456.18456.48.@M0.@S4%28.B708DE.57BACF34.1C.79*28.B708DE.57BACF34.1C.EA+2.0.0.0.P18456.1.7FFF9CFB81A0","Label":"test","Display":"test : 0x00007FFF9CFB81A0"}

The "Display" field is a proposition of a display of the _expression_ 'test' that the client can use directly.

Getting the children of the expressions, it returns a list of info:

 [{"Error":null,"SymbolName":"integer","TypeName":"int","TypeKind":2,"Value":"1234","ID":"WREXPR.10.FP0.P18456.18456.48.@M0.@S4%28.B708DE.57BACF34.1C.57*28.B708DE.57BACF34.1C.EA+2.0.0.0.P18456.1.7FFF9CFB81A0","Label":"integer","Display":"integer : 1234"},
{"Error":null,"SymbolName":"string","TypeName":"char *","TypeKind":4,"Value":"0x0000000000400634","HasChildren":true,"ID":"WREXPR.10.FP0.P18456.18456.48.@M0.@S4%28.B708DE.57BACF34.1C.6C*28.B708DE.57BACF34.1C.EA+2.0.0.0.P18456.1.400634","Label":"string","Display":"string : 0x0000000000400634 \"A string\""},
{"Error":null,"SymbolName":"floating","TypeName":"double","TypeKind":3,"Value":"3.140000000000000","ID":"WREXPR.10.FP0.P18456.18456.48.@M0.@S4%28.B708DE.57BACF34.1C.B6*28.B708DE.57BACF34.1C.EA+2.0.0.0.P18456.1.7FFF9CFB81B0","Label":"floating","Display":"floating : 3.140000000000000"},
{"Error":null,"SymbolName":"array","TypeName":"char [10]","TypeKind":5,"Value":"0x00007FFF9CFB81B8","HasChildren":true,"ID":"WREXPR.10.FP0.P18456.18456.48.@M0.@S4%28.B708DE.57BACF34.1C.BD*28.B708DE.57BACF34.1C.EA+2.0.0.0.P18456.1.7FFF9CFB81B8","Label":"array","Display":"array : 0x00007FFF9CFB81B8 \"A\\u0004@\""}] 

With only two requests to the agent, the client is able to display basic information about a frame variable.


Do you think there is an interest by this contribution to the core TCF?

Any comment/suggestion is welcome.

Benoit

-- 
Benoit Perrin, Senior Member of Technical Staff, Wind River


Back to the top