SlideShare a Scribd company logo
Debugging
seL4 Applications
with GDB
By Chris Guikema
This research was developed with funding
from the Defense Advanced Research
Projects Agency (DARPA). The views,
opinions, and/or findings expressed are
those of the author and should not be
interpreted as representing the official views
or policies of the Department of Defense or
the U.S. Government. Approved for Public
Release, Distribution Unlimited.
○ Debugging Need for Embedded
Systems
○ GDB Overview
○ 3 Implementations
• GDB-stub ARM – DW
• GDB-server x86 – Data61
• GDB-server ARM – DW
o Areas for Improvement
o Questions
Summary
2
About DornerWorks
Embedded Systems Engineering located in
Grand Rapids, MI
DornerWorks provides technology
engineering so you can focus on your
customers.
○ Embedded electronics
○ FPGA
○ Software engineering
○ Cloud ad mobile apps
We accelerate your product development
and lower risk for adopting advanced
technologies.
Experience with seL4
DARPA SBIR Project: “An seL4 – Enabled
Safe & Secure Soldier Helmet Display”
3
Why Debuggers?
• No matter the length and readability of your code, there is always the possibility for bugs
• Print debugging is inflexible
• UART access may be limited when porting to a new platform
• Doesn’t work well with timing-sensitive functions or interrupt handlers
• Debug functions allow for easier error identification
4
About GDB
• GNU Project Debugger, Developed in 1986 by Richard Stallman
• Most widely used embedded debugger
• Allows the user to see what happens ‘inside’ the program while it is executing
• Available Functionality:
• Breakpoints
• Step-Through
• Variables
• Stack
• Many, Many others…
• How can this be implemented in seL4?
5
Overview of seL4 GDB Solutions
• GDB Stub Application
• gdbstub: Code must be linked directly with the application to debug with GDB
• For programs written with seL4 System Calls
• Not for CAmkES applications
• GDB Server Applications
• gdbserver: control program which allows you to connect your program with gdb without linking in the usual
debugging stub.
• CAmkES application for x86 (Data61) and ARM (DW)
6
GDB stub
• Developed by DornerWorks
• Only tested on Zynq7000 Platform
• Other ARM Platforms should work
• https://github.com/dornerworks/gdbstub-app
• https://github.com/dornerworks/gdbstub-appmanifest
7
GDB stub
8
GDB stub
• GDB Stub communicates with the GDB application over UART0
• Normal Serial Communication occurs over UART1
• Wait for user commands
• Software Breakpoints
• Read/Write bytes
• Step
• Continue
• Step/continue resumes init thread with updated PC
9
GDB stub
• Strengths:
• Can debug seL4 code!
10
• Weaknesses
• Hard Coded Stub
• No CAmkES support
• Uses init thread to debug code
GDB Stub
Strengths
○ Can debug seL4 code!
Weaknesses
○ Hard Coded Stub
○ No CAmkES support
○ Uses init thread to debug code
11
x86 GDB for CAmkES
12
X86 GDB for CAmkES
• Developed by Data61
• https://github.com/smaccm/camkes_debug_manifest/blob/gtt_deliverable/simple.xml
• https://github.com/smaccm/camkes-tool/blob/gtt_deliverable_debug_no_rt/debug/README.md
13
X86 GDB for CAmkES
• Debug tool performs does the following:
• Parses the top level assembly file & outputs new assembly file
• Creates a delegate and a fault endpoint from template files
• Outputs a .gdbinit
14
X86 GDB for CAmkES
• Available commands:
• Read general registers
• Memory read/write
• Set SW breakpoint
• Set HW breakpoint
• Step
15
X86 GDB for CAmkES
Strengths
○ GDB Server
○ HW/SW Breakpoints
○ CAmkES compatible
Weaknesses
○ No ARM support
16
ARM GDB for CAmkES
Strengths
○ GDB Server
○ Improved SW Breakpoints
○ ¤ ARM/CAmkES compatible
Weaknesses
○ Cannot debug multiple threads at once
17
Where Do We Go From Here?
• Multi-Thread capable GDB Server
• HW breakpoints for ARM
• “Detach” operation
• Communicate through Ethernet
• Refactor ARM/x86 applications to be similar
• Build one application based off the required platform
• Integrate GDB Server to a seL4 IDE
• Once a seL4 IDE is developed!
18
ARM GDB for CAmkES
19
ARM GDB for CAmkES
• Based off the Data61 GDB Server
• Developed by DornerWorks
• Modified in the following ways:
• ARM Support
• Additional GDB functionality
20
ARM GDB for CAmkES
• Debug tool slightly modified
• Searches for the source file of the debug component, adds a breakpoint() function call
• Creates a backup of the source code
• Creates a new target file (.camkes.dbg)
• Creates a .gdbinit file
21
ARM GDB for CAmkES
22
ARM GDB for CAmkES
23
ARM GDB
for CAmkES
24
ARM GDB for CAmkES
• Fault Endpoint
• Component generated by debug tool
• Linked to template files
• EP is generated by the python script & templates
• Connected to the fault EP of the debugged thread
• Fault handler waits for something to occur on the EP
• Gets the TCB Capability so GDB can read registers, manipulate the instructions, etc…
25
ARM GDB for CAmkES
• Delegate:
• Component generated by the debug tool
• Linked to template files
• “Provided” by the debugged component.
• Runs in same vspace/cspace
• Capability to vspace – allows for instruction modification
• Required for SW Breakpoints
• Activated when called from the Fault Endpoint
• Has a slightly modified version of the stub application for GDB functionality
26
ARM GDB for CAmkES
• Available commands:
• Read/Write general registers
• Memory read/write
• Set/Remove SW breakpoint
• Step/Continue
• Kill
27
ThankYou
+1.616.245.8369
sales@dornerworks.com
https://dornerworks.com/

