Skip to content

Commit

Permalink
Add display hint p for VPointer
Browse files Browse the repository at this point in the history
  • Loading branch information
yuxiaomao committed Jun 24, 2024
1 parent 27e6ae4 commit ecd0b39
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions hld/Value.hx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ enum Hint {
HNone;
HHex; // v:h
HBin; // v:b
HPointer; // v:p
HEnumFlags(t : String); // v:EnumFlags<T>, v:haxe.EnumFlags<T>
HEnumIndex(t : String); // v:EnumIndex<T>
HCdbEnum(t : String); // v:CDB<T>, v:CDBEnum<T> -- for CastleDB
Expand All @@ -46,6 +47,8 @@ enum Hint {
return HHex;
if( s == "b" )
return HBin;
if( s == "p" )
return HPointer;
if( StringTools.startsWith(s,"EnumFlags<") && StringTools.endsWith(s,">") )
return HEnumFlags(s.substr(10, s.length - 11));
if( StringTools.startsWith(s,"haxe.EnumFlags<") && StringTools.endsWith(s,">") )
Expand Down
8 changes: 6 additions & 2 deletions src/HLAdapter.hx
Original file line number Diff line number Diff line change
Expand Up @@ -665,10 +665,14 @@ class HLAdapter extends DebugSession {
return { name : name, value : "Unknown variable", variablesReference : 0 };
var tstr = dbg.eval.typeStr(value.t);
switch( value.v ) {
case VPointer(_):
case VPointer(ptr):
var fields = dbg.eval.getFields(value);
var pstr = switch( value.hint ) {
case HPointer: " " + ptr.toString();
default: "";
}
if( fields != null && fields.length > 0 )
return { name : name, type : tstr, value : tstr, variablesReference : allocValue(VValue(value)), namedVariables : fields.length };
return { name : name, type : tstr, value : tstr + pstr, variablesReference : allocValue(VValue(value)), namedVariables : fields.length };
case VEnum(c,values,_) if( values.length > 0 ):
var str = c + "(" + [for( v in values ) switch( v.v ) {
case VEnum(c,values,_) if( values.length == 0 ): c;
Expand Down

0 comments on commit ecd0b39

Please sign in to comment.