@@ -46,6 +46,24 @@ function normalize(name: string): string {
4646 return name . trim ( ) . toUpperCase ( ) ;
4747}
4848
49+ /**
50+ * Convert a symbol path notation to GDB qualified symbol syntax.
51+ * Input: "tasks.c/xSchedulerRunning" → Output: "'tasks.c'::xSchedulerRunning"
52+ * Input: "xSchedulerRunning" → Output: "xSchedulerRunning" (unchanged)
53+ */
54+ export function toGdbSymbol ( symbol : string ) : string {
55+ const slashIndex = symbol . indexOf ( '/' ) ;
56+ if ( slashIndex < 0 ) {
57+ return symbol ;
58+ }
59+ const file = symbol . substring ( 0 , slashIndex ) ;
60+ const name = symbol . substring ( slashIndex + 1 ) ;
61+ if ( ! file || ! name ) {
62+ return symbol ;
63+ }
64+ return `'${ file } '::${ name } ` ;
65+ }
66+
4967function toUint32 ( value : number | bigint ) : number | bigint {
5068 if ( typeof value === 'bigint' ) {
5169 return value & 0xFFFFFFFFn ;
@@ -157,7 +175,8 @@ export class ScvdDebugTarget {
157175 }
158176
159177 const addressInfo = await this . symbolCaches . getAddressWithName ( symbol , async ( symbolName ) => {
160- const symbolAddressStr = await this . targetAccess . evaluateSymbolAddress ( symbolName , 'hover' , existCheck ) ;
178+ const gdbSymbol = toGdbSymbol ( symbolName ) ;
179+ const symbolAddressStr = await this . targetAccess . evaluateSymbolAddress ( gdbSymbol , 'hover' , existCheck ) ;
161180 if ( symbolAddressStr !== undefined ) {
162181 const parsed = parseInt ( symbolAddressStr as unknown as string , 16 ) ;
163182 if ( Number . isFinite ( parsed ) ) {
@@ -228,7 +247,8 @@ export class ScvdDebugTarget {
228247 return undefined ;
229248 }
230249 return this . symbolCaches . getArrayCount ( symbol , async ( symbolName ) => {
231- const result = await this . targetAccess . evaluateNumberOfArrayElements ( symbolName ) ;
250+ const gdbSymbol = toGdbSymbol ( symbolName ) ;
251+ const result = await this . targetAccess . evaluateNumberOfArrayElements ( gdbSymbol ) ;
232252 componentViewerLogger . debug ( `get Num Array Elements: ${ symbolName } resolved to ${ result } ` ) ;
233253 return result ;
234254 } ) ;
@@ -260,7 +280,8 @@ export class ScvdDebugTarget {
260280 }
261281
262282 return this . symbolCaches . getSize ( symbol , async ( symbolName ) => {
263- const size = await this . targetAccess . evaluateSymbolSize ( symbolName ) ;
283+ const gdbSymbol = toGdbSymbol ( symbolName ) ;
284+ const size = await this . targetAccess . evaluateSymbolSize ( gdbSymbol ) ;
264285 if ( typeof size === 'number' && size >= 0 ) {
265286 componentViewerLogger . debug ( `get Symbol Size: ${ symbolName } resolved to ${ size } ` ) ;
266287 return size ;
0 commit comments