Click here to Skip to main content
11,437,649 members (34,503 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# Java
how to trace & debug my C# & java programs please tell me the steps involved in it?
Posted 12-Sep-12 4:09am
Comments
aspnet_regiis at 12-Sep-12 9:18am
   
Do you have Visual Studio installed?
Wes Aday at 12-Sep-12 9:20am
   
Okaaaaaaay..... I know this is going to come as a shocking answer.... use a debugger.....
Manfred R. Bihy at 12-Sep-12 9:25am
   
Wes, Wes, Wes :sadheadshake:! Debuggers are for wusses. Real men sprinkle their code with logging statements at a rate of about 50\50 and then analyze the logfiles. :D

:P
OriginalGriff at 12-Sep-12 9:28am
   
Hah! Logfiles are for softies! Real men add assembly level register printing to serial output and analyse it in real time! :laugh:
Malli_S at 12-Sep-12 9:29am
   
lol ! Did you miss the interrupts ? :laugh:
OriginalGriff at 12-Sep-12 9:42am
   
You can't use interrupt driven serial ports for serious debugging - the interrupt handler can change the status of the processor. To get a realistic picture you need to poll, or ensure that the internal buffer of the SIO device is big enough to hold the whole output. :)
Malli_S at 12-Sep-12 9:29am
   
Agreed ! :P
Wes Aday at 12-Sep-12 9:30am
   
I hate to disagree... but a real man would just use a pen (pencils are for sissys) and paper (cocktail napkin) to bench check everything.... :-) Who the heck wants to read log files? lol
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Ignoring the Java side - I don't use it, so I can't comment (but it won't be very different) the debugger is built into VS.

When you run your program with the F5 key, it attaches a debugger to the application, and allows you to do an enormous range of things, from the basic "add a breakpoint" (which stops your program running when it reached a specified line of code) to viewing an amending variable values and single stepping through the code to follow exactly what is going on.

How to do it? Run the program, and use the "Debug" menu to select what you want to do.

We can't give you a full explanation, there is too much there. But start reading here: http://msdn.microsoft.com/en-us/library/sc65sadd.aspx[^] and you might get the basics.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

No need to ignore the Java side!

Debugging etc. is included If you use a decent IDE like Eclipse or Netbeans.
Both are FREE and one of them should be used by every one developing software in Java.

You can actually also develop software in C# with Eclipse.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web04 | 2.8.150506.1 | Last Updated 12 Sep 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100