[GRASS5] Re: v.out.e00
Markus Neteler
neteler at itc.it
Mon Dec 17 04:29:00 EST 2001
Hi Gordon,
(I cc this to "grass5" to get the other informed)
On Fri, Dec 14, 2001 at 12:14:30PM -0700, gordon.haverland at gov.ab.ca wrote:
>
> Hello Markus,
> Well, I've been working on v.out.e00 for about a week now, and I think I
> need a day or so to think about things.
>
> Yes, there are some bugs in the existing code. In fact, I am pretty
> sure that the code submitted never ran on any architecture (let alone this
> Intel Linux machine). However, there is something else going on with the
> code that I am having problems tracking down.
>
> In the code before the "calculation" of the Universe polygon, is a
> branch of code which builds the doubly linked list which is searched to
> build the polygon and also has: if( map.Link[i].left < 0 ) {
> map.Link[i].left = 1;
> } else {
> map.Link[i].left += 1;
> }
> and similar for right. I've tried 4 or 5 variations on writing that chunk
> of code dealing with the renumbering of map.Link[i].(right|left) now. If
> I put fprintf(stderr,"...") statements before and after that code, I get
> the similar result as if I have no fprintf()s there. That is, the if left
> is less than 0, that left is multiplied by -1. Sometimes right gets set to
> 1 and sometimes it is left alone. However, if I put fprintf()s between
> the right and left chunks of code, now it renumbers left and right
> correctly. Which seems to me to be a compiler bug. However, it may be a
> problem with the vector library, because almost every line read from a
> grass vector file comes out with lines which consist of a single node
> pointing to itself (N1 almost always equals N2).
>
> It would be a LOT easier to follow what is going on, if I could do this
> debugging inside emacs with gdb, instead of using a zillion fprintf
> statements. Do you know how I can arrange to run GRASS binaries inside
> GDB? Do I have to compile all of grass with
> -ggdb?
>
> Have a great weekend!
> Gordon Haverland
Please have a look at
documents/debugging.txt
in the source code. It tells you how to debug with GDB. I assume that
you have been trying to debug
$GISBASE/bin/module
which is only a hard-link to front-end. The real binary which is
happily accepted by a debugger lives in
$GISBASE/etc/bin/cmd/module
Of course "-g" is required (and no "-s").
Hope this helps,
you fixes will be appreciated!
Markus
PS: Please be sure to work on the latest code in CVS (release branch).
It is also included in the CVS snapshot.
More information about the grass-dev
mailing list