Skip to content
Closed
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
11 changes: 5 additions & 6 deletions src/backend/mi2/mi2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -852,15 +852,13 @@ export class MI2 extends EventEmitter implements IBackend {
if (trace)
this.log("stderr", "getRegisters");

// Getting register names and values are separate GDB commands.
// We first retrieve the register names and then the values.
// The register names should never change, so we could cache and reuse them,
// but for now we just retrieve them every time to keep it simple.
const names = await this.getRegisterNames();
if (!this.regNames) {
this.regNames = await this.getRegisterNames();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the idea is good, but we need to store the regnames per inferior (you may switch between multiple ones via UI), not globally, as the inferiors can have different registers (example: server in 64 bit and client in 32 bit (or vice versa), attached to both)

}
const values = await this.getRegisterValues();
const ret: Variable[] = [];
for (const val of values) {
const key = names[val.index];
const key = this.regNames[val.index];
const value = val.value;
const type = "string";
ret.push({
Expand Down Expand Up @@ -1026,6 +1024,7 @@ export class MI2 extends EventEmitter implements IBackend {
printCalls: boolean;
debugOutput: boolean;
features: string[];
regNames: string[];
public procEnv: any;
public registerLimit: string;
protected isSSH: boolean;
Expand Down