From: Pedro Alves <pedro@palves.net>
To: Tom Tromey <tom@tromey.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Remove 'target_mach' global from score-tdep.c
Date: Wed, 16 Mar 2022 12:07:41 +0000 [thread overview]
Message-ID: <5835f3ee-9026-2b37-9bdd-e14aba0247d8@palves.net> (raw)
In-Reply-To: <20220315223154.6517-1-tom@tromey.com>
On 2022-03-15 22:31, Tom Tromey wrote:
> I randomly noticed that score-tdep.c sets a global variable from
> score_gdbarch_init, and then reuses this in other spots in the file.
>
> This seems incorrect to me, at least if multiple inferiors or targets
> are used; or potentially if there is a single gdb session that
> switches back and forth between (sub-)architectures, causing the
> global to be invalid.
>
> This patch fixes the problem by deferring the lookup.
>
> I wrote this just based on inspection, though, and have no way to test
> it. I wonder if other *-tdep.c files have similar issues.
Looks fine.
I think we should just drop the whole score port, though. See here, from 2014 (!):
https://sourceware.org/pipermail/gdb/2014-October/044643.html
Pedro Alves
next prev parent reply other threads:[~2022-03-16 12:07 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-15 22:31 Tom Tromey
2022-03-16 11:38 ` Andrew Burgess
2022-03-16 12:07 ` Pedro Alves [this message]
2022-03-16 14:44 ` [PATCH] gdb: Remove support for S+core Pedro Alves
2022-03-16 15:55 ` Andrew Burgess
2022-03-16 16:28 ` Tom Tromey
2022-03-17 15:42 ` Pedro Alves
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=5835f3ee-9026-2b37-9bdd-e14aba0247d8@palves.net \
--to=pedro@palves.net \
--cc=gdb-patches@sourceware.org \
--cc=tom@tromey.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).