Re: soft debug

Zoltan Varga <[email protected]> Tue, 27 Feb 2018 09:26:26 -0500
Newsgroups gmane.comp.gnome.mono.devel
Message-ID <CAJR-0p-FXZZZxUGK8YUe3o2K_Ygie_xQ_uD3fNZ_avGRgF-RAg@mail.gmail.com>
--===============6208174065608475510==
Content-Type: multipart/alternative; boundary="001a114e3d726b195d0566326978"

--001a114e3d726b195d0566326978
Content-Type: text/plain; charset="UTF-8"

Hi,

  There is no reply, only the requests sent from the debugger to the
debuggee have a reply.

              Zoltan

On Tue, Feb 27, 2018 at 8:45 AM, pierre <[email protected]>
wrote:

> 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 file mono <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) {
>   long id = 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
>
>
>
>
> _______________________________________________
> Mono-devel-list mailing list
> [email protected]
> http://lists.dot.net/mailman/listinfo/mono-devel-list
>
>

--001a114e3d726b195d0566326978
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi,<div><br></div><div>=C2=A0 There is no reply, only the =
requests sent from the debugger to the debuggee have a reply.</div><div><br=
></div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Zoltan</div></=
div><div class=3D"gmail_extra"><br><div class=3D"gmail_quote">On Tue, Feb 2=
7, 2018 at 8:45 AM, pierre <span dir=3D"ltr">&lt;<a href=3D"mailto:pierre.s=
[email protected]" target=3D"_blank">[email protected]</a>&gt=
;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 =
.8ex;border-left:1px #ccc solid;padding-left:1ex">
 =20

   =20
 =20
  <div text=3D"#000000" bgcolor=3D"#FFFFFF">
    <p>Hi,</p>
    <p>Parsing the code of Mono.Debugger.Soft there is one thing I
      cannot figure out:</p>
    <p>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).</p>
    <p>If I reply with a=C2=A0 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. <br>
    </p>
    <p>Where can I find either the description of the reply I should
      send or the code that is doing it?</p>
    <p>and I think there is a bug:</p>
    <p>in the file<span class=3D"m_4727352197368907842repo-root m_472735219=
7368907842js-repo-root"><span class=3D"m_4727352197368907842js-path-segment=
"><a href=3D"https://github.com/mono/mono" target=3D"_blank"><span> mono</s=
pan></a></span></span><span class=3D"m_4727352197368907842separator">/</spa=
n><span class=3D"m_4727352197368907842js-path-segment"><a href=3D"https://g=
ithub.com/mono/mono/tree/master/mono" target=3D"_blank"><span>mono</span></=
a></span><span class=3D"m_4727352197368907842separator">/</span><span class=
=3D"m_4727352197368907842js-path-segment"><a href=3D"https://github.com/mon=
o/mono/tree/master/mono/mini" target=3D"_blank"><span>mini</span></a></span=
><span class=3D"m_4727352197368907842separator">/</span><u><font color=3D"#=
3366ff"><span class=3D"m_4727352197368907842final-path">debugger-agent.<wbr=
>c</span></font></u>,=C2=A0 in
      the function <span class=3D"m_4727352197368907842pl-en">process_event=
, line 3747, there
        is:</span></p>
    <p><tt>case EVENT_KIND_VM_START:</tt><tt><br>
      </tt><tt>=C2=A0=C2=A0=C2=A0=C2=A0 buffer_add_domainid (&amp;buf, mono=
_get_root_domain
        ());</tt><tt><br>
      </tt><tt>=C2=A0=C2=A0=C2=A0=C2=A0 break;</tt><tt><br>
      </tt></p>
    <br>
    but in<br>
    <div class=3D"m_4727352197368907842breadcrumb m_4727352197368907842js-z=
