Skip to content

Commit f94ad05

Browse files
author
colin-grant-work
authored
if evaluate request fails then ignore variable (eclipse-theia#11928)
1 parent 255450b commit f94ad05

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

packages/memory-inspector/src/browser/memory-provider/cdt-gdb-memory-provider.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,22 +64,21 @@ export class CDTGDBMemoryProvider extends AbstractMemoryProvider {
6464
expression: addrExp,
6565
context: 'watch',
6666
frameId: frame.raw.id,
67-
});
67+
}).catch(e => { console.warn(`Failed to evaluate ${addrExp}. Corresponding variable will be omitted from Memory Inspector display.`, e); });
68+
if (!addrResp) { continue; }
69+
6870
const sizeResp = await session.sendRequest('evaluate', {
6971
expression: sizeExp,
7072
context: 'watch',
7173
frameId: frame.raw.id,
72-
});
74+
}).catch(e => { console.warn(`Failed to evaluate ${sizeExp}. Corresponding variable will be omitted from Memory Inspector display.`, e); });
75+
if (!sizeResp) { continue; }
7376

7477
// Make sure the address is in the format we expect.
7578
const addressPart = /0x[0-9a-f]+/i.exec(addrResp.body.result);
76-
if (!addressPart) {
77-
continue;
78-
}
79+
if (!addressPart) { continue; }
7980

80-
if (!/^[0-9]+$/.test(sizeResp.body.result)) {
81-
continue;
82-
}
81+
if (!/^[0-9]+$/.test(sizeResp.body.result)) { continue; }
8382

8483
const size = parseInt(sizeResp.body.result);
8584
const address = hexStrToUnsignedLong(addressPart[0]);

0 commit comments

Comments
 (0)