From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 35329 invoked by alias); 9 Oct 2015 09:53:21 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 35318 invoked by uid 89); 9 Oct 2015 09:53:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 09 Oct 2015 09:53:19 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 745AFC0C3861; Fri, 9 Oct 2015 09:53:18 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t999rHM6024612; Fri, 9 Oct 2015 05:53:17 -0400 Message-ID: <56178E8C.5040407@redhat.com> Date: Fri, 09 Oct 2015 09:53:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Simon Marchi , gdb-patches@sourceware.org Subject: Re: [PATCH c++] Change some void* to gdb_byte* References: <1444341261-5714-1-git-send-email-simon.marchi@ericsson.com> In-Reply-To: <1444341261-5714-1-git-send-email-simon.marchi@ericsson.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-10/txt/msg00081.txt.bz2 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