More Related Content

What's hot

Migrating a build farm from on-prem to AWS
Migrating a build farm from on-prem to AWSMigrating a build farm from on-prem to AWS
Migrating a build farm from on-prem to AWS
Claes Buckwalter
 
Git at scale-helix4_git (1)
Git at scale-helix4_git (1)Git at scale-helix4_git (1)
Git at scale-helix4_git (1)
Perforce
 
Is Trunk-based Development Easy in Game Development?
Is Trunk-based Development Easy in Game Development?Is Trunk-based Development Easy in Game Development?
Is Trunk-based Development Easy in Game Development?
Perforce
 
Infrastructure as Code and AWS CDK
Infrastructure as Code and AWS CDKInfrastructure as Code and AWS CDK
Infrastructure as Code and AWS CDK
SupratipBanerjee
 
Cloud native fundamentals
Cloud native fundamentalsCloud native fundamentals
Cloud native fundamentals
Victor Morales
 
Perforce Innovations Showcase 
Perforce Innovations Showcase Perforce Innovations Showcase 
Perforce Innovations Showcase 
Perforce
 
How Samsung Engineers Do Pre-Commit Builds with Perforce Helix Streams
How Samsung Engineers Do Pre-Commit Builds with Perforce Helix StreamsHow Samsung Engineers Do Pre-Commit Builds with Perforce Helix Streams
How Samsung Engineers Do Pre-Commit Builds with Perforce Helix Streams
Perforce
 
Kubernetes Logging
Kubernetes LoggingKubernetes Logging
Kubernetes Logging
Denys Havrysh
 
Cloud-Native Modernization or Death? A false dichotomy. | DevNation Tech Talk
Cloud-Native Modernization or Death? A false dichotomy. | DevNation Tech TalkCloud-Native Modernization or Death? A false dichotomy. | DevNation Tech Talk
Cloud-Native Modernization or Death? A false dichotomy. | DevNation Tech Talk
Red Hat Developers
 
