Embedded Systems Principle of Debugger. Reference Materials kl.de/avr_projects/arm_projects/#winarmhttp://www.siwawi.arubi.uni-

Slides:



Advertisements
Similar presentations
Categories of I/O Devices
Advertisements

Chapter 3 Basic Input/Output
Introduction to the Omega Server CSE Overview Intro to Omega Basic Unix Command Files Directories Printing C and C++ compilers GNU Debugger.
Utilizing the GDB debugger to analyze programs Background and application.
CS4315A. Berrached:CMS:UHD1 Operating Systems and Computer Organization Chapter 4.
Debugging What can debuggers do? Run programs Make the program stops on specified places or on specified conditions Give information about current variables’
© 2003 Xilinx, Inc. All Rights Reserved Debugging.
© 2007 Cisco Systems, Inc. All rights reserved.ICND1 v1.0—6-1 Network Environment Management Managing Cisco Devices.
CSE 303 Lecture 13a Debugging C programs
WXES2106 Network Technology Semester /2005 Chapter 5 Routers CCNA2: Module 1 and 2.
Midterm Tuesday October 23 Covers Chapters 3 through 6 - Buses, Clocks, Timing, Edge Triggering, Level Triggering - Cache Memory Systems - Internal Memory.
1 Introduction Chapter What is an operating system 1.2 History of operating systems 1.3 The operating system zoo 1.4 Computer hardware review 1.5.
Managing Cisco IOS Software
This material exempt per Department of Commerce license exception TSU Debugging.
Introduction Purpose Objectives Content Learning Time
Shell and Flashing Images Commands and upgrades. RS-232 Driver chip – ST3232C Driver chip is ST3232C Provides electrical interface between UART port and.
Spring 2014 SILICON VALLEY UNIVERSITY CONFIDENTIAL 1 Introduction to Embedded Systems Dr. Jerry Shiao, Silicon Valley University.
Debugging techniques in Linux Debugging Techniques in Linux Chetan Kumar S Wipro Technologies.
Gdb is the GNU debugger on our CS machines. gdb is most effective when it is debugging a program that has debugging symbols linked in to it. With gcc and.
Basic Router Configuration Honolulu Community College Cisco Academy Training Center Semester 2 Version 2.1.
CISCO ROUTER.  The Cisco router IOS  Enhanced editing  Administrative functions  Hostnames  Banners  Passwords  Interface descriptions  Verifying.
Main sponsor PicassoMonet + RembrandtMatejko + Canaletto How Debuggers Work Karl Rehmer Failures Come in Flavors Michael Nygard REST in Java Stefan Tilkov.
hardware and operating systems basics.
Linux Booting Procedure
Debugging Cluster Programs using symbolic debuggers.
Computer System Laboratory
Memory & Storage Architecture Seoul National University GDB commands Hyeon-gyu School of Computer Science and Engineering.
Computer System Laboratory
Cisco S2 C4 Router Components. Configure a Router You can configure a router from –from the console terminal (a computer connected to the router –through.
Instructor Notes GPU debugging is still immature, but being improved daily. You should definitely check to see the latest options available before giving.
Porting Operating Systems Phan Duy Hùng (PhD) ES Lecturer – Hanoi FPT University.
Compiling & Debugging Quick tutorial. What is gcc? Gcc is the GNU Project C compiler A command-line program Gcc takes C source files as input Outputs.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
Lab 10 Department of Computer Science and Information Engineering National Taiwan University Lab10 – Debugging II 2014/12/2 1 /16.
I/O management is a major component of operating system design and operation Important aspect of computer operation I/O devices vary greatly Various methods.
NIOS II Ethernet Communication Final Presentation
Application Block Diagram III. SOFTWARE PLATFORM Figure above shows a network protocol stack for a computer that connects to an Ethernet network and.
Operating Systems CMPSC 473 Processes August 31, Lecture 3 Instructor: Bhuvan Urgaonkar.
A Tutorial on Introduction to gdb By Sasanka Madiraju Graduate Assistant Center for Computation and Technology.
Networking in Linux. ♦ Introduction A computer network is defined as a number of systems that are connected to each other and exchange information across.
National Chung Cheng University,Taiwan,R.O.C eCos demo using x86 PCs I-Hung Lin Date:2004/4/29.
CSE 351 GDB Introduction. Lab 1 Status? How is Lab 1 going? I’ll be available at the end of class to answer questions There are office hours later today.
Debugging. Outline Announcements: –HW II due Fridayl db.
1.4 Hardware Review. CPU  Fetch-decode-execute cycle 1. Fetch 2. Bump PC 3. Decode 4. Determine operand addr (if necessary) 5. Fetch operand from memory.
Debugging 1/6/2016. Debugging 1/6/2016 Debugging  Debugging is a methodical process of finding and reducing the number of bugs, or defects, in a program.
17 Establishing Dial-up Connection to the Internet Using Windows 9x 1.Install and configure the modem 2.Configure Dial-Up Adapter 3.Configure Dial-Up Networking.
Unit - V. Debugging GNU Debugger helps you in getting information about the following: 1.If a core dump happened, then what statement or expression did.
COP 3530 Spring 12 Discussion Session 1. Agenda 1.Introduction 2.Remote programming 3.Separate code 4.Compile -- g++,makefile 5.Debug -- gdb 6.Questions?
CS4315A. Berrached:CMS:UHD1 Operating Systems and Computer Organization Chapter 4.
Lab 9 Department of Computer Science and Information Engineering National Taiwan University Lab9 - Debugging I 2014/11/4/ 28 1.
Downloading a new OS kernel to the EBox. Connecting to the eBox Use Network Cable to connect Need to decide if you will be using a Static IP or DHCP Details.
Embedded Real-Time Systems Introduction to embedded software development Lecturer Department University.
 Wind River Systems, Inc Chapter - 4 CrossWind.
Chap. 4 ARM Boot Loader Internals. 2 S3C2500 ARM940T Core module ARM9TDMI CoreIC.
Introduction to networking (Yarnfield) Configure a router.
© 2002, Cisco Systems, Inc. All rights reserved..
1 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com Embedded Linux system development.
1.1.2 OneOs Downloading Software Upgrade
Introduction to Operating Systems
Chapter 1: A Tour of Computer Systems
Chapter 2: System Structures
Debugging with gdb gdb is the GNU debugger on our CS machines.
Introduction to Operating Systems
AT91RM9200 Boot strategies This training module describes the boot strategies on the AT91RM9200 including the internal Boot ROM and the U-Boot program.
Lecture9: Embedded Network Operating System: cisco IOS
Computer System Laboratory
Debugging.
Chapter 13: I/O Systems.
In Today’s Class.. General Kernel Responsibilities Kernel Organization
Lecture9: Embedded Network Operating System: cisco IOS
Presentation transcript:

Embedded Systems Principle of Debugger

Reference Materials kl.de/avr_projects/arm_projects/#winarmhttp:// kl.de/avr_projects/arm_projects/#winarm ocument/debugger/ew_GDB_RSP.pdfhttp:// ocument/debugger/ew_GDB_RSP.pdf

Software Debugging

GDB Host PC Target Board gdb's Remote Serial Protocol (RSP) Debugging Stub/Agent GDB Server GDB

Debugging Agent/Stub Small Code Response to GDB Request –Read / Write Memory –Read / Write Register –Set / Remove Breakpoints Provide Debug Trap –Breakpoint exception –Invalid instruction exception –System error exception Transmit CPU Status Data to Remote Debugger Host PC Target Board gdb's Remote Serial Protocol (RSP) Debugging Agent/Stub GDB

Typical Debug Session localhost$ sh-hitachi-hms-gdb a.out GNU gdb 5.0 Copyright 2000 Free Software Foundation, Inc. (gdb) target remote /dev/ttyS0 (gdb) load Loading section.text, size 0x1280 vma 0x1000 Loading section.data, size 0x760 vma 0x2280 Loading section.stack, size 0x10 vma 0x30000 Start address 0x1000 Transfer rate: bits in <1 sec. (gdb) b main Breakpoint 1 at 0x : file test.c, line 5. (gdb) continue Breakpoint 1, main () at test.c:5 5 for( i = 0; i < 10; i++ ) { (gdb) display j 1: j = (gdb) step 6 j = i * 2 + 1; 1: j = (gdb) step 5 for( i = 0; i < 10; i++ ) { 1: j = 1 (gdb) quit

GDB Remote Serial Protocol (RSP) RSP Message $ # CKSUM_MSN CKSUM_LSN Response of RSP Message + … - … Host PC Target Board gdb's Remote Serial Protocol (RSP) Debugging Agent/Stub GDB if the received checksum was correct, and the receiver is ready for the next packet if the received checksum was incorrect, and the message needs to be retransmitted sum of, keep last 8-bit, expressed in ASCII

RSP Example Read All Registers [gdb]$g#67 [target]+$ abcdef abcdef...#xx Write All Registers [gdb] $G abcdef0...#xx [target]+ $OK#9a Write Specific Registers [gdb] $P10= c#b3 [target]+ $OK#9a Read Memory [gdb] $m4015bc,2#5a [target]+ $2f86#06 Write Memory [gdb] $ M4015cc,2:c320#6d [target] + $OK#9a Set register 16 to the value 0x40149c All register values Read two bytes, starting at address 0x4015bc Write the value 0xc320 to address 0x4015cc

RSP Example Step [gdb]$s#73 Continue [gdb] $c#63 Console Output [target] $O48656c6c6f2c20776f726c64210a#55 Prints “Hello, world!\n” on the gdb console

Request ? : Read current Status g : Read all registers G : Write all registers m , : Read memory M , : : Write meoory c : Continue s : Single step k : Kill RSP Command List Response “” : Command not support E : Error OK : w : Exit X : Terminate at signal S : Stop at signal O : Console output

Detailed Example of a GDB Session write break point write memory run until stop read memory stopped, response with register value that GDB may be interested response with memory data stopped, response with register value that GDB may be interested

Break Point & Step Break point Program Codes GDB Stub Set Breakpoint Run User Code Wait for Exception Report CPU status Remove Breakpoint Program Stops Enter Exception ISR Waiting For Debugging Command … … … … … … … … … … … …

Use GDB with Embedded Linux user board GDB Ethernet Cable GBD Server Remote PC Running Linux

Transfer Binary to Board Transfer Method Ethernet FTP NFS UART Z-Modem Root Image USB-Disk CF/SD-Card Storage RAM FlashROM Remote Disk Communication Applications on the Development Board Device Driver for These Storage Rebuild and download Root Image Network Hardware

Bootloader Linux need to copy kernel from ROM to RAM Kernel Image Root Image ROM User Data Storage Kernel Root Image RAM User Data Storage User Apps

NFS Debugging Mode Kernel RAM User Data Storage NFS Server Ethernet Chip User Apps Avoid repeatedly re-write Flashrom

Start Remote Debug gdbserver :1234 Hello_arm xxx-elf-linux-gdb Hello_arm target remote :1234 IP address of PC (Can be found by command “ ifconfig ”) run from the development board Run from PC IP address of development board Run from PC

Remote Debugging Commands br main set break point at main() cont continue run (stopped at main()) l list source code n step n

Other Useful GDB Command Stop running “Ctrl-C” exit GDB quit run program run Set breakpoint break main Clear breakpoint clear main Check existing breakpoint info b Step ( enter subroutine ) s Step ( skip subroutine ) n Show call stack bt check memory 0x200 x 0x200 Check variable m p m Change value of m to 7 set m=7 Display reg. PC p/x $pc Dislpay reg. SP p/x $sp Change PC to 0 set $pc=0 Disassember from addr. 0 x/5i 0x0