Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3137875imu; Sun, 11 Nov 2018 08:21:23 -0800 (PST) X-Google-Smtp-Source: AJdET5dLK1HHABuEd7cs9cL0RQMWs1DOicIcj8QIPckofF+GRMOFigrsZjreFsuOljbpyrjFikBE X-Received: by 2002:a62:e0dd:: with SMTP id d90-v6mr16450162pfm.214.1541953283617; Sun, 11 Nov 2018 08:21:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541953283; cv=none; d=google.com; s=arc-20160816; b=mLXNCbmIjj5mDLnuz3Z9JQI+fQ00hrW3ofq5cd8fiDpSRAqpvfFWkembmFrfXeNoSj fXmuVt+ZwpRiV4RoCvlkIJLLnDIHYeKsYSYlxcwSivzI1cT2555bk7AC/EOuZGy+jxOI eIQp2A+eTsegVrcWG2/9GZPHYAxi/dYBPeZLHDRMvWhV0+Ytn2aG0koChf/8P1SEfw+1 d27gQe1zW2QDTVKKRngtRf4cBqrbW0RlZis1Nbz0TEoPgVe4/kpBdhGi5l+6qlrlFi0Y yUV10IJDD9eHXtX2UmSTNvwNAVJnaw/KM6Qj5mNUThsIADtkqkCocc+EpUekIsfbcieP zBoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=fWUzy6Ri8IxSCOQZXQtrr/NIg4UCNlB0aHQHsX2Af7Q=; b=dUuBKhA6NeXmuLs8LPrl7dU6zbRYMfuRC1pxF88LmajIefmBuuyRoxd3FmBnQENNe5 ay62QBk4JORXN6E0pjRffMpCg9KrLA5k0czIHpw8/2dBT+oDob52emmnPhjUSQF+HQVv 85U3GRvYZFNudgH8HdVZUY7lRtTTae/h7BBaQXP0BBdqYSeM2guDUyPl5nx63jtSGpe2 QyDhmjdgHz29YKpSDmW+GmPFetbjlcNCj+0hRzVncWFJtfQqsigRf8Lb4XjIh9jBmLpa fAFvCIkszbI1lpTp6dz9IiGjZKkNEQpunqTjsmgcZjqtjLbeqVcpv1xKha+A63cMJVJH 1oAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=YgJws5sf; 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 x187si13784864pgx.241.2018.11.11.08.21.06; Sun, 11 Nov 2018 08:21:23 -0800 (PST) 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=YgJws5sf; 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 S1729092AbeKLCJi (ORCPT + 99 others); Sun, 11 Nov 2018 21:09:38 -0500 Received: from perceval.ideasonboard.com ([213.167.242.64]:37582 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729056AbeKLCJi (ORCPT ); Sun, 11 Nov 2018 21:09:38 -0500 Received: from localhost.localdomain (unknown [31.221.87.67]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id CEFFEDE; Sun, 11 Nov 2018 17:20:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1541953239; bh=3SufsXOrKZU9+5zIKBCCraZzR7hq60talMyw219FL58=; h=From:To:Cc:Subject:Date:From; b=YgJws5sfmv7pt3QHDibne5sFVKkvbgv9UXI7Wtg1QCmeN/vpBpJL2165Nbw5TpWYV vWSxAUKCrde9ag+7Fo4olUPWVNGxpCJm06F0Ov04ikBtv0DIF11gtg/lpb++ZhXsTO Lst4XRbvN8L3J1Wn05Y3B86FZ3Jtw32RdeTfrLQA= From: Kieran Bingham To: Andrew Morton Cc: Jan Kiszka , Kieran Bingham , linux-kernel@vger.kernel.org, Du Changbin Subject: [PATCH v4] scripts/gdb: fix lx-version string output Date: Sun, 11 Nov 2018 16:20:35 +0000 Message-Id: <20181111162035.8356-1-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Du Changbin A bug is present in GDB which causes early string termination when parsing variables. This has been reported [0], but we should ensure that we can support at least basic printing of the core kernel strings. For current gdb version (has been tested with 7.3 and 8.1), 'lx-version' only prints 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 [0] https://sourceware.org/bugzilla/show_bug.cgi?id=20077 Fixes: 2d061d999424 ("scripts/gdb: add version command") Signed-off-by: Du Changbin Acked-by: Jan Kiszka [Kieran: Added detail to commit message] Signed-off-by: Kieran Bingham --- Andrew - could you consider this patch for inclusion in your tree please? Regards Kieran 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()) LxVersion() -- 2.17.1