aboutsummaryrefslogtreecommitdiff
path: root/gprof
diff options
context:
space:
mode:
authorYao Qi <yao.qi@linaro.org>2017-05-19 21:31:24 +0100
committerYao Qi <yao.qi@linaro.org>2017-06-20 11:34:11 +0100
commita8c099d1b6834606567cf32446a9e3b384a73209 (patch)
tree3fbbddc24ab8e1f43a4063cbd0772e76495f55fc /gprof
parent7b162e155c0c39cad83d7542a61918114d130407 (diff)
downloadgdb-a8c099d1b6834606567cf32446a9e3b384a73209.zip
gdb-a8c099d1b6834606567cf32446a9e3b384a73209.tar.gz
gdb-a8c099d1b6834606567cf32446a9e3b384a73209.tar.bz2
Generate c for feature instead of tdesc
This patch changes Makefile and command "maint print c-files" so that GDB can print c files for features instead target description. Previously, we feed GDB a target description xml file, which generate c files including multiple features. With this patch, in Makefile, we wrap each feature xml file, and create a temp target description which include only one feature. Then, adjust the target description printer for them, and print a c function for each given feature, so that we can use these c functions later to create target description in a flexible way. Before GDB prints c-tdesc, we need to set tdesc. However, this involves some validations in each gdbarch on these target descriptions, and this make troubles to generate c file for each target feature when we feed GDB a target description only including an optional feature (without some mandatory feature), GDB just reject it, and don't print the c file. What we need here is to translate xml file to object target_desc, and translate the object target_desc to c file. We don't have to involve gdbarch validation in this process at all, so I modify command "maint print c-tdesc" to have an optional argument which is the filename of xml target description. If the file name is provided, parse the xml target description, create target_desc object, and print c file from it. gdb: 2017-05-22 Yao Qi <yao.qi@linaro.org> * features/Makefile (FEATURE_XMLFILES): New. (FEATURE_CFILES): New. New rules. * features/i386/32bit-avx.c: Generated. * features/i386/32bit-avx512.c: Generated. * features/i386/32bit-core.c: Generated. * features/i386/32bit-linux.c: Generated. * features/i386/32bit-mpx.c: Generated. * features/i386/32bit-pkeys.c: Generated. * features/i386/32bit-sse.c: Generated. * target-descriptions.c: Include algorithm. (tdesc_element_visitor): Add method visit_end. (print_c_tdesc): Implement visit_end. (print_c_tdesc:: m_filename_after_features): Move it to protected. (print_c_feature): New class. (maint_print_c_tdesc_cmd): Use print_c_feature if XML file name starts with "i386/32bit-". gdb/doc: 2017-06-08 Yao Qi <yao.qi@linaro.org> * gdb.texinfo (Maintenance Commands): Document optional argument of "maint print c-tdesc".
Diffstat (limited to 'gprof')
0 files changed, 0 insertions, 0 deletions