From: Andrea C. O. <and...@gm...> - 2010-04-06 13:02:07
|
I changed cil32-objdump to print comments with the line numbers. This change kind of breaks cil32-objdump, the original idea was that after objdump, you could do some change in the text file and afterwards reassemble it. What I originally wanted was to be able to dump and reassemble it without loosing info. Now it looses the line numbers; my current change dumps just comments. I looked only at the instruction code stream, there may be some problem with position info attached to members (fields or methods) in Cecil. BTW In http://groups.google.it/group/mono-cecil?hl=it someone have problems with debug info. I do not know how mature is in Cecil the debug info handling. Andrea On Tue, Apr 6, 2010 at 2:30 PM, Thierry Lafage <thi...@in...> wrote: > Hi Andrea, > > Even with the Cecil patch, it seems it does not work... > I recompiled my test program (named induction.dbg.exe) and try to debug it > with mdb. The link still generates an .mdb file which is (a bit) smaller > than the original .o.mdb... What I found strange is that when I ask mdb to > list the source main method, it displays a main method which is not the main > method of my test program! Also, I set up a breakpoint at main, but mdb > never stops in the main of the program being debugged... > You'll find below some output. > How did you check that your ld merges well all input .mdb files? > > Regards, > > Thierry Lafage. > > > lafage$ ls -l > induction.dbg.* > -rwxr-x--- 1 lafage alf 3072 2010-04-06 14:11 > induction.dbg.exe* > -rw-r----- 1 lafage alf 405 2010-04-06 14:11 > induction.dbg.exe.mdb > -rw-r----- 1 lafage alf 3584 2010-04-01 11:37 > induction.dbg.o > -rw-r----- 1 lafage alf 485 2010-04-01 11:37 > induction.dbg.o.mdb > -rwxr-x--- 1 lafage alf 4392 2010-04-01 11:37 > induction.dbg.s* > -rw-r----- 1 lafage alf 112 2010-04-01 11:24 > induction.dbg.s.mdb > lafage@dingdong src$ cil32-mdb induction.dbg.exe > Mono Debugger > (mdb) b main > Breakpoint 3 at main > (mdb) l main > ERROR: No target. > (mdb) run > Starting program: induction.dbg.exe > Cannot read symbol file `/udd/lafage/gcc/image/lib/gcc4net.dll.mdb': Could > not find file "/udd/lafage/gcc/image/lib/gcc4net.dll.mdb". > Cannot read symbol file `/udd/lafage/gcc/image/lib/libstd.dll.mdb': Could > not find file "/udd/lafage/gcc/image/lib/libstd.dll.mdb". > Thread @1 stopped at #0: 0xb67c720d in <induction.dbg:.start > (string[])>+0x15 at 1. > 1 IL_0000: call 0x06000001 > (mdb) l main > 1 #include <config.h> > 2 #include "mini.h" > 3 #ifndef PLATFORM_WIN32 > 4 #include "buildver.h" > 5 #endif > 6 > 7 #ifdef PLATFORM_WIN32 > 8 > 9 int > 10 main () > 11 { > 12 int argc; > 13 gunichar2** argvw; > 14 gchar** argv; > 15 int i; > 16 > 17 argvw = CommandLineToArgvW (GetCommandLine (), &argc); > 18 argv = g_new0 (gchar*, argc + 1); > 19 for (i = 0; i < argc; i++) > 20 argv [i] = g_utf16_to_utf8 (argvw [i], -1, NULL, NULL, > NULL); > (mdb) c > Cannot read symbol file > `/udd/lafage/gcc/image/lib/MSCorelibWrapper.dll.mdb': Could not find file > "/udd/lafage/gcc/image/lib/MSCorelibWrapper.dll.mdb". > <HERE IS THE OUTPUT OF MY TEST PROGRAM> > Thread @1 exited. > Process #1 exited. > (mdb) Target exited. > > Thierry Lafage a écrit : > > Andrea, > > I did not see your patch for Cecil inthe bugzilla... So, I'll try it > Sorry, > > Thierry Lafage. > > > > Thierry Lafage a écrit : > > > Hi Andrea, > > Thanks for fixing it. By the way, I can't have it working properly. > I generate a .s with line numbers. Then I use my patched ilasm to > generated a .o and a .o.mdb. > Then I use your new ld to make a .exe and a .exe.mdb > It actually produces a .exe.mdb, but it seems that it does not contain > the correct information: I run mdb on the .exe and "list main" does not > list the main of the program but something else I don't understand... > Moreover, the .exe.mdb is smaller than the .o.mdb ; I think the .exe.mdb > may be at least as big as the .o.mdb since it should include it, > shouldn't it? > > $ ls -l > -rw-r----- 1 lafage alf 671 2010-03-31 14:21 induction.c > -rwxr-x--- 1 lafage alf 3072 2010-04-01 11:56 induction.exe* > -rw-r----- 1 lafage alf 112 2010-04-01 11:56 induction.exe.mdb > -rw-r----- 1 lafage alf 3584 2010-04-01 11:37 induction.o > -rw-r----- 1 lafage alf 485 2010-04-01 11:37 induction.o.mdb > -rwxr-x--- 1 lafage alf 4392 2010-04-01 11:37 induction.s* > -rw-r----- 1 lafage alf 3648 2010-03-31 14:22 induction.s > > Any clue? > > Thierry Lafage. > > > > Andrea Carlo Ornstein a écrit : > > > > There is a bug in Mono.Cecil > https://bugzilla.novell.com/show_bug.cgi?id=592849 > > otherwise it seems to be working. > At least small examples. > I looked ONLY at line numbers in the code stream. > We do not do anything special for the debug information. > If there is a problem it would be from mono. Cecil :) > > I added the option -g to cil32-as > it has to be passed down when -g is passed to gcc. > > I use this change: > Index: gcc/config/cil32/cil32.h > =================================================================== > --- gcc/config/cil32/cil32.h (revision 157653) > +++ gcc/config/cil32/cil32.h (working copy) > @@ -53,7 +53,7 @@ > #else > #error "Unrecognized binutils: impossible to choose default compiler > driver arguments" > #endif > -#define ASM_SPEC "%{!O0:%{O*:-O}}" > +#define ASM_SPEC "%{!O0:%{O*:-O}} %{g*:-g}" > #define LIB_SPEC "-l libstd.dll" > #define LINK_SPEC "%{shared:--shared} %{mthreads:-mt}" > #define STARTFILE_SPEC "" > > > Andrea > > > > > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > Clibinutils-devel mailing list > Cli...@li... > https://lists.sourceforge.net/lists/listinfo/clibinutils-devel > |