public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Martin Simmons <qqxnjvamvxwx@dyxyl.com>
To: Chris Nicol <nicolc@uleth.ca>
Cc: simark@simark.ca, gdb@sourceware.org
Subject: Re: gdb 8.3: "handler for the OSI ABI "FreeBSD" is not built into this configuration"
Date: Sat, 23 May 2020 23:17:53 +0100	[thread overview]
Message-ID: <jeh7w6b8j2.fsf@dyxyl.com> (raw)
In-Reply-To: <ea376066-41a6-3023-9ba3-bdac03157c0a@uleth.ca> (message from Chris Nicol on Sat, 23 May 2020 12:29:49 -0600)

Hi Chris,

Yes, the architecture is detected from the binary if given, otherwise it
defaults to the main architecture.

BTW, have you tried building devel/gdb from the /usr/ports tree?  That
is the normal way to get any specific tweaks that the FreeBSD project
already knows about.

I can't give you comprehensive instructions on how to debug the nested
gdb.  I think you should start by looking at the function
gdbarch_init_osabi in gdb/osabi.c to see what it does.  In summary, it
is looking in the list gdb_osabi_handler_list for something that matches
the argument named info.  It only finds a match if the osabi is the same
and it has an acceptable arch_info (the function can_run_code_for).  It
prints the warning if it doesn't find a match.

The command sequence to start debugging it is something like this:

break gdbarch_init_osabi
run

It should then stop at the breakpoint, where it is useful to do:

print info
print *info.bfd_arch_info
set $tmp=gdb_osabi_handler_list
while $tmp
print *$tmp
print *$tmp->arch_info
set $tmp=$tmp->next
end

That might be enough to find why there is no match, but otherwise you
have to repeatedly use the step command and print other things that the
code is examining.

__Martin


