All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] .gdbinit: load QEMU sub-commands when gdb starts
Date: Mon, 15 May 2017 15:17:28 +0100	[thread overview]
Message-ID: <87a86erypz.fsf@linaro.org> (raw)
In-Reply-To: <20170515134753.28412-1-stefanha@redhat.com>


Stefan Hajnoczi <stefanha@redhat.com> writes:

> The scripts/qemu-gdb.py file is not easily discoverable.  Add a .gdbinit
> file so GDB either loads qemu-gdb.py automatically or prints a message
> informing the user how to enable them (some systems disable ./.gdbinit
> loading for security reasons).
>
> Suggested-by: Eric Blake <eblake@redhat.com>
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
>  .gdbinit | 8 ++++++++
>  1 file changed, 8 insertions(+)
>  create mode 100644 .gdbinit
>
> diff --git a/.gdbinit b/.gdbinit
> new file mode 100644
> index 0000000..9d322fc
> --- /dev/null
> +++ b/.gdbinit
> @@ -0,0 +1,8 @@
> +# GDB may have ./.gdbinit loading disabled by default.  In that case you can
> +# follow the instructions it prints.  They boil down to adding the following to
> +# your home directory's ~/.gdbinit file:
> +#
> +#   add-auto-load-safe-path /path/to/qemu/.gdbinit
> +
> +# Load QEMU-specific sub-commands and settings
> +source scripts/qemu-gdb.py

While this works well enough you might as well just comment the helper
script itself. Would this script take precedence over a users
~/.gdbinit? How would it work for out-of-tree builds?

GDB does have a mechanism for autoloading extensions by way of adding
ELF sections:

  https://sourceware.org/gdb/current/onlinedocs/gdb/dotdebug_005fgdb_005fscripts-section.html#dotdebug_005fgdb_005fscripts-section

--
Alex Bennée

  parent reply	other threads:[~2017-05-15 14:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-15 13:47 [Qemu-devel] [PATCH] .gdbinit: load QEMU sub-commands when gdb starts Stefan Hajnoczi
2017-05-15 13:49 ` Philippe Mathieu-Daudé
2017-05-15 14:17 ` Alex Bennée [this message]
2017-05-16 10:45   ` Stefan Hajnoczi
2017-05-16 11:04     ` Daniel P. Berrange
2017-05-16 11:05     ` Markus Armbruster

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=87a86erypz.fsf@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.