[LCP]Printing a Variables Value..!!!
Steve Baker
ice at mama.indstate.edu
Tue Jun 24 03:29:01 UTC 2003
Mike and/or Penny Novack <stepbystepfarm at mtdata.com> wrote:
> I believe what Mohamed is looking for is the capability of a BATCH debugger.
>
> I am too unfamiliar with the capabilities of the available C debuggers
As far as gcc is concerned it supports gdb, dbx and sdb, perhaps others, but
as far as Linux is concerned, gdb is your only real option. Gdb does seem to
offer a batch mode (-batch), but I am not certain if this is what you're
talking about, but it does seem so. There are some graphical debuggers, I
imagine they use gdb or dbx on the backend. Commerical compilers may have
their own debuggers. Programs must be explicitly compiled with debugging
support under gcc (-ggdb, et.al.). Gcc offers varying levels of debugging
information as well (--ggdb1 / --ggdb3).
> He has a LARGE application and perhaps thousands of variables any of
> which he might need to examine. This is a familiar situation to me
> although not in C. So I don't know which if any of the "standard" C
> debuggers might have a "batch" mode. These usually will do other things
> besides "debugging" -- for example, will any of the debuggers "profile"
> a program for you (display where a program spends its time, useful in
Profiling under gcc requires that you compile your program with profiling
support (-pg for gprof). You have to use gprof then to analyze the profile
information after the program has completed. Usually you want to profile with
optimizations enabled, and debug with them off, however gcc does support
debugging with -O.
I recommend to linux C programming newbies that they consider reading the
gcc man page at least once.
- Steve
More information about the linuxCprogramming
mailing list