-
-
Notifications
You must be signed in to change notification settings - Fork 373
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
librz/bin/dwarf: add xtensa register mapping (#4878)
- Loading branch information
Showing
2 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// SPDX-FileCopyrightText: 2025 Billow <[email protected]> | ||
// SPDX-License-Identifier: LGPL-3.0-only | ||
|
||
#ifndef XTENSA_DWARF_REGNUM_TABLE_H | ||
#define XTENSA_DWARF_REGNUM_TABLE_H | ||
|
||
static const char * | ||
xtensa_register_name(ut32 index) { | ||
static const char *const reg_names[] = { | ||
"a0", "sp", "a2", "a3", "a4", "a5", "a6", "a7", | ||
"a8", "a9", "a10", "a11", "a12", "a13", "a14", "a15", | ||
"fp", "argp", "b0", | ||
"f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", | ||
"f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", | ||
"acc" | ||
}; | ||
if (index >= RZ_ARRAY_SIZE(reg_names)) { | ||
return NULL; | ||
} | ||
return reg_names[index]; | ||
} | ||
|
||
#endif // XTENSA_DWARF_REGNUM_TABLE_H |