SlideShare a Scribd company logo
1 of 18
www.tetcos.com
Debugging in NetSim
Using Graphical User Interface (GUI)
and
Command Line Interface (CLI)
www.tetcos.com
1:Debugging through GUI
1. Before start any simulation
or debugging, make sure you
make a back up of
simulation folder present in
<NetSim_Install_Dir>src
Simulation. Eg: “C:Program
Files (x86)NetSim
StandardsrcSimulation”.
2. Work on the folder
Simulation
3. The folder simulation-copy
is a back-up of the original
files
A prerequisite to debugging is that the user has already
completed the “Hello World” Program in NetSim
www.tetcos.com
1:Debugging through GUI
4. Create a scenario in GUI of
the respective protocol
5. Open the protocol’s init
function. This will be present
in the .c file of respective
protocol
6. Ex : fn_NetSim_Zigbee_Init()
in 802_15_4.c.
fn_NetSim_CR_Init( ) in
802.22.c
7. Write getch() at the start of
the above function.
www.tetcos.com
1:Debugging through GUI
8. Build the protocol and replace the dll in bin folder in NetSim. Do not
close Visual Studio.
9. In NetSim, create a network scenario and simulate.
10. The simulation won’t start and will pause (because of getch()).
11. Switch to the Visual Studio window and put break point inside the
source code where you want to debug.
12. Go to “Debug->Attach to Process” in Visual studio and attach to
NetSimCore.exe.
www.tetcos.com
1:Debugging through GUI
13. Click on “Attach”
and continue the
simulation by
pressing Enter.
www.tetcos.com
1. The App path is the file location in the system in which NetSim has
been installed.
2. Typically this path would be “C:Program FilesNetSim
Standardbin”
3. To get it, right click on the NetSim icon and select Open File
Location.
4. The IO path (Input/output Path) is the path where the input and
output files of an application is written.
5. For NetSim, the IO path can be got by Start -> Run->
%temp%/NetSim.
6. Once you reach this folder, the user would notice that the path would
be something like “C:UsersRamAppDataLocalTempNetSim”
2:Information needed for CLI
www.tetcos.com
2:Information needed for CLI
7. The IO path is the path where the Configuration.xml (NetSim
Config file) of the scenario, that will be simulated, should be
present.
8. Create the required scenario in GUI as described previously to get
the config file( Ignore steps 4 and 7 of GUI)
9. You may also need the IP Address of the License Server. If the
user is running a floating license then this is the address of where
the dongle is running
10. For node locked licenses the IP Address need not be entered
www.tetcos.com
3:Debugging through CLI
1. Create the required scenario in GUI as described previously to get
the config file( Ignore steps 4 and 7 of GUI)
2. In the command window (cmd), open your apppath ( Write cd
<apppath> in cmd)
3. Then type NetSimCore.exe<space> -apppath<space><app
path><space>-iopath<space><io path><space>-
license<space>5053@<Server IP Address> -d
Figure 3.1
www.tetcos.com
3:Debugging through CLI
4. Then press Enter key to get screen like figure given below
Figure 3.2
www.tetcos.com
5. Now follow the steps 8 to 10 as mentioned in Debugging with
GUI section
3:Debugging through CLI
www.tetcos.com
3:Debugging through CLI
6. Enter the desired event id where you want to break ( see prev.
fig.) Execution will stop at the desired Event Id ( see fig. below)
www.tetcos.com
3:Debugging through CLI
7. Press enter then control goes to visual studio and stops at the
break point in the source code as shown in figure below.
8. All debugging options like step over (F10), step into (F11),
step out (Shift + F11), continue(F5) are available.
www.tetcos.com
4:Co-relating with Event Trace (CLI)
1. Enable the Event trace manually in the config file.
2. The config file Configuration.xml is located inside the IO Path.
Open this file in notepad / visual studio and change file name &
path in line marked in figure below; and set STATUS=ENABLE.
3. Sometimes in visual studio the entire file is opened in 1 line and to
see it in the correct format, click the reformat selection icon
www.tetcos.com
4:Co-relating with Event Trace (CLI)
4. Run the simulation as described in debugging through CLI
section without the the debug (–d) option.( This generates the event
trace)
5. Rename the Event trace file generated in previous step. This is done
to avoid over writing of the file when the simulation is run. So while
debugging the code flow is compared against a recorded event trace.
6. Run the simulation as described in Debugging Through CLI section
again and enter -1 as event id to break in .This is required to watch the
variable.
www.tetcos.com
7. Open the C file inside the protocol folder inside Simulation folder
that has the init function as explained in the earlier slides. The run
function will be present in the same file.
8. There will be a switch case statement , where the switch
is on the variable nEventType.
4:Co-relating with Event Trace (CLI)
www.tetcos.com
4:Co-relating with Event Trace (CLI)
9. Set a break point there and check the values of members of this
struct as the code executes using F5, F10 and F11 keys
10. Add a watch as described in the coming slides on
pstruEventDetails variable .
11. Compare it with the event trace file generated in steps 1-4. The
values will match exactly.
www.tetcos.com
5:Viewing & Accessing variables
1. To follow a variable through execution, use “Add Watch” option
available.
2. Some variables cannot be viewed directly when added in the watch
tab, as this would throw the error: “CX0017: Error:symbol
“Variable_Name”not found”.
3. In the call stack window one can find the file in which that variable
is situated.
4. If this file is grey color in the call stack window, then load it
knowing the location of its .pdb file (Refer to user manual)
www.tetcos.com
5. Otherwise, if variable is already loaded add prefix
{,,<filename>.dll} to the variable name and press enter (Refer to
user manual)
6. For eg. For viewing pstruEventDetails prefix {,,NetworkStack.dll}.
5:Viewing & Accessing variables
• Prefixing {,,Networkstack.dll} before
variable name and press Enter to see
the watch window.

