Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Kazu Hirata <kazu@cs.umass.edu>
To: dvenkat@noida.hcltech.com
Cc: gdb-patches@sources.redhat.com, binutils@sources.redhat.com,
	newlib@sources.redhat.com
Subject: Re: PATCH : H8300 Simulator File I/O Implementation
Date: Tue, 24 Dec 2002 06:51:00 -0000	[thread overview]
Message-ID: <20021224.045555.78725758.kazu@cs.umass.edu> (raw)
In-Reply-To: <E04CF3F88ACBD5119EFE00508BBB21210673169C@exch-01.noida.hcltech.com>

Hi Venky,

> I had submitted a patch for providing File I/O Support for 
> H8300 simulator. The message link is:
> 
> http://sources.redhat.com/ml/gdb-patches/2002-12/msg00013.html 
> 
> Could you point out if this patch is acceptable, or are there 
> still some inconsistencies to be fixed. I would be willing to 
> do any further changes required. 

Not being the maintainer of the h8300 port other than in gcc...

I would split the gdb part of your patch into the opcodes part and the
rest because opcodes is part of binutils.

I am guessing that you probably don't need to change the order of
functions in newlib/libc/sys/h8300hms/syscalls.c.  You might want to
submit a patch with few or no formatting changes to make your real
changes exposed.  See the attached patch below.  Also, please use
"asm (...)" instead of "asm(...)".

For the gdb part, I would run 'indent' to see what it recommends.  One
thing it suggests should be to change

! 	    filename = (char *)malloc(sizeof(char) * len);

to something like

! 	    filename = (char *) malloc (sizeof (char) * len);

Some variables seem to be unused.

! 	case O (O_SYS_FSTAT, SB):
	     :
	     :
! 	    int i = 0;            /* Loop Counter */
! 	    int j = 0;            /* Temporary variable for Position in source */
! 	    int short_size = sizeof (short); /* Sizeof short */
! 	    int int_size = sizeof (int);     /* Sizeof int */

Here i, j, short_size, and int_size seem to be unused.

! 	case O (O_SYS_STAT, SB):
	     :
	     :
! 	    int j = 0;            /* Temporary variable for Position in source */
! 	    int short_size = sizeof (short); /* Sizeof short */
! 	    int int_size = sizeof (int);     /* Sizeof int */


Here j, short_size, and int_size seem to be unused.

Meanwhile, I'll try to run the simulator with your patch.  Thanks!

Kazu Hirata

Index: syscalls.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/sys/h8300hms/syscalls.c,v
retrieving revision 1.3
diff -c -r1.3 syscalls.c
*** syscalls.c	17 May 2002 20:13:38 -0000	1.3
--- syscalls.c	16 Dec 2002 23:32:08 -0000
***************
*** 4,9 ****
--- 4,10 ----
  #include <sys/types.h>
  #include <sys/stat.h>
  #include <errno.h>
+ #include "sys/syscall.h"
  
  
  int _DEFUN(_lseek,(file, ptr, dir),
***************
*** 11,23 ****
  	  int ptr _AND
  	  int dir)
  {
!   return 0;
  }
  
  int _DEFUN(_close,(file),
  	  int file)
  {
!   return -1;
  }
  
  int isatty(file)
--- 12,24 ----
  	  int ptr _AND
  	  int dir)
  {
!   asm ("jsr @@0xc8");
  }
  
  int _DEFUN(_close,(file),
  	  int file)
  {
!   asm ("jsr @@0xc9");
  }
  
  int isatty(file)
***************
*** 26,37 ****
    return 1;
  }
  
  int _DEFUN(_fstat,(file, st),
  	  int file _AND
  	  struct stat *st)
  {
!   st->st_mode = S_IFCHR;
!   return 0;
  }
  
  int
--- 27,45 ----
    return 1;
  }
  
+ int _DEFUN(_stat,(path, sbuf),
+ 	const char *path _AND
+ 	struct stat *st)
+ {
+   asm ("jsr @@0xca");
+ }
+ 
+ 
  int _DEFUN(_fstat,(file, st),
  	  int file _AND
  	  struct stat *st)
  {
!   asm ("jsr @@0xcb"); 
  }
  
  int
***************
*** 39,45 ****
       const char *path;
       int flags;
  {
!   return 0;
  }
  
  int
--- 47,53 ----
       const char *path;
       int flags;
  {
!   asm ("jsr @@0xc5");
  }
  
  int


  reply	other threads:[~2002-12-24  9:56 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-23 22:59 D.Venkatasubramanian, Noida
2002-12-24  6:51 ` Kazu Hirata [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-01-14  4:56 D.Venkatasubramanian, Noida
2003-01-08  5:08 D.Venkatasubramanian, Noida
2003-01-03  8:30 D.Venkatasubramanian, Noida
2003-01-07 22:00 ` Kazu Hirata
2003-01-07 23:08 ` Andrew Cagney
2002-12-31  2:00 D.Venkatasubramanian, Noida
2002-12-31  4:42 ` Kazu Hirata
2002-12-26 10:12 D.Venkatasubramanian, Noida
2002-12-26  4:38 D.Venkatasubramanian, Noida
2002-12-02  3:45 D.Venkatasubramanian, Noida
2002-11-29 21:31 D.Venkatasubramanian, Noida
2002-11-30 10:01 ` Kazu Hirata
2003-03-04 16:08   ` Andrew Cagney
2003-03-04 16:33     ` Kazu Hirata

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=20021224.045555.78725758.kazu@cs.umass.edu \
    --to=kazu@cs.umass.edu \
    --cc=binutils@sources.redhat.com \
    --cc=dvenkat@noida.hcltech.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=newlib@sources.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