From: Hans-Peter Nilsson <hp@axis.com>
To: Roger Sayle <roger@nextmovesoftware.com>
Cc: <aburgess@redhat.com>, <gdb-patches@sourceware.org>
Subject: Re: [PATCH] Avoid seg fault in sim/cris/sim-if.c
Date: Mon, 10 Aug 2026 16:07:39 +0200 [thread overview]
Message-ID: <20260810140739.66796412CAA2@pc56224-2341.se.axis.com> (raw)
In-Reply-To: <009501dd2343$a20cc5f0$e62651d0$@nextmovesoftware.com> (roger@nextmovesoftware.com)
> From: "Roger Sayle" <roger@nextmovesoftware.com>
> Date: Mon, 3 Aug 2026 13:28:41 +0100
> Hi Andrew,
> No worries. The one line change is obvious, and there's really nothing
> to take credit for. I'm far more pleased that you've pushed a fix.
> Thank you very much for taking care of this.
>
> Cheers,
> Roger
> --
>
> > -----Original Message-----
> > From: Andrew Burgess <aburgess@redhat.com>
> > Sent: 03 August 2026 13:10
> > To: Roger Sayle <roger@nextmovesoftware.com>; gdb-patches@sourceware.org
> > Cc: 'Hans-Peter Nilsson' <hp@axis.com>
> > Subject: Re: [PATCH] Avoid seg fault in sim/cris/sim-if.c
> >
> > "Roger Sayle" <roger@nextmovesoftware.com> writes:
> >
> > > Typing "target sim" in GDB built with --target=cris-elf, crashes
> > > immediately after being launched with "gdb ./a.out". The issue is
> > > that STATE_PROG_ARGV may return NULL, and this isn't tested before
> > dereferencing the pointer.
> > >
> > > If approved, please could someone commit this for me.
> > > Thanks in advance.
> >
> > I pushed this.
> >
[Apology for mortal sin elided]
> > Thanks,
> > Andrew
> >
> >
> > >
> > > 2026-08-01 Roger Sayle <roger@nextmovesoftware.com>
> > >
> > > ChangeLog
> > > * sim/cris/sim-if.c (sim_open): Check that prog_argv isn't NULL.
Thank you both! I've (obviously) never run "target sim" in gdb for
cris-elf. That sin may be more grave than forgetting to assign
authorship when applying a one-line patch...
It was always on the TODO-list to wire up the hooks and plugging in
the pieces, to get the simulator running built-in with gdb. I'm glad
this got it working. If there's actually something more needed, then
at least this serves as defensive programming. I see it was already
rightly committed while I was happily on vacation, so just a thank
you.
brgds, H-P
prev parent reply other threads:[~2026-08-10 14:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-01 20:50 Roger Sayle
2026-08-03 12:10 ` Andrew Burgess
[not found] ` <009501dd2343$a20cc5f0$e62651d0$@nextmovesoftware.com>
2026-08-10 14:07 ` Hans-Peter Nilsson [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=20260810140739.66796412CAA2@pc56224-2341.se.axis.com \
--to=hp@axis.com \
--cc=aburgess@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=roger@nextmovesoftware.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