On 6/2/22 20:35, Tom de Vries wrote: > Subject: > Re: [PATCH][gdb] Fix warning in foreach_arch selftests > From: > Tom de Vries > Date: > 6/2/22, 20:35 > > To: > Simon Marchi , Pedro Alves , > gdb-patches@sourceware.org > > > On 6/2/22 19:44, Simon Marchi wrote: >> On 6/2/22 11:44, Tom de Vries via Gdb-patches wrote: >>> On 6/1/22 21:08, Simon Marchi wrote: >>>> Hi Tom, >>>> >>>> This introduces some failures for me: >>>> >>>> Running selftest print_one_insn::A6.^M >>>> Self test failed: Cannot access memory at address 0x0^M >>> >>> Hi Simon, >>> >>> sorry for not catching this, I forgot to test with >>> --enable-targets=all, I'll try to fix the default in my build scripts. >>> >>> I've done a new version of the existing patch (so it applies once the >>> old one is reverted). >>> >>> Mainly because I realized that there's an easier way to handle the >>> osabi none setting: >>> ... >>> @@ -68,6 +68,7 @@ foreach_arch_test_generator (const std::string &name, >>>             { >>>               struct gdbarch_info info; >>>               info.bfd_arch_info = bfd_scan_arch (arch); >>> +            info.osabi = GDB_OSABI_NONE; >>>               struct gdbarch *gdbarch = gdbarch_find_by_info (info); >>>               SELF_CHECK (gdbarch != NULL); >>>               function (gdbarch); >>> ... >>> >>> Currently regression testing, but at least fixes the ARC regression. >> >> It fixes the gdb.gdb/unittest.exp failure, but introduces: >> >> FAIL: gdb.arch/amd64-osabi.exp: arch=i386:x86-64: print sizeof (void*) >> FAIL: gdb.arch/amd64-osabi.exp: arch=i386:x86-64: print sizeof (long >> double) >> FAIL: gdb.arch/amd64-osabi.exp: arch=i386:x64-32: print sizeof (long >> double) > > Ack, I also encountered that during testing, that was a thinko in the > refactoring of gdbarch_init_osabi, now fixed and fully tested. > I've committed this version. I ended up doing this slightly different: ... const char *arch = gdbarch_bfd_arch_info (gdbarch)->printable_name; ... struct gdbarch_info info; info.bfd_arch_info = bfd_scan_arch (arch); info.osabi = it; ... and used instead: ... struct gdbarch_info info; info.bfd_arch_info = gdbarch_bfd_arch_info (gdbarch); ... info.osabi = it; ... Thanks, - Tom