aboutsummaryrefslogtreecommitdiff
path: root/gdb/source-cache.c
diff options
context:
space:
mode:
authorAndrew Burgess <aburgess@redhat.com>2022-08-28 21:19:50 +0100
committerAndrew Burgess <aburgess@redhat.com>2022-10-02 14:21:24 +0100
commit89e601ac3a2e29da46275a3dcb83855e662fb0c9 (patch)
tree4dca0b4e426cb28ca0ed6e81e8d5c0cee45da347 /gdb/source-cache.c
parentbd93abe8d5513ceecc10a91452a85c803cac895b (diff)
downloadgdb-89e601ac3a2e29da46275a3dcb83855e662fb0c9.zip
gdb-89e601ac3a2e29da46275a3dcb83855e662fb0c9.tar.gz
gdb-89e601ac3a2e29da46275a3dcb83855e662fb0c9.tar.bz2
gdb/gdbarch: add a comment to gdbarch_register_name
After the previous commit, this commit sets out to formalise the API for gdbarch_register_name. Not every architecture is actually in compliance with the API I set out here, but I believe that most are. I think architectures that don't comply with the API laid out here will fail the gdb.base/completion.exp test. The claims in the comment are I feel, best demonstrated with the asserts in this code: const char * gdbarch_register_name (struct gdbarch *gdbarch, int regnr) { gdb_assert (regnr >= 0); gdb_assert (regnr < gdbarch_num_cooked_regs (gdbarch)); const char *name = gdbarch->register_name (gdbarch, regnr); gdb_assert (name != nullptr); return name; } Like I said, I don't believe every architecture follows these rules right now, which is why I'm not actually adding any asserts. Instead, this commit adds a comment to gdbarch_register_name, this comment is where I'd like to get to, rather than where we are right now. Subsequent commits will fix all targets to be in compliance with this comment, and will even add the asserts shown above to gdbarch_register_name.
Diffstat (limited to 'gdb/source-cache.c')
0 files changed, 0 insertions, 0 deletions