LCDproc development and user support list

Text archives Help


[Lcdproc] Re: debugging


Chronological Thread 
  • From: joris AT robijn.net (Joris Robijn)
  • Subject: [Lcdproc] Re: debugging
  • Date: Sun Dec 2 23:02:01 2001

> could you please tell me (and the rest of us) (in short) how you've found
> the
> bug in my code?
> I'm kind of new to debugging of this sort ;)
> Is there some trick in gdb or did you "just" see the error in my code?

I'm far from a gdb debugging expert. I still like the good old
Borland IDE from Borland C 3 most. But I can tell how I did this.

I've first check wether it crashed with and without debug. It did
both. I've placed returns at the start of the all reporting
functions, to let them do nothing. It still crashed. So the cause was
not my new reporting function, and I could remove these things again.

I've then started "gdb server/LCDd". I let it run with "r -c
LCDd.conf -d lcdm001 -p 1300 -r 5", start "lcdproc K", it crashed and
I checked what "bt" (backtrace) told me. You could see that in the
stack of function calls there were some queer parameters for the
num() function. Too big x and num values.

Then after some checking the "bt" report further and some code
searching I found that the draw_frame function in render.c calls the
init_num function once first, and num for every rendered frame. So
the call that crashed above should be done from here somewhere. With
"b render.c:485" I set a breakpoint just there. Then I did some steps
(with "n" ) while init_num was called. I found (with a bit of luck)
that instead of that lcdm001_init_num was in the stack, lcdm001_num
appeared. That meant that num was called instead of init_num. I check
the driver structure "p lcd_ptr" probably) and saw num occured
double. And the source confirmed this.

So far my report :)

These bugs are so small, they sneak in everywhere.

Joris


--
Joris Robijn
<joris AT robijn.net>
Home: 053 4311 553
Mobile: 06 288 41 964

// To understand recursion, we must first understand recursion



  • [Lcdproc] debugging, Rene Wagner, 12/02/2001
    • [Lcdproc] Re: debugging, Joris Robijn, 12/02/2001

Archive powered by MHonArc 2.6.18.

Top of page