More Related Content

Similar to Debugging in net_sim

C# Security Testing and Debugging
C# Security Testing and DebuggingC# Security Testing and Debugging
C# Security Testing and DebuggingRich Helton
 
O porque das minhas aplicações funcionarem... E o que acontece com os recurso...
O porque das minhas aplicações funcionarem... E o que acontece com os recurso...O porque das minhas aplicações funcionarem... E o que acontece com os recurso...
O porque das minhas aplicações funcionarem... E o que acontece com os recurso...Comunidade NetPonto
 
Salesforce ANT migration
Salesforce ANT migration Salesforce ANT migration
Salesforce ANT migration Cloud Analogy
 
The Ring programming language version 1.8 book - Part 95 of 202
The Ring programming language version 1.8 book - Part 95 of 202The Ring programming language version 1.8 book - Part 95 of 202
The Ring programming language version 1.8 book - Part 95 of 202Mahmoud Samir Fayed
 
15LLP108_Demo4_LedBlinking.pdf1. Introduction In D.docx
15LLP108_Demo4_LedBlinking.pdf1. Introduction In D.docx15LLP108_Demo4_LedBlinking.pdf1. Introduction In D.docx
15LLP108_Demo4_LedBlinking.pdf1. Introduction In D.docxfelicidaddinwoodie
 
Cracking CTFs The Sysbypass CTF
Cracking CTFs The Sysbypass CTFCracking CTFs The Sysbypass CTF
Cracking CTFs The Sysbypass CTFRiyaz Walikar
 
Software industrialization
Software industrializationSoftware industrialization
Software industrializationBibek Lama
 
BP501 - Building and deploying custom IBM sametime connect client installatio...
BP501 - Building and deploying custom IBM sametime connect client installatio...BP501 - Building and deploying custom IBM sametime connect client installatio...
BP501 - Building and deploying custom IBM sametime connect client installatio...Carl Tyler
 
computer notes - Inter process communication
computer notes - Inter process communicationcomputer notes - Inter process communication
computer notes - Inter process communicationecomputernotes
 
maXbox Starter 42 Multiprocessing Programming
maXbox Starter 42 Multiprocessing Programming maXbox Starter 42 Multiprocessing Programming
maXbox Starter 42 Multiprocessing Programming Max Kleiner
 
R12 d49656 gc10-apps dba 16
R12 d49656 gc10-apps dba 16R12 d49656 gc10-apps dba 16
R12 d49656 gc10-apps dba 16zeesniper
 

Similar to Debugging in net_sim (20)

C# Security Testing and Debugging
C# Security Testing and DebuggingC# Security Testing and Debugging
C# Security Testing and Debugging
 
O porque das minhas aplicações funcionarem... E o que acontece com os recurso...
O porque das minhas aplicações funcionarem... E o que acontece com os recurso...O porque das minhas aplicações funcionarem... E o que acontece com os recurso...
O porque das minhas aplicações funcionarem... E o que acontece com os recurso...
 
