2006-10-27 Andrew Stubbs <andrew.stubbs@st.com>
[deliverable/binutils-gdb.git] / binutils / prdbg.c
index 5b6b0479a8e74d2990543fdf9e62074751c81442..7a0af83336e2e4e409c9d86d6891cac718c5154b 100644 (file)
@@ -1,5 +1,6 @@
 /* prdbg.c -- Print out generic debugging information.
-   Copyright 1995, 1996, 2002, 2003 Free Software Foundation, Inc.
+   Copyright 1995, 1996, 1999, 2002, 2003, 2004, 2006
+   Free Software Foundation, Inc.
    Written by Ian Lance Taylor <ian@cygnus.com>.
    Tags style generation written by Salvador E. Tropea <set@computer.org>.
 
@@ -17,8 +18,8 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-   02111-1307, USA.  */
+   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+   02110-1301, USA.  */
 
 /* This file prints out the generic debugging information, by
    supplying a set of routines to debug_write.  */
@@ -723,8 +724,8 @@ pr_function_type (void *p, int argcount, bfd_boolean varargs)
 
   /* Now the return type is on the top of the stack.  */
 
-  s = (char *) xmalloc (len);
-  strcpy (s, "(|) (");
+  s = xmalloc (len);
+  LITSTRCPY (s, "(|) (");
 
   if (argcount < 0)
     strcat (s, "/* unknown */");
@@ -909,11 +910,10 @@ pr_method_type (void *p, bfd_boolean domain, int argcount, bfd_boolean varargs)
       domain_type = pop_type (info);
       if (domain_type == NULL)
        return FALSE;
-      if (strncmp (domain_type, "class ", sizeof "class " - 1) == 0
+      if (CONST_STRNEQ (domain_type, "class ")
          && strchr (domain_type + sizeof "class " - 1, ' ') == NULL)
        domain_type += sizeof "class " - 1;
-      else if (strncmp (domain_type, "union class ",
-                       sizeof "union class ") == 0
+      else if (CONST_STRNEQ (domain_type, "union class ")
               && (strchr (domain_type + sizeof "union class " - 1, ' ')
                   == NULL))
        domain_type += sizeof "union class " - 1;
@@ -1316,7 +1316,7 @@ pr_class_baseclass (void *p, bfd_vma bitpos, bfd_boolean virtual,
   if (t == NULL)
     return FALSE;
 
-  if (strncmp (t, "class ", sizeof "class " - 1) == 0)
+  if (CONST_STRNEQ (t, "class "))
     t += sizeof "class " - 1;
 
   /* Push it back on to take advantage of the prepend_type and
@@ -1904,7 +1904,7 @@ find_address_in_section (bfd *abfd, asection *section, void *data)
   if (pc < vma)
     return;
 
-  size = bfd_get_section_size_before_reloc (section);
+  size = bfd_get_section_size (section);
   if (pc >= vma + size)
     return;
 
@@ -2153,12 +2153,10 @@ tg_class_static_member (void *p, const char *name,
 
   len_var = strlen (name);
   len_class = strlen (info->stack->next->type);
-  full_name = (char *) xmalloc (len_var + len_class + 3);
+  full_name = xmalloc (len_var + len_class + 3);
   if (! full_name)
     return FALSE;
-  memcpy (full_name, info->stack->next->type, len_class);
-  memcpy (full_name + len_class, "::", 2);
-  memcpy (full_name + len_class + 2, name, len_var + 1);
+  sprintf (full_name, "%s::%s", info->stack->next->type, name);
 
   if (! substitute_type (info, full_name))
     return FALSE;
@@ -2198,7 +2196,7 @@ tg_class_baseclass (void *p, bfd_vma bitpos ATTRIBUTE_UNUSED,
   if (t == NULL)
     return FALSE;
 
-  if (strncmp (t, "class ", sizeof "class " - 1) == 0)
+  if (CONST_STRNEQ (t, "class "))
     t += sizeof "class " - 1;
 
   /* Push it back on to take advantage of the prepend_type and
This page took 0.023892 seconds and 4 git commands to generate.