[Mono-dev] soft debug

pierre pierre.saunier at ppmodeler.com
Tue Feb 27 13:45:32 UTC 2018


Hi,

Parsing the code of Mono.Debugger.Soft there is one thing I cannot 
figure out:

what is the expected reply when the debugger receives an event (command 
set: 64, command: 100)? The command packet contains a list of events, 
each with its own unique req_id (and there is an id in the header of the 
command packet).

If I reply with a  reply with no additional data with no error (and no 
attached data), the application crashes... and I am not using the req_id 
of each event.

Where can I find either the description of the reply I should send or 
the code that is doing it?

and I think there is a bug:

in the filemono <https://github.com/mono/mono>/mono 
<https://github.com/mono/mono/tree/master/mono>/mini 
<https://github.com/mono/mono/tree/master/mono/mini>/_debugger-agent.c_,  
in the function process_event, line 3747, there is:

case EVENT_KIND_VM_START:
      buffer_add_domainid (&buf, mono_get_root_domain ());
      break;


but in
mono <https://github.com/mono/mono>/mcs 
<https://github.com/mono/mono/tree/master/mcs>/class 
<https://github.com/mono/mono/tree/master/mcs/class>/Mono.Debugger.Soft 
<https://github.com/mono/mono/tree/master/mcs/class/Mono.Debugger.Soft>/Mono.Debugger.Soft 
<https://github.com/mono/mono/tree/master/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft>/Connection.cs, 
line 1318:
if (kind == EventKind.VM_START) {
    events [i] = new EventInfo (etype, req_id) { ThreadId = thread_id };
    //EventHandler.VMStart (req_id, thread_id, null);*
*   }...

while it shouold be:

if (kind == EventKind.VM_START) {
   longid= r.ReadId ();
   events [i] = new EventInfo (etype, req_id) { ThreadId = thread_id };
   ....

it is not causing trouble because the VM_START is always sent alone, but 
if this change, decoding the next events will have troubles....


thanks in advance,

Pierre



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.dot.net/pipermail/mono-devel-list/attachments/20180227/b6bd79db/attachment.html>


More information about the Mono-devel-list mailing list