Skip to content

Commit

Permalink
Fix missing right click menu for VInlined
Browse files Browse the repository at this point in the history
  • Loading branch information
yuxiaomao committed Mar 29, 2024
1 parent f9ad409 commit b49c8e1
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions src/HLAdapter.hx
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ class HLAdapter extends DebugSession {
case VClosure(f,context,_):
return { name : name, type : tstr, value : dbg.eval.funStr(f), variablesReference : allocValue(VValue(value)), indexedVariables : 2 };
case VInlined(fields):
return { name : name, type : tstr, value : dbg.eval.valueStr(value), variablesReference : fields.length == 0 ? 0 : allocValue(VValue(value)), indexedVariables : fields.length };
return { name : name, type : tstr, value : dbg.eval.valueStr(value), variablesReference : fields.length == 0 ? 0 : allocValue(VValue(value)), namedVariables : fields.length };
default:
}
return { name : name, type : tstr, value : dbg.eval.valueStr(value), variablesReference : 0 };
Expand Down Expand Up @@ -1020,17 +1020,24 @@ class HLAdapter extends DebugSession {
}

override function dataBreakpointInfoRequest(response:DataBreakpointInfoResponse, args:DataBreakpointInfoArguments) {
var ptr = getVarAddress(args.variablesReference, args.name);
if( ptr != null ) {
var desc = switch( varsValues.get(args.variablesReference) ) {
case VScope(_): "local "+args.name;
case VValue({ v : VArray(_) } ): "["+args.name+"]";
default: "field "+args.name;
try {
var ptr = getVarAddress(args.variablesReference, args.name);
if( ptr != null ) {
var desc = switch( varsValues.get(args.variablesReference) ) {
case VScope(_): "local "+args.name;
case VValue({ v : VArray(_) } ): "["+args.name+"]";
default: "field "+args.name;
}
response.body = {
dataId : cast allocPtr(ptr),
description : "Write "+desc+":"+ptr.ptr.toString(),
accessTypes : [Write],
};
}
} catch( e : Dynamic ) {
response.body = {
dataId : cast allocPtr(ptr),
description : "Write "+desc+":"+ptr.ptr.toString(),
accessTypes : [Write],
dataId : null,
description : ""+e,
};
}
sendResponse(response);
Expand Down

0 comments on commit b49c8e1

Please sign in to comment.