Integration for CodeWright TRACE32 Online Help TRACE32 Directory TRACE32 Index TRACE32 Documents... 3rd Party Tool Integrations... Integration for CodeWright... 1 Overview... 2 Brief Overview of Documents for New Users... 3 Operation Theory... 4 Installation... 5 Startup Sequence... 6 Menu Commands... 7 Go Continue application 7 Break Stop application 7 Step Into Step into function call 7 Step Over Step over function call 7 Set Breakpoint Set breakpoint on current line 8 Delete Breakpoint Delete breakpoint on current line 8 Add Watch Add variable to watch window 8 Delete Watch Delete variable from watch window 8 Restart Target Do a target restart 8 Start TRACE32 Start display driver 9 Connect Connect to TRACE32 9 Disconnect Disconnect TRACE32 9 Synchronize Synchronize editor and PC 9 Get Selection Load source of TRACE32 selection 10 About trace32.dll Information about 'trace32.dll' 10 Working with the Codewright extensions... 11 Known Bugs... 12 Integration for CodeWright 1
Integration for CodeWright Version 29-Mar-2017 Overview This interface integrates the Codewright editor (Premia Corporation) and TRACE32. Current Supported Codewright versions are: Versions: Codewright 4.0, 5.0, 6.0 Hosts: Windows95, Windows NT Integration for CodeWright 2 Overview
Brief Overview of Documents for New Users Architecture-independent information: Debugger Basics - Training (training_debugger.pdf): Get familiar with the basic features of a TRACE32 debugger. T32Start (app_t32start.pdf): T32Start assists you in starting TRACE32 PowerView instances for different configurations of the debugger. T32Start is only available for Windows. General Commands (general_ref_<x>.pdf): Alphabetic list of debug commands. Architecture-specific information: Processor Architecture Manuals : These manuals describe commands that are specific for the processor architecture supported by your debug cable. To access the manual for your processor architecture, proceed as follows: - Choose Help menu > Processor Architecture Manual. RTOS Debugger (rtos_<x>.pdf): TRACE32 PowerView can be extended for operating systemaware debugging. The appropriate RTOS manual informs you how to enable the OS-aware debugging. Integration for CodeWright 3 Brief Overview of Documents for New Users
Operation Theory The interface installes an additional menu to Codewright, which allows to control TRACE32 main features via Codewright. It consists of a 32-bit DLL (dynamic link library), which is linked to Codewright at startup. Codewright passes all requests of the inserted menu to the DLL. The DLL sends the requests to TRACE32 via sockets (important: WINSOCK has to be installed!). The display driver transports the requests to the TRACE32. The answer goes exactly the same way backwards. Codewright --> trace32.dll --> t32 --> TRACE32 NOTE: This integration uses internally the TRACE32 Remote API. The Remote API has restrictions if TRACE32 runs in demo mode. Please see there for further details. Integration for CodeWright 4 Operation Theory
Installation Follow these steps to install the Codewright extension for TRACE32: 1. Copy the file "~~/demo/env/cwright/trace32.dll" to your Codewright directory. 2. Edit your "config.t32" file: Add between two empty lines the line "RCL=NETASSIST", if not already there. No "PORT=" line should follow. The port defaults to 20000, and this is the only one currently usable. 3. Edit your "cwright.ini" file: At the end of t he section "[LibPreLoad]" add the line "LibPreLoad=trace32.dll" Integration for CodeWright 5 Installation
Startup Sequence For the first try on the Codewright integration follow the steps below. If you once got experienced, you can customize your own startup sequence, e.g. starting the TRACE32 driver from Codewright. 1. Switch on power on TRACE32 and your target. 2. Start the TRACE32 display driver. 3. Change the directory inside TRACE32 to the demo example. 4. Start Codewright. It should contain the extra menu "Trace32". 5. Load the project "demo.pjt" of the demo example. 6. Connect to TRACE32 by invoking the menu "Trace32 -> Connect" 7. Restart the demo application by invoking "Trace32 -> Restart Target". Answer "OK" to the default restart command. 8. After the application came up, try "Synchronize", "Step" etc. Integration for CodeWright 6 Startup Sequence
Menu Commands The DLL adds a menu to the Codewright menu bar. This chapter describes the added menu items. Each menu item is assigned to a specific DLL function. You can assign a shortkut key to the DLL functions using the Codewright assignment tools. Go Continue application DLL Function: t32go Equivalent emulator command: "Go" This command starts the application in the emulator. Break Stop application DLL Function: t32break Equivalent emulator command: "Break" This command stops the application in the emulator immediately. Step Into Step into function call DLL Function: t32stepinto Equivalent emulator command: "Step.Hll" Performs an HLL single step. If a function is called, the emulation will stop at the beginning of this function. Step Over Step over function call DLL Function: t32stepover Equivalent emulator command: "Step.Over" Performs an HLL single step. If a function is called, the emulation will stop when the function returned to the caller. Integration for CodeWright 7 Menu Commands
Set Breakpoint Set breakpoint on current line DLL Function: t32setbreakpoint Equivalent emulator command: "Break.Set" Sets a program breakpoint on the line currently marked by the cursor. Delete Breakpoint Delete breakpoint on current line DLL Function: t32delbreakpoint Equivalent emulator command: "Break.Delete" Deletes the program breakpoint on the line currently marked by the cursor. Add Watch Add variable to watch window DLL Function: t32addwatch Equivalent emulator command: "Var.AddWatch" Adds the variable marked or selected by the cursor to the watch window inside the TRACE32 display. If no watch window is currently active, one is created. Delete Watch Delete variable from watch window DLL Function: t32delwatch Equivalent emulator command: "Var.DelWatch" Deletes the variable marked or selected by the cursor from the active watch window inside the TRACE32 display. Restart Target Do a target restart DLL Function: t32restarttgt Equivalent emulator command: "DO restart" Integration for CodeWright 8 Menu Commands
Performs any practice command. Normally used for restarting the target by invoking a practice file. For this reason the default is "do restart", which implies, that there is a practice file called "restart.cmm" containing all restart activities, such as reset and reload. Start TRACE32 Start display driver DLL Function: t32start Equivalent emulator command: -- Start an instance of the TRACE32 display driver. You are prompted for the start command. Connect Connect to TRACE32 DLL Function: t32connect Equivalent emulator command: -- Connects the Codewright editor to the TRACE32 display driver. After successful connection a "Synchronize" is performed automatically. Disconnect Disconnect TRACE32 DLL Function: t32disconnect Equivalent emulator command: -- Disonnects the Codewright editor from the TRACE32 display driver. Synchronize Synchronize editor and PC DLL Function: t32synchronize Equivalent emulator command: -- This command synchronizes the Codewright editor to the current program counter. The source code is loaded into Codewright (if not already loaded), and the cursor is placed at the current source line. The current source line is marked green. All breakpoints set on lines in that file are marked red. Integration for CodeWright 9 Menu Commands
Get Selection Load source of TRACE32 selection DLL Function: t32getselection Equivalent emulator command: -- If a source line in a TRACE32 window was marked (e.g. in a "d.l" or "a.l" window), this command gets the last selection and displays it in the Codewright editor. The cursor is placed at the line selected. About trace32.dll Information about 'trace32.dll' DLL Function: t32about Equivalent emulator command: -- This menu item gives information about the "trace32.dll" file, such as build date and version. Integration for CodeWright 10 Menu Commands
Working with the Codewright extensions You have to keep some things in mind, when working with the integration. It is not dangerous to use both - Codewright Extension and Trace32 driver - to control the emulator. However in some cases the editor gets confused. Codewright tracks the program counter when single stepping or breaking through its menu. It does not recognize any action done in the display driver. That means, if you perform steppings in the display driver, Codewright will show you the wrong program line. But that is harmless, because performing a "Synchronize" will get you back to the right line. The Trace32 DLL for Codewright has its own breakpoint management. Breakpoints, that should be displayed in Codewright, MUST be set in Codewright and MUST be deleted in Codewright. Codewright will not show breakpoints set in the display driver. We strongly recommend to use EITHER the Codewright extensions for breakpoints OR the breakpoint commands in the display driver BUT NOT both mixed together. Integration for CodeWright 11 Working with the Codewright extensions
Known Bugs - Multiple HLL breakpoints on single ASM lines The breakpoint management inside the DLL works on HLL lines, while the breakpoint system inside TRACE32 works on hardware addresses. If you set two breakpoints on different HLL lines, which represent the same hardware address (e.g. comments), Codewright will have two breakpoints, while TRACE32 will have one. Deleting one of the HLL breakpoints will delete the hardware breakpoint. That means, in Codewright there is on breakpoint remaining, while TRACE32 has no breakpoint left. Workaround: Set breakpoints only on code lines. When detecting multiple breakpoints on a single address, delete all that breakpoints. Integration for CodeWright 12 Known Bugs