diff --git a/src/debugger.js b/src/debugger.js index d43495c..6d3fe51 100644 --- a/src/debugger.js +++ b/src/debugger.js @@ -855,8 +855,10 @@ Debugger.prototype = { .then((fields, x) => { var field = fields.find(f => f.name === x.fieldname); if (field) return $.Deferred().resolveWith(this,[field,x.extra]); - if (!x.includeInherited || x.objvar.type.signature==='Ljava/lang/Object;') - return $.Deferred().rejectWith(this,[new Error('No such field: '+x.fieldname), x.extra]); + if (!x.includeInherited || x.objvar.type.signature==='Ljava/lang/Object;') { + var fqtname = [x.reqtype.package,x.reqtype.typename].join('.'); + return $.Deferred().rejectWith(this,[new Error(`No such field '${x.fieldname}' in type ${fqtname}`), x.extra]); + } // search supertype return this.getsuperinstance(x.objvar, x) .then((superobjvar,x) => { @@ -865,7 +867,7 @@ Debugger.prototype = { }); }); } - return findfield({findfield, objvar, fieldname, includeInherited, extra}); + return findfield({findfield, objvar, fieldname, includeInherited, extra, reqtype:objvar.type}); }, getExceptionLocal: function (ex_ref_value, extra) { @@ -1060,6 +1062,8 @@ Debugger.prototype = { arrayfields.push(info); else if (keys[i].type.signature === 'Ljava/lang/String;') stringfields.push(info); + else if (keys[i].type.signature === 'C') + info.char = info.valid ? String.fromCodePoint(info.value) : ''; i++; } } diff --git a/src/jdwp.js b/src/jdwp.js index aa8f788..2e39dcf 100644 --- a/src/jdwp.js +++ b/src/jdwp.js @@ -169,7 +169,7 @@ function _JDWP() { return i<32768?i:i-65536; }, decodeChar: function(o) { - return String.fromCharCode((o.data[o.idx++]<<8)+o.data[o.idx++]); + return (o.data[o.idx++]<<8)+o.data[o.idx++]; // uint16 }, decodeBoolean: function(o) { return o.data[o.idx++] != 0;