Hi,
Could a gate keeper please review the attached patch to fix bug #944.
This fix solves a problem in debugging the open64 generated binaries. Currently
if we compile a file which is in different directory than the working
directory, it cannot be debugged.
$pwd
/tmp
$opencc -g test_dir/t1.c
$gdb a.out
(gdb) b main
(gdb) run
Breakpoint 1, main () at t1.c:6
6 t1.c: No such file or directory.
in t1.c
We don't generate the path information for ".file" directives in the generated
assembly and due to this directory table entries are not not created correctly.
This patch generates the ".file" directives similar to gcc and fixes the
problem.
Regards,
Shivaram
Index: be/cg/cgdwarf.cxx
===================================================================
--- be/cg/cgdwarf.cxx (revision 3858)
+++ be/cg/cgdwarf.cxx (working copy)
@@ -2831,9 +2831,19 @@
fprintf(Asm_File, "\t%s\t%d\t\"%s\"\n", AS_FILE, count,
file_table[count].filename);
else
-#endif
+#elif defined(TARG_X8664)
+ int include_idx = file_table[count].incl_index;
+ if (incl_table[include_idx].path_name)
+ fprintf(Asm_File, "\t%s\t\%d\t\"%s/%s\"\n", AS_FILE,count,
+ incl_table[include_idx].path_name,
+ file_table[count].filename);
+ else
+ fprintf(Asm_File, "\t%s\t%d\t\"%s\"\n", AS_FILE, count,
+ file_table[count].filename);
+#else
fprintf(Asm_File, "\t%s\t%d\t\"%s\"\n", AS_FILE, count,
file_table[count].filename);
+#endif
count++;
}
fputc ('\n', Asm_File);
------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Open64-devel mailing list
Open64-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-devel