]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
-Wpointer-sign: bookmarks.
authorPedro Alves <palves@redhat.com>
Fri, 19 Apr 2013 15:32:56 +0000 (15:32 +0000)
committerPedro Alves <palves@redhat.com>
Fri, 19 Apr 2013 15:32:56 +0000 (15:32 +0000)
Bookmarks are opaque to the core code -- by design, the target is free
to use any sort of blob as bookmark identifier.

The record target chooses to use strings for bookmarks.  This adds
casts following that direction, fixing -Wpointer-sign warnings.

gdb/
2013-04-19  Pedro Alves  <palves@redhat.com>

* record-full.c (record_full_get_bookmark): Change local 'ret'
type to char * and add cast to gdb_byte *.
(record_full_goto_bookmark): Handle 'bookmark' argument as a
string.
* reverse.c (goto_bookmark_command): Add casts to gdb_byte *.

gdb/ChangeLog
gdb/record-full.c
gdb/reverse.c

index f718b4dc824d882ca6b4d862de9d3baa770e0ae5..6e6cf671161c03e5472345e6e73b15f0d9403472 100644 (file)
@@ -1,3 +1,11 @@
+2013-04-19  Pedro Alves  <palves@redhat.com>
+
+       * record-full.c (record_full_get_bookmark): Change local 'ret'
+       type to char * and add cast to gdb_byte *.
+       (record_full_goto_bookmark): Handle 'bookmark' argument as a
+       string.
+       * reverse.c (goto_bookmark_command): Add casts to gdb_byte *.
+
 2013-04-19  Pedro Alves  <palves@redhat.com>
 
        * python/py-inferior.c (infpy_write_memory): Add cast to gdb_byte
index 03d287d0f03d849b74f197046bb756046385de2d..aa3ad8532d40139ce740e2016bbd6d6e7187b97c 100644 (file)
@@ -1844,7 +1844,7 @@ record_full_can_execute_reverse (void)
 static gdb_byte *
 record_full_get_bookmark (char *args, int from_tty)
 {
-  gdb_byte *ret = NULL;
+  char *ret = NULL;
 
   /* Return stringified form of instruction count.  */
   if (record_full_list && record_full_list->type == record_full_end)
@@ -1859,14 +1859,16 @@ record_full_get_bookmark (char *args, int from_tty)
        fprintf_unfiltered (gdb_stdlog,
                            "record_full_get_bookmark returns NULL\n");
     }
-  return ret;
+  return (gdb_byte *) ret;
 }
 
 /* "to_goto_bookmark" method for process record and prec over core.  */
 
 static void
-record_full_goto_bookmark (gdb_byte *bookmark, int from_tty)
+record_full_goto_bookmark (gdb_byte *raw_bookmark, int from_tty)
 {
+  char *bookmark = (char *) raw_bookmark;
+
   if (record_debug)
     fprintf_unfiltered (gdb_stdlog,
                        "record_full_goto_bookmark receives %s\n", bookmark);
@@ -1883,7 +1885,7 @@ record_full_goto_bookmark (gdb_byte *bookmark, int from_tty)
       /* Pass along to cmd_record_full_goto.  */
     }
 
-  cmd_record_goto ((char *) bookmark, from_tty);
+  cmd_record_goto (bookmark, from_tty);
   return;
 }
 
index 171c53c230d202f0ecc343d6bbf36d0c34d19e02..c0d7058ca93e103a71bdfc1a3d49aaf14b02f8a8 100644 (file)
@@ -259,7 +259,7 @@ goto_bookmark_command (char *args, int from_tty)
       || strncmp (args, "end",   strlen ("end")) == 0)
     {
       /* Special case.  Give target opportunity to handle.  */
-      target_goto_bookmark (args, from_tty);
+      target_goto_bookmark ((gdb_byte *) args, from_tty);
       return;
     }
 
@@ -268,7 +268,7 @@ goto_bookmark_command (char *args, int from_tty)
       /* Special case -- quoted string.  Pass on to target.  */
       if (args[strlen (args) - 1] != args[0])
        error (_("Unbalanced quotes: %s"), args);
-      target_goto_bookmark (args, from_tty);
+      target_goto_bookmark ((gdb_byte *) args, from_tty);
       return;
     }