Skip to content

Commit 48136e0

Browse files
committed
New memory-tag commands
Add new commands under the "memory-tag" prefix to allow users to inspect, modify and check memory tags in different ways. The available subcommands are the following: - memory-tag print-logical-tag <expression>: Prints the logical tag for a particular address. - memory-tag withltag <expression> <tag>: Prints the address tagged with the logical tag <tag>. - memory-tag print-allocation-tag <expression>: Prints the allocation tag for a particular address. - memory-tag setatag <expression> <length> <tags>: Sets one or more allocation tags to the specified tags. - memory-tag check <expression>: Checks if the logical tag in <address> matches its allocation tag. These commands make use of the memory tagging gdbarch methods, and are still available, but disabled, when memory tagging is not supported by the architecture. I've pondered about a way to make these commands invisible when memory tagging is not available, but given the check is at runtime (and support may come and go based on a process' configuration), that is a bit too late in the process to either not include the commands or get rid of them. Ideas are welcome. gdb/ChangeLog: 2021-03-24 Luis Machado <[email protected]> * printcmd.c: Include gdbsupport/rsp-low.h. (memory_tag_list): New static global. (process_print_command_args): Factored out of print_command_1. (print_command_1): Use process_print_command_args. (show_addr_not_tagged, show_memory_tagging_unsupported) (memory_tag_command, memory_tag_print_tag_command) (memory_tag_print_logical_tag_command) (memory_tag_print_allocation_tag_command, parse_with_logical_tag_input) (memory_tag_with_logical_tag_command, parse_set_allocation_tag_input) (memory_tag_set_allocation_tag_command, memory_tag_check_command): New functions. (_initialize_printcmd): Add "memory-tag" prefix and subcommands. gdbsupport/ChangeLog: 2021-03-24 Luis Machado <[email protected]> * rsp-low.cc (fromhex, hex2bin): Move to ... * common-utils.cc: ... here. (fromhex) Change error message text to not be RSP-specific. * rsp-low.h (fromhex, hex2bin): Move to ... * common-utils.h: ... here.
1 parent ffcc2a1 commit 48136e0

File tree

7 files changed

+457
-80
lines changed

7 files changed

+457
-80
lines changed

gdb/ChangeLog

+16
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
2021-03-24 Luis Machado <[email protected]>
2+
3+
* printcmd.c: Include gdbsupport/rsp-low.h.
4+
(memory_tag_list): New static global.
5+
(process_print_command_args): Factored out of
6+
print_command_1.
7+
(print_command_1): Use process_print_command_args.
8+
(show_addr_not_tagged, show_memory_tagging_unsupported)
9+
(memory_tag_command, memory_tag_print_tag_command)
10+
(memory_tag_print_logical_tag_command)
11+
(memory_tag_print_allocation_tag_command, parse_with_logical_tag_input)
12+
(memory_tag_with_logical_tag_command, parse_set_allocation_tag_input)
13+
(memory_tag_set_allocation_tag_command, memory_tag_check_command): New
14+
functions.
15+
(_initialize_printcmd): Add "memory-tag" prefix and subcommands.
16+
117
2021-03-24 Luis Machado <[email protected]>
218

319
* aarch64-linux-tdep.c

0 commit comments

Comments
 (0)