summaryrefslogtreecommitdiff
path: root/gdb/features/rx.c
Commit message (Collapse)AuthorAgeFilesLines
* gdb: add an option flag to 'maint print c-tdesc'Andrew Burgess2020-11-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GDB has two approaches to generating the target descriptions found in gdb/features/, the whole description approach, where the XML file contains a complete target description which is then used to generate a single C file that builds that target description. Or, the split feature approach, where the XML files contain a single target feature, each feature results in a single C file to create that one feature, and then a manually written C file is used to build a complete target description from individual features. There's a Makefile, gdb/features/Makefile, which is responsible for managing the regeneration of the C files from the XML files. However, some of the logic that selects between the whole description approach, or the split feature approach, is actually hard-coded into GDB, inside target-descriptions.c:maint_print_c_tdesc_cmd we check the path to the incoming XML file and use this to choose which type of C file we should generate. This commit removes this hard coding from GDB, and makes the Makefile entirely responsible for choosing the approach. This makes sense as the Makefile already has the XML files partitioned based on which approach they should use. In order to allow this change the 'maint print c-tdesc' command is given a new command option '-single-feature', which tells GDB which type of C file should be created. The makefile now supplies this flag to GDB. This did reveal a bug in features/Makefile, the rx.xml file was in the wrong list, this didn't matter previously as the actual choice of which approach to use was done in GDB. Now the Makefile decides, so placing each XML file in the correct list is critical. Tested this by doing 'make GDB=/path/to/gdb clean-cfiles cfiles' to regenerate all the C files from their XML source. There are no changes after this commit. gdb/ChangeLog: * features/Makefile (XMLTOC): Add rx.xml. (FEATURE_XMLFILES): Remove rx.xml. (FEATURE_CFILES rule): Pass '-single-feature' flag. * features/rx.c: Regenerate. * features/rx.xml: Wrap in `target` tags, and reindent. * target-descriptions.c (struct maint_print_c_tdesc_options): New structure. (maint_print_c_tdesc_opt_def): New typedef. (maint_print_c_tdesc_opt_defs): New static global. (make_maint_print_c_tdesc_options_def_group): New function. (maint_print_c_tdesc_cmd): Make use of command line flags, only print single feature C file for target descriptions containing a single feature. (maint_print_c_tdesc_cmd_completer): New function. (_initialize_target_descriptions): Update call to register command completer, and include command line flag in help text. gdb/doc/ChangeLog: * gdb.texinfo (Maintenance Commands): Update description of 'maint print c-tdesc'.
* gdb: Have allocate_target_description return a unique_ptrAndrew Burgess2020-10-081-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update allocate_target_description to return a target_desc_up, a specialisation of unique_ptr. This commit does not attempt to make use of the unique_ptr in the best possible way, in almost all cases we immediately release the pointer from within the unique_ptr and then continue as before. There are a few places where it was easy to handle the unique_ptr, and in these cases I've done that. Everything under gdb/features/* is auto-regenerated. There should be no user visible changes after this commit. gdb/ChangeLog: * arch/aarch32.c (aarch32_create_target_description): Release unique_ptr returned from allocate_target_description. * arch/aarch64.c (aarch64_create_target_description): Likewise. * arch/amd64.c (amd64_create_target_description): Likewise. * arch/arc.c (arc_create_target_description): Likewise. * arch/arm.c (arm_create_target_description): Likewise. * arch/i386.c (i386_create_target_description): Likewise. * arch/riscv.c (riscv_create_target_description): Update return type. Handle allocate_target_description returning a unique_ptr. (riscv_lookup_target_description): Update to handle unique_ptr. * arch/tic6x.c (tic6x_create_target_description): Release unique_ptr returned from allocate_target_description. * features/microblaze-with-stack-protect.c: Regenerate. * features/microblaze.c: Regenerate. * features/mips-dsp-linux.c: Regenerate. * features/mips-linux.c: Regenerate. * features/mips64-dsp-linux.c: Regenerate. * features/mips64-linux.c: Regenerate. * features/nds32.c: Regenerate. * features/nios2.c: Regenerate. * features/or1k.c: Regenerate. * features/rs6000/powerpc-32.c: Regenerate. * features/rs6000/powerpc-32l.c: Regenerate. * features/rs6000/powerpc-403.c: Regenerate. * features/rs6000/powerpc-403gc.c: Regenerate. * features/rs6000/powerpc-405.c: Regenerate. * features/rs6000/powerpc-505.c: Regenerate. * features/rs6000/powerpc-601.c: Regenerate. * features/rs6000/powerpc-602.c: Regenerate. * features/rs6000/powerpc-603.c: Regenerate. * features/rs6000/powerpc-604.c: Regenerate. * features/rs6000/powerpc-64.c: Regenerate. * features/rs6000/powerpc-64l.c: Regenerate. * features/rs6000/powerpc-7400.c: Regenerate. * features/rs6000/powerpc-750.c: Regenerate. * features/rs6000/powerpc-860.c: Regenerate. * features/rs6000/powerpc-altivec32.c: Regenerate. * features/rs6000/powerpc-altivec32l.c: Regenerate. * features/rs6000/powerpc-altivec64.c: Regenerate. * features/rs6000/powerpc-altivec64l.c: Regenerate. * features/rs6000/powerpc-e500.c: Regenerate. * features/rs6000/powerpc-e500l.c: Regenerate. * features/rs6000/powerpc-isa205-32l.c: Regenerate. * features/rs6000/powerpc-isa205-64l.c: Regenerate. * features/rs6000/powerpc-isa205-altivec32l.c: Regenerate. * features/rs6000/powerpc-isa205-altivec64l.c: Regenerate. * features/rs6000/powerpc-isa205-ppr-dscr-vsx32l.c: Regenerate. * features/rs6000/powerpc-isa205-ppr-dscr-vsx64l.c: Regenerate. * features/rs6000/powerpc-isa205-vsx32l.c: Regenerate. * features/rs6000/powerpc-isa205-vsx64l.c: Regenerate. * features/rs6000/powerpc-isa207-htm-vsx32l.c: Regenerate. * features/rs6000/powerpc-isa207-htm-vsx64l.c: Regenerate. * features/rs6000/powerpc-isa207-vsx32l.c: Regenerate. * features/rs6000/powerpc-isa207-vsx64l.c: Regenerate. * features/rs6000/powerpc-vsx32.c: Regenerate. * features/rs6000/powerpc-vsx32l.c: Regenerate. * features/rs6000/powerpc-vsx64.c: Regenerate. * features/rs6000/powerpc-vsx64l.c: Regenerate. * features/rs6000/rs6000.c: Regenerate. * features/rx.c: Regenerate. * features/s390-gs-linux64.c: Regenerate. * features/s390-linux32.c: Regenerate. * features/s390-linux32v1.c: Regenerate. * features/s390-linux32v2.c: Regenerate. * features/s390-linux64.c: Regenerate. * features/s390-linux64v1.c: Regenerate. * features/s390-linux64v2.c: Regenerate. * features/s390-te-linux64.c: Regenerate. * features/s390-tevx-linux64.c: Regenerate. * features/s390-vx-linux64.c: Regenerate. * features/s390x-gs-linux64.c: Regenerate. * features/s390x-linux64.c: Regenerate. * features/s390x-linux64v1.c: Regenerate. * features/s390x-linux64v2.c: Regenerate. * features/s390x-te-linux64.c: Regenerate. * features/s390x-tevx-linux64.c: Regenerate. * features/s390x-vx-linux64.c: Regenerate. * mips-tdep.c (_initialize_mips_tdep): Release unique_ptr returned from allocate_target_description. * target-descriptions.c (allocate_target_description): Update return type. (print_c_tdesc::visit_pre): Release unique_ptr returned from allocate_target_description. gdbserver/ChangeLog: * linux-low.cc (linux_process_target::handle_extended_wait): Release the unique_ptr returned from allocate_target_description. * linux-riscv-low.cc (riscv_target::low_arch_setup): Likewise. * linux-x86-low.cc (tdesc_amd64_linux_no_xml): Change type. (tdesc_i386_linux_no_xml): Change type. (x86_linux_read_description): Borrow pointer from unique_ptr object. (x86_target::get_ipa_tdesc_idx): Likewise. (initialize_low_arch): Likewise. * tdesc.cc (allocate_target_description): Update return type. gdbsupport/ChangeLog: * tdesc.h (allocate_target_description): Update return type.
* Convert the RX target to make use of target descriptions.Yoshinori Sato2019-08-251-0/+80
gdb/ChangeLog 2019-08-25 Yoshinori Sato <ysato@users.sourceforge.jp> * gdb/rx-tdep.c (rx_register_names): New. (rx_register_name): Delete. (rx_psw_type): Delete. (rx_fpsw_type): Delete. (rx_register_type): Delete. (rx_gdbarch_init): Convert target-descriptions. (_initialize_rx_tdep): Add initialize_tdesc_rx. * gdb/features/Makefile: Add rx.xml. * gdb/features/rx.xml: New. * gdb/features/rx.c: Generated. * gdb/NEWS: Mention target description support. gdb/doc/ChangeLog: 2019-08-25 Yoshinori Sato <ysato@users.sourceforge.jp> * gdb.texinfo (Standard Target Features): Add RX Features sub-section.