[2/5] gdb: make use of set_tdesc_osabi overload in features/ files
Checks
Context |
Check |
Description |
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 |
success
|
Build passed
|
linaro-tcwg-bot/tcwg_gdb_build--master-arm |
success
|
Build passed
|
linaro-tcwg-bot/tcwg_gdb_check--master-arm |
success
|
Test passed
|
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 |
success
|
Test passed
|
Commit Message
There are two versions of the set_tdesc_osabi function in GDB:
void
set_tdesc_osabi (struct target_desc *target_desc, const char *name)
{
set_tdesc_osabi (target_desc, osabi_from_tdesc_string (name));
}
void
set_tdesc_osabi (struct target_desc *target_desc, enum gdb_osabi osabi)
{
target_desc->osabi = osabi;
}
In the gdb/features/ files we call the second of these functions, like
this:
set_tdesc_osabi (result.get (), osabi_from_tdesc_string ("GNU/Linux"));
This can be replaced with a call to the first set_tdesc_osabi
function, so lets do that. I think that this makes the features/ code
slightly simpler and easier to understand.
There should be no user visible changes after this commit.
Approved-By: Tom Tromey <tom@tromey.com>
---
gdb/features/mips-dsp-linux.c | 2 +-
gdb/features/mips-linux.c | 2 +-
gdb/features/or1k-linux.c | 2 +-
gdb/features/sparc/sparc32-solaris.c | 2 +-
gdb/features/sparc/sparc64-solaris.c | 2 +-
gdb/target-descriptions.c | 2 +-
6 files changed, 6 insertions(+), 6 deletions(-)
@@ -11,7 +11,7 @@ initialize_tdesc_mips_dsp_linux (void)
target_desc_up result = allocate_target_description ();
set_tdesc_architecture (result.get (), bfd_scan_arch ("mips"));
- set_tdesc_osabi (result.get (), osabi_from_tdesc_string ("GNU/Linux"));
+ set_tdesc_osabi (result.get (), "GNU/Linux");
struct tdesc_feature *feature;
@@ -11,7 +11,7 @@ initialize_tdesc_mips_linux (void)
target_desc_up result = allocate_target_description ();
set_tdesc_architecture (result.get (), bfd_scan_arch ("mips"));
- set_tdesc_osabi (result.get (), osabi_from_tdesc_string ("GNU/Linux"));
+ set_tdesc_osabi (result.get (), "GNU/Linux");
struct tdesc_feature *feature;
@@ -11,7 +11,7 @@ initialize_tdesc_or1k_linux (void)
target_desc_up result = allocate_target_description ();
set_tdesc_architecture (result.get (), bfd_scan_arch ("or1k"));
- set_tdesc_osabi (result.get (), osabi_from_tdesc_string ("GNU/Linux"));
+ set_tdesc_osabi (result.get (), "GNU/Linux");
struct tdesc_feature *feature;
@@ -11,7 +11,7 @@ initialize_tdesc_sparc32_solaris (void)
target_desc_up result = allocate_target_description ();
set_tdesc_architecture (result.get (), bfd_scan_arch ("sparc"));
- set_tdesc_osabi (result.get (), osabi_from_tdesc_string ("Solaris"));
+ set_tdesc_osabi (result.get (), "Solaris");
struct tdesc_feature *feature;
@@ -11,7 +11,7 @@ initialize_tdesc_sparc64_solaris (void)
target_desc_up result = allocate_target_description ();
set_tdesc_architecture (result.get (), bfd_scan_arch ("sparc:v9"));
- set_tdesc_osabi (result.get (), osabi_from_tdesc_string ("Solaris"));
+ set_tdesc_osabi (result.get (), "Solaris");
struct tdesc_feature *feature;
@@ -1318,7 +1318,7 @@ class print_c_tdesc : public tdesc_element_visitor
&& tdesc_osabi (e) < GDB_OSABI_INVALID)
{
gdb_printf
- (" set_tdesc_osabi (result.get (), osabi_from_tdesc_string (\"%s\"));\n",
+ (" set_tdesc_osabi (result.get (), \"%s\");\n",
gdbarch_osabi_name (tdesc_osabi (e)));
gdb_printf ("\n");
}