Hi Sun,
Yes. I agree we don't need to guard the fix under #ifdef. A revised patch is
attached.
Regards,
Shivaram
-----Original Message-----
From: Sun Chan [mailto:sun.c...@gmail.com]
Sent: Tuesday, January 17, 2012 4:19 PM
To: Rao, Shivarama
Cc: open64-devel
Subject: Re: [Open64-devel] Code review request for bug #944 [CG]
Looks like this fix is generic and no need for #ifdef, don't you think?
sun
On Tue, Jan 17, 2012 at 5:52 PM, Rao, Shivarama <shivarama....@amd.com> wrote:
> 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
>
>
>
>
> ------------------------------------------------------------------------------
> 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
>
Index: be/cg/cgdwarf.cxx
===================================================================
--- be/cg/cgdwarf.cxx (revision 3858)
+++ be/cg/cgdwarf.cxx (working copy)
@@ -2831,9 +2831,16 @@
fprintf(Asm_File, "\t%s\t%d\t\"%s\"\n", AS_FILE, count,
file_table[count].filename);
else
+#else
+ 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);
#endif
- fprintf(Asm_File, "\t%s\t%d\t\"%s\"\n", AS_FILE, count,
- file_table[count].filename);
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