Visual Studio Problems > Debugging

A

Advocated

Hi there, just wondering if anyone uses visual studio 6?

Im having real problems, just with debugging, i could either do with a
really good tutorial, if anyone knows of one, but the main thing is, when i
run the debugger, as soon as it gets to my first printf statement, its
asking me "please enter the path for PRINTF.C"

Any ideas?
 
M

Malcolm

Advocated said:
Hi there, just wondering if anyone uses visual studio 6?

Im having real problems, just with debugging, i could either do with a
really good tutorial, if anyone knows of one, but the main thing is,
when i run the debugger, as soon as it gets to my first printf statement,
its asking me "please enter the path for PRINTF.C"
Generally I find that debuggers are difficult and confusing things to use,
so I rely on diagnostic printf's. One useful thing they can tell you is
where your program crashed.

Your debugger is obviously trying to step into the source code for printf,
which is unlikley to be available. Even it was available it is unlikely that
your bug is caused by a badly-implemented library function.

You should have options to "step over" functions you know to be OK. There's
also probably a way of telling it that printf() is a library function, but
as I said, debuggers are horrible things to use.
 
P

Peter Pichler

Advocated said:
Hi there, just wondering if anyone uses visual studio 6?

Maybe, maybe not. In this group, a compiler does not matter. We only discuss
issues that work the same way in all (ISO/ANSI) C compilers.
Im having real problems, just with debugging, i could either do with a
really good tutorial, if anyone knows of one, but the main thing is, when i
run the debugger, as soon as it gets to my first printf statement, its
asking me "please enter the path for PRINTF.C"

<OT>Have you tried to 'step over' rather that 'step into'? Do you really
*need* to debug printf?</OT>

Peter
 
K

Kevin Goodsell

This is off-topic here, and you should ask these questions in a group
that discusses your debugger. I'll just say that 1) this isn't a
problem, you can cancel the dialog then step-out of the the printf()
function, 2) you can avoid this completely by using step-over instead of
step-into on standard functions, and 3) I'd suggest installing the C
library source code - you just re-run the installation and select it.
This won't help your specific problem much (you'll step right into
printf(), which isn't where the problem is), but can be useful when a
problem is caused by passing a bad argument to a standard function.
Generally I find that debuggers are difficult and confusing things to use,
so I rely on diagnostic printf's. One useful thing they can tell you is
where your program crashed.

So can a debugger, and much more quickly.
Your debugger is obviously trying to step into the source code for printf,
which is unlikley to be available. Even it was available it is unlikely that
your bug is caused by a badly-implemented library function.

You should have options to "step over" functions you know to be OK. There's
also probably a way of telling it that printf() is a library function, but
as I said, debuggers are horrible things to use.

Debuggers are incredibly useful tools, and you'd be well-advised to get
comfortable using them. What do you do when your diagnostic printf()
calls change the program enough to make the bug disappear until the
printfs are removed? I think most people with much experience debugging
have seen things like this happen.

-Kevin
 
J

Jared Dykstra

Advocated said:
Hi there, just wondering if anyone uses visual studio 6?

Im having real problems, just with debugging, i could either do with a
really good tutorial, if anyone knows of one, but the main thing is, when i
run the debugger, as soon as it gets to my first printf statement, its
asking me "please enter the path for PRINTF.C"

Any ideas?

The debugger is looking for symbolic debugging information. Just
click Cancel, there aren't going to be bugs in the printf() function
anyway.

At any rate, this post is waaaaaaay off topic as comp.lang.c is
concerned with the symantics of the language, not anything specific to
a certain toolchain or IDE.
 
R

Richard Heathfield

The debugger is looking for symbolic debugging information. Just
click Cancel, there aren't going to be bugs in the printf() function
anyway.

It's funny you should say that. :) As it happens, in at least one early
release of Visual Studio 6, there /is/ a bug in printf - or in something it
calls. To find out whether your copy of Visual Studio 6 has this bug, try
out the following program:

#include <stdio.h>

int main(void)
{
unsigned long count = 0;
while(getchar() != EOF)
{
++count;
}
printf("%lu\n", count);
return 0;
}

Give it a bunch of characters from the keyboard, then ^Z ENTER

If you get output, you don't have that bug.
At any rate, this post is waaaaaaay off topic as comp.lang.c is
concerned with the symantics of the language, not anything specific to
a certain toolchain or IDE.

Right.
 

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
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top