Skip to content

Evaluation of variables to support RTOS Views extension #400

@thorstendb-ARM

Description

@thorstendb-ARM

While adapting RTOS Views extension for gdbtarget, I figured out that some variable expressions are turned into array expressions where they imho should not. A struct or array member which is an array itself gets [] for the access expression, which results in an expression: ((TCB_t*)0x20005cd0)[pcTaskName], where pcTaskName is a char [16] array.

I have changed this to use GDB directly, but this could cause bandwidth issues when running GDB remotely, see: #390

If I got it correctly,

isArrayParent determines if the element itself is an array
isArrayChild determines if the element is part of an array
I want to understand why isArrayParent elements also gets brackets []. I thought about two-dimensional arrays, but they run fine on just using isArrayChild.

This change for arrayParent fixes the issue on parsing (my) expressions and survives 2D arrays:
const isArrayParent = arrayRegex.test(child.type) && arrayChildRegex.test(child.exp);

@asimgunes, @jonahgraham, can someone help?

Ref. (two approaches):

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions