From: Anthony Green <green@moxielogic.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [patch] [sim/moxie] Fix NULL dereferences
Date: Sat, 27 Feb 2010 01:04:00 -0000 [thread overview]
Message-ID: <4B886F8C.1070002@moxielogic.com> (raw)
In-Reply-To: <20100226124738.GA6773@host0.dyn.jankratochvil.net>
On 2/26/2010 7:47 AM, Jan Kratochvil wrote:
> Hi,
>
> it looks as obvious to me but I know nothina about either sim or moxie.
>
Thanks, please apply this if you haven't already.
AG
>
> Thanks,
> Jan
>
>
> This GDB was configured as "--host=x86_64-unknown-linux-gnu --target=moxie-unknown-elf".
> ./gdb -nx -ex 'target sim' -ex r
> = crash
>
> 2010-02-26 Jan Kratochvil<jan.kratochvil@redhat.com>
>
> * interp.c (sim_create_inferior): Fix crashes on zero PROG_BFD or ARGV.
>
> --- a/sim/moxie/interp.c
> +++ b/sim/moxie/interp.c
> @@ -1307,11 +1307,12 @@ sim_create_inferior (sd, prog_bfd, argv, env)
> set_initial_gprs ();
> issue_messages = l;
>
> - cpu.asregs.regs[PC_REGNO] = bfd_get_start_address (prog_bfd);
> + if (prog_bfd != NULL)
> + cpu.asregs.regs[PC_REGNO] = bfd_get_start_address (prog_bfd);
>
> /* Copy args into target memory. */
> avp = argv;
> - for (argc = 0; *avp; avp++)
> + for (argc = 0; avp&& *avp; avp++)
> argc++;
>
> /* Target memory looks like this:
>
next prev parent reply other threads:[~2010-02-27 1:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-26 12:47 Jan Kratochvil
2010-02-27 1:04 ` Anthony Green [this message]
2010-02-27 1:29 ` Jan Kratochvil
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=4B886F8C.1070002@moxielogic.com \
--to=green@moxielogic.com \
--cc=gdb-patches@sourceware.org \
--cc=jan.kratochvil@redhat.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