www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/12/24/01:49:26

Date: Sun, 24 Dec 1995 08:41:25 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Geoffrey Wong <gwong AT cse DOT unsw DOT edu DOT au>
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Re: Memory

On Sat, 23 Dec 1995, Geoffrey Wong wrote:

> 	I think that I have some problem with the way memory was handled. I
> wrote this program and I am currently debugging it. Now the funny thing is 
> that when running under dpmi-mode (windows's dos shell) it ran okay, ( at 
> least for 1 function call, but the same function running under non-dpmi (straight dos) has segmentation violation error.
> 	I complied the programming under Unix, and I get segmentation violation
> error also.
> 	Dos anyone know why?

This seems like a bug in your program, because it crashes in DOS and Unix 
alike.  Probably something like using an uninitialized pointer or writing 
off the array limits.  But you didn't post the code which crashes, so 
it's really hard to guess what's wrong with it.

You can use the `symify' program which comes with DJGPP to see where 
exactly does your program crash.  The DJGPP FAQ list (available as 
faq102.zip from the same place you get DJGPP) explains how to use 
`symify' in section 9.5.

> 	Also , How can I pass arguments for gdb under dos? It accepts arguments
> but it ignores them!

This is a bug in that port of gdb.  It is corrected in the version which 
will come with DJGPP v2.0.  For now, you will have to use some 
workaround, like setting argv[] from within the debugger, or reading the 
arguments from some file, or hard-wiring them into your code when you 
debug.

- Raw text -


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