Skip to content

Commit 69fe553

Browse files
author
David Karlaš
committed
Sync Mono.Debugger.Soft with mono repository
1 parent e4c5a7b commit 69fe553

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,8 @@ public enum ErrorCode {
382382
ERR_UNLOADED = 103,
383383
ERR_NO_INVOCATION = 104,
384384
ABSENT_INFORMATION = 105,
385-
NO_SEQ_POINT_AT_IL_OFFSET = 106
385+
NO_SEQ_POINT_AT_IL_OFFSET = 106,
386+
INVOKE_ABORTED = 107
386387
}
387388

388389
public class ErrorHandlerEventArgs : EventArgs {
@@ -418,7 +419,7 @@ public abstract class Connection
418419
* with newer runtimes, and vice versa.
419420
*/
420421
internal const int MAJOR_VERSION = 2;
421-
internal const int MINOR_VERSION = 40;
422+
internal const int MINOR_VERSION = 42;
422423

423424
enum WPSuspendPolicy {
424425
NONE = 0,
@@ -802,6 +803,13 @@ public string ReadString () {
802803
return res;
803804
}
804805

806+
public string ReadUTF16String () {
807+
int len = decode_int (packet, ref offset);
808+
string res = new String (Encoding.Unicode.GetChars (packet, offset, len));
809+
offset += len;
810+
return res;
811+
}
812+
805813
public ValueImpl ReadValue () {
806814
ElementType etype = (ElementType)ReadByte ();
807815

@@ -2408,7 +2416,16 @@ internal void Array_SetValues (long id, int index, ValueImpl[] values) {
24082416
* STRINGS
24092417
*/
24102418
internal string String_GetValue (long id) {
2411-
return SendReceive (CommandSet.STRING_REF, (int)CmdStringRef.GET_VALUE, new PacketWriter ().WriteId (id)).ReadString ();
2419+
var r = SendReceive (CommandSet.STRING_REF, (int)CmdStringRef.GET_VALUE, new PacketWriter ().WriteId (id));
2420+
2421+
bool is_utf16 = false;
2422+
if (Version.AtLeast (2, 41))
2423+
is_utf16 = r.ReadByte () == 1;
2424+
2425+
if (is_utf16)
2426+
return r.ReadUTF16String ();
2427+
else
2428+
return r.ReadString ();
24122429
}
24132430

24142431
internal int String_GetLength (long id) {

Mono.Debugger.Soft/Mono.Debugger.Soft/ObjectMirror.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,9 @@ static void InvokeMultipleCB (ValueImpl v, ValueImpl exc, ValueImpl out_this, Va
442442

443443
Interlocked.Decrement (ref r.NumPending);
444444

445+
if (error != 0)
446+
r.ErrorCode = error;
447+
445448
if (r.NumPending == 0) {
446449
r.IsCompleted = true;
447450
((ManualResetEvent)r.AsyncWaitHandle).Set ();

0 commit comments

Comments
 (0)