public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [patch gprof]: Let binutils understand DOS-paths (4 of 4)
@ 2011-02-28  8:01 Kai Tietz
  2011-02-28 13:41 ` Nick Clifton
  0 siblings, 1 reply; 3+ messages in thread
From: Kai Tietz @ 2011-02-28  8:01 UTC (permalink / raw)
  To: Binutils, Nick Clifton; +Cc: Dave Korn

[-- Attachment #1: Type: text/plain, Size: 381 bytes --]

Hello,

ChangeLog gprof/
2011-02-28  Kai Tietz

	* basic_blocks.c (cmp_bb): Use filename_(n)cmp.
	* cg_print.c (order_and_dump_functions_by_arcs): Likewise.
	(cg_print_file_ordering): Likewise.
	* corefile.c (read_function_mappings): Likewise.
	(core_create_line_syms): Likewise.

Tested for x86_64-w64-mingw32, i686-pc-cygwin, and
x86_64-pc-linux-gnu. Ok for apply?

Regards,
Kai

[-- Attachment #2: gprof_filename.txt --]
[-- Type: text/plain, Size: 3638 bytes --]

Index: src/gprof/basic_blocks.c
===================================================================
--- src.orig/gprof/basic_blocks.c	2011-02-26 23:06:14.834909100 +0100
+++ src/gprof/basic_blocks.c	2011-02-27 12:09:19.557789400 +0100
@@ -24,6 +24,7 @@
 \f
 #include "gprof.h"
 #include "libiberty.h"
+#include "filenames.h"
 #include "basic_blocks.h"
 #include "corefile.h"
 #include "gmon_io.h"
@@ -61,7 +62,7 @@ cmp_bb (const PTR lp, const PTR rp)
 
   if (left->file && right->file)
     {
-      r = strcmp (left->file->name, right->file->name);
+      r = filename_cmp (left->file->name, right->file->name);
 
       if (r)
 	return r;
Index: src/gprof/cg_print.c
===================================================================
--- src.orig/gprof/cg_print.c	2011-02-26 23:06:14.836909100 +0100
+++ src/gprof/cg_print.c	2011-02-27 12:09:19.564789800 +0100
@@ -22,6 +22,7 @@
 \f
 #include "gprof.h"
 #include "libiberty.h"
+#include "filenames.h"
 #include "search_list.h"
 #include "source.h"
 #include "symtab.h"
@@ -1221,8 +1222,8 @@ order_and_dump_functions_by_arcs (the_ar
 static int
 cmp_symbol_map (const void * l, const void * r)
 {
-  return strcmp (((struct function_map *) l)->file_name, 
-	         ((struct function_map *) r)->file_name);
+  return filename_cmp (((struct function_map *) l)->file_name,
+		       ((struct function_map *) r)->file_name);
 }
 
 /* Print a suggested .o ordering for files on a link line based
@@ -1269,7 +1270,7 @@ cg_print_file_ordering (void)
 
       /* Don't bother searching if this symbol
 	 is the same as the previous one.  */
-      if (last && !strcmp (last, symbol_map[sym_index].file_name))
+      if (last && !filename_cmp (last, symbol_map[sym_index].file_name))
 	continue;
 
       for (index2 = 0; index2 < symtab.len; index2++)
@@ -1277,7 +1278,8 @@ cg_print_file_ordering (void)
 	  if (! symtab.base[index2].mapped)
 	    continue;
 
-	  if (!strcmp (symtab.base[index2].name, symbol_map[sym_index].file_name))
+	  if (!filename_cmp (symtab.base[index2].name,
+			     symbol_map[sym_index].file_name))
 	    break;
 	}
 
Index: src/gprof/corefile.c
===================================================================
--- src.orig/gprof/corefile.c	2011-02-26 23:06:14.851909100 +0100
+++ src/gprof/corefile.c	2011-02-27 12:09:19.573790300 +0100
@@ -22,6 +22,7 @@
 \f
 #include "gprof.h"
 #include "libiberty.h"
+#include "filenames.h"
 #include "search_list.h"
 #include "source.h"
 #include "symtab.h"
@@ -157,7 +158,8 @@ read_function_mappings (const char *file
   symbol_map_count = count;
 
   for (i = 0; i < symbol_map_count; ++i)
-    if (i == 0 || strcmp (symbol_map[i].file_name, symbol_map[i - 1].file_name))
+    if (i == 0
+        || filename_cmp (symbol_map[i].file_name, symbol_map[i - 1].file_name))
       symbol_map[i].is_first = 1;
 
   qsort (symbol_map, symbol_map_count, sizeof (struct function_map), cmp_symbol_map);
@@ -766,7 +768,7 @@ core_create_line_syms (void)
 	  || (prev_line_num == dummy.line_num
 	      && prev_name != NULL
 	      && strcmp (prev_name, dummy.name) == 0
-	      && strcmp (prev_filename, filename) == 0))
+	      && filename_cmp (prev_filename, filename) == 0))
 	continue;
 
       ++ltab.len;
@@ -831,7 +833,7 @@ core_create_line_syms (void)
       if (!get_src_info (vma, &filename, &ltab.limit->name, &ltab.limit->line_num)
 	  || (prev && prev->line_num == ltab.limit->line_num
 	      && strcmp (prev->name, ltab.limit->name) == 0
-	      && strcmp (prev->file->name, filename) == 0))
+	      && filename_cmp (prev->file->name, filename) == 0))
 	continue;
 
       /* Make name pointer a malloc'ed string.  */

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch gprof]: Let binutils understand DOS-paths (4 of 4)
  2011-02-28  8:01 [patch gprof]: Let binutils understand DOS-paths (4 of 4) Kai Tietz
@ 2011-02-28 13:41 ` Nick Clifton
  2011-02-28 18:39   ` Kai Tietz
  0 siblings, 1 reply; 3+ messages in thread
From: Nick Clifton @ 2011-02-28 13:41 UTC (permalink / raw)
  To: Kai Tietz; +Cc: Binutils, Dave Korn

Hi Kai,

> ChangeLog gprof/
> 2011-02-28  Kai Tietz
>
> 	* basic_blocks.c (cmp_bb): Use filename_(n)cmp.
> 	* cg_print.c (order_and_dump_functions_by_arcs): Likewise.
> 	(cg_print_file_ordering): Likewise.
> 	* corefile.c (read_function_mappings): Likewise.
> 	(core_create_line_syms): Likewise.

Approved - please apply.

Cheers
   Nick


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch gprof]: Let binutils understand DOS-paths (4 of 4)
  2011-02-28 13:41 ` Nick Clifton
@ 2011-02-28 18:39   ` Kai Tietz
  0 siblings, 0 replies; 3+ messages in thread
From: Kai Tietz @ 2011-02-28 18:39 UTC (permalink / raw)
  To: Nick Clifton; +Cc: Binutils, Dave Korn

2011/2/28 Nick Clifton <nickc@redhat.com>:
> Hi Kai,
>
>> ChangeLog gprof/
>> 2011-02-28  Kai Tietz
>>
>>        * basic_blocks.c (cmp_bb): Use filename_(n)cmp.
>>        * cg_print.c (order_and_dump_functions_by_arcs): Likewise.
>>        (cg_print_file_ordering): Likewise.
>>        * corefile.c (read_function_mappings): Likewise.
>>        (core_create_line_syms): Likewise.
>
> Approved - please apply.
>
> Cheers
>  Nick
>
>
>

Applied.

Thanks,
Kai

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-02-28 18:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-28  8:01 [patch gprof]: Let binutils understand DOS-paths (4 of 4) Kai Tietz
2011-02-28 13:41 ` Nick Clifton
2011-02-28 18:39   ` Kai Tietz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).