Delivering Cloud Native Batch Solutions - Dodd Pfeffer
Delivering Cloud Native Batch Solutions - Dodd PfefferDelivering Cloud Native Batch Solutions - Dodd Pfeffer
Delivering Cloud Native Batch Solutions - Dodd Pfeffer
VMware Tanzu
 
GitLab, AWS and Terraform: The Perfect Combination
GitLab, AWS and Terraform: The Perfect CombinationGitLab, AWS and Terraform: The Perfect Combination
GitLab, AWS and Terraform: The Perfect Combination
Will Hall
 
Approaches to debugging mixed-language HPC apps
Approaches to debugging mixed-language HPC appsApproaches to debugging mixed-language HPC apps
Approaches to debugging mixed-language HPC apps
Rogue Wave Software
 
Top 5 Considerations for Successful Deployment of Kubernetes
Top 5 Considerations for Successful Deployment of KubernetesTop 5 Considerations for Successful Deployment of Kubernetes
Top 5 Considerations for Successful Deployment of Kubernetes
Platform9
 
FluentD vs. Logstash
FluentD vs. LogstashFluentD vs. Logstash
FluentD vs. Logstash
All Things Open
 
17 Things Developers Should Know About Databases
17 Things Developers Should Know About Databases17 Things Developers Should Know About Databases
17 Things Developers Should Know About Databases
All Things Open
 
Cost-effective Compute Clusters with Spot and Pre-emptible Instances - KubeCo...
Cost-effective Compute Clusters with Spot and Pre-emptible Instances - KubeCo...Cost-effective Compute Clusters with Spot and Pre-emptible Instances - KubeCo...
Cost-effective Compute Clusters with Spot and Pre-emptible Instances - KubeCo...
Platform9
 
CICD With GitHub, Travis, SonarCloud and Docker Hub
CICD With GitHub, Travis, SonarCloud and Docker HubCICD With GitHub, Travis, SonarCloud and Docker Hub
CICD With GitHub, Travis, SonarCloud and Docker Hub
Carlos Cavero Barca
 
Helm summit 2019_handling large number of charts_sept 10
Helm summit 2019_handling large number of charts_sept 10Helm summit 2019_handling large number of charts_sept 10
Helm summit 2019_handling large number of charts_sept 10
Shikha Srivastava
 
RedisConf18 - Making Real-Time Predictive Decisions with Redis
RedisConf18 - Making Real-Time Predictive Decisions with RedisRedisConf18 - Making Real-Time Predictive Decisions with Redis
RedisConf18 - Making Real-Time Predictive Decisions with Redis
Redis Labs
 
Scaling systems for research computing
Scaling systems for research computingScaling systems for research computing
Scaling systems for research computing
The BioTeam Inc.
 

What's hot (20)

Migrating a build farm from on-prem to AWS
Migrating a build farm from on-prem to AWSMigrating a build farm from on-prem to AWS
Migrating a build farm from on-prem to AWS
 
Git at scale-helix4_git (1)
Git at scale-helix4_git (1)Git at scale-helix4_git (1)
Git at scale-helix4_git (1)
 
Is Trunk-based Development Easy in Game Development?
Is Trunk-based Development Easy in Game Development?Is Trunk-based Development Easy in Game Development?
Is Trunk-based Development Easy in Game Development?
 
Infrastructure as Code and AWS CDK
Infrastructure as Code and AWS CDKInfrastructure as Code and AWS CDK
Infrastructure as Code and AWS CDK
 
Cloud native fundamentals
Cloud native fundamentalsCloud native fundamentals
Cloud native fundamentals
 
Perforce Innovations Showcase 
Perforce Innovations Showcase Perforce Innovations Showcase 
Perforce Innovations Showcase 
 
How Samsung Engineers Do Pre-Commit Builds with Perforce Helix Streams
How Samsung Engineers Do Pre-Commit Builds with Perforce Helix StreamsHow Samsung Engineers Do Pre-Commit Builds with Perforce Helix Streams
How Samsung Engineers Do Pre-Commit Builds with Perforce Helix Streams
 
