[GRASS5] Debugging modules ...

I did the following and was able to run a module with DDD (uses gdb).

In grass/src/CMD/head/head set the following (don't use any
optimization)

COMPILE_FLAGS = -g
LDFLAGS =

Then, for whatever module delete the OBJ* dir and rerun gmake5. Then
run gdb (or DDD in this case) on the executable in
<path>/grass-5.0b/etc/bin/<main | contrib>/cmd/<module> . The
executable in <path>/grass-5.0b/bin/ is not what you're interested in.

--
/bin/sh ~/.signature:
Command not found

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

"Eric G . Miller" wrote:

I did the following and was able to run a module with DDD (uses gdb).

In grass/src/CMD/head/head set the following (don't use any
optimization)

COMPILE_FLAGS = -g
LDFLAGS =

Then, for whatever module delete the OBJ* dir and rerun gmake5. Then
run gdb (or DDD in this case) on the executable in
<path>/grass-5.0b/etc/bin/<main | contrib>/cmd/<module> . The
executable in <path>/grass-5.0b/bin/ is not what you're interested in.

--

Eric,

This is mainly what I do (do you find the mouse behaviour a bit
quirky..?) In fact I have a whole tree with these flag options for
debugging : only too often you have to trace into library calls. But I
have had to run ddd through the GRASS environment, eg through the
terminal that opens GRASS. It mostly gets confused when you try to trace
into a forked process - do you have any insights on this?

Can I also suggest using a malloc debugger for some traces - I use the
preloadable NJAMD (Not Just Another Malloc Debugger) from:

http://fscked.org/proj/njamd.shtml

David

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

Hi Eric, Hi David,

thanks a lot for the information. I can run now DDD from within a grass
session. But i have the problem with r.reclass that i can not do any
input. Will investigate this further another time.

The "unstripped" binaries/libraries take up half of my diskspace.

I finally got the thing with the cmd/inter modules and the switching
with the bin in grass-5.0b/bin. Are all modules that use
interactive/commandline mode using the commandline module to process the
input from the interactive version? (e. g. r.reclass from bin/inter uses
system("r.reclass ...")).

Maybe i will write a script that exports the grass enviroment to use
DDD/gdb from outside the grass shell.

cu,

Andreas

Eric G . Miller wrote:

I did the following and was able to run a module with DDD (uses gdb).

In grass/src/CMD/head/head set the following (don't use any
optimization)

COMPILE_FLAGS = -g
LDFLAGS =

Then, for whatever module delete the OBJ* dir and rerun gmake5. Then
run gdb (or DDD in this case) on the executable in
<path>/grass-5.0b/etc/bin/<main | contrib>/cmd/<module> . The
executable in <path>/grass-5.0b/bin/ is not what you're interested in.

--
/bin/sh ~/.signature:
Command not found

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

--
Andreas Lange, 65187 Wiesbaden, Germany, Tel. +49 611 807850
Andreas.Lange@Rhein-Main.de - A.C.Lange@GMX.net

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

On Sat, Oct 21, 2000 at 09:38:20AM +0000, David D Gray wrote:

This is mainly what I do (do you find the mouse behaviour a bit
quirky..?)

That's an understatement (DDD is a little buggy itself).

In fact I have a whole tree with these flag options for
debugging : only too often you have to trace into library calls. But I
have had to run ddd through the GRASS environment, eg through the
terminal that opens GRASS. It mostly gets confused when you try to trace
into a forked process - do you have any insights on this?

Yea, forgot to mention about having to run it from an active GRASS
session. As far as forked processes go, must admit I don't know. I
don't use debuggers very often.

--
/bin/sh ~/.signature:
Command not found

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

On Sat, Oct 21, 2000 at 06:45:01PM +0200, Andreas Lange wrote:

Hi Eric, Hi David,

thanks a lot for the information. I can run now DDD from within a grass
session. But i have the problem with r.reclass that i can not do any
input. Will investigate this further another time.

Are you using an execution window? Should spawn an xterm for
input/output. Unfortunately, if you restart the program, you have to
specify this again.

--
#! /bin/sh
# ppp-address: What's my Internet Address for ppp0 ?
/sbin/ifconfig ppp0 | grep 'inet addr:' | sed \
's=.*inet addr\:\([0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\).*=\1='

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

Hi Andreas, Eric, all,

if you finally have some receipe to debug GRASS modules,
please add a short text to CVS for the others...

Thanks in advance

Markus

On Sat, Oct 21, 2000 at 10:18:56AM -0700, Eric G . Miller wrote:

On Sat, Oct 21, 2000 at 09:38:20AM +0000, David D Gray wrote:
> This is mainly what I do (do you find the mouse behaviour a bit
> quirky..?)

That's an understatement (DDD is a little buggy itself).

> In fact I have a whole tree with these flag options for
> debugging : only too often you have to trace into library calls. But I
> have had to run ddd through the GRASS environment, eg through the
> terminal that opens GRASS. It mostly gets confused when you try to trace
> into a forked process - do you have any insights on this?

Yea, forgot to mention about having to run it from an active GRASS
session. As far as forked processes go, must admit I don't know. I
don't use debuggers very often.

--
/bin/sh ~/.signature:
Command not found

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

--
Dipl.-Geogr. Markus Neteler * University of Hannover
Institute of Physical Geography and Landscape Ecology
Schneiderberg 50 * D-30167 Hannover * Germany
Tel: ++49-(0)511-762-4494 Fax: -3984

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'