SlideShare a Scribd company logo
Tutorial 1
Fall 2022
Abdelrahman Elewah
SOFE 4590U: Embedded Systems
Agenda
• NVIDIA Jetson TX2.
• Stack memory
• The GNU Project Debugger GDB.
• Example for GDB tool
https://drive.google.com/file/d/13hOh0qr6DSyhv_fLIxxbC4LPR1CR6x8c/view?usp=sharing
• putty
https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html
Codes folder
NVIDIA Jetson TX2.
NVIDIA Jetson TX2
4
• NVIDIA Jetson TX2 developer Kit is an embedded system-on-module with dual-core ARM Cortex-A57, 8 GB
LPDDR4, and integrated 256-core Pascal GPU. It gives us an easy way to develop software and hardware for
the Jetson TX2 AI supercomputer on a module.
https://sirinsoftware.com/blog/the-arm-processor-a-r-and-m-categories-and-their-specifics/
In a nutshell
5
• The Jetson TX2 boards consists of an Ethernet port, an HDMI port to
the external HDMI display, a USB port that could connect to a USB
hub to a keyboard and mouse.
• If you are interested in more on the Jetson Series products, there
are many useful online documents available on the NVIDIA website.
For example, you can read through Jetson TX1 and TX2 Developer
Kits User Guide for more details.
Stack memory
Stack vs Array
7
https://www.geeksforgeeks.org/difference-between-stack-and-array/
Array
Stack Example
8
https://www.computerhope.com/jargon/s/stacover.htm
For example, we use to start with declaring variables at the
beginning of all programs.
Int a = 4; //line 1
Int b =5; //line 2
The stack is responsible for keeping tracking the running
memory in your application. When the program executes
integer b, it stacks this memory allocation on top of the first
memory allocation, where the first line of code executes.
Debugging
9
Debugging is the process of finding and resolving bugs (defects or problems that prevent
correct operation) within computer programs, software, or systems.
The GNU Debugger (GDB) is a portable debugger that runs on many Unix-like systems and
works for many programming languages, including Ada, C++, Objective-C, Free Pascal,
Fortran, and Go.
GNU Debugger allows you to inspect what the program is doing at a certain point during
execution.
Enabling built-in debugging support
10
• Normally, you would compile a program like:
• Now you add a -g option to enable built-in debugging support (which gdb needs):
gcc [flags] <source files> -o <output file>
gcc [other flags] -g <source files> -o <output file>
• The GNU Project Debugger GDB.
Code for GDB tutorial
12
#include <stdio.h>
void fun3(){
int fun3Var=30;
printf("fun3Var in fun3 = %dn",fun3Var);}
void fun2(){
int fun2Var=20;
printf("fun3Var in fun2 = %dn",fun2Var);
fun3();}
void fun1(){
int fun1Var=10;
printf("fun3Var in fun1 = %dn",fun1Var);
fun2();}
int main() {
int mainVar=1000;
printf("mainVar in main = %dn",mainVar);
fun1();
return 0;}
gcc -g code.c -o code
gdb code
13
Setting Breakpoints
Breakpoints are points in your code at which gdb will stop and allow executing other gdb commands.
Set a breakpoint at the beginning of a function.
Example. Set a breakpoint at the beginning of main.
(gdb) b main
Set a breakpoint at a line of the current file during debugging.
Example. Set a breakpoint at line 35 while in file code.c
(gdb) b 7
Breakpoints
14
Listing breakpoints.
Example. List all breakpoints which have been set so far in a debugging session.
(gdb) info b
Num Type Disp Enb Address What
1 breakpoint keep y 0x0040104f in main at code.c:14
2 breakpoint keep y 0x004010a7 in fun2 at code.c:8
Deleting a breakpoint.
Example. Delete the breakpoint at line 8
(gdb) delete 2
Help and Quitting Gdb
There is a help command, h and the command to quit gdb is q.
(gdb) h
(gdb) q
Breakpoints
15
Start the program being debugged.
Example 1. The program is printch, which can take an optional command line argument. Start it running with no command line
argument.
(gdb) r
Execute a single statement.
If the statement is a function call, execute the entire function and return to the statement just after the call; that is, step over the
function.
(gdb) n
Execute a single statement.
If the statement is a function call, just single step into the function.
(gdb) s
Execute from the current point up to the next breakpoint
if there is one, otherwise execute until the program terminates.
(gdb) c
Execute the rest of the current function; that is, step out of the function.
(gdb) finish
Running the Program being Debugged
16
Examining Variables
Print the value of a variable or expression.
Example 1. Print the value of a variable count
(gdb) p fun1Var
Print local variable
(gdb) info local
Print variable in another function
(gdb) f 1
List Source Code and the Next Statement
List lines of source code.
Example. List the next listsize number of lines of code. Note that listsize's value can be change with the set command.
(gdb) l
List lines of source code centered around a particular line.
Example. List the lines centered around line 41.
(gdb) l 41
Show the next statement that will be executed.
(gdb) where
Or
(gdb) bt
Show the entire assembly code
(gdb) disass
Thank you

