slurping in binary data

G

Guest

Not every intermediate stage of a program is bug-infested.

I'm sorry I'm having trouble with your english again.
If you have a bug then debug it. If you don't then don't.
Right now I haven't a clue what your problem is.

90% of programming is clear thinking and clear expression
of that thought (or maybe 100%...).

Programming languages, UML, debuggers etc. are just tools
to help you with those things.

f = fopen( filename, "r" );
if( f == NULL )
  if( f == NULL && f == NULL )
    if( f == NULL )
      if( really_really_NULL( f )) {
        perror( filename );
        exit( EXIT_FAILURE );

I rarely see code like that (even allowing for exageration). But
I *do* see code like this

f = fopen (filename, "r");
fscanf ("%d %d", &i, &j);
process_it (i, j);

That is code with *no* error checking. "What could go
wrong with reading a config file"?

Can't do it.  The words sting like "read the Book of Mormon."

to be blunt. I'm sure you are wrong about gdb. I've used ddd,
a graphical front end for gdb, and it could do that.

<10s on google>

ok, read this

http://sourceware.org/gdb/download/onlinedocs/gdb_6.html#SEC31

especially section 5.2. Especially this bit

"step
Continue running your program until control reaches a different
source
line..."

"next [count]
Continue to the next source line in the current (innermost) stack
frame.
This is similar to step, but function calls that appear within the
line
of code are executed without stopping. Execution stops when control
reaches
a different line of code at the original stack level that was
executing
when you gave the next command."



Note I've never used gdb or read the documentaion before
and I found what looks like what you need in *seconds*
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top