Clean up my ChangeLog entry
[binutils-gdb.git] / gdb / auxv.c
index 2ffcd73b9882bd3d9833b9999cbae9f00539ee70..2bcf9f452e3eb2541cc3e5cfaa0b1caac4179d91 100644 (file)
@@ -1,6 +1,6 @@
 /* Auxiliary vector support for GDB, the GNU debugger.
 
-   Copyright (C) 2004-2020 Free Software Foundation, Inc.
+   Copyright (C) 2004-2021 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -192,8 +192,8 @@ ld_so_xfer_auxv (gdb_byte *readbuf,
       len -= block;
 
       /* Check terminal AT_NULL.  This function is being called
-         indefinitely being extended its READBUF until it returns EOF
-         (0).  */
+        indefinitely being extended its READBUF until it returns EOF
+        (0).  */
 
       while (block >= auxv_pair_size)
        {
@@ -320,7 +320,8 @@ target_auxv_parse (gdb_byte **readptr,
   if (gdbarch_auxv_parse_p (gdbarch))
     return gdbarch_auxv_parse (gdbarch, readptr, endptr, typep, valp);
 
-  return current_top_target ()->auxv_parse (readptr, endptr, typep, valp);
+  return current_inferior ()->top_target ()->auxv_parse (readptr, endptr,
+                                                        typep, valp);
 }
 
 
@@ -576,11 +577,12 @@ fprint_target_auxv (struct ui_file *file, struct target_ops *ops)
 static void
 info_auxv_command (const char *cmd, int from_tty)
 {
-  if (! target_has_stack)
+  if (! target_has_stack ())
     error (_("The program has no auxiliary information now."));
   else
     {
-      int ents = fprint_target_auxv (gdb_stdout, current_top_target ());
+      int ents = fprint_target_auxv (gdb_stdout,
+                                    current_inferior ()->top_target ());
 
       if (ents < 0)
        error (_("No auxiliary vector found, or failed reading it."));
@@ -598,7 +600,7 @@ _initialize_auxv ()
 This is information provided by the operating system at program startup."));
 
   /* Observers used to invalidate the auxv cache when needed.  */
-  gdb::observers::inferior_exit.attach (invalidate_auxv_cache_inf);
-  gdb::observers::inferior_appeared.attach (invalidate_auxv_cache_inf);
-  gdb::observers::executable_changed.attach (invalidate_auxv_cache);
+  gdb::observers::inferior_exit.attach (invalidate_auxv_cache_inf, "auxv");
+  gdb::observers::inferior_appeared.attach (invalidate_auxv_cache_inf, "auxv");
+  gdb::observers::executable_changed.attach (invalidate_auxv_cache, "auxv");
 }