2012-05-09 Frank Ch. Eigler <fche@redhat.com>
[deliverable/binutils-gdb.git] / gdb / macrotab.c
index 4a6aacda18b92c1e85032ff53310d85fd668c7fd..74288398898ef21a4fba526ba2c6a4c191f14cf2 100644 (file)
@@ -1,6 +1,5 @@
 /* C preprocessor macro tables for GDB.
-   Copyright (C) 2002, 2007, 2008, 2009, 2010, 2011
-   Free Software Foundation, Inc.
+   Copyright (C) 2002, 2007-2012 Free Software Foundation, Inc.
    Contributed by Red Hat, Inc.
 
    This file is part of GDB.
@@ -21,6 +20,7 @@
 #include "defs.h"
 #include "gdb_obstack.h"
 #include "splay-tree.h"
+#include "filenames.h"
 #include "symtab.h"
 #include "symfile.h"
 #include "objfiles.h"
@@ -160,7 +160,7 @@ struct macro_key
   struct macro_table *table;
 
   /* The name of the macro.  This is in the table's bcache, if it has
-     one. */
+     one.  */
   const char *name;
 
   /* The source file and line number where the definition's scope
@@ -500,7 +500,7 @@ struct macro_source_file *
 macro_lookup_inclusion (struct macro_source_file *source, const char *name)
 {
   /* Is SOURCE itself named NAME?  */
-  if (strcmp (name, source->filename) == 0)
+  if (filename_cmp (name, source->filename) == 0)
     return source;
 
   /* The filename in the source structure is probably a full path, but
@@ -510,11 +510,12 @@ macro_lookup_inclusion (struct macro_source_file *source, const char *name)
     int src_name_len = strlen (source->filename);
 
     /* We do mean < here, and not <=; if the lengths are the same,
-       then the strcmp above should have triggered, and we need to
+       then the filename_cmp above should have triggered, and we need to
        check for a slash here.  */
     if (name_len < src_name_len
-        && source->filename[src_name_len - name_len - 1] == '/'
-        && strcmp (name, source->filename + src_name_len - name_len) == 0)
+        && IS_DIR_SEPARATOR (source->filename[src_name_len - name_len - 1])
+        && filename_cmp (name,
+                        source->filename + src_name_len - name_len) == 0)
       return source;
   }
 
@@ -911,7 +912,8 @@ foreach_macro (splay_tree_node node, void *arg)
   struct macro_key *key = (struct macro_key *) node->key;
   struct macro_definition *def = (struct macro_definition *) node->value;
 
-  (*datum->fn) (key->name, def, datum->user_data);
+  (*datum->fn) (key->name, def, key->start_file, key->start_line,
+               datum->user_data);
   return 0;
 }
 
@@ -943,7 +945,8 @@ foreach_macro_in_scope (splay_tree_node node, void *info)
       && (!key->end_file
          || compare_locations (key->end_file, key->end_line,
                                datum->file, datum->line) >= 0))
-    (*datum->fn) (key->name, def, datum->user_data);
+    (*datum->fn) (key->name, def, key->start_file, key->start_line,
+                 datum->user_data);
   return 0;
 }
 
This page took 0.025504 seconds and 4 git commands to generate.