Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3638789imu; Mon, 28 Jan 2019 08:14:48 -0800 (PST) X-Google-Smtp-Source: ALg8bN6mO3egtly5JrAs/SlaOcp/fC1kvAePbFLsHaOodiBFl4Mcek8OUKNBLW6QXK/MA5hXSBTO X-Received: by 2002:a63:5207:: with SMTP id g7mr20608405pgb.253.1548692088315; Mon, 28 Jan 2019 08:14:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548692088; cv=none; d=google.com; s=arc-20160816; b=nmQU0A4XwYQ7p3W6anKmZC5D0hmHc44F39O818W09KtVzmvm+QviTlP0BU8ZnBn2El As1ZzYcnV5LGDs3oKVmaN+iphuAV5N31v89P9B5vCmr072F+DShHa3ndLGcoy0PS++mP 46IYju27qTJyqds6/I0Nr6zldr2cTczd5k53Ur3dJmttHPd3u03uHF+JsQFG1wWTqrFE dm5zE34G6f+rGMVuATF//JicZ6WpYBMUZ9bQb0iAfktQRwOlUi28GZPGftbg03t4sjCT aFe4twUZsGozhaXmcVJmdFd/3kDXm8cufHfbyXi8zad4HhLI62rDMpbO4s4B0otTvCNp VPMQ== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=r9myt4VDT/x7p+QmqNJi1gKNP/6jw4jkrr8rEomzTgw=; b=ICrRMfS3aJBruSLRXop+rHS1qK9UliHLrwwYLXWMNcSbwdmBgSgsCkiCHMBP7xs+bK 3fCbQmp23BxWYzgIEeRoaji8LVq6h7oc/J1fbdKNbW1o1YmkagHkLgG6q4r3S3kJuVZd OCcN/C6nsBk/At0iS4Y+LVgx6ubk/LZRQArm3PbS4UFSo5Z6XXMWIlGqlJ/fpEzORUbU F6FABN8/oYp+pZMLCF3/beaP1u0AH26BCaLncydhMUWVYsB9pFd1NtqDxl9Jpig+jXF1 BsObublWrUZ7ZnrCDpHY3L3WM7wUTmOuVxvXb6BYs9vKUJB0dfOGA5R/J2RGhr3mtAPq XRNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=2hrAmJPp; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 86si3792316pfl.46.2019.01.28.08.14.31; Mon, 28 Jan 2019 08:14:48 -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 header.i=@kernel.org header.s=default header.b=2hrAmJPp; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733081AbfA1QMG (ORCPT + 99 others); Mon, 28 Jan 2019 11:12:06 -0500 Received: from mail.kernel.org ([198.145.29.99]:39574 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732390AbfA1QL7 (ORCPT ); Mon, 28 Jan 2019 11:11:59 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B23572177E; Mon, 28 Jan 2019 16:11:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548691918; bh=yzX3yOPfXHZAsRv4i1lqHC0NmaDrNzvgnQSWp1yz1Es=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2hrAmJPpuTBnYAE04e2XcTUP2c+eqZdi87pwT87wEC+87CEupueZQ/iZu5j0oqvPh zzd+/PTMDZul0JbmNEhFt69O2/FdFJJh1bMSnxK6uGR/MZYv9voxchPlaMSW1Hqg39 qr25b6mkJwvEdwcxIajhX33cmX67nQkCt7tIG+/I= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Du Changbin , Kieran Bingham , Jan Kiszka , Jason Wessel , Daniel Thompson , Andrew Morton , Linus Torvalds , Sasha Levin Subject: [PATCH AUTOSEL 4.19 258/258] scripts/gdb: fix lx-version string output Date: Mon, 28 Jan 2019 10:59:24 -0500 Message-Id: <20190128155924.51521-258-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190128155924.51521-1-sashal@kernel.org> References: <20190128155924.51521-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Du Changbin [ Upstream commit b058809bfc8faeb7b7cae047666e23375a060059 ] 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 [kbingham@kernel.org: add detail to commit message] Link: http://lkml.kernel.org/r/20181111162035.8356-1-kieran.bingham@ideasonboard.com Fixes: 2d061d999424 ("scripts/gdb: add version command") Signed-off-by: Du Changbin Signed-off-by: Kieran Bingham Acked-by: Jan Kiszka Cc: Jan Kiszka Cc: Jason Wessel Cc: Daniel Thompson Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- 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.19.1