/* set/show remote NAME-packet {auto,on,off} -- legacy. */
if (legacy)
{
- /* It's not clear who should take ownership of this string, so, for
- now, make it static, and give copies to each of the add_alias_cmd
- calls below. */
- static gdb::unique_xmalloc_ptr<char> legacy_name
+ /* It's not clear who should take ownership of the LEGACY_NAME string
+ created below, so, for now, place the string into a static vector
+ which ensures the strings is released when GDB exits. */
+ static std::vector<gdb::unique_xmalloc_ptr<char>> legacy_names;
+ gdb::unique_xmalloc_ptr<char> legacy_name
= xstrprintf ("%s-packet", name);
add_alias_cmd (legacy_name.get (), cmds.set, class_obscure, 0,
&remote_set_cmdlist);
add_alias_cmd (legacy_name.get (), cmds.show, class_obscure, 0,
&remote_show_cmdlist);
+ legacy_names.emplace_back (std::move (legacy_name));
}
}
gdb_test_no_output "set remote hardware-watchpoint-limit 2147483647"
gdb_test_no_output "set remote hardware-breakpoint-limit 2147483647"
+# Check the X/P/p alias commands display the correct packet names.
+foreach pkt {X P p} {
+ gdb_test "show remote ${pkt}-packet" "Support for the `${pkt}' packet is.*"
+}
+
gdb_exit