® 4-2 CrossWind 4.1Overview Starting A Debugging Session Basic Debugging System-Level Debugging.

Slides:



Advertisements
Similar presentations
6 Copyright © 2005, Oracle. All rights reserved. Building Applications with Oracle JDeveloper 10g.
Advertisements

Utilizing the GDB debugger to analyze programs Background and application.
Debugging What can debuggers do? Run programs Make the program stops on specified places or on specified conditions Give information about current variables’
1 Tornado: An Embedded System Development Tool Maung Wynn Aung Han CIS 642, Spring 2001 Prof. Insup Lee.
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
The IDE (Integrated Development Environment) provides a DEBUGGER for locating and correcting errors in program logic (logic errors not syntax errors) The.
A Guide to Oracle9i1 Creating an Integrated Database Application Chapter 8.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
Introduction Purpose Objectives Content Learning Time
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.
Debugging Cluster Programs using symbolic debuggers.
Memory & Storage Architecture Seoul National University GDB commands Hyeon-gyu School of Computer Science and Engineering.
Debugging applications, using properties Jim Warren – COMPSCI 280 S Enterprise Software Development.
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.
TotalView Debugging Tool Presentation Josip Jakić
® 2-2 Projects 2.1Projects Overview Bootable Projects and VxWorks Configuration Integrated Simulator Downloadable Projects Build Specifications.
Introduction Purpose This training course covers debugging an application on an SH target in the Renesas HEW (High-performance Embedded Workshop) development.
Debugging Dwight Deugo Nesa Matic
Debugging. 2 © 2003, Espirity Inc. Module Road Map 1.Eclipse Debugging  Debug Perspective  Debug Session  Breakpoint  Debug Views  Breakpoint Types.
Active-HDL Interfaces Debugging C Code Course 10.
Presented by IBM developer Works ibm.com/developerworks/ 2006 January – April © 2006 IBM Corporation. Making the most of The Eclipse debugger.
Module 6: Debugging a Windows CE Image.  Overview Debug Zones IDE Debug Setup IDE Debug Commands Platform Builder Integrated Kernel Debugger Other Debugging.
A Tutorial on Introduction to gdb By Sasanka Madiraju Graduate Assistant Center for Computation and Technology.
Allegro CL Certification Program Lisp Programming Series Level I Session Basic Lisp Development in the IDE.
Renesas Electronics America Inc. © 2012 Renesas Electronics America Inc. All rights reserved. Advanced E 2 Studio Topics.
3 Copyright © 2004, Oracle. All rights reserved. Working in the Forms Developer Environment.
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.
Data Display Debugger (DDD)
CSE 374 Programming Concepts & Tools Hal Perkins Fall 2015 Lecture 11 – gdb and Debugging.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 4 Slide 1 Slide 1 What we'll cover here l Using the debugger: Starting the debugger Setting.
Dale Roberts Debugger Dale Roberts, Lecturer Computer Science, IUPUI Department of Computer and Information Science, School.
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.
CSI605 Introduction to ddd. ddd ddd stands for the Data Display Debugger ddd is a graphical environment that resides on top of gdb We recall that gdb.
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?
Object-Oriented Application Development Using VB.NET 1 Chapter 2 The Visual Studio.NET Development Environment.
Debugging tools in Flash CIS 126. Debugging Flash provides several tools for testing ActionScript in your SWF files. –The Debugger, lets you find errors.
Ladebug Kernel Debugging Tutorial Bob Lidral. Introduction Kinds of kernel debugging How to use Ladebug for kernel debugging Not how to debug a kernel.
Lab 9 Department of Computer Science and Information Engineering National Taiwan University Lab9 - Debugging I 2014/11/4/ 28 1.
15 Copyright © 2004, Oracle. All rights reserved. Debugging Triggers.
Debugging Lab Antonio Gómez-Iglesias Texas Advanced Computing Center.
Embedded Real-Time Systems Introduction to embedded software development Lecturer Department University.
CITA 171 Section 1 DOS/Windows Introduction. DOS Disk operating system (DOS) –Term most often associated with MS-DOS –Single-tasking operating system.
HP-SEE Debugging with GDB Vladimir Slavnic Research Assistant SCL, Institute of Physics Belgrade The HP-SEE initiative.
 Wind River Systems, Inc Chapter - 4 CrossWind.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Introduction Purpose  This training course demonstrates the use of the High-performance.
