]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix Solaris build
authorPedro Alves <palves@redhat.com>
Thu, 12 Apr 2018 16:47:59 +0000 (17:47 +0100)
committerPedro Alves <palves@redhat.com>
Thu, 12 Apr 2018 16:47:59 +0000 (17:47 +0100)
This commit fixes a bit of rot in procfs.c caused by recent changes.

Specifically, the target_ops::to_detach change to pass down 'inferior
*' missed updating a forward declation, and the change to use
scoped_fd in more places missed removing one do_cleanups call.

  src/gdb/procfs.c: In function ‘target_ops* procfs_target()’:
  src/gdb/procfs.c:167:16: error: invalid conversion from ‘void (*)(target_ops*, const char*, int)’ to ‘void (*)(target_ops*, inferior*, int)’ [-fpermissive]
     t->to_detach = procfs_detach;
  ^
  src/gdb/procfs.c: In function ‘ssd* proc_get_LDT_entry(procinfo*, int)’:
  src/gdb/procfs.c:1624:17: error: ‘old_chain’ was not declared in this scope
      do_cleanups (old_chain);
   ^
  src/gdb/procfs.c: At global scope:
  src/gdb/procfs.c:90:13: error: ‘void procfs_detach(target_ops*, const char*, int)’ declared ‘static’ but never defined [-Werror=unused-function]
   static void procfs_detach (struct target_ops *, const char *, int);
       ^
  src/gdb/procfs.c:1923:1: error: ‘void procfs_detach(target_ops*, inferior*, int)’ defined but not used [-Werror=unused-function]
   procfs_detach (struct target_ops *ops, inferior *inf, int from_tty)
   ^

gdb/ChangeLog:
2018-04-12  Pedro Alves  <palves@redhat.com>

* procfs.c (procfs_detach): Make forward declaration's prototype
match definition's protototype.
(proc_get_LDT_entry): Remove stale do_cleanups call.

gdb/ChangeLog
gdb/procfs.c

index a05520fb7cc3297a09346fb418a6c01ae47fc98e..66ca520aadcb265b7b92967dfc35576c1f8e2ff9 100644 (file)
@@ -1,3 +1,9 @@
+2018-04-12  Pedro Alves  <palves@redhat.com>
+
+       * procfs.c (procfs_detach): Make forward declaration's prototype
+       match definition's protototype.
+       (proc_get_LDT_entry): Remove stale do_cleanups call.
+
 2018-04-12  Pedro Alves  <palves@redhat.com>
 
        * target.h (target_ops::to_has_exited): Delete.
index 5ca7477fa57b549ef8d555cb710715dd6c42a4e4..3c747cd3e21eb97ebce6585e8a226ef0cb4b09fe 100644 (file)
@@ -87,7 +87,7 @@
 /* This module defines the GDB target vector and its methods.  */
 
 static void procfs_attach (struct target_ops *, const char *, int);
-static void procfs_detach (struct target_ops *, const char *, int);
+static void procfs_detach (struct target_ops *, inferior *, int);
 static void procfs_resume (struct target_ops *,
                           ptid_t, int, enum gdb_signal);
 static void procfs_files_info (struct target_ops *);
@@ -1620,10 +1620,7 @@ proc_get_LDT_entry (procinfo *pi, int key)
        break;  /* end of table */
       /* If key matches, return this entry.  */
       if (ldt_entry->sel == key)
-       {
-         do_cleanups (old_chain);
-         return ldt_entry;
-       }
+       return ldt_entry;
     }
   /* Loop ended, match not found.  */
   return NULL;