Home

MN10300 Series C Source Code Debugger User`s Manual

image

Contents

1. 32 Window command 66 83 256 Window display 62 65 Write File Program command WR 116 X X Display Symbol command 182 Y Y Delete Watch command 199 MN10300 Series C Source Code Debugger User s Manual March 2000 2nd Edition 2nd Printing Issued by Matsushita Electric Industrial Co Ltd Matsushita Electric Industrial Co Ltd Semiconductor Company Matsushita Electronics Corporation Nagaokakyo Kyoto 617 8520 Japan Tel 075 951 8151 http www mec panasonic co jp SALES OFFICES E U S A SALES OFFICE Panasonic Industrial Company PIC New Jersey Office 2 Panasonic Way Secaucus New Jersey 07094 Tel 201 392 6173 Fax 201 392 4652 Milpitas Office 1600 McCandless Drive Milpitas California 95035 Tel 408 945 5630 Fax 408 946 9063 Chicago Office 1707 N Randall Road Elgin Illinois 60123 7847 Tel 847 468 5829 Fax 847 468 5725 Atlanta Office 1225 Northbrook Parkway Suite 1 151 Suwanee Georgia 30174 Tel 770 338 6940 Fax 770 338 6849 San Diego Office 9444 Balboa Avenue Suite 185 San Diego California 92123 Tel 619 503 2940 Fax 619 715 5545 E CANADA SALES OFFICE Panasonic Canada Inc PCI 5700 Ambler Drive Mississauga Ontario L4W 2T3 Tel 905 624 5010 Fax 905 624 9880 E GERMANY SA
2. 209 Display Source Line command V 187 Display Time command TIME 210 Display Trace Dump Window command TDW 151 Display Watch command W command 195 Display Change Data commands command 184 A command 190 C command 171 D command 167 Ecommand 169 F command 172 H command 179 M command 174 PF command 180 PRINTF command 180 R command 177 S command 175 U command 188 V command 187 X command 182 9 Appendix 279 Display Change Registers command R 177 z E Change Memory command 169 EC Cancel Break Event command 136 EV Set event command 127 EX Allocate Memory command 158 EXIT Exit command
3. 41 Start Trace command TG 146 Startup 56 Status display area 64 Stop Trace command TS 147 Structure and union inspection 88 Subprocess 49 Return from subprocess 50 Startup 49 Startup command 203 Alphabetic 282 Supplied power 241 Symbols Display command X 182 Register Change Delete command 184 Symbols handled by the C Source Code Debugger 97 System Control commands command 203 205 command 205 command 197 HELP command 202 Q command 201 T T Single step Execution command 117 TD TDU Real time Trace Execution command 148 TDW Trace Dump Window Display command 151 TG Trace Start command 1 146 TI Timer command 153 TIME Time
4. 47 Register Watch command W 195 Register window 63 Display 41 Hide 41 Reset command RESET 123 S S Search Memory command 175 SALL Macro Display Output Suppression command 233 SM Set Cancel Sample Area command 161 Screen control 66 Scrolling 42 Search Memory command S 175 Set Option command OPTION 217 Set break 45 Set event command EV 127 Set Cancel Sample Area command SM 161 Set Display Trigger command TRIG 156 Shell function 78 Single step execution 44 Single step execution command T 117 Size specification B startup options 56 Software break 125 Special symbols 99 Stack window 64 Display 41 Hide
5. 164 On the fly NO INFLUENCES 2Wunction R O Tabulate access status PROF joniorrictry PROF These commands tabulate which functions Subroutines are accessed what percentage of the time while the user program is running PROF ON This command specifies the start of tabulation for the profile PROF OFF This command stops tabulation for the profile This is the state in effect when the C source code debugger is started up PROF CLR This command clears the profile information PROF This command displays based on the tabulated profile information the time that each function subroutine was executing and the percentage of the total time that each function accounted for The functions are dis played in order of time consumed starting from the function that con sumed the most time Because PROF ON OFF can be specified whenever desired it is possible to create profile information concerning only a particular portion of a program e In order to use the profile function it is necessary for the debug A ging information to be loaded beforehand tt e If an overlay load is made to the microprocessor s internal instruc tion RAM during profile tabulation the profile information will not be tabulated correctly Performance Measurement 7 Dialog Commands 165 Example eee gt prof on gt g gt IM 0 S 0 D0 0001B072 D1 00000000 D2 00000000 D3 00000000 P
6. A block transfer cannot be made to special regiter areas Data Display Change 7 Dialog Commands 175 On the fly INFLUENCES function Memory pattern search S lt address S gt lt address E gt lt search pattern gt SB lt address S gt lt address E gt lt search pattern gt SW lt address S gt lt address E gt lt search pattern gt SD lt address S gt lt address E gt lt search pattern gt These commands display the addresses in memory from lt address S gt to lt address E gt where the data matches lt search pattern gt Option Use lt address S gt lt address E gt lt search pattern gt Search starting address Search ending address Up to 16 items of data can be specified up to 16 characters enclosed in single quotation marks can be specified for lt search pattern gt in the S and SB commands S SB SW SD Byte 8 bits search Word 16 bits search Double word 32 bits search Data Display Change 176 Example gt d 80000000 8000002F 80000000 DC 06 00 00 00 FF 24 00 01 F2 FO 90 00 2D 00 20 80000010 F1 00 60 20 04 29 FC Cl FB F8 FE FC FC FF OD 00 80000020 00 00 F8 FE 04 CA F4 CB CB F8 FE F8 DD 16 00 00 gt s 80000000 8000002 ff 80000005 8000001D gt Data Display Change 7 Dialog Commands 177 R Display change register value R R lt register name gt lt
7. 16 18 19 Indicator disabled specification N startup options 56 Inspect command INS 193 Inspect function 84 Interface board 18 243 Installation 22 K K Backtrace command 191 KEYIN Keyboard Input command 237 KILL Delete Registered Macro command 235 Alphabetic L L LP Load Program command 114 LALL Output Macro Display command 232 LIST Display Output Specification command 209 Load Program 40 Load Program command 112 L LP command 114 RD command 115 WR command 116 M M Transfer Memory command 174 MAP EX Allocate Memory command 158 MEM Memo command 215 MLIST Display Registered Macros command 234 Macro 51 Macro command execution 31 Delete Registered Macros command KILL 235 Display Registered Macros command MLIST 234 Keyboard Input
8. 201 Electrical Specifications 241 248 Environment Specifications 241 248 Environment Variables HELP 25 202 PANASRC 24 114 187 PATH 25 TMP TEMP 25 Error Messages 249 Execute Program commands G command 121 P command 119 T command 117 Execution 70 External dimensions 241 F F Fill Memory command 172 FOR Execute for Macro command 228 File selection 42 43 File selection window display 42 Fill Memory command F 172 Flat cable 18 Flow of debugging operations 33 Forced termination 83 Function key 82 Function step execution 44 Function step execution command P 119 G G Go command
9. 205 Subprocess startup command 203 command History function 205 command comment 212 command register change delete symbol 184 lt command batch processing 214 gt command log output 213 command evaluate C expression 197 __DEBINF __ 184 __ERR ___ 99 RUN__ 99 Alphabetic A A Assemble command 190 Access status tabulation command PROF 164 Assemble command A 190 B BC Cancel Break command 136 BD Disable Break command 137 BE Enable Break command 139 BEL Bell command 210 BP Set Display Break command 130 BPA Set AND Break command 133 BPS Set Sequential Break command 134 BREAK Exit Macro command 231 Backtrace command K 191 Batch command lt 214 Bell command BEL 210 Binary operator 104 Symbols Al
10. 121 Go command G 121 Go to Editor Screen 50 Alphabetic 280 H H Display Expression command 179 HELP Display Help command 202 HELP environment variable 202 HOME Cursor Home command 208 Hardware List 18 Hardware break 125 Hardware related commands MAP EX command 158 TD TDU command 148 TDW command 151 TG command 146 TI command 153 TM command 142 TRIG command 156 TS command 147 Help Display Help window 38 Hide Help window 39 History function commands 205 205 Host computer settings 25 l IF Conditional Execution of Macro command 236 INS Inspect command 193 In circuit Emulator
11. CONTENTS lt Contents 2 gt Chapter 1 C Source Code Debugger Overview C Source Code Debugger Overview ccceeeeeeeceeeeteeeeeeeeeteteeeeeneeeeee 2 NOteS ON USC i siteciccekcaedesssenavhe dead eaaa benedeni orate 13 2 1 Hardware Notesu isedus ionnd ena E a ERE 13 2 2 Software Notes 0 ccccccceccesssceeeeeeseeeeeeeseseeeeeessneeeeesesteeeeeees 14 2 3 ROM RAM i ececeisee stds cctv seca dgaieessdedeteadetedgve dices e aa a aan 14 2 4 Program EXGCuiOM visis rerio aa 14 2 5 Breaks cena cee eae se nest eoses teases peewee 15 2 6 Tracing a a E E EEN 15 2 7 COATT sinna a e a n r E 16 2 8 Miscellanous ceadrcindsseadererianncasranscasecemmindegxtacdes ieaventacdieanie 16 Chapter 2 C Source Code Debugger Configuration Hardware LiSt crisccscceseessasecenbeced doxdeyansduveds aiaia ia a EA 18 Descriptions of Each DeVICEG sessao E 19 2 1 circuit ENON ooh ce are tais cttcecteiadecs ae a 19 2 2 C Source Code Debugger 10300 Floppy Disk 00e 20 Chapter 3 Connections and Startup 1 Installing the Interface Board c cccceceeeeeseeeeeceeeeeeeeeeaeeseeeeeessaeeseenees 22 1 1 Installation in the PC 9800 Series ccccceeeeeeeeeeeeeseeeeees 22 1 2 Installation in the PC 98 NOTE Series cccseecteeeeeeeees 23 1 3 Installation in the PC AT DOS V Series a an 23 Connection Procedure sssr a NE 24 2 1 Connection Procedure ceeeccceecseeeeeeeeeeeeeeeeeseeeeeeeesessaeee
12. 03FFH 3 F F Note indicates any position is fine Set an unused address from 0300 to 03FFH as the I O address e DIP switch DSW5 7 settings 1 2 3 4 DSW5 OFF OFF OFF ON DSW7 OFF ON ON ON Interface Board Switch Settings 248 Special Notes on the Probe 3 1 Electrical Specifications The absolute maximum ratings and electrical characteristics are the same as those of the microcomputer inside the probe When power is supplied from the target the supply voltage must be between 0 5V and 3 6V and while the unit is in operation stable voltage between 2 5V and 3 6V must be supplied Operation is not guaranteed if the supply voltage is not stable 3 2 Environment Specifications Item Ratings Temperature During operation 10 C to 30 C During storage 0 C to 45 C Humidity During operation 20 to 80 During storage No more than 90 Special Notes on the Probe Not enough memory 9 Appendix 249 C Source Code Debugger Error Messages The C source code debugger displays an error message when an error is found in a command that was input by the user The C source code debugger error messages are explained below The C source code debugger could not be started up because there is not enough available memory Restart the C source code debugger with the B or F option EMS driver not found Not enough free space in EM
13. System Control Commands 7 Dialog Commands 205 On the fly NO INFLUENCES functione l Display search history lt character string gt The C source code debugger has an internal 16 level command line input buffer that can be used to display up to the last 16 command lines that were input It is also possible to search for character strings in the buffer from most recent to oldest The information displayed by this command can be freely edited within the Command window This command displays the previous command that was input history dis play lt character string gt This command searches for a character string in the history buffer that begins with lt character string gt starting from the most recent command If a character string that meets the condition is found it is displayed coy and In order to differentiate this command from the subprocess initia tion command do not insert a space or tab between the E lt character string gt u lt MS DOS external command name gt Subprocess initiation lt character string gt History display search Chapter 6 section 2 6 Shell functions System Control Commands 206 Other Commands The C source code debugger is provided with other commands for Command window display control cursor control clear screen etc memos option set tings log output and batch execution CLS command This
14. ccceeeeeeeeeeeeeeeeeeetteeeeeeeees 141 TM Set display trace mode ceceeceeeeeeeeeeeeeeetteeeeeeeees 142 WG Stat TACO sireenin esiaine seia aa aniei 146 TS Stoptrace oe cess acts codes anaeeucdasesseactsaigiazeled tevoecedassevvenkasds 147 TD TDU Display trace sic s cciniccadietn asin iit sieneied 148 TDW Display trace WINGOW assisi ans esa 151 TI Measure display Execution time c e 153 TRIG Set display trigger c cccceeeeeeeeeeseteeeeeeeeeteteeeeeneeees 156 MAP EX Assign MEMOLY ce eeeeeceeeeeeeeeeeeeeteeeeeeeeeeeeneeees 158 5 Performance Measurement sisisi iaeiiai 160 SM Set release sample area cceceeeeeeeeeeeeeeeteeeeeeeeees 161 PROF Tabulate access status cccceeeeeeeeeeeeeteeeeeees 164 6 Data Display Change ccccccceceeeecceeeeeeeeeeeeeeeeeaeeeeeeeeessaeeeeeeeeseas 166 D Display dump of contents of Memory ee 167 E Change specified memory contents cceeeeeeeees 169 C Compare specified memory contents cc cceeeeee 171 F Fill specified range of memory with data value 172 M Block transfer of specified range of memory ceeeeeeee 174 S Memory pattern Search ceeeceeeceeeeeeeeeeeeeeeetteeeeeneee 175 R Display change register value eceeeeeeeseeeeeeeeteeeeeees 177 H Display expression operation results 179 PRINTF PF Display format ssimsrircisicrn s 180 X Display
15. Trace stop gt tg gt Other Hardware related Commands 7 Dialog Commands 147 On the fly NO INFLUENCES function T S Stop trace This command stops tracing while the user program is running To restart tracing use the TG command When TS is valid the message Trace stop is output The TS command can only be executed while the user program is g running Other Hardware related Commands 148 TD TDU TD TDU TD Dump INFLUENCES On the fly Disassemble NO INFLUENCES meeste Display trace This command displays a hexadecimal dump TD or a disassembled code dump TDU of the contents of trace memory every machine cycle If the contents of the frame to be displayed are identical to those of the previ ous frame a semicolon is displayed If this command is executed the number of frames sampled is displayed and trace display mode is initiated In this mode the prompt changes to and the system waits for a key to be pressed The sub commands that can be used are shown on the following page If the TD command is executed while tracing the message Stop Trace Y N is displayed on the screen Pressing Y stops tracing and displays the con tents of trace memory Pressing N does not stop tracing and returns control to the command input state If trace display mode is exited while a program is running the message Go Trace Y N
16. DO D1 D2 D3 data registers AO Al A2 A3 address registers MDR multiply and divide register PC program counter SP stack pointer LIR branch destination instruction register LAR instruction fetch address register PSW processor status word CF carry flag ZF zero flag NF negative flag VF overflow flag JE interrupt enable flag IMO IM1 IM2 interrupt mask level Example gt while DO D1 Vv NN Pe compare the contents of the DO register and the D1 register execute trace command end of macro In the above example the T single step execution command is executed un til DO and D1 are the same If a register and a symbol have the same name the register takes precedence Rules for Using Dialog Commands 104 1 5 Operational expressions An operational expression has one value derived from a combination of nu meric values symbols registers and function arguments linked together by opera tors The C source code debugger uses numeric and logical operators that are similar to those in C Operational expressions can be used in any command where a value needs to be specified data or addresses The monadic and binary operators that can be used in operational expressions are listed below 1 Monadic operators 32 bit data at a specified address pointer or long word Monadic plus Monadic minus N
17. command This command displays searches the command history System Control Commands 7 Dialog Commands 201 On the fly INFLUENCES function Q E XI Quit C source code debugger Q EXIT These commands quit the C source code debugger and return control to MS DOS However if a subprocess is running when this command is issued the C source code debugger cannot be terminated In such a case the following error message is displayed and control returns to the C source code debugger prompt Not terminated subprocess In this case terminate the subprocess first and then execute the Q EXIT com mand System Control Commands 202 HELP On the fly NO INFLUENCES function Display help screen HELP Sample screen This command switches to the help display screen and displays the help menu The highlighting on the screen can be moved to the desired menu item by using the gt lt T orl key When the Return key is pressed the content of the item selected on the help menu is displayed To return to the debugging menu press the ESC key In order to use the C source code debugger s help function the help file PT103 HLP must be located either in the current directory or in the directory specified by the environment variable HELP After the command is input the screen switches to the help screen LP lt file name gt load a program designated by lt file
18. is displayed on the screen To resume tracing press Y In delayed trigger trace mode this message is not displayed because tracing can not be resumed If the Return key is pressed without pressing any other key N is g assumed Trace memory hexadecimal dump display Trace memory disassembled code display Other Hardware related Commands 7 Dialog Commands 149 The available subcommands when the TD command is input are shown be low B Pn P1 Nn D lt frame address S gt lt frame address E gt L lt frame address S gt lt frame address E gt This command displays the start of trace memory This command displays the end of trace memory This command moves the display start frame n pages and then displays one page If a is added in front this command moves the display back n pages If the number of pages is omitted 1 is assumed If only the Return key is pressed the frame moves to the next page which is then displayed This command sets the display start frame at aaa The first frame is frame 0 which contains the oldest data This command changes the display mode to hexadecimal display every machine cycle If s and e are specified the data from frame ad dress S to frame address E is displayed This command changes the display mode to dis assembled code display If s and e are specified the data from frame
19. sec 1 if sec 1 6 secl1 0 init_data CN IM 0 S 0 DO 00000002 D1 00000000 D2 00000000 D PSW 0006 AG 00000000 A1 90800000 A2 00000000 A PC 80000076 MDR 80000073 LIR 8000007C LAR 00000000 S mov 200C d0 gt i File WOpthing SrcsifSearchg Go WInspctf Come HSglStpk BreakiFncS tpl kg 3 Register window This window displays the contents of the registers and the statuses of the flags This window can be easily opened or closed as necessary Window displays 64 1j int 2 sec DO 0000888A AO 0000A0AA D1 00000000 A1 00000000 display D2 00000000 A2 00000000 cnt60 D3 00000000 A3 00000000 cnt60 sec if secl 10 secl1 if secl1 6 sec 1 0 Monitor Program Version Evachip Number 0 01 103000 gt d sec 00002000C OA OO BO BB 03 OO OO OA 16 89 E2 OB 84 02 85 gt w sec gt F File OptHing SrcSWaSearchi Go Inspctfi Come HSg1Stpk BreakidFncSt plank 4 Option window One of four windows Memo Back Trace Stack and Local can be selected for display in this window The Back Trace and Local windows can only be displayed in C debugging mode Memo window Displays the contents of the memos registered by the MEM command Back Trace window Displays the back trace for the C functions Stack window Displays the contents of stack memory Local window Displays the list of local variables for the function where
20. 104 Option window 64 Output Log command gt 213 Overcurrent prevention 243 P P Function step Execution command 119 PANASRC Environment Variable 25 114 187 PATH Environment Variable 25 PF Format Display command 180 PRINTF Format Display command 180 PRMPT Change Prompt command 211 PROF Access Status Tabulation command 164 Pause command WAIT 211 Power ON OFF 29 Process control 77 Profile function 11 164 Program execution 44 Q Q EXIT Exit command 201 Quit command Q EXIT 201 Quitting the C Source Code Debugger 52 R R Display Change Register Value command 177 RAM Monitor 77 RD Fail Program Read command 115 9 Appendix 281 REPEAT Repeat Macro Execution command 230 RESET Reset User CPU command 123 Read File Program command RD 115 Real time Trace Display command TD TDU 148 Reference memory
21. 80 80 80 80 80 80 gt 2 gt a 80000000 000000 add 16 sp 000003 jmp 80000062 000006 80000062 000062 add amp ffee sp 000062 add ffee sp 000068 e V command and U command Code Display Change 7 Dialog Commands 191 K Back trace This command back traces the C stack frame and displays the process addresses by which the current function was called from the main func tion If back tracing is selected for the Option window the most recent back trace information is always displayed in the Option window A The K command is valid only in C debugging mode E Code Display Change 192 Watch Display E The C source code debugger is equipped with a function that displays the con tents of memory variables and other information important for debugging work in the Watch window in the specified format This function can be used to con tinuously display the most recent contents of data at those checkpoints that must be monitored most carefully during debugging As a result it is possible carry out debugging work smoothly without interruption and without the need to input data display commands each time a break or trace is executed as is required in conven tional debuggers INS command This command displays the contents of the specified C expression or symbol W command This command registers the specified memory contents or variables for watch ing
22. In actual program development completing a program is not a simple matter The process of editing compiling assembling linking and debugging will be repeated a number of times before the program is complete After operating the C source code debugger as we went through the basic pro cess in this tutorial you should now have a general understanding of how to use the C source code debugger Now you are ready to use the C source code debugger on an actual program and discover more advanced uses of the debugger Debugging Tutorial 54 Chapter 5 C Source Code Debugger Startup Method and Options 1 C Source Code Debugger Startup Method and Options 56 C Source Code Debugger Startup Method and Options E ee ee To start up the C source code debugger input the following at the MS DOS command level PICE103 lt option gt lt debug file gt lt parameter gt If the INIT MCR file is located in the current directory when the C source code debugger is started up the C source code debugger automatically loads and executes this file This file is equivalent to an MS DOS AUTOEXEC BAT file The C source code debugger startup options are listed below A space is required between options Startup option Description of option B lt size D gt lt size M gt Specifies the size of the debugging information area and the macro area BEMS
23. On the fly INFLUENCES function Input assembly language line A lt address gt If the A command is input the system enters mnemonic input mode dis Example Change the address to 80000062 222 indicates an input error plays the specified address and waits for a mnemonic to be input If the lt address gt specification is omitted input starts at the next address fol lowing the last address used by the A command The mnemonic that is input is then assembled and the resulting instruction code is stored in memory at the specified address If the mnemonic that was input is correct the machine language code that was stored in the address is displayed to the right of the address and then the system begins waiting for the next input Press the Return key to return to the C source code debugger s command mode from assembly language input mode Reference Subcommands in assembly language input mode Q lt address gt Changes the address ORG lt address gt Changes the address 4 Return Proceeds to the next address Returns to the previous address lt symbol gt Registers a symbol DB lt data gt Stores 8 bit data DW lt data gt Stores 16 bit data DD lt data gt Stores 32 bit data In order to differentiate hexadecimal immediate values that begin with the letters A through F from register names add a zero in front of the immediate value
24. when they are included within a character string so that the string is treated as a single parameter In this case the square brackets are deleted from the character string when it is passed to the macro as a parameter Macro Commands 226 Example gt calc h 0 2 gt calce 1 2 gt h 1 oct dec hex asc float 00000000001 1 00000001 0 000000e 00 gt cale 1 2 gt h 1 2 oct dec hex asc float 00000000003 3 00000003 0 000000e 00 37777777777 1 FFFFFFFF 6 805647e 38 double 0 000000000000000e 00 gt Macro Commands 8 Macro Commands 227 DO WHILE a DO lt macro body gt WHILE lt expression gt In the same manner as a macro command definition if DO is input the macro input prompt is displayed and the system enters macro input mode Multiple commands and macros can be freely written in the lt macro body gt por tion there is no limit on the number of commands that can be included except for the capacity of the macro buffer The input of lt macro body gt is terminated by inputting WHILE lt expression gt After the entire lt macro body gt is executed the value of lt expression gt is evalu ated If the value is 0 the macro terminates if the value is not 0 lt macro body gt is executed again starting from the beginning The commands in lt macro body gt are always executed at least once in a D
25. 144 TM F TM This command sets the trace mode to default mode Bus selection Internal RAM bus Trace storage condition Normal trace mode Trace stop condition Trace continue mode This command displays the trace mode that have been set and trace mode is set to the default mode If a trace event is cancelled or disabled the emulator stops tracing The table below indicates which modes can be used with memory accesses by the microprocessor internal DMA accesses and external DMA accesses A X indicates that the space in question cannot be accessed through that type of access in that mode Microprocessor memory access Internal DMA External DMA Microprocessor s internal data RAM space O 2 a 8 Microprocessor s internal fe i O O x special register space Z Microprocessor s internal instruction ROM RAM space O O x External memory space O x x Microprocessor s internal A data RAM space f Microprocessor s internal 2 A x A x E special register space He 24 Microprocessor s internal instruction ROM RAM space x A as External memory space O O x A Possible only with a DMA access with an external memory space Other Hardware related Commands Example 7 Dialog Commands 145 gt tm Trigger OFF Trace Full Continue Trace Cycle ALL amp INT Sample Event NONE gt ev main cnt60 ex gt tm 1
26. BPS command Sets sequential break BC EC command Cancels events hardware breaks and software breaks BD command Temporarily disables events hardware breaks and software breaks BE command Enables events hardware breaks and software breaks Event Related Commands 7 Dialog Commands 127 On the fly NO INFLUENCES function E V Set display event EV lt address S gt lt address E gt lt status gt lt data gt B W D N L lt count gt EV Ccciist gt 4 EV EV lt address S gt lt This command sets an event The following table lists the options that can be specified for each event type Event type Execution address event Data event lt address S gt J J lt address E gt 9O O lt status gt EX RW R W lt data gt O B W D O N O Required O may be omitted blank may not be specified lt address S gt Specify a memory address or symbol When specifying a memory range specify the start address versus the end address in lt address E gt lt address E gt Specify a memory address or symbol Specify the end address versus the start address in lt address S gt lt status gt EX Execution address event RW Data event in read or write operation R Data event in read operation W Data event in write operation Omitted RW data event in read or write operation is assumed if lt data gt is specified and EX exe
27. Code Display Change 188 On the fly INFLUENCES function U Display disassembled code U lt address gt U P U SH lt address gt UPOP UEND UX lt address S gt lt address E gt These commands display one screen of disassembled code in memory starting from lt address gt in the Code window or the Command window The display of disassembled code in the Code window can be easily scrolled up and down by using the T and J keys or the ROLL UP and ROLL DOWN keys U lt address gt This command displays the disassembled code starting from the speci fied address in the Code window Valid symbols can be used in the lt address gt specification UPUSH This command PUSH es the current displayed address onto the address lt address gt stack an 8 level internal stack and then displays the disassembled code starting from the specified address UPOP This command POPs the last address that was UPUSHed onto the stack and displays the disassembled code starting from that address UEND This command displays the disassembled code starting from the last ad dress that was UPUSHed onto the stack UX lt address S gt This command displays the disassembled code starting from the speci lt address E gt fied address in the Command window If lt address E gt is specified the code is displayed in the Command window up to that address If lt address E gt is omitted a
28. TLALL TSALL gt mlist tlall sall d10 lall Ie d gt mlist gt macro log gt lt command Macro Commands 8 Macro Commands 235 KI L L Delete macro KI LL lt macro name gt KILL These commands delete currently registered macro commands K L L lt macro name gt This command deletes the macro command specified by lt macro name gt K IL L This command deletes all of the macro commands that were defined by the user Example gt mlist N n ti H v oOo nu OUy Vv Down DVD w a H f K c kill gt mlist Macro command definition Macro Commands 236 Conditional execution IF lt expression gt lt command gt ELSEIF lt expression gt lt command gt ELSE lt command gt This macro command is valid only within a lt macro body gt First lt expres sion gt is evaluated and if the value is not 0 the next lt command gt is executed If the evaluated value is 0 the lt command gt that follows the ELSE that corre sponds to the IF is executed Example chkgo g If the value of the pro bas gram counter is 0x4000009f dump the contents of memory if _PC 0x4000009F starting from the sec while __run_ symbol address other d sec wise execute five steps jelse 5 i chkram cS If the data in address 70 is 8 output
29. played or disassembled code is displayed down one screen When the cursor is located in the Command window pressing these keys scrolls the contents of the Command window down one screen Window commands 68 Ctrl Q R Ctrl Q C Ctrl lt lt Ctrl gt Ctrl T Ctrl 4 Ctrl J Ctrl Q W Ctrl Q Z Ctrl Q J Pressing these keys moves the cursor to the beginning of the source file that is currently displayed This command is valid only when a source listing is displayed in the Code win dow and the cursor is located in the Code window Pressing these keys moves the cursor to the end of the source file that is currently displayed This command is valid only when a source listing is displayed in the Code win dow and the cursor is located in the Code window Pressing these keys enlarges the Option window In other words this command moves the vertical boundary between the Option window and the Command and Code windows to the left Pressing these keys reduces the Option window In other words this command moves the vertical boundary between the Option window and the Command and Code windows to the right Pressing these keys enlarges the Command window and reduces the Code window In other words this command moves the boundary between the Command win dow and the Code window up one line Pressing these keys reduces the Command window and
30. using the F9 Break key in the 45th line of the source listing Next execute the program using the F5 Go key The Watch window is updated Continue to press the F5 Go key it should be apparent that the values are updated continuously Canceling all Watch windows To cancel all Watch windows input the following from the keyboard Y k e page 199 J All watch windows disappear from the screen Debugging Tutorial Starting up a subprocess page 203 4 Characteristic C Source Code Debugger Functions and Their Usage 49 4 7 Subprocesses ee The C source code debugger is equipped with a function that allows another MS DOS command to be started up while debugging work is in progress and permits immediate switching between that command and the C source code debugger In short it is possible to simultaneously start up the C source code debugger and another MS DOS command on one computer and switch between the two processes with a simple key operation while debugging is in progress In the C source code debugger this second process is called the subprocess We will now start up a subprocess To do so input the following from the keyboard lo This causes the MS DOS command input screen to appear While in this state MS DOS commands can be used normally Use a text editor to open the SAMPLE C file that we have been using to practice debugging operations iew ptions elp C USR HIRO PICE1 3 SRC SAMPL
31. 0X00000000 A3 0X00000000 PC 0X80000010 MDR 0X00000000 LIR 0X8000000D LAR 0X00000000 SP 0X00000100 SUB DO0 DO0 zZ IM 0 S 0 DO 0X00000000 D1 0X00002000 D2 0xX00000000 D3 0x00000000 PSW 0X0001 AO 0X00000000 A1 0X00000000 A2 0xX00000000 A3 0x00000000 PC 0X80000012 MDR 0X00000000 LIR 0X80000010 LAR 0X00000000 SP 0xX00000100 MOV DO A0 Z IM 0 S 0 DO 0X00000000 D1 0xX00002000 D2 0xX00000000 D3 0x00000000 PSW 0X0001 AO 0X00000000 A1 0X00000000 A2 0X00000000 A3 0X00000000 PC 0X80000013 MDR 0X00000000 LIR 0X80000012 LAR 0X00000000 SP 0xX00000100 ADD 0X4 _TEST A0 Program Loading Execution 7 Dialog Commands 119 Function step execution of user program The P command executes one step at a time the number of steps speci fied by lt count gt from the address currently pointed to by the program counter The lt count gt specification can be made either in decimal or hexadecimal depending on the base The difference between the P com mand and the T command is that with the P command called functions are executed as one step e N command The maximum lt count gt specification is 65 535 If lt count gt is omitted 1 is assumed When C source code is displayed in the Code window one line of source code is executed as one step when disassembled code is displayed in the Code win dow one instruction is executed as one step When executing lines of source code one at a time function step
32. Cannot use operators with secondary effects gt val_abc 1234 substitutes 1234 in abc int 1234 0x4D2 gt val_fnc 1 2 3 fne function call int 10 OxA Rules for Using Dialog Commands 7 Dialog Commands 111 Command Index This is an alphabetized index of the commands Symbol 112 Program Loading Execution E el The commands that are used to load user programs are the L and LP Dialog commands the commands that are used to execute user programs are the T P and G Dialog commands L command LP command These commands load the program EX format file that is to be debugged into memory RD command This command loads either a Motorola S format file an Intel HEX format file or a binary format files into memory WR command This command writes the contents of memory to a file in either Motorola S format Intel HEX format or binary format T command When a source file is displayed in the Code window this command step ex ecutes the file one line at a time When disassembled code is displayed in the Code window this command step executes the code one instruction at a time Step execution continues within subroutines functions Single step execution P command When a source file is displayed in the Code window this command step ex ecutes the file one line at a time When disassembled code is displayed in the Code window this command step executes the co
33. HALT or SLEEP mode mr G Command T Command P Command The stack pointer SP register value must always be set so that its value is a multiple of four The correct value is not displayed when the In circuit Emulator measures the execution time TI command during single step or function step execution Notes on Use 1 C Source Code Debugger Overview 15 2 5 Breaks If a software break is set in other than an op code the value of the operand is replaced with the PI code Oxff Because software breaks halt execution before the instruction where the break was set is executed the pass count specification cannot be made Hardware breaks halt execution after executing as many as nine instructions after executing the instruction for which the break event was set The actual number of instructions that are executed after the break but before execution stops depends on the specific combination of instructions involved 2 6 Tracing The contents of trace memory are cleared if single step or function step execution is performed When fewer than 16K steps were traced the first instruction that was executed when tracing started might not be included in the trace information When the trace full break is used the last several instructions immediately before the user program was halted might not be included in the trace information A disassembled display of the trace information is not possible when the micropro cessor is i
34. S IM 0 S 0 DO 12345678 PSW 0000 AO 00000000 PC 40000000 MDR 00000000 jmp 0x80000000 gt cflg 1 Sr C IM 0 S 0 DO 12345678 PSW 0004 AO 00000000 PC 40000000 MDR 00000000 jmp 0x80000000 gt _d2 abcdef gt r C IM 0 S 0 DO 12345678 PSW 0004 AO 00000000 PC 40000000 MDR 00000000 jmp 80000000 D1 00000000 Al 00000000 LIR 00000000 D1 00000000 Al 00000000 LIR 00000000 D1 00000000 Al 00000000 LIR 00000000 D1 00000000 A1 00000000 LIR 00000000 D2 00000000 A2 00000000 LAR 00000000 D2 00000000 A2 00000000 LAR 00000000 D2 00000000 A2 00000000 LAR 00000000 D2 00ABCDEF A2 00000000 LAR 00000000 D3 A3 SP D3 A3 SP D3 A3 SP D3 A3 SP 00000000 00000000 00000100 00000000 00000000 00000100 00000000 00000000 00000100 00000000 00000000 00000100 Data Display Change 7 Dialog Commands 179 On the fly NO INFLUENCES function Display expression operation results H lt expression gt H lt expression 1 gt lt expression 2 gt These commands display the expression operations H lt expression gt This command displays the specified expression in octal decimal hexa decimal and ASCII H lt expression 1 gt This command displays the results of addition and subtraction of the val lt expression 2 gt ues of the two expressions lt expression 1 gt and lt expression 2 gt In addition this command also di
35. Trigger output current 4mA 1 3 Environment Specifications Item Rating Temperature During operation 10 C to 30 C During storage 0 C to 45 C Humidity During operation 20 to 80 During storage No more than 90 1 4 External Dimensions Pc a a O a e Length x Width x Height 130mm x 100mm x 40mm In circuit Emulator Specifications 242 1 5 Target Interface Trigger output section PROBE CN2 ICE Control chip PROBE CN2 2 Ea E CMOS driver In circuit Emulator Specifications 9 Appendix 243 Interface Board Switch Settings The interface between the host computer and the In circuit Emulator uses one byte of I O space in the host computer Only the lower eight bits of the I O ad dress are decoded The upper eight bits are used within the board Set the inter face board switches in accordance with the computer system being used Al though any address may be used as an I O address as long as it is an unused address the addresses shown in the table that follows should normally be set 2 1 When the Host Computer is the PC 9800 Series SS Fuseless circuit breaker AN DSW3 DIP switches CN2 DSW6 DSW1 DSW2 DSW4 DSW5 DSW7 DSW8 R lt U aL Rotary switches ply from damage due to overcurrent If overcurrent f
36. gt Reference The base used in lt list gt is assumed to be decimal regardless of the N command specification If 0x is added the base is hexadecimal EV command BP command BD command and BE command Event Related Commands 7 Dialog Commands 137 Hardware break NO INFLUENCES On the fly Software break INFLUENCES function E D Temporarily disable break event BD lt list gt This command temporarily disables software break hardware break events that were set by the EV command and BP command If lt list gt is specified the break events with the specified numbers are disabled If is specified all break events that were set are disabled BD 1 2 7 4 In the above example break events 1 2 and 7 are temporarily disabled BD 4 In the above example all break events are temporarily disabled If a disabled event is used in an AND break a sequential break as a trace event or as a time measurement event these functions are also cancelled Even if a break event disabled by the BE command is subsequently enabled these break events remain cancelled Event Related Commands 138 Example gt bp No Sadr Eadr st Data Symbol Sz Cnt Command E 1 80000039 SF _Omain 1 E 2 00000100 RW 0xxxx100 1 E 3 00000000 RW 05 1 E 4 80000058 EX _Ocnt60 1 gt bd 2 3 gt bp No Sadr Eadr st Data Symbol Sz Cnt Command E 1 80000039 SF _Omain I D 2 000001
37. portion of the variable name on which the cursor is positioned Next press F6 or CTRL I This opens the Inspect window in which the data structure of the variable in question is displayed To close the Inspect window either press the ESC key or else press the F6 or CTRL I key There are four types of Inspect windows scalar pointer array and struct The display format and the local com mands that can be used differ for each type of Inspect window s Chapter 6 section 3 3 for the local commands The only variables symbols that can be inspected are those that are currently valid Therefore local variables that are currently not in use and static variables described in a source file other than the source file currently pointed to by the program counter cannot be inspected Data Reference Functions 6 Window Commands 85 SAMPLE C DO 00000007 AB 00000000 D1 00000000 A1 00000000 cnt6a D2 00000000 A2 00000000 D3 00000000 A3 00000000 if sec te 6 sec 0 secl1 int i 80000000 0 O 0x0 init_data test tst1 0 test tst2 0 PSW 0006 AG 00000000 A1 80000000 A2 00000000 A PSH 0006 AG 00000000 A1 00000000 A2 00000000 A PC 80000076 MDR 80000073 LIR 8000006C LAR 00000000 S mov 200C d0 ee 16 lt gt 10 RangelliChangel Ky Pins i E Pointer inspection Pointer values only hold information on address values within memory However the information stored in that address is
38. such as a specified address range specified data access width match no match or a count Events that are conditions for break functions are called break events events that are conditions for starting or stopping tracing are called trace events and events that are conditions for starting or stopping time measurement are called time measurement events C Source Code Debugger Overview 1 C Source Code Debugger Overview 5 Break functions These functions halt user program execution 1 Software break Software breaks are implemented by the Debugger by inserting PI codes Oxff into the user program Therefore these breaks can only be set in writ able program areas they cannot be set in data areas and the target ROM space In addition because software breaks halt program execution before the in struction in the address where the break was set is executed it is not possible to set conditions such as a specified address range or a count of the number of passes through an address 2 Hardware breaks This type of break halts execution when an event occurs Program execution does not actually stop until several instruction cycles after the event 3 AND breaks AND breaks halt program execution once all of the specified events occur regardless of the sequence in which they occur 4 Sequential breaks Sequential breaks halt program execution once the specified events occur in the specified seque
39. 4 section 4 L 4 Program completion Debugging Work Flow 33 34 0001 0002 0003 0004 0005 0006 0007 0008 0009 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 0020 0021 0022 0023 0024 0025 0026 0027 Creation of Executable Files ee The sample program SAMPLE C is written in C language This program is a simple one that increments the contents of the sec variable sec O is incremented each time the cnt60 function is called When the value of sec 0 reaches 10 it is cleared to zero and the value of sec 1 is incremented by one sec 1 is also cleared to zero when its value reaches 6 This operation is repeated continuously Refer to the source listing of SAMPLE C below E Sample program SAMPLE C MN10300 SERIES C SAMPLE PROGRAM MN10300 COUNTER PROGRAM 7 T define INIT_DISPDATA_L 0x00 define INIT_DISPDATA_H 0x00 Ine Sa struct abc int tst1 TInt Sts struct abc test int sec 2 main struct aaa ine aly int aZs tmp initialize for display Creation of Executable Files 0028 0029 0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 4 Characteristic C Source Code Debugger Functions and Their Usage 35 initialize in
40. 400000BE F99395 udf 9 6B d3 40000011 D8 leq 40000012 76 mov a2 d1 40000013 6A mov d2 a2 40000014 6F mov d3 a3 40000015 5F53 mov 53 sp a3 40000017 D2 lge 40000018 F366 mov d2 d1 a2 4000001A 8E mov d3 d2 4000001B FC amp 4BFC90B108 movbu _ 8B19 FC a3 d2 PICE 10300 Ver 3 6b Release 1 1 1 Copyright c 1996 Panasonic KMC Sub process segment 873AH 99 Kbyte Monitor Program Version Evachip Number 103000 gt F File BOptWing SrcSWASearch Go Inspctfi Come HSglStpk BreakilFncS tpa 1 Code window This window displays either source code or a combination of source code and disassembled code If the cursor is located in this window the Window com mands can be used to change the display by scrolling the source code up or down for example or set cancel software breaks where the cursor is located 2 Command window This window is used to input Dialog commands and to display commands This window stores the display contents in the Command window display buffer reserved as an 8KB area at the same time that the information is displayed on the screen If the cursor is located within this window the cursor keys can be used to scroll the display up and down over the range of the display buffer Window displays 6 Window Commands 63 1 int 2 sec i D8 00000002 AB C0000000 SAMPLE C D1 00000000 A1 00000000 D2 00000000 A2 00000000 D3 00000000 A3 00000000 cnt6 if sec 0 10 sec 0
41. 5 C Source Code Debugger Startup Method and Options 1 CC Source Code Debugger Startup Method and OPtions vases icnn anenanennta diuini aaaeaii niai Chapter 6 Window Commands Window DisplayS issenensis aianei aeaiia iea 2 Window Commands ccccccccceceeeseeeeeceeeeeeeeeeeeaeeeeseeeaeeseeeeseeeeeeeeaas 2 1 Sereen COMO ccccatesscccdcasenceccctanessdeccvvenedeacevsecveccevsvenedcesvaenees 2 2 EX CULION Breaks cei sevoctteiiss deeacicinadscties sideceees cai voretated ceed 2 3 Getting selecting StrinQS sissien ganisa anenai 2 4 Pile Cispl ay siniipane oiai ara en ea ae aa a eben abel 2 5 Process control RAM Monitor 0 cccceccceceeeseeeeeeeessneeeeeeeeas 2 6 Shell TUNGHONS ennaa aaa 2 7 MEMOS niian ree eee 2 8 Other window commandS cccccceecceceeseeeeeeeeeeeseeeeesseeeaees lt Contents 3 gt 3 Data Reference Functions ccccccccicceccccceceseeeecsseueeseueeeseeeeseuauaseeaaeas 84 3 1 Inspect MUMCHON success sasesaceissavveusaeasnnddeunessdareanttanweuieisaaedeeedtsaces 84 3 2 Struct and Union Inspection ccceeeeeeeeeeeeeeeseeseeeeeeeneeeeeees 88 3 3 Local commands within the Inspect Window nsss 89 3 4 Watch TunCtons essre edna a 92 3 5 VIEW TUNGUON sizeren aa ie Ce eee 93 Chapter 7 Dialog Commands 1 Rules for Using Dialog Commands cceceeeeeeeeeeeeeeeeeteeeeeeeeeeeeee 96 1 1 Conventions used in command explanations 0cee 96 1 2 Command input format c
42. 80000000 BFFFFFFF In the above example the 1GB space from address 0x80000000 to OxBFFFFFFF is assigned to a user target system resource external memory This command displays the current settings Reference The meanings of the codes in the Memory column are explained below Int RAM Internal RAM Int REG Special register Int ROM Internal ROM or internal instruction RAM ICE ROM Emulation ROM ICE RAM fast Fast emulation RAM ICE RAM slow Slow emulation RAM TARGET User target system memory external memory ERROR Access prohibited MONITOR Area used by monitor reserved for system gt mape 80020000 8003ffff CPU MEMORY MODE EXMODE Sadr Eadr Memory 00000000 00003FFF Int RAM 00004000 1FFFFFFF 20000000 3FFFFFFF Int REG 40000000 40003FFF Int ROM 40004000 7FFFFFFF 80000000 8001FFFF ICE RAM fast 80020000 BFFFFFFF TARGET c0000000 FFFFFFFF MONITOR gt mapi 90000000 9001ffff CPU MEMORY MODE EXMODE Sadr Eadr Memory 00000000 00003FFF Int RA 00004000 1FFFFFFF 20000000 3FFFFFFF Int REG 40000000 40003FFF Int RO 40004000 7FFFFFFF 80000000 8001FFFF ICE RAM fast 90000000 BFFFFFFF TARGET c0000000 FFFFFFFF MONITOR Other Hardware related Commands 160 Performance Measurement SM command This command sets releases the RAM monitor sample area PROF command This command t
43. Changing C Data E System Assembles code starting from the specified address and expands it directly in memory INS lt variable name gt lt function name gt Displays inspects the variable array etc specified by variable name W lt type gt lt address gt lt count gt lt base gt lt type gt lt base gt W lt C expression gt Registers an address for watching Byte 8 bits display Word 16 bits display Double word 32 bits display ASCII display units of 8 bits 4 byte real number short floating point display Hexadecimal display specification SEY eae Decimal display specification O Octal display specification Registers the C expression display for watching VAL lt C expression gt lt function name gt Y lt list gt l Q EXIT HELP lt command gt 1 lt character string gt H Screen Control Miscellaneous CLS HOME LIST NLIST BEL TIME WAIT PRMPT lt prompt character gt ok Quick Reference Evaluates and displays the C expression Deletes the watch registrations specified by the list Quits the C source code debugger Displays the Help screen Executes lt command gt Displays history Searches for the history indicated by lt character string gt Clears the Command window Moves the Command window cursor to the Home position Command window display output specification Command window display output suppressi
44. Conversion Board QFP Adapter Flat DIL Conversion Board Surface Mount Socket Socket Cover Interface Board 34 wire Flat Cable Option Probe Manual C Source Code Debugger Installation L Jo C Source Code 10300 Floppy disk Micro Driver Hardware List 2 C Source Code Debugger Configuration 19 Descriptions of Each Device 2 1 In circuit Emulator E LED Display There are three LEDs on the In circuit Emulator main unit Their functions are described below Red MEMV This LED lights when power is being supplied to the In circuit Emulator main unit Note that the power for the In circuit Emulator is supplied from the Emulator Controller Yellow TVDD This LED lights when the power is being supplied to the target microprocessor Green RUN This LED lights when the user program is executing In Circuit Emulator Main Unit Bottom View TRIGOUT In Circuit Emulator Main Unit Side View 1 CONTROLLER amp amp In Circuit Emulator Main Unit Side View 2 Descriptions of Each Device E Option Probe Connector TRIGOUT This is the connector for the external trigger output 2 2 C Source Code Debugger 10300 Floppy Disk Before using the software make a backup of the C Source Code Debugger floppy disk Copying this floppy disk is permitted only for maintenan
45. EVENT This command outputs the event occurrence status If a sequential break was set with the BPS command the correspon L dence between an event output that is output due to a trigger and its event number may change so use the TRIG command to check the correspondence of the numbers TRIG This command displays the trigger output that is currently set Other Hardware related Commands 7 Dialog Commands 157 Example gt trig Trigger mode Port Data 00 00000000 gt gt ev cnt60 ex gt ev sec rw gt ev 80000100 ex gt trig event gt trig Trigger mode Event Trig No 7 6 5 4 3 2 1 0 Event N SSeS aa Se 3 2s ae gt gt trig ram sec gt trig Trigger mode RAM Monitor Address 0000000C Data is invalid gt Other Hardware related Commands 158 Display NO INFLUENCES On the fly Set CANNOT BE USED function MAP EX e MAPI lt adaress S gt lt adaress E gt FI S MAP lt address S gt lt address E gt MAP EXI lt address S gt lt address E gt F S EXE lt address S gt lt address E gt EX These commands specify which memory space will be assigned to in memory within the in circuit emulator emulation memory The total memory emulation RAM assigned to the in circuit emulator must be less than the installed memory 512KB of standard fast emulation RAM and 512KB of slow emulation RAM The start and end
46. Measurement command 210 TM Set Display Trace command 142 TMP TEMP environment variable 25 TRIG trigger setting display command 156 TS Halt Trace command 147 Target interface 242 Timer command TI 153 Title display 65 Trace Memory command TM 142 Transfer Memory command M 174 U U Disassembled Code Display command 188 V V Display Source Line command 187 VAL Evaluate C expression command 197 Values that can be handled as addresses by the C Source Code Debugger 100 Values that can be handled as line numbers by the C Source Code Debugger 101 Alphabetic Values that can be handled by the C Source Code Debugger in register names 100 View function 93 W W Watch Registration command 195 WAIT Pause command 211 WHILE Execute while Macro command 229 WR Write File Program command 116 Watch Window 64 Watch function 92 Window
47. NO INFLUENCES function X Display currently registered symbols X X lt symbol name gt This command displays the names and contents of the currently registered global symbols X This command displays all symbols X lt symbol name gt This command displays the symbols specified by lt symbol name gt The wildcard characters and which function in the same manner as the MS DOS wildcard characters can be used in the lt symbol name gt specifica tion Matches all patterns Matches all individual characters Unlike normal symbol description the underscore character _ that the C compiler adds to the front of all symbol names cannot be omitted in the lt symbol name gt specification Data Display Change Example 7 Dialog Commands 183 gt x 00000000 _i 00000004 _test 0000000C _sec 80000000 _Reset 80000029 _main 8000002C _Omain 80000042 _initialize 80000042 _Oinitialize 8000004C _display 8000004C _Odisplay 80000056 _Ocnt60 80000056 _cnt60 8000009F _init_data 8000009F _Oinit_data gt gt tmp1 80001234 Registered symbol name gt x 00000000 _i 00000004 _test 0000000C _sec 80000000 _Reset 80000029 _main 8000002C _Omain 80000042 _initialize 80000042 _Oinitialize 8000004C _display 8000004C _Odisplay 80000056 _Ocnt 60 80000056 _cnt60 8000009F _init_data 8000009F _Oinit_data 80001234 tmpl gt gt tmp1 gt x 00000000 _i 00000004 _test 0000000C _sec
48. Program single step execution F8 page 71 4 5 Program execution and break This section explains how to execute a program and how to set and cancel breaks There are two methods for executing a program one line at a time step ex ecution function step execution and single step execution First we will try function step execution Press the F10 FncStp key The current line the line highlighted in yellow in the Code window moves down one line This means that one step has been executed Press the F10 FncStp key several more times The current line keeps changing one line at a time SAMPLE C tmp DO 00000008 AD 00000000 D1 00000000 A1 00000000 initialize D2 00000000 A2 00000000 forts D3 00000000 A3 00000000 orl initialize init_data display PICE 10300 Ver 3 6b Release 1 1 1 Copyright c 1996 Pa Sub process segment 873AH 99 Kbyte Monitor Program Version 0 01 Evachip Number 103000 gt File WOptting SrcSWSearchi Go Inspctf Come HSglSt FncS tp eng Now look at the register display in the Register window If the Register win dow is not displayed on the screen press the F2 OptWin key The most recent register values are displayed each time the F10 FncStp key is pressed There is another method of step execution Press the F8 SglStp key The current line moves in the same fashion as in function step execution Press the F8 SglStp key several more times The current
49. VAL command This command displays the contents of a C expression or variable Y command This command deletes the specified watch point Watch Display INS 7 Dialog Commands 193 Global variable INFLUENCES On the fly Local variable CANNOT BE USED function Inspect INS lt variable name gt lt function name gt F4 Zoom F5 16 lt gt 10 F6 Ctrl l Inspct F7 Ctrl W W Watch This command displays the specified variable array or bit value in the Inspect window according to the variable data Local variables can be displayed by specifying lt function name gt for the func tion in which that local variable is used If lt function name gt is omitted the cur rent function is assumed The following local commands can be used When inspecting pointers arrays or structs this command enlarges the window to fill the screen This function is extremely useful when referencing an array with a large num ber of elements etc If this key is pressed again while the window is enlarged to fill the screen the window is reduced to its original size In the scalar display values are displayed in both decimal and hexadecimal format However if the number of elements in an array or struct is such that they cannot all be displayed on one line they are displayed in either decimal format default or hexadecimal format not both The F5 key is used to switch the base This command displays
50. also possible to include masked bit specifications Specify X to indicate don t care for a bit The high order bits are also don t care 10xx The following values satisfy the condition 1000 1001 1010 and 1011 CORK asec Any value from C500 to C5FF satisfies the condi tion A Symbols can not be used in the lt data gt specification E B W D Specify the data access width for a data break 8 bit data B 16 bit data W or 32 bit data D If omitted the access width mode is no specific size don t care N Specifies that the break condition is met when the data accessed in the data break did not match the value specified by lt data gt If this specification is omitted the break condition is met when the data does match lt count gt In the case of an execution address break specify the pass count In the case of a data break specify the access count The break occurs after the break condition is met the specified number of times The maximum setting is 256 if lt count gt is omitted is assumed Regardless of the setting of the N command the base of the count specification is decimal unless Ox is added to the value which makes the base of the count specification hexadeci mal C lt command gt A C source code debugger command or macro of up to 40 char acters can be specified for lt command gt If this specification is made the specified lt command gt is
51. an array or struct element that is selected high lighted through the use of the cursor keys in a newly opened Inspect win dow The ESC key is used to close the current Inspect window This command registers the variable that is inspected or the element that is selected for watching in the Watch window Watch Display 194 F8 Ctrl V V View F9 Ctrl R R Range F10 Change This command displays the variable that is inspected or the element that is selected for viewing in the Command window This command changes the array or pointer display element number or the maximum element number If these keys are pressed the window that is used to input the number of the element to be referenced opens At this point the current display element and the maximum element number are displayed highlighted Input the new display ele ment number and maximum display element number may be omitted During line input the history and line edit shell functions can be used This command is extremely useful when referencing a large array or when referencing the area around a pointer This command changes the value of the variable that is inspected or the element that is selected The variables that can be changed by this com mand must have either the scalar attribute char int etc or the pointer attribute Pressing this key opens a window that is used to input the new value expres sion Once th
52. and for searching for character strings The file display function is valid only when source code is dis played in the Code window and the cursor is located in the Code window Pressing these keys switches the Code window display to the next source file display This command is valid when source code is displayed in the Code window Pressing this key opens the file selection window and displays the files that can currently be selected The file that is highlighted in the file selection window is the currently selected source file Use the cursor keys to move the highlighted bar to the name of the desired source file and press the Return key the contents of the selected source file are then displayed in the Code window STARTUP ASH stack_end DG 00000000 AO 00AOQQQA D1 00000000 A1 00000000 _TEXT SECTION CODE PUBLIC 1 D2 00000000 A2 00000000 D3 80008000 A3 00000000 reset SAMPLE C _BSS _GBSS CLR mov _BSSEND BSS d1 PICE 10300 Yer 3 6b Release 1 1 1 Copyright c 1996 Pa Sub process segment 873AH 99 Kbyte Monitor Program Version 0 01 Evachip Number 103000 gt 1 sample gt File WOptiin SrcSSearchy Go Winspcti Come HSg1Stp BreakilFncs tpl In addition the V command is used to reference the contents of files other than those displayed in the file selection window V command Window commands F4 Search Ctrl Q F Ctrl L 6 Window Commands 75 When no search st
53. are pressed the window that is used for inputting the numeric value expression to be changed opens Input a C expression or a numeric value in this window the expression or value is then evaluated and if no error is found the value of the variable is changed to that value In certain cases the type of the value is converted During line input the History and Line Edit shell functions can be used Data Reference Functions 92 Watch registration Ctrl F7 Watch Ctrl W 3 4 Watch functions The Watch function is used in order to constantly display the most recent values for important variables arrays and expressions in the Watch win dow while debugging is in progress The C source code debugger provides two methods for registering items to be watched One is registration using a Window command registration is also pos sible via local commands for Inspect or String Select and the other is registration using the W command of the Dialog commands Registration using a Window command is explained in this section Watch registration is accomplished by moving the cursor to the Code window positioning it on the variable that is to be registered for watching and then press ing CTRL F7 or CTRL W Once an item is registered for watching the variable name and its contents value are displayed in the Watch window When the item registered for watching has multiple elements such as a struct or an arr
54. automatically executed after the break If execution was initiated by using the F5 key how ever the lt command gt is not executed after the break Event Related Commands 132 B P Example This command displays the breaks that have been set gt bp main gt bp sec w 5 gt bp 100 rw gt bp No Sadr Eadr st Data Symbol Sz Cnt Command E 1 80000039 SF _Omain a E 2 0000080C WR 05 I E 3 00000100 RW 1 gt bp cnt60 ex gt bp No Sadr Eadr st Data Symbol Sz Cnt Command E 1 80000039 SF _Omain 1 E 2 0000080C WR 05 4 E 3 00000100 RW 1 E 4 80000058 EX _cnt60 gt ev No Sadr Eadr st Data Symbol Sz Cnt BRK TRC DLY TS TE CLR E 2 0000080C WR 05 i E 3 00000100 RW l E 4 80000058 EX _Ocnt60 1 gt Reference e The No column indicates the number applied to the break event This number is used in the BC EC BD and BE commands to specify the break even to be cancelled disabled or enabled e The E or D indication indicates whether the break event is currently enabled E or disabled D e The meanings of the codes in the st column are explained below SF EX Software break Execution address break RW Data break in read or write operation RD Data break in read operation WR Data break in write operation e The sz Jay column means the accessive range for data event 8 bit data
55. can be inserted deleted or changed in a fashion similar to a screen editor Making full use of the shell functions makes it possible to reduce the volume of keyboard operations during debugging Each operation described here is valid for Command window input search string input refer to the search function and inputting the array elements Range changing values Change for the Inspect function A History search and line editing using the shell commands is pos E sible only when the cursor is located in the Command window Reference In the C source code debugger when the cursor is in the Code win dow pressing the Shift key causes the cursor to shift temporarily to the Command window Releasing the Shift key causes the cursor to return to the Code window Therefore the standard for many shell functions is SHIFT key Pressing these keys deletes the last character that was input Pressing these keys moves the cursor to the left Pressing these keys moves the cursor to the right If the cursor is already located at the end of the line the operation is identical to that of SHIFT F1 C1 Pressing these keys moves the cursor to the beginning of the line Window commands SHIFT F5 LNBOT CTRL F Del Ctrl G Shift F7 In Can Ctrl U Ins Ctrl V Shift T Ctrl W Shif 1 Ctrl Z 6 Window Commands 79 Pressing these keys moves the cursor to the end of the line If the
56. can be used to set various C source code debugger options The items that can be set by this command can also be displayed changed by using the Window command SHIFT F10 The options that can be set by this command are listed below Option Parameters Description lt reg gt ONIOFF Register window display control lt code gt SRCIASM Code window source disassembled code display switching lt case gt ONIOFF Symbol name uppercase lowercase discrimination on off Example gt option ON SRC OFF gt option OFF gt gt Other Commands 218 Chapter 8 Macro Commands 1 Macro Command Overview 2 Macro Commands 220 Example Macro Command Overview 1 1 Macro function The macro function makes it possible to construct new commands by combin ing existing commands In the C source code debugger it is possible to create sophisticated macro commands by using a wide variety of commands and power ful macro control structures The features of the C source code debugger s macro function are listed below 1 The macro function supports control structures similar to those used in C making it possible to describe easy to understand macros in a block format without using GOTOs 2 It is possible to nest up to 255 IF statements making it possible to handle different possibilities with tremendous detail 3 It is possi
57. circuit Emulator are integrated Develop ment Tools for Panasonic s MN10300 Series 32 bit microcomputers The In circuit Emulator consists of the main unit and the emulator controller Because the emulator s control circuits are implemented on a single chip it was possible to greatly reduce the size weight and power consumption of the emulator The control software the Debugger permits efficient debugging of C and assem bly programs at the source level The Debugger also offers sophisticated func tions and excellent operability with multi window display macro functions multi job functions various break functions memory emulation functions trace functions and EMS memory support Multi window 1 int 2 sec DO 00000002 AO 00000000 SAMPLE C D1 00000000 A1 00000000 D2 00000000 A2 00000000 D3 00000000 A3 00000000 cnt60 if sec 10 sec 0 0 sec 1 if sec 1 6 secl1 0 init_data CN IM 0 S 0 DO 00000002 D1 00000000 D2 e0000000 D PSW 0006 AG 00000000 A1 00000000 A2 00000000 A PC 80000076 MDR 80000073 LIR 8000007C LAR 00000000 S mov 200C d0 i SglStp FncS tpa k9 Five windows Code Register Watch Command and Option can be displayed simultaneously Excellent operability is provided through a wide variety of op eration functions including pop up menus window commands and dialog com mands C Source Code Debugger Overview So
58. command KEYIN 237 Macro Break command BREAK 231 Macro Conditional Execution command IF 236 Macro Display Output Suppression command SALL 233 Macro Display Output command LALL 232 Repeat Macro Execution command REPEAT 230 do while Macro Execution command DO WHILE 227 for Macro Execution command FOR 228 while Macro Execution command WHILE 229 Measure Execution Time command TI 153 Memo 82 Memo command MEM 215 Memo window 64 Display 41 Hide 41 Memory allocation MAP EX 158 Monadic operator 104 Move cursor between windows 42 N N Change Base command 216 NLIST Display Output Specification command 209 O OPTION Set Options command 217 On the fly functions 11 16 Operating environment 2 Operations
59. command definition Macro Commands 230 R B EAT REPEAT Macro control execution R E P EAT lt parameter list gt lt macro body gt In the same manner as a macro command definition if REPEAT lt parameter list gt J is input the macro input prompt is displayed and the system enters macro input mode Multiple commands and macros can be freely written in the lt macro body gt portion there is no limit on the number of commands that can be included except for the capacity of the macro buffer The input of lt macro body gt is terminated by inputting In the REPEAT macro the pseudo parameter 0 in lt macro body gt is replaced by each element in lt parameter list gt one by one as lt macro body gt is executed Therefore lt macro body gt is repeatedly executed a number of times equal to the number of elements in lt parameter list gt The maximum number of parameters that can be specified is 10 Example gt d 80000000 80000000 A3 06 86 00 ED CB 31 00 01 F2 FO 90 00 2D 00 20 gt repeat 80000000 80000002 80000004 80000006 Pe 0 f f gt e 80000000 ff gt e 80000002 ff gt e 80000004 ff gt e 80000006 ff gt d 80000000 80000000 FF 06 FF 00 FF CB FF 00 01 F2 FO 90 00 2D 00 20 gt Macro command definition Macro Commands 8 Macro Commands 231 BREAK ona This command can only be used
60. currently registered symbols eeeeeeeeeee 182 Register change delete symbol cccceceeereeesteeeeeees 184 7 Code Display Change ccccceccceeceeeeeeseceeeeeeeesecaeeeseeeesecaeeeseeeeeeas 186 V Display source lines from specified position in Code WINGOW 2 0 5ich He a EE eee 187 U Display disassembled code 0 eee eee eeees 188 A Input assembly language line s s s 190 K Bak tha Ce aiiin aaco aota aiaia iai aaas 191 8 Water DIS Olay e NE 192 INS INSPOGl erriarena ea 193 W Register walGhirossssnss ninsi EA 195 lt Contents 5 gt lt Contents 6 gt VAL Evaluate C expression c cecceeeeeeceeeeteeeeeseeetees 197 Y Delete Watch ecceeesceeceteeeeeneeeeeeeeeeeaeeeeeeeeescaeeeseneeeees 199 System Control COMMANAS cccceeceeceeeeeeeeeeseeeeeeeeeeeseeeeeeneeeteaees 200 Q EXIT Quit C source code debugger ccccceeseeeees 201 HELP Display help screen srties 202 Execute SUDPrOCeSS ceeecceeeeeeeeceeeeeeneeceeeeeseneeeeeeseeeeees 203 I Display search history c cceseeeeeteeeeeeeeeeeeeeeeseeeeeeeees 205 10 Other Command sacs gice she ezecesiceesees parcel a eian e aa 206 CLS Clear Command window screen s es 208 HOME Move cursor to home position eccceeeeeeeeeees 208 LIST Specify display Output 0 ccceeeeeeeseeeeeeteeesteeeeeeees 209 NLIST Suppress display output cc
61. cursor is already located at the end of the line the operation is identical to that of SHIFT F3 CA Pressing these keys deletes the character located at the cursor position Pressing these keys deletes all of the characters in the line currently being edited Pressing these keys switches between Insert mode and Replace mode Pressing these keys displays the preceding portion of the history buffer In addition if a character string has been input on the command input line a search is conducted for a character string beginning with that character string within the history buffer going from newest to oldest If a character string that satisfies the conditions is found it is displayed If these keys are then pressed again the search continues in the older part of the history buffer e command and command Example gt bp tcirg gt U main gt bp count gt bp E If SHIFT 7 is then pressed the previously input commands are searched for a character string that begins with bp the character string that is found bp count is then displayed If SHIFT T is then pressed again bp tcirq is dis played Pressing these keys displays the subsequent portion of the history buffer In addition if a character string has been input on the command input line a search is conducted for a character string beginning with that character string within the history buffer going from oldest to newest If a cha
62. difference in the display format between structs and unions is that the attribute display is either struct struct name or union union name Data Reference Functions 6 Window Commands 89 Inspection display for a SAMPLE C be Bm Hout variable with the struct T D1 99908008 A1 00000000 attribute D3 00000000 A3J 00000000 if sec 0 10 sec 0 0 secl1 struct abc test 90002004 tst1 0 tst2 0 int tstl 0 0x0 int_ tst2 0 0x0 init_data test tst1 0 test tst2 0 CN IM 0 S 0 DO 00000007 D1 80000000 D2 00000000 D PSH 0006 AG 00000000 A1 80000000 A2 00000000 A PC 80000076 MDR 80000073 LIR 8000006C LAR 00000000 S mov 200C d0 O g 16 lt gt 10 RangelliChangef GK gt ins test 3 3 Local commands within the Inspect window If the Inspect window is opened the contents of the variables are displayed in window at the same time the function key display changes showing the local commands that can be used in the Inspect window These local commands can be used to find more detailed information on the contents of data structures that have multiple elements such as arrays and structs Elements can be selected in the array and struct display with the key operations described below The currently selected element is highlighted tT CTRL E Moves the selected element line up one line q CTRL X Moves the selected element line down one line ROLL DOWN CTRL R Moves the dis
63. event number gt Event conditional trace mode Quick Reference 266 B IC S T lt count gt lt event number gt TM F TM TG TS TD TDU Breaks when the trace memory becomes full Tracing continues until program execution is halted Only tracing halts when the trace memory becomes full User program execution does not halt After the event condition specified by lt event number gt has been met the number of times specified by lt count gt tracing halts Sets the default trace mode INT ALL C Displays the current trace mode settings Resumes tracing Halts tracing Displays the contents of trace memory as a hex dump Displays the disassembled contents of trace memory Subcommands for trace display mode B P lt pages gt N lt frame address gt Displays the top bottom of trace memory Moves the display start frame the number of pages specified by lt pages gt and then displays one page Sets the display start frame to lt frame address gt D lt frame address S gt lt frame address E gt Displays the contents of the range of frames in hexadecimal L lt frame address S gt lt frame address E gt C Q TDW TI lt mode gt lt mode gt S lt event number gt E lt event number gt TI lt clock gt lt clock gt Quick Reference Displays the disassembled contents of the range of frames Hides frames labelled with Execut
64. extern are valid in all program areas In other words their scope is the entire program On the other hand automatic variables declared within a function are valid only within that function Therefore the scope of such a variable is limited to that function When a variable declared with extern and an automatic variable declared within a function have the same name within the function only the automatic variable is valid and the extern variable cannot be accessed In addition auto matic variables of functions not currently being used cannot be viewed In the C source code debugger this type of processing is performed automati cally on the basis of the scope information derived from the debugging informa tion Rules for Using Dialog Commands 108 H Constants The use of constants is exactly the same as in C syntax The default base is always base ten regardless of the setting of the N command base change com mand Notation Base number Decimal constant Oxnumber Hexadecimal constant OXnumber Hexadecimal constant Onumber Octal constant For example 4096 decimal 0x1000 hexadecimal and 010000 octal all represent the same value The C escape sequence listed below is supported for character constants C character Value Meaning Ya Ox7 Bell b 0x8 Backspace f OxC Form feed n OxA Line feed r OxD Return t 0x9 Horizontal t
65. flag name gt lt register name gt REG lt value gt lt flag name gt FLG lt value gt These commands display and change the contents of registers The register and flag names that can be used with the R command are listed below lt register name gt AO Al A2 A3 DO D1 D2 D3 MDR LIR LAR SP PC PSW lt flag name gt C carry flag Z zero flag N negative flag V overflow flag IE interrupt enable flag IM interrupt mask level R This command displays the contents of all registers and flags in hexadeci mal R lt register name gt This command displays the contents of lt register name gt lt flag name gt and then waits for input If a value is input at this point the value in the register is replaced with the new value Pressing just the Return key returns control to the C source code debugger without changing the value in the register lt register name gt REG lt value gt These commands change the value of the specified register flag lt flag name gt FLG lt value gt To change the status of a flag code flag name FLG For example to change the C flag use CFLG Reference If the Register window is left open F2 or CTRL 4 the most recent register contents can always be seen Data Display Change 178 Example gt r IM 0 S 0 DO 00000000 PSW 0000 AO 00000000 PC 40000000 MDR 00000000 jmp 0x80000000 gt d0reg 12345678
66. gt lt line number gt Format 2 lt line number gt Format 3 lt symbol gt t lt line number gt Line numbers specify a specific source line in the user program as a combina tion of a decimal number lt line number gt and the file name or symbol name Format indicates the absolute line number If lt file name gt was input this format specifies the nth line where n is lt line number gt of the specified file If lt file name gt is omitted this format specifies the nth line where n is lt line num ber gt of the current file the file currently displayed in the Code window gt v_ 100 specifies the 100th line of the currently selected source file gt v test 120 specifies the 120th line of test c Format 2 specifies a line in terms of its relative position to the source line currently pointed at by the program counter The lt line number gt specification points at the line that is lt line number gt lines beyond the current source line while the lt line number gt specification points at the line that is lt line number gt lines in front of the current source line However if there is no corresponding source line for the program counter when a format 2 line number specification is made an input error results gt v_ 10 specifies the 10th line from the source line currently pointed at by the program counter Rules for Using Dialog Commands 102
67. gt ev No Sadr Badr st Data Symbol Sz E 1 80000039 80000058 EX _Omain gt tm Trigger OFF Trace Full Continue Sample Event 1 Trace Cycle INT gt ev sec w 5 gt tm t1000 2 gt ev No Sadr Badr st Data Symbol Sz E 1 80000039 80000058 EX _Omain E 2 0000080C WR 05 E gt tm Trigger ON Delay 1000 Sample Event 2 Trace End Stop Trace Cycle ALL amp INT Sample Event NONE gt tm f gt tm Trigger OFF Trace Full Continue Trace Cycle ALL amp INT Sample Event NONE gt Cnt BRK TRC DLY TS TE CLR al Cnt BRK TRC DLY TS TE CLR L pi Reference The base used in lt event number gt trace with event conditions and directory triggered trace and lt count gt is assumed to be decimal regardless of the N command specification If 0x is added the base is hexadecimal EV command Other Hardware related Commands 146 On the fly INFLUENCES function T G Start trace If tracing was stopped due to the TS command or a trace full stop while the user program was running the TG command can be used to restart tracing If tracing was stopped by a trigger being tripped in delayed trigger trace mode the TG command cannot be used to resume tracing The TG command can only be executed while the user program is running Example gt tm Trigger OFF Trace Full Continue Trace Cycle ALL amp INT gt g gt ts
68. halted Because tracing did not halt even though the trace halt processing was executed the trace results cannot be displayed Because it is likely that there is a problem with the in circuit emulator contact us at the address indicated at the end of this manual Trace contents have been cleared If the trace contents have been cleared or if tracing has not been performed even once since the C source code debugger was started up the commands that display the trace results TD and TDW cannot be executed The delay counter specification is not correct An attempt was made to specify a value for the delay counter that was outside of the permitted range from 257 to 16 384 Cannot be used after delay trigger has been tripped In delay trigger trace mode tracing cannot be resumed with the TG command once tracing was halted because the conditions were met Canceling a trace event This warning message indicates that a trace event is being cancelled or disabled Event break cannot be set 82 maximum No more than 32 software breaks and hardware breaks in total can be set Software break has already been set at the same address A software break has already been set at the specified address Multiple software breaks cannot be set at the same address Command cannot be registered A command could not be registered because there was insufficient area to register lt command gt with the BP or C lt command gt comm
69. lt address S gt lt address B gt W Runs a user program F5 F7 W Runs a user program with the on the fly functions disabled RESET Resets the microprocessor EV lt address S gt lt addressE gt lt status gt lt data gt BI WI D N lt count gt Sets an event lt status gt EX Execution address event RW A data event is generated upon a read or write operation R A data event is generated upon a read operation W A data event is generated upon a write operation Omitted If lt data gt is specified RW a data event is generated upon a read or write operation is assumed If lt data gt is not specified EX execution address event is assumed lt access width gt Specifies the data access width for a data event B An event is generated upon a 8 bit data access W An event is generated upon a 16 bit data access D An event is generated upon a 32 bit data access Omitted Access width does not matter Quick Reference IN EV C lt listl gt EV 9 Appendix 265 An event is generated when the data does not match lt data gt When the specified event is generated all event generation flags and counters are cleared Displays the events that have been set BP lt address S gt lt address E gt lt status gt lt data gt BI WI D N lt count gt lt status gt lt access width gt IN C lt command gt BP BPA lt list gt BPS lt list gt
70. lt size M gt Reserves the debugging information area in EMS memory E lt extension gt Specifies the default extension F Specifies overlap mode save to file FEMS Specifies overlap mode save to EMS memory N Disables indicators TAB lt tab size gt Specifies tab size X Specifies assembler debugging mode XC Specifies CC103 compiler debugging mode NOTARGET Specifies startup without target system C Source Code Debugger Startup Method and Options Specifying the size of the debugging information area and the macro area B 5 C Source Code Debugger Startup Method and Options 57 This option specifies the size of the debugging information area and the macro area A wide variety of information is stored in the debugging information area including symbol names and line number information This information area must be about 1 2 the size of the executable file the EX file when compiled with all debugging options including the debugging information As a result if the debugging information area is reserved in conventional memory the memory area up to 640KB it will be impossible to debug a large program In such a case reserve the debugging information area in EMS memory B lt size D gt lt size M gt Specify numeric values for the size of the debugging information area lt size D gt and the macro area lt size M gt lt size D gt Size in 16KB units of the area where the debugging infor
71. macro name DO lt macro body gt WHILE lt expression gt A macro command similar to the do while statement in C FOR lt command 1 gt lt expression gt lt command 2 gt lt macro body gt A macro command similar to the for statement in C WHILE lt expression gt lt macro body gt A macro command similar to the while statement in C REPEAT lt parameter list gt lt macro body gt BREAK LALL SALL MLIST lt macro name gt MLIST gt lt file name gt KILL lt macro name gt Repeat macro command Exits the macro Display output specification in a macro Display output suppression specification in a macro Displays lt macro name gt Writes all macros that are currently defined to the specified file Deletes lt macro name gt IF lt expression gt lt command gt ELSEIF lt expression gt lt command gt ELSE lt command gt KEYIN lt file name E Special Symbols __ERR__ __RUN__ __DEBINF _ Quick Reference Conditional control command similar to the if elseif else statement in C Instructs that the next line is to be input from the keyboard Loads a macro from the specified macro file 1 when the previously executed command generated an error 0 when the command was executed normally 1 while a user program is running 0 otherwise Special debugger symbol that is used delete all symbols PageUp Ctrl C RollUp
72. mal numbers The base of a number is identified by a symbol in front of the value Numeric values for which the symbol indicating the base was omitted are handled according to the base specified by the N command N command Symbol Base lt numeric value gt lt numeric value gt _ lt numeric value gt lt numeric value gt Ox lt numeric value gt numeric value Binary Octal Decimal Hexadecimal Hexadecimal Accords with the base specification either hexadecimal or decimal For example 11001010 312 202 CA and OxCA all represent the same numeric value In addition there are also commands DS DL etc that handle 4 and 8 byte real numbers in IEEE format E Addresses The address format used by the C source code debugger is shown below XXXXXXXX b Address 32 bits Example gt D 80001234 Symbol names and line numbers explained below can be input as command parameters wherever an address needs to be specified Rules for Using Dialog Commands 7 Dialog Commands 101 E Line numbers The C source code debugger supports debugging at the source code level using the line numbers in the source file The line numbers are used to specify specific lines within the source file Line numbers are valid only when the source line information is included within the executable file that was loaded There are three line number input formats Format 1 lt file name
73. meaningful For example if char p MEC is coded the variable p stores not string MEC itself but the address infor mation where the string MEC is stored If a variable with the pointer attribute is inspected the content of that variable an address value is displayed in hexadecimal with an asterisk The Oth element the information stored in memory indicated by the variable address of the pointer is displayed If the pointer has the character attribute that element is recognized as a character string and the characters are displayed as the element until the null character 0 is reached If the pointer has multiple elements such as a struct array those elements are enclosed in brackets and as much in formation as possible that fits on one line is displayed Example int ip 1500 integer pointer 0 10 OxA pointer element Data Reference Functions 86 Char p 1550 MEC O character pointer 0 M 77 0x4D subsequent character elements 1 E 69 0x45 2 C 67 0x43 3 0 0 0x0 E Array inspection An array has multiple elements as the name indicates There are also a num ber of variations such as multidimensional arrays with two or more dimensions and struct arrays These arrays can be inspected in an easy and efficient manner In array inspection the array attributes are disp
74. of memory extending from lt address S gt to lt address E gt with the contents of memory starting at lt address D gt F lt type gt lt address S gt lt address E gt lt data gt Fills the specified range of addresses with the value lt data gt in the format specified by lt type gt lt type gt B Byte 8 bits fill W Word 16 bits fill D Double word 32 bits fill M lt address S gt lt address E gt lt address D gt Transfers the memory block extending from lt address S gt to lt address E gt to the position in memory starting at lt address D gt S lt type gt lt address S gt lt address E gt lt target pattern gt Displays the memory addresses within the range of ad dresses whose contents match lt target pattern gt lt type gt B Byte 8 bits search W Word 16 bits search D Double word 32 bits search Quick Reference E Registers R R lt register name gt lt register gt REG lt value gt lt flag gt FLG lt value gt E Displaying Expressions H lt expression gt H lt expression 1 gt lt expression 2 gt 9 Appendix 269 Displays the contents of all flags and registers in hexadecimal Changes the contents of lt register name gt lt flag name gt Changes the value of the specified register Changes the value of the specified flag Displays the value of lt expression gt in octal decimal hexa decimal and ASCII Displays the sum and difference of lt expre
75. of trace memory are erased by single step execution Program Loading Execution 118 Example gt T IM 0 S 0 DO 0X00000000 D1 0x00000000 D2 0x00000000 D3 0x00000000 PSW 0X0000 AO 0X00000000 A1 0xX00000000 A2 0xX00000000 A3 0x00000000 PC 0X80000000 MDR 0X00000000 LIR 0X40000000 LAR 0X00000000 SP 0xX00000100 _RESET JMP 0X80000006 gt T IM 0 S 0 DO 0X00000000 D1 0xX00000000 D2 0xX00000000 D3 0xX00000000 PSW 0X0000 AO 0X00000000 Al 0X00000000 A2 0X00000000 A3 0X00000000 PC 0X80000006 MDR 0X00000000 LIR 0X80000000 LAR 0X00000000 SP 0X00000100 MOV 0xX100 A0 gt T IM 0 S 0 DO 0X00000000 D1 0X00000000 D2 0xX00000000 D3 0xX00000000 PSW 0X0000 AO 0X00000100 Al 0xX00000000 A2 0X00000000 A3 0X00000000 PC 0X80000009 MDR 0X00000000 LIR 0X80000006 LAR 0X00000000 SP 0xX00000100 MOV AO SP gt T 5 IM 0 S 0 DO 0X00000000 D1 0X00000000 D2 0xX00000000 D3 0xX00000000 PSW 0X0000 AO 0X00000100 Al 0X00000000 A2 0X00000000 A3 0xX00000000 PC 0X8000000B MDR 0X00000000 LIR 0X80000009 LAR 0X00000000 SP 0X00000100 MOV OxO _I A0 IM 0 S 0 DO 0X00000000 D1 0X00000000 D2 0xX00000000 D3 0xX00000000 PSW 0X0000 AO 0X00000000 Al 0X00000000 A2 0X00000000 A3 0X00000000 PC 0X8000000D MDR 0X00000000 LIR 0X8000000B LAR 0X00000000 SP 0X00000100 MOV 0X2000 D1 IM 0 S 0 DO 0X00000000 D1 0xX00002000 D2 0xX00000000 D3 0xX00000000 PSW 0X0000 AO 0X00000000 A1 0X00000000 A2
76. settings Specifies the starting address of the sample area Specifies the address to be displayed at the bit level Clears the address to be displayed at the bit level Displays the RAM monitor screen Displays the current sample area Tabulates the subroutine access status Profile function ON Profile ON OFF Profile OFF CLR Clears the profile results Displays the profile results Quick Reference 268 E Memory D lt type gt lt address S gt lt address E gt lt count gt lt base gt Displays the contents of memory from lt address S gt to lt address E gt in the specified base Byte 8 bits display Word 16 bits display Double word 32 bits display 4 byte real number short floating point display lt type gt 8 byte real number long floating point display ASCII display lt base gt Hexadecimal display specification Decimal display specification DOr Ceo ED Octal display specification E lt type gt lt address gt lt data gt Changes the contents of memory starting from the specified address to the format specified by lt type gt lt type gt Changes format to byte 8 bits format Changes format to word 16 bits format Changes format to double word 32 bits format nggaw Changes format to 4 byte real number short floating point format C lt address S gt lt address E gt lt address D gt Compares the contents
77. string are described below Pressing one of these keys F1 to F5 and F10 registers the selected character string in a memo number area with the same number as the function key that was pressed e MEM command These keys are used to inspect the selected character string as a C ex pression Chapter 6 section 3 1 Inspect function SAMPLE C DO 0000000A AG 00000000 D1 00000000 A1 00000000 cnt60 D2 00000000 A2 00000000 sec O D3 00000008 A3 00000000 if sec 10 secl1 int 2 sec 0000200C A 3 0 10 xA 1 3 0x3 init_data test tst1 0 test tst2 0 2 IM 0 0 DO 0000000A D1 89000000 D2 00000000 D PSW 0001 AG 00000000 A1 89000000 A2 00000000 A PC 80000092 MDR 80000073 LIR 80000076 LAR 00000000 S clr d PO Zoom L6 lt gt 108 Inspctf Hatch View W RangeiliChangelMkg gt These keys are used to register the selected character string as a C ex pression in the Watch window Chapter 6 section 3 4 Watch function These keys are used to view the selected character string as a C expres sion be Chapter 6 section 3 5 View function These keys are used to get the selected character string for input to the Command window Window commands 74 Shift Home F1 File File selection window 2 4 File display This section explains commands for listing modifying those files that can be referenced
78. the mes sage otherwise output the data in address 70 Lf 70 amp 0xff pft test OK else pf amp x 70 amp 0xff Macro Commands 8 Macro Commands 237 K i N Specify input from the keyboard KEYIN This command is used within a user defined macro command to ask for the next line to be input from the keyboard Example gt setd e 80000100 11 222 233 244 keyin 266 fas TI gt setd gt e 80000100 address asc oct dec hex data 0000100 370 8 F8 11 0000101 347 25 E7 22 0000102 003 3 03 33 0000103 044 36 24 44 0000104 i 301 63 C1 55 0000105 amp 046 38 26 66 0000106 173 123 7B Vo o oOo co o co o In this example the 55 in address 80000104 was input from the keyboard all of the other data was input through macro expansion Macro Commands 238 Chapter 9 Appendix 1 In circuit Emulator Specifications 2 Switch Settings for Interface Board 3 Notes for Probe Section 4 C Source Code Debugger Error Messages 5 Quick Reference 6 Supplement for the PC AT DOS V Version 240 In circuit Emulator Specifications SS 1 1 Functional Specifications Item Specifications Target device MN10300 Series Memory capacity Emulation memory 1024K standard high speed memory 512K low spee
79. the numeric keypad Pressing these keys while a subprocess is being executed pauses the subprocess and returns control to the C source code debugger These keys are valid only while a subprocess is being executed Pressing these keys while the subprocess is paused pauses the C source code debugger and passes control to the subprocess sey These keys are ignored if the subprocess was not started up by the command s Chapter 4 section 4 7 for the command These keys turn the display of the Register window and Option window on and off If the Register window is not displayed pressing these keys displays the Register window If the Register window is displayed pressing these keys closes the Reg ister window These keys have the same function as the F2 key Chapter 6 section 2 1 Screen control Pressing these keys changes the display to the RAM monitor To return to the debugger screen press CTRL 5 again Window commands 78 BS Ctrl H lt Shift Ctrl S Shift gt Ctrl D Shift F4 LnTop Ctrl A 2 6 Shell functions The C source code debugger registers in sequence all key input other than Window commands in the history buffer an area of about 1500 characters The contents of this history buffer can be searched and line edited Unlike the MS DOS template functions the cursor can be moved freely in the line being edited and characters
80. third line mea sures the execution speed of the timer command The fourth line initiates execu tion Then in the 9th line if the user program is stopped the time required to execute from the 45th line to the 45th line is displayed and the macro is exited On the other hand if the user program is running in the 9th line the macro inputs ESC displays a message indicating that fact and exits the macro User pro gram execution can be interrupted by inputting ESC from within a macro These are just two examples of how macros can be used to make more effi cient debugging possible This function can also be used in durability testing by collecting the results of macro command execution in a file and determining whether the same commands yield the same results Macro Command Overview 222 Macro Commands The following Dialog commands are provided as macro definition execution commands and as control commands supported by the C source code debugger to provide control structures similar to those in C DO WHILE command This command executes do while macro control FOR command This command executes for macro control WHILE command This command executes while macro control REPEAT command This command executes repeat macro control BREAK command This command exits a macro LALL command This command specifies display output by a macro SALL command Th
81. to the Command window Move the cursor to the Code window if the cursor is in the Command win dow press the HOME key and then press the Cursor Down key J The cursor moves down one line Keep pressing the Cursor Down key The cursor moves down line by line Once the cursor reaches the bottom of the Code window the Code window dis play begins to scroll up Now press the Cursor Up key 1 The cursor then moves up the screen and once it reaches the top of the Code window the Code window display scrolls down In addition the ROLL UP and ROLL DOWN keys can be used to control the Code window display in a fashion similar to most screen edi tors Next press the F1 File key The File Select window appears on the screen In this example the SAMPLE C and STARTUP ASM files are displayed When debugging a program that has more source files the name of each source file is displayed in this window After selecting a file by using the cursor keys to high light the desired file name in yellow press the Return key The File Select win dow then closes and the selected file is displayed in the Code window Debugging Tutorial Displaying the disassembled code and C source code F3 gt page 69 4 Characteristic C Source Code Debugger Functions and Their Usage 43 STARTUP ASH stack_end DO 00000000 AG 90000000 D1 00000000 A1 00000000 _TEXT SECTION CODE PUBLIC 1 D2 00000000 A2 00000000 D3 00000000 A3 00000000 _reset S
82. while a user program is executing all event true flags that were set up to that point are cleared e Ifa break is set while a user program is executing there may be a time differential between the occurrence of the cause of the break and the point when program execu tion breaks e Following three icons are used for quick reference of the on the fly function NO INFLUENCES No limitation on command functions No influences on the program execution INFLUENCES No limitation on command functions Some influences on the program execution CANNOT BE USED On the fly function cannot be used 2 8 Miscellaneous e Ifthe measured execution time is long a slight amount of error may begin to creep in e If using handshake mode the In circuit Emulator does not generate an acknowledge signal when the microprocessor accesses an external memory space Therefore it is necessary for the user to include a circuit or other mechanism that generates an acknowledge signal in all external memory spaces that will be used Notes on Use Chapter 2 C Source Code Debugger Structure 1 Equipment List 2 Equipment Description 18 Hardware List E Y The development environment is configured from the following devices Confirm that all of this hardware is provided before using this system If any components are missing or damaged contact our sales office In circuit Emulator DIL
83. 0 A2 0X00000000 A3 0X00000000 PC 0X80000013 MDR 0X00000000 LIR 0X80000012 LAR 0X00000000 SP 0X00000100 ADD 0X4 _TEST A0 Program Loading Execution 7 Dialog Commands 121 Execute user program G lt address S gt lt address B gt W G im G lt address S gt lt address B gt W G lt address B gt W G W The G command is used to execute user programs With the G command one temporary software break lt address B gt can be specified Any break points specified by the BP command are also valid The ESC key can also be used to interrupt forcibly break execution of the user program at any time The G command initiates execution of the user program from the address specified by lt address S gt execution start address and stops at the ad dress specified by lt address B gt lt Address B gt is a temporary software break This command initiates execution of the user program from the address specified by the current program counter value and stops at the address specified by lt address B gt This format is valid only when the C source code debugger was started up in C debugging mode When the program to be debugged is executed by the G command execution stops once control returns from the function that is currently being executed This command has the same function as the CTRL F5 Return Window command IW Executes the program with on the fly functions prohib ite
84. 00 RW 0xxxx100 1 D 3 00000000 RW 05 1 E 4 80000058 EX _Ocnt60 1 gt bd gt bp No Sadr Eadr st Data Symbol Sz Cnt Command D i 80000039 SF _Omain 1 D 2 00000100 RW 0xxxx100 z 1 D 3 00000000 RW 05 1 D 4 80000058 EX _Ocnt60 1 gt Reference The base used in lt list gt is assumed to be decimal regardless of the N command specification If Ox is added the base is hexadecimal e EV command BP command BC EC command and BE command Event Related Commands 7 Dialog Commands 139 Hardware break UNO INFLUENCES Gadhosiy Software break INFLUENCES function B E Enable break event BE tist This command enables software break hardware break events that were temporarily disabled by the BD command If lt list gt is specified the break events with the specified numbers are enabled If is specified all break events that were set are enabled BE 1 2 7 4 In the above example break events 1 2 and 7 are enabled BE In the above example all break events are enabled Event Related Commands 140 Example gt bp No Sadr Eadr st Data Symbol Sz Cnt Command D 1 80000039 SF _Omain a D 2 00000100 RW 0xxxx100 1 D 3 00000000 RW 05 5 HE D 4 80000058 EX _Ocnt60 1 gt be 1 3 gt bp No Sadr E Eadr st Data Symbol Sz Cnt Command E 1 80000039 SF _Omain 1 D 2 00000100 RW 0xxxx100 1 E 3 00000000 RW 05 I D 4 80000058 EX _Ocnt60 L gt be
85. 000 D1 AO 0X00000100 0X8000000B MDR 0X00000000 MOV OXO _I A0 IM 0 S 0 DO 0X00000000 D1 AO 0X00000000 0X8000000D MDR 0X00000000 MOV 0X2000 D1 IM 0 S 0 DO 0x00000000 D1 AO 0xX00000000 0X80000010 MDR 0x00000000 SUB DO DO 0X00000000 D2 Al 0X00000000 LIR 0X40000000 0X00000000 D2 Al 0X00000000 LIR 0X80000000 0X00000000 D2 Al 0X00000000 LIR 0X80000006 0X00000000 D2 Al 0X00000000 LIR 0X80000009 0X00000000 D2 Al 0X00000000 LIR 0X8000000B 0X00002000 D2 Al 0X00000000 LIR 0X8000000D 0X00000000 D3 A2 0X00000000 LAR 0X00000000 0X00000000 D3 A2 0X00000000 LAR 0X00000000 0X00000000 D3 A2 0X00000000 LAR 0X00000000 0X00000000 D3 A2 0X00000000 LAR 0X00000000 0X00000000 D3 A2 0X00000000 LAR 0X00000000 0X00000000 D3 A2 0X00000000 LAR 0X00000000 0X00000000 A3 0X00000000 SP 0X00000100 0X00000000 A3 0X00000000 SP 0X00000100 0X00000000 A3 0X00000000 SP 0X00000100 0X00000000 A3 0X00000000 SP 0X00000100 0X00000000 A3 0X00000000 SP 0X00000100 0X00000000 A3 0X00000000 SP 0X00000100 Z IM 0 S 0 DO 0X00000000 D1 0xX00002000 D2 0xX00000000 D3 0xX00000000 PSW 0X0001 AO 0X00000000 Al 0X00000000 A2 0X00000000 A3 0X00000000 PC 0X80000012 MDR 0X00000000 LIR 0X80000010 LAR 0X00000000 SP 0X00000100 MOV DO A0 Z IM 0 S 0 DO 0X00000000 D1 0X00002000 D2 0X00000000 D3 0xX00000000 PSW 0X0001 AO 0X00000000 A1 0X0000000
86. 0000 SP 0X000000F0 _CNT60 MOV OXO0C _SEC DO gt BP command BC command BD command BE command F5 Go F7 Come key Window command and SM command Program Loading Execution 7 Dialog Commands 123 On the fly INFLUENCES function R ES ET Reset user microprocessor This command makes the microprocessor s reset input active The program counter PC register is set to address 0x40000000 The value of all of the CPU registers is undefined when a reset is executed However with this debugger the value set by the Installer is set in the stack pointer SP register s MN10300 Series PanaX Series Installation Manual Hardware volume section 5 Installer Startup and Settings This command is used to execute a program from the start or if the program has hung and the debugger is not able to accept commands Program Loading Execution 124 Event related Commands D 3 Event functions set triggers that initiate hardware breaks tracing time mea surement functions etc The in circuit emulator monitors the occurrence of events without stopping execution of the user program There are two types of events 1 Execution address events An event is generated by the address of the instruction that was executed Conditions including a range of addresses and a number of passes through an address can be specified Up to four events can be set 2 Data
87. 000020 00 00 F8 FE 04 CA F4 CB CB F8 F gt d 80000000 8000002 80000000 DC 06 00 00 00 CB 24 00 01 F2 FO 90 00 2D 00 20 80000010 F1 00 60 20 04 29 FC Cl FB F8 FE FC FC FF OD 00 80000020 00 00 F8 FE 04 CA F4 CB CB F8 F F8 DD 16 00 00 FJ PJ F8 DD 16 00 00 gt gt c 0 2f 80000000 Start to compare 00000005 FF CB 80000005 00000000B D7 90 8000000B 00000017 08 C1 80000017 End to compare Data Display Change F FB FW FD 172 On the fly INFLUENCES function Fill specified range of memory with data value F lt address S gt lt address E gt lt data gt FB lt address S gt lt address E gt lt data gt FW lt address S gt lt address E gt lt data gt FD lt address S gt lt address E gt lt data gt These commands fill memory from lt address S gt to lt address E gt with the value lt data gt When the length of lt data gt is shorter than the address range lt data gt will be repeated until the specified range of memory is filled From 1 to 16 data items can be specified for lt data gt Byte 8 bits fill Word 16 bits fill Double word 32 bits fill The fill function cannot be used in the special register areas E Data Display Change 7 Dialog Commands 173 Example gt d 80000000 8000003 80000000 DC 06 00 00 00 CB 24 00 01 F2 FO 90 00 2D 00 20 80000010 F1 00 60 20 04 29 FC Cl FB F8 FE FC F
88. 000080C RW 05 1 gt Reference e No is the number assigned to the event that was set This number is used by the BC EC BD BE BPA BPS TM and TI commands for vari ous settings e The E or D indicates whether that event is currently enabled E or disabled D e The meanings of the codes in the st column are explained below EX Execution address event RW Data event in read or write operation RD Data event in read operation WR Data event in write operation e The sz column means the accessive range for data event 8 bit data 16 bit data 32 bit data size don t care gay e asterisk Indicates that the event in question was assigned to one of the following functions BRK Break BP command TRC Trace with event conditions TM command DLY Delayed trigger trace event t gt TM command TS Time measurement start event TI command TE Time measurement end event Tl command CLR Event clear t gt EV C command TTT EentRetated commands 130 Set display sofware break NO INFLUENCES On the fly Set display sotware break INFLUENCES function B f Set display break event BP lt adaress S gt lt address E gt lt status gt lt data gt B W D N L lt count gt C lt command gt BP B P lt address S gt I lt This command sets an internal event and that event is set in a hardware break The following tabl
89. 00009F _init_data 8000009F _Oinit_data 80001234 tmp2 gt __debinf__ gt x No debugging information found gt gt d 100 00000100 86 74 CD 76 E8 95 98 BA Bl B6 EB D2 gt j 100 Registered symbol name gt x 76CD7486 j gt k 100 amp ffff Registered symbol name gt x 00007486 k 76CD7486 j gt TF 2A 99 4E t gt R command and X command Data Display Change 186 Code Display Change E a EEN The C source code debugger displays the source code or the results of disas sembly in the Code window Changes in the displayed contents can easily be referenced by using Window commands to switch between the source code and the disassembled code The V and U Dialog commands can also be used to ex ecute similar processing s Chapter 6 Window Commands V command This command displays the source code in the Code window U command This command displays the disassembled results in the Code window A command This command performs line assembly K command This command back traces the C stack frame Code Display Change 7 Dialog Commands 18 7 On the fly NO INFLUENCES function Display source lines from specified position in Code window V lt file name gt lt line gt V lt symbol gt V lt file name gt lt line gt V lt symbol name gt Example Display the source code in the Code window starting from the loca tion wher
90. 16 bit data 32 bit data size don t care BC EC command BD command BE command G command L command or LP command Event Related Commands 7 Dialog Commands 133 On the fly NOINFLUENCES function a B PA Set AND break This command sets an AND break B P A lt list gt The hardware break events specified in lt list gt become AND conditions Once all of the conditions are satisfied a break occurs Specify up to eight break event numbers in lt list gt delimited by commas If an AND break is set while a program is running it becomes valid immedi ately To cancel an AND break execute the BD or BC EC command on one of the break events set as part of the AND break Example gt bp No Sadr Eadr st Data Symbol Sz Cnt Command E 1 80000039 SF _Omain 1 E 2 00000100 RW 0xxxx100 1 E 3 00000800 RW _i 7 1 E 4 80000058 EX _Ocnt60 1 gt bpa 2 3 Break event Nos gt bp 2 and 3 form No Sadr Eadr st Data Symbol Sz Cnt Command an AND break E 1 80000039 SF _Omain 1 gt E 2 amp 00000100 RW 0xxxx100 1 E 3 amp 00000800 RW _i 1 E 4 80000058 EX _Ocnt60 1 gt Reference The base used in lt list gt is assumed to be decimal regardless of the N command specification If Ox is added the base is hexadecimal Event Related Commands 134 BPS On the fly NO INFLUENCES function Set sequential break B P S lt list gt Thi
91. 80000000 _Reset 80000029 _main 8000002C _Omain 80000042 _initialize 80000042 _Oinitialize 8000004C _display 8000004C _Odisplay 80000056 _Ocnt 60 80000056 _cnt60 8000009F _init_data 8000009F _Oinit_data gt __debinf__ gt x No debugging information found gt d 100 00000100 86 74 CD 76 E8 95 98 BA Bl B6 gt j 100 Registered symbol name gt x 76CD7486 j gt EB D2 7F 2A 99 4 Fl Data Display Change 184 On the fly NO INFLUENCES function o Register change delete symbol lt symbol name gt lt address gt lt symbol name gt lt address gt lt symbol name gt These commands are used to register change or delete symbols The period at the start of the line may be omitted lt symbol name gt This command sets registers the immediate lt address gt for lt symbol lt address gt name gt lt symbol name gt This command inputs the symbol name and then its setting value lt address gt If lt symbol name gt is input in the C source code debugger s command mode the mode changes to one line keyboard input mode even from within a macro command and then the program waits for the setting value to be input This input method is useful when setting data within a macro In the case of this specification the period may not be omitted lt symbol name gt This command deletes the specified symbol
92. AMPLE C BSS _GBSS CLR mov _BSSEND BSS d1 PICE 10300 Ver 3 6b Release 1 1 1 Copyright c 1996 Pa Sub process segment 873AH 99 Kbyte Monitor Program Version 0 01 Evachip Number 103000 gt 1 sample gt File BOptiing SrcSiSearchi Go WInspctfj Come HSg1St FncS tolk Once the Return key has been pressed and the File Select window has been closed press the F3 SrcSW key The Code window display switches to a mixed display of disassembled code and the C source code This display is useful for more detailed debugging than is possible with the source listing alone sec FFFDFFS DO 00000000 A0 00000000 D1 00000000 A1 00000000 D2 00000000 A2 00000000 80000006 F2F0 a sp D3 00000000 A3J 00000000 80000008 F8FEF4 0C sp 38000000B FCCD14200000 2014 d1 80000011 A500 0 d1 80000013 C30F 80000022 80000015 FCDCO0OOAQOA mov 0 a0 8000001B 00 clr dd PICE 10300 Ver 3 6b Release 1 1 1 Copyright c 1996 Pa deniter Prosran Version DUL Evachip Number gt 1 sample gt File WOptting SrcSWSearchi Go InspctH Come HSglStpk BreakilFncS tplAkS 0 01 103000 Press the F3 SrcSW key again Now the display shows the source code only again You have loaded the executable file SAMPLE EX and now know about the contents of the windows displayed on the screen You are now ready to execute the program Debugging Tutorial 44 Program function step execution F10 page 71
93. BC EC lt list gt BD lt list gt BE lt list gt E Hardware related C lt command gt Sets a break event F9 EX Execution address break RW A data break is generated upon a read or write operation R A data break is generated upon a read operation W A data break is generated upon a write operation Omitted If lt data gt is specified RW is assumed If lt data gt is not specified and lt address E gt or lt count gt is specified EX is assumed Otherwise a software break is assumed Specifies the data access width for a data break B A break is generated upon an 8 bit data access W A break is generated upon a 16 bit data access D A break is generated upon a 32 bit data access Omitted Access width does not matter A break is generated when the data does not match lt data gt Executes lt command gt automatically after the break Displays the breaks that have been set Sets the break events specified in the list as AND breaks Sets the break events specified in the list as sequential breaks Cancels the break events specified in the list Temporarily disables the break events specified in the list Enables the break events specified in the list TM lt mode gt BI Cl SI T lt count gt lt event number gt lt mode gt Sets the trace mode INT Internal RAM bus default EXT Extended RAM bus ALL Normal trace mode default JMP Branch trace mode lt
94. C FF OD 00 80000020 00 00 F8 FE 04 CA F4 CB CB F8 FE F8 DD 16 00 00 80000030 00 00 08 DD 19 00 00 00 00 08 DC F9 FF FF FF DE gt f 80000000 8000002Ff 55 gt d 80000000 8000003 80000000 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 80000010 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 80000020 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 80000030 00 00 08 DD 19 00 00 00 00 08 DC F9 FF FF FF DE gt Data Display Change 174 On the fly INFLUENCES function l Block transfer of specified range of memory M lt address S gt lt address E gt lt address D gt This command performs a memory block transfer of the contents of memory from lt address S gt to lt address E gt to a position in memory starting at lt address D gt Example gt d 0 2f 00000000 FF FF FF FF FF FF FF FE FE PE EP FEFE PE FE FEE FPE 00000010 FF FF FF FF FF FF FF FE PEE GPE BEE BoB BEEE EE PE 00000020 FF FF FF FF FF FF FF FE FE PE EP FEE FE FE EE PE gt d 80000000 8000002 80000000 DC 06 00 00 00 CB 24 00 01 F2 FO 90 00 2D 00 20 80000010 F1 00 60 20 04 29 FC Cl FB F8 FE FC FC FF OD 00 80000020 00 00 F8 FE 04 CA F4 CB CB F8 FE F8 DD 16 00 00 gt m 80000000 8000002F 0 gt d 0 2f 00000000 DC 06 00 00 00 CB 24 00 01 F2 FO 90 00 2D 00 20 00000010 F1 00 60 20 04 29 FC Cl FB F8 FE FC FC FF OD 00 00000020 00 00 F8 FE 04 CA F4 CB CB F8 FE F8 DD 16 00 00 gt
95. Ctrl C p67 PageDown Ctrl R RollDown Ctrl R p67 Alt F1 Ctrl lt p68 Alt F2 Ctrl gt P 68 Alt F3 Ctrl T P68 Alt F4 Ctrl 4 p68 9 Appendix 273 Supplement for the PC AT DOS V Version EEN This section explains the differences in keyboard functions when using the PC AT DOS V version of the C Source Code Debugger as compared to those of the PC 9800 Series version The key combinations shown in parentheses are those used in the PC 9800 Se ries 6 1 Screen Operations When the cursor is located in the Code window pressing these keys scrolls the contents of the Code window up one screen Applies to both C source code display and disassembled code display When the cursor is located in the Code window pressing these keys scrolls the contents of the Code window down one screen Applies to both C source code display and disassembled code display Pressing these keys enlarges the Option window In other words the vertical division between the Option window and the Command Code window moves to the left Pressing these keys reduces the Option window In other words the vertical divi sion between the Option window and the Command Code window moves to the right Pressing these keys enlarges the Command window and reduces the Code win dow In other words the division between the Command window and the Code window moves up o
96. E C MN10300 SERIES C SAMPLE PROGRAM MN10300 COUNTER PROGRAM define define int i struct abc ant tstl int tst2 Ls struct abc test int secl2 main struct aaa int al int a2 imp i eal Line 1 Col 1 If the message Insufficient Memory is displayed when shifting to the subprocess refer to the C source code debugger startup option B Chapter 5 Startup Options Debugging Tutorial 50 Returning from a subprocess To return to the C source code debugger screen hold down the CTRL key and Ctrl 0 then press the 0 key on the numeric keypad Next hold down the CTRL key and then press the 1 key on the numeric keypad in order to return to the editor Returning to a subprocess Simple operations such as these can be used to switch between the C source code Ctrl 1 debugger and an editor or other MS DOS commands applications This func page 77 tion makes it possible to reference source files and specification document files while debugging or to correct the portion of a source file where a bug was found When switching processes the C source code debugger does not C switch data within the MS DOS system such as the current direc tory etc Therefore if the current directory etc was changed in the subprocess restore the original status before returning to the C source code debugger In addition because there is n
97. Format 3 specifies a line in terms of its relative position to the source line corresponding to the address value of the specified lt symbol gt The lt line number gt specification points at the line that is lt line number gt lines beyond the corresponding source line while the lt line number gt specification points at the line that is lt line number gt lines in front of the corresponding source line However if there is no corresponding source line for the specified lt symbol gt when a format 3 line number specification is made an input error results gt bp main 10 specifies the 10th line from the symbol main E Character strings The C source code debugger can handle character strings as ASCII codes in place of numeric values A character string is enclosed in single quotes Example A 0x 41 AB 0x 4142 ABCD 0 x 41424344 In the E EB command data input mode when the data specification in the command line was omitted and the Return key was pressed up to 16 characters can be set at one time in a character string gt E_1000 address asc oct dec hex data 00001000 000 000 1234567890abcd 00001010 Rules for Using Dialog Commands E Register names 7 Dialog Commands 103 In the C source code debugger the contents of registers can be handled as variables The register names that can be used are listed below Register names Flag names
98. H 99 Kbyte Monitor Program Version 0 01 Evachip Number 103000 gt 1 sample gt File WOptiling SrcSWSearchi Go InspctH Come HSglStpk BrealkdlncS tp ky Next press the F2 OptWin key A new window appears on the right side of the screen The top portion of this new window is the Register window which always displays the current contents of the registers The bottom portion of this window is used to display one of four windows the Local window the Memo window the Back Trace window or the Stack window To select one of these windows hold down the CTRL key and then press the F2 OptWin key Note that the Local and Back Trace windows can only be dis played in C debugging mode Press the F2 OptWin key again to close this window The F2 OptWin key is used to both open and close the window Debugging Tutorial 42 Moving the cursor between windows Home page 66 Moving the cursor down and scrolling the screen up L page 66 Moving the cursor up and scrolling the screen down T page 66 Displaying the File Select window F1 page 74 Selecting a file lt program name gt J 4 4 Screen control file handling How do you view the portion of the source listing below the bottom of the Code window First press the HOME key The cursor in the Command window disappears and moves to the Code window Pressing the HOME key again brings the cursor back
99. KNS PJ No 17 Jalan Yong Shook Lin 46050 Petaling Jaya Selangor Darul Ehsan Malaysia Tel 03 7516606 Fax 03 7516666 Penang Office Suite 20 17 MWE PLAZA No 8 Lebuh Farquhar 10200 Penang Malaysia Tel 04 2625550 Fax 04 2619989 Johore Sales Office 39 01 Jaran Sri Perkasa 2 1 Taman Tampoi Utama Tampoi 81200 Johor Bahru Johor Malaysia Tel 07 241 3822 Fax 07 241 3996 E CHINA SALES OFFICE Panasonic SH Industrial Sales Shenzhen Co Ltd PSI SZ 7A 107 International Business amp Exhibition Centre Futian Free Trade Zone Shenzhen 518048 Tel 755 359 8500 Fax 755 359 8516 Panasonic Industrial Shanghai Co Ltd PICS 1F Block A Development Mansion 51 Ri Jing Street Wai Gao Qiao Free Trade Zone Shanghai 200137 Tel 21 5866 6114 Fax 21 5866 8000 E THAILAND SALES OFFICE Panasonic Industrial Thailand Ltd PICT 252 133 Muang Thai Phatra Complex Building 31st Fl Rachadaphisek Rd Huaykwang Bangkok 10320 Tel 02 6933407 Fax 02 6933423 E PHILIPPINES SALES OFFICE National Panasonic Sales Philippines NPP 102 Laguna Boulevard Laguna Technopark Sta Rosa Laguna 4026 Philippines Tel 02 520 3150 Fax 02 843 2778 181199 Printed in JAPAN
100. LE C 0000 Sample program source file STARTUP ASM Sample program startup routine source file To start up the C source code debugger input the following as an MS DOS command PICE103 NOTARGET 4 When this command is input the C source code debugger startup screen ap pears Specify NOTARGET when there is no target system connected This example assumes that there is about 500KB of available space 7 in main memory Debugging Tutorial 4 Characteristic C Source Code Debugger Functions and Their Usage 37 The upper portion of the screen the Code window displays either the C source code or a disassembled listing of the program 40000005 FF pi 40000006 FF pi 40000007 FF pi 40000008 F3AQ mov dO a a2 40000000A FB236FFE udf 2 191 d3 44000000E F99395 udf09 6B d3 40000011 D8 leq 40000012 76 mov a2 d1 40000013 6A mov d2 a2 40000014 6F mov d3 a3 40000015 5F53 mov 53 sp a3 40000017 D2 lge 40000018 F366 mov d2 d1 a2 40000010 8E mov d3 d2 4000001B FC4BFC90B108 movbu _ 8B19QFC a3 d2 PICE 10300 Ver 3 6b Release 1 1 1 Copyright c 1996 Panasonic KMC Sub process segment SAH 99 Kbyte Monitor Program Yersion 0 01 I Evachip Number 103000 gt File WOptHing SrcSWASearch Go WInspctfj Come BSglStpy Breakilijrncs tpl ky The lower portion of the screen the Command window is used to execute commands input through the keyboard and to display the results of the execution
101. LES OFFICE Panasonic Industrial Europe G m b H PIEG Munich Office Hans Pinsel Strasse 2 85540 Haar Tel 89 46159 156 Fax 89 46159 195 E U K SALES OFFICE Panasonic Industrial Europe Ltd PIEL Electric component Group Willoughby Road Bracknell Berkshire RG12 8FP Tel 1344 85 3773 Fax 1344 85 3853 E FRANCE SALES OFFICE Panasonic Industrial Europe G m b H PIEG Paris Office 270 Avenue de President Wilson 93218 La Plaine Saint Denis Cedex Tel 14946 4413 Fax 14946 0007 E ITALY SALES OFFICE Panasonic Industrial Europe G m b H PIEG Milano Office Via Lucini N19 20125 Milano Tel 2678 8266 Fax 2668 8207 E HONG KONG SALES OFFICE Panasonic Shun Hing Industrial Sales Hong Kong Co Ltd PSI HK 11 F Great Eagle Centre 23 Harbour Road Wanchai Hong Kong Tel 2529 7322 Fax 2865 3697 Matsushita Electronics Corporation 2000 E TAIWAN SALES OFFICE Panasonic Industrial Sales Taiwan Co Ltd PIST Head Office 6th Floor Tai Ping amp First Building No 550 Sec 4 Chung Hsiao E Rd Taipei 10516 Tel 2 2757 1900 Fax 2 2757 1906 Kaohsiung Office 6th Floor Hsien 1st Road Kaohsiung Tel 7 223 5815 Fax 7 224 8362 E SINGAPORE SALES OFFICE Panasonic Semiconductor of South Asia PSSA 300 Beach Road 16 01 The Concourse Singapore 199555 Tel 390 3688 Fax 390 3689 E MALAYSIA SALES OFFICE Panasonic Industrial Company Malaysia Sdn Bhd Head Office PICM Tingkat 16B Menara P
102. LL command LIST command and NLIST command Macro Commands SALL Example 8 Macro Commands 233 Macro display suppression specification This command suppresses display of the commands within the macro command and of the prompt in the Command window The SALL command and the LALL command have opposite functions gt test sall 2E d 100 a gt gt test gt sall PSW 0000 00000100 gt gt IM 0 S 0 DO mov 2000 i a0 D7 16 Bl FO 00000000 D1 00000000 D2 00000000 D3 00000000 AO 00000000 Al 00000000 A2 00000000 A3 00000000 PC 80000000 MDR 00000000 LIR 40000000 LAR 00000000 SP 00000100 E7 79 FD 7B DE 1D D2 86 B7 8F 33 D3 s LALL command LIST command and NLIST command Macro Commands 234 M L S Display macros MLIST M LIST lt macro name gt M LIST gt lt macro file name gt These commands display the macros MLIST This command displays all of the macro names currently defined MLIST This command displays the macro body the contents of the macro defini lt macro name gt tion of the macro command specified by lt macro name gt MLIST gt This command writes the contents of all of the currently defined macros lt macro file name gt into the file specified by lt macoro file name gt This file can be loaded by means of the C source code debugger batch function lt command Example gt mlist Q
103. MPLE If the file extension is omitted from the file specification after the L com mand EX is assumed The Code window display now changes to a display of the STARTUP ASM source listing STARTUP ASM stack_end _TEXT SECTION CODE PUBLIC 1 _reset Program counter _ gt org START_VECTOR mov stack STACK_SIZE a mov a sp _start add 12 sp BSS _GBSS CLR mov _BSSEND BSS d1 PICE 10300 Ver 3 6b Release 1 1 1 Copyright c 1996 Panasonic KMC Sub process segment 873AH 99 Kbyte Monitor Program Version 0 01 Evachip Number 103000 gt 1 sample Dl File WOptting SrcShSearchi Go Inspct Come fSg1Stpe BreakdldFncS tpl The source line highlighted in yellow in the Code window indicates the line that is currently pointed to by the program counter PC register Debugging Tutorial Opening the Register window and Option window F2 Switching the Option window Ctrl F2 Closing the Register window and Option window F2 4 Characteristic C Source Code Debugger Functions and Their Usage 41 STARTUP ASH stack_end DO 00000000 AB 00000000 D1 00000000 A1 00000000 _TEXT SECTION CODE PUBLIC 1 D2 00000000 A2 00000000 D3 00000000 A3 00000000 reset org START_VECTOR mov stack STACK_SIZE a mov a sp _start add 12 sp BSS _GBSS CLR mov _BSSEND BSS d1 PICE 10300 Ver 3 6b Release 1 1 1 Copyright c 1996 Pa Sub process segment 873A
104. O WHILE macro Example test3 reset do while val sec 0 9 Macro command definition Macro Commands 228 i O R Macro control execution FOR lt command 1 gt lt expression gt lt command 2 gt lt macro body gt In the same manner as a macro command definition if FOR lt command 1 gt lt expression gt lt command 2 gt is input the macro input prompt is dis played and the system enters macro input mode Multiple commands and macros can be freely written in the lt macro body gt portion there is no limit on the number of commands that can be included except for the capacity of the macro buffer The input of lt macro body gt is terminated by inputting In the FOR macro lt command 1 gt is executed and then the value of lt ex pression gt is evaluated If the value is 0 the macro terminates if the value is not 0 lt macro body gt is executed from the beginning After lt macro body gt is ex ecuted lt command 2 gt is executed and then lt expression gt is evaluated again lt macro body gt and lt command 2 gt are then executed in turn until the value of the expression is 0 In the FOR macro if the value of lt expression gt is 0 the first time it is evaluated the commands in lt macro body gt are not executed even once Example fort for j 0x100 j lt 0x200 j j 1 e j ff This macro command w
105. OT one s complement Logical NOT 2 Binary operators Priority Operator Description 1 7 Multiplication Division Modulo operation remainder 2 Addition Subtraction 3 gt gt Right shift lt lt Left shift 4 lt Compare operation 1 if right side is greater than or equal to left side 0 otherwise gt Compare operation 1 if right side is less than or equal to left side 0 otherwise lt Compare operation 1 if right side is greater than left side 0 otherwise gt Compare operation 1 if right side is less than left side 0 otherwise 5 Compare operation 1 if right side is equal to left side 0 otherwise l Compare operation 1 if right side is not equal to left side 0 otherwise 6 amp AND 7 A XOR 8 OR 9 KE Logical AND 10 ll Logical OR Rules for Using Dialog Commands 7 Dialog Commands 105 The numerals in the left hand column indicate operational priority If adja cent operators have the same priority the expression is evaluated from left to right The priority within an expression can be changed by the use of parentheses however In addition compare operators and logical AND and logical OR operators are provided for conditional decision processing in macros FOR and WHILE com mands etc and conditional decision processing commands IF command etc In addition the compare operators and logical AND and logical OR i
106. Pana Series The One toWatch for Constant Innovation Making the Future Come Alive MICROCOMPUTER MN10300 MN10300 Series C Source Code Debugger User s Manual Pub No 13130 022E Panasonic PanaXSeries is a trademark of Matsushita Electric Industrial Co Ltd Sun Sun OS SPARC station2 and OpenWindows are registered trademarks of Sun Microsystems Inc USA UNIX is a registered trademark of X Open Company Ltd in the USA where it is licensed and in other countries The other corporation names logotype and product names written in this book are trademarks or registered trademarks of their corresponding corporations d 2 3 4 Request for your special attention and precautions in using the technical informaition and semiconductors described in this book An export permit needs to be obtained from the competent authorities of the Japanese Government if any of the products or technologies described in this book and controlled under the Foreign Exchange and Foreign Trade Law is to be exported or taken out of Japan The contents of this book are subject to change without notice in matters of improved function When finalizing your design therefore ask for the most up to date version in advance in order to check for any changes We are not liable for any damage arising out of the use of the contents of this book or for any infringement of patents or any other rights owned by a third party No part of t
107. S Help file not found This error message appears when an attempt was made to use EMS memory as a work area with the FEMS or BEMS option but either the EMS driver could not be found or there was not enough free space in the EMS memory Check the EMS related settings in the CONFIG SYS file The PT103 HLP file was not found Place the PT103 HLP file either in the cur rent directory or in the directory specified by the environment variable HELP The Emulator is operating abnormally free run timer error The timer in the in circuit emulator is not operating properly If this error occurs contact us at the address indicated at the end of this manual The Emulator is operating abnormally profile address latch error The profile address latch function get execution address function in the in cir cuit emulator is not operating properly If this error occurs regardless of whether or not the target system is operating correctly contact us at the address indicated at the end of this manual The emulator controller power is off The in circuit emulator could not be started up because the emulator controller power is off Turn the power adapter on and restart the C source code debugger C Source Code Debugger Error Messages 250 The target system power is off The target system power is off Turn the target system on and restart the C source code debugger When starting up the C source code debu
108. S and is useful for repeated execution of a predetermined sequence of operations However unlike DOS batch processing it is not possible to pass parameters to this function If the ability to pass parameters is needed use a macro function In addition if the INIT MCR file is located in the current directory when the C source code debugger is started up the C source code debugger loads and ex ecutes automatically This file is equivalent to the AUTOEXEC BAT file in DOS In other words by writing any preprocessing such as loading the user pro gram essential for program debugging in this file it is possible to automatically execute that processing when the C source code debugger starts up The batch function is useful if used for macro definition registration Al though macros can be defined from within the C source code debugger it is also possible to use a text editor to write large macros outside of the C source code debugger and then use the batch function to register those macros in the C source code debugger It is also possible to use the MLIST command to load macros written in a file Batch execution can be interrupted by pressing the ESC key gt lt mil mcr e MLIST command and macro definition Other Commands MEM M E M lt number gt lt character string gt MEM MEM M E M lt number gt lt character string gt MEM Example 7 Dialog Commands 215 On the fly NO INFLUENCE
109. S function Display register delete memo These commands are used to display register and delete memos The contents of the memos are displayed in the Memo window one of the Option windows A character string set by the MEM command can also be called up by the CTRL SHIFT function key sequence This command registers the specified character string in the memo indi cated by lt number gt If lt character string gt is omitted any memo registered in the specified memo number is deleted This command deletes all of the memos that are currently registered This command displays the contents of the memos that are currently reg istered gt mem1 Panasonic gt mem2 PanaX gt mem3 MN10300 gt mem MEMO 1 Panasonic MEMO 2 Panax MEMO 3 MN10300 gt mem2 gt mem MEMO 1 Panasonic MEMO 3 MN10300 gt mem gt mem gt Chapter 6 section 2 7 for the Memo command Other Commands 216 On the fly NO INFLUENCES function N Change input format base N soj16 This command changes the base for parameters input in Dialog com mands to either decimal or hexadecimal When the C source code debugger starts up the base is 16 N 10 Changes the input base to 10 N 16 Changes the input base to 16 Example gt N 10 Other Commands 7 Dialog Commands 2 17 On the fly NO INFLUENCES nee O PTI O N Set option This command
110. SW 0000 AO 00000000 Al 00000000 A2 00000000 A3 00000000 PC 8000007D MDR 8000007A LIR 40000000 LAR 00000000 SP 00001FE0 Total number of Gent 60 mov 200C _sec d0 samples gt gt prof Number of k k Profile samples within Total sampling count 36784 user program _ User sampling count 36784 100 number used by System sampling count 0 0 0 the debugging program No Addr Name Percent Sum Samples 8000007D _Ocnt60 44 9 44 9 16541 8000004B _Omain 31 0 75 9 11407 80000073 _Odisplay 24 0 100 8836 Number of samples X within in circuit gt prof clr emulator time gt prof used by the system Sampling was not performed gt prof off gt Performance Measurement 166 Data Display Change EEEN The C source code debugger can easily display and change memory register and symbol data D command This command displays a dump of the contents of memory The display can be modified by changing the display base number etc E command This command changes a value stored in memory to the specified value C command This command compares the specified areas in memory F command This command fills the specified area in memory with one repeated value M command This command performs a block transfer of the specified area in memory S command This command searches for data within the specified area memory R command This command display
111. St Fnc tp akg Pressing the function key corresponding to the desired character string causes that character string to be displayed input in the input portion of the Command window Pressing these keys specifies a memo character string The character strings 1 through 10 that were set by the MEM command can be called up by pressing CTRL SHIFT function key CTRL SHIFT F1 calls up memo character string 1 CTRL SHIFT F2 calls up memo character string 2 and so on up to CTRL SHIFT F10 which calls up memo character string 10 e MEM command Window commands Shift F10 Option Esc Stop Ctrl C Ctrl S Ctrl P Help 6 Window Commands 83 2 8 Other window commands Pressing these keys displays and changes the various options If these keys are pressed the Option display window opens and the statuses of the various options are displayed The T and 4 keys can be used to select an option item the selected item is highlighted and the and lt keys can be used to change the contents of the option Press the ESC key or the Return key to close this window OPTION command This key is used to forcibly break the program this is running to stop a macro command or batch function that is currently executing to stop a search to exit the Inspect Help or Option menus etc The ESC key can be used to interrupt or terminate the majority of Window com mands These keys h
112. ab v OxB Vertical tab YF 0x5C Yen symbol nnn nnn Octal 8 bits xnn nn Hexadecimal 8 bits Rules for Using Dialog Commands E Operators 7 Dialog Commands 109 The same operators as those used in C are supported However operators other than the operator substitution operation cannot be used with floating point decimals The priority ranking of the operators is indicated below Priority ranking Operator a 2 3 4 5 6 7 8 9 10 1 12 13 14 15 16 Function n Array n n n n gt n n n amp n n n n n n n sizeof n cast n n n n n n n n n n n n lt lt n n gt gt n n gt n n lt n n gt n n lt n n n n n n amp n n n nin n amp amp n niin nn nn nn n n n n n n n n n n n n n lt lt n n gt gt n n amp n n n nl n n n The number indicated in the left hand column indicates the priority ranking of the operators listed on the right The smaller the number the higher the priority ranking If adjacent operators have the same priority the expression is evaluated from left to right An exception is the substitution operators priority ranking 15 which are evaluated from right to left The priority within an expression can be altered through the use of parentheses Rules for Using Dialog Commands 110 E Expressions with secondary effects Substitutio
113. abulates the access status Performance Measurement 7 Dialog Commands 16 1 On the fly NO INFLUENCES function S M Set release sample area S M lt address gt S M B lt address gt S M C lt number gt SMW SM The commands select the RAM monitor function sample area The sample area consists of 32 blocks consisting of 64 bits 8 bytes each for a total of 256 bytes starting from lt address gt CTRL 5 can be used to switch between the RAM monitor screen and the C source code debugger screen To change the sample area while the RAM monitor is displayed press the SHIFT arrow keys The sample area can be changed only while the user program is running Press CTRL 5 again to return to the debugger screen While the user program is running the memory data area particularly the RAM area is sampled at a constant interval allowing the user to see changes to the data This is the RAM monitor function This function naturally does not affect the execution of the user program Only data accessed in memory is moni tored and displayed The RAM monitor can display changes in data either in hexadecimal or in bit a underscore _ indicates an address that has not been accessed S M lt address gt This command specifies the starting address of the sample area S M B lt address gt This command specifies an address to be displayed in bit units S M C lt number gt This command clears an address displayed in bit unit
114. ad dress S to frame address E is displayed C This command erases frames indicated by from the screen If this command is executed again is displayed Q This command quits the trace display mode e If less than 16K steps were traced the first instruction after trace L start might not be traced e If a trace full break was used several instructions prior to the stopping of the user program might not be traced Other Hardware related Commands 150 Example gt bp sec rw 5 d gt g gt so IM 0 S 0 DO 00000005 D1 00000000 D2 0000001C D3 00000014 PSW 0000 AO 00000000 Al 80000098 A2 FFFFF870 A3 20000000 PC 8000005F MDR 80000055 LIR 02A544F0 LAR FFFFFOEO SP 00000FF8 MDRO 00800000 mov 80C _sec d0 gt td Sampled Frame Number 16384 xd Q Frame ROM_A RAM_A Data R W 00000 80000015 00000EE4 00001 00002 e 1000 Frame ROM_A RAM_A Data R W 01008 E 80000017 00000EFC 01009 80000017 00000EFC 01088 JE 80000013 00000EFC u 2000 Frame Addr Mnemo Opr RAM_A Data R W STARTUP ASM 0058 mov d0 a0 02048 JE 80000013 mov d0 a0 00000F14 STARTUP ASM 0059 inc4 ad 02049 E 80000014 inc4 a0 00000F18 00000000 wr Frame Addr Mnemo Opr RAM_A Data R W STARTUP ASM 0060 add 4 dl 02050 E 80000015 add 4 dl 00000F18 02051 80000015 00000F18 EC q gt Other Hardware related Commands 7 Dialog Commands 151 Dump NO INFLUENCES on the fly Disasse
115. alt execution of a long display operation initiated by the D command etc or interrupt the repeated step execution of a program initi ated by the T or P command These keys are used in order to pause the Command window display The display resumes when any other key is pressed These keys direct the Command window display output to the printer as well These keys are used to toggle printer output on and off This key saves the debugging screen and displays a help screen When this key is pressed the help screen for the previous Dialog command is displayed For example if an input error was made in a Dialog command press ing this key displays the help screen for that command If this key is pressed while using the Inspect function or String Select the help screen for the respective local command is displayed Press the ESC key to exit the help screen and return to the debugger screen e HELP command Window commands 84 Opening closing the Inspect window F6 Inspct Ctrl page 89 Data Reference Functions SSS The data reference and modification functions are frequently used in conjunc tion with the execution break functions The data reference functions include the Inspect Watch and View functions are the most powerful feature of the C source code debugger The Inspect function in particular can be used to reference and modify data structures simply by using the cursor to specify var
116. an be relived by mapping the space from 0x80000000 to Ox8001FFFF 128K with a single block as shown in Fig C Finally note that with the In circuit Emulator it is not possible to map internal RAM or special registers to emulation RAM since these use the microprocessor s internal resources t5 MAP EX Command C Source Code Debugger Overview 1 C Source Code Debugger Overview 9 Trace Function This function makes it possible to view the execution path of the user program The data that is traced includes execution addresses data addresses data values and the bus status Data addresses and data values can be switched between the microprocessor s internal bus the CPU core bus and the external bus The fol lowing modes can be selected to establish the trace storage conditions and the trace halt conditions Trace storage conditions 1 Normal trace default In this mode all of the microprocessor s execution cycles are traced Up to 16K steps can be traced 2 Branch trace In this mode only branch instructions are stored in trace memory and the software compensates for the portions between branch instructions As a re sult this mode makes it possible to trace longer than in normal mode How ever no tracing information is displayed from the time when tracing starts until the first branch instruction is encountered 3 Conditional trace In conditional trace mode tracing is performed only while a spe
117. and C Source Code Debugger Error Messages 9 Appendix 257 No further events breaks can be set Up to four execution address events can be set up to four data events each can be set in internal data RAM and the external memory space respectively and a fur ther 8 events total can be set These numbers cannot be exceeded The same applies to hardware breaks Event break was not set This error occurs if a nonexistent break number was specified or if a software break was specified in a location that calls for a hardware event break Event status does not change Hardware events breaks cannot be set or changed while the microcontroller is in a state where it does not operate such as STOP HALT or SLEEP Could not map to the specified area An attempt was made to map emulation memory extend memory to an area inter nal RAM special register area etc that can not be mapped Could not map due to insufficient mapping blocks Could not map due to insufficient emulation blocks An attempt was made to map in excess of 8 emulation blocks Could not map due to insufficient emulation memory An attempt was made to map emulation memory in excess of the memory capac ity installed in the in circuit emulator Changing mapping addresses to 4KB units Although mapping is performed in 4KB units if the addresses were specified in other than 4KB units the C source code debugger adjusts the addresses so that they are
118. ast operator as an example of how to use the command Proper use of the cast operator makes it possible to display the contents of memory in an easy to understand format Example gt d sec O0000000C 08 00 00 00 03 00 00 00 00 00 00 00 00 00 00 00 eee eee eee gt sec int 2 0000000C 8 3 gt d 0000001C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ee eee eee gt Chapter 6 section 3 1 Inspect function Watch Display 7 Dialog Commands 199 On the fly NO INFLUENCES function i Delete watch Y idisto This command deletes the watch registrations set with the W command If lt list gt is specified the watch registrations with the specified numbers are deleted If was specified all watch registrations that were set are deleted and the Watch window is closed Yo Ty 2e Ta In the above example watch registrations 1 2 and 7 are deleted Y al In this example all watch registrations are deleted and the Watch window is closed b W command Watch Display 200 System Control Commands ENE The Dialog commands listed below are provided for system control such as quitting the C source code debugger and for help subprocesses and history Q EXIT command This command quits the C source code debugger HELP command This command displays a help message command This command executes a subprocess
119. ation Hexadecimal display Watch Display 196 W W B Byte 8 bits display W W Word 16 bits display W D Double word 32 bits display WA ASCII display 8 bit units WS 4 byte real number short floating point display W C expression display Example gt W SEC gt W SEC 1 gt W 100 5 gt Y command Reference Some C variables such as local variables have a limited scope range of use As a result some variables cannot be evaluated de pending on the position of the program counter In case such as when local variables are assigned to registers automatically by the C compiler the value of the C expression in the Watch window changes to Watch Display 7 Dialog Commands 19 7 Global variable NO INFLUENCES On the fly Local variable CANNOT BE USED function Evaluate C expression VAL lt C expression gt lt function name gt VAL lt variable name gt lt function name gt lt C expression gt lt function name gt lt variable name gt lt function name gt V A L lt C expression gt lt C expression gt V A L lt variable name gt lt variable name gt This command displays the contents of a C expression or a variable Local variables can be displayed by specifying lt function name gt for the func tion in which that local variable is used If lt function name gt is omitted the current function is assume
120. ation RAM 0x80000000 Extended RAM AF Total no more than 1MB 0xC0000000 Access prohibited 7 C Source Code Debugger Overview 1 C Source Code Debugger Overview 7 2 Emulation RAM This is memory RAM that emulates memory extended RAM in the target The In circuit Emulator has two sets of 512K of emulation RAM for a total of 1MB One set is used for high speed dedicated memory and can operate with no wait cycles with an external bus cycle of up to 20MHz 50nsec The other set can operate with no wait cycles with an external bus cycle of up to 12MHz approximately 83nsec Emulation RAM permits allocation of ranges of addresses blocks in the microprocessor s extended RAM space 0x80000000 to OXBFFFFFFF in ex tended mode and 0x40000000 to OxBFFFFFFF in processor mode When an address in the shaded portion of the extended RAM space in Fig A is ac cessed the emulation RAM in the emulator is accessed This allocation of emulation memory to a portion of the microprocessor s memory space is called mapping A continuous segment of mapped memory is called a block With this emulator a maximum of eight blocks can be mapped The size of one block can be selected as either 4K 8K 16K 32K 64K 128K 256K 512K or 1024K The address boundaries of blocks must coincide with boundaries for that unit of memory space For example if one block is 64K that block must fall on a 64K boundary in memory The aspect of the ma
121. ay each element is enclosed in brackets and as many items as can be displayed on one line are displayed Use the Y command of the Dialog commands to cancel a watch registration 1 int 2 sec A DO 00000002 AO 00000000 SAMPLE C D1 00000000 A1 00000000 D2 00000000 A2 00000000 D3 00000000 A3 00000000 cnt60 if sec 0 10 sec 0 0 sec 1 if sec 1 6 sec 1 0 init_data CN IM 0 S 0 DO 00000002 D1 80000000 D2 00000000 D PSH 0006 AG 00000000 A1 00000000 A2 00000000 A PC 80000076 MDR 80000073 LIR 8000007C LAR 00000000 S mov 200C d0 gt E i File WOpthing SrcSWASearch Co Inspctfj Come HSg1Stpk BreakigFncStp nd A local variable can be registered for watching only while the pro gram counter is pointing within the function in which the local vari able was declared The scope specification of the range over which the variable can be used of the local variable registered for watching is naturally limited to the function in which it was de clared Therefore once the program counter points outside of that function the display for the variable registered for watching changes to Static variables also have scope and so in the same fashion as local variables once the program counter points outside of that scope the display for the variable registered for watching changes to Data Reference Functions Viewing Ctrl F8 View Ctrl V 6 Window Comma
122. ble to nest up to 15 macros so that separate macros can be used as subroutines and expanded within other macros 4 Up to 10 parameters can be passed to a macro command 5 It is possible to define macro commands that use combinations of cursor con trol commands the PRINTF PF command etc to create formatted screen output and that use combinations of symbol definition functions to perform interactive processing Macro commands can be used in the same manner as the C source code debugger s internal commands In other words there is no special command that is needed in order to execute a macro command A macro command can be inter rupted by using the ESC key By using special symbols execution control commands can be used to make even more efficient debugging possible Some specific examples are shown be low testl bp sec w do g while __run_ while val sec 0 9 Macro Command Overview Example 8 Macro Commands 221 This macro sets a hardware break at the address assigned to the variable sec The 3rd through 7th lines form a do while loop and as long as the condition sec 9 that follows the do while loop is not met the G command is executed TEST2 bp 45 ti run g while __run if val sec 1 1 g if __run__ 1 ti jelse esc pf Forced break was executed In this example a break point is set in the 45th line first The
123. ccccecceeeeeeeeeeeceeeeseeeeseeeeeesnaeeeeaes 96 1 3 Symbols in the C source code debugger cecceeeeeeeeees 97 1 4 Numbers in the C source code debuggGe l cceieeeeees 100 1 5 Operational ExpreSSiONS cccsceeeeeeeeeeeeeeeeeeeeeeaeeeeeeeeeeas 104 1 6 Data Expressions at the C Language Level 0 c ee 106 Command Index 2 Program Loading EXecution eee ceeeeeeeeeeeeeeeeeeeeaeeeeeeenaaeeeeeeeaas 112 L LP Load executable file 00 0 2 eee ccceeeeeeecceeeeeeeceeeeeeseeeeeeenes 114 RD Read file into MEMOSY aeiae 115 WR Write toile cisseec acetate niin eases 116 T Single step execution of user program ceeeeeee 117 P Function step execution of user program s s s 119 G Execute user Program cccceeceeceeeeeceeeeeeeeseeeeeeeeeeeees 121 RESET Reset user MicroproCeSSor ccceeceeesteeeeeees 123 3 Event related Commands ceccececeeeeeeeeeeeeeeeeeeeaeseeeeeestaeeeeeeeee 124 EV Set display Vent risiini aieeaii saaniga 127 BP Set display break event 0 cccceeeeeeeesteeeeeeeeseeeeeenees 130 BPA Set AND break c cceecceeeeeeeeeeeeeeeseaeeeeeeeeseaeeesenaees 133 BPS Set sequential break eeccceeeeeesseeeeeeeeeetaeeesenees 134 BC EC Cancel break event iniisa 136 BD Temporarily disable break event eseese 137 lt Contents 4 gt BE Enable break event ssimic 139 4 Other Hardware related Commands
124. ccurs after the event condition is met the specified number of times The maximum setting is 256 if lt count gt is omitted is assumed Regardless of the setting of the N command the base of the count specification is decimal unless Ox is added to the value which makes the base of the count specification hexadeci mal When an event specified in the lt list gt occurs program execution is not halted instead all event flags are cleared the pass count and access count counters are initialized to O and the counts are restarted This setting is not allowed for AND breaks sequential breaks and software breaks When an event whose number is specified in the lt list gt occurs all events are initialized Event Related Commands 7 Dialog Commands 129 EV C 1 2 7 4 In the above example if any one of events 1 2 or 7 occur all events are initialized Reference The base used in lt list gt is assumed to be decimal regardless of the N command specification If Ox is added the base is hexadecimal EV This command displays the events that have been set Example gt EV MAIN gt EV CNT60 3 gt EV SEC 5 gt EV NO SADR EADR ST DATA SYMBOL SZ CNT BRK TRC DLY TS TE CLR E 1 80000039 EX _Omain 1 E 2 80000058 EX _cnt60 3 E 3 0000080C RW 05 l gt tm 3 gt ti max sl e2 gt ev NO Sadr Eadr st Data Symbol SZ CNT BRK TRC DLY TS TE CLR E 1 80000039 EX _main 1 E 2 80000058 EX _cnt60 3 ia E 3 0
125. ce and ar chival purposes To copy the disk use the DISKCOPY command or COPY command in MS DOS Files on the floppy disk 1 PICE103 EXE 0 C Source Code Debugger 10300 main pro gram 2 PINS103 EXE Environment setting utility Installer 3 ENV103 TXT oo Model definition file 4 PICE103 MAC 0 Macro instruction definition file 5 PICEI03 MES 0 00 00 Message file 6 PTIOSHLEP iieis C Source Code Debugger 10300 help file 7 MONI03 EX 0 cce In circuit Emulator Monitor Program File 8 SAMPLE EX oe Executable sample program file 9 SAMPLE C ernennen Sample program source file 10 STARTUP ASM Sample program startup routine source file Descriptions of Each Device Chapter 3 Connection and Booting 1 Interface Board Installation 2 Connection Procedure 3 Host Computer Settings 4 Power ON OFF 22 Installing the Interface Board The interface board is installed in the host computer as described below Set the switches on the interface board before installing it in the host computer mw Chapter 9 section 2 Interface Switch Settings 1 1 Installation in the PC 9800 Series 1 Before beginning turn the computer off 2 Remove the cover from an expansion slot on the rear of the computer 3 Connect a 34 wire flat cable to the connector CN2 on the top side of the interface board 4 With th
126. ce code debugger could not be started up because the Monitor program is the wrong version Copy the Monitor program file that is suited to this Debugger either into the current directory or into the directory specified by the environment variable PATH C Source Code Debugger Error Messages 9 Appendix 251 Overvoltage from the target system was detected Turn off all power eliminate the cause of the problem and then restart Overvoltage from the target system was detected Turn off all power and then check the target system for any problems An error occurred in communications between the Emulator and the microcontroller Quit the Debugger Execute the INIT command Execute the RESET command Insufficient overlap area An error occurred in communications between the in circuit emulator and the microcontroller Check whether the microcontroller is hung up or if there is a problem in the target system A problem occurred in the in circuit emulator microcontroller or emulator con troller including cases where the power is off Quit the Debugger immediately Execute the INIT command to initialize the in circuit emulator because a problem occurred in the in circuit emulator Execute the RESET command to initialize the microcontroller because a problem occurred in the microcontroller There is insufficient overlap area free disk space Either use the B option to reduce the size of the debugging information a
127. cified event is true i 16 Kstep SS SS ae gt Flow of User program Evert tue Trace halt conditions 1 Trace continue mode default In this mode tracing continues until the user program halts even if trace memory becomes full When execution of the user program halts the last 16K steps remain as trace data 16 Kstep Flow of user program ee ene 4 execution starts User program stop C Source Code Debugger Overview 10 2 Trace full halt mode In this mode tracing begins when user program execution begins or re sumes and continues until trace memory is full 16K steps The user pro gram does not halt even if tracing is halted 16 Kstep Flow of user program PIINE p hisses et execution starts trace stop 3 Delayed trigger trace In this mode once a specified event occurs tracing halts after a specified number of steps This mode can be used to monitor the execution status of a program before and after the occurrence of an event 16 Kstep a delay count Flow of ie ee tse program Time measurement function This function measures the execution time of a user program The following modes are available 1 Continuous measurement mode This mode measures the time from the point when user program execution begins or resumes to the point when it halts 2 Partial measurement modes These modes measure the time fr
128. command clears the Command window HOME command This command moves the Command window cursor to the home position LIST command This command enables Command window display output NLIST command This command disables Command window display output BEL command This command sounds a beep TIME command This command displays the current time WAIT command This command causes the system to wait PRMPT command This command changes the prompt command This command specifies comments Other Commands 7 Dialog Commands 20 7 gt command This command outputs a log of the Command window display contents lt command This command performs batch processing MEM memo command This command displays registers and deletes memos N command This command selects the base used for parameters as either decimal or hexa decimal OPTION command This command sets options Other Commands 208 On the fly NO INFLUENCES function C L S Clear Command window screen CLS This command clears the Command window This command is used in combination with the HOME PRINTF PF LALL and SALL commands for display control within macro commands gt HOME command On the fly NO INFLUENCES function H O M E Move cursor to home position HOME This command moves the Command window cursor to the home position the left end of the command input line This comma
129. commands for example display the source files in the direc tory indicated by PANASRC If PANASRC is not set the source files in the current directory are displayed This specifies the directory where the C Source Code Debugger work files are stored In order to shorten the debugger s internal processing time it is recommended that this directory be set up in a RAM disk area If TMP TEMP is not set work files are created in the current directory Host Computer Settings 3 1 Starting up the Installer 1 Turn on the host computer 2 Connect the AC cable for the emulator controller to a 100V AC power source and turn on the power switch 3 When the computer is waiting for command input input PINS103 J Set the following items PICE Installer VER 3 02 ENV103 TXT VER 1 07 iL F PCHCIA I F Port Address CPU Select 103000 1030016 103002 103003 103005 Memory Mode SINGLE EXMODE PROCESSOR Bus Size 8BIT 16BIT 32BIT SP setting Reset Start 1090H 1 I F Board Select Select the interface method between the host computer and the in circuit emulator 2 I F Port Address Specify the I O address that was set by a rotary switch on the inter face board Use the arrow keys to specify the low order address and the SHIFT arrow keys to specify the high order address Rotary switch ms Chapter 9 section 2 3 CPU Select Use the arrow keys to select the CPU being used 4 Me
130. cseeecsaeeeccseecssaeesscsueeseaeeesesaeeeenees 260 5 1 Window Commands cccccccesseeceeeeesneeeeeesenueeeeeesntaeesesenaas 260 5 2 Dialog COMMANAS essiensa aaas 264 6 Supplement for the PC AT DOS V Version ccecceeeeeteteteteeteetteeteeeeees 273 6 1 Screen OPSratlONS sneer eieaa aarian aian eaa eaaa eben 273 6 2 Data Change Reference Commands cccccceeeesseeeeeeees 274 6 3 Process Control COMMANAS cccseceeeeeeeeeteeeeeeeeeetteeeeeeees 274 6 4 Shell COMMands ccecececeeeeeceeeeeseeeeeeeseeeeaeeeeseestaeeeeeseaaas 275 6 5 Other Window Commands ccccceeeeeeeeeeeeeeeeeeeeteeeeeeees 275 lt Contents 7 gt lt Contents 8 gt Symbols Alphabetic Chapter 1 C Source Code Debugger Overview 1 C Source Code Debugger Overview 2 Usage Precautions C Source Code Debugger Overview C Source Code Debugger Operating Environment Host computer PC 9800 Series PC AT Series DOS V compatible machine expansion slot Memory At least 500K At least 500K OS MS DOS Ver 3 x or later MS DOS Ver 6 2 Slot One standard personal computer One standard personal computer expansion slot Interface systems T O system T O system C Source Code Debugger Overview Overview 1 C Source Code Debugger Overview 3 Software Overview The C Source Code Debugger and the In
131. ction and the meaning of each element are explained below Intermediate title Header icon The shading of the icon varies according to the content of that section Debugging Tutorial r From overview to Summary This is an intro duction to the section in ques nna This section provides an overview of the debugging process and the operating startup methods of the C source code debugger from start to finish by actually using the tion ii C source code debugger to debug the sample program SAMPLE C Knowledge LK Tutorial of these operating methods combined with a knowledge of the window com Subtitl e L Command expla ee ens dialog commands will enable you to operate the C source code lebugger x M nation ain text 4 1 Starting up the C source code debugger Ly Appendix Confirm that the current directory contains the following files If one of these files is not contained in the current directory copy the file from the master disk PICE103 EXE C source code debugger 10300 PINS103 EXE Environment setup utility ENV103 TXT Type definition file PICE103 MAC Macro command definition file Keys PICE103 MES Message file PT103 HLP Jelp file for the C source code debugger 10300 These indicate the MON103 EX In circuit emulator monitor program file SAMPLE EX Executable file of the sample program keys that are to be SAMPLE C Sample program source f
132. cution address event is assumed if lt data gt is not specified Event Related Commands 128 E V C lt list gt lt data gt C B W D N lt count gt Specify the data for a data event If omitted the data is ignored and only the address becomes the event target The lt data gt can be specified in binary format if the symbol is added at the start of the data If the symbol is omitted hexadecimal specification is assumed In addition as the examples show be low it is also possible to include masked bit specifications Specify X to indicate don t care for a bit The high order bits are also don t care 10xx The following values satisfy the condition 1000 1001 1010 and 1011 CORK i Any value from C500 to C5FF satisfies the condi tion Symbols can not be used in the lt data gt specification Specify the data access width for a data event 8 bit data B 16 bit data W or 32 bit data D If omitted the access width mode is no specific size don t care Specifies that the event condition is met when the data accessed in the data event did not match the value specified by lt data gt If this specification is omitted the event condition is met when the data does match In the case of an execution address event specify the pass count In the case of a data event specify the access count The event o
133. d These commands display the expression type and its value These commands display the variable type variable name and variable value The and wild cards can be used in lt variable name gt Matches all patterns Matches all single characters For example if the command ab is input all variables that begin with ab are displayed When displaying a C expression or variable that has multiple elements such as an array the elements are enclosed in rounded brackets and as many elements as will fit on one line are displayed Watch Display 198 The VAL command can use substitution operators and op 1 erators with secondary effects such as or If an operator with a secondary effect is used with the com mand the message Operator with possible harmful side effect cannot be used is displayed and an error is gener ated e When only referencing data do not use the VAL command use the command e When using an operator that has a secondary effect such as changing data use the VAL command Doing so will eliminate inadvertent changes to variables in a program resulting from mis takes in the evaluation of C expressions for example mixing up ci and so e In the VAL command and the command all variables con tained in a C expression must be in a usable state The following example uses a c
134. d In other words once the user program has begun executing no other commands will be accepted until ex ecution stops The screen is also not updated This op tion is useful when starting the next command after user program execution stopped within a macro Reference e While a program is executing the message Target executing is displayed at the division between the Command window and the Code window e The C source code debugger has a built in time measurement function that measures the amount of time that was needed for user program execution Tl command Program Loading Execution 122 Example User program execution is not possible when the microprocessor is in STOP HALT or SLEEP mode In this case either execute the RESET command or else use the E command to overwrite the microprocessor s CPUM register and then execute the user pro gram gt RESET gt G CNT60 gt Z IM 0 S 0 DO 0X00000000 D1 0x00000000 D2 0X00000000 D3 0X00000000 PSW 0X0001 AO 0X00002000 Al 0X00000000 A2 0X00000000 A3 0X00000000 PC 0X80000056 MDR 0X80000053 LIR 0X40000000 LAR 0X00000000 SP 0X000000EC _CNT60 MOV OX0C _SEC DO gt gt G gt RESET gt G MAIN CNT60 gt Z IM 0 S 0 DO 0X00000000 D1 0X00000000 D2 0X00000000 D3 0X00000000 PSW 0X0001 AO 0X00000000 Al 0X00000000 A2 0X00000000 A3 0X00000000 PC 0X80000056 MDR 0X80000053 LIR 0X40000000 LAR 0X0000
135. d by the value the left end of the field or the right end if the left justification specification was made with the minus sign is filled out with blanks Conversion characters amp d Converts the parameter to a decimal number amp u Converts the parameter to an unsigned decimal number amp x Converts the parameter to a hexadecimal number amp o Converts the parameter to an octal number amp c Handles the parameter as a character amp s Handles the parameter as a character string Data Display Change 7 Dialog Commands 181 Reference The symbol amp is used as the equivalent of the conversion start character in the printf function in C e The field format can be specified between amp and the conversion character d c s etc e Just as in C the symbol is used as an escape character Example gt sec int 2 0000200C 7 3 gt pf amp x sec 200C gt pf amp x sec 7 gt pf amp x sec 10 17 gt pf amp x sec amp 4 4 gt pf amp x sec amp 8 amp 0 Se CN IM 0 S 0 DO 00000007 D1 00000000 D2 00ABCD EF D3 00000000 PSW 0006 AO 00002000 Al 00000000 A2 00000000 A3 00000000 PC 0x80000094 MDR 8000007A LIR 40000000 LAR 00000000 SP 00001FEO jmp 800000C3 gt pf amp x mdrreg 8000007A gt Data Display Change 182 On the fly
136. d from within a macro command In other words macro commands can only be defined in the C source code debugger command input mode when the gt prompt is displayed Reference The user can change the gt prompt to a different character by us ing the PRMPT command While this command can be used to define simple macro commands after the C source code debugger has been started up large macro commands can be more easily described by using an editor beforehand and then using the batch function for macro registration In addition in order to save macro commands that were defined within the C source code debugger it is possible to use the MLIST command to write the mac ros to a file Macro Commands 224 Example gt TEST1 bp sec ex do g while __run__ 2 while val sec 0 9 2 gt lt command and MLIST command Notes on macro description 1 An error will result if the description 0 is made within a L macro Example of a description that generates an error test while _ _ run repeat wi0 wil wi2 d 0 In order to implement 0 in a macro use Example of a description that does not generate an error repeat wi0 wil wi2 d 0 2 In the case of lt macro command gt lt parameter list etc gt a space between the macro command and the will prevent the macro from being properly reco
137. d memor 5 12K 2560K maximum high speed memory 512K low speed memory 2048K Break functions Execution address breaks Data breaks 4 events maximum Conditions area specification pass count specification 4 events maximum Conditions area specification pass count specification bit mask read write access specifi cation data width specification match no match specification AND breaks Available Sequential breaks 8 levels Trace full breaks Available External breaks None Trace functions Trace memory 16K steps capacity Data acquired through tracing Trace mode Execution address data address data bus status information Normal mode branch trace mode event condition trace mode Timer functions Measurement mode Time measurement resolution Continuous measurement mode maximum minimum execution time measurement mode Switchable among 25ns 50ns 100ns Trigger output Trigger outputs 8 signals function RAM monitor Sample memory 256 bytes function Display mode Dump list mode Bitmap mode Performance Profile Execution ratio display measurement measurement function Clock OSC1 Target side separate excitation only xI Target side separate excitation only In circuit Emulator Specifications 9 Appendix 241 1 2 Electrical Specifications Item Rating Emulator and probe supply voltage 0 5 to 3 6V Trigger output voltage 0 3 to 3 6V
138. de one instruction at a time Subroutines functions are also executed as one step Function step execution G command This command executes the user program RESET command This command resets the microprocessor Program Loading Execution 7 Dialog Commands 113 The screen is updated to reflect the changes in status caused by the execution of each command The position currently pointed to by the program counter is highlighted in yellow on the Code window The current register contents are displayed in the Register window The contents of the Watch window and the Option window are also updated to reflect any changes in status Program Loading Execution 114 L L Load executable file L lt file name gt LP lt file name gt These commands load an executable file an EX format file into memory either emulation memory target memory or internal instruction RAM A pe riod is displayed in the Command window while the file is being loaded the number symbol is displayed while the debugging information is being pro cessed Press the ESC key in order to interrupt a file load operation while it is in progress A message asking whether to abort or continue then appears If con tinue is selected the loading operation continues from where it was interrupted L lt file gt 1 Loads an executable file If the file includes debugging information symbol in
139. do so in the reverse sequence Emulator Control ler target system and then host computer Power On Off 30 Chapter 4 Characteristic C Source Code Debugger Functions and Their Usage 1 Overview of Window Display 2 Debugging Work Flow 3 Creation of Executable Files 4 Debugging Tutorial Overview of Window Display The C source code debugger provides five windows Watch Code Com mand Register and Option that display information that is required for debug ging work Chapter 6 1 Window Displays 1 int 2 sec DO 00000002 AB 00000000 SAMPLE C D1 00000000 A1 00000000 D2 00000000 A2 00000000 D3 00000000 A3 00000000 cnt60 if sec 10 sec 0 Q sec 1 if secl1 6 7 sec 1 0 5 init_data CN IM 0 0 DO 00000002 D1 00000000 D2 00000000 D PSW 0006 AG 00000000 A1 00000000 A2 00000000 A PC 80000076 MDR 80000073 LIR 8000007C LAR 00000000 S mov 200C d0 l SglStp FncS tpl k3 1 Watch window Displays user specified variables and the contents of memory 2 Code window Displays source code or a combination of assembly and source code 3 Command window Displays and allows input of dialog commands key input macros 4 Register window Displays the contents of the registers and the status of the flags 5 Option window Displays either the Memo Back Trace Stack
140. dresses in units of 8 bits 16 bits or 32 bits When changing the data with a real number the contents of memory at the specified addresses are replaced with a 4 byte real number Option Use When omitted lt address gt Start address for change Starts from the next address that follows the address used for the last E command lt data gt Data values to be written Enters data input mode displays the specified address and the current up to 16 values memory contents in ASCII octal decimal or hexadecimal and waits for the new data to be input E EB Byte 8 bits change EW Word 16 bits change ED Double word 32 bits change ES 4 byte real number short float change Data Display Change 170 Reference Data input mode rules 1 2 3 4 After the contents of memory at the specified address are dis played the function enters data input mode Up to 16 data val ues delimited by commas can then be input With the E com mand it is also possible to input a character string of up to 16 characters enclosed by single quotation marks To proceed to the next address without making any changes simply press the Return key The next address and the contents of that address are then displayed and the function enters data input mode To return to the previous address input a minus sign The previous address and the contents of that addrss are then displayed and the func
141. ds 115 R D Read file into memory R D lt file name S HEX gt RD lt file name gt lt address gt R D lt file S HEX gt This command loads the specified data or program in either Motorola S format or Intel HEX format If the file extension is S the file is treated as a Motorola S format file if the file extension is HEX the file is treated as an Intel HEX format file R D lt file gt lt address gt This command loads the specified data or program at the specified ad dress in binary format Specify a file extension other than S or HEX A EX format file cannot be specified E Example gt rd sample s Read SAMPLE S 80000000 80000FFF Complete gt WR command and L command Program Loading Execution 116 W R Write to file WR lt file name gt lt address S gt lt address E gt This command writes the contents of memory from lt address S gt to lt ad dress E gt to a file The file name extension can be used to select either Motorola S format Intel HEX format or binary format Extension File format g HEX Motorola S format Intel HEX format Other than S or HEX Binary format A EX format file cannot be specified E Example gt wr sample s 80000000 80000fff Write SAMPLE S at 80000000 80000FFF gt s L command and RD command Program Loadi
142. e The base used in lt list gt is assumed to be decimal regardless of the N command specification If Ox is added the base is hexadecimal Event Related Commands 136 Hardware break NO INFLUENCES On the fly Software break INFLUENCES function E C C Cancel break event BC lt list gt EC lt list gt These commands cancel software break hardware break events that were set by the EV command and BP command The BC command can be used to cancel software breaks and hardware events breaks The EC command can only be used to cancel hardware events breaks If lt list gt is specified the break events with the specified numbers are cancelled If is specified all break events that were set are cancelled BC 1 2 7 4 In the above example break events 1 2 and 7 are cancelled BC uJ In the above example all break events are cancelled If a cancelled event is used in an AND break a sequential break as a trace event or as a time measurement event these functions are also cancelled Example gt BP NO SADR EADR ST DATA SYMBOL CNT COMMAND E 1 80000029 SF _MAIN 1 E 2 00000100 RW OXXXX100 1 E 3 00000000 RW _I 1 E 4 80000056 EX _CNT60 1 gt BC 1 4 gt BP NO SADR EADR ST DATA SYMBOL CNT COMMAND E 2 00000100 RW 0XXXX100 1 E 00000000 RW _I 1 gt BC 2 gt BP NO SADR EADR ST DATA SYMBOL CNT COMMAND E 3 00000000 RW _I 1
143. e components on the board facing up align the board with the card guide grooves and then push the board firmly into the slot until it clicks into place Then pull gently on the board to make sure that it does not come out Installing the Interface Board 3 Connections and Startup 23 1 2 Installation in the PC 98 NOTE Series A a 1 Before beginning turn the computer off 2 Tighten the two screws on the interface board and then pull gently on the board to make sure that it does not come out 3 Connect a 34 wire flat cable to the connector CN2 on the interface board A z 1 3 Installation in the PC AT DOS V Series 1 Before beginning turn the computer off 2 Remove the top cover 3 With the board s connector facing down push the connector into the connector inside the computer until the connector is fully seated Then pull on the board gently to make sure that it does not come out 4 Connect the 34 wire flat cable to the connector on the interface board Connection Procedure 24 Connection Procedure The host computer is connected to the Emulator Controller via a 34 wire flat cable One of the connectors on the In circuit Emulator main unit is for connec tion to the Emulator Controller The In circuit Emulator also has a connector TRIGOUT for the trigger output 2 1 Connection Procedure After confirming that all devices are off perform the f
144. e expression has been input it is evaluated if no errors are found the value of the variable is changed to the new value During line input the history and line edit shell functions can be used Chapter 6 section 2 1 for the Inspect function Watch Display 7 Dialog Commands 195 Global variable NO INFLUENCES On the fly Local variable CANNOT BE USED function W Register watch W lt address gt lt count gt H D O WB 6 lt address gt lt count gt H D O WW lt address gt lt count gt H D O WD lt address gt lt count gt H D O WA lt address gt lt counts H D O WS lt address gt W C expression These commands register the specified memory contents or symbol for watching Just as with the D command the watch specification has a number of display patterns formats When an address or symbol is registered for watching its content is displayed in the Watch window in the specified format lt count gt specifies the number of data items to be displayed in one line up to a maximum of 29 0x1D WA only supports a maximum of 99 0x63 Option Use When omitted lt address gt Watch address Error lt count gt Number of data items 1 data item is displayed in the case displayed on one line of WA 32 characters are displayed H Hexadecimal display specification Hexadecimal display D Decimal display specification Hexadecimal display O Octal display specific
145. e line where breakpoint is set and press the F9 Break key The underline disappears indicating that the break has been deleted SAMPLE C init_data DO 00000008 AG 00000000 D1 00000000 A1 00000000 D2 00000000 A2 00000000 D3 00000000 A3 00000000 display cnt60 cnt60 if sec 10 secl 0 secl1 if secl1 6 secl1 PICE 10300 Yer 3 6b Release 1 1 1 Copyright c 1996 Pa Sub process segment 873AH 99 Kbyte Monitor Program Version 0 01 Evachip Number 103000 gt File WOptting SrcSWSearchi Go InspctH Come HSglStpk BreakilFncS tplAk Debugging Tutorial 46 Executing the program F5 page 70 Deleting all break events BC page 136 Program forced stop ESC page 71 Now we will execute the program by pressing the F5 Go key The program then stops at the 45th line of the source listing where we set our break software break Input the following from the keyboard BC i This command deletes all break events that were set with the dialog command Now press the F5 Go key again Because there is no break event set execu tion continues uninterrupted To interrupt program execution while a program is running press the ESC key This forcibly stops program execution Debugging Tutorial 4 Characteristic C Source Code Debugger Functions and Their Usage 47 4 6 Memory referencing The values of the variables sec 0 and s
146. e lists the options that can be specified for each break type Break type Execution address break Data break Software break lt address S gt J J lt address E gt O O lt status gt EX RW R W lt data gt O B W D O N O lt count gt O O C lt command gt O O O required O may be omitted blank may not be specified lt address S gt Specify a memory address or symbol When specifying a memory range specify the start address versus the end address in lt address E gt lt address E gt Specify a memory address or symbol Specify the end address versus the start address in lt address S gt lt status gt EX Execution address break RW Data break in read or write operation R Data break in read operation W Data break in write operation Omitted RW is assumed if lt data gt is specified EX is as sumed if lt data gt is not specified and lt address E gt or lt count gt is specified and a software break is assumed in all other cases Event Related Commands 7 Dialog Commands 131 lt data gt Specify the data for a data break If omitted the data is ignored and only the address becomes the break target The lt data gt can be specified in binary format if the symbol is added at the start of the data If the symbol is omitted hexadecimal specification is assumed In addition as the examples show be low it is
147. e the symbol init_data is defined gt y init data m gt v startup asm Displays the file startup asm in the Code window These commands display the specified source lines in the Code window This command displays the contents of the file specified by lt file name gt starting from the specified line If the lt line gt specification is omitted the first line of the file is assumed If lt file name gt is omitted the source file currently displayed in the Code window is assumed The V command also permits the specification of a file without source information In other words it is possible to load any ASCII file into the Code window in a similar manner to a text editor This command displays a source file containing the function specified by lt symbol name gt The F1 Window command can be used to open the file selection window and change the displayed file e If a file that has no source line information is opened with the V A command source level execution within the file and command input with source line specifications are not possible If the environment variable PANASRC has been set the V com mand displays the files in the directory specified by PANASRC If PANASRC is not set the V command displays the files in the current directory e Even if the line number is omitted the after the file name is required Chapter 6 Window Commands for the U command
148. ec 1 are the most important elements Referencing the contents of in the sample program To reference the value of sec input the following from the memory in the Command keyboard window D lt address gt D sec J t gt page 167 The following values are displayed in the Command window 0000000C OA 00 00 00 00 ue The contents of sec 0 in address 0x0000000C and of sec 1 in 0x00000010 are displayed in hexadecimal sec was declared as type int A The values indicated above are examples only and will not neces E sarily match the actual values Referencing the contents of Input the following from the keyboard memory in the Watch window W lt symbol gt W sec J page 195 A new Watch window is opened above the Code window displaying the de clared type address and value of sec 1j int 2 sec DO 8080000A AD 00000000 D1 00000000 A1 00000000 display D2 00000000 A2 00000000 cnt60 D3 00000000 A3 00000000 cnt60 Ol secl A if sec 0 10 sec 1 if secl1 6 sec 1 0 Monitor Program Version 0 01 Evachip Number 103000 gt d sec 00000200C OA 0O OA OO 03 OO OO OA 16 89 E2 OB 84 02 85 gt u sec gt File WOptting SrcSWSearchi Go InspctH Come HSglStpk BreakilFncS tp kg Debugging Tutorial 48 The data registered for watching is continuously updated and displayed in the window As an example set a break software break
149. ect Inspct F6 CTRL l I Register watch Watch F7 CTRL W W Display view View F8 CTRL V V Get text string Get F9 CTRL G G E File related Commands Switch source file SHIFT HOME Select file File F1 Search for text string downl Search F4 CTRL L Input search for text string downl CTRL Q F Search for text string upT SrchT CTRL F4 CTRL B Stop search ESC Quick Reference 262 Process Control Return to Debugger CTRL 0 Go to subprocess CTRL 1 Display hide Option window CTRL 4 Display hide RAM monitor CTRL 5 Shell Backspace delete one character BS CTRL H Move cursor one character to left lt SHIFT lt CTRL S Move cursor one character to right gt SHIFT gt CTRL D Move cursor to beginning of line Ln Top SHIFT F4 CTRL A Move cursor to end of line Ln Bot SHIFT F5 CTRL F Delete one character at cursor position DEL CTRL G Delete all characters Ln Can SHIFT F7 CTRL U Switch between insert mode and replace mode INS CTRL V Display find last history buffer SHIFT T CTRL W Display find next history buffer SHIFT CTRL Z Copy one character from history buffer C1 SHIFT F1 SHIFT gt CTRL D Display History window Histry SHIFT F2 Copy from history buffer CA SHIFT F3 Display Extended Symbol window ExtSym SHIFT F6 Clear history buffer All Can SHIFT F8 Quick Reference H Others 9 Appendix 263 Speci
150. ed when using oscillation signals from the target OSC XI The In circuit Emulator will not operate normally in the following cases When the clock is supplied from the target and the level of the clock wave form is inadequate or there is noise in the clock signal When the target s power is off When the current capacity of the target power supply is inadequate When the bus request signal from the target remains active for more than a certain period of time approximately 0 1 seconds When the target hardware is not operating normally Notes on Use 14 2 2 Software Notes Before using the software make a backup of the C Source Code Debugger floppy disk Copying this floppy disk is permitted only for maintenance and archival purposes To copy the disk use the DISKCOPY command or COPY command in MS DOS 2 3 ROM RAM Only eight blocks out of the 4GB address space can be allocated to emulation memory The total size of the eight blocks of memory must not exceed the size of the memory installed in the In circuit Emulator 1MB standard Each block can be set so that it starts and ends in units of 4K of memory Operation is not guaranteed if data accesses to special register areas are not performed with the correct access data size and address boundaries 2 4 Program Execution Programs cannot be executed including single step and function step execu tion while the microprocessor is in STOP
151. eeseeeeeeeeeeeeeeeeeees 209 BEL Sound beep c cccececceeeeeeeeeeneeeeeeeeeeeeeeeseeeeeeeeeesaees 210 TIME Display Current Ume insin 210 WATT Walt citencnesiescenta datetecie vere weet ees 211 PRMPT Change prompt ccccccceeeceeceeeseeeeeeeeeeesseeeeeneees 211 COMMON vest ccsteeeeestaeed tiana nanain aaneen i aeda niaaa ena 212 S QUTDUT IOG 5 steccedest cb don odentcceecaetuander ebasteesacddaninnetestianeesieries 213 lt Bath cree saves save ceces saaciesas sande due tates aecus iocdesJavededeeleveneevenctenes 214 MEM Display register delete MEMO 215 N Change input format base c cceceeeeseeeeeeeeeeteeeeeees 216 OPTION Set Option 0 c cceececeeeeeeeeeeeeeeeeeeeeeeeeeseeeeeeeneeeee 217 Chapter 8 Macro Commands Macro Command OVEerVieW cccceecccccceeeeeeeceesueeeeesessesaueeeeseeeeeeneees 220 Macro FUNCTION ieseanca a a 220 Command Index Macro Command srronireimirnia nara 222 Se A E A 223 AE EEEE Spededaatetagdatans lags 225 DO WHILE Macro control execution sssseeseeeseeeeeeee 227 FOR Macro control execution cceceeseeeeeteeeetteeeeteees 228 WHILE Macro control execution ceeeeeeeeteeeeeteeee 229 REPEAT REPEAT Macro control execution 230 BREAK EXit Macro 0 ceeececeeeeeceeeeeeeeeeeesaeeeeeeeeeseaeeeeeneeeeas 231 LALL Macro display output specification 232 SALL Macro display suppression specifica
152. enlarges the Code window In other words this command moves the boundary between the Command win dow and the Code window down one line Pressing these keys redisplays the screen Pressing these keys enlarges the Command window to its maximum size and reduces the Code window to its minimum size Pressing these keys reduces the Command window to its minimum size and enlarges the Code window to its maximum size Pressing these keys restores all windows to their initial window sizes Window commands F2 OptWin Ctrl 4 Press the 4 on the numeric keypad Ctrl F2 Optsw Ctrl O F3 SrcSW Ctrl F3 SrcSW1 6 Window Commands 69 Pressing these keys turns the Register window and Option window display on and off If the Register window is not displayed pressing these keys causes the Register window to appear If the Register window is displayed pressing these keys causes the Register window to disappear These keys switch the contents of the Option window display This command changes the Option window from the Memo window to the Stack window When there is debugging information in the user program this com mand changes the Option window in the following cycle Memo to Back Trace to Stack to Local This command is valid only when the Register window and the Option window are displayed When the Code window is displayed pressing this key changes the source listing display to the disa
153. environment variable TMP or TEMP Therefore the overlap time can be greatly reduced by specifying a RAM disk for an overlap disk If this environ ment variable is not set the file is created in the current directory be Chapter 3 section 3 FEMS This option uses EMS memory as the save area for overlapping This option allows faster task swapping than when saving to a file This option specifies the default source file extension lt extension gt becomes the default source file extension If this option is omit ted C becomes the default extension This option disables the display of the indicators that indicate the screen type If the indicators are disabled S and U the subprocess screen and user screen indicators are not displayed in the lower left corner of the screen This option can be specified for the PC 9800 Series only This option specifies the tab size when displaying a source listing in the Code window TAB tab size The tabs are adjusted to the number specified by the tab size If this option is omitted the tab size is set to 8 This function is useful for displaying files in which the tab size was changed with an editor C Source Code Debugger Startup Method and Options Specifying assembler debugging mode X Starting up with no target system NOTARGET 5 C Source Code Debugger Startup Method and Options 59 Reference To set the tab size to four columns input the follow
154. equation calculation in the command or the VAL command The C variable specified by the command or the VAL command was not found Operators with secondary effects cannot be used Operators with secondary effects etc cannot be used in the com mand Use the VAL command with operators with secondary effects A macro cannot be defined within a macro Define macro commands at the C source code debugger command level Macro commands cannot be defined within a macro command A macro cannot be deleted within a macro Delete macro commands at the C source code debugger command level Macro commands cannot be deleted within a macro command C Source Code Debugger Error Messages 9 Appendix 253 Macro name duplicates an internal command The macro name that was being defined matches the name of an internal com mand of the C source code debugger Use a different macro name Insufficient macro registration area Either the macro command registration area is full or else too many macro com mands are being defined Use the B option to expand the macro command regis tration area and then start up the C source code debugger Macro command definition was not terminated properly There is an error in the correspondence of the brackets within the macro command definition Macro nesting has exceeded 15 levels Macro commands can be nested 1 e a macro co
155. es the instruction set gt MN10300 Series Cross assembler User s Manual lt Describes the assembler syntax and notation gt MN10300 Series C Compiler User s Manual Usage Guide lt Describes the installation the commands and options of the C Compiler gt MN10300 Series C Compiler User s Manual Language Description lt Describes the syntax of the C Compiler gt MN10300 Series C Compiler User s Manual Library Reference lt Describes the the standard library of the C Compiler gt MN10300 Series C Source Code Debugger for Windows R User s Manual lt Describes the use of the C source code debugger for Windows gt MN10300 Series Installation Manual lt Describes the installation of the C compiler cross assembler and C source code debugger and the procedure for bringing up the in circuit emulator gt Contact Information If you have any comments or questions concerning this manual contact the nearest Semiconductor Design Center Refer to the list at the back of this manual for addresses etc lt About This manual 3 gt CONTENTS Chapter 1 C Source Code Debugger Overview Chapter 2 C Source Code Debugger Configuration Chapter 3 Connections and Startup Chapter Characteristic C Source Code Debugger Functions and Their Usage Chapter 5 C Source Code Debugger Startup Method and Options Chapter 6 Window Commands Chapter 7 Dialog Commands Chapter 8 Macro Commands Chapter 9 Appendix Index
156. events An event is generated by a data access Conditions including read write ad dress range data access width match no match and number of accesses can be specified Up to four events can be set in the microprocessor s internal data RAM space and in the external memory space respectively No more than a combined total of eight execution address event and data event points can be set however An event that is a condition for the break function is called a break event an event that is a condition for starting or stopping tracing is called a trace event and an event that is a condition for starting or stopping time measurement is called a time measurement event The respective commands used for setting these events are as follows Break events BP command Trace events EV command Time measurement events EV command The BC or EC command is used to delete events Data events can even be set for the microprocessor s internal in struction ROM RAM space or special register space and areas re served for the system However there is still a limit of four events on the combined total number of events that can be set in these areas and internal data RAM Event Related Commands 7 Dialog Commands 125 The table below indicates which types of events can be used with memory ac cesses by the microprocessor internal DMA accesses and external DMA accesses Accesses marked with an X cannot be
157. formation source line information the debugging information is automatically loaded into the debug ging information area If the file does not include debugging information a mes sage is displayed and only the executable file is loaded If the debugging informa tion is loaded by the L command all registered debugging information is erased and the new debugging information is registered in its place 2 The L command deletes all existing break event settings and watch registrations initializes the trace function the time measurement func tion and the profile function and resets the user CPU microproces sor If source line information is included in the file loaded by the L command the Code window changes to source code display L P lt file gt The LP command loads only the specified executable code and data and resets the microprocessor e If the lt file name gt specification is omitted the file with the same A file name that was specified for the last L or LP command is loaded e Use the RD command when loading a Motorola S format file an Intel HEX format file or a binary format file e When the environment variable PANASRC is set after an execut able file has been loaded the source files in the directory specified by the environment variable are displayed If PANASRC is not set the source files in the current directory are displayed RD command and WR command Program Loading Execution 7 Dialog Comman
158. from the symbol table The C source code debugger has a special reserved symbol _ _DEBINF__ If the following line is input __DEBINF__ J all registered symbols will be deleted In this case the source line information is also deleted Symbols are used as variables in macro commands An example is shown below Example i 0 do T Single step execution command i itl while i lt 3 In this example the symbol i is used as a loop variable in the DO WHILE command This sample macro code causes three steps to be executed Data Display Change Example When registering a symbol with the name gt R command the period period is omitted the command wil register command 7 Dialog Commands 185 same name as a CPU register oe 99 cannot be omitted If the l be interpreted as a change gt x 00000000 _i 00000004 _test 0000000C _sec 80000000 _Reset 80000029 _main 8000002C _Omain 80000042 _initialize 80000042 _Oinitialize 8000004C _display 8000004C _Odisplay 80000056 _Ocnt60 80000056 _cnt60 8000009F _init_data 8000009F _Oinit_data gt tmp1 80001234 Registered symbol name gt tmp1 80000020 Registered symbol name gt X 00000000 _i 00000004 _test 0000000C _sec 80000000 _Reset 80000020 tmpl 80000029 _main 8000002C _Omain 80000042 _initialize 80000042 _Oinitialize 8000004C _display 8000004C _Odisplay 80000056 _Ocnt60 80000056 _cnt60 80
159. fy memo text string CTRL SHIFT F1 F10 Display change option menu Option SHIFT F10 Interrupt quit Window command ESC Interrupt display interrupt step execution etc STOP CTRL C Pause resume Command window display CTRL S Echo output to printer CTRL P Display help HELP E Referencing changing data Inspect variables Inspct F6 CTRL I Local commands for Inspection Zoom in out Zoom F4 Change base 16 lt gt 10 F5 Inspect Inspct F6 CTRL l 1 Register watch Watch F7 CTRL W W Display view View F8 CTRL V V Specify array range Range F9 R Change value Change F10 C Register variable watch Watch CTRL F7 CTRL W Display variable view View CTRL F8 CTRL V Quick Reference 264 E Loading Programs E Reading Writing Files E Running Programs E Breaks Events 5 2 Dialog Commands L lt file name gt Loads both the program that is to be debugged and the de bugging information for that program LP lt file name gt Loads just the program that is to be debugged RD lt file name gt lt address gt Loads the specified file at the specified address WR lt file name gt lt address S gt lt address E gt Writes the contents of memory in the specified range of ad dresses to the specified file T lt count gt Runs a program under single step execution F8 P lt count gt Runs a program under function step execution F10 G
160. gger without a target system use the NOTARGET option The NOTARGET option cannot be specified while a target system is connected Only specify the NOTARGET option when using the in circuit emulator by itself without connecting a target system The NOTARGET option cannot be specified while a target system is connected The emulator controller is not outputting any voltage The C source code debugger could not be started up because the emulator control ler is not outputting any voltage If this error occurs contact us at the address indicated at the end of this manual Check for an address conflict etc with the interface board Check to see whether the interface board address and the address set by the In staller PINS 103 EXE are the same Monitor program loading failed The loading of the Monitor program MON103 EX failed There is most likely a problem either in the hardware or in the Monitor program file Monitor program MON103 EX not found The Monitor program file MON103 EX which is needed in order to start up the C source code debugger was not found Copy the MON103 EX file either into the current directory or into the directory specified by the environment variable PATH Monitor program initialization failed The Monitor program was not started up There is most likely a problem either in the hardware or in the Monitor program file Wrong Monitor program version The C sour
161. gnized The should follow immediately after the macro command Examples where macro is recognized normally forf lt command 1 gt lt expression gt lt command 2 gt lt macro body gt if lt parameter list gt Examples where macro is not recognized normally for m lt command 1 gt lt expression gt lt command 2 gt lt macro body gt ifm lt parameter list gt Macro Commands 8 Macro Commands 225 Execute macro command lt macro name gt lt parameter list gt A defined macro can be executed with the same input format as an internal command of the C source code debugger In other words there is no special command that is needed in order to execute a macro command As long as the C source code debugger prompt is displayed a macro command can be executed simply by inputting the macro name In addition up to 10 parameters can be specified for a macro command The parameters are delimited by commas The parameters specified in the macro command replace the pseudo parameters 0 1 9 within lt macro body gt when the command is executed 0 Corresponds to the first parameter in the macro command 1 Corresponds to the second parameter in the macro command 9 Corresponds to the tenth parameter in the macro command A macro command that is executing can be interrupted by pressing the ESC key When specifying parameters commas and single quotation marks can be enclosed in square brackets
162. gt bp No Sadr Eadr st Data Symbol Sz Cnt Command E 1 80000039 SF _Omain 1 E 2 00000100 RW 0xxxx100 1 E 3 00000000 RW 05 al E 4 80000058 EX _Ocnt60 1 gt Reference The base used in lt list gt is assumed to be decimal regardless of the N command specification If Ox is added the base is hexadecimal e EV command BP command BC EC command and BD command Event Related Commands 7 Dialog Commands 141 Other Hardware related Commands TM Command Sets and displays trace mode TG command Starts tracing TS command Stops tracing TD command TDU command Displays trace information TDW command Displays trace information in a window format TI command Sets and displays the timer TRIG command Sets and displays the trigger MAP command EX command Assigns memory Other Hardware related Commands 142 On the fly NO INFLUENCES function M Set display trace mode TM lt mode gt B C S T lt count gt lt event number gt TM F TM The trace function stores a record of the user program execution status in trace memory allowing the program execution status to be analyzed later Execution addresses data addresses data values and information on the bus status can be stored for up to 16K steps TM lt mode gt B C This command specifies the trace mode The mode specification items in clude the bus specification the
163. h ROM and RAM e Count specification Data break e Address data bit mask e Read write access e Count specification Others e AND break e Sequential break Trace full break Stopping position Before instruction execution After execution of several instruc tions after event conditions are met Number that can Up to 32 including hardware Up to four execution address be set breaks breaks and four data breaks Implementation Inserting PI codes in the Monitoring of status by external program hardware Event Related Commands 126 3 AND break This is a type of hardware break A break occurs when all of the specified event conditions are satisfied simul taneously Only one set of AND break conditions can be specified BPA com mand 4 Sequential break This is a type of hardware break A break occurs when all of the specified event conditions are satisfied in the sequence in which they were specified Only one set of sequential break condi tions can be specified BPS command 5 Trace full break This is a type of hardware break A break occurs when the trace memory is filled with data TM command In addition a forced break can be executed forcibly stopping user program execution by pressing the ESC key on the host computer EV command Sets displays events BP command Sets displays hardware breaks and software breaks BPA command Sets AND break
164. han normal tracing How ever after starting the trace the trace display does not appear until the first branch instruction appears Trace mode with event condition In tracing with an event condition tracing is performed only while the event condition specified by lt event num ber gt is satisfied Select one of the following Trace full break mode Tracing stops and user program execution also stops breaks when trace memory becomes full Trace continue mode default Even if the trace memory becomes full tracing contin ues until the user program stops The last 16K of steps executed before the user program stopped then remain as the trace data Trace full stop mode Tracing is performed from the start or resumption of user program execution until the trace memory becomes full 16K steps When the trace memory becomes full tracing stops but the user program continues T lt count gt lt event number gt Delayed trigger trace mode Once the event specified by lt event number gt occurs tracing continues for the number of cycles specified by lt count gt after which tracing stops This mode makes it possible to monitor the execution status of a program before and after the occurrence of an event lt count gt can be specified over a range from 257 to 16 384 If omitted 257 is assumed for lt count gt lt event number gt cannot be omitted Other Hardware related Commands
165. he cur sor keys to move the cursor the highlighted item to the desired item Select LOAD PROGRAM by moving the highlighted cursor to LOAD PROGRAM and then pressing the Return key Debugging Tutorial Closing the Help screen ESC 4 Characteristic C Source Code Debugger Functions and Their Usage 39 LP lt file name gt load a program designated by lt file name gt L lt file name gt load a program designated by lt file name gt with line number and symbol information RD lt file name gt lt address gt read a file from the designated address It is possible to read a file in the following format EF HEX WR lt file name gt lt extent gt write the contents of memory to lt file name gt lt example gt WR SAMPLE EX 0 100 K lt symbol name gt display lt symbol name gt if the name isn t designated all symbols are displayed lt name gt lt value gt change the symbol lt name gt to value lt val gt The Help screen changes so that the LOAD PROGRAM help screen is dis played This screen indicates that the Load command is L lt file name gt Press the ESC key to return to the original C source code debugger screen Debugging Tutorial 40 4 3 Loading executable files A Loading a program Now that we know that the L command is used to load executable files L lt file name gt SAMPLE EX in this example type the following e page 114 L SA
166. he cursor keys in a newly opened Inspect window The ESC key is used to close one Inspect window at a time Pressing these keys registers either the variable that is being inspected or the selected element for watching in the Watch window be Chapter 6 section 3 4 Watch function Data Reference Functions F8 View Ctrl V V FQ Range R F10 Change C 6 Window Commands 91 Pressing these keys displays either the variable that is being inspected or the selected element for viewing in the Command window e Chapter 6 section 3 5 View function These keys are used to change the number of the displayed array or pointer element and to change the maximum number When one of these keys is pressed the window that is used to input the number of the element to be referenced opens with the element that is currently being dis played and the maximum element number highlighted Input the display element number and the maximum display element number may be omitted During this line input the History and Line Edit shell functions can be used This command is an extremely useful function for referencing large arrays and for referencing areas around pointers Pressing these keys changes the value of either the variable that is being inspected or the selected element The only variables that can be changed with this command are those that have a scalar attribute char int etc or the pointer attribute If these keys
167. his book may be reprinted or reproduced by any means without written permission from our company If you have any inquiries or questions about this book or our semiconductors please contact one of our sales offices listed at the back of this book or Matsushita Electronics Corporation s Sales Department About This Manual This manual is intended for engineers who will be debugging programs for the MN10300 Series Chapters 1 through 3 provide an overview of the C Source Code Debugger describe its organization and explain how to start it up Chapter 4 intended for beginners is a detailed guide to debugging work Chapter 5 introduces the options that can be specified when starting up the C Source Code Debugger Chapter 6 explains the window commands while chapters 7 and 8 explain the dialog commands and macro commands respectively These chapters also include specific command execu tion examples Chapter 9 an appendix includes specifications and notes concerning the In circuit Emulator probe specifications an explanation of the operation of the interface board switches error messages and a quick reference for the commands E Organization of This Manual Each section in this manual generally consists of a title summary main text indications of the keys that are used notes and reference information Chapters 7 and 8 also include commands command patterns and examples of usage The layout of each se
168. hlighted string is no longer highlighted and the debugger awaits normal input When inputting a new string the shell function history and line editing functions can be used Once the search string has been input the function searches for the search string in the forward direction starting from the current cursor position and proceeding towards the end of the file Pressing these keys causes the function to search for the search string specified previously by using CTRL Q CTRL F or F4 in the forward direction starting from the current cursor position and proceeding towards the end of the file Window commands 76 Ctrl F4 Srch7 Ctrl B Esc Pressing these keys causes the function to search for the search string specified previously by using CTRL Q CTRL F or F4 in the reverse direction starting from the current cursor position and proceeding towards the beginning of the file The message Searching Interrupt with ESC key is displayed at the top of the screen when a string search is in progress To interrupt the search press the ESC key The message Cancelling String Search is displayed and the search is cancelled Window commands Ctrl 0 Ctrl 1 Ctrl 4 Ctrl 5 6 Window Commands 77 2 5 Process control RAM monitor Process control and RAM monitor screen switching are performed using the CTRL key in conjunction with the keys on
169. iables arrays structs and unions in the source file displayed in the Code window During debugging first use the execution break commands to execute the ex ecutable file up to the desired position Next use the data reference modification commands to reference the states of variables at that point in order to determine the locations of bugs or confirm that the program is running properly Then ex ecute the program and reference the data again The vast majority of debugging work consists of repeating this process If a bug is found the file is debugged by repeating the process of correcting the source file recompiling and reloading the file executing the file and referencing the data It is clear therefore that the degree to which the data referencing functions are simple and easy to understand can determine how useful a debugger is Once the user has a solid understanding of the data referencing functions this C source code debugger provides an excel lent debugging environment 3 1 Inspect function a The Inspect function makes it possible to reference or change a variable array struct or union in the source file displayed in the Code window in a format suited to the data structure of that variable simply by specifying the variable array struct or union with the cursor To do so move the cursor to the Code window and then position the cursor on the variable to be referenced changed in the source file It does not matter which
170. ile pressed Those that STARTUP ASM Sample program startup routine source file are not enclosed are To start up the C source code debugger input the following as an MS DOS keys that are used for command Reference option commands or PICE103 NOTARGET J symbol local commands When this command is input the C source code debugger startup screen ap pears Specify NOTARGET when there is no target system connected Notes a This example assumes that there is about 500KB of available space g in main memory Debugging Tutorial lt About This manual 1 gt This indicates where related in formation can be referenced Command Command pattern This shows the spe cific command pat tern Commentary Explains the under lined portions Reference information BPA 7 Dialog Commands 1B On the fly NO INFLUENCES function Set AND break BPA lt list gt Example Break event Nos 2 and 3 form an AND break L____ E Finding Information This command sets an AND break The hardware break events specified in lt list gt become AND conditions Once all of the conditions are satisfied a break occurs Specify up to eight break event numbers in lt list gt delimited by commas If an AND break is set while a program is running it becomes valid immedi ately To cancel an AND break execute the BD or BC EC command on one of the break events set a
171. in 4KB units before mapping This warning message is displayed in such a Case Changing time measurement to continuous mode This warning message indicates that time measurement was changed to continu ous mode because a timer event was cancelled or disabled C Source Code Debugger Error Messages 258 Paused time measurement Time measurement is paused if a timer event was changed while the user program was running with time measurement in partial mode Furthermore the measured results up to that point are cleared This warning message is displayed in such a case Time measurement error occurred While the time measurement mode was partial mode the length of time that the in circuit emulator can measure was exceeded Time measurement not completed While the time measurement mode was partial mode time measurement was not completed because a timer event time measurement start stop events did not occur Time measurement events not set The time measurement start and stop events were not set when the time measure ment mode was set as partial mode measurement of time from the occurrence of one event until the occurrence of a different event Memory access failed timeout An emulation memory read or write operation failed If this error occurs fre quently it is likely that there is a problem with the in circuit emulator so contact us at the address indicated at the end of this
172. ing PICE103 TAB4 J This option specifies either the assembler or various C debugging modes X This option specifies the assembler debugging mode If the C source code debugger is started up in this mode commands related to C stack back tracing local variables cannot be used XC default This option specifies the CC103 compiler debugging mode This option specifies that the in circuit emulator is to be used by itself with out being connected to a target system This option must be specified if there is no target system i Never specify this option if a target system is connected Doing so will cause the voltage of the target and that of the in circuit emula tor to be different causing the in circuit emulator to operate incor rectly and damaging the system C Source Code Debugger Startup Method and Options 60 Chapter 6 Window Commands 1 Window Displays 2 Window Commands 3 Data Reference Functions 62 Window Displays EE a aaa The C source code debugger supports two types of command specification Window commands and Dialog commands using either the function keys or the Control key This chapter explains the Window commands and how to use them For details on Dialog commands refer to Chapter 7 Dialog Commands 40000005 FF pi 40000006 FF pi 40000007 FF pi 40000008 F3AQ mov dO a a2 4000000A FB236FFE udf 2 191 d3
173. ing this command displays frames labelled with again Terminates trace display mode Displays the contents of trace memory in window mode Sets the timer mode RUN Measures the time from the start of program execution until it halts FIRST Measures the time between events once MIN MAX Continuously measures the time between events and determines the maximum and minimum times Specifies the event at which time measurement is to start Specifies the event at which time measurement is to end Sets the timer clock T1 25ns resolution T2 50ns resolution T4 100ns resolution M_ Microprocessor clock TI STOP TI TRIG OUT lt data gt TRIG RAM lt address gt TRIG EVENT TRIG 9 Appendix 267 Cancels timer mode Displays the current timer mode and the timer value Outputs the 8 bit port data lt data gt Outputs the contents of lt address gt when the microprocessor accesses lt address gt Outputs the event status Displays the trigger outputs that are currently set MAPI EX I lt address S gt lt address E gt FI S F IS Allocates memory to emulation RAM Fast emulation RAM Slow emulation RAM MAPE EXE lt address S gt lt address E gt MAP EX E Measuring Performance SM lt address gt SMB lt address gt SMC lt number gt SMW SM PROF lt mode gt lt mode gt PROF Allocates memory to a resource in the user target Displays the memory allocation
174. is command suppresses display output by a macro MLIST command This command displays the registered macros KILL command This command deletes registered macros IF command This command executes a command under conditional control KEYIN command This command specifies input from the keyboard Macro Commands 8 Macro Commands 223 lt gt lt gt Execute macro command lt macro name gt lt macro body gt This command defines a macro command lt macro name gt is the name of the macro being defined If lt macro name gt is input the macro input prompt appears and the system waits for the input of the body of the macro being defined Multiple internal commands and macro commands can be freely written in the lt macro body gt portion there is no limit on the number of commands that can be included except for the capacity of the macro buffer No error checking of the commands is performed while lt macro body gt is be ing input Error checking is performed only when the macro is executed The input of lt macro body gt is terminated by inputting lt If a macro is defined with the same name as an internal command of the C source code debugger the following error message appears Conflicting Dialog command In addition if a macro is defined with a name that is the same as that of a previously defined macro the old macro definition is deleted A macro command cannot be define
175. it_data display ent60 cent60 sec O t if sec 0 10 sec 0 0 sec 1l if sec 1 6 sec 1 0 init_data test tst1 0 test tst2 0 sec 0 INIT_DISPDATA_L sec 1 INIT_DISPDATA_H The sample program is then compiled and linked and an executable file is created Creation of Executable Files 36 Debugging Tutorial SS SS This section provides an overview of the debugging process and the operating methods of the C source code debugger from start to finish by actually using the C source code debugger to debug the sample program SAMPLE C Knowledge of these operating methods combined with a knowledge of the window com mands and dialog commands will enable you to operate the C source code debugger 4 1 Starting up the C source code debugger Confirm that the current directory contains the following files If one of these files is not contained in the current directory copy the file from the master disk PICE103 EXE C source code debugger 10300 PINS 103 EXE Environment setup utility ENV103 TXT Type definition file PICE103 MAC Macro command definition file PICE103 MES Message file PT103 HLP Help file for the C source code debugger 10300 MON103 EX In circuit emulator monitor program file SAMPLE EX Executable file of the sample program SAMP
176. layed in cast format the array elements are enclosed in brackets and as many elements as possible are displayed In the second and subsequent lines all of the array elements are dis played in order Oth 1st 2nd nth If the array has multiple elements such as a struct array those elements are enclosed in brackets and as much informa tion as possible that fits on one line is displayed For example when inspecting the two dimensional array int x 3 2 the dis play appears as shown below Example int 3 2 x 1 2 3 4 5 6 array inspection O 1 2 x 0 element display 1 3 4 x 1 element display 2 5 6 x 2 element display When referencing an array with a large number of elements it can be enlarged with the Zoom function to fill the screen Chapter 6 section 3 3 Data Reference Functions 6 Window Commands 87 E Inspection display for a variable with an array attribute SAMPLE C DO 00000007 AB B0000000 D1 00000000 A1 00000000 cnt6 D2 00000000 A2 00000000 D3 00000000 A3I 0000000A if sec 0 10 sec 0 0 int 2 sec 00002200C 7 0 0 7 0x7 1 0 0x0 init_data test tst1 0 test tst2 0 CN IM 0 S 0 DO 00000007 D1 80000000 D2 00000000 D PSH 0006 AG 00000000 A1 00000000 A2 00000000 A PC 80000076 MDR 80000073 LIR 8000006C LAR 00000000 S mov 200C d Pw Zoom 16 lt gt 108 TInspctl Watch Vie
177. line Move cursor one word to left Move cursor one word to right Move cursor to beginning of line Move cursor to end of line Scroll up one screen Scroll down one screen Move cursor to beginning of text Move cursor to end of text Enlarge Option window Reduce Option window Enlarge Command window Reduce Command window Redisplay screen Maximize Command window Minimize Command window Redisplay screen and restore window to initial size Display hide Option window Switch option window Switch between source and disassembled display Switch between source and disassembled display cursor specification HOME 1 CTRL A CTRL F CTRL QsS CTRL Q D ROLL UP ROLL DOWN CTRL Q R CTRL Q C CTRL CTRL gt CTRL T CTRLW CTRL4 J CTRL Q W CTRL Q Z CTRL Q J F2 CTRL F2 F3 CTRL F3 CTRL S CTRL D CTRL E CTRL X CTRL C CTRL R CTRL 4 CTRL 0 Quick Reference E Execution Breaks 9 Appendix 261 Execute Go F5 Execute up to cursor position Come F7 Single step execution SglStp F8 Set cancel break software break Break F9 Function step execution FncStp F10 Forced break ESC Forcibly terminate command CTRL SHIFT GRPH E Get Select Text String Get text string at cursor position Get CTRL F9 CTRL G Select text string according to cursor position Sel CTRL F10 Local commands for text string selection Register memo Memo F1 F5 F10 Insp
178. line then steps sequentially one step at a time through the functions display and cnt60 This method is referred to as single step execution Debugging Tutorial 4 Characteristic C Source Code Debugger Functions and Their Usage 45 SAMPLE C init_data DO 00000008 AD 00000000 D1 00000000 A1 00000000 D2 00000000 A2 00000000 D3 00000000 A3 00000000 display cnt60 cnt60 if sec 10 sec 0 0 104 if sec 1 6 sec 1 0 PICE 10300 Ver 3 6b Release 1 1 1 Copyright c 1996 Pa Sub process segment 873AH 99 Kbyte Monitor Program Version 0 01 Evachip Number 103000 gt File WOptiing SrcSWSearchi Go InspctH Come HSglStpk BreakilFncS tp ky The difference between function step execution with the F10 FncStp key and single step execution with the F8 SglStp key is whether called functions as a whole are regarded as one step or are also executed internally one step at a time Setting deleting break Next we will set a break software break Move the cursor to the Code win software break dow if the cursor is currently in the Command window press the HOME key F9 and move the cursor to the 45th line of the SAMPLE C file Once the cursor has page 71 been positioned in the 45th line press the F9 Break key The 45th line is now underlined A break has now been set in the 45th line of the source listing To delete a break move the cursor back to th
179. lows through the A The function of the fuseless circuit breaker is to protect the 5V power sup E breaker for any reason the white button pops out and the current is inter rupted If the fuseless circuit breaker is tripped determine what the cause was before pushing the white button back in When pushing the white button do not use too much force The white button is deemed to have popped out when it extends 1 or 2 mm out from the fuseless circuit breaker when viewed from above Interface Board Switch Settings 244 e Rotary switch settings DSW1 2 4 5 7 8 I O address DSW1 DSW2 DSW4 DSW5 DSW7 DSW8 xxD0H 0 D 0 xxD1H 0 D 1 xxDFH 0 D F xxEOH 0 D F xxEl1H 0 E 1 xxEFH 0 E F Note The indicates any position is fine Set an unused address from xxDOH to xxEFH as the I O address e DIP switch DSW3 6 settings 1 2 3 4 DSW3 OFF OFF ON ON DSW6 OFF OFF OFF ON Interface Board Switch Settings 9 Appendix 245 2 2 When the Host Computer is the PC 98 NOTE Series Open this panel to set the switches L T Panaxseries D ICE POWER N The DC jack is used to supply the power for Panasonic EPROM programmers used independently The AC adapter sold separately is required Connector to It is not required when the power f
180. ma tion is to be stored Reserves an area of the specified size in a memory area of less than 640KB If omitted a 64KB area is reserved lt size M gt Size in 1KB units up to a maximum of 32KB of the macro command registration area If omitted a 3KB area is reserved Reference For example in order to reserve 128KB for the debugging informa tion area and 5KB for the macro area input the following PICE103 B128 5 BEMS lt size M gt This option reserves the debugging information area in EMS memory Specify a numeric value for the size of the macro area lt size M gt Reference For example in order to reserve the debugging information area in EMS memory and also reserve 10KB for the macro area input the following PICE103 BEMS 10 J C Source Code Debugger Startup Method and Options 58 Specifying overlap mode F Specifying the default extension E lt extension gt Disabling indicators N Setting the tab size TAB This option specifies overlap mode in which only the bare minimum of essential functions for executing the debugging program are loaded into main memory while the C source code debugger itself and the work area are saved to EMS memory or to a file s Chapter 1 section 1 for the Overlap function F This option uses a file as the save area for overlapping If the F option is specified the overlap file is created in the directory speci fied by the
181. manual Verify error Data was not written to memory properly This error occurs when data was writ ten to an address in memory that has not been installed or if a write was made to write only I O etc Cannot write special registers A fill and block transfer F or M command cannot be made to the special register area Duplicate watch point specification A watch point specification with the same contents has already been made C Source Code Debugger Error Messages 9 Appendix 259 Watch point cannot be set This error occurs when an attempt was made to set more than 16 watch points Specified setting does not exist The watch point registration that was to be deleted by the Y command does not exist Sampling was not performed An attempt was made to display profile results before sampling the execution status of each function with the profile function PICE internal error This error message is displayed when an error occurs in the C source code debugger s internal processing This error should normally not occur if it does occur and it is reproducible contact us at the address indicated at the end of this manual C Source Code Debugger Error Messages 260 Quick Reference 5 1 Window Commands H Screen Control Switch cursor command code Move cursor one character to left Move cursor one character to right Move cursor up one line Move cursor down one
182. mble INFLUENCES function DW Display trace window TDW This command displays the contents of the trace memory in a window When this command is specified it is possible to switch between the dump display and the disassembled code display just as with the TD command The F1 through F10 keys are used for this purpose If the TDW command is executed during tracing the message Stop Trace Y N is displayed on the screen Pressing Y stops tracing and displays the contents of trace memory Pressing N does not stop tracing and returns control to the command input state If the trace display is exited while a program is running the message Go Trace Y N is displayed on the screen To resume tracing press Y Note that in delayed trigger trace mode this message is not displayed because tracing cannot be resumed F1 Jump This function key jumps from the frame that is currently being displayed to the next frame to be viewed F2 Search This function key searches for a character string in the trace information To interrupt the search press the ESC key F3 Next In search mode this function key searches the trace information for the character string that was specified by the F2 key searching in the direc tion of the end of the trace information the most recent trace information F4 Back In search mode this function key searches the trace information for the specified character string searching i
183. mmand can be executed from within a macro command up to a maximum of 15 levels Specified file not found The specified file was not found Specified file cannot be opened The specified file could not be opened Confirm that the file exists This error also occurs if there are too many files open at one time File cannot be created The file could not be created either because there is not enough free disk space or because there are too many files open at one time First confirm the amount of free disk space if there is adequate disk space close any unnecessary files Insufficient free disk space There is not enough free disk space Checksum error A loading operation failed because there is a problem in a Motorola S format or Intel HEX format file C Source Code Debugger Error Messages 254 Illegal file format Subprocess execution failed because of a problem in the contents of the MS DOS command file execution format COM EXE No debugging information found The debugging information was not found when an execution format file Matsushita EX format was loaded with the L command Compile assemble the file with the option that outputs debugging information Bad debugging information There is a problem in the format of the debugging information This error should normally not occur if it does occur and it is reproducible contact us at the address indicated at the e
184. mmands 213 On the fly NO INFLUENCES function Output log The C source code debugger is provided with a log output function that out puts the information that is output to the command window during debugging to a file simultaneously with the screen display This command creates a new file with the specified lt file name gt and be gins log output to that file If the specified file already exists that file is deleted and a new one is created The lt file name gt specification can include a drive name and path name This command adds appends the screen output information to an exist ing file If the specified file does not already exist a new file is created The lt file name gt specification can include a drive name and path name This command stops the log output operation gt gt test log gt UX 0 1FF gt gt gt gt gt testl log gt t 10 gt gt gt Other Commands 214 lt On the fly NO INFLUENCES function Batch lt lt file name gt Example Execute commands from the file m1 mcr This batch function inputs and executes a series of commands from a file instead of from the keyboard The C source code debugger sequentially executes the commands that it reads from the file that was specified by this command The file name can include a drive name and path name This function is similar to batch processing in DO
185. mory Mode Use the arrow keys to select the memory mode 5 Bus Size Use the arrow keys to select the microprocessor bus size 6 SP setting Reset Start Input the initial value for the stack pointer It must be set to an address for which physical memory is installed After setting the above six items press the ESC key to quit the Installer Host Computer Settings 3 Connections and Startup 27 After the Installer has been run the environment settings file PICE103 ENV is created This file is loaded when the C Source Code Debugger is started up Be careful to avoid deleting this file accidentally or otherwise changing its contents Host Computer Settings 28 3 2 Debugger Test Startup 4 With the system waiting for an MS DOS command to be input Input PICE103 NOTARGET 1 Once the screen is displayed and Debugger startup has been confirmed input a to quit 40000005 FF pl 40000006 FF pl 40000007 FF pi 40000008 F3IAQ mov dO a0 a2 4000000A FB236FFE udf 2 191 d3 4000000E F99395 udf 9 6B d3 40000011 D8 leq 40000012 76 mov a2 d1 40000013 6A mov moy 40000014 6F 40000015 5F53 mov 53 sp a3 40000017 D2 lge 40000018 F366 mov d2 d1 a2 v 400000LA 8E mo d3 d2 000001B FC4BFC90B108 movbu 8B190FC_ a3 d2 PICE 10300 Ver 3 6b Release 1 1 1 Copyright c 1996 Panasonic KMC 873AH 99 Kt Sub process segment Monitor Program Version Evachip Numbe
186. n STOP HALT or SLEEP mode or if the user target has initiated a reset If the contents of the microprocessor s internal instruction RAM is overwritten while trace information is being collected or after trace information has been collected the disassembled display of the trace information from the microprocessor s internal in struction RAM space will not be correct If an event setting is changed while using the delayed trigger trace the trace function will operate incorrectly Notes on Use 16 2 7 On the fly e If the contents of memory are referenced or changed including a disassembled dis play while a user program is being executed program execution is halted momen tarily For a one byte access to emulation memory program execution is halted for a maximum of 14 machine cycles for a one byte access to the microprocessor s in ternal special registers internal data RAM internal instruction RAM or external memory in the target program execution is halted for a maximum of 150 machine cycles e While a user program is executing the microprocessor is in STOP HALT or SLEEP mode or during a reset initiated by the user target it is not possible to reference or change the microprocessor s internal special registers internal data RAM internal instruction RAM or external memory in the target nor is it possible to display disas sembled trace information e If an event setting is changed
187. n be handled by the C Source Code Debugger 100 Clear Screen command CLS 208 Code window 62 Command input format 96 Command window 62 Comment command 212 Compare Memory command C 171 Cursor Home command HOME 208 D D Display Memory command 167 DIP switches 243 247 DO WHILE Execute do while Macro command 227 Data Reference function 84 94 Delete Watch command Y 199 Delete all in watch window 48 Device Connection Procedure 25 Dialog command 95 218 Disassembled code display 43 Display Disassembled Code command U 188 Display Expression command H 179 Display Format commands PF 180 PRINTF 180 Display Help command HELP 202 Display Memory command D 167 Display Output Specification command LIST 209 Display Output Suppression Specification command NLIST
188. n operators such as and and function calls have second ary effects that change data such as the contents of variables in the user program being debugged while processing for that particular operation is performed While there may be occasions where a substitution operator is used to intention ally change data the majority of the time during debugging work it is more com mon to want to simply reference data rather than change it Therefore in order to prevent data from being accidentally changed during the evaluation of an expres sion in an Inspect Watch or command the use of operators with secondary effects is prohibited in the C source code debugger Operators with secondary effects can only be used in the VAL command e When referencing data use the command or the Inspect com L mand instead of the VAL command The VAL command should only be used when using an operator that has a secondary effect such as changing the value of data Function calls using the VAL command are even more dangerous It is possible that a global variable or static variable could be changed or data in another data area could be changed by a pointer during function processing Itis also possible that an infinite loop could be created within such a function If the user is unaware of this it might be impossible to resume execution Use caution when you use a function call with the VAL command Example gt abc 1234
189. n the direction of the beginning of the trace information F5 D AS This function key switches the display between dump and disassembled code F6 First This function key displays the beginning of the trace memory F7 Last This function key displays the end of the trace memory F10 Compres This function key displays erases the frames indicated by ESC This key quits this mode and returns to the debugging screen of the C source code debugger Other Hardware related Commands 152 e If less than 16K steps were traced the first instruction after trace start might not be traced e If a trace full break was used several instructions prior to the stopping of the user program might not be traced e If the microprocessor s internal instruction RAM is overwritten while collecting trace information the trace disassembled code display will be incorrect Sample screen 80000053 call 8000006C 88801FEC 8000005A wr 80000053 Q0001FEC 80000053 00001FEC 8000006C call 80000076 0001FEC 8000006C Q0001FEC 80000060 Q0001FE4 8000006 00001FE4 80000076 mov 200C d0 Q0001FE4 80000076 Q0001FE4 8000007C inc d 0000200C 00000004 rd 8000007C 0000200C 8000007C 0000200C 38000007D mov d 200C 00002000C 80000070 0000200C 80000070 00802000 00000005 wr 80000070 0080200C 858 80000083 mov 200C me 9000200C D AS First Last Y MiCmpresf RS Other Hardware related Comma
190. name gt L lt file name gt load a program designated by lt file name gt with line number and symbol information RD lt file name gt lt address gt read a file from the designated address It is possible to read a file in the following format EF HEX WR lt file name gt lt extent gt write the contents of memory to lt file name gt lt example gt WR SAMPLE EX 8 100 K lt symbol name gt display lt symbol name gt if the name isn t designated all symbols are displayed lt name gt lt value gt change the symbol lt name gt to value lt val gt System Control Commands 7 Dialog Commands 203 On the fly NO INFLUENCES Suet Execute subprocess u lt MS DOS external command name gt It is possible to execute MS DOS commands in parallel with debugging An MS DOS command initiated by the command is called a subprocess coy Once a subprocess is initiated by the command it is possible to switch back and forth between the subprocess and the C source code debugger by means of certain key sequences multi job function CTRL 1 numeric keypad Shifts from C source code debugger to subpro cess CTRL 0 numeric keypad Returns from subprocess to C source code debugger This function makes it possible to startup an editor as a subprocess and per form debugging work while referencing the source listing In addition by using the overlap function and co
191. nce 5 Trace full break This type of break halts program execution when the trace memory becomes full 6 Forced break This function forcibly halts execution of the user program when the ESC key on the host computer is pressed C Source Code Debugger Overview Memory Emulation Function This function emulates a microprocessor s internal instruction memory ROM RAM space and the target memory extended RAM space with the memory called emulation memory in the In circuit Emulator There are two types of emulation memory 1 Emulation ROM This is readable writable memory RAM that emulates the microprocessor s internal ROM including internal instruction RAM In the In circuit Emula tor 256K of RAM is installed fixed addresses from 0x40000000 to 0x4003FFFF for use as emulation ROM Note that emulation ROM is valid only in modes that can use internal ROM internal instruction RAM such as when the microprocessor s memory mode is single chip mode or extended mode emulation ROM cannot be used in processor mode Microprocessor memory space Emulation memory in extended mode In ciruit emulator 0x00000000 Internal RAM space and special registers use space Internal RAM within the microprocessor AY 0x20000000 Emulation ROM readable writable Ox40000000 gt gt P7222 OL 0x40000000 256Kbyte Fixed address Internal ROM AY Emul
192. nd is used in combination with the CLS PRINTF PF LALL and SALL commands for display control within macro commands e CLS command Other Commands 7 Dialog Commands 209 On the fly NO INFLUENCES nenon L ST Specify display output This command resumes Command window display output after it has been suppressed by the NLIST command The LIST state is the default state when the C source code debugger is started up The LIST command and the NLIST command have opposing functions e NLIST command SALL command and LALL command On the fly NO INFLUENCES function N L ST Suppress display output This command suppresses Command window display output This command can be used to suppress the display of unnecessary data The NLIST command and the LIST command have opposing functions s LIST command SALL command and LALL command Other Commands 210 On the fly NO INFLUENCES function E E L Sound beep BEL This command causes the host computer to beep This command can be used in macro commands etc to sound a beep On the fly NO INFLUENCES function TI M E Display current time TIME This command displays the current time in the Command window Example gt time qa AST gt Other Commands 7 Dialog Commands 211 On the fly NO INFLUENCES function WAIT This command causes the system to wait either until a key is
193. nd of this manual Insufficient debugging information area There is no free space in the debugging information area Use the B option to enlarge the debugging information area and then start up the C source code debugger Subprocess not terminated When a subprocess has been started up the C source code debugger cannot be quit before the subprocess is terminated Terminate the subprocess first before quitting the C source code debugger Cannot return to PICE without terminating the subprocess Press the space bar to return to the subprocess It was not possible to return to the C source code debugger because the subprocess is using too much memory Terminate the subprocess first before returning to the C source code debugger Corresponding command does not exist The help screen could not be displayed because the specified command does not exist User program cannot be executed because the reset pin is low A user program could not be executed because the user reset pin is low Set the user reset pin high before executing the user program C Source Code Debugger Error Messages 9 Appendix 255 User program cannot be executed The user program cannot be executed Check the target system for any problems The stack pointer cannot be set to an address that is not a multiple of four The stack pointer must be set to an address that is a multiple of four This error occurs if the stack pointer is set to an add
194. nderlined In normal debugging work load the executable file that is to be A debugged before using an execution break command The execut able file can be loaded by the L dialog command or can be speci fied when the C source code debugger is started up Chapter 7 section 2 for the L command Pressing this key executes the user program from the current location indi cated by the program counter PC register All enabled break events are valid and when the user program reaches a break event or is forced to break because the ESC key was pressed the user program stops executing G command Command set with the BP and C lt command gt cannot be ex 7 ecuted Pressing this key executes the user program from the current location indi cated by the program counter PC register to the current cursor location All enabled break events are valid and when the user program reaches a break event or is forced to break because the ESC key was pressed the user program stops executing G command Window commands F8 Sg1Stp F9 Break F10 FncSp Esc Ctrl Shift Graph 6 Window Commands 71 Pressing this key executes single step execution in which the program is executed one step at a time even within called functions subroutines T command Pressing this key sets cancels breaks software breaks When the F9 key is pressed a break is set at the line where the cursor is loca
195. nds TI 7 Dialog Commands 153 On th