From: Simon Marchi <simon.marchi@polymtl.ca>
To: Andrew Burgess <andrew.burgess@embecosm.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] sim: don't rely on inferior_ptid in gdbsim_target::wait
Date: Mon, 20 Jan 2020 00:49:00 -0000 [thread overview]
Message-ID: <a4272a6a-8188-aa08-1f60-e64a2c282b31@polymtl.ca> (raw)
In-Reply-To: <20200119211217.GE3865@embecosm.com>
On 2020-01-19 4:12 p.m., Andrew Burgess wrote:
> * Simon Marchi <simon.marchi@polymtl.ca> [2020-01-18 22:55:57 -0500]:
>
>> When running a program with the simulator target, I get:
>>
>> /home/simark/src/binutils-gdb/gdb/inferior.c:279: internal-error: inferior* find_inferior_pid(process_stratum_target*, int): Assertion `pid != 0' failed.
>>
>> This can be reproduced by building a GDB for --target=arm-none-gnueabi,
>> and running with
>>
>> $ ./gdb -nx --data-directory=data-directory a.out -ex "target sim" -ex load -ex "b main" -ex r
>>
>> Where a.out is any program with a main.
>>
>> The problem is that gdbsim_target::wait assumes that inferior_ptid has
>> the value of the thread it wants to report an event for.
>>
>> Actually, it's the target's responsibility to come up with the ptid of
>> the thread the event is for. In the sim target, that ptid is stored in
>> sim_inferior_data::remote_sim_ptid, so return that instead of
>> inferior_ptid.
>>
>> ChangeLog:
>>
>> * remote-sim.c (gdbsim_target::wait): Return
>> sim_data->remote_sim_ptid instead of inferior_ptid.
>
> This makes sense. LGTM.
>
> Thanks,
> Andrew
Thanks, I pushed it.
Simon
next prev parent reply other threads:[~2020-01-20 0:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-19 16:07 Simon Marchi
2020-01-19 23:23 ` Andrew Burgess
2020-01-20 0:49 ` Simon Marchi [this message]
2020-01-20 15:28 ` Pedro Alves
2020-01-20 15:48 ` 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=a4272a6a-8188-aa08-1f60-e64a2c282b31@polymtl.ca \
--to=simon.marchi@polymtl.ca \
--cc=andrew.burgess@embecosm.com \
--cc=gdb-patches@sourceware.org \
/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