Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If evaluate request fails, ignore variable #11928

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,22 +64,21 @@ export class CDTGDBMemoryProvider extends AbstractMemoryProvider {
expression: addrExp,
context: 'watch',
frameId: frame.raw.id,
});
}).catch(e => { console.warn(`Failed to evaluate ${addrExp}. Corresponding variable will be omitted from Memory Inspector display.`, e); });
if (!addrResp) { continue; }

const sizeResp = await session.sendRequest('evaluate', {
expression: sizeExp,
context: 'watch',
frameId: frame.raw.id,
});
}).catch(e => { console.warn(`Failed to evaluate ${sizeExp}. Corresponding variable will be omitted from Memory Inspector display.`, e); });
if (!sizeResp) { continue; }

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

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

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