More Related Content

Similar to lab1-ppt.pdf

GNU Compiler Collection - August 2005
GNU Compiler Collection - August 2005GNU Compiler Collection - August 2005
GNU Compiler Collection - August 2005
Saleem Ansari
 
LAS16-403 - GDB Linux Kernel Awareness
LAS16-403 - GDB Linux Kernel Awareness LAS16-403 - GDB Linux Kernel Awareness
LAS16-403 - GDB Linux Kernel Awareness Peter Griffin
 
LAS16-403: GDB Linux Kernel Awareness
LAS16-403: GDB Linux Kernel AwarenessLAS16-403: GDB Linux Kernel Awareness
LAS16-403: GDB Linux Kernel Awareness
Linaro
 
Debugging Python with gdb
Debugging Python with gdbDebugging Python with gdb
Debugging Python with gdb
Roman Podoliaka
 
Mender.io | Develop embedded applications faster | Comparing C and Golang
Mender.io | Develop embedded applications faster | Comparing C and GolangMender.io | Develop embedded applications faster | Comparing C and Golang
Mender.io | Develop embedded applications faster | Comparing C and Golang
Mender.io
 
Mesa and Its Debugging, Вадим Шовкопляс
Mesa and Its Debugging, Вадим ШовкоплясMesa and Its Debugging, Вадим Шовкопляс
Mesa and Its Debugging, Вадим Шовкопляс
Sigma Software
 
Graphics Programming in C under GNU Linux (Ubuntu distribution)
Graphics Programming in C under GNU Linux (Ubuntu distribution)Graphics Programming in C under GNU Linux (Ubuntu distribution)
Graphics Programming in C under GNU Linux (Ubuntu distribution)
Tushar B Kute
 
Gdb tutorial-handout
Gdb tutorial-handoutGdb tutorial-handout
Gdb tutorial-handoutSuraj Kumar
 
Mesa and Its Debugging
Mesa and Its DebuggingMesa and Its Debugging
Mesa and Its Debugging
GlobalLogic Ukraine
 
Debugging Hung Python Processes With GDB
Debugging Hung Python Processes With GDBDebugging Hung Python Processes With GDB
Debugging Hung Python Processes With GDB
bmbouter
 
Extending GDB with Python
Extending GDB with PythonExtending GDB with Python
Extending GDB with Python
Lisa Roach
 
Basics of gtk_ilugc
Basics of gtk_ilugcBasics of gtk_ilugc
Basics of gtk_ilugc
ilugc
 
MazuV-Debug-System
MazuV-Debug-SystemMazuV-Debug-System
MazuV-Debug-System
feathertw
 
Ctrl-C redesign for gcc cauldron in 2022 in prague
Ctrl-C redesign for gcc cauldron in 2022 in pragueCtrl-C redesign for gcc cauldron in 2022 in prague
Ctrl-C redesign for gcc cauldron in 2022 in prague
ssuser866937
 
