This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
Re: [eliz@is.elta.co.il: Termios support in the DJGPP port of GDB]
- To: Stan Shebs <shebs@cygnus.com>
- Subject: Re: [eliz@is.elta.co.il: Termios support in the DJGPP port of GDB]
- From: Eli Zaretskii <eliz@gnu.org>
- Date: Thu, 19 Aug 1999 05:34:30 -0400
- CC: dj@delorie.com, gdb-patches@sourceware.cygnus.com
- References: <199908130156.SAA23569@andros.cygnus.com> <199906271748.NAA32030@envy.delorie.com>
> 1999-06-26 Eli Zaretskii <eliz@is.elta.co.il>
>
> * inflow.c (tcgetpgrp, tcsetpgrp) [__DJGPP__]: Define away.
>
> Rather than adding yet another ifdef to a generic file, I'd prefer to
> see #define macros added to a platform-specific file, for instance
> xm-go32.h
It turns out that DJGPP's unistd.h has a prototype fro these
functions, which makes it impossible to define them away in a header
included by defs.h.
The absence of these functions from the DJGPP library is actually a
bug; but until it is corrected, I added simple versions in go32-nat.c:
1999-08-19 Eli Zaretskii <eliz@is.elta.co.il>
* go32-nat.c (go32_stopped_by_watchpoint): Remove unused code.
1999-08-18 Eli Zaretskii <eliz@is.elta.co.il>
* go32-nat.c (tcgetpgrp, tcsetpgrp): New functions.
*** gdb/go32-nat.~13 Mon Aug 16 18:01:14 1999
--- gdb/go32-nat.c Thu Aug 19 10:28:04 1999
*************** go32_stopped_by_watchpoint (int pid, int
*** 1093,1108 ****
ret = D_REGS[i];
}
}
- #if 0
- /* Hardware breakpoints and data watchpoints utilize the same
- machinery of debug registers, but the processor behaves
- differently in these two cases: if we stopped at an instruction
- breakpoint, the processor generates a fault-class exception,
- whereby data breakpoint generates a trap. Therefore, instruction
- breakpoints need to increment the program counter. */
- if (!data_watchpoint && STATUS && !ret)
- stop_pc += DECR_PC_AFTER_BREAK;
- #endif
return ret;
}
--- 1093,1098 ----
*************** _initialize_go32_nat (void)
*** 1345,1347 ****
--- 1335,1355 ----
init_go32_ops ();
add_target (&go32_ops);
}
+
+ pid_t
+ tcgetpgrp (int fd)
+ {
+ if (isatty (fd))
+ return SOME_PID;
+ errno = ENOTTY;
+ return -1;
+ }
+
+ int
+ tcsetpgrp (int fd, pid_t pgid)
+ {
+ if (isatty (fd) && pgid == SOME_PID)
+ return 0;
+ errno = pgid == SOME_PID ? ENOTTY : ENOSYS;
+ return -1;
+ }