Kernel Newbies archive mirror
 help / color / mirror / Atom feed
From: jim.cromie@gmail.com
To: kernelnewbies <kernelnewbies@kernelnewbies.org>
Subject: gdb vmlinux scripting
Date: Mon, 28 Nov 2022 14:46:42 -0700	[thread overview]
Message-ID: <CAJfuBxzLt0HQFSjvB5S-o1qsXn7UZ=seg1_86hWFkXFZB4oYTw@mail.gmail.com> (raw)

so Im debugging a kernel,
running inside virtme  (I cant recommend it enough)

using 2 terminals, each in build-dir

1st runs
function dkrunk () {
    echo vm    $KRUN_SHOW $KRUN_STDS $KDBG_OPTS $* $QM_OPTS --smp 3 -s -S
    virtme-run $KRUN_SHOW $KRUN_STDS $KDBG_OPTS $* $QM_OPTS --smp 3 -s -S
    # -qmp tcp:localhost:4444,server,nowait
}

2nd runs:
alias tui='gdb --tui -q -x ../../../gdb-2 vmlinux'

that script is

# seems I need a hardware breakpoint to get started,
# is that the case for anyone else ?
hbreak dynamic_debug_init
c
b strcmp if cs == ct
c


If you do this, youll find all the places where
strcmp is called on identical args.

Most of them I dont want to see,
but what kind of syntax lets me look up the frame(s)
to select only the contexts of interest ?

it would be useful enough to test just the caller file,
that would get me a long way

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

                 reply	other threads:[~2022-11-28 21:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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='CAJfuBxzLt0HQFSjvB5S-o1qsXn7UZ=seg1_86hWFkXFZB4oYTw@mail.gmail.com' \
    --to=jim.cromie@gmail.com \
    --cc=kernelnewbies@kernelnewbies.org \
    /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).