public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
From: Keith Seitz <keiths@redhat.com>
To: insight <insight@sourceware.org>
Subject: [PATCH] char  -> gdb_byte
Date: Wed, 05 Jun 2013 20:27:00 -0000	[thread overview]
Message-ID: <51AF9F18.2050305@redhat.com> (raw)

[-- 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,

                 reply	other threads:[~2013-06-05 20:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51AF9F18.2050305@redhat.com \
    --to=keiths@redhat.com \
    --cc=insight@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).