🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.os2.programmer
Article #2188

How to debug in OS/2 with GCC 2.2.2?

#2188
From: Wey Jing HO
Date: Tue, 29 Sep 1992 19:07
41 lines
2170 bytes
PLEASE HELP ME!!

I've been trying to port most of my DOS C-programs to OS/2 using GCC 2.2.2
(modifying some parts to allow me to work with bigger arrays).

Compiling the C-source is generally quite easy. I don't get any warnings
even with the "-Wall" flag turn on. However, I've been getting some mysterious
memory allocation errors (running the resulting program gives me error message
such as SYS3175 with access violation at 11959, SYS1808, and the software
diagnostic code (exception code) is 0005).

My question is, is there any debugger (PD/commercial) that I can use?
If not, can anyone help me?

Briefly, what I am trying to do:
1) declare unsigned char **variable;
2) variable = (unsigned char **)malloc(512*sizeof(unsigned char));
3) check malloc if == NULL;
4) variable[i] = (unsigned char *)malloc(512*sizeof(unsigned char)); 
   for (i=0; i<512; i++); (sorry, this line should appear first)
5) check malloc if == NULL;
6) variable[row][col] = (unsigned char)fgetc(instream);

The program will break with the above SYS errors at row = 256 and col = 0
(that means it manage to reach row = 255 and col = 511).

I compile the program with: gcc -c -Wall c-source.c
and link with: link386 c-source.obj, RUN.EXE;

So, what can I do to get rid of this problem?

Thank you for any kind soul that is willing to help me.

Wey Jing Ho
sci240s@monu6.cc.monash.edu.au

-- 
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>Wey Jing Ho    Tel: 61-3-573-2567   E-mail : sci240s@monu6.cc.monash.edu.au<
>Physics Dept., Monash University ( Caulfield Campus ), Melbourne, AUSTRALIA<
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Technical Details
Message-ID: <1992Sep29.190753.4833@monu6.cc.monash.edu.au>
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!munnari.oz.au!bruce.cs.monash.edu.au!monu6!sci240s

Show Full Headers
Complete Article Headers
Newsgroups: comp.os.os2.programmer,comp.os.os2.misc
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!munnari.oz.au!bruce.cs.monash.edu.au!monu6!sci240s
From: sci240s@monu6.cc.monash.edu.au (Wey Jing HO)
Subject: How to debug in OS/2 with GCC 2.2.2?
Message-ID: <1992Sep29.190753.4833@monu6.cc.monash.edu.au>
Followup-To: poster
Organization: Monash University, Melb., Australia.
Date: Tue, 29 Sep 1992 19:07:53 GMT
Lines: 41