Dale Roberts Debugger Dale Roberts, Lecturer Computer Science, IUPUI Department of Computer and Information Science, School.
Using the GNU Debugger (GDB)‏ Techzemplary Pvt.Ltd February 24 th 2008 Pranav Peshwe.
Institute of Radio Physics and Electronics ILug-Cal Introduction to GDB Institute of Radio Physics and Electronics and Indian GNU/Linux Users Group Kolkata.
DEBUG.
Chapter 2: The Visual Studio .NET Development Environment
Debugging Dwight Deugo
Debugging with gdb gdb is the GNU debugger on our CS machines.
gdb gdb is the GNU debugger on our CS machines.
Important terms Black-box testing White-box testing Regression testing
Important terms Black-box testing White-box testing Regression testing
Debugging with Eclipse
DEBUGGING JAVA PROGRAMS USING ECLIPSE DEBUGGER
GNU DEBUGGER TOOL. What is the GDB ? GNU Debugger It Works for several languages – including C/C++ [Assembly, Fortran,Go,Objective-C,Pascal]
Tornado Training Workshop
Debugging Visual Basic Programs
Module 6: Debugging a Windows CE Image
Debugging Dwight Deugo
Tornado Training Workshop
Code Composer Essentials 3.0
Debugging.
Makefiles, GDB, Valgrind
Debugging with Eclipse
Presentation transcript:

® 4-2 CrossWind 4.1Overview Starting A Debugging Session Basic Debugging System-Level Debugging

® 4-3 Overview Allows debugging at source and assembly levels. CrossWind executes on host; code executes on target. Based on GNU debugger GDB: –Debug engine customized for VxWorks multitasking and Tornado target server communication strategy. –Graphical user interface added. Windows and Unix GUIs differ. CrossWind uses the WTX protocol to communicate with the target server.

® 4-4 Customization The Debugger is easy to customize: –Extend or modify user interface –Add new debugger commands To customize the user interface: Use Tcl language. crosswind.tcl –Put Tcl commands in crosswind.tcl –Interpreted by GUI Tcl interpreter To customize the debug engine: gdb.tcl –Put Tcl commands in gdb.tcl –Interpreted by debug engine Tcl interpreter.gdbinit –Put GDB commands in.gdbinit WRS extensions provide access to the WTX protocol via Tcl functions.

® 4-5 Task vs. System Level Debugging Task level debugging: –Can debug tasks only, not ISRs. –By default, breakpoints affect only the attached task. Global task breakpoints may also be set. –When the attached task is stopped, other tasks and ISRs in the system continue executing. –Communication with WDB agent is interrupt driven. System level debugging: –Can debug tasks, ISRs, and pre-kernel execution. –Default breakpoints stop the whole system. Task-specific breakpoints may be set. –When system stopped, external WDB agent runs with interrupts locked out. During this time, communication with WDB agent is in polled mode.

® 4-6 CrossWind Overview 4.2Starting A Debugging Session Basic Debugging System-Level Debugging

® 4-7 Executing CrossWind -g -O0 Compile code with the -g option to generate debug symbols. Specifying -O0 is also recommended. Select a target server. To invoke the debugger: –Use the launcher CrossWind button(UNIX) –Use Tools => Debugger or button.(Windows) To exit the debugger: –Select File => Quit from the debugger menu.(UNIX) –Select Debug => Stop Debugging from the Tornado menu bar, or use button.(Windows)

® 4-8 Locating Code CrossWind needs to access both object and source code for modules to be debugged symbolically. Usually it can locate such modules automatically. Modules may be downloaded to the target via Download –Project Facility Download button or menu item. ldload –WindSh ld() command, CrossWind load command, or any other Tornado tool which can load modules. When GDB starts, it querries the target server for the file path to each object module loaded on the target. -g –The object module contains symbolic debug information if compiled with -g. –If debug information is found, CrossWind searches its source path for the corresponding source code.

® 4-9 Listing Source Displays the C or/and assembly source code centered at location. Without argument, displays source: (gdb) list Used to get source into source display window. This happens automatically when GDB attaches to a task. Examples, using argument: (gdb) list foo.c:1 First few lines of foo.c (gdb) list 25 Line 25 in foo.c (gdb) list mySub Location can be a function.

® 4-10 Debugging a Task Use CrossWind to create a new task tDbgTask that runs the function to debug: run – (gdb) run function arg1 arg2... Debug->Run –Windows users may use Debug->Run or the button. –You may set breakpoints before running the task. To debug a task already running on the target, GDB must attach to the task. –Targets->Attach Task... –Targets->Attach Task... in CrossWind (UNIX) –Debug->Attach... –Debug->Attach... in Tornado (Windows) attach – (gdb) attach taskId –The task is suspended wherever it is executing. (Windows users may override this default.)

® 4-11 Debugging Multiple Tasks At task level, a CrossWind instance may be attached to a single task at a time. To debug multiple tasks, either detach from one and attach to another, use system level debugging, or start multiple debugger instances. To detach from a task, resuming it, use –Targets->Detach Task/System –Targets->Detach Task/System(UNIX) –Detach and Resume –Detach and Resume (Windows) – detach – detach from the GDB command line. To detach from a task, leaving it in its current state, use –Debug->Detach –Debug->Detach(Windows) –detach –detach auto from the GDB command line. sdetach (GDB) sdetach detaches, leaving the task suspended.

® 4-12 Automatic Attachment (Windows) In Windows, CrossWind may be configured to automatically attach to a task which generates an exception or hits a breakpoint. Tools => Options => Debugger Use Tools => Options => Debugger dialog. Three choices: –Never auto-attach. –Auto-attach only if not already attached. –Auto-attach even if already attached. The last choice, always auto-attach, can lead to flurries of reattachments when several tasks hit a global breakpoint.

