* gdb.cp/hang.exp: Use .cc instead of .C.
[deliverable/binutils-gdb.git] / gprof / sym_ids.c
index d41a716b78e5c6c4657cf60ef276f4652c77c2b1..492e825136f43fcab67dfde256dbf8a82dc78542 100644 (file)
@@ -1,12 +1,12 @@
 /* sym_ids.c
 
-   Copyright 1999, 2000, 2001, 2002, 2004 Free Software Foundation, Inc.
+   Copyright 1999, 2000, 2001, 2002, 2004, 2007 Free Software Foundation, Inc.
 
    This file is part of GNU Binutils.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -27,6 +27,7 @@
 #include "symtab.h"
 #include "cg_arcs.h"
 #include "sym_ids.h"
+#include "corefile.h"
 
 static struct sym_id
   {
@@ -218,12 +219,19 @@ parse_id (struct sym_id *id)
 static bfd_boolean
 match (Sym *pattern, Sym *sym)
 {
-  return (pattern->file ? pattern->file == sym->file : TRUE)
-    && (pattern->line_num ? pattern->line_num == sym->line_num : TRUE)
-    && (pattern->name
-       ? strcmp (pattern->name,
-                 sym->name+(discard_underscores && sym->name[0] == '_')) == 0
-       : TRUE);
+  if (pattern->file && pattern->file != sym->file)
+    return FALSE;
+  if (pattern->line_num && pattern->line_num != sym->line_num)
+    return FALSE;
+  if (pattern->name)
+    {
+      const char *sym_name = sym->name;
+      if (*sym_name && bfd_get_symbol_leading_char (core_bfd) == *sym_name)
+       sym_name++;
+      if (strcmp (pattern->name, sym_name) != 0)
+       return FALSE;
+    }
+  return TRUE;
 }
 
 
This page took 0.024249 seconds and 4 git commands to generate.