Kubernetes Logging
Kubernetes LoggingKubernetes Logging
Kubernetes Logging
 
Cloud-Native Modernization or Death? A false dichotomy. | DevNation Tech Talk
Cloud-Native Modernization or Death? A false dichotomy. | DevNation Tech TalkCloud-Native Modernization or Death? A false dichotomy. | DevNation Tech Talk
Cloud-Native Modernization or Death? A false dichotomy. | DevNation Tech Talk
 
Delivering Cloud Native Batch Solutions - Dodd Pfeffer
Delivering Cloud Native Batch Solutions - Dodd PfefferDelivering Cloud Native Batch Solutions - Dodd Pfeffer
Delivering Cloud Native Batch Solutions - Dodd Pfeffer
 
GitLab, AWS and Terraform: The Perfect Combination
GitLab, AWS and Terraform: The Perfect CombinationGitLab, AWS and Terraform: The Perfect Combination
GitLab, AWS and Terraform: The Perfect Combination
 
Approaches to debugging mixed-language HPC apps
Approaches to debugging mixed-language HPC appsApproaches to debugging mixed-language HPC apps
Approaches to debugging mixed-language HPC apps
 
Top 5 Considerations for Successful Deployment of Kubernetes
Top 5 Considerations for Successful Deployment of KubernetesTop 5 Considerations for Successful Deployment of Kubernetes
Top 5 Considerations for Successful Deployment of Kubernetes
 
FluentD vs. Logstash
FluentD vs. LogstashFluentD vs. Logstash
FluentD vs. Logstash
 
17 Things Developers Should Know About Databases
17 Things Developers Should Know About Databases17 Things Developers Should Know About Databases
17 Things Developers Should Know About Databases
 
Cost-effective Compute Clusters with Spot and Pre-emptible Instances - KubeCo...
Cost-effective Compute Clusters with Spot and Pre-emptible Instances - KubeCo...Cost-effective Compute Clusters with Spot and Pre-emptible Instances - KubeCo...
Cost-effective Compute Clusters with Spot and Pre-emptible Instances - KubeCo...
 
CICD With GitHub, Travis, SonarCloud and Docker Hub
CICD With GitHub, Travis, SonarCloud and Docker HubCICD With GitHub, Travis, SonarCloud and Docker Hub
CICD With GitHub, Travis, SonarCloud and Docker Hub
 
Helm summit 2019_handling large number of charts_sept 10
Helm summit 2019_handling large number of charts_sept 10Helm summit 2019_handling large number of charts_sept 10
Helm summit 2019_handling large number of charts_sept 10
 
RedisConf18 - Making Real-Time Predictive Decisions with Redis
RedisConf18 - Making Real-Time Predictive Decisions with RedisRedisConf18 - Making Real-Time Predictive Decisions with Redis
RedisConf18 - Making Real-Time Predictive Decisions with Redis
 
Scaling systems for research computing
Scaling systems for research computingScaling systems for research computing
Scaling systems for research computing
 

Similar to Debugging seL4 apps with the GNU Debugger

Easily emulating full systems on amazon fpg as
Easily emulating full systems on amazon fpg asEasily emulating full systems on amazon fpg as
Easily emulating full systems on amazon fpg as
RISC-V International
 
Freedreno on Android – XDC 2023
Freedreno on Android          – XDC 2023Freedreno on Android          – XDC 2023
Freedreno on Android – XDC 2023
Igalia
 
Groovy In the Cloud
Groovy In the CloudGroovy In the Cloud
Groovy In the Cloud
Jim Driscoll
 
Debugging embedded devices using GDB
Debugging embedded devices using GDBDebugging embedded devices using GDB
Debugging embedded devices using GDB
Chris Simmonds
 
