public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Luis Machado <luis.machado@arm.com>
To: Little Tree <littletreetrunk32@gmail.com>, gdb@sourceware.org
Subject: Re: Linux kernel debugging - make scripts_gdb - Error
Date: Wed, 12 Apr 2023 18:51:12 +0100	[thread overview]
Message-ID: <8c16e6b9-f451-00b2-1700-d9a1ed67e883@arm.com> (raw)
In-Reply-To: <CAHwOCLZAP2_scz5NXF7F=PD+g4Of53H51vTnWbxCg6+G4899Fg@mail.gmail.com>

Hi,

On 4/12/23 11:28, Little Tree via Gdb wrote:
> I am remotely debugging an AArch64 Linux kernel running on QEMU using gdb.
> I wish to make use of the Python support while debugging (for using the
> commands like lx-dmesg).
> Referring to this link
> https://docs.kernel.org/dev-tools/gdb-kernel-debugging.html , I understand
> that for Linux kernel 5.1 and above, the scripting support is to be built
> using the command "make scripts_gdb" after the Linux kernel is built. I am
> getting many errors while building (mostly related to x86).
> 
> Do I have to set any arm specific environment variable before building? At
> present my build command is
> 
> $make scripts_gdb

In my experience I didn't have to make scripts_gdb. After enabling the CONFIG_GDB_SCRIPTS option in the kernel configuration, the helper python scripts were left in the kernel build tree.

When you load vmlinux, gdb will automatically attempt to load the helper python scripts if you have the proper auto-load permissions.

I did run into issues with a more recent kernel where it says the following when I try to load vmlinux into gdb:

Traceback (most recent call last):
   File "linux-arm64/vmlinux-gdb.py", line 25, in <module>
     import linux.utils
   File "linux-arm64/scripts/gdb/linux/utils.py", line 131, in <module>
     atomic_long_counter_offset = atomic_long_type.get_type()['counter'].bitpos
KeyError: 'counter'

I'm not sure if that's a bug in the helper scripts due to a recent commit or not. I recall these steps working out-of-the-box though.

> 
> 
> Thanks a lot,
>    Little


      reply	other threads:[~2023-04-12 17:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-12 10:28 Little Tree
2023-04-12 17:51 ` Luis Machado [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8c16e6b9-f451-00b2-1700-d9a1ed67e883@arm.com \
    --to=luis.machado@arm.com \
    --cc=gdb@sourceware.org \
    --cc=littletreetrunk32@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).