Wavedigitech gdb
Wavedigitech gdbWavedigitech gdb
Wavedigitech gdb
Wave Digitech
 
Newbie’s guide to_the_gpgpu_universe
Newbie’s guide to_the_gpgpu_universeNewbie’s guide to_the_gpgpu_universe
Newbie’s guide to_the_gpgpu_universe
Ofer Rosenberg
 
Multiplatform JIT Code Generator for NetBSD by Alexander Nasonov
Multiplatform JIT Code Generator for NetBSD by Alexander NasonovMultiplatform JIT Code Generator for NetBSD by Alexander Nasonov
Multiplatform JIT Code Generator for NetBSD by Alexander Nasonov
eurobsdcon
 
COMPUTER GRAPHICS PROJECT REPORT
COMPUTER GRAPHICS PROJECT REPORTCOMPUTER GRAPHICS PROJECT REPORT
COMPUTER GRAPHICS PROJECT REPORT
vineet raj
 
Golang execution modes
Golang execution modesGolang execution modes
Golang execution modes
Ting-Li Chou
 

Similar to lab1-ppt.pdf (20)

GNU Compiler Collection - August 2005
GNU Compiler Collection - August 2005GNU Compiler Collection - August 2005
GNU Compiler Collection - August 2005
 
LAS16-403 - GDB Linux Kernel Awareness
LAS16-403 - GDB Linux Kernel Awareness LAS16-403 - GDB Linux Kernel Awareness
LAS16-403 - GDB Linux Kernel Awareness
 
LAS16-403: GDB Linux Kernel Awareness
LAS16-403: GDB Linux Kernel AwarenessLAS16-403: GDB Linux Kernel Awareness
LAS16-403: GDB Linux Kernel Awareness
 
Debugging Python with gdb
Debugging Python with gdbDebugging Python with gdb
Debugging Python with gdb
 
Mender.io | Develop embedded applications faster | Comparing C and Golang
Mender.io | Develop embedded applications faster | Comparing C and GolangMender.io | Develop embedded applications faster | Comparing C and Golang
Mender.io | Develop embedded applications faster | Comparing C and Golang
 
Mesa and Its Debugging, Вадим Шовкопляс
Mesa and Its Debugging, Вадим ШовкоплясMesa and Its Debugging, Вадим Шовкопляс
Mesa and Its Debugging, Вадим Шовкопляс
 
Gccgdb
GccgdbGccgdb
Gccgdb
 
Graphics Programming in C under GNU Linux (Ubuntu distribution)
Graphics Programming in C under GNU Linux (Ubuntu distribution)Graphics Programming in C under GNU Linux (Ubuntu distribution)
Graphics Programming in C under GNU Linux (Ubuntu distribution)
 
Gdb tutorial-handout
Gdb tutorial-handoutGdb tutorial-handout
Gdb tutorial-handout
 
Mesa and Its Debugging
Mesa and Its DebuggingMesa and Its Debugging
Mesa and Its Debugging
 
Debugging Hung Python Processes With GDB
Debugging Hung Python Processes With GDBDebugging Hung Python Processes With GDB
Debugging Hung Python Processes With GDB
 
Extending GDB with Python
Extending GDB with PythonExtending GDB with Python
Extending GDB with Python
 
Basics of gtk_ilugc
Basics of gtk_ilugcBasics of gtk_ilugc
Basics of gtk_ilugc
 
MazuV-Debug-System
MazuV-Debug-SystemMazuV-Debug-System
MazuV-Debug-System
 
Ctrl-C redesign for gcc cauldron in 2022 in prague
Ctrl-C redesign for gcc cauldron in 2022 in pragueCtrl-C redesign for gcc cauldron in 2022 in prague
Ctrl-C redesign for gcc cauldron in 2022 in prague
 
Wavedigitech gdb
Wavedigitech gdbWavedigitech gdb
Wavedigitech gdb
 
Newbie’s guide to_the_gpgpu_universe
Newbie’s guide to_the_gpgpu_universeNewbie’s guide to_the_gpgpu_universe
Newbie’s guide to_the_gpgpu_universe
 