Gocd – Kubernetes/Nomad Continuous Deployment
Gocd – Kubernetes/Nomad Continuous DeploymentGocd – Kubernetes/Nomad Continuous Deployment
Gocd – Kubernetes/Nomad Continuous Deployment
Leandro Totino Pereira
 
“A New, Open-standards-based, Open-source Programming Model for All Accelerat...
“A New, Open-standards-based, Open-source Programming Model for All Accelerat...“A New, Open-standards-based, Open-source Programming Model for All Accelerat...
“A New, Open-standards-based, Open-source Programming Model for All Accelerat...
Edge AI and Vision Alliance
 
Modern Web-site Development Pipeline
Modern Web-site Development PipelineModern Web-site Development Pipeline
Modern Web-site Development Pipeline
GlobalLogic Ukraine
 
Utilizing AMD GPUs: Tuning, programming models, and roadmap
Utilizing AMD GPUs: Tuning, programming models, and roadmapUtilizing AMD GPUs: Tuning, programming models, and roadmap
Utilizing AMD GPUs: Tuning, programming models, and roadmap
George Markomanolis
 
Cuda
CudaCuda
CFD on Power
CFD on Power CFD on Power
CFD on Power
Ganesan Narayanasamy
 
Build your android app with gradle
Build your android app with gradleBuild your android app with gradle
Build your android app with gradle
Swain Loda
 
Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5
Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5
Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5
David Voyles
 
Codasip application class RISC-V processor solutions
Codasip application class RISC-V processor solutionsCodasip application class RISC-V processor solutions
Codasip application class RISC-V processor solutions
RISC-V International
 
Mesa and Its Debugging
Mesa and Its DebuggingMesa and Its Debugging
Mesa and Its Debugging
GlobalLogic Ukraine
 
An Introduction To Android
An Introduction To AndroidAn Introduction To Android
An Introduction To Android
natdefreitas
 
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_osEnhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
Arnav Gupta
 
XPDS16: Display Handler, a Client Display Framework for Xen - Brendan Kerrig...
XPDS16:  Display Handler, a Client Display Framework for Xen - Brendan Kerrig...XPDS16:  Display Handler, a Client Display Framework for Xen - Brendan Kerrig...
XPDS16: Display Handler, a Client Display Framework for Xen - Brendan Kerrig...
The Linux Foundation
 
Webinar - Unbox GitLab CI/CD
Webinar - Unbox GitLab CI/CD Webinar - Unbox GitLab CI/CD
Webinar - Unbox GitLab CI/CD
Annie Huang
 
Preparing your dockerised application for production deployment
Preparing your dockerised application for production deploymentPreparing your dockerised application for production deployment
Preparing your dockerised application for production deployment
Dave Ward
 
Android Lollipop
Android LollipopAndroid Lollipop
Android Lollipop
Željko Plesac
 

Similar to Debugging seL4 apps with the GNU Debugger (20)

Easily emulating full systems on amazon fpg as
Easily emulating full systems on amazon fpg asEasily emulating full systems on amazon fpg as
Easily emulating full systems on amazon fpg as
 
Freedreno on Android – XDC 2023
Freedreno on Android          – XDC 2023Freedreno on Android          – XDC 2023
Freedreno on Android – XDC 2023
 
Groovy In the Cloud
Groovy In the CloudGroovy In the Cloud
Groovy In the Cloud
 
Debugging embedded devices using GDB
Debugging embedded devices using GDBDebugging embedded devices using GDB
Debugging embedded devices using GDB
 
Gocd – Kubernetes/Nomad Continuous Deployment
Gocd – Kubernetes/Nomad Continuous DeploymentGocd – Kubernetes/Nomad Continuous Deployment
Gocd – Kubernetes/Nomad Continuous Deployment
 
“A New, Open-standards-based, Open-source Programming Model for All Accelerat...
“A New, Open-standards-based, Open-source Programming Model for All Accelerat...“A New, Open-standards-based, Open-source Programming Model for All Accelerat...
“A New, Open-standards-based, Open-source Programming Model for All Accelerat...
 
