From: Guinevere Larsen <blarsen@redhat.com>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 2/3] gdb/record: add support to vmovd and vmovq instructions
Date: Wed, 5 Jun 2024 16:53:19 -0300 [thread overview]
Message-ID: <811d838c-ef3b-4bcf-bbad-69c406503aa3@redhat.com> (raw)
In-Reply-To: <736a096d-91bb-4787-b628-c273f7e91c78@redhat.com>
On 6/5/24 15:24, Guinevere Larsen wrote:
> On 6/5/24 13:13, Tom Tromey wrote:
>>>>>>> "Guinevere" == Guinevere Larsen <blarsen@redhat.com> writes:
>> Guinevere> This commit adds support to the x86_64 AVX instructions
>> vmovd and vmovq.
>> Guinevere> The programmers manuals for Intel and AMD describe these 2
>> instructions
>> Guinevere> as being almost the same, but my local testing, using gcc
>> 13.2 on Fedora
>> Guinevere> 39, showed several differences and inconsistencies.
>>
>> Guinevere> static bool
>> Guinevere> -i386_record_vex (struct i386_record_s *ir, uint8_t rex_w,
>> uint8_t rex_r,
>> Guinevere> +i386_record_vex (struct i386_record_s *ir, uint8_t vex_w,
>> uint8_t vex_r,
>> Guinevere> int opcode, struct gdbarch *gdbarch)
>> Guinevere> {
>> ...
>> Guinevere> + error ("Unrecognized VEX.PP value %d at address %s.",
>> Guinevere> + ir->pp, paddress(gdbarch, ir->orig_addr));
>>
>> I don't know anything about record, really, but it seems weird to have a
>> function that has two error return mechanisms -- either calling error or
>> printing a message and returning some value:
>>
>> Guinevere> default:
>> Guinevere> gdb_printf (gdb_stderr,
>> Guinevere> _("Process record does not support VEX
>> instruction 0x%02x "
>>
>> What's the deal with that?
>
> Christmas vacation in between, mostly.
>
> gdb_printf is what i386_process_record already uses, so felt
> reasonable, then I chose "error" int the other situation because it
> felt more appropriate for me to have a strong error when we find
> something that, to the best of my knowledge, breaks the ISA. To me it
> marks a difference between "we're not equipped to handle" versus "up
> to most recent ISA, this is straight up incorrect", but if you think
> it's better to only use one error mechanism, I can switch to
> gdb_printf everywhere.
>
Interestingly enough, I just double checked what happens, and for the
end user, the gdb_printf option looks stronger because gdbarch will add
> Process record: failed to record execution log.
and error will not print anything but the message given. I'll
standardize on the gdb_printf version instead. Thanks for the pointer!
--
Cheers,
Guinevere Larsen
She/Her/Hers
next prev parent reply other threads:[~2024-06-05 19:53 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-21 20:27 [PATCH 0/3] Small step in supporting AVX instructions Guinevere Larsen
2024-05-21 20:27 ` [PATCH 1/3] gdb: Start supporting AVX instruction Guinevere Larsen
2024-06-05 16:11 ` Tom Tromey
2024-06-05 17:33 ` Guinevere Larsen
2024-06-06 17:01 ` Tom Tromey
2024-05-21 20:27 ` [PATCH 2/3] gdb/record: add support to vmovd and vmovq instructions Guinevere Larsen
2024-06-05 16:13 ` Tom Tromey
2024-06-05 18:24 ` Guinevere Larsen
2024-06-05 19:53 ` Guinevere Larsen [this message]
2024-05-21 20:28 ` [PATCH 3/3] gdb/record: add support to AVX unpack instructions Guinevere Larsen
2024-06-04 19:10 ` [PING][PATCH 0/3] Small step in supporting AVX instructions Guinevere Larsen
2024-06-05 16:13 ` Tom Tromey
2024-06-06 8:16 ` Willgerodt, Felix
2024-06-06 12:50 ` Guinevere Larsen
2024-06-06 13:36 ` Willgerodt, Felix
2024-06-06 13:45 ` Guinevere Larsen
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=811d838c-ef3b-4bcf-bbad-69c406503aa3@redhat.com \
--to=blarsen@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=tom@tromey.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).