delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/10/24/01:25:20

Message-Id: <3.0.6.16.19981024022225.2cdf5124@mail.tir.com>
X-Sender: thruska AT mail DOT tir DOT com
X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.6 (16)
Date: Sat, 24 Oct 1998 02:22:25 -0400
To: djgpp AT delorie DOT com
From: "Thomas J. Hruska" <thruska AT tir DOT com>
Subject: Re: Nested structure problem (maybe)?
In-Reply-To: <36318BAA.91343991@stargate.net>
Mime-Version: 1.0
Reply-To: djgpp AT delorie DOT com

At 01:11 AM 10/24/98 -0700, you wrote:
>ps. I typed part of the error codes generated when the program was run
>directly from the DOS prompt (from a 'print screen' printout). I would
>like to capture them all to include here but I dont know how. :( 

If you want to capture text from a screen to a file, you might want to
consider downloading Screen Thief.  True, you will lose some data because
it is shareware and adds its own header, but you will get most of the info.
you are after.  Quite a useful little toy if you want to make screenshots
for your games and other programs.

>ps2: This was run under DOS 6.2 on a P75.
>
>
><snip>
>
>
>int ParseFile(OBJECT_TYPE *list)
>{ char command[6][2] = {"Z","X","K","I","T","G"},
>       *p,*p1,*p2,tmp[256],tmp2[256];
>  int n,G;
>  double CX=0,CY=0,CI=0,CJ=0,X=0,Y=0,I=0,J=0,arc,start,inc,r;
>  RECORD_TYPE *record;
>  OBJECT_TYPE *graph_win;
>
>  graph_win=TagSearch(list,GRAPH_WIN); /* in debug this points to the
>correct data */
>  record=graph_win->file->records;     /* this also */ 
>  vflag.max=vflag.graph=0;             /* and this */
>  view_count=0;                        /* I'll get rid of this global
>eventually */ 
>
>  do{
>  X=CX; Y=CY;
>  vflag.park = 0;                       /* this one too */
>  p = record->text; /******* SIGSEGV first flagged here ******/
>  p1 = tmp;         /* Run to cursor at the *end* of this line and then
>debug in Rhide shows that record->text contains exactly what it is
>supposed to?
>
>
><snip>
>
>
>
>partial error code listing:
>
>Shutting down Allegro
>Exiting due to signal SIGSEGV
>Page fault at eip=000046b4, error=0004
>eax=00000000 ebx=00006bc4 ecx=0000000a edx=0008f0a0 esi=00000054
>edi=0004c790
>ebp=0008c2dc esp=0008c04a
>
>etc...

I had a problem similar to this once.  I kept trying to hunt down my
problem and I would do things like what you did with RHIDE's debug
features.  The answer to the whole problem, at least for me, lied in the
fact that I was going through the dynamic structures till I hit a NULL
pointer to the next structure.  That is, when I allocated space for the
next structure, I forgot to set the pointer to the next structure to NULL
(since there was no next structure).  The result of not setting NULL was
unpredictable and usually resulted in a floating point error under Borland
C++ (the 16-bit compiler I use before compiling under DJGPP) or a SIGSEGV
error under DJGPP.  Check your whole loop in that function code snippet for
allocations too, as the code might execute through the first time just
fine, but not the second or third.


                 Thomas J. Hruska -- thruska AT tir DOT com
Shining Light Productions -- "Meeting the needs of fellow programmers"
         http://www.geocities.com/SiliconValley/Heights/8504
                    http://shinelight.home.ml.org

- Raw text -


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