From cdd238daf949385bd6ef188e24b40d9fcb83a0e8 Mon Sep 17 00:00:00 2001 From: Yao Qi Date: Wed, 24 May 2017 22:15:23 +0100 Subject: [PATCH] Use XCNEW gdbarch_tdep This patch uses XCNEW gdbarch_tdep instead of XNEW. gdb: 2017-05-24 Yao Qi * alpha-tdep.c (alpha_gdbarch_init): Use XCNEW instead of XNEW. * avr-tdep.c (avr_gdbarch_init): Likewise. * bfin-tdep.c (bfin_gdbarch_init): Likewise. * cris-tdep.c (cris_gdbarch_init): Likewise. * ft32-tdep.c (ft32_gdbarch_init): Likewise. * lm32-tdep.c (lm32_gdbarch_init): Likewise. * m32r-tdep.c (m32r_gdbarch_init): Likewise. * m68hc11-tdep.c (m68hc11_gdbarch_init): Likewise. * mep-tdep.c (mep_gdbarch_init): Likewise. * microblaze-tdep.c (microblaze_gdbarch_init): Likewise. * mips-tdep.c (mips_gdbarch_init): Likewise. * mn10300-tdep.c (mn10300_gdbarch_init): Likewise. * moxie-tdep.c (moxie_gdbarch_init): Likewise. * msp430-tdep.c (msp430_gdbarch_init): Likewise. * sh64-tdep.c (sh64_gdbarch_init): Likewise. * v850-tdep.c (v850_gdbarch_init): Likewise. --- gdb/ChangeLog | 19 +++++++++++++++++++ gdb/alpha-tdep.c | 2 +- gdb/avr-tdep.c | 2 +- gdb/bfin-tdep.c | 2 +- gdb/cris-tdep.c | 2 +- gdb/ft32-tdep.c | 2 +- gdb/lm32-tdep.c | 2 +- gdb/m32r-tdep.c | 2 +- gdb/m68hc11-tdep.c | 2 +- gdb/mep-tdep.c | 2 +- gdb/microblaze-tdep.c | 2 +- gdb/mips-tdep.c | 2 +- gdb/mn10300-tdep.c | 2 +- gdb/moxie-tdep.c | 2 +- gdb/msp430-tdep.c | 2 +- gdb/sh64-tdep.c | 2 +- gdb/v850-tdep.c | 2 +- 17 files changed, 35 insertions(+), 16 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e5222c615ec..0f076f032f9 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,22 @@ +2017-05-24 Yao Qi + + * alpha-tdep.c (alpha_gdbarch_init): Use XCNEW instead of XNEW. + * avr-tdep.c (avr_gdbarch_init): Likewise. + * bfin-tdep.c (bfin_gdbarch_init): Likewise. + * cris-tdep.c (cris_gdbarch_init): Likewise. + * ft32-tdep.c (ft32_gdbarch_init): Likewise. + * lm32-tdep.c (lm32_gdbarch_init): Likewise. + * m32r-tdep.c (m32r_gdbarch_init): Likewise. + * m68hc11-tdep.c (m68hc11_gdbarch_init): Likewise. + * mep-tdep.c (mep_gdbarch_init): Likewise. + * microblaze-tdep.c (microblaze_gdbarch_init): Likewise. + * mips-tdep.c (mips_gdbarch_init): Likewise. + * mn10300-tdep.c (mn10300_gdbarch_init): Likewise. + * moxie-tdep.c (moxie_gdbarch_init): Likewise. + * msp430-tdep.c (msp430_gdbarch_init): Likewise. + * sh64-tdep.c (sh64_gdbarch_init): Likewise. + * v850-tdep.c (v850_gdbarch_init): Likewise. + 2017-05-24 Yao Qi * selftest-arch.c (tests_with_arch): Call registers_changed diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c index b1bc6a1e049..672e578ff1d 100644 --- a/gdb/alpha-tdep.c +++ b/gdb/alpha-tdep.c @@ -1748,7 +1748,7 @@ alpha_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) if (arches != NULL) return arches->gdbarch; - tdep = XNEW (struct gdbarch_tdep); + tdep = XCNEW (struct gdbarch_tdep); gdbarch = gdbarch_alloc (&info, tdep); /* Lowest text address. This is used by heuristic_proc_start() diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c index 3d041c619f5..7867c2fabeb 100644 --- a/gdb/avr-tdep.c +++ b/gdb/avr-tdep.c @@ -1453,7 +1453,7 @@ avr_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) } /* None found, create a new architecture from the information provided. */ - tdep = XNEW (struct gdbarch_tdep); + tdep = XCNEW (struct gdbarch_tdep); gdbarch = gdbarch_alloc (&info, tdep); tdep->call_length = call_length; diff --git a/gdb/bfin-tdep.c b/gdb/bfin-tdep.c index bfb5d57a4c3..aa9efebe2fb 100644 --- a/gdb/bfin-tdep.c +++ b/gdb/bfin-tdep.c @@ -811,7 +811,7 @@ bfin_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) return arches->gdbarch; } - tdep = XNEW (struct gdbarch_tdep); + tdep = XCNEW (struct gdbarch_tdep); gdbarch = gdbarch_alloc (&info, tdep); tdep->bfin_abi = abi; diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c index e554e241908..85a12e25b17 100644 --- a/gdb/cris-tdep.c +++ b/gdb/cris-tdep.c @@ -4008,7 +4008,7 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) } /* No matching architecture was found. Create a new one. */ - tdep = XNEW (struct gdbarch_tdep); + tdep = XCNEW (struct gdbarch_tdep); info.byte_order = BFD_ENDIAN_LITTLE; gdbarch = gdbarch_alloc (&info, tdep); diff --git a/gdb/ft32-tdep.c b/gdb/ft32-tdep.c index 966a593a34c..5a7aea1bd2d 100644 --- a/gdb/ft32-tdep.c +++ b/gdb/ft32-tdep.c @@ -597,7 +597,7 @@ ft32_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) return arches->gdbarch; /* Allocate space for the new architecture. */ - tdep = XNEW (struct gdbarch_tdep); + tdep = XCNEW (struct gdbarch_tdep); gdbarch = gdbarch_alloc (&info, tdep); /* Create a type for PC. We can't use builtin types here, as they may not diff --git a/gdb/lm32-tdep.c b/gdb/lm32-tdep.c index 84ece3e93f0..1ca6c08bf2d 100644 --- a/gdb/lm32-tdep.c +++ b/gdb/lm32-tdep.c @@ -521,7 +521,7 @@ lm32_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) return arches->gdbarch; /* None found, create a new architecture from the information provided. */ - tdep = XNEW (struct gdbarch_tdep); + tdep = XCNEW (struct gdbarch_tdep); gdbarch = gdbarch_alloc (&info, tdep); /* Type sizes. */ diff --git a/gdb/m32r-tdep.c b/gdb/m32r-tdep.c index 2d14cede7eb..28017b67cac 100644 --- a/gdb/m32r-tdep.c +++ b/gdb/m32r-tdep.c @@ -908,7 +908,7 @@ m32r_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) return arches->gdbarch; /* Allocate space for the new architecture. */ - tdep = XNEW (struct gdbarch_tdep); + tdep = XCNEW (struct gdbarch_tdep); gdbarch = gdbarch_alloc (&info, tdep); set_gdbarch_wchar_bit (gdbarch, 16); diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c index b19ddf7b71d..b0b97b2de40 100644 --- a/gdb/m68hc11-tdep.c +++ b/gdb/m68hc11-tdep.c @@ -1434,7 +1434,7 @@ m68hc11_gdbarch_init (struct gdbarch_info info, } /* Need a new architecture. Fill in a target specific vector. */ - tdep = XNEW (struct gdbarch_tdep); + tdep = XCNEW (struct gdbarch_tdep); gdbarch = gdbarch_alloc (&info, tdep); tdep->elf_flags = elf_flags; diff --git a/gdb/mep-tdep.c b/gdb/mep-tdep.c index 5a45d6e8a84..7e9b855fca0 100644 --- a/gdb/mep-tdep.c +++ b/gdb/mep-tdep.c @@ -2437,7 +2437,7 @@ mep_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) if (gdbarch_tdep (arches->gdbarch)->me_module == me_module) return arches->gdbarch; - tdep = XNEW (struct gdbarch_tdep); + tdep = XCNEW (struct gdbarch_tdep); gdbarch = gdbarch_alloc (&info, tdep); /* Get a CGEN CPU descriptor for this architecture. */ diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c index 86cb090c40f..55c77151f8f 100644 --- a/gdb/microblaze-tdep.c +++ b/gdb/microblaze-tdep.c @@ -703,7 +703,7 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) } /* Allocate space for the new architecture. */ - tdep = XNEW (struct gdbarch_tdep); + tdep = XCNEW (struct gdbarch_tdep); gdbarch = gdbarch_alloc (&info, tdep); set_gdbarch_long_double_bit (gdbarch, 128); diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index 2f5a90be46b..82f91ba2cd9 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -8492,7 +8492,7 @@ mips_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) } /* Need a new architecture. Fill in a target specific vector. */ - tdep = XNEW (struct gdbarch_tdep); + tdep = XCNEW (struct gdbarch_tdep); gdbarch = gdbarch_alloc (&info, tdep); tdep->elf_flags = elf_flags; tdep->mips64_transfers_32bit_regs_p = mips64_transfers_32bit_regs_p; diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c index 1e2526fa201..f8dd762cf0a 100644 --- a/gdb/mn10300-tdep.c +++ b/gdb/mn10300-tdep.c @@ -1395,7 +1395,7 @@ mn10300_gdbarch_init (struct gdbarch_info info, if (arches != NULL) return arches->gdbarch; - tdep = XNEW (struct gdbarch_tdep); + tdep = XCNEW (struct gdbarch_tdep); gdbarch = gdbarch_alloc (&info, tdep); switch (info.bfd_arch_info->mach) diff --git a/gdb/moxie-tdep.c b/gdb/moxie-tdep.c index 91248cc75ca..4cd3bcd18f3 100644 --- a/gdb/moxie-tdep.c +++ b/gdb/moxie-tdep.c @@ -1107,7 +1107,7 @@ moxie_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) return arches->gdbarch; /* Allocate space for the new architecture. */ - tdep = XNEW (struct gdbarch_tdep); + tdep = XCNEW (struct gdbarch_tdep); gdbarch = gdbarch_alloc (&info, tdep); set_gdbarch_wchar_bit (gdbarch, 32); diff --git a/gdb/msp430-tdep.c b/gdb/msp430-tdep.c index d730e1bec45..7debe250a32 100644 --- a/gdb/msp430-tdep.c +++ b/gdb/msp430-tdep.c @@ -944,7 +944,7 @@ msp430_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* None found, create a new architecture from the information provided. */ - tdep = XNEW (struct gdbarch_tdep); + tdep = XCNEW (struct gdbarch_tdep); gdbarch = gdbarch_alloc (&info, tdep); tdep->elf_flags = elf_flags; tdep->isa = isa; diff --git a/gdb/sh64-tdep.c b/gdb/sh64-tdep.c index 581b57fd9f0..06ae04e9da1 100644 --- a/gdb/sh64-tdep.c +++ b/gdb/sh64-tdep.c @@ -2371,7 +2371,7 @@ sh64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* None found, create a new architecture from the information provided. */ - tdep = XNEW (struct gdbarch_tdep); + tdep = XCNEW (struct gdbarch_tdep); gdbarch = gdbarch_alloc (&info, tdep); /* Determine the ABI */ diff --git a/gdb/v850-tdep.c b/gdb/v850-tdep.c index 087026af69d..30cd35be8ab 100644 --- a/gdb/v850-tdep.c +++ b/gdb/v850-tdep.c @@ -1396,7 +1396,7 @@ v850_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) return arches->gdbarch; } - tdep = XNEW (struct gdbarch_tdep); + tdep = XCNEW (struct gdbarch_tdep); tdep->e_flags = e_flags; tdep->e_machine = e_machine; -- 2.30.2