public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug tdep/29804] New: [gdb/tdep, vax] Remove gdbarch_deprecated_function_start_offset
@ 2022-11-18  9:48 vries at gcc dot gnu.org
  2022-11-18  9:55 ` [Bug tdep/29804] " vries at gcc dot gnu.org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: vries at gcc dot gnu.org @ 2022-11-18  9:48 UTC (permalink / raw)
  To: gdb-prs

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.

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2023-01-28 14:09 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-18  9:48 [Bug tdep/29804] New: [gdb/tdep, vax] Remove gdbarch_deprecated_function_start_offset vries at gcc dot gnu.org
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

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).