Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Simon Marchi <simon.marchi@ericsson.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH c++] Change some void* to gdb_byte*
Date: Fri, 09 Oct 2015 09:53:00 -0000	[thread overview]
Message-ID: <56178E8C.5040407@redhat.com> (raw)
In-Reply-To: <1444341261-5714-1-git-send-email-simon.marchi@ericsson.com>

Hi Simon,

On 10/08/2015 10:54 PM, Simon Marchi wrote:
> There are a bunch of places where a void* is implicitely casted into a
> gdb_byte*.  The auto-insert-casts script added explicit casts at those
> places.  However, in many cases, it makes more sense to just change the
> void* to a gdb_byte*.
> 

Most look fine except this one:

> @@ -717,7 +717,7 @@ infpy_search_memory (PyObject *self, PyObject *args, PyObject *kw)
>    static char *keywords[] = { "address", "length", "pattern", NULL };
>    PyObject *start_addr_obj, *length_obj;
>    Py_ssize_t pattern_size;
> -  const void *buffer;
> +  const gdb_byte *buffer;
>    CORE_ADDR found_addr;
>    int found = 0;
>  #ifdef IS_PY3K
> @@ -728,7 +728,7 @@ infpy_search_memory (PyObject *self, PyObject *args, PyObject *kw)
>  				     &pybuf))
>      return NULL;
>  
> -  buffer = pybuf.buf;
> +  buffer = (gdb_byte *) pybuf.buf;
>    pattern_size = pybuf.len;
>  #else
>    PyObject *pattern;
> @@ -746,7 +746,8 @@ infpy_search_memory (PyObject *self, PyObject *args, PyObject *kw)
>        return NULL;
>      }
>  
> -  if (PyObject_AsReadBuffer (pattern, &buffer, &pattern_size) == -1)
> +  if (PyObject_AsReadBuffer (pattern, (const void **) &buffer,
> +			     &pattern_size) == -1)
>      return NULL;
>  #endif
>  

This will need a fix similar to 39086a0e13:
  https://sourceware.org/ml/gdb-patches/2013-03/msg00449.html

Thanks,
Pedro Alves


  reply	other threads:[~2015-10-09  9:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-08 21:54 Simon Marchi
2015-10-09  9:53 ` Pedro Alves [this message]
2015-10-09 13:10   ` Simon Marchi
2015-10-09 14:07     ` Pedro Alves
2015-10-09 14:09       ` Simon Marchi

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=56178E8C.5040407@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@ericsson.com \
    /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