mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-08-26 07:19:16 +08:00
gdb: remove gdbarch_info_init
While reviewing another patch, I realized that gdbarch_info_init could easily be removed in favor of initializing gdbarch_info fields directly in the struct declaration. The only odd part is the union. I don't know if it's actually important for it to be zero-initialized, but I presume it is. I added a constructor to gdbarch_info to take care of that. A proper solution would be to use std::variant. Or, these could also be separate fields, the little extra space required wouldn't matter. gdb/ChangeLog: * gdbarch.sh (struct gdbarch_info): Initialize fields, add constructor. * gdbarch.h: Re-generate. * arch-utils.h (gdbarch_info_init): Remove, delete all usages. * arch-utils.c (gdbarch_info_init): Remove. Change-Id: I7502e08fe0f278d84eef1667a072e8a97bda5ab5
This commit is contained in:
@ -558,7 +558,6 @@ rs6000_nat_target::create_inferior (const char *exec_file,
|
||||
enum bfd_architecture arch;
|
||||
unsigned long mach;
|
||||
bfd abfd;
|
||||
struct gdbarch_info info;
|
||||
|
||||
inf_ptrace_target::create_inferior (exec_file, allargs, env, from_tty);
|
||||
|
||||
@ -593,7 +592,7 @@ rs6000_nat_target::create_inferior (const char *exec_file,
|
||||
|
||||
bfd_default_set_arch_mach (&abfd, arch, mach);
|
||||
|
||||
gdbarch_info_init (&info);
|
||||
gdbarch_info info;
|
||||
info.bfd_arch_info = bfd_get_arch_info (&abfd);
|
||||
info.abfd = current_program_space->exec_bfd ();
|
||||
|
||||
|
Reference in New Issue
Block a user