Modern Web-site Development Pipeline
Modern Web-site Development PipelineModern Web-site Development Pipeline
Modern Web-site Development Pipeline
 
Utilizing AMD GPUs: Tuning, programming models, and roadmap
Utilizing AMD GPUs: Tuning, programming models, and roadmapUtilizing AMD GPUs: Tuning, programming models, and roadmap
Utilizing AMD GPUs: Tuning, programming models, and roadmap
 
Cuda
CudaCuda
Cuda
 
CFD on Power
CFD on Power CFD on Power
CFD on Power
 
Build your android app with gradle
Build your android app with gradleBuild your android app with gradle
Build your android app with gradle
 
Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5
Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5
Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5
 
Codasip application class RISC-V processor solutions
Codasip application class RISC-V processor solutionsCodasip application class RISC-V processor solutions
Codasip application class RISC-V processor solutions
 
Mesa and Its Debugging
Mesa and Its DebuggingMesa and Its Debugging
Mesa and Its Debugging
 
An Introduction To Android
An Introduction To AndroidAn Introduction To Android
An Introduction To Android
 
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_osEnhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
 
XPDS16: Display Handler, a Client Display Framework for Xen - Brendan Kerrig...
XPDS16:  Display Handler, a Client Display Framework for Xen - Brendan Kerrig...XPDS16:  Display Handler, a Client Display Framework for Xen - Brendan Kerrig...
XPDS16: Display Handler, a Client Display Framework for Xen - Brendan Kerrig...
 
Webinar - Unbox GitLab CI/CD
Webinar - Unbox GitLab CI/CD Webinar - Unbox GitLab CI/CD
Webinar - Unbox GitLab CI/CD
 
Preparing your dockerised application for production deployment
Preparing your dockerised application for production deploymentPreparing your dockerised application for production deployment
Preparing your dockerised application for production deployment
 
Android Lollipop
Android LollipopAndroid Lollipop
Android Lollipop
 

Recently uploaded

Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
Rohit Gautam
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
Data structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdfData structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdf
TIPNGVN2
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 

Recently uploaded (20)

Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
Data structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdfData structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdf
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 