>>>>> On Sat, 23 May 2020 12:29:49 -0600, Chris Nicol said:
> 
> Martin,
> 
> Thanks for the follow-up. "show osabi" indicates "The current OS ABI is 
> "auto" (currently "FreeBSD"). The default OS ABI is "FreeBSD")."
> Not very informative, as "FreeBSD" seems to be what gdb is having 
> trouble with when loading. Perhaps there is some configuration parameter 
> I should be setting when I run ./configure?
> 
> I have run the nested gdb gdb llvm... as you suggest, but am not sure 
> where to go from there. What command sequence do I need to use to step 
> through osabi initialisation, then "running code for"?
> 
> If I run gdb on its own with no arguments, "show architecture" indicates 
> "sparc". If I run it and load a binary, then run "show architecture", 
> the result is "sparc:v9". But the problem seems to be with the 
> identification of the OS?
> 
> Thanks.
> 
> Chris.
> 
> 
> On 5/23/2020 11:40 AM, Martin Simmons wrote:
> > 64-bit SPARC is always at least v9.
> > 
> > What do the "show osabi" and "set osabi" commands show?
> > 
> > Can you run gdb under gdb?  I.e. (adjusting the paths as required):
> > 
> > gdb/gdb --args gdb/gdb llvm-tblgen llvm-tblgen.core
> > 
> > Then use the outer gdb to step through gdbarch_init_osabi and
> > can_run_code_for in the inner gdb to see why none of the gdbarch_info
> > objects match before it prints that warning?  You might need to
> > configure gdb with CFLAGS=-g CXXFLAGS=-g to get useful debugging info.
> > 
> > __Martin
> > 
> > 
> >>>>>> On Fri, 22 May 2020 13:35:15 -0600, Chris Nicol said:
> >>
> >> Simon,
> >>
> >> This link:
> >>
> >> https://wiki.freebsd.org/201110DevSummit?action=AttachFile&do=get&target=sparc64_status_201110DevSummit.pdf
> >>
> >> at page 4, "CPU Type" makes me suspicious that v9 does not correctly
> >> characterise my processor. In that same document, there is reference to
> >> support for "UltraSparc, UltraParc III and V9" processors, whereas the
> >> SunBlade 100 I am using is referenced as having an UltrasSparcIIe
> >> processor, which is maybe not "v9"? v9 is possibly something else, such
> >> as UltraSparc III+. There are sparc64-fbsd-nat.o, sparc64-fbsd.tdep.o ,
> >> sparc64-nat.o and sparc64-tdep.o object files in my build directory.
> >>
> >>
> >> Chris.
> >> On 5/22/2020 12:51 PM, Simon Marchi wrote:
> >>> On 2020-05-22 2:22 p.m., Chris Nicol wrote:
> >>>> Dear Simon,
> >>>>
> >>>> Thanks for your reply. I went ahead and completed the build of
> >>>> gbd-9.1, which had been the original plan. With the gdb-9.1
> >>>> executable, I re-ran it against the llvm-tblgen binary and its core
> >>>> dump, with the same result as in gdb-8.3. So this is progress of a
> >>>> sort, I suppose.
> >>>>
> >>>> Taking now the gdb-9.1 and loading gcc9 into the debugger, then
> >>>> "show architecture" yields "The target architecture is set
> >>>> automatically (currently sparc:v9)". The system I am using is based
> >>>> on the 500-MHz UltraSPARC IIe processor. So maybe this setting,
> >>>> sparc:v9, is wrong for this platform?
> >>>>
> >>>> Best wishes,
> >>>>
> >>>> Chris.
> >>>
> >>> I'm not really familiar with sparc machines... does that values sound
> >>> good to you?  Does it seem to match the machine you have?
> >>>
> >>> In any case, that seems to match the osabi registration line in
> >>> sparc64-fbsd-tdep.c:
> >>>
> >>> gdbarch_register_osabi (bfd_arch_sparc, bfd_mach_sparc_v9,
> >>> GDB_OSABI_FREEBSD, sparc64fbsd_init_abi);
> >>>
> >>> Is the file sparc64-fbsd-tdep.c being compiled?  In other words, does
> >>> the file gdb/sparc64-fbsd-tdep.o exist in your build directory?
> >>>
> >>> Simon
> >>>
> >>
> >>
> >>
> >>
> >>
> 
> 
> 
> 

  reply	other threads:[~2020-05-23 22:17 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-20 18:24 gdb-9.1 Fails to build: "invalid cast to abstract class type" Chris Nicol
2020-05-21 14:12 ` Simon Marchi
2020-05-22  3:55   ` Chris Nicol
2020-05-22  5:56     ` gdb 8.3: "handler for the OSI ABI "FreeBSD" is not built into this configuration" Chris Nicol
2020-05-22 17:36       ` Simon Marchi
2020-05-22 18:22         ` Chris Nicol
2020-05-22 18:51           ` Simon Marchi
2020-05-22 19:35             ` Chris Nicol
2020-05-23 17:40               ` Martin Simmons
2020-05-23 18:29                 ` Chris Nicol
2020-05-23 22:17                   ` Martin Simmons [this message]
2020-05-24  1:55                     ` Chris Nicol
2020-05-24 14:05                       ` Simon Marchi
2020-05-27 21:31                       ` Martin Simmons
     [not found]                         ` <46566349-c023-6a75-7006-268aad4913c6@uleth.ca>
2020-05-28 10:57                           ` Martin Simmons
2020-05-28 14:40                             ` Chris Nicol
2020-05-28 17:30                               ` Martin Simmons
2020-05-28 17:37                                 ` Chris Nicol
2020-05-23 16:29   ` gdb-9.1 Fails to build: "invalid cast to abstract class type" Joel Brobecker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jeh7w6b8j2.fsf@dyxyl.com \
    --to=qqxnjvamvxwx@dyxyl.com \
    --cc=gdb@sourceware.org \
    --cc=nicolc@uleth.ca \
    --cc=simark@simark.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).