public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] char  -> gdb_byte
@ 2013-06-05 20:27 Keith Seitz
  0 siblings, 0 replies; only message in thread
From: Keith Seitz @ 2013-06-05 20:27 UTC (permalink / raw)
  To: insight

[-- Attachment #1: Type: text/plain, Size: 438 bytes --]

Hi,

A recent audit of gdb caught some problems with char vs gdb_byte 
correctness. This introduced a build problem. The following patch 
attempts to address this.

Keith

ChangeLog
2013-06-05  Keith Seitz  <keiths@redhat.com>

	* generic/gdbtk-register.c (map_arg_registers): Change type of
	raw_buffer to gdb_byte to follow recent API changes in gdb.
	* generic/gdbtk-cmds.c (gdb_update_mem): Likewise for ' mbfu',
	'mptr', and 'cptr'.

[-- Attachment #2: gdb_byte.patch --]
[-- Type: text/x-patch, Size: 1851 bytes --]

Index: generic/gdbtk-cmds.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-cmds.c,v
retrieving revision 1.132
diff -u -p -r1.132 gdbtk-cmds.c
--- generic/gdbtk-cmds.c	5 Jun 2013 20:19:46 -0000	1.132
+++ generic/gdbtk-cmds.c	5 Jun 2013 20:23:56 -0000
@@ -2477,7 +2477,8 @@ gdb_update_mem (ClientData clientData, T
   int max_ascii_len, max_val_len, max_label_len;
   char format, aschar;
   char *data, *tmp;
-  char buff[128], *mbuf, *mptr, *cptr, *bptr;
+  char buff[128], *bptr;
+  gdb_byte *mbuf, *mptr, *cptr;
   struct ui_file *stb;
   struct type *val_type;
   struct cleanup *old_chain;
@@ -2535,7 +2536,7 @@ gdb_update_mem (ClientData clientData, T
   addr = string_to_core_addr (tmp);
 
   format = *(Tcl_GetStringFromObj (objv[3], NULL));
-  mbuf = (char *) xmalloc (nbytes + 32);
+  mbuf = (gdb_byte *) xmalloc (nbytes + 32);
   if (!mbuf)
     {
       gdbtk_set_result (interp, "Out of memory.");
Index: generic/gdbtk-register.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-register.c,v
retrieving revision 1.44
diff -u -p -r1.44 gdbtk-register.c
--- generic/gdbtk-register.c	21 Nov 2012 16:39:33 -0000	1.44
+++ generic/gdbtk-register.c	5 Jun 2013 20:23:56 -0000
@@ -1,5 +1,5 @@
 /* Tcl/Tk command definitions for Insight - Registers
-   Copyright (C) 2001-2012 Free Software Foundation, Inc.
+   Copyright (C) 2001-2013 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -442,7 +442,7 @@ map_arg_registers (Tcl_Interp *interp, i
 static void
 register_changed_p (int regnum, map_arg arg)
 {
-  char raw_buffer[MAX_REGISTER_SIZE];
+  gdb_byte raw_buffer[MAX_REGISTER_SIZE];
 
   if (!target_has_registers
       || !deprecated_frame_register_read (get_selected_frame (NULL), regnum,

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-06-05 20:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-05 20:27 [PATCH] char -> gdb_byte Keith Seitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).