gdbserver: btrace enums
authorPedro Alves <palves@redhat.com>
Thu, 29 Oct 2015 12:55:02 +0000 (12:55 +0000)
committerPedro Alves <palves@redhat.com>
Thu, 29 Oct 2015 12:55:02 +0000 (12:55 +0000)
Fixes:

 ../../../src/gdb/gdbserver/linux-low.c: In function ‘int linux_low_read_btrace(btrace_target_info*, buffer*, int)’:
 ../../../src/gdb/gdbserver/linux-low.c:6827:48: error: invalid conversion from ‘int’ to ‘btrace_read_type’ [-fpermissive]
    err = linux_read_btrace (&btrace, tinfo, type);
 ^
 In file included from ../../../src/gdb/gdbserver/linux-low.c:98:0:
 ../../../src/gdb/gdbserver/../nat/linux-btrace.h:116:26: error:   initializing argument 3 of ‘btrace_error linux_read_btrace(btrace_data*, btrace_target_info*, btrace_read_type)’ [-fpermissive]
  extern enum btrace_error linux_read_btrace (struct btrace_data *btrace,
   ^

The cyclic dependency the comment talks about is no longer relevant:
  https://sourceware.org/ml/gdb-patches/2015-10/msg00643.html

gdb/gdbserver/ChangeLog:
2015-10-29  Pedro Alves  <palves@redhat.com>

* linux-low.c (linux_low_read_btrace): Change type of 'type'
parameter.
* server.c (handle_qxfer_btrace): Change type of 'type'
local.
* target.h (struct target_ops) <read_btrace>: Change type of
'type' parameter.  Update comment.

gdb/gdbserver/ChangeLog
gdb/gdbserver/linux-low.c
gdb/gdbserver/server.c
gdb/gdbserver/target.h

index 0dfecf1ddeead30b68eef734d9f74b284ae0129e..9b8a7d748a6e6fa4ccc660673a4ff4a880451a86 100644 (file)
        * linux-x86-low.c (x86_regsets): Likewise.
        * linux-xtensa-low.c (xtensa_regsets): Likewise.
 
+2015-10-29  Pedro Alves  <palves@redhat.com>
+
+       * linux-low.h (NULL_REGSET): Define.
+       * linux-aarch64-low.c (aarch64_regsets): Use NULL_REGSET.
+       * linux-arm-low.c (arm_regsets): Likewise.
+       * linux-crisv32-low.c (cris_regsets): Likewise.
+       * linux-m68k-low.c (m68k_regsets): Likewise.
+       * linux-mips-low.c (mips_regsets): Likewise.
+       * linux-nios2-low.c (nios2_regsets): Likewise.
+       * linux-ppc-low.c (ppc_regsets): Likewise.
+       * linux-s390-low.c (s390_regsets): Likewise.
+       * linux-sh-low.c (sh_regsets): Likewise.
+       * linux-sparc-low.c (sparc_regsets): Likewise.
+       * linux-tic6x-low.c (tic6x_regsets): Likewise.
+       * linux-tile-low.c (tile_regsets): Likewise.
+       * linux-x86-low.c (x86_regsets): Likewise.
+       * linux-xtensa-low.c (xtensa_regsets): Likewise.
+
 2015-10-26  Doug Evans  <dje@google.com>
 
        * linux-low.c (__SIGRTMIN): Move to nat/linux-nat.h.
index e778c4c379a80de269b43bb3564cbff3bf65f840..41ab510fa4ac5654f101f08efb68e26b5bc5dbd7 100644 (file)
@@ -6815,7 +6815,7 @@ linux_low_encode_raw (struct buffer *buffer, const gdb_byte *data,
 
 static int
 linux_low_read_btrace (struct btrace_target_info *tinfo, struct buffer *buffer,
-                      int type)
+                      enum btrace_read_type type)
 {
   struct btrace_data btrace;
   struct btrace_block *block;
index ad6626eafe5a98022029dab920775d7f2db2ce6c..024399df9dd6ed51b81a1caf80ad53f8897149eb 100644 (file)
@@ -1608,7 +1608,8 @@ handle_qxfer_btrace (const char *annex,
 {
   static struct buffer cache;
   struct thread_info *thread;
-  int type, result;
+  enum btrace_read_type type;
+  int result;
 
   if (the_target->read_btrace == NULL || writebuf != NULL)
     return -2;
index a14c6ff315ad5f15552d4dcf96d4f4e8210407b9..769c876ede498bbec70127cfb22ef83460b2c9aa 100644 (file)
@@ -399,11 +399,11 @@ struct target_ops
      Returns zero on success, non-zero otherwise.  */
   int (*disable_btrace) (struct btrace_target_info *tinfo);
 
-  /* Read branch trace data into buffer.  We use an int to specify the type
-     to break a cyclic dependency.
+  /* Read branch trace data into buffer.
      Return 0 on success; print an error message into BUFFER and return -1,
      otherwise.  */
-  int (*read_btrace) (struct btrace_target_info *, struct buffer *, int type);
+  int (*read_btrace) (struct btrace_target_info *, struct buffer *,
+                     enum btrace_read_type type);
 
   /* Read the branch trace configuration into BUFFER.
      Return 0 on success; print an error message into BUFFER and return -1