Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp601841imm; Wed, 17 Oct 2018 05:32:22 -0700 (PDT) X-Google-Smtp-Source: ACcGV639Si/AA40Qf61FXMBBLFsK0774sg41WanthbJcH9tHOmZg0raLoIpoITS6L+OT7I5JLe6y X-Received: by 2002:a62:9f11:: with SMTP id g17-v6mr26120486pfe.144.1539779542487; Wed, 17 Oct 2018 05:32:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539779542; cv=none; d=google.com; s=arc-20160816; b=Ph9rSF1J/pmhn9Wg9fU4xrXsuimCx7Z4N6Zn7duE3nC4Nj22Hj4GuZcnXNuVCBc9fX J2M2FLpk/yE2bSwjzlUSUynn5zWxjOWi9sK1Vd95Sz9DuljPC/4bG+EsmMIZe3+lbtGQ TlH4DIyT9gc2NiObWU51/jQJ5OZBtnki/rQ9z/2cQUBNowQ+h6RRKsoUKivWorPi/2Sc gl8/fkLUdyLW2Nil60+vjbvxm/7WmV7TuNZjWcuwNOUEOGeMhq4KObi86rhJwtwr6r/H +TuVHPZMwoUQAoJggcL+NsvmLDdb94BqTTaIrTtfV8HtwdcN1u/Q+I1ITpHgP5s94UxF fakQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:reply-to:autocrypt:openpgp:from:references :cc:to:subject:dkim-signature; bh=25iT8PVeb1j4WXsUkaqumAaK/MgLjUVt+8ODdMq5VEs=; b=FfnqdCBhNG3BNSsRi5eCh7+B2tcB4AeBVkiyes9kLcDsJfnTaAYvSVYVeqIaGx6tBF paq/FmJe6laaeLSbvUxep5++R9HAiNqGiBpyZsqeEVx7ZHwz3Wl1eHe1luPUHBBqAGVM xGHqUbQXJ2pwR3o//A/vfnJ5CcHAZgsj34Yh1ySC/EJ2d1I00crGadOhgdSQatvspNo/ 0+co5+Pq+9l9XYXcn763MRxX0nTE1qw0XkI1bfJj7o1nryaBOcToA8nZavDaG2mEwtYr Tcs0smt23KclLR1GPGWuPHbHacrFA1pLMQj2rAYC9L41K0RH1k4rW7oGj2cNNJXqlw2E QBMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b="Tp1bs/I/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ce19-v6si19092519plb.162.2018.10.17.05.32.05; Wed, 17 Oct 2018 05:32:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b="Tp1bs/I/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727260AbeJQU1B (ORCPT + 99 others); Wed, 17 Oct 2018 16:27:01 -0400 Received: from perceval.ideasonboard.com ([213.167.242.64]:34652 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727247AbeJQU1A (ORCPT ); Wed, 17 Oct 2018 16:27:00 -0400 Received: from [192.168.0.21] (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id E786D1277; Wed, 17 Oct 2018 14:31:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1539779489; bh=cGrj03g5cwfLuKcEawVxdxMdMOhUDKIvhY//8WNcOkA=; h=Subject:To:Cc:References:From:Reply-To:Date:In-Reply-To:From; b=Tp1bs/I/0ToQX6zWFh6FXbD5Fb9UBACQ7bafERPwHR/D5EGQqebpTmB78acfxOhNb xgSOfOEB4B6FcM9PnrvgvNZp1qIgLjCxuIvSSrt3UbMY+t07hp6S4Tv7jotLzrr0nA onwQzxn5OUbVckQTK6JqG52lbsLAJba6h7LBl4H4= Subject: Re: [PATCH] scripts/gdb: fix lx-version for gdb 7.3- To: Du Changbin , jan.kiszka@siemens.com, kbingham@kernel.org Cc: linux-kernel@vger.kernel.org References: <20181017023652.6867-1-changbin.du@gmail.com> From: Kieran Bingham Openpgp: preference=signencrypt Autocrypt: addr=kieran.bingham@ideasonboard.com; keydata= xsFNBFYE/WYBEACs1PwjMD9rgCu1hlIiUA1AXR4rv2v+BCLUq//vrX5S5bjzxKAryRf0uHat V/zwz6hiDrZuHUACDB7X8OaQcwhLaVlq6byfoBr25+hbZG7G3+5EUl9cQ7dQEdvNj6V6y/SC rRanWfelwQThCHckbobWiQJfK9n7rYNcPMq9B8e9F020LFH7Kj6YmO95ewJGgLm+idg1Kb3C potzWkXc1xmPzcQ1fvQMOfMwdS+4SNw4rY9f07Xb2K99rjMwZVDgESKIzhsDB5GY465sCsiQ cSAZRxqE49RTBq2+EQsbrQpIc8XiffAB8qexh5/QPzCmR4kJgCGeHIXBtgRj+nIkCJPZvZtf Kr2EAbc6tgg6DkAEHJb+1okosV09+0+TXywYvtEop/WUOWQ+zo+Y/OBd+8Ptgt1pDRyOBzL8 RXa8ZqRf0Mwg75D+dKntZeJHzPRJyrlfQokngAAs4PaFt6UfS+ypMAF37T6CeDArQC41V3ko lPn1yMsVD0p+6i3DPvA/GPIksDC4owjnzVX9kM8Zc5Cx+XoAN0w5Eqo4t6qEVbuettxx55gq 8K8FieAjgjMSxngo/HST8TpFeqI5nVeq0/lqtBRQKumuIqDg+Bkr4L1V/PSB6XgQcOdhtd36 Oe9X9dXB8YSNt7VjOcO7BTmFn/Z8r92mSAfHXpb07YJWJosQOQARA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zqxX1GVYaNkKTnb/Qja8hnYnkUzY1Lc+OtwiGmXTwYsPZjjAaDX35J/RSKAoy5wGo/YFA JxB1gWThL4kOTbsqqXj9GLcyOImkW0lJGGR3o/fV91Zh63S5TKnf2YGGGzxki+ADdxVQAm+Q sbsRB8KNNvVXBOVNwko86rQqF9drZuw= Reply-To: kieran.bingham@ideasonboard.com Organization: Ideas on Board Message-ID: <9fb27240-b0d5-f49f-4dfa-0d8aa25f6cef@ideasonboard.com> Date: Wed, 17 Oct 2018 13:31:26 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20181017023652.6867-1-changbin.du@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Du, On 17/10/18 03:36, Du Changbin wrote: > For gdb version less than 7.3, lx-version only one character. > (gdb) lx-version > L(gdb) > > This can be fixed by casting 'linux_banner' as (char *). > (gdb) lx-version > Linux version 4.19.0-rc1+ (changbin@acer) (gcc version 7.3.0 (Ubuntu 7.3.0-16ubuntu3)) #21 SMP Sat Sep 1 21:43:30 CST 2018 > > gdb 7.4 seems to be no such issue. > > Signed-off-by: Du Changbin > --- > scripts/gdb/linux/proc.py | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/scripts/gdb/linux/proc.py b/scripts/gdb/linux/proc.py > index 086d27223c0c..0aebd7565b03 100644 > --- a/scripts/gdb/linux/proc.py > +++ b/scripts/gdb/linux/proc.py > @@ -41,7 +41,7 @@ class LxVersion(gdb.Command): > > def invoke(self, arg, from_tty): > # linux_banner should contain a newline > - gdb.write(gdb.parse_and_eval("linux_banner").string()) > + gdb.write(gdb.parse_and_eval("(char *)linux_banner").string()) Interesting - this is an issue I reported to the GDB team after I'd tried to dig into the fault. https://sourceware.org/bugzilla/show_bug.cgi?id=20077 the parse_and_eval finds a string length of 0, but then later in the GBD parsing it gets incremented to 1, hence the single char. I guess it's some failure in GDB determining the type of the pointer. However, from reading the bugzilla entry and from what I recall - it only occurred if you had done a backtrace before calling lx-version. Did you discover that it would always return only the single character in your testing ? Even if it was the first command executed? My worry is - that if this fixes lx-version - do we also need to manually cast lx-cmdline as well ? (I never saw the issue occur on that cmd). I think considering the age of the bugzilla at GDB, and the lack of any GDB level fix or understanding - we should certainly apply this fix here - and probably include it in the stable trees too. With the title fix as highlighted by Jan, Reviewed-by: Kieran Bingham Would you be able to test the issue with the lx-cmdline command as well please? And if it is suffering the same issue - perhaps you could either submit a second patch to update that entry - or respin this one to include both? > > LxVersion() > > -- Regards -- Kieran