public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug tdep/29804] New: [gdb/tdep, vax] Remove gdbarch_deprecated_function_start_offset
Date: Fri, 18 Nov 2022 09:48:07 +0000	[thread overview]
Message-ID: <bug-29804-4717@http.sourceware.org/bugzilla/> (raw)

https://sourceware.org/bugzilla/show_bug.cgi?id=29804

            Bug ID: 29804
           Summary: [gdb/tdep, vax] Remove
                    gdbarch_deprecated_function_start_offset
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: tdep
          Assignee: unassigned at sourceware dot org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

As noted in PR29793, there's only one user left of
gdbarch_deprecated_function_start_offset:
...
$ find gdb -type f | xargs grep set_gdbarch_deprecated_function_start_offset
gdb/gdbarch-gen.h:extern void set_gdbarch_deprecated_function_start_offset
(struct gdbarch *gdbarch, CORE_ADDR deprecated_function_start_offset);
gdb/vax-tdep.c:  set_gdbarch_deprecated_function_start_offset (gdbarch, 2);
gdb/gdbarch.c:set_gdbarch_deprecated_function_start_offset (struct gdbarch
*gdbarch,
...

The vax target.

The deprecation started in 2004:
...
2004-06-18  Andrew Cagney  <cagney@gnu.org>

        * gdbarch.sh (DEPRECATED_FUNCTION_START_OFFSET): Deprecated.
...

The submission email (
https://sourceware.org/pipermail/gdb-patches/2004-May/034563.html ) mentions
vax:
...
The VAX uses this to ``adjust'' a function 
pointer so that it instead points to the function's code address (the 
first few bytes of a vax function are not executable and need to be 
skipped over).

Thing is, this conversion is exactly what CONVERT_FUNC_PTR_ADDR is for. 
  Given a function pointer return the function's code address.  Given 
this overlap, I think FUNCTION_START_OFFSET should be deprecated - it is 
redundant.
...

Unfortunately grepping through the sources shows that code locations of 
gdbarch_deprecated_function_start_offset and convert_from_func_ptr_addr don't
always overlap, so this is not a mechanical substitution, and needs to be
tested.

One outcome could be that we cannot (fully) remove it, but then we should
de-deprecate it and document precisely why we need it and when and where this
hook is necessary.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

             reply	other threads:[~2022-11-18  9:48 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-18  9:48 vries at gcc dot gnu.org [this message]
2022-11-18  9:55 ` [Bug tdep/29804] " vries at gcc dot gnu.org
2022-11-18 10:20 ` vries at gcc dot gnu.org
2022-11-18 15:55 ` tromey at sourceware dot org
2022-11-18 16:01 ` vries at gcc dot gnu.org
2022-11-18 20:13 ` macro at orcam dot me.uk
2022-11-19  9:50 ` vries at gcc dot gnu.org
2022-11-19 13:44 ` macro at orcam dot me.uk
2022-11-21  6:37 ` vries at gcc dot gnu.org
2022-11-22 15:58 ` macro at orcam dot me.uk
2022-12-06 16:25 ` tromey at sourceware dot org
2022-12-06 16:43 ` macro at orcam dot me.uk
2023-01-28 14:09 ` macro at orcam dot me.uk

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=bug-29804-4717@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /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).