diff options
author | Tom de Vries <tdevries@suse.de> | 2023-08-24 13:40:38 +0200 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2023-08-24 13:40:38 +0200 |
commit | 1f08d324601ef7fd4cce3cff8f8db4a774791828 (patch) | |
tree | f5dc02b94c0fe17232557d8bf24b9f705a7ba337 /gdb/target.h | |
parent | f1917fc63166d73a9d0930d96468e486a49c666d (diff) | |
download | fsf-binutils-gdb-1f08d324601ef7fd4cce3cff8f8db4a774791828.zip fsf-binutils-gdb-1f08d324601ef7fd4cce3cff8f8db4a774791828.tar.gz fsf-binutils-gdb-1f08d324601ef7fd4cce3cff8f8db4a774791828.tar.bz2 |
[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<const gdb_byte>
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 <pedro@palves.net>
Diffstat (limited to 'gdb/target.h')
-rw-r--r-- | gdb/target.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/gdb/target.h b/gdb/target.h index 6ae400e..0cea955 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -39,6 +39,10 @@ struct expression; struct dcache_struct; struct inferior; +/* Define const gdb_byte using one identifier, to make it easy for + make-target-delegates.py to parse. */ +typedef const gdb_byte const_gdb_byte; + #include "infrun.h" /* For enum exec_direction_kind. */ #include "breakpoint.h" /* For enum bptype. */ #include "gdbsupport/scoped_restore.h" @@ -679,8 +683,8 @@ struct target_ops inferior *inf) TARGET_DEFAULT_RETURN (NULL); /* See target_thread_info_to_thread_handle. */ - virtual gdb::byte_vector thread_info_to_thread_handle (struct thread_info *) - TARGET_DEFAULT_RETURN (gdb::byte_vector ()); + virtual gdb::array_view<const_gdb_byte> thread_info_to_thread_handle (struct thread_info *) + TARGET_DEFAULT_RETURN (gdb::array_view<const gdb_byte> ()); virtual void stop (ptid_t) TARGET_DEFAULT_IGNORE (); virtual void interrupt () @@ -1924,7 +1928,7 @@ extern struct thread_info *target_thread_handle_to_thread_info /* Given a thread, return the thread handle, a target-specific sequence of bytes which serves as a thread identifier within the program being debugged. */ -extern gdb::byte_vector target_thread_info_to_thread_handle +extern gdb::array_view<const gdb_byte> target_thread_info_to_thread_handle (struct thread_info *); /* Attempts to find the pathname of the executable file |