Debugging seL4 apps with the GNU Debugger

  • 1. Debugging seL4 Applications with GDB By Chris Guikema This research was developed with funding from the Defense Advanced Research Projects Agency (DARPA). The views, opinions, and/or findings expressed are those of the author and should not be interpreted as representing the official views or policies of the Department of Defense or the U.S. Government. Approved for Public Release, Distribution Unlimited.
  • 2. ○ Debugging Need for Embedded Systems ○ GDB Overview ○ 3 Implementations • GDB-stub ARM – DW • GDB-server x86 – Data61 • GDB-server ARM – DW o Areas for Improvement o Questions Summary 2
  • 3. About DornerWorks Embedded Systems Engineering located in Grand Rapids, MI DornerWorks provides technology engineering so you can focus on your customers. ○ Embedded electronics ○ FPGA ○ Software engineering ○ Cloud ad mobile apps We accelerate your product development and lower risk for adopting advanced technologies. Experience with seL4 DARPA SBIR Project: “An seL4 – Enabled Safe & Secure Soldier Helmet Display” 3
  • 4. Why Debuggers? • No matter the length and readability of your code, there is always the possibility for bugs • Print debugging is inflexible • UART access may be limited when porting to a new platform • Doesn’t work well with timing-sensitive functions or interrupt handlers • Debug functions allow for easier error identification 4
  • 5. About GDB • GNU Project Debugger, Developed in 1986 by Richard Stallman • Most widely used embedded debugger • Allows the user to see what happens ‘inside’ the program while it is executing • Available Functionality: • Breakpoints • Step-Through • Variables • Stack • Many, Many others… • How can this be implemented in seL4? 5
  • 6. Overview of seL4 GDB Solutions • GDB Stub Application • gdbstub: Code must be linked directly with the application to debug with GDB • For programs written with seL4 System Calls • Not for CAmkES applications • GDB Server Applications • gdbserver: control program which allows you to connect your program with gdb without linking in the usual debugging stub. • CAmkES application for x86 (Data61) and ARM (DW) 6
  • 7. GDB stub • Developed by DornerWorks • Only tested on Zynq7000 Platform • Other ARM Platforms should work • https://github.com/dornerworks/gdbstub-app • https://github.com/dornerworks/gdbstub-appmanifest 7
  • 9. GDB stub • GDB Stub communicates with the GDB application over UART0 • Normal Serial Communication occurs over UART1 • Wait for user commands • Software Breakpoints • Read/Write bytes • Step • Continue • Step/continue resumes init thread with updated PC 9
  • 10. GDB stub • Strengths: • Can debug seL4 code! 10 • Weaknesses • Hard Coded Stub • No CAmkES support • Uses init thread to debug code
  • 11. GDB Stub Strengths ○ Can debug seL4 code! Weaknesses ○ Hard Coded Stub ○ No CAmkES support ○ Uses init thread to debug code 11
  • 12. x86 GDB for CAmkES 12
  • 13. X86 GDB for CAmkES • Developed by Data61 • https://github.com/smaccm/camkes_debug_manifest/blob/gtt_deliverable/simple.xml • https://github.com/smaccm/camkes-tool/blob/gtt_deliverable_debug_no_rt/debug/README.md 13
  • 14. X86 GDB for CAmkES • Debug tool performs does the following: • Parses the top level assembly file & outputs new assembly file • Creates a delegate and a fault endpoint from template files • Outputs a .gdbinit 14
  • 15. X86 GDB for CAmkES • Available commands: • Read general registers • Memory read/write • Set SW breakpoint • Set HW breakpoint • Step 15
  • 16. X86 GDB for CAmkES Strengths ○ GDB Server ○ HW/SW Breakpoints ○ CAmkES compatible Weaknesses ○ No ARM support 16
  • 17. ARM GDB for CAmkES Strengths ○ GDB Server ○ Improved SW Breakpoints ○ ¤ ARM/CAmkES compatible Weaknesses ○ Cannot debug multiple threads at once 17
  • 18. Where Do We Go From Here? • Multi-Thread capable GDB Server • HW breakpoints for ARM • “Detach” operation • Communicate through Ethernet • Refactor ARM/x86 applications to be similar • Build one application based off the required platform • Integrate GDB Server to a seL4 IDE • Once a seL4 IDE is developed! 18
  • 19. ARM GDB for CAmkES 19
  • 20. ARM GDB for CAmkES • Based off the Data61 GDB Server • Developed by DornerWorks • Modified in the following ways: • ARM Support • Additional GDB functionality 20
  • 21. ARM GDB for CAmkES • Debug tool slightly modified • Searches for the source file of the debug component, adds a breakpoint() function call • Creates a backup of the source code • Creates a new target file (.camkes.dbg) • Creates a .gdbinit file 21
  • 22. ARM GDB for CAmkES 22
  • 23. ARM GDB for CAmkES 23
  • 25. ARM GDB for CAmkES • Fault Endpoint • Component generated by debug tool • Linked to template files • EP is generated by the python script & templates • Connected to the fault EP of the debugged thread • Fault handler waits for something to occur on the EP • Gets the TCB Capability so GDB can read registers, manipulate the instructions, etc… 25
  • 26. ARM GDB for CAmkES • Delegate: • Component generated by the debug tool • Linked to template files • “Provided” by the debugged component. • Runs in same vspace/cspace • Capability to vspace – allows for instruction modification • Required for SW Breakpoints • Activated when called from the Fault Endpoint • Has a slightly modified version of the stub application for GDB functionality 26
  • 27. ARM GDB for CAmkES • Available commands: • Read/Write general registers • Memory read/write • Set/Remove SW breakpoint • Step/Continue • Kill 27