[Mono-dev] help required with debugger

Natalia Kubera nkubera at vqlive.com
Fri Jul 28 10:32:49 EDT 2006


I am using mono-1.1.16 and SUSE Linux 10.1

When debugging with mdb :
1) only machine instructions are displayed. how do we see the source
code LINES?  
2) command 'list' causes 
ERROR: Current location doesn't have source code
3). We've tried using the Xdevelop IDE from OmniCore and it didnt seem
straightforward (we had to get latest mono debugger library).

We therefore have some specific questions on how we get mdb to work and
more general questions, how are other mono developers debugging their
code on SUSE?

what we see using mdb follows:

running without debugger:

natalia at linux-8gsy:~/Projects/simplest> mcs -debug X.cs
natalia at linux-8gsy:~/Projects/simplest> mono X.exe
Foo: 5
Foo with a string: Boston
Hello: 5
Test: 9

running with Debugger:

natalia at linux-8gsy:~/Projects/simplest> mcs -debug X.cs
natalia at linux-8gsy:~/Projects/simplest> mdb X.exe
Mono Debugger
(mdb) run
Starting program: X.exe
Thread @1 stopped at #0: 0x081d3451.
0x081d3451      ret
(mdb) step
Thread @1 stopped at #0: 0x08076738 in mono_debugger_init+0x68.
0x08076738      mov    %ebp,%esp
(mdb) list
ERROR: Current location doesn't have source code
(mdb)

The file:
natalia at linux-8gsy:~/Projects/simplest/X.cs

class X
{
        public static void Foo (int a)
        {
                Console.WriteLine ("Foo: {0}", a);
        }

        public static void Foo (string b)
        {
                Console.WriteLine ("Foo with a string: {0}", b);
        }

        public void Test (long a)
        {
                Console.WriteLine ("Test: {0}", a);
        }

        public static void Hello (int a)
        {
                Console.WriteLine ("Hello: {0}", a);
        }

        public static void Main ()
        {
                int a = 5;
                string hello = "Boston";
                X x = new X ();

                // You are stopped here.
                Foo (a);
                Foo (hello);
                Hello (a);
                x.Test (9);
        }
}

Thanks




More information about the Mono-devel-list mailing list