delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/05/12/19:37:53

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-ID: <AC4D3D80B239D211BC140000F879A2BA0AED73@NTMAIL>
From: Ian Collins <ianc AT kiwiplan DOT co DOT nz>
To: "Gnu-Win32 (E-mail)" <gnu-win32 AT cygnus DOT com>
Subject: ioctl calls under gdb
Date: Thu, 13 May 1999 11:39:40 +1200
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2448.0)

I am trying to debug an application that uses "raw" terminal i/o as follows,

if (ioctl(0, TCGETA, &tbuf) != -1){
  tbufsave = tbuf;
  tbuf.c_iflag &= ~(INLCR| ICRNL| IUCLC| ISTRIP| BRKINT);
  tbuf.c_oflag &= ~OPOST;
  tbuf.c_lflag &= ~(ICANON | ISIG | ECHO);
  tbuf.c_cc[4] = 1;      /* MIN */
  tbuf.c_cc[5] = 0;      /* TIME */
  if (ioctl(0, TCSETA, &tbuf) == -1){
     perror("kwrawmd ioctl (TCSETA) fail ");
     exit(1);
  }
}

When I run the app under gdb I get a "ioctl (TCGETA) fail : Invalid
argument" error.

I have tried using "gdb --tty=/dev/tty2 progname" (ie., another active
terminal), but gdb ignores the other terminal, and I still get the error.

I can't attach to the process "GDB can't read core files on this
machine...Can't attach to process.".

Does anyone know how to debug such an application (without resorting to the
age old printf statements throughout the code).

Ian Collins.


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019