Watch File Contents at Runtime In Netbeans - c

In My program i open a file and certain changes are being written to the file , so when i debug the program in netbeans (7.1) i want to see the contents at each stage , as i go through the break points

It sounds like you want to see the real time changes to the contents of a file as you step through your program in a debugger. In general the debugger is not great at displaying the contents of a file. The debugger is designed to display the state of the running program and not the state of external items such as the file system.
However you can easily watch the contents of the file through an external editor such as gVim or likely the actual IDE you're using. Most editors will detect the contents of the file changing on disk and prompt you to reload when it changes.

Related

How to start c app from desktop with double-click?

I have written one very simple app in C. I know how to run it through Visual studio, but i want to start it from desktop with a double-click. If I double-click on a .exe file made in folder, it does not start. How can I do this?
If you do not wish to modify your code so that it will wait for user input before closing (and there are many reasons that might be inappropriate), you could create a batch file wrapper:
myprog.bat
myprog.exe
pause
Then either you can double click the batch file or create a shortcut to the batch file then edit the shortcut to set the path to the batch file and the path from which to run (so it can find the exe).
That pretty much emulates how Visual Studio runs your code without terminating the window.
Another method you might consider is a batch file such as:
runner.bat
%1
pause
Then you can drag-and-drop your executable onto the runner.bat icon to run it. The advantage being that you don't have to create a new batch file and/or shortcut for every new executable.
Really though this is not a C question, or even a programming question - it is most likely off topic. If your code is ever required to run to completion unattended in a batch file for example, you would not necessarily want to add any interactivity to the program itself.
Your problem is that double clicking on a console app will open a new console window, run the program and then close the window.
VS studio does a trick where it runs the app in a new console window but keeps it open till you press a key.
You can add that same thing yourself - put a getchar() call at the end
Or you can make a bat file to run the app as per Cliffords answer
1st open the code with visual studio code
Run or Build the program
then u will find an executable file where u have saved your code
Open that executable file
but you must have installed mingw installed in your environment
you must compile it first with mingw or like compiler. and start it with by code:
cmd> yourdirectory(e.g Desktop)/ gcc yourcodefile.c your question is available also internet => how-to-compile-c-program

How do I can view what is really inside an *.asi file?

I have a file with .asi extension working as a plug-in of another program, and I wanna to see what's inside that file so I can understand how this plug-in works.
I tried to open my file with some programs such as File Viewer Plus and Notepad++ but I only see a series of strange characters. How do I can see what's inside my file?

How Can I View/Open This File?

i am trying to open and edit a file that contains some type of custom protection.
file game :gameguard.des
its from lineage2/interlude/system file.
this is not the original version though, it has been modified to block some packets sent to the server.
i've used VS2010 to open it and it shows me the memory and the contents in hex, like viewing computer memory.
here is the file attached. http://www20.zippyshare.com/v/88173717/file.html
so my question is, how can i open it viewing the code in a higher level and edit it? what tools i need to use to do that?
regards, George
This is a Win32 program. You can try to disassemble it, but it's itself a binary file and what the VS2010 is showing you is correct, because it's showing it most probably in HEX format to you.
You need to first figure out which compiler was used to compile this application, then maybe it helps you to refactor the executable.
The fact that you can not directly run this application might be just the extension, maybe if you change the extension to .exe, it runs under windows. I don't recommend it though.

how to know the path,where the errors and warnings are stored in eclipse

My doubt is related to the storage of Error/Warning Messages.
For example I wrote a C program in Eclipse IDE and compiled. The Error/Warning Messages are displayed in the problem tab.
If this is the situation which file in my computer contains the Error/Warning Messages. I need to know the location of this file because I am doing a project related to IDE creation.
Any suggestions or Ideas?
First of all you should know that what you see in Problems view in eclipse has not been saved as a log file in plain text. But if you want to see it:
1- Under each workspace there is a folder named ".metadata" . In linux it is a hide folder and you have to choose show hide files. I am not sure about windows.
2- open this path ".plugins/org.eclipse.core.resources/.projects/" under ".metadata".
3- choose the sub folder with the project name. (The project you want to see prolems for it).
4- there is two files holding the problems named ".markers" and ".markers.snap"
As said this is under Linux. Under windows may be it differs. But it should be something like this.
Not every text editor opens these files. I used emacs!

Error "There is no source code available for the current location."

I added the AjaxControlToolKit's sample DLL file as a reference to my web application. I used Mask text boxes on my pages.
While debugging the application, it first asked me to open MaskedEditExtender.cs file. So I just search it from my physical location and copied it in the Bin folder of the solution. Well ... now it is not asking for opening that file. But while debugging, after the content page, it debugs the master page as expected, but after just finishing debug of the master page, the debugger traverses to the MaskedEditExtender.cs file...
That is not much of an issue. That's fine (I am curious why this happening), but while debugging the MaskedEditExtender.cs file, it pop ups the message
There is no source code available for the current location."
with two buttons, "OK" and "Disassembly". What is this error? Why is it arriving? How do I avoid it?
You're missing the PDB file (program debug database) of the assembly where the exception occurs.
Open the Breakpoints window, locate the breakpoint, and delete it. This helped me...
You have arrive at a section of your program for which the debugger cannot associate a source code file. Either this is some third-party software for which you do not have the source code.
Or you have the source, but the debugger cannot associate the debugged code to that source file, since you are missing the debug symbols file (the PDB file). This file contains the mapping between the lines in the text source files and the memory address assigned by the compiler to your methods and members.
It could help if you would specify what method you are trying to drill down into when you get this message.

Resources