Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp3512160img; Mon, 25 Mar 2019 11:47:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqx5Sz30BAEZUKAC4c94TsLOleGEDXePw34nOjN+v/gJr8wXmryvyOgchIpfZogkynhqKTtA X-Received: by 2002:a65:4844:: with SMTP id i4mr24109482pgs.347.1553539665307; Mon, 25 Mar 2019 11:47:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553539665; cv=none; d=google.com; s=arc-20160816; b=poxe2eL9g5vN87CPW0NF2jexa/rBa8BmXUE6ucpz4wKZ9CNK9ZQmmOuOmB+f4DvbJ+ pFAt45AzfYnjM58aAE0IFcfI+NIUjAJNFWpaexzIWddyphEKeo8ljSNMH1JfpVRXnWt3 IXTEWxVoG0qXuT8y8+qKFWDtmbpJFUomWpO5FlFIFwz0YJEyn4ZixYZ6Tn15WenpzZGy f+cEVMoHcwmC1WREsGLUuO610Nu0ZNQdYXzTJLOCo79GODWCJTmW/dpGW6UjCjMYzp07 zjv48LzuTv99pwMz2sZ2N01RO8SofVxHZCt3kA+dK3SmsFNrRi+LxuIWHBXk7I4YVED1 bjug== 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=U7a92O0IL4yxS6jfXWReaSz0adfdvNKb8+QWSFPrpew=; b=Kg5Zn+BDLbu3MxSJRNq6xrao7enPtASTJDDjRt+1y8B1pUQVAaj7paBDm0NTzOv4XY Ki89eleVmiKSOm5cDMR1W5GD05KB+IMU2ZW8OuT9RSpyPZnOvIY431b+F4naoTD47Hi+ m+6t86cyIlmNTpytTQBh0HxW8VuHQuulhJwv0tEEb93QdbtIMAQkWVzEyjKbgLWap9nX XniOiFsu4E8xh2qppWtwztAfiCQ9w7rR6qikScN/8hSNCFeDBy+6SdUE2i1xbszoRW0U Z5TK7gzFxZdEjkxm9buqiLxoOjd1iP2Qf7fBAJXCuaEVZW7Y4Lo32pfuBpa5renOF7KL 4VNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=DVXp2CF9; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x17si13726360pgj.195.2019.03.25.11.47.30; Mon, 25 Mar 2019 11:47:45 -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 header.i=@chromium.org header.s=google header.b=DVXp2CF9; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730285AbfCYSp1 (ORCPT + 99 others); Mon, 25 Mar 2019 14:45:27 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:33511 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730209AbfCYSpZ (ORCPT ); Mon, 25 Mar 2019 14:45:25 -0400 Received: by mail-pg1-f195.google.com with SMTP id b12so7033884pgk.0 for ; Mon, 25 Mar 2019 11:45:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=U7a92O0IL4yxS6jfXWReaSz0adfdvNKb8+QWSFPrpew=; b=DVXp2CF918Ab6uG3uYX4oUjSXGUAkb/u8mG6DENiDwfo8aJehc0wmJKTirRgQS5Gm4 pNHh9r9AF6k0YrZQY28+WJbLMVOGPtR5dq1AopR+pVAGPsjLa+L4+vU4/dYzg3LVHDXx sVABXtM9z1PlO7kbr7Dq2g9RmkbRBtKCE0Ot4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=U7a92O0IL4yxS6jfXWReaSz0adfdvNKb8+QWSFPrpew=; b=UvtMn+WV6mbOoa+hyPtUpgoACstBnW+8xsDT20SADbxV0aGF8J1smJv/ybB6Pi8BAR Wl0cFjTE5Y/HEo8+OXcxXGFxZOAcAVPW4vjdCxOO2y2Rfsd75fjdVzz+QjVyUczy6lA0 n0KW+afyKULv7pHDIENJmGa0qrAZzpMJMRq+X/wb7qJ9smpfDaV5Y0AyAZktUOWnfPvv /6FXjBFmmuZoievU/NDGqGPQ7P1n+OIQ0nliixTSzWp/K1CIXG7kPB2cGo/cpizIQBkF pMQ38UjNnNMQi4jjXIyBLjVDi/wVVN4UM6GWFybH7AjMBXvuakGUup6ApFAh/vM/TAku 6WNg== X-Gm-Message-State: APjAAAXw04rzuWSmpr4AGj8mVa/W1Wc+GcC/KdSV9RPxBXsjnTC8J6yb zYeqbyjTHwXJUA2G7hSWRVvx1w== X-Received: by 2002:a62:6c43:: with SMTP id h64mr25569222pfc.123.1553539525285; Mon, 25 Mar 2019 11:45:25 -0700 (PDT) Received: from smtp.gmail.com ([2620:15c:202:1:fa53:7765:582b:82b9]) by smtp.gmail.com with ESMTPSA id h3sm27505108pfb.31.2019.03.25.11.45.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Mar 2019 11:45:24 -0700 (PDT) From: Stephen Boyd To: Andrew Morton Cc: linux-kernel@vger.kernel.org, Masahiro Yamada , Douglas Anderson , Nikolay Borisov , Kieran Bingham , Jan Kiszka , Jackie Liu Subject: [PATCH 1/4] scripts/gdb: Find vmlinux where it was before Date: Mon, 25 Mar 2019 11:45:19 -0700 Message-Id: <20190325184522.260535-2-swboyd@chromium.org> X-Mailer: git-send-email 2.21.0.392.gf8f6787159e-goog In-Reply-To: <20190325184522.260535-1-swboyd@chromium.org> References: <20190325184522.260535-1-swboyd@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If I run 'gdb ' and there's the vmlinux-gdb.py file there I can properly see symbols and use the lx commands provided by the GDB scripts. But once I run 'lx-symbols' at the command prompt, gdb reloads the vmlinux symbols assuming that this script was run from the directory that has vmlinux at the root. That isn't always true, but we could just look and see what symbols were already loaded and use that instead. Let's do that so this can work by being invoked anywhere. Cc: Douglas Anderson Cc: Nikolay Borisov Cc: Kieran Bingham Cc: Jan Kiszka Cc: Jackie Liu Signed-off-by: Stephen Boyd --- scripts/gdb/linux/symbols.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/gdb/linux/symbols.py b/scripts/gdb/linux/symbols.py index 004b0ac7fa72..2f5b95f09fa0 100644 --- a/scripts/gdb/linux/symbols.py +++ b/scripts/gdb/linux/symbols.py @@ -139,8 +139,12 @@ lx-symbols command.""" saved_states.append({'breakpoint': bp, 'enabled': bp.enabled}) # drop all current symbols and reload vmlinux + orig_vmlinux = 'vmlinux' + for obj in gdb.objfiles(): + if obj.filename.endswith('vmlinux'): + orig_vmlinux = obj.filename gdb.execute("symbol-file", to_string=True) - gdb.execute("symbol-file vmlinux") + gdb.execute("symbol-file {0}".format(orig_vmlinux)) self.loaded_modules = [] module_list = modules.module_list() -- Sent by a computer through tubes