Multiplatform JIT Code Generator for NetBSD by Alexander Nasonov
Multiplatform JIT Code Generator for NetBSD by Alexander NasonovMultiplatform JIT Code Generator for NetBSD by Alexander Nasonov
Multiplatform JIT Code Generator for NetBSD by Alexander Nasonov
 
COMPUTER GRAPHICS PROJECT REPORT
COMPUTER GRAPHICS PROJECT REPORTCOMPUTER GRAPHICS PROJECT REPORT
COMPUTER GRAPHICS PROJECT REPORT
 
Golang execution modes
Golang execution modesGolang execution modes
Golang execution modes
 

Recently uploaded

Fundamentals of Induction Motor Drives.pptx
Fundamentals of Induction Motor Drives.pptxFundamentals of Induction Motor Drives.pptx
Fundamentals of Induction Motor Drives.pptx
manasideore6
 
Online aptitude test management system project report.pdf
Online aptitude test management system project report.pdfOnline aptitude test management system project report.pdf
Online aptitude test management system project report.pdf
Kamal Acharya
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
fxintegritypublishin
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
SamSarthak3
 
Building Electrical System Design & Installation
Building Electrical System Design & InstallationBuilding Electrical System Design & Installation
Building Electrical System Design & Installation
symbo111
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
Aditya Rajan Patra
 
digital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdfdigital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdf
drwaing
 
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdfTutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
aqil azizi
 
14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application
SyedAbiiAzazi1
 
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
ssuser7dcef0
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
zwunae
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
ydteq
 
Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
Dr Ramhari Poudyal
 
An Approach to Detecting Writing Styles Based on Clustering Techniques
An Approach to Detecting Writing Styles Based on Clustering TechniquesAn Approach to Detecting Writing Styles Based on Clustering Techniques
An Approach to Detecting Writing Styles Based on Clustering Techniques
ambekarshweta25
 
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
dxobcob
 
PPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testingPPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testing
anoopmanoharan2
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
AJAYKUMARPUND1
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
WENKENLI1
 
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTSHeap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Soumen Santra
 

Recently uploaded (20)

Fundamentals of Induction Motor Drives.pptx
Fundamentals of Induction Motor Drives.pptxFundamentals of Induction Motor Drives.pptx
Fundamentals of Induction Motor Drives.pptx
 
Online aptitude test management system project report.pdf
Online aptitude test management system project report.pdfOnline aptitude test management system project report.pdf
Online aptitude test management system project report.pdf
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
 
Building Electrical System Design & Installation
Building Electrical System Design & InstallationBuilding Electrical System Design & Installation
Building Electrical System Design & Installation
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
 
digital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdfdigital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdf
 
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdfTutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
 
14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application
 
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
 
Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
 
An Approach to Detecting Writing Styles Based on Clustering Techniques
An Approach to Detecting Writing Styles Based on Clustering TechniquesAn Approach to Detecting Writing Styles Based on Clustering Techniques
An Approach to Detecting Writing Styles Based on Clustering Techniques
 
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
 
PPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testingPPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testing
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
 
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTSHeap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
 

