POV-Ray : Newsgroups : povray.beta-test : Can someone force-test "balcony.pov"? : Re: Can someone force-test "balcony.pov"? Server Time
28 Jul 2024 18:19:45 EDT (-0400)
  Re: Can someone force-test "balcony.pov"?  
From: Warp
Date: 20 Jan 2009 15:57:22
Message: <49763ab1@news.povray.org>
clipka <nomail@nomail> wrote:
> I have, basically, not the slightest idea about how to debug on Linux. I just
> picture that, judging from popular Linux-jockey tools like vi and such, it
> might be VERY far from trivial to get going... something like good old DOS
> "debug" comes to my mind - me no want ;)

  While gdb doesn't have a fancy GUI, it supports most of the same things
that eg. the Visual Studio debugger does. Granted, you'll have to write
commands rather than being able to click with the mouse, but this is a
tool which has been designed with the same principles as the whole gcc
suite (and the whole linux/posix/unix world).

  The most common, and also easiest, task for which gdb is very handy is
determining the exact point where a program crashes. You do it like this:

1) Compile your program with debug info (-g) and without optimizations.

2) Start gdb with your program, ie. like "gdb ./myprogram"

3) Run the program with the "run" command. (If the program takes any
   command-line parameters, you can write them after the "run".) Run it
   so that it crashes, obviously.

4) gdb will report the exact line where it crashed. The most useful thing
   to do now is to write "bt" (shorthand for "backtrace"), which will print
   the entire function call chain up to the point of the crash, with the
   line numbers of each function call. (This is especially useful if the
   program is crashing inside a library and you want to see where it's
   being called from.)

5) If needed, you can print the values of variables in scope with the
   "print" command.

  You can, of course, also add breakpoints and advance the program step
by step, but those are a bit more advanced topics.

  Note how points 4) and 5) are actually identical to what the VS debugger
will show you. The only difference is that you have to write a few commands
to get them, because there's no GUI.

-- 
                                                          - Warp


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.