From: Tom Tromey <tom@tromey.com>
To: Andrew Burgess <aburgess@redhat.com>
Cc: Tom Tromey <tom@tromey.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] gdb: add gdbarch_stack_grows_down function
Date: Fri, 10 May 2024 03:43:18 -0600 [thread overview]
Message-ID: <87ikzmq9xl.fsf@tromey.com> (raw)
In-Reply-To: <87bk5erqrb.fsf@redhat.com> (Andrew Burgess's message of "Fri, 10 May 2024 09:54:32 +0100")
>>>>> "Andrew" == Andrew Burgess <aburgess@redhat.com> writes:
Andrew> Great idea. How about the update below?
Andrew> + /* We don't call gdbarch_stack_grows_down here, instead we're testing the
Andrew> + implementation by calling gdbarch_inner_than. GDB assumes that stacks
Andrew> + either grow down or up (see uses of gdbarch_stack_grows_down), so one of
Andrew> + these needs to be true. */
Andrew> + bool stack_grows = (gdbarch_inner_than (gdbarch, 1, 2)
Andrew> + || gdbarch_inner_than (gdbarch, 2, 1));
It probably should check
(gdbarch_inner_than() != 0) != (gdbarch_inner_than() != 0)
to ensure that exactly one call returns true; with the !=0 being needed
because this still returns int and not bool.
Maybe that's too nit-picky though. TBH I doubt it would ever be an
issue as is.
Approved-By: Tom Tromey <tom@tromey.com>
Tom
next prev parent reply other threads:[~2024-05-10 9:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-09 14:59 Andrew Burgess
2024-05-09 19:43 ` Tom Tromey
2024-05-10 8:54 ` Andrew Burgess
2024-05-10 9:43 ` Tom Tromey [this message]
2024-05-10 13:31 ` Andrew Burgess
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=87ikzmq9xl.fsf@tromey.com \
--to=tom@tromey.com \
--cc=aburgess@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).