From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751755AbcEDFlf (ORCPT ); Wed, 4 May 2016 01:41:35 -0400 Received: from thoth.sbs.de ([192.35.17.2]:52762 "EHLO thoth.sbs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751058AbcEDFle (ORCPT ); Wed, 4 May 2016 01:41:34 -0400 Subject: Re: [PATCH 2/2] Fix issue with dmesg.py and python 3.X To: buzdelabuz2@gmail.com, kieran@ksquared.org.uk References: <1462331576-5570-1-git-send-email-buzdelabuz2+git@gmail.com> <1462331576-5570-2-git-send-email-buzdelabuz2+git@gmail.com> Cc: linux-kernel@vger.kernel.org From: Jan Kiszka Message-ID: <57298B89.9010901@siemens.com> Date: Wed, 4 May 2016 07:41:29 +0200 User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 In-Reply-To: <1462331576-5570-2-git-send-email-buzdelabuz2+git@gmail.com> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2016-05-04 05:12, buzdelabuz2@gmail.com wrote: > From: Dom Cote > > Replace the addition (+) of 2 python 'memoryview' objects > with the addition of 2 'bytes' objects, convert the result > back to memoryview. > > Tested with python 3.4 and 2.7 > Tested with gdb 7.7 A word here on what setup was found broken would have been good. If you have a sentence at hand, we can fold it in during merge. > > Signed-off-by: Dom Cote > --- > scripts/gdb/linux/dmesg.py | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/scripts/gdb/linux/dmesg.py b/scripts/gdb/linux/dmesg.py > index 927d0d2a3145..04d6719067f2 100644 > --- a/scripts/gdb/linux/dmesg.py > +++ b/scripts/gdb/linux/dmesg.py > @@ -33,11 +33,12 @@ class LxDmesg(gdb.Command): > if log_first_idx < log_next_idx: > log_buf_2nd_half = -1 > length = log_next_idx - log_first_idx > - log_buf = inf.read_memory(start, length) > + log_buf = utils.read_memoryview(inf, start, length).tobytes() > else: > log_buf_2nd_half = log_buf_len - log_first_idx > - log_buf = inf.read_memory(start, log_buf_2nd_half) + \ > - inf.read_memory(log_buf_addr, log_next_idx) > + a = utils.read_memoryview(inf, start, log_buf_2nd_half) > + b = utils.read_memoryview(inf, log_buf_addr, log_next_idx) > + log_buf = a.tobytes() + b.tobytes() > > pos = 0 > while pos < log_buf.__len__(): > Patches look good to me on first glance. Need to try out as well. Kieran? Thanks, Jan -- Siemens AG, Corporate Technology, CT RDA ITP SES-DE Corporate Competence Center Embedded Linux