Presentation is loading. Please wait.

Presentation is loading. Please wait.

 Wind River Systems, Inc. 1997 Chapter - 4 CrossWind.

Similar presentations


Presentation on theme: " Wind River Systems, Inc. 1997 Chapter - 4 CrossWind."— Presentation transcript:

1  Wind River Systems, Inc. 1997 Chapter - 4 CrossWind

2 4-2 CrossWind Overview Starting A Debugging Session Basic Debugging Customizing CrossWind System-level Debugging

3 4-3 Overview CrossWind executes on host; code executes on target. Allows debugging at source and assembly levels. Graphical interface Command line interface. WindSh functionality is available from CrossWind Tcl allows customization of GUI and creation of user- defined commands. Choice of user interfaces:

4 4-4 Host - Target Interaction Crosswind WDB Agent tgtsvr back end VxWorks

5 4-5 CrossWind Overview Starting A Debugging Session Basic Debugging Customizing CrossWind System-level Debugging

6 4-6 Executing CrossWind Compile code with the the -g option to generate debug symbols. Use the Launcher. (UNIX Hosts) To invoke the debugger. To exit the debugger : Start a target server with the appropriate back-end communication strategy. Use the Tools menu.(PC Hosts) Select File => Quit from the debugger Menu. (UNIX) Select Debug => Stop Debugging from the Tornado menu bar. (PC)

7 4-7 Connecting to a Target CrossWind connects automatically when invoked from the Launcher (UNIX) or Tornado IDE (WINDOWS). Example output : (UNIX Host) Connecting to target server... …. Connected to vx5@columbia VxWorks : (no debugging symbols found)...ok foo.o... ok prog.o... ok newprog.o: newprog.o: No such file or directory. Done. Output gives information about modules found on target.

8 4-8 Source Path Source path - a list of directories to search for object modules and source code modules. The default source path includes the current working directory and the directory containing VxWorks image. To add another directory: (gdb) directory dirName Typically done in initialization file.gdbinit in home directory. To display current source path (gdb) show dir Source directories searched: c:\Tornado\target\config\mv162;$cdir;$cwd

9 4-9 Loading Additional Modules To load modules after attaching to the target: Causes three loads: Executable code & dataVxWorks target Symbols & module infoTarget Server Debug informationDebugger The debugger will search its source path for modules to load. Select File => Download from CrossWind menu bar. (UNIX Host) Select Debug => Download from Tornado menu bar, or use the download button in the debugger toolbar.(PC Host)

10 4-10 Listing Source Displays the C or/and assembly source code centered at location. Examples, using argument : (gdb) list foo.c:1First few lines of foo.c (gdb) list 25Line 25 in foo.c (gdb) list mySubLocation can be a function. Without argument, fills display panel with source : (gdb) list Used to get source into debugger display panel. list location

11 4-11 Selecting A Task To Debug To spawn a task for debugging : To debug a task which is already running : Select Target => Attach Task... from the CrossWind menu. (UNIX Host) You can only debug one task per debugger session. Use the run command from the (gdb) prompt. Select Debug => Run from Tornado menu (PC Host). The task spawned will be called tDbgTask. Select Debug => Attach... from the Tornado menu.(PC Host) For Windows host, a separate Tornado environment must be initiated for each debugger session.

12 4-12 Getting Help Help can be obtained by selecting Help => GDB Online from the CrossWind menu bar.(UNIX Host) The Tornado User’s Guide and Debugging with GDB manuals document how to use the debugger. Help can be obtained by selecting Help => Manuals => Tornado User’s Guide => Debugger from the Tornado menu bar.(PC Host)

13 4-13 CrossWind Overview Starting A Debugging Session Basic Debugging Customizing CrossWind System-level Debugging

14 4-14 Debugging Tools Examples of debugger functionality : Continue Program execution. Set / Delete breakpoints. Step to next line of code. Step over a function call. Finish current subroutine. For a complete list of debugger tools and GUI access methods see the Tornado User’s Guide. Move up/down subroutine stack. Monitor variables. De-reference pointers. Call up editor.

15 4-15 Conceptual View of Stack foo1 () foo2 () foo3 () foo4 () Frame Number 3 2 1 0 Bottom of Stack Entry Point Current Frame Top of Stack

16 4-16 UNIX: The Graphical Interface Menu Bar Button Bar Program-Display Panel Command Panel

17 4-17 PC: The Graphical Interface Menu Bar Button Bar Program-Display Panel GDB Command Window

18 4-18 CrossWind Overview Starting A Debugging Session Basic Debugging Customizing CrossWind System-level Debugging

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

20 4-20 The Debugger’s Components The Remote Debugger consists of a GUI which interacts with a debugging “engine”. Tcl interpreter GUI Engine Tcl Interpreter GDB Debugger Engine User Interface Debug Engine You can customize the GUI or the debug “engine”.

21 4-21 CrossWind Overview Starting A Debugging Session Basic Debugging Customizing CrossWind System-level Debugging

22 4-22 Overview System-level debugging : System-level debugging supports: Debugging ISR’s. Debugging before the kernel is started. In system-mode, VxWorks, all application tasks and ISR’s stop when a breakpoint is hit. Uses the external agent. Debugs VxWorks and your application. The netrom and wdbserial back ends support system-level debugging. Configure WDB agent for dual or external mode.

23 4-23 Debugging in System Mode To enter system mode: (gdb) attach system Attaching to system. 0x407ae in wdbSuspendSystemHere () Configure your communication channel for system mode. Select an appropriate tgtsvr back end (wdbserial or netrom). Configure the WDB Agent for WDB_MODE_DUAL or WDB_MODE_EXTERN To exit system mode: (gdb) detach

24 4-24 Selecting a Thread to Debug To display all threads (the GDB term for VxWorks contexts): (gdb) info threads 6 System + 0x407ae in wdbSuspendSystemHere() 5 task 0x3de3d0 tExcTask 0x490da in qJobGet() 4 task 0x3dbabc tLogTask 0x490da in qJobGet() * 3 task 0x3d7788 tNetTask 0x40ec4 in semQPut() 2 task 0x3bcc64 tFtpTask 0x40ec4 in semQPut() 1 task 0x3a1340 tWdbTask 0x40ec4 in semQPut() Select a thread to debug: (gdb) thread 4 [Switching to task 0x3dbabc tLogTask ] #0 0x490da in qJobGet()

25 4-25 Examining a Thread Use normal Debugger tools to examine a thread. To set a thread-specific breakpoint : (gdb) break location thread threadNumber Resume execution of the system with Step, Next, Finish, or Continue from the Debugger menu. Stepping a thread inserst a breakpoint after the next line or instruction, and lets the entire system run until any thread hits a breakpoint.

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

27 4-27 Summary Executes on host while code executes on target. Tornado supports a source-code debugger which : Provides source-level debugging. Code must be compiled with -g option. Uses serial or NetROM communication link. System-level debugging: Is useful for debugging ISR’s and BSP’s. Requires configuring communication mode : - WDB agent. - Target server back end


Download ppt " Wind River Systems, Inc. 1997 Chapter - 4 CrossWind."

Similar presentations


Ads by Google