This includes the issue of resolving invalid breakpoints. 1. in the software package management area, select the relevant components of Kdevelop to install. 2. in the NS directory, make the following changes to the Makefile file: Add debugging information in the Code: Modify Makefile (without any suffix) will inside the CCOPT =-wall # if it is a ns-allinone-2.28, here is CCOPT =-O2STATIC = LDFLAGS = $ (STATI
This includes the issue of resolving invalid breakpoints.
1. Select the relevant components of Kdevelop to install in the software package management area.
2. In the NS directory, make the following changes to the Makefile file:
Add debugging information in the Code: Modify Makefile (without any suffix)
CCOPT =-wall # For ns-allinone-2.28, here is CCOPT =-O2
STATIC =
LDFLAGS = $ (STATIC)
LDOUT =-o $ (BLANK)
Changed:
CCOPT =-wall-g # if it is a ns-allinone-2.28, change here to CCOPT =-O2-g
STATIC =
LDFLAGS = $ (STATIC)
LDOUT =-o $ (BLANK)
3. Then recompile
Note: do not perform the following steps
Make clean
Make depend)
Make
(Note: make install is not required ).
4. Rename Makefile to Makefile. am.
5. Open Kdevelop and select "Project"-> "Import Existing Project ". In the Directory, select the NS Directory (the Directory where the Makefile is located), set the Project Name to a Name, and select "Generic C ++ Application (Custom Makefiles)" for the Project type )". select "OK ". Select "Populate.
6. Change Makefile. am to the name Makefile.
Previously I encountered the problem of invalid breakpoint settings. Later I found that the-g option was not added to the Makefile (step 2)
Then you can perform debugging:
1. Enter ns on the terminal and press Enter.
2. Select the menu command "Debug/Attach to process" in Kdevelop, find the NS process you just run in the dialog box, and press OK.
(Note: I encountered a problem here. I have always been prompted that there is no name defined in kdevelop. Define the project name in kdevelop as ns to solve the problem and debug it .)
3. Enter the tcl command on the terminal, such as "source test. tcl" and press Enter.
4. Set a breakpoint (it is invalid if a breakpoint is set at the beginning)
5. Select the Debug command Continue to Continue running the program. The debugging result is displayed.