This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: review request: implementing DW_AT_endianity
- From: Peeter Joot <peeter dot joot at lzlabs dot com>
- To: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Fri, 6 Oct 2017 21:18:39 +0000
- Subject: Re: review request: implementing DW_AT_endianity
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=peeter dot joot at lzlabs dot com;
- References: <VI1PR0501MB28618180080787DD22117A459C710@VI1PR0501MB2861.eurprd05.prod.outlook.com>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
It looks like any talk of contribution (and perhaps review) is premature. My initial test only had a big-endian structure, and the one I wrote describing what I wanted to address doesn't work (which I noticed only after sending my review request email). The big-endian tagged structure does show up properly, but what I have done messes up the display of any little endian integers. It appears that I end up setting my new big-endian flag inappropriately:
Breakpoint 1, print_scalar_formatted (valaddr=0x1e25260 "\003", type=0x1ce2670, options=0x7ffe20ac7490, size=0, stream=0x1c95a40)
at ../../binutils-gdb/gdb/printcmd.c:355
355 struct gdbarch *gdbarch = get_type_arch (type);
(gdb) p *type->main_type
$1 = {code = TYPE_CODE_INT, flag_unsigned = 0, flag_nosign = 0, flag_stub = 0, flag_target_stub = 0, flag_static = 0,
flag_prototyped = 0, flag_incomplete = 0, flag_varargs = 0, flag_vector = 0, flag_stub_supported = 0, flag_gnu_ifunc = 0,
flag_fixed_instance = 0, flag_objfile_owned = 1, flag_endianity_big = 1, flag_endianity_little = 0, flag_declared_class = 0,
flag_flag_enum = 0, type_specific_field = TYPE_SPECIFIC_NONE, nfields = 0, name = 0x1caacbc "int", tag_name = 0x0, owner = {
objfile = 0x1c98620, gdbarch = 0x1c98620}, target_type = 0x0, flds_bnds = {fields = 0x0, bounds = 0x0}, type_specific = {
cplus_stuff = 0x0, gnat_stuff = 0x0, floatformat = 0x0, func_stuff = 0x0, self_type = 0x0}, dyn_prop_list = 0x0}
This is when I'm printing a native endian integer, so do not want to have flag_endianity_big set.
I'm guessing that main_type is not the place for this flag, but it has to be in struct type instead. Is that guess on the right track?
Peeter