Switch the inferior before outputting its id in "info inferiors"
[deliverable/binutils-gdb.git] / binutils / wrstabs.c
index bbf257e5f5d1b8f809f90316544b482c1adf78d5..34c9ef9d2db9fa3030333ddb2d8f2c72b6970565 100644 (file)
@@ -1,6 +1,5 @@
 /* wrstabs.c -- Output stabs debugging information
-   Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006,
-   2007, 2009   Free Software Foundation, Inc.
+   Copyright (C) 1996-2020 Free Software Foundation, Inc.
    Written by Ian Lance Taylor <ian@cygnus.com>.
 
    This file is part of GNU Binutils.
@@ -1441,18 +1440,15 @@ stab_end_struct_type (void *p)
 /* Start outputting a class.  */
 
 static bfd_boolean
-stab_start_class_type (void *p, const char *tag, unsigned int id, bfd_boolean structp, unsigned int size, bfd_boolean vptr, bfd_boolean ownvptr)
+stab_start_class_type (void *p, const char *tag, unsigned int id,
+                      bfd_boolean structp, unsigned int size,
+                      bfd_boolean vptr, bfd_boolean ownvptr)
 {
   struct stab_write_handle *info = (struct stab_write_handle *) p;
-  bfd_boolean definition;
-  char *vstring;
+  bfd_boolean definition = FALSE;
+  char *vstring = NULL;
 
-  if (! vptr || ownvptr)
-    {
-      definition = FALSE;
-      vstring = NULL;
-    }
-  else
+  if (vptr && !ownvptr)
     {
       definition = info->type_stack->definition;
       vstring = stab_pop_type (info);
@@ -1473,17 +1469,16 @@ stab_start_class_type (void *p, const char *tag, unsigned int id, bfd_boolean st
        }
       else
        {
+         assert (vstring);
          vtable = (char *) xmalloc (strlen (vstring) + 3);
          sprintf (vtable, "~%%%s", vstring);
          free (vstring);
+         if (definition)
+           info->type_stack->definition = TRUE;
        }
-
       info->type_stack->vtable = vtable;
     }
 
-  if (definition)
-    info->type_stack->definition = TRUE;
-
   return TRUE;
 }
 
This page took 0.026605 seconds and 4 git commands to generate.