public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [RFA] Use FILENAME_CMP to compare filenames in compare_search_syms.
@ 2013-10-01  9:07 Joel Brobecker
  2013-10-01  9:54 ` Pedro Alves
  0 siblings, 1 reply; 5+ messages in thread
From: Joel Brobecker @ 2013-10-01  9:07 UTC (permalink / raw)
  To: gdb-patches

Hello,

While working on an unrelated issue, I noticed that two symbols were
sorted differently on Windows, compared to the other Unix platforms.
I tracked it down to compare_search_syms which compares filenames
using a plain strcmp instead of FILENAME_CMP.

Not sure how to create a testcase...

gdb/ChangeLog:

        * symtab.c (compare_search_syms): Use FILENAME_CMP instead of
        strcmp to compare two symtab filenames.

Tested on x86-windows and x86_64-linux, no regression.
OK to apply?

Thanks,
-- 
Joel

---
 gdb/symtab.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/symtab.c b/gdb/symtab.c
index dbff042..93d29d6 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -3336,7 +3336,7 @@ compare_search_syms (const void *sa, const void *sb)
   struct symbol_search *sym_b = *(struct symbol_search **) sb;
   int c;
 
-  c = strcmp (sym_a->symtab->filename, sym_b->symtab->filename);
+  c = FILENAME_CMP (sym_a->symtab->filename, sym_b->symtab->filename);
   if (c != 0)
     return c;
 
-- 
1.8.1.2

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

end of thread, other threads:[~2013-10-02  9:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-01  9:07 [RFA] Use FILENAME_CMP to compare filenames in compare_search_syms Joel Brobecker
2013-10-01  9:54 ` Pedro Alves
2013-10-01 12:30   ` Joel Brobecker
2013-10-01 15:14     ` Pedro Alves
2013-10-02  9:24       ` Joel Brobecker

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).