From: benny@crocodial.de (Benjamin Riefenstahl)
Subject: Re:
6 Nov 1998 23:47:33 -0800
Message-ID: <3642D551.3906B2CE.cygnus.gnu-win32@crocodial.de>
References: <3.0.1.32.19981104215232.0069df28@user.rose.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
To: Keith Carscadden <kgc@user.rose.com>
Cc: gnu-win32@cygnus.com

Hi Keith,

Keith Carscadden wrote:
> with STATUS_ACCESS_VIOLATION. I eventually realized that the problem was
> caused by me passing a pointer to a literal (  char *test1 = "123    "; ),
> rather than a pointer to a character array. When I fixed this ( char
> test1[] = "123    "; ), the program ran as expected.
> 
> My question is, why did this run without an error under gdb, when it
> aborted when run under DOS?

To make constant strings read-only they are put into the code segment.
During ordinary runs, the code segmant will be read-only on Win/32. OTOH
gdb needs to be able to change the code to add breakpoints, so under a
debugger the code segment will be writable to allow this.

so long, benny
======================================
Benjamin Riefenstahl (benny@crocodial.de)
Crocodial Communications EntwicklungsGmbH
Ruhrstr. 61, D-22761 Hamburg, Germany
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".
