public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: Tom Tromey <tom@tromey.com>,
	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, 26 Sep 2023 21:23:13 -0400	[thread overview]
Message-ID: <500e0102-f66e-4cd6-b1a8-b147fd2c7836@simark.ca> (raw)
In-Reply-To: <87bkegobsu.fsf@tromey.com>



On 2023-09-05 11:54, Tom Tromey wrote:
>>>>>> "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

Hi Tom,

This test fails for me with native-extended-gdbserver:

$ make check TESTS="gdb.ada/file-then-restart.exp" RUNTESTFLAGS="--target_board=native-extended-gdbserver"
FAIL: gdb.ada/file-then-restart.exp: scenario=kill: start second (the program exited)
FAIL: gdb.ada/file-then-restart.exp: scenario=no-kill: start second (the program exited)

Simon

      reply	other threads:[~2023-09-27  1:23 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
2023-09-27  1:23   ` Simon Marchi [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=500e0102-f66e-4cd6-b1a8-b147fd2c7836@simark.ca \
    --to=simark@simark.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.com \
    --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).