MCPcopy Create free account
hub / github.com/Marus/cortex-debug / field

Method field

src/gdb.ts:2568–2571  ·  view source on GitHub ↗
(nm: string, offset: number, width: number)

Source from the content-addressed store, hash-verified

2566 const intval = parseInt(val.toLowerCase());
2567 res.type = `Register: $${reg} Thread#${threadId}, Frame#${frameId}\n` + toStringDecHexOctBin(intval);
2568 const field = (nm: string, offset: number, width: number): string => {
2569 const v = extractBits(intval, offset, width);
2570 return `\n ${nm}: ${v.toString()}`;
2571 };
2572 // TODO: someday, fake these registers as a struct to VSCode
2573 if (reg.toLowerCase() === 'xpsr') {
2574 res.type += field('Negative Flag (N)', 31, 1);

Callers

nothing calls this directly

Calls 2

extractBitsFunction · 0.90
toStringMethod · 0.80

Tested by

no test coverage detected