Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jason R Thorpe <thorpej@wasabisystems.com>
To: Eli Zaretskii <eliz@is.elta.co.il>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [PATCH/RFA] Generic OS ABI handling
Date: Fri, 17 May 2002 11:31:00 -0000	[thread overview]
Message-ID: <20020517113142.B14437@dr-evil.shagadelic.org> (raw)
In-Reply-To: <2561-Fri17May2002110306+0300-eliz@is.elta.co.il>; from eliz@is.elta.co.il on Fri, May 17, 2002 at 11:03:07AM +0300

On Fri, May 17, 2002 at 11:03:07AM +0300, Eli Zaretskii wrote:

 > This is approved, but see some minor comments below.

Ok, I'll post another patch shortly with the doc changes and ARM changes...

 > > +/* This table matches the indices assigned to enum gdb_osabi.  Keep
 > > +   them in sync.  */
 > 
 > Wouldn't it be nice to have those in sync automatically, or at least
 > have a compiler error if they aren't?

Well, there is a run-time error if the last one isn't right (this is like
how the signal name table is done).

 > Do I understand correctly that any target whose ABI is not in this
 > list will cause the warning below to be issued at run time?
 > 
 > > +  if (osabi == GDB_OSABI_UNKNOWN)
 > > +    {
 > > +      /* Don't complain about not knowing the OS ABI if we don't
 > > +	 have an inferior.  */
 > > +      if (info.abfd)
 > > +	fprintf_filtered
 > > +	  (gdb_stderr, "GDB doesn't recognize the OS ABI of the inferior.  "
 > > +	   "Attempting to continue with the default %s settings",
 > > +	   bfd_printable_arch_mach (arch_info->arch, arch_info->mach));
 > > +      return;
 > 
 > If this warning is to be printed in a normal session, it could get
 > annoying, I think.

Yah, actually, there is a FIXME about that in the SH target code...
I've been toying with the idea of having a "nowarn" argument to that
function to suppress the warning for an unknown OS ABI.

Another option might be to catch "unknown" in target-dependent code
before gdbarch_init_osabi() is called and set it to something else.
E.g. the i386 target currently assumes an otherwise unrecognized binary
is SVR4, and thus might have a bit of code that did:

    /* Default unrecognized ELF binaries to SVR4.  */
    if (osabi == GDB_OSABI_UNKNOWN
        && bfd_get_flavour (info.abfd) == bfd_target_elf_flavour)
      osabi = GDB_OSABI_SVR4;

 > Or maybe I just couldn't figure out when is that function called, and
 > what is the precise meaning of having the `unknown' OS ABI.  Could you
 > please tell that in a few words?

The function is called by <target>_gdbarch_init() after it has set up
the defaults for the gdbarch.  The OS ABI handler is then given a chance
to fine-tune the gdbarch (e.g. set up signal trampoline and shared library
handing, etc.).  If the OS ABI is "unknown", then the gdbarch just gets
the defaults, since there was no OS ABI handler to fine-tune them.

 > It might also be a good idea to tell what header file defines those
 > values, so that if the docs ever gets out of sync, the actual list
 > could be looked up.

...patch with doc changes incoming shortly.

-- 
        -- Jason R. Thorpe <thorpej@wasabisystems.com>


  parent reply	other threads:[~2002-05-17 18:31 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-13 12:08 Jason R Thorpe
2002-05-16 10:02 ` Jason R Thorpe
2002-05-16 14:57 ` Elena Zannoni
2002-05-16 15:17   ` Jason R Thorpe
2002-05-16 15:35     ` Andrew Cagney
2002-05-16 15:42       ` Jason R Thorpe
2002-05-16 15:56         ` Andrew Cagney
2002-05-16 16:11           ` Jason R Thorpe
2002-05-16 19:53             ` Jason R Thorpe
2002-05-16 20:42               ` Elena Zannoni
2002-05-17  0:04                 ` Jason R Thorpe
2002-05-17  1:04               ` Eli Zaretskii
2002-05-17  3:14                 ` Alfred M. Szmidt
2002-05-17 10:51                   ` Michael Snyder
2002-05-17 11:11                     ` Alfred M. Szmidt
2002-05-17 11:33                       ` Jason R Thorpe
2002-05-17 11:46                         ` Alfred M. Szmidt
2002-05-17 11:57                           ` Jason R Thorpe
2002-05-17 12:00                             ` Alfred M. Szmidt
2002-05-17 11:31                 ` Jason R Thorpe [this message]
2002-05-17  5:35               ` Richard Earnshaw
2002-05-17 11:53                 ` Jason R Thorpe
2002-05-17  9:59               ` Andrew Cagney

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=20020517113142.B14437@dr-evil.shagadelic.org \
    --to=thorpej@wasabisystems.com \
    --cc=eliz@is.elta.co.il \
    --cc=gdb-patches@sources.redhat.com \
    /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