From patchwork Thu Jan 7 12:52:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 59278 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp530615lbb; Thu, 7 Jan 2016 04:53:19 -0800 (PST) X-Received: by 10.67.3.230 with SMTP id bz6mr151326824pad.118.1452171199336; Thu, 07 Jan 2016 04:53:19 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id kw9si55422013pab.63.2016.01.07.04.53.16; Thu, 07 Jan 2016 04:53:19 -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; 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; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753707AbcAGMxM (ORCPT + 29 others); Thu, 7 Jan 2016 07:53:12 -0500 Received: from mail-wm0-f50.google.com ([74.125.82.50]:35479 "EHLO mail-wm0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753383AbcAGMw3 (ORCPT ); Thu, 7 Jan 2016 07:52:29 -0500 Received: by mail-wm0-f50.google.com with SMTP id f206so96028008wmf.0 for ; Thu, 07 Jan 2016 04:52:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=dsIHJ1+updiFBEyC1lI7u0wzxD/M8G4UwxUY54bZp2s=; b=SfJYQMkU9vy84TXU1w7u9tEEf33DPXakVZ+iXv8lfR2SxEuFqUtZ2Ppp8XkQaXZnRc DHy2Cxdi+y/1kFu0+vZdVeytAn95huKoYMtzJekebKUqK/OdNFyQyIcytPdqQARTBKaH cswL4405S5enCXedcIy9nRyAQKQ5d+PAHW/ik= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=dsIHJ1+updiFBEyC1lI7u0wzxD/M8G4UwxUY54bZp2s=; b=fHH951nx+hZlDneQ2aJce5bGw0JRcdEsIfaIb/gKUQT8xhF/czd+mWvNu8hrtDKP0q byHzKZkbyvf8oUKH2oFWOGBJcXBU8hoAAvycLOu/Jpr+iP4NvcfApZaIeHVdd7mKC2xg CfKFAoBLOXy5yHMENW6PEWxtl91K3C7UC1OqOuWidXGX1YZ0B40waWZx6myOURU8Mala abIMDOwHKQnVvS6mKrH+xV+mtLMLJF9yxNhJ9xNZVD4mdmUkW/aUENuQdodxcvtnrki0 0rDTjMUquh+aUVfIekD3fdyYPaZ5GuyKjSK9oxtsCmxqnf+rq1+7EpckCT/ErXENcV4K ShYw== X-Gm-Message-State: ALoCoQkA4JaqfpamBBO93rWs0NIKBMxQjH0EjtCWH9sVl3TwdffcnFnJVznTUXdt2cgasABJq0VC/akuJ+sm4/KryfEKuOWolg== X-Received: by 10.194.58.165 with SMTP id s5mr122382756wjq.70.1452171147851; Thu, 07 Jan 2016 04:52:27 -0800 (PST) Received: from localhost.localdomain (cpc87017-aztw30-2-0-cust65.18-1.cable.virginm.net. [92.232.232.66]) by smtp.gmail.com with ESMTPSA id w23sm13543870wmd.1.2016.01.07.04.52.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 07 Jan 2016 04:52:27 -0800 (PST) From: Kieran Bingham To: jan.kiszka@siemens.com, linux-kernel@vger.kernel.org Cc: peter.griffin@linaro.org, lee.jones@linaro.org, maxime.coquelin@st.com, Kieran Bingham Subject: [PATCH 1/2] scripts/gdb: Add version command Date: Thu, 7 Jan 2016 12:52:17 +0000 Message-Id: <1452171138-22691-2-git-send-email-kieran.bingham@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1452171138-22691-1-git-send-email-kieran.bingham@linaro.org> References: <1452171138-22691-1-git-send-email-kieran.bingham@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org lx-version Report the Linux Version of the current kernel. Add a command to identify the version specified by the banner in the debugged kernel. This lets the user identify the kernel of the running kernel, and will let later scripts compare the banner of the attached kernel against the banner in the vmlinux symbols files to verify that the files are correct. Signed-off-by: Kieran Bingham --- scripts/gdb/linux/proc.py | 27 +++++++++++++++++++++++++++ scripts/gdb/vmlinux-gdb.py | 1 + 2 files changed, 28 insertions(+) create mode 100644 scripts/gdb/linux/proc.py -- 2.5.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ diff --git a/scripts/gdb/linux/proc.py b/scripts/gdb/linux/proc.py new file mode 100644 index 000000000000..7a2afe60416a --- /dev/null +++ b/scripts/gdb/linux/proc.py @@ -0,0 +1,27 @@ +# +# gdb helper commands and functions for Linux kernel debugging +# +# Kernel proc information reader +# +# Copyright (c) 2016 Linaro Ltd +# +# Authors: +# Kieran Bingham +# +# This work is licensed under the terms of the GNU GPL version 2. +# + +import gdb + +class LxVersion(gdb.Command): + """ Report the Linux Version of the current kernel. + Equivalent to cat /proc/version on a running target + """ + def __init__(self): + super(LxVersion, self).__init__("lx-version", gdb.COMMAND_DATA) + + def invoke(self, arg, from_tty): + # linux_banner should contain a newline + gdb.write(gdb.parse_and_eval("linux_banner").string()) + +LxVersion() diff --git a/scripts/gdb/vmlinux-gdb.py b/scripts/gdb/vmlinux-gdb.py index ce82bf5c3943..d5943eca19cd 100644 --- a/scripts/gdb/vmlinux-gdb.py +++ b/scripts/gdb/vmlinux-gdb.py @@ -29,3 +29,4 @@ else: import linux.tasks import linux.cpus import linux.lists + import linux.proc