1 /* Target-dependent code the amdgcn architecture.
3 Copyright (C) 2019-2020 Free Software Foundation, Inc.
4 Copyright (C) 2019-2020 Advanced Micro Devices, Inc. All rights reserved.
6 This file is part of GDB.
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>. */
24 #include <gdbsupport/gdb_unique_ptr.h>
26 #include <unordered_map>
28 #include <amd-dbgapi.h>
30 /* Provide std::unordered_map::Hash for amd_dbgapi_register_id_t. */
31 struct register_id_hash
34 operator() (const amd_dbgapi_register_id_t
®ister_id
) const
36 return std::hash
<decltype (register_id
.handle
)> () (register_id
.handle
);
40 /* Provide std::unordered_map::Equal for amd_dbgapi_register_id_t. */
41 struct register_id_equal_to
44 operator() (const amd_dbgapi_register_id_t
&lhs
,
45 const amd_dbgapi_register_id_t
&rhs
) const
47 return std::equal_to
<decltype (lhs
.handle
)> () (lhs
.handle
, rhs
.handle
);
51 /* amdgcn architecture specific information. */
54 /* This architecture's breakpoint instruction. */
55 gdb::unique_xmalloc_ptr
<gdb_byte
> breakpoint_instruction_bytes
;
56 size_t breakpoint_instruction_size
;
58 /* A vector of register_ids indexed by their equivalent gdb regnum. */
59 std::vector
<amd_dbgapi_register_id_t
> register_ids
;
60 /* A vector of register names indexed by their equivalent gdb regnum. */
61 std::vector
<std::string
> register_names
;
62 /* A map of gdb regnums keyed by they equivalent register_id. */
63 std::unordered_map
<amd_dbgapi_register_id_t
, int, register_id_hash
,
66 /* A map of register_class_ids keyed by their name. */
67 std::unordered_map
<std::string
, amd_dbgapi_register_class_id_t
>
69 /* A cache of vector types. */
70 std::unordered_map
<std::string
, struct type
*> vector_type_map
;
73 #endif /* amdgcn-rocm-tdep.h */