Wijlaars, M.W. wrote:
> Hello Duan,
>
> I've been trying to debug the code with printf and even tried with GDB (Still 
> need to read "The art of Debugginng"). This is the first time I,ve used GDB 
> so I'm a bit at lost.
> The code segfaults somewhere in the server.c file. I think the segfault 
> occurs inside the server_loop function and I suppose it segfaults because the 
> new flash driver functions are not known of not called correctly. I'm not 
> sure why but GDB tells me the segfault occurs in an unknown function al line 
> "". I'll probably will continue debugging and keep you informed.
> If it will help get the openocd flash code working correctly with the 
> ADuC702x micro controller I can send you a very exprimental PCB with the 
> ADuC702x and a JTAG interface on it which I'm developing.
>
> Cheers Marcel Wijlaars
>
>   

1) A helpful command - when it dies (in gdb) a horrible death is "bt" 
-for back trace. It would un-wind the entire call stack.

You can then see where you came from.

2) Why no symbols? Not sure why, try this:

 When you "./configure" openocd, type these commands.

    bash$   CFLAGS=-ggdb
    bash$   export CFLAGS
    bash$   ./configure  -what-ever-options-you-normally-use

The option, to be clear is:   <dash><g><g><d><b>, with 2 Gs.

3) Then build openocd, by doing that, it should include a full set of 
debug records in the EXE file for GDB.
    Perhaps openocd is being built without debug information.

4) >> I can send you a very exprimental PCB

    Another toy? Hmm Interesting, you (.nl) are across the pond from me 
(us) It would be costly for you, and take a while days to get here. 
Perhaps we can solve it this way a little faster.

5) Why don't you use the LOG_DEBUG("I am here") macro - and place it all 
over your code.
    The macro works just like printf() - and - includes the filename, 
line number, and function.

    Then - all you need to do is start OpenOCD with the "-d" option
    Or - add the "debug_level 3" command to your 'openocd.cfg' file.

    You should - be able to do a "binary search" and narrow this down 
rather quickly.

-Duane.










_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to