Lab 1 Essay
Lab 1 EssayLab 1 Essay
Lab 1 Essay
 
Yobi d2 naver(create)
Yobi d2 naver(create)Yobi d2 naver(create)
Yobi d2 naver(create)
 
Cracking CTFs - Sysbypass CTF Walkthrough
Cracking CTFs - Sysbypass CTF WalkthroughCracking CTFs - Sysbypass CTF Walkthrough
Cracking CTFs - Sysbypass CTF Walkthrough
 
hw4_specifications
hw4_specificationshw4_specifications
hw4_specifications
 
hw4_specifications
hw4_specificationshw4_specifications
hw4_specifications
 
Salesforce ANT migration
Salesforce ANT migration Salesforce ANT migration
Salesforce ANT migration
 
The Ring programming language version 1.8 book - Part 95 of 202
The Ring programming language version 1.8 book - Part 95 of 202The Ring programming language version 1.8 book - Part 95 of 202
The Ring programming language version 1.8 book - Part 95 of 202
 
15LLP108_Demo4_LedBlinking.pdf1. Introduction In D.docx
15LLP108_Demo4_LedBlinking.pdf1. Introduction In D.docx15LLP108_Demo4_LedBlinking.pdf1. Introduction In D.docx
15LLP108_Demo4_LedBlinking.pdf1. Introduction In D.docx
 
Cracking CTFs The Sysbypass CTF
Cracking CTFs The Sysbypass CTFCracking CTFs The Sysbypass CTF
Cracking CTFs The Sysbypass CTF
 
Software industrialization
Software industrializationSoftware industrialization
Software industrialization
 
Srgoc dotnet
Srgoc dotnetSrgoc dotnet
Srgoc dotnet
 
Readme
ReadmeReadme
Readme
 
BP501 - Building and deploying custom IBM sametime connect client installatio...
BP501 - Building and deploying custom IBM sametime connect client installatio...BP501 - Building and deploying custom IBM sametime connect client installatio...
BP501 - Building and deploying custom IBM sametime connect client installatio...
 
computer notes - Inter process communication
computer notes - Inter process communicationcomputer notes - Inter process communication
computer notes - Inter process communication
 
maXbox Starter 42 Multiprocessing Programming
maXbox Starter 42 Multiprocessing Programming maXbox Starter 42 Multiprocessing Programming
maXbox Starter 42 Multiprocessing Programming
 
R12 d49656 gc10-apps dba 16
R12 d49656 gc10-apps dba 16R12 d49656 gc10-apps dba 16
R12 d49656 gc10-apps dba 16
 
Users guide
Users guideUsers guide
Users guide
 
Computer Science Assignment Help
Computer Science Assignment HelpComputer Science Assignment Help
Computer Science Assignment Help
 

Recently uploaded

call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 

Recently uploaded (20)

call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 

