public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Tom Tromey via Gdb-patches <gdb-patches@sourceware.org>
Cc: Tom Tromey <tromey@adacore.com>
Subject: Re: [PATCH] Read Ada main name from executable, not inferior
Date: Tue, 05 Sep 2023 09:54:41 -0600	[thread overview]
Message-ID: <87bkegobsu.fsf@tromey.com> (raw)
In-Reply-To: <20230823171120.2566006-1-tromey@adacore.com> (Tom Tromey via Gdb-patches's message of "Wed, 23 Aug 2023 11:11:20 -0600")

>>>>> "Tom" == Tom Tromey via Gdb-patches <gdb-patches@sourceware.org> writes:

Tom> An upstream bug report points out this bug: if the user switches from
Tom> one Ada executable to another without "kill"ing the inferior, then the
Tom> "start" command will fail.

Tom> What happens here is that the Ada "main" name is found in a constant
Tom> string in the executable.  But, if the inferior is running, then the
Tom> process_stratum target reads from the inferior memory.

Tom> This patch fixes the problem by changing the main name code to set
Tom> trust-readonly-sections, causing the target stack to read from the
Tom> executable instead.

Tom> I looked briefly at changing GNAT to emit DW_AT_main_subprogram
Tom> instead, but this looks to be pretty involved.

Tom> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=25811

I'm checking this in.

Tom

  reply	other threads:[~2023-09-05 15:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-23 17:11 Tom Tromey
2023-09-05 15:54 ` Tom Tromey [this message]
2023-09-27  1:23   ` Simon Marchi

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=87bkegobsu.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@adacore.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).