diff options
author | Andrew Burgess <aburgess@redhat.com> | 2024-05-05 11:00:04 +0100 |
---|---|---|
committer | Andrew Burgess <aburgess@redhat.com> | 2024-05-10 14:21:21 +0100 |
commit | a4f76c0765a0b9c643dc91d5a398a1cd9519572b (patch) | |
tree | 863f44e6daf20cb51d996417849512ea34f3d0fe /gdb/python/python-config.py | |
parent | 2b34e06765779335cef45a579e7a5698e198472b (diff) | |
download | binutils-a4f76c0765a0b9c643dc91d5a398a1cd9519572b.zip binutils-a4f76c0765a0b9c643dc91d5a398a1cd9519572b.tar.gz binutils-a4f76c0765a0b9c643dc91d5a398a1cd9519572b.tar.bz2 |
gdb: add gdbarch_stack_grows_down function
In another patch I'm working on I needed to ask: does the stack grow
down, or grow up?
Looking around I found in infcall.c some code where we needed to ask
the same question, what we do there is ask:
gdbarch_inner_than (gdbarch, 1, 2)
which should do the job. However, I don't particularly like copying
this, it feels like we're asking something slightly different that
just happens to align with the question we're actually asking.
I propose adding a new function `gdbarch_stack_grows_down`. This is
not going to be a gdbarch method that can be overridden, instead, this
will just call the gdbarch_inner_than function. We already have some
gdbarch methods like this, checkout arch-utils.c for examples.
I think it's now clearer what we're actually doing.
A new self-test ensures that all architectures have a stack that
either grows down, or grows up.
There should be no user visible changes after this commit.
Approved-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'gdb/python/python-config.py')
0 files changed, 0 insertions, 0 deletions