Debugging in net_sim

  • 1. www.tetcos.com Debugging in NetSim Using Graphical User Interface (GUI) and Command Line Interface (CLI)
  • 2. www.tetcos.com 1:Debugging through GUI 1. Before start any simulation or debugging, make sure you make a back up of simulation folder present in <NetSim_Install_Dir>src Simulation. Eg: “C:Program Files (x86)NetSim StandardsrcSimulation”. 2. Work on the folder Simulation 3. The folder simulation-copy is a back-up of the original files A prerequisite to debugging is that the user has already completed the “Hello World” Program in NetSim
  • 3. www.tetcos.com 1:Debugging through GUI 4. Create a scenario in GUI of the respective protocol 5. Open the protocol’s init function. This will be present in the .c file of respective protocol 6. Ex : fn_NetSim_Zigbee_Init() in 802_15_4.c. fn_NetSim_CR_Init( ) in 802.22.c 7. Write getch() at the start of the above function.
  • 4. www.tetcos.com 1:Debugging through GUI 8. Build the protocol and replace the dll in bin folder in NetSim. Do not close Visual Studio. 9. In NetSim, create a network scenario and simulate. 10. The simulation won’t start and will pause (because of getch()). 11. Switch to the Visual Studio window and put break point inside the source code where you want to debug. 12. Go to “Debug->Attach to Process” in Visual studio and attach to NetSimCore.exe.
  • 5. www.tetcos.com 1:Debugging through GUI 13. Click on “Attach” and continue the simulation by pressing Enter.
  • 6. www.tetcos.com 1. The App path is the file location in the system in which NetSim has been installed. 2. Typically this path would be “C:Program FilesNetSim Standardbin” 3. To get it, right click on the NetSim icon and select Open File Location. 4. The IO path (Input/output Path) is the path where the input and output files of an application is written. 5. For NetSim, the IO path can be got by Start -> Run-> %temp%/NetSim. 6. Once you reach this folder, the user would notice that the path would be something like “C:UsersRamAppDataLocalTempNetSim” 2:Information needed for CLI
  • 7. www.tetcos.com 2:Information needed for CLI 7. The IO path is the path where the Configuration.xml (NetSim Config file) of the scenario, that will be simulated, should be present. 8. Create the required scenario in GUI as described previously to get the config file( Ignore steps 4 and 7 of GUI) 9. You may also need the IP Address of the License Server. If the user is running a floating license then this is the address of where the dongle is running 10. For node locked licenses the IP Address need not be entered
  • 8. www.tetcos.com 3:Debugging through CLI 1. Create the required scenario in GUI as described previously to get the config file( Ignore steps 4 and 7 of GUI) 2. In the command window (cmd), open your apppath ( Write cd <apppath> in cmd) 3. Then type NetSimCore.exe<space> -apppath<space><app path><space>-iopath<space><io path><space>- license<space>5053@<Server IP Address> -d Figure 3.1
  • 9. www.tetcos.com 3:Debugging through CLI 4. Then press Enter key to get screen like figure given below Figure 3.2
  • 10. www.tetcos.com 5. Now follow the steps 8 to 10 as mentioned in Debugging with GUI section 3:Debugging through CLI
  • 11. www.tetcos.com 3:Debugging through CLI 6. Enter the desired event id where you want to break ( see prev. fig.) Execution will stop at the desired Event Id ( see fig. below)
  • 12. www.tetcos.com 3:Debugging through CLI 7. Press enter then control goes to visual studio and stops at the break point in the source code as shown in figure below. 8. All debugging options like step over (F10), step into (F11), step out (Shift + F11), continue(F5) are available.
  • 13. www.tetcos.com 4:Co-relating with Event Trace (CLI) 1. Enable the Event trace manually in the config file. 2. The config file Configuration.xml is located inside the IO Path. Open this file in notepad / visual studio and change file name & path in line marked in figure below; and set STATUS=ENABLE. 3. Sometimes in visual studio the entire file is opened in 1 line and to see it in the correct format, click the reformat selection icon
  • 14. www.tetcos.com 4:Co-relating with Event Trace (CLI) 4. Run the simulation as described in debugging through CLI section without the the debug (–d) option.( This generates the event trace) 5. Rename the Event trace file generated in previous step. This is done to avoid over writing of the file when the simulation is run. So while debugging the code flow is compared against a recorded event trace. 6. Run the simulation as described in Debugging Through CLI section again and enter -1 as event id to break in .This is required to watch the variable.
  • 15. www.tetcos.com 7. Open the C file inside the protocol folder inside Simulation folder that has the init function as explained in the earlier slides. The run function will be present in the same file. 8. There will be a switch case statement , where the switch is on the variable nEventType. 4:Co-relating with Event Trace (CLI)
  • 16. www.tetcos.com 4:Co-relating with Event Trace (CLI) 9. Set a break point there and check the values of members of this struct as the code executes using F5, F10 and F11 keys 10. Add a watch as described in the coming slides on pstruEventDetails variable . 11. Compare it with the event trace file generated in steps 1-4. The values will match exactly.
  • 17. www.tetcos.com 5:Viewing & Accessing variables 1. To follow a variable through execution, use “Add Watch” option available. 2. Some variables cannot be viewed directly when added in the watch tab, as this would throw the error: “CX0017: Error:symbol “Variable_Name”not found”. 3. In the call stack window one can find the file in which that variable is situated. 4. If this file is grey color in the call stack window, then load it knowing the location of its .pdb file (Refer to user manual)
  • 18. www.tetcos.com 5. Otherwise, if variable is already loaded add prefix {,,<filename>.dll} to the variable name and press enter (Refer to user manual) 6. For eg. For viewing pstruEventDetails prefix {,,NetworkStack.dll}. 5:Viewing & Accessing variables • Prefixing {,,Networkstack.dll} before variable name and press Enter to see the watch window.