public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "macro at orcam dot me.uk" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug tdep/29804] [gdb/tdep, vax] Remove gdbarch_deprecated_function_start_offset
Date: Sat, 28 Jan 2023 14:09:07 +0000	[thread overview]
Message-ID: <bug-29804-4717-FnyZ0TPmYf@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-29804-4717@http.sourceware.org/bugzilla/>

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

--- Comment #12 from Maciej W. Rozycki <macro at orcam dot me.uk> ---
For the record, I have VAX/NetBSD `gdbserver' implemented however due to
non-functional exception handling with this configuration it always
crashes upon exit with:

terminate called after throwing an instance of 'gdb_exception_quit'
terminate called recursively
Abort

Similarly does native GDB as included with the distribution, e.g.:

(gdb) ^Cterminate called after throwing an instance of
'gdb_exception_RETURN_MASK_QUIT'
terminate called recursively
Abort

I have assessed the problem and concluded that the generic DWARF unwinder
included with libgcc is unsuitable as it stands for the VAX frame layout,
because it makes too many assumptions that are wrong for the VAX ABI.
Most importantly it thinks that it needs to update $sp to unwind a frame,
but it has to be $fp with the VAX ABI ($sp only really matters for
outgoing function arguments and alloca, $ap is used for incoming function
arguments, and $fp is used for everything else).  And in any case DWARF
EH records produced by GCC for the VAX target are broken in many ways.
AFAICT exception handling has never worked for the ELF VAX/NetBSD target
(perhaps it worked for a.out).

With the VAX ABI however there is full frame information always available
(the RET machine instruction makes use of it to restore all the static
registers saved by the CALLS instruction and move to the previous frame)
and one does not need to resort to DWARF records to be able to refer to
arbitrary frames (perhaps except for signal frames; I have not checked
that yet).  Therefore I have not decided yet whether the solution for
exception handling will be a VAX-specific implementation of a DWARF
unwinder or a completely different VAX-specific unwinder working directly
on the frame structure itself.  I do hope to get it sorted with GCC 14
later this year.

Anyway this implementation of `gdbserver' is otherwise fully functional
and has turned out good enough to figure out what is going on with frame
unwinding, so I'll see if it is suitable to run regression testing
despite of crashing upon exit and will submit it anyway.  There is a
change or two required to GDB itself to make the testsuite work with the
generic core of NetBSD `gdbserver', which makes me suspect remote
regression testing has never ever been run with any NetBSD target.

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

      parent reply	other threads:[~2023-01-28 14:09 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-18  9:48 [Bug tdep/29804] New: " 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 message]

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