This article is reproduced from: http://blog.9cbs.net/visioncat/archive/2004/08/09/69532.aspx
DEV-CPP / MINGW32 Environment Introduction (3)
Review:
The above "DEV-CPP / MINGW32 Environment Introduction (2)" introduces some features of DEV-CPP, where there is a package installation and some small features. I hope to get your satisfaction. This time, we continue to introduce other features of DEV-CPP. In fact, tell the truth. For GNU's things, I personally feel comfortable to use it. I do not know why either. There are a lot of features that make a simple character in the prompt, you can complete the features that you need to do a lot of mouse like Windows Ide. I said that this is not an unreasonable hole. I will show you this view.
Chapter 5 Debugging under DEV-CPP
For any programmer, the program's debugging needs to be needed. If there is no program debugging, what is the stability of the program? Now let's take a look at how to use DEV to debug our dear procedure. It is well known that GNU has a great debugger GDB, but because of the usual use of VC. Therefore, there are many people who have smelling this procedure. Now let's open his cover. First of all, we are overexpressed, starting DEV-CPP this time we have to do this at DEV-CPP. Under DEV-CPP, the debugger is not as specifically a dedicated program interface as in VC. His debug interface is below the code box. Just choose the following debug tab to see the debug interface. Will there be a bleak feeling after you see the debug interface? In fact, I have been desolate for several years. Everyone will take it. There are three options in the Test tab. Debug, backtrack, output. Among them, debugging is to make a button for a button to make it easy. But I personally think this feature is convenient to say. Because sometimes it is a very simple operation, it will make the man who uses the man who is busy. Trace, is displayed about the information about the GDB-level function, this feature is not bad. The output is to output the user's GDB command to the GDB program. There is no button, but this interface is not very good place, that is, the window that shows GDB returns information is too small. There is a feeling of peak in a peer, very uncomfortable. So many words, I feel some coming. Are you tickle? (Which is not a small child?) Now open a program, it is best to have a multi-point, the parameter multipoint, function multiple points, programs. Because this can help you understand the basic running mechanism. Click the debug button for the debug window. If your program is not debugging, then DEV will prompt you to recompile the program to join debugging information. The choice is. Then the program will recompile the connection program using the DEBUG. After completion. Let's take a look at your own procedure. First, let's run GDB first. Click debugging, or move the cursor of the editing area to the location you want to run Click to run to the cursor. Then, the program will start running. Where you will see a blue strip in the editing area. This indicates where the program is running. If you like, you can continue to run down. You can complete it when you click Next. For other operations about GDB, such as the code, the variables of the view, information of the function, etc., only through the output. Select Output and enter your GDB command in the character input box in the output. For example: List This command will list the code of the program in the following character box. Of course, you have to find it up and down because the box is too small, it looks very troublesome. Ok, Ideated to debug in the IDE, I will introduce it here. In deepening things, there is no more in-depth. If you are deeply in-depth, I am afraid that I have not exhausted, everyone can look up. In fact, some of the operations described above can be easily OK if the reminder is. It is even more complicated. I think, maybe this is a major reason that dev can't pop it. Because the operation of the interface is too unmanned. Chapter 6 Debugging in Prosecution
In the previous chapter, we appreciate debugging under DEV-CPP. It's really someone else. Let's appreciate the standard, classic GDB debugging. If you know if you have a system such as Linux, you should know that the prompt is a common interface of many classic software. So, use some classic things, it seems to be familiar with how familiar with the prompt. Of course, the prompt here is not as troublesome, there must be hundreds of orders to be memorized. In fact, like GDB, it is basically a very simple command to solve. And very flexible. Let me introduce a GDB debugging. First we have to have a code that can debug. Now we use gcc main.c -o main -g to generate a debugged code. Then use GDB main to start GDB. Is it so complicated? If you will see a GDB copyright information, then (GDB) This prompt is followed. Now you can command your gdb. Look at the program code. If we want to see the source code of the debugger and don't want to turn on Main.c (more reason is to set the breakpoint for the back to set the breakpoint.). Then we can enter List or LIST or L can view the program code. is not it? It seems that the prompt is not as terrible as we think. Run the program code. Although the debugging can be possible, how should we run the code when debugging? Very simple. Enter Run or R can run. If you set a breakpoint in front, use this command to allow the program to run to breakpoints. Set breakpoints for debugging. Using BREAK can set a breakpoint, let the debugger stops running in the breakpoint. There must be a parameter behind Break. The parameter can be a line number. For example, BREAK 10 sets breakpoints at the 10th line. It can also be a function name BREAK Main to set breakpoints at the main function. View program variables. If you look like the variables in the program, you can use the Paint or P command to be implemented. These two commands must be added with the variable name. If p argc is the value of the Argc. Use the info command to view the relevant information, such as the memory location. Step by step running the program. If you execute a program on a step-by-step step, you can use the n or next command to perform the next line of code. Exit debugging. Enter Q to exit. Does it feel that the debugging of the prompt is simpler than the IDE? Don't think that this is the full functionality of GDB. I am here just to show GDB. If you have to learn more about how to use GDB. You can find a lot of technical manuals or to find a related article online. Finally, if you have any questions about the GDB and debuggers, we can discuss together.
Textual sound:
This article seems to be very short, I also think. However, there is no way. The so-called unchecked. This chapter is always going to speak. Simply writing some early. Next article we will enter the establishment of the project and the use of static libraries. I think it will make you feel excited. Finally, I hope you can advise a lot. My motto: Whether it is thinking or a procedure, only through constant exchanges can be more perfect.
Studio software development group
Beidou Ringjun (Huang Yucui)