Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Mike Frysinger via Gdb-patches <gdb-patches@sourceware.org>
To: Faraz Shahbazker <fshahbazker@wavecomp.com>
Cc: gdb-patches@sourceware.org, Chao-ying Fu <cfu@wavecomp.com>
Subject: Re: [PATCH] sim: mips: Add handlers to simulator monitor for unlink,  lseek and stat
Date: Sun, 28 Mar 2021 10:54:16 -0400	[thread overview]
Message-ID: <YGCYmIZ1L49nSwlE@vapier> (raw)
In-Reply-To: <20210328093206.15977-1-fshahbazker@wavecomp.com>

On 28 Mar 2021 02:32, Faraz Shahbazker wrote:
> sim/mips/ChangeLog
> 	* interp.c (sim_monitor): Add switch entries for unlink (13),
> 	lseek (14), and stat (15).

what ABI is sim_monitor supposed to be supporting ?  it seems to be confused
between IDT monitor & PMON, or at least out of sync with the libgloss code.

it would be nice if this were cleaned up to define the ABIs using constant
maps.  cris/traps.c is one example.

> +#include <byteswap.h>

this is not portable.  we have sim-endian.h APIs already you should use.

> +    case 15: /* int stat(const char *path, struct stat *buf); */
> +      {
> +	/* We need to put the data into the type of stat structure
> +	   that MIPS uses and make sure it has the correct endianness.
> +	   We are assuming that the host and MIPS agree on what the bits
> +	   in st_mode mean.  That appears to be true for x86 linux and
> +	   MIPS.  */
> +	struct stat host_stat;
> +	struct __attribute__ ((__packed__)) mips_stat {
> +	  short st_dev;
> +	  unsigned short st_ino;
> +	  unsigned int st_mode;
> +	  unsigned short st_nlink;
> +	  unsigned short st_uid;
> +	  unsigned short st_gid;
> +	  short st_rdev;
> +	  union {
> +	    int b32;
> +	    long b64;
> +	  } st_size;
> +	} mips_stat;

the sim core provides APIs to automate this.  grep for "stat_map" in the bfin,
cris, and common code.
-mike

  parent reply	other threads:[~2021-03-28 14:54 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-28  9:32 Faraz Shahbazker
2021-03-28 14:20 ` Faraz Shahbazker
2021-03-28 14:54 ` Mike Frysinger via Gdb-patches [this message]
2021-03-30 21:20   ` [EXTERNAL]Re: " Faraz Shahbazker
2021-03-31  2:17     ` Mike Frysinger via Gdb-patches
2021-03-30 21:21 ` [PATCH v1] " Faraz Shahbazker
2021-03-31  2:19   ` Mike Frysinger via Gdb-patches
2021-03-31  7:10     ` [PATCH v3] " Faraz Shahbazker
2021-04-01  2:33       ` Mike Frysinger via Gdb-patches
2021-04-02 20:36         ` Maciej W. Rozycki
2021-03-30 21:40 ` [PATCH v2] " Faraz Shahbazker

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=YGCYmIZ1L49nSwlE@vapier \
    --to=gdb-patches@sourceware.org \
    --cc=cfu@wavecomp.com \
    --cc=fshahbazker@wavecomp.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