Re: Linux printf funny
- From: DJ Delorie <dj@xxxxxxxxxxx>
- Date: 27 Feb 2007 09:26:39 -0500
Paul Burke <paul@xxxxxxxxxx> writes:
So, please you Linux/ GCC experienced people- what absolutely basic
item of knowledge am I lacking?
How to use the debugger ;-)
Run your app under gdb, put a hardware watchpoint on your variables,
and see when they change. Or at least put a breakpoint after the
printf, continue until it reads nan, and inspect all the variables to
see which one is wrong (if any).
Sometimes, you can't use just printf to debug code.
If you can't use gdb to inspect the variables, write a routine to
hex-dump them (i.e. cast their address to unsigned char *, dump
sizeof(var) bytes), and call it from various places to try to track
down what's happening.
.
- References:
- Linux printf funny
- From: Paul Burke
- Linux printf funny
- Prev by Date: Re: Linux printf funny
- Next by Date: Re: Linux printf funny
- Previous by thread: Re: Linux printf funny
- Next by thread: Re: Linux printf funny
- Index(es):
Relevant Pages
|