gdb: change xml_fetch_another a function_view
authorSimon Marchi <simon.marchi@polymtl.ca>
Mon, 14 Sep 2020 15:12:55 +0000 (11:12 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Mon, 14 Sep 2020 15:30:58 +0000 (11:30 -0400)
commit8400a90d19c5c53f7100421c688fb896789048b9
treedbf3aff829ab551c14a040ac7717e187d7417300
parentb1766e7ce88647c8002928aeb8a9f04048c494ae
gdb: change xml_fetch_another a function_view

The xml_fetch_another is currently a plain function pointer type, with a
`void *` baton parameter.  To improve type-safety, change this to a
function_view.  Any required data is captured by a lambda at the call
site.

gdb/ChangeLog:

* xml-support.h (xml_fetch_another): Change type to be a
function_view.
(xml_process_xincludes): Remove baton parameter.
(xml_fetch_content_from_file): Change baton parameter to
dirname.
* xml-support.c (struct xinclude_parsing_data)
<xinclude_parsing_data>: Remove baton parameter.
<fetcher_baton>: Remove.
(xinclude_start_include): Adjust.
(xml_process_xincludes): Adjust.
(xml_fetch_content_from_file): Replace baton parameter with
dirname.
* xml-syscall.c (syscall_parse_xml): Remove baton parameter.
(xml_init_syscalls_info): Use a lambda.
* xml-tdesc.c (tdesc_parse_xml): Remove baton parameter.
(file_read_description_xml): Use a lambda.
(fetch_available_features_from_target): Change baton parameter
to target_ops.
(target_read_description_xml): Use a lambda.
(target_fetch_description_xml): Use a lambda.
(string_read_description_xml): Update.

Change-Id: I7ba4b8f5e97fc6a952c6c20ccc3be92a06cc2bd2
gdb/ChangeLog
gdb/xml-support.c
gdb/xml-support.h
gdb/xml-syscall.c
gdb/xml-tdesc.c