DJGPP specific fix for struct serial_ops in ser-go32.c

Message ID 5693F8E1.4040602@gmx.de
State New, archived
Headers

Commit Message

Juan Manuel Guerrero Jan. 11, 2016, 6:48 p.m. UTC
  This is a fix for the DJGPP port of gdb.
I do not know when this has changed but the numbers of arguments passed to
setparity of struct serial_ops no longer match the number of arguments of
dos_noop.  The patch below fixes the issue providing a new dummy function.

Is there some one on this list that is member on the gdb bug mailing list?
I have tried to submitte this mail to bug-gdb@gnu.org but it has been bounced.


Regards,
Juan M. Guerrero



2016-01-10  Juan Manuel Guerrero  <juan.guerrero@gmx.de>

	* gdb/ser-go32.c:  New function dos_setparity_noop.
  

Comments

Eli Zaretskii Jan. 15, 2016, 8:30 a.m. UTC | #1
> Date: Mon, 11 Jan 2016 19:48:01 +0100
> From: Juan Manuel Guerrero <juan.guerrero@gmx.de>
> 
> This is a fix for the DJGPP port of gdb.
> I do not know when this has changed but the numbers of arguments passed to
> setparity of struct serial_ops no longer match the number of arguments of
> dos_noop.  The patch below fixes the issue providing a new dummy function.

Any objections, anyone?  The patch looks obviously correct to me, so
I'd like to commit it.

Thanks.
  
Pedro Alves Jan. 15, 2016, 8:39 p.m. UTC | #2
On 01/15/2016 08:30 AM, Eli Zaretskii wrote:
>> Date: Mon, 11 Jan 2016 19:48:01 +0100
>> From: Juan Manuel Guerrero <juan.guerrero@gmx.de>
>>
>> This is a fix for the DJGPP port of gdb.
>> I do not know when this has changed but the numbers of arguments passed to
>> setparity of struct serial_ops no longer match the number of arguments of
>> dos_noop.  The patch below fixes the issue providing a new dummy function.
> 
> Any objections, anyone?  The patch looks obviously correct to me, so
> I'd like to commit it.

I think the intention is to install ser_base_setparity, which is itself
a dummy function, when the feature is not supported:

 ser-mingw.c:  ser_base_setparity,
 ser-mingw.c:  ser_base_setparity,
 ser-pipe.c:  ser_base_setparity,
 ser-tcp.c:  ser_base_setparity,

Thanks,
Pedro Alves
  

Patch

diff -aprNU5 gdb-7.10.1.orig/gdb/ser-go32.c gdb-7.10.1/gdb/ser-go32.c
--- gdb-7.10.1.orig/gdb/ser-go32.c	2015-11-23 00:42:20 +0100
+++ gdb-7.10.1/gdb/ser-go32.c	2016-01-10 08:24:56 +0100
@@ -593,10 +593,16 @@  dos_close (struct serial *scb)
  }
  


  static int
+dos_setparity_noop (struct serial *scb, int parity)
+{
+  return 0;  /* GO32 doesn't support this */
+}
+
+static int
  dos_noop (struct serial *scb)
  {
    return 0;
  }

@@ -862,11 +868,11 @@  static const struct serial_ops dos_ops =
    dos_set_tty_state,
    dos_print_tty_state,
    dos_noflush_set_tty_state,
    dos_setbaudrate,
    dos_setstopbits,
-  dos_noop,
+  dos_setparity_noop,
    dos_noop,			/* Wait for output to drain.  */
    (void (*)(struct serial *, int))NULL	/* Change into async mode.  */
  };

  int