® 4-13 CrossWind Overview Starting A Debugging Session 4.3Basic Debugging System-Level Debugging

® 4-14 Debugging Tools Examples of debugger functionality: –Set/delete breakpoints. –Step to next line of code. –Step over a function call. –Continue program execution. –Finish current subroutine. –Move up or down stack frames. –Monitor variables or other expressions. –De-reference pointers. –Call up editor (UNIX). For a complete list of debugger tools and GUI access methods, see the Tornado User’s Guide.

® 4-15 Make it Go! Make it Stop! step next continue finish interrupt WindowsUnix

® 4-16 A View of the Stack Click on the desired frame to select it. info locals. The selected frame is used in informational commands such as info locals. finish It also also affect the stopping address of finish.

® 4-17 Breakpoints Default breakpoints: –Stop attached task, or whole system in system mode. Global breakpoints: –Stop any breakable task. Good for stopping tasks spawned by the task being debugged. Hardware breakpoints on some architectures. –Halts on instruction access or various sorts of data access to specified address. Limited in number. –PPC 603, 603e, 604, 860, 403; Mips R4650; x86; i960 CA, JX, HX Temporary breakpoints: –Effective once, then deleted (default) or disabled.

® 4-18 Breakpoints, Continued. Conditional breakpoints: –Effective if specified expression is true, otherwise task hitting breakpoint is automatically resumed. break snafu.c:228 if fbCount > 4 – (gdb) break snafu.c:228 if fbCount > 4 –Debug => Breakpoints => Advanced –Debug => Breakpoints => Advanced (Windows) Listing breakpoints: info breakpoints (i b) –GDB info breakpoints (i b) command. –Debug->Breakpoints –Debug->Breakpoints dialog.(Windows)

® 4-19 Information Displaying variables and expressions: –Watch windows - extendable, editable, dockable, hierarchical display. (Windows) –Inspect windows - hierarchical display. Following pointers opens additional inspect windows.(UNIX) display /W – (GDB) display /W expr print – (GDB) print expr Other display windows: –Backtrace, Registers(UNIX, Windows) –Locals, Memory dump (Windows)

® 4-20 UNIX: The Graphical Interface Menu Bar Toolbar Program Display Panel Command Panel

® 4-21 PC: The Graphical Interface

® 4-22 CrossWind Overview Starting A Debugging Session Basic Debugging 4.4System-Level Debugging

® 4-23 Overview System-level debugging supports: –Debugging ISRs. –Debugging before the kernel is started. –Multitask debugging. In system mode, VxWorks and all application tasks and ISRs stop when a breakpoint is hit. The external WDB agent runs with interrupts locked out when VxWorks is stopped. WDB system debugging VxWorks configuration must include the WDB system debugging component.

® 4-24 Debugging In System Mode To enter system mode: attach system (gdb) attach system Attaching to system. 0x407ae in wdbSuspendSystemHere () To exit system mode: detach (gdb) detach While in system mode, one can use normal debugger features: –Step/continue –Set breakpoints –Display expressions

® 4-25 Selecting a Thread To Debug info threads To display all threads (the GDB term for VxWorks contexts), use the info threads command: i th (gdb) i th 5 task 0x3e8984 tExcTask 0x72e50 in qJobGet() 4 task 0x3e605c tLogTask 0x72e50 in qJobGet() 3 task 0x3b349c + tNetTask 0x38e44 in wdbSuspendSystemHere() 2 task 0x389de4 tPortmapd 0x3c36a in noSemQPutEvt() 1 task 0x3881c0 tWdbTask 0x3c36a in noSemQPutEvt() To select the current thread, for information display: thread 4 (gdb) thread 4 [Switching to task 0x3e605c tLogTask ] #0 0x72e50 in qJobGet ()

® 4-26 Examining a Thread Use normal debugger tools to examine a thread. To set a thread-specific breakpoint: breakthread (gdb) break location thread threadNumber –If the breakpoint is hit by a different thread, the system is resumed automatically. Step, Next, Finish, Continue Resume execution of the system with Step, Next, Finish, or Continue from the debugger menu. –When you continue the system, VxWorks controls scheduling. step, nextfinish –You may not be in the same task after a step, next, or finish command completes. Such commands may involve setting a breakpoint and resuming the system.

® 4-27 Caveats Cannot create a new task with run. Can only step or continue from where system is stopped. Cannot use multiple debuggers per target.

® 4-28 Summary Tornado supports a source-code debugger which: –Executes on host while code executes on target –Provides source-level debugging -g -O0-O Code must be compiled with -g option. For easiest debugging, also specify -O0 (or no -O flags). System-level debugging: –Is useful for debugging ISRs and BSPs. –Is useful for multitask debugging. –VxWorks and application freeze when breakpoint is hit. –WDB agent uses polled-mode communication when system suspended, as interrupts are locked out.