[Mono-list] Stepping into interncalls with the Mono Debugger

Urs C Muff umuff@quark.com
Fri, 21 Mar 2003 08:26:07 +0000


The current built debugger from CVS does not start up (the main windows=20
flashes and then the following exception occurs):  Let me know if I can=20
produce better info for you.  [I built all the libraries including gtk#,=20
corlib, and the debugger, with debug symbols, but it would help a lot if =
the=20
configuration already would support debug targets!!]

$ mono --debug /usr/bin/Debugger.exe ~/Test/Client.exe
** Message: debug-mono-symfile.c:950: 0x8707480 - 0,f,0

Unhandled Exception: System.NullReferenceException: A null value was foun=
d=20
where an object instance was required
in [0x00009] (at /home/umuff/mono/gtk-sharp/glade/XML.custom:184) 00=20
=2ESignalConnector:ConnectFunc (string,intptr,string,string,intptr,int,in=
tptr)
in <0x0008c> 05 .SignalConnector:ConnectFunc=20
(intptr,intptr,intptr,intptr,intptr,int,intptr)
in (unmanaged) 06 .SignalConnector:glade_xml_signal_autoconnect_full=20
(intptr,RawXMLConnectFunc,intptr)
in <0x00004> 06 .SignalConnector:glade_xml_signal_autoconnect_full=20
(intptr,RawXMLConnectFunc,intptr)
in [0x00013] (at /home/umuff/mono/gtk-sharp/glade/XML.custom:163) 00=20
=2ESignalConnector:Autoconnect ()
in [0x00010] (at /home/umuff/mono/gtk-sharp/glade/XML.custom:115) 00=20
Glade.XML:Autoconnect (object)
in [0x00186] (at=20
/home/umuff/mono/debugger/lib/../frontends/gui/DebuggerGUI.cs:226) 00=20
Mono.Debugger.GUI.DebuggerGUI:SetupGUI ()
in [0x00061] (at=20
/home/umuff/mono/debugger/lib/../frontends/gui/DebuggerGUI.cs:140) 00=20
Mono.Debugger.GUI.DebuggerGUI:.ctor (string[])
in [0x000fc] (at=20
/home/umuff/mono/debugger/lib/../frontends/gui/DebuggerGUI.cs:88) 00=20
Mono.Debugger.GUI.DebuggerGUI:Main (string[])

It worked about 4 days ago, and does not seem to be either in gtk, nor in=
 the=20
debugger itself [but that is just a hunch].

- Urs

On Friday 21 March 2003 12:24, Martin Baulig wrote:
> Hi,
>
> the bug is now fixed in CVS and the debugger can now debug interncalls =
:-)
>
> Documentation is in doc/FAQ.txt:
>
> =3D=3D=3D=3D=3D
> * How do I enter a JIT trampoline ?
>
>   Normally, the debugger hides JIT trampolines from the user, even when
> stepping one single instruction.  To force the debugger to debug a JIT
> trampoline, you need to use the `native stepi' command in the command l=
ine
> interface.
>
>
> * How do I enter an interncall ?
>
>   There are two ways of entering an interncall: if the module the
> interncall is contained in has debugging info and the `step' property i=
s
> set (use `module <number> !ignore step' in the command line interface),=
 the
> debugger will automatically enter the interncall when stepping by sourc=
e
> lines.
>
>   Example debugging session:
>
>         [martin@einstein debugger]$ run-mono ./lib/Interpreter.exe
> ./test/N.exe Process @1 stopped at #0: 0x08365f63 in X.Main()+0x7 at
> N.cs:7. #0: 0x08365f63 in X.Main()+0x7 at N.cs:7
>         0x08365f63      push   $0x41
>            7            bool is_number =3D Char.IsNumber ('A');
>         Mono debugger
>         $ show modules
>         3 /home/martin/MONO-LINUX/libexec/mono-debugger-jit-wrapper loa=
ded
> ignore 5 N loaded symbols step
>         7 /home/martin/MONO-LINUX/lib/libmono.so.0 loaded ignore
>         9 mscorlib loaded symbols step
>         $ module 7 !ignore step
>         $ s
>         Process @1 stopped at #0: 0x400aa12c in
> ves_icall_System_Char_IsNumber+0x1c at unicode.c:110. 0x400aa12c    =20
> movzwl 0xfffffff2(%ebp),%eax
>         110    GUnicodeType t =3D g_unichar_type (c);
>
>   You can also "force" the debugger to enter the intercalls by stepping=
 by
> machine instructions; in this case, the debugger will automatically jum=
p
> over the JIT trampoline and stop at the first instruction of the
> interncall.
>
>   Example debugging session:
>
>         [martin@einstein debugger]$ run-mono ./lib/Interpreter.exe
> ./test/N.exe Process @1 stopped at #0: 0x08366013 in X.Main()+0x7 at
> N.cs:7. #0: 0x08366013 in X.Main()+0x7 at N.cs:7
>         0x08366013      push   $0x41
>          7            bool is_number =3D Char.IsNumber ('A');
>         Mono debugger
>         $ i
>         Process @1 stopped at #0: 0x08366018 in X.Main()+0xc at N.cs:7.
>         0x08366018      call   System.Char.IsNumber(System.Char)
>          7            bool is_number =3D Char.IsNumber ('A');
>         $
>         Process @1 stopped at #0: 0x400aa110.
>         0x400aa110      push   %ebp
>
>
> =3D=3D=3D=3D
>
> Please let me know if you have any more questions or problems.