public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
* Re: insight debugger locks up
       [not found] ` <1068842680.3fb53eb8880b8@www.nexusmail.uwaterloo.ca>
@ 2003-11-21 19:24   ` Keith Seitz
  0 siblings, 0 replies; only message in thread
From: Keith Seitz @ 2003-11-21 19:24 UTC (permalink / raw)
  To: y2bismil; +Cc: insight

On Fri, 2003-11-14 at 12:44, y2bismil@engmail.uwaterloo.ca wrote:
> Weird.  It appears it is a kbhit problem.  For some reason even on that line way
> up top, if I just press a key on the console screen from the debugger, the
> program continues.  But stepping through appears to be messed up.  I have to put
> breakpoints everywhere.
> 
> Is there some incompatibility with stepping through code and kbhit.
> 
> Yamin

I've never used mingw, so I cannot comment on how well gdb works with it
-- especially when using windows system calls.

> Quoting y2bismil@engmail.uwaterloo.ca:
> > Hi all,
> > 
> > i'm using the insight debugger from the lastest cygwin package.  It seems to
> > be
> > locking up when trying to step through code.  The following program isolates
> > the
> > issue on my system
> > 
> > ******************************************************
> > #include <io.h>
> > #include <stdio.h>
> > #include  <fcntl.h>
> > #include <sys/stat.h>
> > #include <conio.h>
> > 
> > int main()
> > {
> >    int handle;
> >    handle= creat("hello.txt", 0);
> >    if (handle == -1)
> >    {
> >       printf("Unable to creat file hello.txt\r\n");
> >    }
> > 
> >    write(handle, "Hello\r\n",7);
> >    close(handle);
> > 
> >    handle= open("hello.txt", O_RDWR|O_BINARY, S_IREAD | S_IWRITE);
> >    if (handle == -1)
> >    {
> >       printf("Unable to open file hello.txt\r\n");
> >    }
> >    write(handle, "urdum\r\n",7);
> >    close(handle);
> > 
> >   while(1)
> >  {
> > 	char c = kbhit();
> >        if(c)
> >        {
> >             c = getch();
> >             char buffer[12];
> >             buffer[0] = c;
> >             buffer[1] = '\0';
> >             printf(buffer);
> >             break;
> >        }
> >         
> >  }
> > }
> > 
> > 
> > Compile line:
> > 
> > g++ -g -mno-cygwin -isystemC:/cygwin/usr/include/mingw -o main.exe  main.cpp
> > ******************************************************
> > What I do:
> > Start the insight debugger.  Use Next (not even step into).  Stepping over
> > this
> > line:  handle= creat("hello.txt", 0); causes a lockup of insight.  Yet, I
> > get
> > the printfs:
> > 
> > printf("Unable to creat file hello.txt\r\n");
> > printf("Unable to open file hello.txt\r\n").
> > 
> > My problem first arose after trying out kbhit, which locks up.  Then I went
> > to
> > my little file test program and it has the same problem.
> > Any ideas?

Offhand, it sounds like the debug info is messed up (or gdb is messed up
trying to use that information). Have you tried running just vanilla
gdb? ("insight -nw" or just "gdb")

My suspicion is that since your program is not using cygwin, the console
stuff is all messed up. Consequently, you're having to type into the
console that started insight (or something like that).

Keith


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-11-21 19:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1068842483.3fb53df3678d6@www.nexusmail.uwaterloo.ca>
     [not found] ` <1068842680.3fb53eb8880b8@www.nexusmail.uwaterloo.ca>
2003-11-21 19:24   ` insight debugger locks up Keith Seitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).