lab1-ppt.pdf

  • 1. Tutorial 1 Fall 2022 Abdelrahman Elewah SOFE 4590U: Embedded Systems
  • 2. Agenda • NVIDIA Jetson TX2. • Stack memory • The GNU Project Debugger GDB. • Example for GDB tool https://drive.google.com/file/d/13hOh0qr6DSyhv_fLIxxbC4LPR1CR6x8c/view?usp=sharing • putty https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html Codes folder
  • 4. NVIDIA Jetson TX2 4 • NVIDIA Jetson TX2 developer Kit is an embedded system-on-module with dual-core ARM Cortex-A57, 8 GB LPDDR4, and integrated 256-core Pascal GPU. It gives us an easy way to develop software and hardware for the Jetson TX2 AI supercomputer on a module. https://sirinsoftware.com/blog/the-arm-processor-a-r-and-m-categories-and-their-specifics/
  • 5. In a nutshell 5 • The Jetson TX2 boards consists of an Ethernet port, an HDMI port to the external HDMI display, a USB port that could connect to a USB hub to a keyboard and mouse. • If you are interested in more on the Jetson Series products, there are many useful online documents available on the NVIDIA website. For example, you can read through Jetson TX1 and TX2 Developer Kits User Guide for more details.
  • 8. Stack Example 8 https://www.computerhope.com/jargon/s/stacover.htm For example, we use to start with declaring variables at the beginning of all programs. Int a = 4; //line 1 Int b =5; //line 2 The stack is responsible for keeping tracking the running memory in your application. When the program executes integer b, it stacks this memory allocation on top of the first memory allocation, where the first line of code executes.
  • 9. Debugging 9 Debugging is the process of finding and resolving bugs (defects or problems that prevent correct operation) within computer programs, software, or systems. The GNU Debugger (GDB) is a portable debugger that runs on many Unix-like systems and works for many programming languages, including Ada, C++, Objective-C, Free Pascal, Fortran, and Go. GNU Debugger allows you to inspect what the program is doing at a certain point during execution.
  • 10. Enabling built-in debugging support 10 • Normally, you would compile a program like: • Now you add a -g option to enable built-in debugging support (which gdb needs): gcc [flags] <source files> -o <output file> gcc [other flags] -g <source files> -o <output file>
  • 11. • The GNU Project Debugger GDB.
  • 12. Code for GDB tutorial 12 #include <stdio.h> void fun3(){ int fun3Var=30; printf("fun3Var in fun3 = %dn",fun3Var);} void fun2(){ int fun2Var=20; printf("fun3Var in fun2 = %dn",fun2Var); fun3();} void fun1(){ int fun1Var=10; printf("fun3Var in fun1 = %dn",fun1Var); fun2();} int main() { int mainVar=1000; printf("mainVar in main = %dn",mainVar); fun1(); return 0;} gcc -g code.c -o code gdb code
  • 13. 13 Setting Breakpoints Breakpoints are points in your code at which gdb will stop and allow executing other gdb commands. Set a breakpoint at the beginning of a function. Example. Set a breakpoint at the beginning of main. (gdb) b main Set a breakpoint at a line of the current file during debugging. Example. Set a breakpoint at line 35 while in file code.c (gdb) b 7 Breakpoints
  • 14. 14 Listing breakpoints. Example. List all breakpoints which have been set so far in a debugging session. (gdb) info b Num Type Disp Enb Address What 1 breakpoint keep y 0x0040104f in main at code.c:14 2 breakpoint keep y 0x004010a7 in fun2 at code.c:8 Deleting a breakpoint. Example. Delete the breakpoint at line 8 (gdb) delete 2 Help and Quitting Gdb There is a help command, h and the command to quit gdb is q. (gdb) h (gdb) q Breakpoints
  • 15. 15 Start the program being debugged. Example 1. The program is printch, which can take an optional command line argument. Start it running with no command line argument. (gdb) r Execute a single statement. If the statement is a function call, execute the entire function and return to the statement just after the call; that is, step over the function. (gdb) n Execute a single statement. If the statement is a function call, just single step into the function. (gdb) s Execute from the current point up to the next breakpoint if there is one, otherwise execute until the program terminates. (gdb) c Execute the rest of the current function; that is, step out of the function. (gdb) finish Running the Program being Debugged
  • 16. 16 Examining Variables Print the value of a variable or expression. Example 1. Print the value of a variable count (gdb) p fun1Var Print local variable (gdb) info local Print variable in another function (gdb) f 1 List Source Code and the Next Statement List lines of source code. Example. List the next listsize number of lines of code. Note that listsize's value can be change with the set command. (gdb) l List lines of source code centered around a particular line. Example. List the lines centered around line 41. (gdb) l 41 Show the next statement that will be executed. (gdb) where Or (gdb) bt Show the entire assembly code (gdb) disass