This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: gdb-help
Anand Ganesh wrote:
>
> Hi,
> I am not sure this is the right forum for a question on gdb.
Probably not.
But you caught me on a good day. ;-)
> Please let me know if there is a better one.
Dunno.
>
> I am trying to use gdb for a glut program :
>
> #include <stdlib.h>
> #include <stdio.h>
> #include <GL/glut.h>
>
> int
> main(int argc, char** argv) {
> glutInit(&argc, argv);
> glutInitDisplayMode( GLUT_RGBA | GLUT_DOUBLE | GLUT_DEPTH);
> return;
> }
>
> In gdb I put in a breakpoint after glutInit and tried to call
> glutInitDisplayMode from gdb itself (call ...). It says it cant recognise
> GLUT_RGBA. How do I get gdb to recognise it ? If I try load gdb complains
> that you cant do that when your target is procfs...
Your problem is that GLUT_RGBA is a macro-defined constant, i.e. a
creature of the preprocessor and lost by actual compile time. Find the
value it's defined to be and use that.
Alternatively, if this is your own code, define similarly named
variables to these constants to allow you to use them at debugging time,
as in
int MY_GLUT_RGBA = GLUT_RGBA;
etc.
HTH,
--ag
> Thanks in advance,
> ag.
--
Artie Gold, Austin, TX
mailto:agold@bga.com or mailto:agold@cs.utexas.edu
--
"If you come to a fork in the road, take it." L. P. Berra