public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Lancelot SIX <lsix@lancelotsix.com>
To: Bruno Larsen <blarsen@redhat.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH v2] gdb: add 'maintenance print record-instruction' command
Date: Wed, 14 Dec 2022 10:04:27 +0000	[thread overview]
Message-ID: <20221214100427.wubrugmrrjud4zqm@ubuntu.lan> (raw)
In-Reply-To: <20221214004529.3hgz2yuhv6rx2r4c@ubuntu.lan>

>     struct value_print_options opts;
>     get_user_print_options (&opts);
>     auto mark = value_mark ();

Hi,

I forgot about scoped_value_mark which is probably much better than
manually doing the value_mark () ; value_free_to_mark () dance.

Lancelot.

>     type *regtype = gdbarch_register_type (target_gdbarch (),
>                                            to_print->u.reg.num);
>     value *val
>       = value_from_contents (regtype, record_full_get_loc (to_print));
> 
>     gdb_printf ("Register %s changed: %s\n",
>                 gdbarch_register_name (target_gdbarch (),
>                                        to_print->u.reg.num));
>     value_print (val, gdb_stdout, &opts);
>     gdb_printf ("\n");
>     value_free_to_mark (mark);

  reply	other threads:[~2022-12-14 10:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-12 10:44 Bruno Larsen
2022-12-12 13:54 ` Eli Zaretskii
2022-12-14  0:46 ` Lancelot SIX
2022-12-14 10:04   ` Lancelot SIX [this message]
2022-12-14 16:30     ` Tom Tromey
2022-12-16 10:03   ` Bruno Larsen
2022-12-16 13:25 ` Pedro Alves

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=20221214100427.wubrugmrrjud4zqm@ubuntu.lan \
    --to=lsix@lancelotsix.com \
    --cc=blarsen@redhat.com \
    --cc=gdb-patches@sourceware.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).