[GRASS-dev] Re: [GRASS-user] g.gisenv DEBUG broken!

[moved to dev list]

Sorry, a wrong example, trying again -- GRASS *gisenv* variable DEBUG:

g.gisenv set=DEBUG=5
g.gisenv get=DEBUG
5

g.remove x
Remove <x>
WARNING: <x> nothing removed

.... no debug message, should be(?)

grep G_debug general/manage/lib/do_remove.c
G_debug (1, "%s: %s", list[n].desc[i],_("missing"));
G_debug (1, "%s: %s", list[n].desc[i],_("removed"));
G_debug (1, "%s: %s", colr2, _("missing"));
G_debug (1, "%s: %s", colr2, _("removed"));

odd, same here.

g.gisenv set="DEBUG=5"
echo "1|1" | v.in.ascii out=foo

no debug messages!

It seems that lstr = G__getenv( "DEBUG" ); in lib/gis/debug.c
fails for some reason (lstr gets set to NULL).

???

Hamish

hallo,
On Wed, Oct 11, 2006 at 06:30:50PM +1300, Hamish wrote:

[moved to dev list]

> Sorry, a wrong example, trying again -- GRASS *gisenv* variable DEBUG:
>
> g.gisenv set=DEBUG=5
> g.gisenv get=DEBUG
> 5
>
> g.remove x
> Remove <x>
> WARNING: <x> nothing removed
>
> .... no debug message, should be(?)
>
> grep G_debug general/manage/lib/do_remove.c
> G_debug (1, "%s: %s", list[n].desc[i],_("missing"));
> G_debug (1, "%s: %s", list[n].desc[i],_("removed"));
> G_debug (1, "%s: %s", colr2, _("missing"));
> G_debug (1, "%s: %s", colr2, _("removed"));

odd, same here.

g.gisenv set="DEBUG=5"
echo "1|1" | v.in.ascii out=foo

no debug messages!

It seems that lstr = G__getenv( "DEBUG" ); in lib/gis/debug.c
fails for some reason (lstr gets set to NULL).

???

Hamish

we discussed this with soeren (huhabla) on irc while ago with the
result, that if the module is runing in gdb environment, debuging works

i do not know why, but it was so :-/

jachym

--
Jachym Cepicky
e-mail: jachym.cepicky@centrum.cz
URL: http://les-ejk.cz
GPG: http://les-ejk.cz/gnupg_public_key/jachym_cepicky-gpg_public_key.asc
-----------------------------------------
OFFICE:
Department of Geoinformation Technologies
Zemedelska 3
613 00, Brno
Czech Republick
e-mail: xcepicky@node.mendelu.cz
URL: http://mapserver.mendelu.cz
Tel.: +420 545 134 514

> > .... no debug message, should be(?)

..

> odd, same here.
>
> g.gisenv set="DEBUG=5"
> echo "1|1" | v.in.ascii out=foo
>
> no debug messages!

..

> It seems that lstr = G__getenv( "DEBUG" ); in lib/gis/debug.c
> fails for some reason (lstr gets set to NULL).

..

we discussed this with soeren (huhabla) on irc while ago with the
result, that if the module is runing in gdb environment, debuging
works

i do not know why, but it was so :-/

it works for this:
g.mremove foo*

and this:
v.db.addtable rand_pts

but not for this:
echo "1|1" | v.in.ascii out=foo

?
Hamish

Hi all,

is there anybody who has *no* problem with g.gisenv variable DEBUG?? I
have, I was trying to find out why... I have found a strange problem
in function

G_getl2 ()

[...snip...]

    buf[i] = '\0';

    G_debug ( 4, "G_getl2: ->%s<-", buf ); <-----------
    // G_debug helps
    return ret;
}

After reading the first line in read_env() [env.c], the function
G_debug () is called, it cause that (see debug.c) grass_debug_level
variable is set to 0. As a result no debug message will be displayed
regardless to DEBUG value.

I don't know why, just trying to find out why no debug messages are
not displayed any more...

Best, Martin

2006/10/11, Hamish <hamish_nospam@yahoo.com>:

> > > .... no debug message, should be(?)
..
> > odd, same here.
> >
> > g.gisenv set="DEBUG=5"
> > echo "1|1" | v.in.ascii out=foo
> >
> > no debug messages!
..
> > It seems that lstr = G__getenv( "DEBUG" ); in lib/gis/debug.c
> > fails for some reason (lstr gets set to NULL).
..
> we discussed this with soeren (huhabla) on irc while ago with the
> result, that if the module is runing in gdb environment, debuging
> works
>
> i do not know why, but it was so :-/

it works for this:
g.mremove foo*

and this:
v.db.addtable rand_pts

but not for this:
echo "1|1" | v.in.ascii out=foo

?
Hamish

--
Martin Landa <landa.martin@gmail.com> * http://gama.fsv.cvut.cz/~landa *