From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28483 invoked by alias); 9 Jul 2007 13:26:35 -0000 Received: (qmail 28471 invoked by uid 22791); 9 Jul 2007 13:26:34 -0000 X-Spam-Check-By: sourceware.org Received: from ik-out-1112.google.com (HELO ik-out-1112.google.com) (66.249.90.177) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 09 Jul 2007 13:26:32 +0000 Received: by ik-out-1112.google.com with SMTP id b35so568156ika for ; Mon, 09 Jul 2007 06:26:29 -0700 (PDT) Received: by 10.78.21.7 with SMTP id 7mr1563014huu.1183987588039; Mon, 09 Jul 2007 06:26:28 -0700 (PDT) Received: from localhost.mail.individual.net ( [85.179.195.59]) by mx.google.com with ESMTP id g1sm61938905muf.2007.07.09.06.26.26 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 09 Jul 2007 06:26:26 -0700 (PDT) To: gdb@sourceware.org Subject: argc - cant access memory Date: Mon, 09 Jul 2007 13:26:00 -0000 Message-ID: <87ejjhg137.fsf@gmail.com> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii From: Hadron Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2007-07/txt/msg00065.txt.bz2 I recently compiled and executed an opengl programming guide (redbook) example, hello.c, successfully. However, when I try to debug it under GUD I get ,---- | #0 main (argc=Cannot access memory at address 0x2d | ) at hello.c:93 `---- The code can be found here: http://opengl-redbook.com/code/ but is pasted below for convenience. It is compiled using the following Linux based makefile: ,---- | CC=gcc | COMPILE.c=$(CC) $(CFLAGS) -c | LINK.c=$(CC) $(CFLAGS) $(LDFLAGS) | LDLIBS=$(EXTRALIBS) | CFLAGS= -std=c99 -pedantic -Wall -D_GNU_SOURCE -g | | GLUT = -lglut | EXTRALIBS = $(GLUT) -lGLU -lGL -lXmu -lXext -lX11 -lm | | PROGS = \ | aaindex aargb accanti accpersp alpha3D \ | alpha bezcurve bezmesh bezsurf blendeqn \ | checker clip colormat combiner cubemap \ | cube dof double drawf feedback \ | fogcoord fogindex fog font hello \ | image light lines list material \ | mipmap model movelight multisamp multitex \ | mvarray pickdepth picksquare planet pointp \ | polyoff polys quadric robot scene \ | select shadowmap smooth stencil stroke \ | surface surfpoints teapots tesswind tess \ | texbind texgen texprox texsub texture3d \ | texturesurf torus trim unproject varray \ | wrap | | IMAGING_SUBSET = colormatrix colortable convolution histogram minmax blendeqn | | all: $(PROGS) | | clean: | rm -f $(PROGS) `---- The code is: ,---- | /* | * hello.c | * This is a simple, introductory OpenGL program. | */ | #include | #include | | void display(void) | { | /* clear all pixels */ | glClear (GL_COLOR_BUFFER_BIT); | | /* draw white polygon (rectangle) with corners at | * (0.25, 0.25, 0.0) and (0.75, 0.75, 0.0) | */ | glColor3f (1.0, 1.0, 1.0); | glBegin(GL_POLYGON); | glVertex3f (0.25, 0.25, 0.0); | glVertex3f (0.75, 0.25, 0.0); | glVertex3f (0.75, 0.75, 0.0); | glVertex3f (0.25, 0.75, 0.0); | glEnd(); | | /* don't wait! | * start processing buffered OpenGL routines | */ | glFlush (); | } | | void init (void) | { | /* select clearing color */ | glClearColor (0.0, 0.0, 0.0, 0.0); | | /* initialize viewing values */ | glMatrixMode(GL_PROJECTION); | glLoadIdentity(); | glOrtho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0); | } | | /* | * Declare initial window size, position, and display mode | * (single buffer and RGBA). Open window with "hello" | * in its title bar. Call initialization routines. | * Register callback function to display graphics. | * Enter main loop and process events. | */ | int main(int argc, char** argv) | { | glutInit(&argc, argv); | glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB); | glutInitWindowSize (250, 250); | glutInitWindowPosition (100, 100); | glutCreateWindow ("hello"); | init (); | glutDisplayFunc(display); | glutMainLoop(); | return 0; /* ANSI C requires main to return int. */ | } `---- It is not on all lines in main that I get this error. Ideas?