From 1f08d324601ef7fd4cce3cff8f8db4a774791828 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Thu, 24 Aug 2023 13:40:38 +0200 Subject: [gdb/build] Return gdb::array_view in thread_info_to_thread_handle In remote_target::thread_info_to_thread_handle we return a copy: ... gdb::byte_vector remote_target::thread_info_to_thread_handle (struct thread_info *tp) { remote_thread_info *priv = get_remote_thread_info (tp); return priv->thread_handle; } ... Fix this by returning a gdb::array_view instead: ... gdb::array_view remote_target::thread_info_to_thread_handle (struct thread_info *tp) ... Tested on x86_64-linux. This fixes the build when building with -std=c++20. Approved-By: Pedro Alves --- gdb/target-delegates.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'gdb/target-delegates.c') diff --git a/gdb/target-delegates.c b/gdb/target-delegates.c index 06f22d5..715e50b 100644 --- a/gdb/target-delegates.c +++ b/gdb/target-delegates.c @@ -89,7 +89,7 @@ struct dummy_target : public target_ops const char *extra_thread_info (thread_info *arg0) override; const char *thread_name (thread_info *arg0) override; thread_info *thread_handle_to_thread_info (const gdb_byte *arg0, int arg1, inferior *arg2) override; - gdb::byte_vector thread_info_to_thread_handle (struct thread_info *arg0) override; + gdb::array_view thread_info_to_thread_handle (struct thread_info *arg0) override; void stop (ptid_t arg0) override; void interrupt () override; void pass_ctrlc () override; @@ -263,7 +263,7 @@ struct debug_target : public target_ops const char *extra_thread_info (thread_info *arg0) override; const char *thread_name (thread_info *arg0) override; thread_info *thread_handle_to_thread_info (const gdb_byte *arg0, int arg1, inferior *arg2) override; - gdb::byte_vector thread_info_to_thread_handle (struct thread_info *arg0) override; + gdb::array_view thread_info_to_thread_handle (struct thread_info *arg0) override; void stop (ptid_t arg0) override; void interrupt () override; void pass_ctrlc () override; @@ -1871,28 +1871,28 @@ debug_target::thread_handle_to_thread_info (const gdb_byte *arg0, int arg1, infe return result; } -gdb::byte_vector +gdb::array_view target_ops::thread_info_to_thread_handle (struct thread_info *arg0) { return this->beneath ()->thread_info_to_thread_handle (arg0); } -gdb::byte_vector +gdb::array_view dummy_target::thread_info_to_thread_handle (struct thread_info *arg0) { - return gdb::byte_vector (); + return gdb::array_view (); } -gdb::byte_vector +gdb::array_view debug_target::thread_info_to_thread_handle (struct thread_info *arg0) { gdb_printf (gdb_stdlog, "-> %s->thread_info_to_thread_handle (...)\n", this->beneath ()->shortname ()); - gdb::byte_vector result + gdb::array_view result = this->beneath ()->thread_info_to_thread_handle (arg0); gdb_printf (gdb_stdlog, "<- %s->thread_info_to_thread_handle (", this->beneath ()->shortname ()); target_debug_print_struct_thread_info_p (arg0); gdb_puts (") = ", gdb_stdlog); - target_debug_print_gdb_byte_vector (result); + target_debug_print_gdb_array_view_const_gdb_byte (result); gdb_puts ("\n", gdb_stdlog); return result; } -- cgit v1.1