Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933920AbcCNKUg (ORCPT ); Mon, 14 Mar 2016 06:20:36 -0400 Received: from mail-wm0-f53.google.com ([74.125.82.53]:33874 "EHLO mail-wm0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752125AbcCNKU0 (ORCPT ); Mon, 14 Mar 2016 06:20:26 -0400 To: Jan Kiszka , Peter Griffin , Lee Jones , Lee Jones , Peter Griffin , Maxime Coquelin , Russell Wayman , Linux Kernel From: Kieran Bingham Subject: gdb/scripts: Module symbol search paths Message-ID: <56E69067.1020909@linaro.org> Date: Mon, 14 Mar 2016 10:20:23 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1384 Lines: 45 Hi Jan, Whilst testing the modules update patch you sent, I discovered (due to having rebased to v4.5) that the module search path will end up picking an incorrect version of the .ko file if an earlier version exists.: (gdb) lx-symbols /opt/root/ubuntu-vivid.x86_64 loading vmlinux (gdb) c Continuing. < load module helloworld.ko on target > scanning for modules in /opt/root/ubuntu-vivid.x86_64 loading @0xffffffffa0000000: /opt/root/ubuntu-vivid.x86_64/lib/modules/4.4.0+/extra/helloworld.ko Looking at the filesystem layout: kbingham@CookieMonster:~$ sudo find /opt/root/ubuntu-vivid.x86_64/ -name helloworld.ko /opt/root/ubuntu-vivid.x86_64/lib/modules/4.4.0+/extra/helloworld.ko /opt/root/ubuntu-vivid.x86_64/lib/modules/4.5.0+/extra/helloworld.ko Unfortunately I can't see any reference to a vfs path in: print $lx_module("helloworld") So we can't retrieve the exact path location from the kernel information Have you experienced this issue? Perhaps we ought to prefix our search path with $(path_item)/lib/modules/`uname -r` ST's C implementation of module support can be seen at: https://git.linaro.org/people/kieran.bingham/binutils-gdb.git/blob/e30a18cf086bd02c4ebb57f6f783fe2ad4af9c84:/gdb/stlinux/lkd-modules.c They restrict the search paths, and parse expected lib/modules/{version}/ paths to ensure the correct modules are discovered. -- Regards Kieran