By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,227 Members | 1,376 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,227 IT Pros & Developers. It's quick & easy.

Visual Studio Problems > Debugging

P: n/a
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?
Nov 14 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Can you compile your program successfully???
Nov 14 '05 #2

P: n/a

"Advocated" <......@......com> wrote in message
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.
Nov 14 '05 #3

P: n/a
"Advocated" <......@......com> wrote in message
news:Nu***************@newsfep4-winn.server.ntli.net...
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
Nov 14 '05 #4

P: n/a
Zuan Chen wrote:
Can you compile your program successfully???


Yes. Thanks for asking.

--
Richard Heathfield : bi****@eton.powernet.co.uk
"Usenet is a strange place." - Dennis M Ritchie, 29 July 1999.
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
K&R answers, C books, etc: http://users.powernet.co.uk/eton
Nov 14 '05 #5

P: n/a
Malcolm wrote:
"Advocated" <......@......com> wrote in message
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"

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
--
My email address is valid, but changes periodically.
To contact me please use the address from a recent posting.
Nov 14 '05 #6

P: n/a
"Advocated" <......@......com> wrote in message news:<Nu***************@newsfep4-winn.server.ntli.net>...
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.

---
Jared Dykstra
http://www.bork.org/~jared
Nov 14 '05 #7

P: n/a
Jared Dykstra wrote:
"Advocated" <......@......com> wrote:
Hi there, just wondering if anyone uses visual studio 6?
<snip>
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.

--
Richard Heathfield : bi****@eton.powernet.co.uk
"Usenet is a strange place." - Dennis M Ritchie, 29 July 1999.
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
K&R answers, C books, etc: http://users.powernet.co.uk/eton
Nov 14 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.