public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Burgess <aburgess@redhat.com>
To: Mike Frysinger <vapier@gentoo.org>, jaydeep.patil@imgtec.com
Cc: gdb-patches@sourceware.org, joseph.faulls@imgtec.com,
	bhushan.attarde@imgtec.com
Subject: Re: [PATCH v2 1/3] [sim/riscv] Add basic semi-hosting support
Date: Tue, 12 Dec 2023 17:24:02 +0000	[thread overview]
Message-ID: <87y1dze3m5.fsf@redhat.com> (raw)
In-Reply-To: <ZWbu6jj7CSSS9i91@vapier>

Mike Frysinger <vapier@gentoo.org> writes:

> On 30 Oct 2023 13:00, jaydeep.patil@imgtec.com wrote:
>> Added support for basic semi-hosting calls OPEN, EXIT and GET_CMDLINE.
>
> what host environment are you implementing ?  none of the syscalls you've
> defined match what have long been in the riscv libgloss port.  those are
> the only ones i'd really expect at this point to be wired up.

This would be the RISC-V semihosting target, which is included in
newlib (since 2020), but is separate to libgloss.

Where libgloss syscalls use ecall, the semihosting uses ebreak with two
specific nop instructions (one before, one after the ebreak).

Do you see any reason why we can't support both of these syscall
libraries?  Potentially we could have a switch to select between them,
but I'm inclined to say we should just support both until someone comes
with a use-case where supporting both is a bad idea...  But maybe you
have some deeper insights here.

>
>> Added gdb.arch/riscv-exit-getcmd.c to test it.
>> ---
>>  gdb/testsuite/gdb.arch/riscv-exit-getcmd.c   |  26 +++
>>  gdb/testsuite/gdb.arch/riscv-exit-getcmd.exp |  27 +++
>>  sim/riscv/riscv-sim.h                        |  32 +++
>>  sim/riscv/sim-main.c                         | 230 ++++++++++++++++++-
>
> you're missing sim/ tests.  gdb tests are great, but not sufficient.

100% agree with this.

Thanks,
Andrew

>
>> @@ -990,6 +1209,7 @@ execute_one (SIM_CPU *cpu, unsigned_word iw, const struct riscv_opcode *op)
>>      case INSN_CLASS_A:
>>        return execute_a (cpu, iw, op);
>>      case INSN_CLASS_I:
>> +    case INSN_CLASS_ZICSR:
>>        return execute_i (cpu, iw, op);
>
> seems unrelated to this patch
> -mike


  reply	other threads:[~2023-12-12 17:24 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-30 13:00 [PATCH v2 0/3] sim: riscv: Compressed instruction simulation and " jaydeep.patil
2023-10-30 13:00 ` [PATCH v2 1/3] [sim/riscv] Add basic " jaydeep.patil
2023-11-29  7:57   ` Mike Frysinger
2023-12-12 17:24     ` Andrew Burgess [this message]
2023-12-13  3:43       ` Mike Frysinger
2023-12-18 12:44         ` Andrew Burgess
2023-12-18 23:06           ` Mike Frysinger
2023-12-19  6:13     ` [EXTERNAL] " Jaydeep Patil
2023-12-20  1:45       ` Mike Frysinger
2023-12-20  8:52         ` Jaydeep Patil
2023-12-12 17:57   ` Andrew Burgess
2023-10-30 13:00 ` [PATCH v2 2/3] [sim/riscv] Add support for compressed integer instruction set jaydeep.patil
2023-11-29  7:58   ` Mike Frysinger
2023-12-19  6:11     ` [EXTERNAL] " Jaydeep Patil
2023-12-20  1:32       ` Mike Frysinger
2023-10-30 13:00 ` [PATCH v2 3/3] [sim/riscv] Add semi-hosting support jaydeep.patil
2023-11-13 12:07 ` [PATCH v2 0/3] sim: riscv: Compressed instruction simulation and " Jaydeep Patil

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=87y1dze3m5.fsf@redhat.com \
    --to=aburgess@redhat.com \
    --cc=bhushan.attarde@imgtec.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jaydeep.patil@imgtec.com \
    --cc=joseph.faulls@imgtec.com \
    --cc=vapier@gentoo.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).