eroclipboard-target"> <span class=3D"m_4727352197368907842repo-root m_47273=
52197368907842js-repo-root"><span class=3D"m_4727352197368907842js-path-seg=
ment"><a href=3D"https://github.com/mono/mono" target=3D"_blank"><span>mono=
</span></a></span></span><span class=3D"m_4727352197368907842separator">/</=
span><span class=3D"m_4727352197368907842js-path-segment"><a href=3D"https:=
//github.com/mono/mono/tree/master/mcs" target=3D"_blank"><span>mcs</span><=
/a></span><span class=3D"m_4727352197368907842separator">/</span><span clas=
s=3D"m_4727352197368907842js-path-segment"><a href=3D"https://github.com/mo=
no/mono/tree/master/mcs/class" target=3D"_blank"><span>class</span></a></sp=
an><span class=3D"m_4727352197368907842separator">/</span><span class=3D"m_=
4727352197368907842js-path-segment"><a href=3D"https://github.com/mono/mono=
/tree/master/mcs/class/Mono.Debugger.Soft" target=3D"_blank"><span>Mono.Deb=
ugger.<wbr>Soft</span></a></span><span class=3D"m_4727352197368907842separa=
tor">/</span><span class=3D"m_4727352197368907842js-path-segment"><a href=
=3D"https://github.com/mono/mono/tree/master/mcs/class/Mono.Debugger.Soft/M=
ono.Debugger.Soft" target=3D"_blank"><span>Mono.Debugger.Soft</span></a></s=
pan><span class=3D"m_4727352197368907842separator">/</span><span class=3D"m=
_4727352197368907842final-path">Connec<wbr>tion.cs,
        line 1318:</span> </div>
    =C2=A0 <tt>if (kind =3D=3D EventKind.VM_START) {</tt><tt><br>
    </tt><tt>=C2=A0=C2=A0 events [i] =3D new EventInfo (etype, req_id) { Th=
readId =3D
      thread_id };</tt><tt><br>
    </tt><tt>=C2=A0=C2=A0 //EventHandler.VMStart (req_id, thread_id, null);=
</tt><b><br>
    </b>=C2=A0=C2=A0 }...<br>
    <br>
    while it shouold be:<br>
    <br>
    <tt>if (kind =3D=3D EventKind.VM_START) {</tt><tt><br>
    </tt><tt><span class=3D"m_4727352197368907842pl-k">=C2=A0 long</span></=
tt><tt> </tt><tt><span class=3D"m_4727352197368907842pl-en">id</span></tt><=
tt> =3D r.ReadId ();</tt><tt><br>
    </tt><tt>=C2=A0 events [i] =3D new EventInfo (etype, req_id) { ThreadId=
 =3D
      thread_id };</tt><br>
    =C2=A0 ....<br>
    <br>
    it is not causing trouble because the VM_START is always sent alone,
    but if this change, decoding the next events will have troubles....<br>
    <br>
    <p><br>
    </p>
    <p>thanks in advance,</p>
    <p>Pierre</p>
    <p><br>
    </p>
    <p><br>
    </p>
  </div>

<br>______________________________<wbr>_________________<br>
Mono-devel-list mailing list<br>
<a href=3D"mailto:[email protected]">[email protected].=
net</a><br>
<a href=3D"http://lists.dot.net/mailman/listinfo/mono-devel-list" rel=3D"no=
referrer" target=3D"_blank">http://lists.dot.net/mailman/<wbr>listinfo/mono=
-devel-list</a><br>
<br></blockquote></div><br></div>

--001a114e3d726b195d0566326978--

--===============6208174065608475510==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KTW9uby1kZXZl
bC1saXN0IG1haWxpbmcgbGlzdApNb25vLWRldmVsLWxpc3RAbGlzdHMuZG90Lm5ldApodHRwOi8v
bGlzdHMuZG90Lm5ldC9tYWlsbWFuL2xpc3RpbmZvL21vbm8tZGV2ZWwtbGlzdAo=

--===============6208174065608475510==--