Home

- Service, Support

image

Contents

1. References SET DIRECTORY SHOW DIRECTORY Debugging C Programs 2 22 C79000 G7076 C520 01 Organon XDB Command Set 2 15 DELETE EVALUATE Syntax DELETE EVALUATE lt expression gt DELETE EVALUATE ID lt eval id gt DELETE EVALUATE ALL Description Removes a member from the list of expressions which are to be evaluated at every program halt lt expression gt Deletes all items with an equal expression stored ID lt eval id gt The expression with the ID number lt eval ia gt is selected ALL All expressions from the list are deleted Examples DELETE EVALUATE globstat DELETE EVALUATE ID 3 References DISABLE EVALUATE ENABLE EVALUATE SET EVALUATE SHOW EVALUATE Debugging C Programs C79000 G7076 C520 01 2 23 Organon XDB Command Set 2 16 DELETE KEY Syntax DELETE KEY lt name gt EY ALL H x Description lt name gt Deletes the user definition of the specified key lt name gt ALL All user defined function keys are deleted Examples DELETE KEY F1 EY ALL J H 4 N References DEFINE KEY SHOW KEY 2 24 Debugging C Programs C79000 G7076 C520 01 Organon XDB Command Set 2 17 DELETE MACRO Syntax DELETE MACRO lt name gt DELETE MACRO ALL Description lt name gt Delete the macro lt name gt
2. 172 d0 cre d0 cre d0 rre 4 bi This window shows the source code of the target program Unless you switch to another module by using the menu item File Set Module the module being executed is displayed The left part of the source window shows the line numbers the source lines are displayed in the right part A line number marked with a stop sign indicates that this line contains a breakpoint The current line i e the line of code to be executed next is displayed inverted i e white on black background The environment variable XDBTABLEN controls the position of the tabstops for adjusting the source code To mark a line for further manipulation e g to set a breakpoint position the line pointer the black arrow left of the line numbers by clicking the line You can also move the line pointer by hitting the lt Cursor up gt and lt Cursor down gt keys To scroll up or down in the source window you can use the lt PgUp gt and lt PgDown gt keys Note Not every line of code contains information useful for debugging purposes e g comment lines The line numbers of such lines are written in a different color and a blue point is placed behind the line number If you click the left part of the window i e a line number with the right mouse button the line pointer is set to this line and the following menu appears Go here Set Breakpoint Run until caller Run until return Set PC Debugging C Programs C790
3. SET TRACEPOINT AT lt expression gt HARD lt number gt Description AT lt expression gt The result of lt expression gt is monitored by a tracepoint When the value of lt expression gt is changed it is displayed in the appropriate window and the program continues execution HARD lt number gt This qualifier forces the hardware interface to select the internal tracepoint specified by lt number gt If this tracepoint is not available an error message is issued With this option the i80386 debug registers can be used directly if they are not set Each of the four debug registers can serve as a trace watch or breakpoint If there is no debug register left or the expression can not be controlled by a single debug register the tracepoint is simulated by XDB In this case XDB will perform single steps through the program which causes a very slow execution of your application task Therefore XDB issues a warning message CAUTION trace or watchpoint not maskable must be simulated which has to be confirmed by the user The expression is computed and the result is stored in an internal buffer as a reference value to compare with Examples TRACEPOINT AT main buffercount TRACEPOINT AT globptr HARD 3 References 2 102 Debugging C Programs C79000 G7076 C520 01 Organon XDB Command Set DELETE TRACEPOINT DISABLE TRACEPOINT ENABLE TRACEPOINT SET EVALUATE SET WATCHPOINT Debugging
4. Examples NEXT NEXT 10 References RUN STEP Debugging C Programs C79000 G7076 C520 01 2 63 Organon XDB Command Set 2 46 PAGE Syntax PAGE lt window gt lt window direction gt Description This command is used to scroll in the specified window lt window gt or in the current active window lt window gt The following values are allowed for lt window gt ASSEMBLER SOURCE The active window is the assembler window if the current language is set to assembler Otherwise the active window is the source window lt window direction gt lt window direction gt may have the following values lt expression gt assembler window only UP lt pages gt DOWN lt pages gt TOP BOTTOM LEFT lt cols gt source window only RIGHT lt cols gt source window only NULL source window only lt expression gt is allowed for the assembler window only The disassembly is set to the address given by lt expression gt UP and DOWN scroll up down the specified number of pages TOP and BOTTOM scroll to the first last line Debugging C Programs 2 64 C79000 G7076 C520 01 Organon XDB Command Set LEFT RIGHT and NULL are allowed for the source window only In this case the qualifier SOURCE is not allowed The window is scrolled to column 0 or to the specified number of columns into the specified direction Examples PAGE TOP PAGE DOWN PAGE ASSEMBLER 0x12400 PAGE interface PAGE LEFT 5 PA
5. The macro lt name gt must be specified without the leading Otherwise the content of lt name gt is considered to be the macro to be deleted ALL All currently defined macros are deleted Examples DELETE MACRO getid DELETE MACRO ALL References DEFINE MACRO SHOW MACRO Debugging C Programs C79000 G7076 C520 01 2 25 Organon XDB Command Set 2 18 DELETE MODULE Syntax DELETE MODULE lt name gt DELETE MODULE ALL Description This command frees all dynamic memory space needed by the debug information of the selected module s All symbol and line number information for the selected module are deleted To regain the information the module must be reloaded using the command SET MODULE lt name gt The module lt name gt of the internal module list is deleted This name is not the file name of the source module It contains no path name and extension ALL All modules from the module list are deleted The command is invoked internally by XDB when it runs out of heap space The current module of the program cannot be deleted Use the command SHOW DEBUG to obtain the current status of the modules Examples DELETE MODULE fileio DELETE MODULE ALL References SET MODULE SHOW DEBUG Debugging C Programs 2 26 C79000 G7076 C520 01 Organon XDB Command Set 2 19 DELETE TRACEPOINT Syntax
6. The necessary cast of the operands for this operator is not allowed for their types The first type cannot be cast to the second one The first type cannot be cast to the second one The program currently resides in another module Use the command SET MODULE first The set up of the descriptor for the shown debug image failed The debug information of this file is corrupt The debugger does not know the requested debug id This debug id must not be deleted The shown debugger variable is not defined The shown file name cannot be converted to a debug image name Debugging C Programs C79000 G7076 C520 01 CODE L B DBRD L B DBRO L B DBSY L B DBTP L B DBVU L B DBVUN L B DBWR L B DID L B DITG Debugging C Programs C79000 G7076 C520 01 CLASS TEXT E debug info error at readonly debugger variable bad debug symbol no printable type undefined debugger variable get ID undefined debugger variable wrong debug info invalid debug id different tag names Organon XDB Error Messages DESCRIPTION An error occurred during reading and interpreting the debug information Possible errors are corrupt file systems or disk overflow during compilation Try to assign a value to a read only debugger variable The debug information of a symbol in this file is corrupt You can go on with your debug session but the information of this symbol is lost The type of th
7. e a line number in a source module denoted as module LINE xx or LINE xx e aglobal name of a procedure e an address WHEN lt expression gt If a WHEN clause is used the expression is evaluated after the stop of the program at the breakpoint If the result is FALSE zero the execution of the program continues In this case an optional SKIP count remains unchanged SKIP lt count gt If a SKIP count is specified the execution of the program stops first if this breakpoint is reached for the count 1 th time and the WHEN clause is true Debugging C Programs C79000 G7076 C520 01 2 73 Organon XDB Command Set CONTINUE The CONTINUE qualifier forces XDB to continue execution after processing the lt action gt list The debugger variable ERROR is checked If it has a non zero value the loop is stopped and the next command is executed SYMBOL lt bid gt The SYMBOL qualifier directs XDB to store the ID number of the breakpoint into the debugger variable lt bid gt This variable can be used in expressions or to enable disable show or delete this breakpoint HARD lt number gt The HARD qualifier forces the hardware interface to select the hardware specific breakpoint specified by lt numbers If this breakpoint is not available an error message is issued With this option the i80386 debug registers can be used directly if they are not set Each of the four debug registers can serve as a trace watch or
8. 1 4 3 2 1 2 Description of the Subwindows Command Window Command Window Editor Source Window Assembler Window Register Window Task Window Remote System Window Evaluation Windows Memory Windows Memory Window Context Menu Trace Windows Copy and Paste Descriptor and Register Tables Descriptor Tables Modify Reload Table Set Range Control Registers Modify Update Register Window General Registers Segment Registers I a NI nl GG CoN a amp NM oO eet D HH ODT ala 1 48 O oO Debugging C Programs C79000 G7076 C520 01 Organon XDB User Interface 1 Organon XDB User Interface 1 1 Starting Organon XDB 1 1 1 Start up Dialog The first thing Organon XDB does is reading the Windows registry which contains information about the preferred window sizes and colors the directories where the sources of your target program are located and details of the connection to the target machine If there are no entries Organon XDB starts anyway using the built in default values for size and color The other informations Organon XDB needs must be entered by you into the start up window see below Now the start up window appears where you enter the information the debugger needs to begin its work Check the displayed information and modify if necessary To start Organon XDB click the Start XDB button When you close the start up window the registry entries are updated or created
9. ALL Description The breakpoint that was set inactive by DISABLE BREAKPOINT is reactivated lt halt id gt This is the number of the breakpoint to be reactivated It is a decimal number or a debugger variable containing the ID number of the breakpoint ALL All currently inactive breakpoints are set active again Examples ENABLE BREAKPOINT ID 15 ENABLE BREAKPOINT AT LINE 170 ENABLE BREAKPOINT AT location ENABLE BREAKPOINT ALL References DELETE BREAKPOINT DISABLE BREAKPOINT SET BREAKPOINT SHOW BREAKPOINT Debugging C Programs 2 42 C79000 G7076 C520 01 Organon XDB Command Set 2 31 ENABLE EVALUATE Syntax ENABLE EVALUATE lt expression gt ENABLE EVALUATE ID lt eval id gt ENABLE EVALUATE ALL Description The expression which was prevented from evaluation by DISABLE EVALUATE is to be evaluated again lt expression gt The item with this expression is enabled Note that lt expression gt has to match literally the expression to be enabled e g a b does not match b a ID lt eval id gt The expression with the ID number lt eval id gt is enabled ALL All disabled expressions from the list are enabled Examples ENABLE EVALUATE globstat ENABLE EVALUATE ID 3 References DELETE EVALUATE DISABLE EVALUATE SET EVALUATE SHOW EVALUATE Debugging C Programs C79000
10. C Near 16 C Far 16 phe C binary C Near 32 C Far 32 I Based I Auto Update Enter the memory address and choose the size and the format the memory contents are to be displayed in The Browse button summons the XDB symbol browser You find a detailed description of the symbol browser in chapte Updating the memory window automatically whenever the contents of the memory are changed might reduce the performance thus you can choose whether the memory window is to be updated automatically by activating the Auto Update checkbutton If the start address of the memory window is not a constant expression you may want the memory window to follow whenever the value of the expression changes In this case activate the Based checkbutton to set the memory window to the so called based mode Example Define a debugger variable called MEMSTART with the initial value 3 by issuing the following line in the command window DEFINE SYMBOL VALUE 3 MEMSTART Debugging C Programs 1 20 C79000 G7076 C520 01 Organon XDB User Interface Now create a memory window in based mode with the start address 0x1000 MEMSTART and the new memory window starts at address 0x3000 Now change the value of the variable by typing SET VALUE MEMSTART 5 into the command window and the memory window displays the memory starting at address 0x5000 e CPU Structures This item enables you to manipulate some CPU sp
11. If a macro body spans more than 1 line a backslash character must be entered immediately before the newline character If the macro contains more than one command the commands must be separated by semicolons Examples EFINE MACRO EFINE MACRO EFINE MACRO EFINE MACRO EFINE MACRO OO zone MAC CON FIL OV BU 0O SET BREAK AT 1 TINUE RUN ENAM testset 1 ERWRITE OLDMAC parr 1 2 TTON Symbols SHOW ACTIVE 1 Some macro invocations MACO LINE 20 n ET LOGFILE FIL References DELETE MACRO SHOW MACRO SHOW BUTT 2 16 ON ENAM log MAC1 BREAKPOINT main Debugging C Programs C79000 G7076 C520 01 Organon XDB Command Set 2 9 DEFINE SYMBOL Syntax DEFINE SYMBOL OVERWRITE ADDRESS lt expression gt TYPE lt type gt VALUE lt expression gt lt symbol name gt Description This command generates a symbol called lt symbol name gt which behaves like a debugger variable or a program symbol The optional parameter TYPE can be used to define a type for the symbol To store an initial value use the VALUE option ADDRESS lt expression gt This optional parameter specifies the address of the symbol If no address is given the symbol is taken to be a debugger variable OVERWRITE By default overwriting an existi
12. SET ESCAPE lt esc_sequence gt The escape sequence to finish the transparent mode is defined All inputs from the keyboard are given to the remote system The input of lt esc_sequence gt terminates this state SET ESCAPE lt var gt As above but the contents of the debugger variable lt var gt is taken as the new escape sequence The default sequence is L ctrl L Control characters are denoted as Achar The control characters C and S must not be used Examples SET ESCAPE A SET ESCAPE Xc References REMOTE SHOW ESCAPE Debugging C Programs C79000 G7076 C520 01 2 81 Organon XDB Command Set 2 58 SET EVALUATE Syntax SET EVALUATE lt format gt lt size gt ADDRESS LEVEL lt nr gt WINDOW lt nr gt lt expr gt Description The mentioned lt expression gt is stored in an internal list After every STEP NEXT or RUN command all expressions from this list are evaluated and the results are written to the command window If local variables are monitored they are evaluated only if they are valid at the current point of the program As a default scalar values are in decimal and all pointers are in hexadecimal notation If a pointer has the value 0 the string NIL is printed In case of function pointers the name of the procedure which is referenced by the pointer is printed format The option lt format gt may b
13. debugged block or function String constants are not addressible There is no task attached to the debugger The equivalence between pointers and arrays is only possible for the first index stage The unary operator is not allowed for this type This operator does not allow operands of type float or double no procedure type for This operator does not allow CLASS TEXT E no addressible expression E expression not addressible E no array type for E no physical address for end of block E no valid block E string constant not allowed E no current task E cannot address as subarray E unary not allowed for E no float double type for E E no index allowed operands of type procedure The expression is not of type array or pointer An index offset specification is not allowed Debugging C Programs C79000 G7076 C520 01 CODE L B NIND L B NLNO L B NMAIN L B NMB L B NMOF L B NOBD L B NOEV L B NOEX L B NOHXNM L B NOLV L B NOMV Debugging C Programs C79000 G7076 C520 01 CLASS TEXT E no indirection allowed E no code line use E MAIN symbol not found for E not a struct union member for E no offset address E boundfile not found E not a enum member E missing expression E missing filename of hex record E no lvalue E MOVE not allowed Organon XDB Error Messages DESCRIPTION The expression is usable for dereferencing or indexing The given line
14. detects a warning Debugging C Programs 3 20 C79000 G7076 C520 01 CODE M D IONE M H HEAM M H HEFM M H HEIN M H HEOP M H HEUN M I HICM M I HIDL M I HIID M I HIOP M M CLAC M M CLOK Debugging C Programs C79000 G7076 C520 01 CLASS TEXT E too deeply nested input ambiguous topic name HELP file format error can t setup HELP can t open HELP file unknown topic illegal history command delete history ID no command word can t open help file read write access denied Target i o redirected to Organon XDB Error Messages DESCRIPTION Your input sources BATCH file MACROS are nested too deeply The input string matches more than one help topic Supply more characters The help file is corrupt Check your disk and restore it The help feature cannot be started Check the correctness of your help file The help file cannot be opened Check your installation or disk This topic is not found in the help tables This command is not allowed in HISTORY mode Consult your manual The deletion of the history member with lt id gt failed The entered string is not a command word The help test database cannot be opened The shown device cannot be used for read and write i o The target in output is redirected to the shown device 3 21 Organon XDB Error Messages CODE M M MABE M M MACV M M MAIT M M MALO M M MASU M M
15. recursively until any non structured type is found Examples SHOW TYP SHOW TYP xtable prio BJ IA References SHOW DECLARATOR SHOW INFO Debugging C Programs 2 146 C79000 G7076 C520 01 Organon XDB Command Set 2 103 SHOW VERSION Syntax SHOW VERSION Description This command displays the version number of your XDB version in the command window Example SHOW VERSION Debugging C Programs C79000 G7076 C520 01 2 147 Organon XDB Command Set 2 104 SHOW WATCHPOINT Syntax SHOW WATCHPOINT AT lt expression gt SHOW WATCHPOINT ID lt halt id gt SHOW WATCHPOINT ALL Description The status and count expression and action parameters for the watchpoints and their ID numbers are displayed The status can be ENABLE DISABLE or CURRENT The status CURRENT means that the last program stop is caused by this watchpoint AT lt expression gt The watchpoint at the address denoted by lt expression gt is displayed D lt halt id gt The watchpoint with the ID number lt halt id gt is displayed ALL All existing watchpoints are shown Examples SHOW WATCHPOINT ID 13 SHOW WATCHPOINT ID DBID SHOW WATCHPOINT ALL References DELETE WATCHPOINT SET WATCHPOINT Debugging C Programs 2 148 C79000 G7076 C520 01 Organon XDB Command Set 2 105 SPAWN Syntax SPAWN lt command gt lt arguments gt Description Executes the specified command and passes the o
16. 32 C79000 G7076 C520 01 Organon XDB Command Set 2 24 DISABLE TRACEPOINT Syntax DISABLE TRACEPOINT DISABLE TRACEPOINT DISABLE TRACEPOINT Description lt expression gt ID lt halt id gt ALL AT lt expression gt ID lt halt id gt ALL A tracepoint is set inactive This means that XDB does no longer check the memory location until this tracepoint is set active again by the ENABLE TRACEPOINT command However XDB preserves all information about the selected tracepoints in the internal tables Therefore it is easy to activate them again This expression yields the address where a tracepoint is located This is the number of the tracepoint to be set inactive It is a decimal number or a debugger variable containing the ID number All tracepoints are set inactive On the target system this tracepoint is really cleared The resources like debug registers used by the disabled tracepoint can be reused Examples DISABLE TRACEPOINT AT putrecord DISABLE TRACEPOINT AT calculate erg0 DISABLE TRACEPOINT ID BRKSYM1 DISABLE TRACEPOINT ALL Debugging C Programs C79000 G7076 C520 01 2 33 Organon XDB Command Set References DELETE TRACEPOINT ENABLE TRACEPOINT SET TRACEPOINT SHOW TRACEPOINT 2 34 Debugging C Programs C79000 G7076 C520 01 Organon XDB Command Set 2 25 DISABLE WATCHPOINT Syntax DISABLE WATCHPOINT AT lt expression
17. All members of structured data types are shown with their member names The value of a union is shown in the format of all union members All elements of arrays are displayed As a default scalar values are in decimal and all pointers are in hexadecimal notation If a pointer has the value 0 the string NIL is printed In case of function pointers the name of the procedure which is referenced by the pointer is printed lt format gt 2 48 The option lt format gt may be one of the following ASCII lt length gt DEC OCTAL BINARY HEX Debugging C Programs C79000 G7076 C520 01 Organon XDB Command Set BINARY DEC HEX OCTAL Values are shown in binary decimal hexadecimal or octal notation if you use the BINARY DEC HEX or OCTAL qualifier ASCII lt length gt The qualifier ASC is used to show a char pointer or a char array as a readable string enclosed in double quotes Nonprintable characters are shown as signs By default a string is shown up to the first 0 byte This can be avoided by giving a length declaration after the ASCII qualifier separated by ASCIl lt length gt Then up to lt ength gt bytes are shown where lt ength gt is any expression ADDRESS The qualifier ADDRESS shows the address where the result of the expression is stored If the expression refers to a register the register name is printed Note that this option is rather meaningless when applie
18. C79000 G7076 C520 01 2 5 Organon XDB Command Set 2 1 BATCH Syntax BATCH STEP ERROR NOOUT ARGUMENTS argIl arg2 lt filename gt Description lt filename gt The name of the batch file To avoid problems with path names including special characters the file name must be enclosed in double quotes ISTEP This option forces single stepping through the batch file and its possible recursive descendants asking for every command to be executed The command is shown at the command window There are four choices for each command Choice Description y execute the command S skip the command c continue without asking anymore e exit batch mode and return to interactive mode ERROR This option stops the execution of commands if XDB detects an error and returns to interactive mode NOOUT This option switches off any update of windows except the error window during execution of a BATCH file ARGUMENTS arg1 arg2 This option allows to pass arguments to BATCH files Up to 40 arguments are allowed An argument is referenced with amp lt argument number gt The argument 0 contains the name of the BATCH file To suppress the expansion Debugging C Programs 2 6 C79000 G7076 C520 01 Organon XDB Command Set of a positional parameter use a backslash character as prefix Undefined parameters are treated as empty strings The parameters are passed as textual strings The q
19. CALLS SHOW DBVAR SHOW DEBUG SHOW DECLARATOR SHOW DESCRIPTOR SHOW DIRECTORY SHOW ESCAPE SHOW EVALUATE SHOW INFO SHOW KEY SHOW LANGUAGE SHOW LEVEL SHOW LOGFILE SHOW MACRO SHOW MEMORY SHOW MODULE SHOW OPTION SHOW PROTFILE SHOW REGISTER SHOW SCOPE SHOW SEGMENT SHOW SOURCE SHOW STATUS SHOW SYMBOL SHOW TASK SHOW TRACEPOINT SHOW TYPE SHOW VERSION SHOW WATCHPOINT Debugging C Programs C79000 G7076 C520 01 Organon XDB Command Set no ro ro na oc o5 o KR NM Oo ea taal ALA 4 Oo Oo mM oO MN N ajj AA aj aA N para O Y na N N jN Ajl O m9 P ro ln AL NUN N N O1 m9 9 _ gt _ t NM Pd oO o m9 9 9 na W Wl wo PO oO mp TS ln wo wo DU Organon XDB Command Set 2 105 SPAWN 2 149 2 106 STEP 2 150 2 107 WHILE 2 164 Debugging C Programs 2 4 C79000 G7076 C520 01 2 Organon XDB Command Set Organon XDB Command Set Organon XDB contains a rich set of commands These commands are listed in alphabetical order below BATCH EXIT BREAK GOTO CLOSE HELP CONTINUE IF DEFINE Label DELETE LINE DISABLE LOAD DISPLAY MESSAGE ENABLE NEXT ERASE PAGE EVALUATE PRINT REMOTE RUN SCAN SEARCH SET SHOW SPAWN STEP WHILE Note that commands and keywords may be abbreviated as long as they are unambiguous E g DEF is recognized as DEFINE while DIS is illegal because it could mean DISABLE as well as DISPLAY Debugging C Programs
20. Cascade The windows are resized and positioned along the diagonal across the area one on top of the other so that their upper left corners are visible Debugging C Programs 1 44 C79000 G7076 C520 01 Organon XDB User Interface e Arrange Icons Like all windows the subwindows can be iconized While you are free to arrange the icons everywhere within the subwindow area this menu item rearranges them along the lower edge of the subwindow area Note that icons of windows being open in the moment are rearranged too e Other Subwindows The lower part of the menu shows a list of all subwindows being on display open or iconized in the moment The active subwindow is checkmarked in the list If you click the name of a subwindow this window is activated i e positioned on top and opened if it was iconized You can issue these commands by clicking them or by hitting the underlined letter or digit while pushing down the lt Alt gt key For example hitting lt Alt A gt rearranges the subwindow icons while hitting lt Alt 3 gt would activate the third subwindow in the picture at the beginning of this chapter this would be the assembler window 1 2 1 8 Help Reference manual Using Help While working with Organon XDB you can get online help Choose one of the following items by clicking it or by hitting lt Alt x gt x being the underlined letter in the menu For example hitting lt Alt H gt has the same effect as click
21. DELETE TRACEPOINT AT lt expression gt DELETE TRACEPOINT ID lt halt id gt DELETE TRACEPOINT ALL Description A tracepoint is deleted It can be selected by the ID number or the location where it is set AT lt expression gt The expression which yields the address where the tracepoint to be deleted is located D lt halt id gt This is a decimal number or a debugger variable lt halt id gt is the number of the tracepoint to be deleted The ID number and the expression of the deleted tracepoint are displayed in the command window ALL This option deletes all specified tracepoints Examples ETE TRACEPOINT AT main buffercount ETE TRACEPOINT AT globptr ETE TRACEPOINT ID 5 ELETE TRACEPOINT ALL oov le le le References DISABLE TRACEPOINT ENABLE TRACEPOINT SHOW TRACEPOINT Debugging C Programs C79000 G7076 C520 01 2 27 Organon XDB Command Set 2 20 DELETE WATCHPOINT Syntax DELETE WATCHPOINT AT lt expression gt DELETE WATCHPOINT ID lt halt id gt DELETE WATCHPOINT ALL Description A watchpoint is deleted It can be selected by the ID number or the location where it is set AT lt expression gt The expression which yields the address where the watchpoint to be deleted is located D lt halt id gt This is a decimal number or a debugger variable lt halt id gt is the number of the watchpoint to be deleted
22. Description lt level gt All current active visible variables of the debugged program with static level greater than or equal to lt eveb are displayed A procedure has a higher scope level than a module lt eve gt 0 displays all currently active variables GLOBAL MODULE CURRENT The symbolic values GLOBAL MODULE and CURRENT respond to the scope levels program global module global and the current scope of the program lt regexp gt If the regular expression lt regexp gt is specified only the symbols whose names match the regular expression lt regexp gt are displayed lt regexp gt may contain the wildcard characters for any character and for any string of characters Examples SHOW ACTIVE 0 SHOW ACTIVE CURRENT ptr SHOW ACTIVE MODULE References SHOW LEVEL SHOW SCOPE Debugging C Programs C79000 G7076 C520 01 2 113 Organon XDB Command Set 2 74 SHOW BREAKPOINT Syntax SHOW BREAKPOINT AT lt expression gt SHOW BREAKPOINT ID lt halt id gt SHOW BREAKPOINT ALL Description The status and the count expression and action parameters for the breakpoints and their ID numbers are displayed The status can be ENABLE DISABLE or CURRENT The status CURRENT means that the last program stop is caused by this haltpoint AT lt expression gt The breakpoint at the address denoted by lt expression gt is displayed D lt halt id gt The bre
23. HW 0 xdb gt set breakpoint at line 100 E L B NLNO no code line use prev 8 next 163 Bi xdb gt run program stopped BREAKPOINT ID 1 at CRM MAIN LINE 168 task CRM_003B 1 xdb gt si Po In this window you are prompted for commands as described in the Command Reference All diagnostics and error messages are written here Debugging C Programs C79000 G7076 C520 01 1 57 Organon XDB User Interface 1 3 1 1 Command Window Editor All the commands you give in the current session including commands read from batch files or issued by user defined buttons are kept in a buffer enabling you to repeat and edit them The following commands are available Everything else you type is inserted into the line When you hit lt Return gt the command is issued and executed You can change from insert mode to overstrike mode and back again by hitting the lt Insert gt key Debugging C Programs 1 58 C79000 G7076 C520 01 Organon XDB User Interface 1 3 2 Source Window E Source CRM crm c Bil Ea s757 a 151 7813 a 5 714 static struct defs d0 pd0 163 printf test started n 164 flgs 1 These flags dictate do 165 d0 flgm 1 the verbosity of 166 do 1 4 the progran 167 d0 flgl 1 168 pdl amp d0 fi 169600 for j 0 j lt sizeof sec sizeof sec 0 j 170 printf test ld addr lx n long j unsigned long sec j 171 d0 rre sec j pd0
24. ID is enclosed in square brackets Examples SHOW TASK SHOW TASK io SHOW TASK data SHOW TASK ID SHOW TASK ID 1 Reference SET TASK Notes The shown states have a different meaning than the states of RMOS tasks Debugging C Programs 2 144 C79000 G7076 C520 01 Organon XDB Command Set 2 101 SHOW TRACEPOINT Syntax SHOW TRACEPOINT AT lt expression gt SHOW TRACEPOINT ID lt halt id gt SHOW TRACEPOINT ALL Description The status and count expression and action parameters for the tracepoints and their ID numbers are displayed The status can be ENABLE or DISABLE AT lt expression gt The tracepoint at the address denoted by lt expression gt is displayed ID lt halt id gt The tracepoint with the ID number lt halt id gt is displayed ALL All existing tracepoints are shown Examples SHOW TRACEPOINT ID 13 SHOW TRACEPOINT ID DBID SHOW TRACEPOINT ALL References DELETE TRACEPOINT SET TRACEPOINT Debugging C Programs C79000 G7076 C520 01 2 145 Organon XDB Command Set 2 102 SHOW TYPE Syntax SHOW TYPE lt regexp gt Description The type definitions of all symbols whose names match the regular expression lt regexp gt are displayed lt regexp gt may contain wildcard characters as and Only basic types and declarators are used to print the type If a structured mode like struct union or enum is used their members are expanded
25. LONG BYTE BYTE WORD LONG BYTE WORD LONG WORD no SIZE allowed WORD no SIZE allowed WORD WORD WORD WORD WORD LONG LONG LONG Debugging C Programs 2 C79000 G7076 C520 01 95 Organon XDB Command Set Examples Legal Sizes TR6 LONG TR7 LONG read only only for SHOW REGISTER only if SET OPTION PENTIUM off 3 only if SET OPTION PENTIUM on only if SET OPTION 180486 on and PENTIUM off The following examples are valid for language ASSEMBLER EGIST ER EAX 0000001 EGIST ER EGIST ER SIZE WORD ESI 0017 AL 45 Nnn Nn J V V J EGIST References ER DI 0786 DISPLAY REGISTER SHOW REGISTER 2 96 Debugging C Programs C79000 G7076 C520 01 Organon XDB Command Set 2 66 SET SCOPE Syntax SET SCOPE DOWN lt levels gt SET SCOPE UP lt levels gt SET SCOPE CURRENT SET SCOPE lt expression gt SET SCOPE Description Set the scope of the debugger The term scope means the current visibility of symbols and types The source window and the assembler window are updated to show the corresponding source lines and machine statements respectively The location fields of the program are enclosed in brackets to signal that the address shown is not the current program address DOWN lt levels gt With this qualifier the scope c
26. Organon XDB Command Set POINTER ASCII HEX If a character pointer is referenced the result can be displayed in hexadecimal or in ASCII depending on this option ASSEMBLER ON OFF ASM ON OFF If this option is set to ON the assembler window shows not only the assembler code but also the appropriate source code lines CODE USE16 USE32 This option determines the way the code segments are interpreted EVALUATE BINARY OCTAL DEC HEX DEFAULT This option sets the default display mode for evaluations The default for this option is DEC lt processor_type gt ON OFF The selected lt processor_type gt forces XDB to disassemble opcode due to the instruction set of the chosen processor The default for all these options is OFF Then disassembly is done for an 80386 processor lt processor_type gt may be one of the following processors 180486 PENTIUM MULTITASK ON OFF This option allows toggling between multitasking mode and compatible mode lf the option is set to ON XDB works in multitasking mode If the option is set to OFF XDB works in compatible mode This option is set to ON by default NOWAIT ON OFF If this option is set to ON XDB works in the original asynchronous mode This is the default If this option is set to OFF the XDB waits until a RUN NEXT or STEP command has been finished Debugging C Programs 2 90 C79000 G7076 C520 01 Examples SET OPTION AUTOLOAD ON SET O
27. R W and C 3 7 Organon XDB Error Messages CODE L B LDSL L B LDSP L B LDSS L B LDTG L B LDTN L B LDUS L B LMAL L B LNCU 3 8 E CLASS TEXT invalid segment length invalid CPU space i o error missing TASK or GLOBAL qualifier missing task name for load segment already used out of memory stopped at no current line DESCRIPTION The length must be a decimal or hexadecimal which is prefixed with a number The CPU space qualifier can have the values UD UP UX SP SD SX XX and CP A disk error occured during loading an image from the host system to the target An attempt to download segments is made without a task or global specification The global task qualifier is set to ON but XDB has currently no task under control There is no task name specified and the TASK option is not set to global The shown segment is already used during the command LOAD There is not enough memory to load the debug information of all modules The load process stopped at the issued name but does not include this module The program stops at an invalid source line Debugging C Programs C79000 G7076 C520 01 CODE CLASS TEXT L B LOGOP E L B MBID E L B MBRK E L B MCUR E L B MLIN E L B MMPU E L B MNLD E L B MODZ E L B MOVE E L B N2PT E L B NADB E Debugging C Programs C79000 G7076 C520 01 can t open logfile no such member too many breakpoints current m
28. The ID number and the expression of the deleted watchpoint are displayed in the command window ALL This option deletes all specified watchpoints Examples DELETE WATCHPOINT AT main buffercount DEI E WATCHPOINT AT globptr DELETE WATCHPOINT ID 5 DELETE WATCHPOINT ALL References DISABLE WATCHPOINT ENABLE WATCHPOINT SHOW WATCHPOINT Debugging C Programs 2 28 C79000 G7076 C520 01 2 21 DISABLE Commands Syntax DISABLE lt item gt The item lt item gt can be one of the following BREAKPOINT EVALUATE TRACEPOINT WATCHPOINT Debugging C Programs C79000 G7076 C520 01 Organon XDB Command Set 2 29 Organon XDB Command Set 2 22 DISABLE BREAKPOINT Syntax DISABLE BREAKPOINT AT lt expression gt DISABLE BREAKPOINT ID lt halt id gt DISABLE BREAKPOINT ALL Description A breakpoint is set inactive This means that a program does not stop at such a haltpoint However XDB preserves all information about the selected haltpoints in the internal tables Therefore it is easy to activate them again This is very useful if you want to reuse haltpoints with complex conditions and actions later lt expression gt This is the expression which yields the address where a breakpoint is located ID lt halt id gt This is the number of the breakpoint to be set inactive It is a decimal number or a debugger variable containing the ID number A
29. and Non Interactive In the interactive mode Organon XDB expects you to issue commands whereas the debugger finishes the session immediately after reading and executing the initial batch file if you switch to non interactive mode e Add Underscore Your compiler might change the symbol names by adding an underscore or dot to it e g a procedure you named init might be called init init init_ or init in the assembler code You have to tell Organon XDB which way the compiler translating your program uses The default value is None e CPU Organon XDB disassembles opcode due to the instruction set of the chosen processor During a debug session this option can be modified with the SET OPTION command Debugging C Programs C79000 G7076 C520 01 1 5 Organon XDB User Interface e Use only hardware breakpoints Breakpoints are points which can be set arbitrarily into your program and whenever the execution of the program meets such a breakpoint it is stopped at this point enabling you to examine the state the program is in Organon XDB can simulate breakpoints by maintaining a list of set breakpoints and looking whether the execution encountered one of them But looking for breakpoint encounters before every step of execution is rather time consuming slowing down the execution speed If you want to use debug register breakpoints only to enhance the performance choose this option e Convert symbols to upper case If you enter thi
30. are currently visible on stack L B SVCO E set value of a Set value of a constant constant expression expression is possible in only in assembler language assembler only L B SYBA W address not resolved The address lies outside of any known memory region L B SYMB E symbol not found The symbol is not found in the requested scope Possibly the name is wrong or the path name specification is insufficient L B SYNA E symbol not The symbol is not reachable at addressible this state of the debugger scope view Debugging C Programs 3 18 C79000 G7076 C520 01 CODE L B SYTY L B TID L B TKCP L B TKEC L B TKEN L B TKER L B TKID L B TKIF L B TKIN Debugging C Programs C79000 G7076 C520 01 CLASS TEXT W no type information for int assumed invalid task id capture task failed unmonitored exception invalid exception code task no such task id available INFO about task needed invalid command Organon XDB Error Messages DESCRIPTION The issued symbol references to an unknown type This is a problem of the debug information writer in the compiler The debugger assumes an integer type for this symbol The shown task id is invalid Only numbers greater or equal to zero are allowed An attempt to get the shown task under control of the debugger failed again The shown exception is detected by the hardware interface but the debugger does not control it The shown except
31. arguments To change the scope of symbols visible to Organon XDB click one of the procedures then click the Set Scope button An alternative way to set the scope is to doubleclick the procedure line Note that continuing the execution changes the scope back to the procedure being executed Callstack x 0x0083 0x003857B1 POW2 S241 line 164 lt lt scope 0x0083 0x003852DF 241 241 line 95 0x0083 0x003850CF MAIN 0 CRM line 171 0x0083 0x0038D8B1 __startup 0x35 Cancel Set Scope i gt I Arguments For performance reasons the procedure arguments are shown only if you ask for them Click the Arguments button and the windows changes to Callstack Lx 0x0083 0x003857B1 POW2 N 6 S241 line 164 lt lt scope 0x0083 0x003852DF 5241 PDO 0x8B 0x003710CC 241 lin 0x0083 0x003850CF MAIN N 1 ARGS 0x8B 0x0037109C CF 0x0083 0x0038D8B1 __startup 0x35 Cancel Set Scope 4 M Arguments Debugging C Programs 1 34 C79000 G7076 C520 01 Organon XDB User Interface 1 2 1 5 Language v C C Pascal Assembler The expressions entered for evaluation as well as the breakpoint conditions are by default assumed to be C expressions You can switch to another language by clicking it or by hitting the underlined letter while pushing down the lt Alt gt key for example hit lt Alt P gt to set the language to Pascal This menu allows you to change to the following languages e C C Note that expressio
32. breakpoint XDB issues a warning message if the requested breakpoint cannot be executed in real time This is true if a WHEN clause is used THEN lt actions gt END lt actions gt is an optional command list enclosed by the keywords THEN and END It is executed if the program stops at this breakpoint If more than one action is specified they must be separated by a delimiter Debugging C Programs 2 74 C79000 G7076 C520 01 Examples SET BREAKPOINT AT calculate LINE 10 n wW vol EAKPOINT D SET BREAKPOINT AT txtofil WHI iT rundown SET BREAKPOINT AT server hidden SET BREAKPOINT AT LIN E17 WH EN outcount gt 10 EN loop gt end 5 THEN EVALUATE templ EVALUATE erg EAKPOINT AT checkpoint CONTINUI Gl END SET BREAKPOINT AT toggle SKIP 20 SET BR THEN EVAL counter END SET BREAKPOINT AT fun2 SYMBOL DBID References DELETE BREAKPOINT DISABLE BREAKPOINT ENABLE BREAKPOINT SHOW BREAKPOINT Debugging C Programs C79000 G7076 C520 01 Organon XDB Command Set 2 75 Organon XDB Command Set 2 54 SET DEBUG Syntax EBUG lt debug id gt Description Select between multiple debug information trees If more than one image was loaded by the debugger the corresponding debug information is stored in separate so called debu
33. by a click or by hitting the space bar This increases the value of the bit group by 1 wrapping around the maximal value The focus can be moved left or right with the cursor left and cursor right keys Some bit groups are so large that changing them in the manner described above would be cumbersome Thus a different mechanism to change their contents was implemented Just doubleclick the bit group or its name displayed in the layout field then enter the new value as a decimal octal or hex number Bit groups with this change mechanism are displayed hatched viz You find a short description of the focused bit group and its current value below the Descriptor Layout field The Description field at the bottom of the box shows a summary of the contents of the descriptor Changed bits are displayed in enhanced color in the Descriptor Layout field Bits which are not accessible directly i e by clicking them in the Descriptor Layout field are displayed in gray indicating they are disabled Debugging C Programs C79000 G7076 C520 01 1 81 Organon XDB User Interface 1 4 1 2 Reload Table The descriptor table is not updated automatically when the target memory is changed e g by performing a step Choose this menu item to update the table on display Note that the whole table on display is updated it does not matter which line was clicked to summon the pop up menu 1 4 1 3 Set Range This menu item enables you to change
34. char char int STRNCMP char char int STRNCPY char char int TAN double Debugging C Programs C79000 G7076 C520 01 2 107 Organon XDB Command Set Function _ Argumens_ TOASCII TOLOWER TOUPPER Valid register names see SET REGISTER Examples n ET VALUE loop 10 ET VALUE angle 1 27le 13 n References EVALUATE SET REGISTER Debugging C Programs 2 108 C79000 G7076 C520 01 Organon XDB Command Set 2 71 SET WATCHPOINT Syntax n ET WATCHPOINT LENGTH lt bytes gt ACCESS FETCH READ WRITE ALL AT lt expression gt SKIP lt count gt SYMBOL lt dbid gt HARD lt number gt CONTINUE THEN lt actions gt END Description If the location of lt expression gt is accessed in a way specified by ACCESS and LENGTH and the SKIP counter decrements to zero the program stops The default value for lt count is 1 for LENGTH the size of the result of lt expression gt and for ACCESS it is WRITE If there is no debug register left or the expression can not be controlled by a single debug register the watchpoint is simulated by XDB This slows down the speed dramatically so that XDB issues a warning message CAUTION trace or watchpoint not maskable must be simulated which must be confirmed by the user Under simulation only WRITE is possible as ACCESS value Respectively WRITE is poss
35. click the Ok button the result is printed to the command window If you click the Window button instead an evaluation window is created 1 2 3 16 Create Memory Window This button is identical to the menu item Display Memory It causes the creation of anew memory window The Browse button shows the addresses of all symbols visible within this scope You find a detailed description of the symbol browser in chapte More than one memory window may be open Debugging C Programs C79000 G7076 C520 01 1 55 Organon XDB User Interface 1 2 3 17 Display Callstack This button is identical to the menu item Debug Calls The stack of procedure calls is displayed The procedures are listed with their names addresses and arguments To change the scope of symbols visible to Organon XDB click one of the procedures then click the Set Scope button An alternative way to set the scope is to doubleclick the procedure line Note that continuing the execution changes the scope back to the procedure being executed Callstack x 0x0083 0x003857B1 POW2 0 5241 line 164 lt lt scope 0x0083 0x003852DF 241 241 line 95 0x0083 0x003850CF MAIN Q CRM line 171 0x0083 0x0038D8B1 __startup 0x35 Cancel Set Scope 4 gt I Arguments For performance reasons the procedure arguments are shown only if you ask for them Click the Arguments button and the window changes to Callstack x 0x0083 0x003857B1 POW2 N 6 5241 line 16
36. current line i e the next line to be executed is line 100 the expression LINE SOURCELINE 10 makes Organon XDB continue the execution until line 110 is reached Blockend The end of the block is reached A block is a number of statements which are bundled together e g statements enclosed in braces in a C program Procend The end of the procedure is reached The next step of execution will be the jump back to the calling routine If this command is issued while the execution is in the main routine it continues until the end of the program is reached Caller Run until the calling routine is reached useful in subroutines only Debugging C Programs 1 22 C79000 G7076 C520 01 Organon XDB User Interface If the condition is true already when you issue this command e g run until line 50 when the current line is line 50 the execution stops immediately i e nothing is done Note that the execution stops if a breakpoint or a watchpoint is encountered regardless of the condition you chose Example O Expression Cancel C End of block Browse C End of procedure C Caller As the line pointer of the source window marks the source code line 168 Organon XDB suggests to execute until this line You can confirm this by clicking the Ok button or hitting lt Return gt or you can enter another line number or choose any other condition Browse invokes the symbol browser which is
37. debugger If no task is specified by D the current task is attached DETACH ID lt task_id gt With this option a task can be detached from the debugger If no task is specified by D the current task is detached The Organon XDB attempts to exit and then delete the current task with the command set task detach as well as enabling assigned memory and resources STEP This option modifies the state of the currently monitored task This allows to unlock tasks which run into an unpredictable state The task state is modified to a normal halted state The current location of the application is not changed SET ID lt task_id gt With this option the current task is set to the task specified by lt task_id gt Debugging C Programs 2 100 C79000 G7076 C520 01 Organon XDB Command Set DEBUG lt debug_id gt ID lt task_id gt With this option the debug information specified by lt debug_id gt is assigned to a task If no task is specified by ID the current task is used KILL Sends a FREETASK command with the current RMOS task ID to the target deletes the task and frees the memory on the target This option works only if the task is in state DORMANT RMOS INIT XDB Examples SET TASK ATTACH ID 4 SET TASK DETACH SET TASK SET ID 1 References SHOW TASK Debugging C Programs C79000 G7076 C520 01 2 101 Organon XDB Command Set 2 69 SET TRACEPOINT Syntax
38. existent the execution does not stop when the watched piece of memory is accessed Of course disabled watchpoints can be enabled again The Enable button is visible only if you click a disabled breakpoint Delete and Delete all delete the watchpoint marked by inverted color display resp all existing watchpoints Edit Watchpoints 3 CRM MAIN D0 disabled S 0 CS 0 4 CRM MAINSSEC addr 0x02B8 0x00000000 len 84 acc enabled S 0 CS 0 am a Dea The watchpoints are displayed in the following form lt n gt lt pos1 gt addr lt pos2 gt len lt ength gt acc lt access gt lt status gt S lt skip gt CS lt current_skip gt A C HW lt hard gt SYMBOL lt name gt THEN lt actions gt END where lt n gt is the id number of the watchpoint lt pos1 gt and lt pos2 gt are the location in the source code resp assembler code lt length gt is the length in bytes of the watched memory lt access gt can be R for read W for write F for fetch or X for all lt status gt may be enabled disabled or current The latter indicates that the execution is halted due to this watchpoint Debugging C Programs C79000 G7076 C520 01 1 31 Organon XDB User Interface lt skip gt is the skip number lt current_skip gt indicates how many times this watchpoint will be skipped until it stops the execution l e whenever this watchpoint is encountered lt current _ skip gt is decrement
39. gt DISABLE WATCHPOINT ID lt halt id gt DISABLE WATCHPOINT ALL Description A watchpoint is set inactive This means that a program does not stop at such a haltpoint However XDB preserves all information about the selected haltpoints in the internal tables Therefore it is easy to activate them again This is very useful if haltpoints with complex conditions and actions are to be deleted temporarily lt expression gt This is the expression which yields the address where a watchpoint has been set ID lt halt id gt This is the number of the watchpoint to be set inactive It is a decimal number or a debugger variable containing the ID number ALL All watchpoints are set inactive On the target system this watchpoint is really cleared The resources like debug registers used by the disabled watchpoint can be reused Debugging C Programs C79000 G7076 C520 01 2 35 Organon XDB Command Set Examples DISABLE WATCHPOINT AT putrecord DISABLE WATCHPOINT AT calculate erg0 DISABLE WATCHPOINT ID BRKSYM1 DISABLE WATCHPOINT ALL References DELETE WATCHPOINT ENABLE WATCHPOINT SET WATCHPOINT SHOW WATCHPOINT 2 36 Debugging C Programs C79000 G7076 C520 01 Organon XDB Command Set 2 26 DISPLAY Syntax DISPLAY lt window gt Description With this command it is possible to display additional windows These windows can be displayed and erased at any time during the debugging s
40. hidden by later calls There are also restrictions if the top level function has not passed its prologue code which moves the parameters from the stack into their registers LE VEL lt number gt With LEVEL only the first lt number gt of nested calls are displayed Debugging C Programs 2 116 C79000 G7076 C520 01 Examples SHOW CALLS SHOW CALLS ARG UMENTS SHOW CALLS LEV EL 3 ARGUMI Reference SET SCOPE Debugging C Programs C79000 G7076 C520 01 ENTS Organon XDB Command Set 2 117 Organon XDB Command Set 2 77 SHOW DBVAR Syntax SHOW DBVAR lt regexpr gt Description All debugger variables which match the regular expression lt regexpr gt are printed to the command window lt regexpr gt may contain wildcard characters as or The regular expression may be enclosed in to protect them from the keyword scanner Examples SHOW DBVAR s SHOW DBVAR Notes The character is not a part of the variable names and must not be used in the regular expression Debugging C Programs 2 118 C79000 G7076 C520 01 Organon XDB Command Set 2 78 SHOW DEBUG Syntax SHOW DEBUG ID lt debug id gt lt module gt Description ID lt debug id gt With the optional ID parameter a special debug tree can be selected If the lt debug id gt value is omitted all available debug IDs with their modules are displayed The current ID is enclosed in square brac
41. list SIZE lt size gt 2 104 This optional parameter defines the number of bytes to be written The following values are allowed for lt size gt 1 byte is written 2 bytes are written 4 bytes are written Debugging C Programs C79000 G7076 C520 01 Organon XDB Command Set FLOAT EXTEND DOUBLE NEAR16 NEAR32 FAR16 FAR32 CONSTANT lt number gt REPEAT lt number gt a floating point number is written an extended number is written a double number is written a near 16 pointer is written a near 32 pointer is written a far 16 pointer is written a far 32 pointer is written number of bytes specified by lt number gt are written If this option is specified the value of lt expression2 gt is written not only into the address denoted by lt expression1 gt but also to the following lt number gt pieces of memory If e g lt number gt equals 3 the value of lt expression2 gt is written four times altogether There are internal predefined debugger variables and macro functions Their names must not be used to define new XDB variables If these names are used for macro definition the predefined function is overwritten and is available again after deleting the user defined macro Debugging C Programs C79000 G7076 C520 01 2 105 Organon XDB Command Set 2 106 The following internal variables are predefined Variable Meaning Remark BWID CS CURRLINE EFL EIP ERROR ER
42. must follow the END keyword Example IF commandtype 4 THEN EVALUATE ASCII commandname ELSE EVALUATE commandclass END Debugging C Programs 2 54 C79000 G7076 C520 01 Organon XDB Command Set References WHILE GOTO Label Debugging C Programs C79000 G7076 C520 01 2 55 Organon XDB Command Set 2 41 Label Syntax lt label gt Description The actual line is marked by the label lt abel gt This command is allowed in batch files only Labels must start with an alphabetic character Labels can be used as jump targets of the GOTO command Example line text 1 SET BREAK AT fune 2 Label RUN 3 EVALUATE I J 4 GOTO Label References GOTO BATCH Debugging C Programs 2 56 C79000 G7076 C520 01 Organon XDB Command Set 2 42 LINE Syntax INE UP lt lines gt LINE DOWN lt lines gt INE lt line number gt LINE CURRENT Description With the LINE command you can scroll up or down in the source window UP lt lines gt DOWN lt lines gt UP or DOWN specifies the direction of the movement The lt ines gt parameter is optional The default value is 1 The movement is relative to the currently displayed line lt line number gt If UP or DOWN is omitted lt ine number gt denotes an absolute line in the shown source file CURRENT The cursor is positioned at the current location of the progra
43. not identified by address breakpoint already on this location bad range type Organon XDB Error Messages DESCRIPTION The PAGE command is not allowed in the assembler window This symbol contains corrupt debug data The debug information is loaded already The entered expression was not found in the internal tables This evaluation ID was not found in the internal tables IDs must be positive numbers The specified break watch or tracepoint can not be found the commands DELETE ENABLE or DISABLE are impossible Another breakpoint at this address is already enabled More than one breakpoint at the specified address This source location is already monitored by a breakpoint It is set only once It is not allowed to prefix the shown type with a range definition 3 3 Organon XDB Error Messages CODE L B BWN L B COMT L B CSOP L B CSTW L B CSTY L B CUMT L B DBDC L B DBFM L B DBID L B DBND L B DBNE L B DBNM 3 4 CLASS TEXT E invalid window E unary bitwise not not allowed for E not allowed implicit cast W can t cast E can t cast E not current module E create debug image descriptor E bad debug format E no such debug id available E may not delete debug id E undefined debugger variable E can t build debug image name DESCRIPTION This command is not allowed in this window The bitwise not operator is not allowed for this type
44. not found open lock directory write to password file file version not available 0 assumed can t redirect XDB and CHILD output read write access denied Debugger i o redirected to Organon XDB Error Messages DESCRIPTION The id of the host system XDB currently runs on cannot be read The input line was too long The path to the XDB license file cannot be made The lock file cannot be opened for writing Check the permissions The path to the lock directory cannot be made The path to XDB was not found The lock directory was not found Write error on password file Check disk quota The shown file is not accessible with the original version number Only one of them can be redirected to another in out device The shown device cannot be used for read and write i o The in output of XDB is redirected to the shown device 3 23 Organon XDB Error Messages CODE CLASS TEXT DESCRIPTION U E AGREG E CPU register The second parameter of an expected indirect addressing mode has to be a register U E AILL E illegal expression The input string does not forma legal assembler expression U E AIREG E index register A register is required which is required suitable for an indexed addressing mode U E AMISS E missing Supply it U E ARPAR E missing A is missing Supply it U E CID E identifier required A C ldentifier is necessary at this point of the expression U E CMA E e
45. not stop here Of course disabled breakpoints can be enabled again by clicking the Enable button which is visible only if you click a disabled breakpoint Delete and Delete all delete the breakpoint marked by inverted color display resp all existing breakpoints Modify allows the change of the details of the specified breakpoint Just click the item you want to change and edit it Note that the condition if existent must follow the rules of the current language see chapter 1 2 1 5 Edit Breakpoint ID 0 Location CRM LINE 176 Condition count gt 7 Cancel as Skip 5 Symbol K Hard O Continue Like in Set Breakpoint see above the ability to Browse is given You find a detailed description of the symbol browser in chapte Debugging C Programs C79000 G7076 C520 01 1 29 Organon XDB User Interface e Set Watchpoint When debugging a program you may wish the program to stop whenever a certain piece of memory is accessed This stopping is done by setting a watchpoint A watchpoint is set by specifying its symbolic address the Location the Length of the memory in bytes to be watched 4 by default and the Access mode default All A Skip number can also be issued see below Browse gives a list of usable symbolic addresses see chapter 1 2 2 for a detailed description of the symbol browser The watchpoint can be given a Symbol or name for easy access in commands If the ha
46. number does not point to a real code location Use the shown alternatives The language specific entry point cannot be found for the current language ore one the other possible debugger languages The term following the member of operator is not of type member of anything The left side expression is not suitable to enter using an offset no structure array No bound file found for this debug id The shown string is nota member of the given enumeration constant An expression node is required Check your input The file name of the hex record has not been specified The entered expression is not usable to form an address This version of XDB does not allow the movement of windows 3 11 Organon XDB Error Messages CODE L B NOP L B NOSP L B NOTG L B NOTK L B NOTT L B NOTY L B NPEA L B NPRC L B NPTR L B NSGA L B NSMO L B NSNF 3 12 CLASS TEXT no binary operator no SPAWN command no target type no task to reset unary not allowed for command not yet implemented no physical address for end of procedure no valid procedure no pointer type for no segment list no source module displayed segment name not found DESCRIPTION The operator is not usable for an expression with 2 operands This version of XDB does not support the command SPAWN This type is not a structure union or enum There is no task known for the debugger The un
47. number of the first table entry to be displayed The default value is 1 for the GDT and 0 otherwise REPEAT lt count gt The expression lt count gt specifies the number of table entries to be displayed If this option is not specified 64 entries will be displayed GDT lt index gt The expression lt index gt denotes the number of the GDT entry This entry must be an LDT selector If this option is not specified the register LDTR is taken so that the descriptor table of the current task will be displayed Examples DISPLAY IDT DISPLAY GDT REPEAT 20 1 DISPLAY LDT REPEAT 5 GDT 1 Reference ERASE Debugging C Programs C79000 G7076 C520 01 2 39 Organon XDB Command Set 2 28 DISPLAY SYSREG Syntax DISPLAY SYSREG lt register gt Description DISPLAY SYSREG displays the system register windows lt register gt may have the following value CONTROL CONTROL The 80386 control register window is displayed Example DISPLAY SYSREG CONTROL Reference ERASE SYSREG Debugging C Programs 2 40 C79000 G7076 C520 01 2 29 ENABLE Commands Syntax ENABLE lt item gt The item lt item gt can be one of the following BREAKPOINT EVALUATE TRACEPOINT WATCHPOINT Debugging C Programs C79000 G7076 C520 01 Organon XDB Command Set 2 41 Organon XDB Command Set 2 30 ENABLE BREAKPOINT Syntax ENABLE BREAKPOINT ID lt halt id gt ENABLE BREAKPOINT
48. that the breakpoint is supposed to be at the beginning of the line For example a breakpoint at source code line 100 will stop the program after line 99 was executed By default Organon XDB implements breakpoints by software interrupts which are inserted into the code If you want to use processor maintained breakpoints only choose the Hard option This is especially useful when the program code to be debugged is stored in EPROM Browse shows as usual a list of the known symbols You find a detailed description of the symbol browser in chapter Click Ok to create the breakpoint or Cancel to cancel the operation Debugging C Programs C79000 G7076 C520 01 1 27 Organon XDB User Interface e Edit Breakpoints This is useful when details of existing breakpoints are to be changed The pop up window shows all existing breakpoints Edit Breakpoints 0 CRM LINE 176 addr 0x02B8 0x000000D9 WHEN J lt 5 enabled S 0 CS 0 HW Ok 1 CRM LINE 164 addr 0x02B8 0x0000001D enabled S 0 CS 0 HW 1 T 2 CRM LINE 170 disabled S 0 CS 0 T Cancel Add new Disable O Perean The breakpoints are displayed in the following form lt n gt lt p1 gt lt p2 gt WHEN lt cond gt lt status gt S lt skip gt CS lt current_skip gt A C HW lt hard gt lt scope gt SYMBOL lt name gt THEN lt actions gt END where lt n gt is the id number of the breakpoint lt p1 gt a
49. vector is used as an index to get a gate descriptor from this table To change the register value set the focus to one of the value fields i e click the field or hit lt Alt gt and the underlined letter then enter a number octal decimal or hex Debugging C Programs 1 84 C79000 G7076 C520 01 Organon XDB User Interface 1 4 2 2 Update The control register table is not updated automatically when the target CPU registers change e g by performing a step Choose this menu item to update the table on display Note that the whole table on display is updated it does not matter which line was clicked to summon the pop up menu 1 4 3 Register Window The Organon XDB386 offers the ability to manipulate the register contents This feature is explained in this chapter 1 4 3 1 General Registers If you click a register name or register value with the right mouse button this menu appears Only the first item Value is enabled Select it to summon the following dialog box This dialog box also pops up if you doubleclick the register value circumventing the menu EAX Format default octal decimal binary hexadecimal ascii The Format radio buttons determine the display format of the value You can change the register value by entering an expression into the Value field The change takes place if you click Ok or hit lt Return gt Note that the Follow button is always disabled Debuggin
50. words you can go back to the initial start address after an arbitrary number of address changes If no previous address exists this menu item is disabled e Assembler This menu item opens the assembler window unless it is open already The assembler window is set to the address marked by the memory window cursor Debugging C Programs 1 72 C79000 G7076 C520 01 e Watchpoint Organon XDB User Interface Select this item to set a watchpoint to the location marked by the memory window cursor The dialog box popping up is the same as invoked by the main menu item Debug Set Watchpoint described in chapter 1 2 1 4 e Size You can tell XDB how to group the array of bits it extracts from the memory Click the size you want or hit the underlined letter The current size is checkmarked Modify Start Address Reload Home Follow Back Assembler Watchpoint ByE Format Word v Based Mode Long Auto Update Float Double Extended Pointer Near 16 Pointer Far 16 Pointer Near 32 Pointer Far 32 e Format This menu item enables you to change the display format of the memory window Click the format you want or hit the underlined letter The current format is checkmarked Modify Start Address Reload Home Follow Back Assembler Watchpoint Size gt v Hexadecimal Based Mode Decimal v Auto Update Octal Binary Debugging C Programs C79000 G7076 C520 01 1 7
51. 0 The assembler protocol contains the assembler instructions where the execution stopped or nothing if the assembler window was hidden ASM creation date Thu Feb 9 14 20 16 1995 I ASM 0188 0000001D C7 05 70 00 MOV DWORD PTR DS MAIN 00000070 00000001 I ASM 0188 00000045 C7 05 90 00 MOV DWORD PTR DS MAIN 00000090 00000054 Debugging C Programs 1 17 C79000 G7076 C520 01 Organon XDB User Interface e Open Logfile All commands written into the command window are copied into the logfile so that it can be used later as a batch file to repeat the session Some restrictions apply when using logfiles as batch files if XDB works in the multitasking mode If you issue this command the file browser see chapter 1 2 2 1 is invoked Choose the appropriate directory then enter a file name Because opening a logfile that existed already will destroy the contents of the old file you will be asked to confirm this e Close Logfile Closes the logfile None of the following commands will appear in the logfile e Save Settings Saves the colors fonts and window positions for subsequent sessions These informations are written into the Windows registry You are asked to confirm this to avoid an accidental change e Exit Ends the Organon XDB session closing all output files still open You are asked to confirm the exit to assure you really want to leave Organon XDB really quit xi Debugging C Programs 1
52. 00 G7076 C520 01 Organon XDB User Interface and is therefore disabled in the IDT case Write the number of items to be displayed into the Length field then click Ok or hit lt Return gt A similar dialog box appears when you choose to display an LDT Local Descriptor Table Additionally to the items mentioned above you have to choose which LDT to display by entering the appropriate GDT index number to display the LDT of the current task which is referenced to by the LDTR register activate the LDTR button Display Descriptor Table LDT Table Start Index Selector LDTR O GDT Index id Length LDT Selector Now the descriptor table is loaded from the target During loading the following is displayed Working 32 Uploading descriptor table please wait Afterwards the descriptor table is displayed GDT Descriptor Table 1 64 Description base 0x00030000 b PETE DPL 0 attr UWA DPL 0 attr UWA DPL 0 USE16 attr NRX DPL 0 USE32 attr NRA G 1b AVL 0 G 1b AVL 0 base 0x00040000 base 0x00040918 bytes limit 0x00000A73 bytes AV386TSS BU386TSS lt illegal gt lt illegal gt AV386TSS BU386TSS DATA SEG DATA SEG CODE SEG If you want to change the table or examine an item in detail click it with the right base 0x0004138C base 0x00042340 base 0x000B0000 basc 0x000B8000 base 0x00000400 base 0x00048000 base 0x00040840 base 0x000408B0 0 0 base 0x0004F330
53. 00 G7076 C520 01 1 59 Organon XDB User Interface You can click one of these items or hit lt Alt gt the underlined letter and Organon XDB will react as follows e Go here Execute the program until the line pointer is reached The line you clicked is not executed e Set Breakpoint Set a breakpoint at the specified line This menu item is not visible if a breakpoint exists already at this position An alternative way to set a breakpoint is to doubleclick the line number e Delete Breakpoint Delete the breakpoint in this line This menu item is visible only if a breakpoint exists at this position An alternative way to delete a breakpoint is to doubleclick the line number e Run until caller Useful in subroutines only The execution is continued until it returns to the calling routine If the line containing the call is completely processed upon the return the next line becomes the current line Otherwise the calling line remains the current line Example The calling line stores the return value of the subroutine in the variable a viz a sub x y When the execution is inside the subroutine sub you click Run until caller and the rest of sub is processed Now the line above is still the current line sub was processed but its return value is not yet stored in a e Run until return Execute until the routine is left but still remain in this routine The current line is the last source line of the routine If the e
54. 13 2 114 2 115 2 116 2 118 2 119 2 120 2 121 2 124 2 125 2 126 2 127 2 128 2 129 2 130 2 131 2 132 2 133 2 135 2 136 2 137 2 139 2 139 2 140 2 141 2 142 2 143 2 144 2 145 2 146 2 147 2 148 2 149 2 150 2 152 Debugging C Programs C79000 G7076 C520 01 Organon XDB User Interface 1 ORGANON XDB USER INTERFACE 1 1 1 1 1 1 1 2 l bh N li e ee LL ci i dh ib hihihiihi RR ONDORWD 4 N N 1 2 2 2 1 2 3 1 2 3 1 1 2 3 2 1 2 3 3 1 2 3 4 1 2 3 5 1 2 3 6 1 2 3 7 1 2 3 8 1 2 3 9 1 2 3 10 1 2 3 11 1 2 3 12 1 2 3 13 1 2 3 14 1 2 3 15 1 2 3 16 1 2 3 17 1 2 3 18 Starting Organon XDB Start up Dialog Starting problems Description of the Main Window Menu Panel File Display Run Debug Language Options Windows Help Browsers The Windows File Browser The Organon XDB Symbol Browser Buttons Load Search Step Next Run Recapture Set Scope Up Set Scope Down Set Scope Here Display Hide Source Window Display Hide Assembler Window Display Hide Register Window Display Hide Task Window Display Hide Remote System Window Evaluate Create Memory Window Display Callstack Break Debugging C Programs C79000 G7076 C520 01 1 1 Organon XDB User Interface 1 3 1 3 1 1 3 1 1 1 3 2 1 3 3 1 3 4 1 3 5 1 3 6 1 3 7 1 3 8 1 3 8 1 1 3 9 1 3 10 1 4 1 4 1 1 4 1 1 1 4 1 2 1 4 1 3 1 4 2 1 4 2 1 1 4 2 2 1 4 3 1 4 3 1
55. 18 C79000 G7076 C520 01 Organon XDB User Interface 1 2 1 2 Display v Source Assembler Register Remote Task Memory CPU Structures 180366EX Registers gt This menu allows the opening or closing if already open of several subwindows For a detailed description of these windows see chapter Windows are checkmarked in this menu if they are currently open You can open close these subwindows by clicking their names in the menu or by hitting the underlined letter while pushing down the lt Alt gt key For example hit lt Alt A gt to open the assembler window e Source Displays or hides the source window which shows the source code of the task you debug e Assembler Displays or hides the assembler window which shows the assembly code of the task you debug e Register Displays or hides the register window e Remote Displays or hides the remote system window which gives access to the target system Debugging C Programs C79000 G7076 C520 01 1 19 Organon XDB User Interface e Task Displays or hides the task window which shows all the tasks XDB knows about e Memory Choosing this item causes the creation of a new memory window Note that more than one memory window may be open When you select the item Memory the following dialog box pops up Display Memory Window Lx Address Size Format Cancel Byte Float Choxedecimel fesa C Word C Double C decimal C Long C Extend C octal
56. 3 Organon XDB User Interface e Based Mode If the start address of the memory window is not a constant expression you may want the memory window to follow whenever the value of the expression changes This is the so called based mode You can toggle between based mode and constant mode by selecting this item The menu item is checkmarked if the memory window is in based mode Note that the automatical start address change of a based memory window cannot be undone by means of the item Back e Auto Update If this item is checkmarked the window is updated automatically whenever the memory on display is changed Otherwise it is updated only when you select the menu item Reload You can toggle between these two update modes by selecting Auto Update 1 3 9 Trace Windows Tracepoints can be used to watch a piece of memory e g a variable You can set a tracepoint using the Debug menu in the tool bar see chapter 1 2 1 4 or you can issue the SET TRACEPOINT command in the command window A trace window is opened for every tracepoint and the value stored in the memory to be traced is displayed If a value has changed in the last execution step it is displayed in a different color the so called enhanced color see menu item Options Edit Colors chapter 1 2 1 6 to catch your attention Debugging C Programs 1 74 C79000 G7076 C520 01 Organon XDB User Interface poet e E eeno ele struct DEFS CBITS IBITS SBITS LBIT
57. 4 lt lt scope 0x0083 0x003852DF 241 PD0 0x8B 0x003710CC 241 lini 0x0083 0x003850CF MAIN N 1 ARGS 0x8B 0x0037109C CF 0x0083 0x0038D8B1 __startup 0x35 Cancel Set Scope 4 gt M Arguments 1 2 3 18 Break E This button tries to stop the current action so that new commands can be entered Useful if the XDB waits for some event that takes too long or that never happens Debugging C Programs 1 56 C79000 G7076 C520 01 Organon XDB User Interface 1 3 Description of the Subwindows The most informative part of Organon XDB is the subwindow area where different sorts of subwindows may appear As usual all windows can be iconized and reopened Subwindows can also be hidden i e completely invisible with the exception of the command window which is always visible Closing the command window exits the XDB The uppermost subwindow is called the active subwindow Depending on the sort of subwindow being active the behaviour of Organon XDB changes in some details which are described in the following chapters To activate another subwindow just click this window 1 3 1 Command Window EN command OF X BREAKPOINT 0 AT CRM LINE 176 addr 0x0083 0x0035F10E enabled S 0 CS 0 T xdb gt run until main xdb gt set breakpoint at line 168 BREAKPOINT 1 AT CRM LINE 168 addr 0x0083 0x0035F099 enabled S 0 CS 0 T xdb gt step 2 xdb gt set tracepoint at J TRACEPOINT 2 AT J addr 0x008B O0xFFC7EFCO enabled
58. 710F4 00 00 00 00 00 00 O00 00 003710FC 00 00 00 00 CC 10 37 00 00371104 00 00 00 00 00 00 O00 00 0037110C 00 00 00 00 00 00 00 c00 i A memory window displays a certain piece of the memory Values that were changed by the last instruction executed are displayed in a different color the so called enhanced color see menu item Options Edit Colors chapter 1 2 1 6 Memory windows are opened by the menu item Display Memory or by the button Create Memory Window You can open as many memory windows as you want The title bar contains the name of the memory window The text based is displayed if the window is in based mode The string indicates that the window is not updated automatically and something happened since the last update which possibly changed the memory on display Debugging C Programs C79000 G7076 C520 01 1 69 Organon XDB User Interface The first line of the Memory Windows contains the start address If the Memory Window cursor is located at the address of a program or XDB symbol the first line of the window displays the symbol name inclusively the path of the respective debug information In bytewise display the contents of the memory are not only displayed numerically but also interpreted as characters and written on the right side of the memory window Invisible characters are replaced by a dot Note that a window in based mode always displays the memory denoted by the start address exp
59. 76 C520 01 2 121 Organon XDB Command Set SELECTOR lt selector value gt The expression lt selector value gt is used as index into the GDT or LDT according to the TI bit of the selector REPEAT lt times gt The expression lt times gt specifies how many descriptors are to be displayed The default value is 1 The output shows the memory address the table where it resides and a hexadecimal dump of the addressed memory The descriptor fields are decoded and formatted Based on the type of the descriptor various fields are displayed Field Description base The base address of the segment limit The limit of the segment sel The target selector of the gate descriptor off The target offset of the gate descriptor dwent The argument count of the call gate descriptor G granularity The granularity of the segment 1b means that the limit value is used as byte count 4k means that the limit value is used as 4kb page count P present Shows the status of the present bit dpl The value of the privilege level attr The segment attributes Debugging C Programs 2 122 C79000 G7076 C520 01 If attris a CODE segment Symbol USE32 USE16 x PMIDIZO If attr is a DATA segment Organon XDB Command Set following abbreviations are used Description USE32 segment USE16 segment conforming segment non conforming segment read execute segment execute only segment segment accessed segment
60. AS H H HWNB H H HWUB L B ADRR L B APGNO L B AWND 3 2 CLASS TEXT E address out of sync hardware breakpoint already set too many hardware breakpoints unknown breakpoint at unary amp not for register variables no line in ASM buffer use PAGE lt addr gt no code displayed DESCRIPTION The shown address lies between two opcodes The task walks through garbage The real hardware break point is set already The internal table for real hardware breakpoints overflows The program halts at a breakpoint which is not found in the internal tables of the debugger Anyone has written the opcode of the breakpoint into the target memory The address operator is not applicable to variables stored in registers The lines up are not in the assembler buffer an address is needed for new disassembly There is no code displayed Therefore you cannot move up or down Debugging C Programs C79000 G7076 C520 01 CODE L B AWPG L B BDBG L B BDMU L B BEVEX L B BEVID L B BID L B BPNA L B BPOE L B BPSA L B BPU L B BRTP Debugging C Programs C79000 G7076 C520 01 CLASS TEXT E no PAGE in assembler window bad debug information for debug info already loaded evaluation expression not found evaluation ID not found bad id number specified halt not found no action done another breakpoint at this address already enabled breakpoint
61. C Programs C79000 G7076 C520 01 2 103 Organon XDB Command Set 2 70 SET VALUE Syntax SET VALUE SIZE lt size gt REPEAT lt number gt address lt expression gt SET VALUE SIZE lt size gt REPEAT lt number gt address lt list gt Description lt address gt lt expression gt The value of lt expression gt is evaluated and written to the address given by expression lt address gt lf there is no SIZE parameter given the written data width is equal to the width of the object referenced by lt address gt If there is a SIZE parameter given the result is converted unsigned to the size which is given by lt size gt and written If structured data types are used only complete member identifications are allowed If lt address gt is name the debugger variable name is set to the value of lt expression gt Debugger variables inherit the type of the assigned result lt address gt lt list gt lt list gt is a list of expressions separated by commas As above the expressions are evaluated converted to the size given by S ZE and written into the memory starting at address lt address gt The amount of memory accessed is the number of expressions in the list times the length determined by the option SIZE If no SIZE is given the written data width is equal to the width of the object referenced by lt address gt times the number of expressions in the
62. EADER Set i and j to Sd Sd Gi amp j SCAN HEADER a Ss a Debugging C Programs 2 70 C79000 G7076 C520 01 Organon XDB Command Set 2 51 SEARCH Syntax SEARCH lt regexp gt Description In the source file of the active module a character sequence which matches the regular expression lt regexp gt is searched The environment of the matched text appears in the source window If no text is found the source window remains unchanged lt regexp gt may contain the wildcard characters for any character and for any string of characters Examples n EARCH output EARCH main EARCH put out n n Debugging C Programs C79000 G7076 C520 01 2 71 Organon XDB Command Set 2 52 SET Commands Syntax SET lt set_modes gt The following lt set_modes gt are available BREAKPOINT LANGUAGE DEBUG LOGFILE DESCRIPTOR MODULE DIRECTORY OPTION ESCAPE PROTFILE EVALUATE REGISTER INTERFACE SCOPE 2 72 SCROLL TASK TRACEPOINT VALUE WATCHPOINT Debugging C Programs C79000 G7076 C520 01 Organon XDB Command Set 2 53 SET BREAKPOINT Syntax SET BREAKPOINT AT lt expression gt WHEN lt expression gt SKIP lt count gt CONTINUE SYMBOL lt bid gt HARD lt number gt THEN lt actions gt END Description AT lt expression gt A breakpoint is set at the address specified by lt expression gt This can be
63. EAKPOINT AT main References DISABLE BREAKPOINT ENABLE BREAKPOINT SHOW BREAKPOINT Debugging C Programs C79000 G7076 C520 01 2 19 Organon XDB Command Set 2 12 DELETE BUTTON Syntax DELETE BUTTON lt name gt DELETE BUTTON ALL Description This command can be used to delete a user defined button lt name gt is the name of the button to be deleted The option ALL deletes all user defined buttons in the tool bar Examples DELETE BUTTON break DELETE BUTTON ALL References DEFINE BUTTON SHOW BUTTON 2 20 Debugging C Programs C79000 G7076 C520 01 Organon XDB Command Set 2 13 DELETE DEBUG Syntax DELETE DEBUG lt debug id gt Description This command deletes the debug information tree addressed by lt debug id gt This is useful if a loaded module is changed and compiled again By deleting and reloading the debug info the changed version can be debugged without a restart of the debugger Example DELETE DEBUG 12 References LOAD DEBUG SET DEBUG SHOW DEBUG Note The debug id 0 cannot be deleted Debugging C Programs C79000 G7076 C520 01 2 21 Organon XDB Command Set 2 14 DELETE DIRECTORY Syntax DELETE DIRECTORY lt name gt Description The directory named lt name gt is deleted from the list of directories in the search path Example DELETE DIRECTORY oldsrcs
64. ECTOR lt selector value gt lt address gt Description This command copies a piece of memory starting at the address lt address gt formatted as INTEL segment descriptor The location of the descriptor can be specified in several ways GDT lt GDT index gt The given expression lt GDT index gt is used as index into the GDT of the target system The GDTR register is used to get the base address of the GDT and to check whether the index is inside the current GDT limit IDT lt IDT index gt The given expression lt DT index gt is used as index into the IDT of the target system The IDTR register is used to get the base address of the IDT and to check whether the index is inside the current IDT limit LDT lt GDT LDTsel gt lt LDT index gt The given expression lt LDT index gt is used as index into the LDT of the target system The LDTR register is used to get the base address of the LDT and to check whether the index is inside the current LDT limit If the optional expression lt GDT LDTsel gt is specified this value is used as index into the GDT to obtain an LDT descriptor The value is checked against the current GDT limit and the selected descriptor must be an LDT descriptor MEMORY lt address gt The given expression lt address gt yields the memory location where the descriptor is written Debugging C Programs 2 78 C79000 G7076 C520 01 Organon XDB Command Set SELECTOR l
65. EXIT GOTO HELP IF Label LINE LOAD MESSAGE NEXT PAGE PRINT REMOTE RUN SCAN SEARCH SET Commands SET BREAKPOINT SET DEBUG SET DESCRIPTOR SET DIRECTORY SET ESCAPE SET EVALUATE SET INTERFACE SET LANGUAGE SET LOGFILE SET MODULE SET OPTION SET PROTFILE SET REGISTER SET SCOPE SET SCROLL Debugging C Programs C79000 G7076 C520 01 2 37 2 39 2 40 2 41 2 42 2 43 2 44 2 45 2 46 2 47 2 48 2 51 2 52 2 53 2 54 2 56 2 57 2 59 2 62 2 63 2 64 2 66 2 67 2 68 2 70 2 71 2 72 2 73 2 76 2 78 2 80 2 81 2 82 2 85 2 86 2 87 2 88 2 89 2 92 2 94 2 99 3 94 Contents 2 68 2 69 2 70 2 71 2 72 2 73 2 74 2 75 2 76 2 77 2 78 2 79 2 80 2 81 2 82 2 83 2 84 2 85 2 86 2 87 2 88 2 89 2 90 2 91 2 92 2 93 2 94 2 95 2 96 2 97 2 98 2 99 2 100 2 101 2 102 2 103 2 104 2 105 2 106 2 107 SET TASK SET TRACEPOINT SET VALUE SET WATCHPOINT SHOW Commands SHOW ACTIVE SHOW BREAKPOINT SHOW BUTTON SHOW CALLS SHOW DBVAR SHOW DEBUG SHOW DECLARATOR SHOW DESCRIPTOR SHOW DIRECTORY SHOW ESCAPE SHOW EVALUATE SHOW INFO SHOW KEY SHOW LANGUAGE SHOW LEVEL SHOW LOGFILE SHOW MACRO SHOW MEMORY SHOW MODULE SHOW OPTION SHOW PROTFILE SHOW REGISTER SHOW SCOPE SHOW SEGMENT SHOW SOURCE SHOW STATUS SHOW SYMBOL SHOW TASK SHOW TRACEPOINT SHOW TYPE SHOW VERSION SHOW WATCHPOINT SPAWN STEP WHILE Organon XDB Error Messages 2 100 2 102 2 104 2 109 2 112 2 1
66. G7076 C520 01 2 43 Organon XDB Command Set 2 32 ENABLE TRACEPOINT Syntax ENABLE TRACEPOINT ID lt halt id gt ENABLE TRACEPOINT ALL Description The tracepoint that was set inactive by DISABLE TRACEPOINT is reactivated lt halt id gt This is the number of the tracepoint to be reactivated It is a decimal number or a debugger variable which contains the ID number of the tracepoint ALL All currently inactive tracepoints are set active again Examples ENABLE TRACEPOINT ID 15 ENABLE TRACEPOINT ID BPID ENABLE TRACEPOINT AT location ENABLE TRACEPOINT ALL References DELETE TRACEPOINT DISABLE TRACEPOINT SET TRACEPOINT SHOW TRACEPOINT Debugging C Programs 2 44 C79000 G7076 C520 01 Organon XDB Command Set 2 33 ENABLE WATCHPOINT Syntax ENABLE WATCHPOINT ID lt halt id gt ENABLE WATCHPOINT ALL Description The watchpoint that was set inactive by DISABLE WATCHPOINT is reactivated lt halt id gt This is the number of the watchpoint to be reactivated It is a decimal number or a debugger variable which contains the ID number of the watchpoint ALL All currently inactive watchpoints are set active again Examples ENABLE WATCHPOINT ID 15 ENABLE WATCHPOINT ID BPID ENABLE WATCHPOINT AT location ENABLE WATCHPOINT ALL References DELETE WATCHPOINT DISABLE WATCHPOINT
67. GE RIGHT 10 PAGE NULL Hi Hi CI w BH References LINE Debugging C Programs C79000 G7076 C520 01 2 65 Organon XDB Command Set 2 47 PRINT Syntax PRINT mask lt expression gt Description PRINT formats the results of the optional listed expressions according to the format specifications in the string mask The output is shown in the command window and is written to an optional opened protocol file No output takes place until the newline symbol n is encountered in mask Subsequent calls of PRINT may be used to build up one line of output In this case no other command may be interspersed because the already stored output would be lost The interpretation of the mask string follows the conventions defined by the ANSI C standard of the library function printf Some restrictions to the ANSI definitions for formatting requests are made e the flag is not supported e the sequence n is ignored no expression argument should be given Examples PRINT Current array settings n PRINT input 04d t PRINT result Sf Ss n outfl 10 0 sval Reference EVALUATE Debugging C Programs 2 66 C79000 G7076 C520 01 Organon XDB Command Set 2 48 REMOTE Syntax REMOTE Description The remote window is displayed and the input and output is directed directly to the low level debugger on the target A simple terminal emulation supporting backs
68. INFO lt regexp gt Description SHOW INFO searches through the internal symbol table for type names which match the regular expression pattern lt regexp gt This pattern may contain wildcard characters as and The type tables are searched from the current scope level upwards The types found are displayed in the command window with their scope levels and full descriptions Examples SHOW INFO int SHOW INFO struct SHOW INFO struct s_abc References SHOW DECLARATOR SHOW TYPE Debugging C Programs C79000 G7076 C520 01 2 127 Organon XDB Command Set 2 85 SHOW KEY Syntax SHOW KEY lt key gt SHOW KEY ALL Description lt key gt Displays the definition of the user defined key lt key gt ALL All currently defined keys are displayed Examples SHOW KEY F2 SHOW KEY ALL References DEFINE KEY DELETE KEY 2 128 Debugging C Programs C79000 G7076 C520 01 Organon XDB Command Set 2 86 SHOW LANGUAGE Syntax SHOW LANGUAGE Description Displays the current language setting of the debugger in the command window Example SHOW LANGUAGE Reference SET LANGUAGE Debugging C Programs C79000 G7076 C520 01 2 129 Organon XDB Command Set 2 87 SHOW LEVEL Syntax SHOW LEVEL Description This command shows the static nesting level of the current position The static nesting level defines the visibility of symbols and types 0 stands for glob
69. L B RGSZ E illegal register size The mentioned register cannot be entered with this size parameter Debugging C Programs 3 14 C79000 G7076 C520 01 CODE L B RLSZ L B RLVO L B RMAP L B RNOV L B RSNE L B SCCM L B SCCP L B SCID L B SCLN L B SCNE Debugging C Programs C79000 G7076 C520 01 CLASS TEXT E size of expression exceeds buffer limit value of VOID register not accessible range selection overflow too deep nested stack no current module no current procedu re no valid identifier line number too high scope stack deeply nested Organon XDB Error Messages DESCRIPTION The result of an expression is too big It is probably a very big structure in an expression A value of a void type expression is requested The symbol is located in a register The value of this register is currently saved at an unknown position at the stack The selected range of index values exceeds the number of elements of this array The runtime stack is nested too deeply The internal buffer for tracking the stack frame is filled completely There is no module currently used There is no procedure currently used This expression is not a valid identifier for the command SET SCOPE The given line number is outside the module The dynamic stack of local symbol tables overflows There are currently too many active procedures 3 15 Organon XDB Error Messages CODE CLAS
70. LL All breakpoints are set inactive On the target system this breakpoint is really cleared The resources like debug registers used by the disabled breakpoint can be reused Debugging C Programs 2 30 C79000 G7076 C520 01 Examples DISABLE BREAKPOINT AT putrecord DISABLE BREAKPOINT AT calculate erg0 DISABLE BREAKPOINT AT LINE 170 DISABLE BREAKPOINT ALL References DELETE BREAKPOINT ENABLE BREAKPOINT SET BREAKPOINT SHOW BREAKPOINT Note Organon XDB Command Set The option HARD is lost by using ENABLE or DISABLE BREAKPOINT command Debugging C Programs C79000 G7076 C520 01 2 31 Organon XDB Command Set 2 23 DISABLE EVALUATE Syntax DISABLE EVALUATE lt expression gt DISABLE EVALUATE ID lt id gt DISABLE EVALUATE ALL Description The denoted expression is not evaluated anymore but still remains in the list of expressions to be evaluated lt expression gt The item with this expression is disabled Note that lt expression gt has to match literally the expression to be disabled e g a b does not match b a ID lt eval id gt The expression with the ID number lt eval ia gt is disabled ALL All expressions from the list are disabled Examples DISABLE EVALUATE globstat DISABLE EVALUATE ID 3 References DELETE EVALUATE ENABLE EVALUATE SET EVALUATE SHOW EVALUATE Debugging C Programs 2
71. MENT TRAP RESUME DIRECTION IOPL The virtual 8086 flag YM is set Description EFLAGS Register System Flags The system flags of the EFLAGS register control 170 maskable interrupts debugging task switching and the virtual 8086 mode An application program should ignore these systems flags and should not attempt to change their state In some systems an attempt to change the state of a system flag by an application program results in The modification becomes effective when you click the Set button The Close button dismisses the dialog box discarding all changes you made Clicking the Restore button discards all changes made since the opening but the dialog box remains open You can change the whole register value by entering a number octal decimal or hex into the Register Value field You can change the value of a bit group by clicking it or its name in the Register Layout field then set the focus to the Group Value field and enter a number octal decimal or hex The Bits field shows which bits belong to this group The Register Layout field helps you modifying the contents of the descriptor bit for bit Click the bit or bit group or its name displayed in the field to set the focus on it The focused bit or bit group can be altered by a click or by hitting the space bar This increases the value of the bit group by 1 wrapping around the maximal value The focus can be moved left or right
72. MINF M M MSDI M M NCTK M M PWAP M M PWCF M M PWDL 3 22 E CLASS TEXT error in creating debug file name preprocessing debug info failed target not initialized error in initialization error in setup too many input files too many source directories no attached task absolute path needed in spite of create password file missing security key DESCRIPTION The input file name cannot be modified to the name of the debug file Check path name and length of file name The preprocessor for the input file failed Check your permissions and disk quota The target initialization is not possible The internal set up of the debugger fails The basic set up of the debugger with the configuration file failed The debugger was started with too many input images The limit of search directories for source directories is exceeded The debugger has no current attached task The call of XDB needs an absolute pathname The password file cannot be opened for writing Check the permissions The security mechanism is corrupted Debugging C Programs C79000 G7076 C520 01 CODE M M PWHI M M PWIL M M PWKY M M PWLF M M PWLK M M PWNP M M PWOL M M PWWF M M SMVN M M TCLI M M TLAC M M TLOK Debugging C Programs C79000 G7076 C520 01 CLASS TEXT E m get host identification too long input make key path create lock file make lock path path
73. PTION PENTIUM ON SET OPTION SEGMENT LOCAL SET OPTION TASK GLOBAL SET OPTION EVALUATE HEX References EVALUATE LOAD SET EVALUATE SHOW OPTION SHOW SEGMENT Debugging C Programs C79000 G7076 C520 01 Organon XDB Command Set 2 91 Organon XDB Command Set 2 64 SET PROTFILE Syntax SET PROTFILE APPEND WINDOW lt window gt lt file gt SET PROTFILE OVERWRITE WINDOW lt window gt lt file gt SET PROTFILE APPEND ALL lt file gt SET PROTFILE OVERWRITE ALL lt file gt Description lt file gt Switch on the protocol mechanism for a set of windows The output of the windowJs is copied to this file WINDOW lt window gt lt window gt specifies which window output is to be directed to the protocol file The following values are allowed for lt window gt ASSEMBLER EVALUATE TRACEPOINT COMMAND REGISTER ERROR SOURCE All selected inputs to the system and all outputs of the system are recorded in the file lt file gt The outputs of the system are recorded as comments The source of the output is shown with a parenthesed shorthand of the window name after the comment character Every window can be tied together to one protocol file but several protocol files can receive any combination of window outputs ALL If ALL is used all in and outputs are recorded just in the ALL protocol file even if other protocol files are open
74. Programs C79000 G7076 C520 01 1 47 Organon XDB User Interface subroutines these symbolic names are derived from the names you use in the source code Sometimes Organon XDB expects you to enter a symbol name The symbol browser can give you an overview over the known symbols and helps you to choose one The symbols are shown with their task module and symbol name together with their addresses Symbol Browser Symbol GAM WAINVARGS at T6 EBP at 0x0168 0x00000054 at 4 EBP at 24 EBP at 0x0168 0x00000090 Pattern CRM MAIN SEC at 0x0168 0x00000000 M Scope Level Current O Procedure Module Global O Select functions only The fields on the right side help you to change the set of visible symbols You can change the scope level by clicking the scope level you want Procedure for all symbols within this subroutine Module for all symbols within the current module and Global for all symbols Current which is the default value sets the scope level according to the current state of execution You can also set the scope level by hitting the lt Alt gt key and the underlined letter e g lt Alt R gt for Procedure To reduce the set of symbols displayed on the left side you may write a pattern into the Pattern field Finish the pattern entry by pressing lt Tab gt Similar to the menu item File Search a pattern consists of characters letters digits etc which are recognized as suc
75. Qualified persons are defined as persons who are authorized to commission to ground and to tag circuits equipment and systems in accordance with established safety practices and standards Note the following Warning This device and its components may only be used for the applications described in the catalog or the technical description and only in connection with devices or components from other manufacturers which have been approved or recommended by Siemens This productcan only function correctly and safely ifitis transported stored setup and installed correctly and operated and maintained as recommended SIMATIC is a registered trademark of SIEMENS AG Third parties using for their own purposes any other names in this document which refer to trademarks might infringe upon the rights of the trademark owners Copyright Siemens AG 1997 All rights reserved The reproduction transmission or use of this documentor its contents is notpermitted withoutexpress written authority Offenders will be liable for damages Allrights including rights created by patentgrantor registration of a utility model or design are reserved Siemens AG Automation Group Industrial Automation Systems Postfach 4848 D 90327 N rnberg Disclaimer of Liability We have checked the contents of this manual for agreement with the hardware and software described Since deviations cannot be precluded entirely we cannot guarantee full agre
76. RORTEXT INSTANCE LEVEL MODULE NEST PC PROCEDURE PROCESS SOURCEFILE SOURCELINE STACK STOPREASON The following macro functions are predefined The macro functions offer the last ID of Break or Watchpoint code selector current line flags instruction pointer last error message number last error message incarnation of the actual process active scope level active where the PC is module nesting level actual PC active procedure actual process number current file source line 0 CURRENT 32 WIND 64 TOP last reason of program stop read only read only read only read only read only writable read only read only read only read only read only read only read only read only read only read only read only read only functionality of the C Runtime library function with the same name Function Arguments double double double double double double char Debugging C Programs C79000 G7076 C520 01 Organon XDB Command Set EXP FABS GETCHAR GETS ISALNUM ISALPHA ISASCII ISCNTRL ISDIGIT ISLOWER ISPRINT ISPUNCT ISSPACE ISUPPER ISXDIGIT LOG double LOG10 double OPRINTF char POW double double PRINTF char PUTCHAR char PUTS char REG register name SCANF char SIN double SQRT double STRCAT STRCMP STRCPY char char char char char char STRLEN char STRNCAT
77. S UBITS FBITS DBITS FLGS FLGH FLGD FLGL REC CRC RFS DO OORRPRRrOOCOOCOCCOO a NI Here you see two trace windows which were named trace 0 and trace 1 by the debugger trace 0 was set on the integer variable J which has the value 4 at the moment The variable DO is a compound structure thus Organon XDB shows the structure component names in the left part of the trace window while displaying the values of these components in the right part The value of the component RFS is displayed in enhanced color because it was changed in the last execution step The handling of trace windows is excepted the missing Pop Up menues available by pressing the the right mouse button exactly the same as the handling of evaluation windows 1 3 10 Copy and Paste It is possible to transfer text from one subwindow to another by using the mouse Just brush over the text with the mouse while pressing down the left mouse button To paste the copied text into another window move the mouse into this window and click the right mouse button Note that the text copied into the copy and paste buffer remains there until you mark another text Debugging C Programs C79000 G7076 C520 01 1 75 Organon XDB User Interface You can copy text from the following subwindows Command window source window assembler window remote window You can paste the copied text into the following subwindows Command window remote window When you choos
78. S TEXT DESCRIPTION L B SCNL E no current line The program is not at a correct source line L B SCNM E no such module This module is not found in the debug tables L B SCNP E no procedure The mentioned procedure name is not in the given module L B SCNR E no global scope The debugger is not located at any debug information L B SGNF E segment not found The given address is not included in the segment list L B SHAL E level too high The requested scope level is higher than the current level of the program L B SHMA E expression not The result of the expression in addressible not located in memory L B SHMO E no such module The issued module name cannot be found in the debug tables L B SHMR E expression evaluated The result of the expression is to register located in a register L B SMBO W already at bottom The source window already displays the last lines of this module L B SMBT W can tgo down The source window cannot be moved down so many lines The debugger goes to the last line L B SMLE W already at left border The source window already displays the first column Debugging C Programs 3 16 C79000 G7076 C520 01 CODE L B SMLN L B SMTO L B SMTP L B SRNF L B STFR L B STOP L B STSB L B STSC L B STSE Debugging C Programs C79000 G7076 C520 01 CLASS TEXT W can t go to W alreadyattop W can t go up E string not found E Corrupt stack frame at E unrecognized option E on to
79. SET WATCHPOINT SHOW WATCHPOINT Debugging C Programs C79000 G7076 C520 01 2 45 Organon XDB Command Set 2 34 ERASE Syntax ERASE lt window gt ERASE SYSREG lt window gt Description lt window gt This command closes the window lt window gt lt window gt may have the following values ASSEMBLER MODULE SYSREG GDT REGISTER TASK IDT REMOTE LDT SOURCE SYSREG lt window gt This command is explained in the chapter ERASE SYSREG Example ERASE REGISTER Reference DISPLAY ERASE SYSREG Debugging C Programs 2 46 C79000 G7076 C520 01 Organon XDB Command Set 2 35 ERASE SYSREG Syntax ERASE SYSREG lt window gt Description This command closes the system register window lt window gt lt window gt may have the following value CONTROL Example ERASE SYSREG CONTROL Reference DISPLAY SYSREG Debugging C Programs C79000 G7076 C520 01 2 47 Organon XDB Command Set 2 36 EVALUATE Syntax EVALUATE lt format gt lt size gt ADDRESS LEVEL lt nr gt WINDOW lt nr gt lt expr gt Description lt expr gt The given expression lt expr gt is evaluated and the result is displayed in the command window lt expr gt has to be in the notation of the currently selected language If no qualifier is supplied the output is formatted according to the type of the result
80. SIEMENS SIMATIC ProC C for M7 300 and M7 400 Debugging C Programs User Manual This manual is part of the documentation package with the order number 6ES7812 0CA01 8BA0 C79000 G7076 C520 01 Table of Contents User Information The Organon XDB 1 User Interface Reference Information Commands of Organon XDB 2 Organon XDB Error Messages 3 Safety Guidelines ZN ZN ZN Qualified Personnel Correct Usage ZN Trademarks This manual contains notices which you should observe to ensure your own personal safety as well as to protect the product and connected equipment These notices are highlighted in the manual by a warning triangle and are marked as follows according to the level of danger Danger indicates that death severe personalinjury orsubstantial property damage willresultifproper precautions are not taken Warning indicates that death severe personal injury or substantial property damage can result if proper precautions are not taken Caution indicates that minor personal injury or property damage can result if proper precautions are not taken Note draws your attention to particularly important information on the product handling the product or to a particular part of the documentation The device system may only be set up and operated in conjunction with this manual Only qualified personnel should be allowed to install and work on this equipment
81. TION TIME ON OFF TION POINTER ASCII HEX TION ASSEMBLER ON OFF TION ASM ON OFF TION CODE USE16 USE32 TION EVALUATE BINARY OCTAL DEC HEX DEFAULT TION lt processor_type gt ON OFF TION MULTITASK ON OFF TION NOWAIT ON OFF UU U0 U0 UU UU UU TU TU TU NANNANNNNNNUNN MN AAA Ae eeeee o O 0000 OO OO O OO Description Each SET OPTION command enables the setting of one of the global debugger flags described below AUTOLOAD ON OFF If AUTOLOAD is set to ON XDB loads automatically any required debug information Otherwise the user is asked for every module to load This option is set to ON by default TASK GLOBAL LOCAL If TASK is set to GLOBAL all target system tasks are assigned to one virtual debugger task If TASK is set to LOCAL all tasks are monitored separately by XDB The default value is GLOBAL SEGMENT GLOBAL LOCAL The value GLOBAL forces XDB to attach all segments specified at initial load or LOAD commands to the debugger s global segment map If LOCAL is used segments are attached to task The default value is LOCAL TIME ON OFF If TIME is set to ON XDB shows for evaluated tracepoints the current time in the format hh mm ss after the actual address line This option is set to OFF by default Debugging C Programs C79000 G7076 C520 01 2 89
82. Tsel gt lt LDT index gt SHOW DESCRIPTOR REPEAT lt times gt MEMORY lt address gt SHOW DESCRIPTOR REPEAT lt times gt SELECTOR lt selector value gt Description This command shows pieces of 64 bits of memory formatted as INTEL segment descriptor The location of the descriptor can be specified in several ways GDT lt GDT index gt The given expression lt GDT index gt is used as index into the GDT of the target system The GDTR register is used to get the base address of the GDT and to check whether the index is inside the current GDT limit IDT lt IDT index gt The given expression lt DT index gt is used as index into the IDT of the target system The IDTR register is used to get the base address of the IDT and to check whether the index is inside the current IDT limit LDT lt GDT LDTsel gt lt LDT index gt The given expression lt LDT index gt is used as index into the LDT of the target system The LDTR register is used to get the base address of the LDT and to check whether the index is inside the current LDT limit If the optional expression lt GDT LDTsel gt is specified this value is used as index into the GDT to obtain an LDT descriptor The value is checked against the current GDT limit and the selected descriptor must be an LDT descriptor MEMORY lt address gt The given expression lt address gt yields the memory location where the descriptor is read Debugging C Programs C79000 G70
83. Y_COUNT UNIT 0008H SYSCON UNIT 0000H c_0 UNIT 0000H VC_1 UNIT 0001H VC_2 UNIT 0002H VC_3 UNIT 0003H Di VC_A4 UNIT 0004H VC_S UNIT 0005H This window offers you access to the target system Within the remote system window you can t use shortcuts for example X R Only the escape character is active and closes the remote window 1 3 7 Evaluation Windows Jvar 0 PDO LIDx 0x8B 0x0036B0CC t A Q var 2 PD0 gt FLGS BEE 5 I ea te These windows are opened when you evaluate an expression see the menu item Debug Evaluate chapter 1 2 1 4 and the command SET EVALUATE in the Command Reference If the expression denotes a complex structure like a record or an array all components are shown together with the declaration of the structure Whenever the result of the expression changes the new value is displayed in a different color the so called enhanced color see menu item Options Edit Colors chapter 1 2 1 6 You can open as many evaluation windows as you want If the expression denotes a complex structure like a record or an array you can get information about its type declaration by doubleclicking the left part of the evaluation window Debugging C Programs 1 66 C79000 G7076 C520 01 Organon XDB User Interface If you want to change the value of the expression just doubleclick the value displayed and a pop up window appears which allows you to manipulate the memory assuming the
84. a the button set_task Now the task is started on the target and the CS EIP is at the entry point Debugging C Programs C79000 G7076 C520 01 Organon XDB Command Set Examples LOAD ARGUMENTS f machine dat of simulate bd LOAD TASK c rmos test test1 386 of testl LOAD BINARY TASK a test2 386 of test2 LOAD SEGMENT 3F8 4D of simulate bd References DELETE DEBUG SET DEBUG SET OPTION SHOW DEBUG SHOW SEGMENT Debugging C Programs C79000 G7076 C520 01 2 61 Organon XDB Command Set 2 44 MESSAGE Syntax MESSAGE lt string gt Description A new window is created which displays the message lt string gt This command is especially useful in batch files Examples MESSAGE loading ESSAGE loading file please wait Z Debugging C Programs 2 62 C79000 G7076 C520 01 Organon XDB Command Set 2 45 NEXT Syntax NEXT lt count gt Description NEXT continues the execution of the program If XDB is in HLL mode the next lt count gt source lines are executed If a subroutine call occurs it is executed but the line counter is not affected On assembler language level the next lt count gt instructions are executed Subroutines are called but counted as one instruction lt count gt If lt count gt runs to zero the program is stopped The default value for lt count gt is 1 Note that lt count is not an expression but a number
85. akpoint with the ID number lt halt id gt is displayed ALL All existing breakpoints are shown Examples SHOW BREAKPOINT ID 13 SHOW BREAKPOINT AT LINE 170 SHOW BREAKPOINT ALL References SET BREAKPOINT Debugging C Programs 2 114 C79000 G7076 C520 01 Organon XDB Command Set 2 75 SHOW BUTTON Syntax SHOW BUTTON lt name gt SHOW BUTTON ALL Description This command shows the current mappings of the user defined button lt name gt or of all currently defined buttons if ALL was specified Example SHOW BUTTON restart References DEFINE BUTTON DELETE BUTTON DEFINE MACRO Debugging C Programs C79000 G7076 C520 01 2 115 Organon XDB Command Set 2 76 SHOW CALLS Syntax SHOW CALLS ARGUMENTS LEVEL lt number gt Description A list of all current active functions is displayed The output is written to the command window The first column contains the address where the procedure was called from The second one contains the symbolic name of the address The module name and the source line the address in the first column belongs to is shown at the end of the line The procedure which matches the current scope setting of the debugger is marked with lt lt lt scope at the end of the line ARGUMENTS If this option is used the function arguments are displayed too Note that there are restrictions because if parameters are stored in registers they are
86. al 1 for module local 2 and higher for procedure local The debugger displays information if and how this level was reached via the SET SCOPE command wind means UP or DOWN was used walk means lt expression gt was used Example SHOW LEVEL References SET SCOPE SHOW ACTIVE Debugging C Programs 2 130 C79000 G7076 C520 01 Organon XDB Command Set 2 88 SHOW LOGFILE Syntax SHOW LOGFILE Description If a logfile is open this command shows the name and directory Otherwise you are told that no logfile is used currently Example SHOW LOGFILE References CLOSE SET LOGFILE Debugging C Programs C79000 G7076 C520 01 2 131 Organon XDB Command Set 2 89 SHOW MACRO Syntax SHOW MACRO lt name gt SHOW MACRO ALL Description lt name gt Displays the selected macros and their replacement texts The lt name gt argument may contain wildcard characters as and ALL With ALL all currently defined macros are shown Examples SHOW MACRO ALL SHOW MACRO MAC SHOW MACRO DEF References DEFINE MACRO DELETE MACRO Debugging C Programs 2 132 C79000 G7076 C520 01 Organon XDB Command Set 2 90 SHOW MEMORY Syntax SHOW MEMORY Description LENGTH lt length gt SIZE lt size gt WINDOW lt format gt lt expression gt The contents of the memory are shown in hexadecimal and ASCII notation starting at the addr
87. ams C79000 G7076 C520 01 DI N INIT do NM are ere Nilla nm W MRI DCDCDC 0 I Loo Lon S DIN do Go Mo SEO co do co 1 Gi RIESI aA 256 D DS 2 1 Organon XDB Command Set 2 31 2 32 2 33 2 34 2 35 2 36 2 37 2 38 2 39 2 40 2 41 2 42 2 43 2 44 2 45 2 46 2 47 2 48 2 49 2 50 2 51 2 52 2 53 2 54 2 55 2 56 2 57 2 58 2 59 2 60 2 61 2 62 2 63 2 64 2 65 2 66 2 67 2 2 ENABLE EVALUATE ENABLE TRACEPOINT ENABLE WATCHPOINT ERASE ERASE SYSREG EVALUATE EXIT GOTO HELP IF Label LINE LOAD MESSAGE NEXT PAGE PRINT REMOTE RUN SCAN SEARCH SET Commands SET BREAKPOINT SET DEBUG SET DESCRIPTOR SET DIRECTORY SET ESCAPE SET EVALUATE SET INTERFACE SET LANGUAGE SET LOGFILE SET MODULE SET OPTION SET PROTFILE SET REGISTER SET SCOPE SET SCROLL Pg al AA A or B G A ala ollo oA oN N I gi DQ Tic MoO NI D Bi NI no ro mo N OOo ro o rp oO Cc Nh oO 0 oOo N A Debugging C Programs C79000 G7076 C520 01 N 2 68 2 69 2 70 2 71 2 72 2 73 2 74 2 75 2 76 2 77 2 78 2 79 2 80 2 81 2 82 2 83 2 84 2 85 2 86 2 87 2 88 2 89 2 90 2 91 2 92 2 93 2 94 2 95 2 96 2 97 2 98 2 99 2 100 2 101 2 102 2 103 2 104 SET TASK SET TRACEPOINT SET VALUE SET WATCHPOINT SHOW Commands SHOW ACTIVE SHOW BREAKPOINT SHOW BUTTON SHOW
88. an be moved forward along the current call stack to show the dynamic call structure of the program The value of lt levels gt defaults to 1 UP lt levels gt With this qualifier the scope can be moved backwards along the current call stack to show the dynamic call structure of the program The value of lt levels gt defaults to 1 If you set the scope to a procedure not using UP or DOWN its local stack and register variables cannot be evaluated because they are not addressable Debugging C Programs C79000 G7076 C520 01 2 97 Organon XDB Command Set lt expression gt The scope can be set to a static position in your program Allowed lt expressions gt are lt module gt lt procedure gt lt procedure gt CURRENT The scope is set to the location where the program currently halts Examples ET SCOPE ET SCOP ET SCOP ET SCOPI SCOPR UP 2 DOWN main function7 procedure CURRENT NNNUNN Hew we E ESL ECESE os References SHOW SCOPE SHOW CALLS Notes The qualifiers UP and DOWN can work correctly only if the list of nested procedure calls contains only procedures with normal function prologue epilogue sequences These sequences maintain a linked list on the user stack which is used by XDB to walk up and down If some procedures do not place themselves into this list or do not execute their prologue codes they are not visible to the debugger The latter case h
89. anon XDB Command Set 2 91 SHOW MODULE Syntax SHOW MODULE lt name gt Description The source of the module lt name gt is displayed in the source window This does not change the scope of the debugger or load any symbol or debug information Example SHOW MODULE mainloop References SET MODULE SHOW DEBUG Debugging C Programs C79000 G7076 C520 01 2 135 Organon XDB Command Set 2 92 SHOW OPTION Syntax SHOW OPTION lt option gt SHOW OPTION ALL Description Displays the current setting of global options The set of legal values for lt option gt depends on the configuration See the command SET OPTION for further details Examples SHOW OPTION ALL SHOW OPTION SE Reference SET OPTION Notes GM ENT SHOW OPTION lists the item TIME as TRACETIME 2 136 Debugging C Programs C79000 G7076 C520 01 Organon XDB Command Set 2 93 SHOW PROTFILE Syntax SHOW PROTFILE Description This command tells you which protocol files are currently open complete with file name and path name Example SHOW PROTFILE References SET PROTFILE CLOSE Debugging C Programs C79000 G7076 C520 01 2 137 Organon XDB Command Set 2 94 SHOW REGISTER Syntax SHOW REGISTER lt register gt Description The value of register lt register gt is displayed in the command window General purpose registers are shown in hexadecimal and decimal notation Float
90. appens if a breakpoint is set on a procedure name and the debugger stops there and the command SHOW CALLS is used immediately In this case the last procedure is missing in the list of nested procedures Debugging C Programs 2 98 C79000 G7076 C520 01 Organon XDB Command Set 2 67 SET SCROLL Syntax n ET SCROLL lt mode gt PAGE CONTINUE ali Description lt mode gt The scroll mode of the command window is set In the current version lt mode gt can only be EVALUATE PAGE If this qualifier is selected the output of an EVALUATE command to the command window stops when it is completely filled Then the debugger asks whether to continue or not CONTINUE If this qualifier is selected the output scrolls without automatic stop This mode is the default Example SET SCROLL EVALUATE PAGE Reference EVALUATE Debugging C Programs C79000 G7076 C520 01 2 99 Organon XDB Command Set 2 68 SET TASK Syntax SET TASK ATTACH ID lt task_id gt SET TASK DETACH ID lt task_id gt SET TASK STEP SET TASK SET ID lt task_id gt SET TASK DEBUG lt debug_id gt ID lt task_id gt SET TASK KILL Description The purpose of this command is task manipulation Tasks can be switched killed attached and detached ATTACH ID lt task_id gt With this option a task is started on the target and attached to the
91. apture xdb gt run until main xdb gt step xdb gt _ KE 01 CRMAMAINA LINE 163 CRM_003B CS EIP 0x0083 0x0035f072 C C Chapter 1 2 contains a detailed explanation of the menu items followed by a description of the tool bar The subwindows are covered in chapter The status bar at the bottom of the main window shows some general information about the status of the target task and the debugger 01 CRMSMAINS LINE 163 CRM_003D CS EIP 0x0083 0x00385072 C C SET EVALUATE Debugging C Programs 1 8 C79000 G7076 C520 01 Organon XDB User Interface The first field contains the debug info number and the position of the execution source file name function name line number The second field shows the task name and the contents of the program counter The third field indicates the execution mode Organon XDB is in C C or PAS for source code mode and Asm for assembler mode If the display is stopped e g by typing lt ctrl S gt the mode field changes to hold The last field is the status field telling what Organon XDB is doing at the moment 1 2 1 Menu Panel The keywords in this panel give access to the menus listed below To enter any of these menus click the appropriate keyword or type lt Alt x gt x being the underlined letter in the keyword Example Organon XDB supports the high level languages C C and Pascal as well as the assembly language To switch between these languages
92. arting problems During the start of Organon XDB the following problems can occur First is when you try to start Organon XDB a second time Doing so the following window appears In this case exit the running Organon XDB Initialisation failed If Organon XDB can not find the authorization for software package ProC C the following window appears Check the ProC C installation SIEMENS Authorisation xl Error during Authorisation call occured Debugging C Programs C79000 G7076 C520 01 1 7 Organon XDB User Interface 1 2 Description of the Main Window When Organon XDB is ready its main window will appear on the screen This main window consists of four parts whose elements and functions are described in the following chapters These parts are 1 the menu panel 2 the tool bar 3 a panel with user defined buttons this panel exists only if there are such buttons 4 and the subwindow area EX Organon XDB Eile Display Bun Debug Language Options Windows Help EN BS EA ENEN alea eS EC E 3 fe A Bh WAN IGE Source CRM crm c 1 These flags dictate 1 ve the verbosity of Zz se the program 1 for j70 jssizeof sec lt sizeof sec 01 j printi test ld addr lx n long l asigid pd di cao flgs i 0 printi Section s returned d n if d0 cre 0 printf nNo errors detected n elses printf nFailed n Lil rec
93. ary operator is not allowed for this type This command is not usable in this release Check the release notes of further updates The logical end address of a procedure cannot be converted to a physical address XDB is currently not inside a debugged function This operator does not allow operands of type pointer There is no segment list available The source window does not contain a source module Use the command SHOW or SET MODULE first The given segment name was not found in the segment list Debugging C Programs C79000 G7076 C520 01 CODE L B NSTC L B NSUE L B NTKS L B NTP L B NTSK L B NUSP L B OBNM L B OJRD L B ONEP L B OPBD L B OPOJ L B OVFL Debugging C Programs C79000 G7076 C520 01 CLASS TEXT E no struct union referenced by E no struct enum union types for E no segments for task E no type information E no task for PC E no struct union pointer E module not found E object format error E procedure in epilogue E can t open E can t open object file W near pointer overflow Organon XDB Error Messages DESCRIPTION The left side of the expression is neither a structure nor a union This operator does not allow structured types The shown task contains no physical segments The operands have no type information None of the assigned address spaces of the task matches the given PC value The expression left of gt is not a struc
94. ault decimal default C hexadecimal O octal C byte O binary O ascii word Length Level fi I Gilang The expression you marked is already in the Expression field All you have got to do is to click the Ok button and the result appears in the command window Debugging C Programs C79000 G7076 C520 01 1 77 Organon XDB User Interface 1 4 Descriptor and Register Tables The menu item Display CPU Structures gives access to the CPU structures used by the processors Intel386 and upward Open the menu and choose the table you want to manipulate by clicking it or by hitting lt Alt gt and the underlined letter v Source Assembler Register Remote Task Memory CPU Structures GDT Table I80386EX Registers LDT Table DT Table Control Registers If one of these tables is displayed already its name is checkmarked Clicking this name is the appropriate way to dismiss the table 1 4 1 Descriptor Tables If you choose to display the GDT Global Descriptor Table or the IDT Interrupt Descriptor Table the following dialog box pops up gt Display Descriptor Table GDT Table Start t O Index Selector Enter the number of the first table item to be displayed into the Table Start field and activate the button Index or enter the selector into the Table Start field and activate the button Selector The Selector option makes sense only in the case of a GDT Debugging C Programs 1 78 C790
95. base 0x0004F39C base 0x00000000 base 0x0004E000 base 0x00048000 limit 0x00000010 limit 0x000FFFFE limit 0x00000FA0 limit 0x00000FA0 limit 0x00000130 limit 0x00005FFF limit 0x00000067 limit 0x00000067 limit 0x00000069 limit 0x00000069 limit 0x000FFFFF limit 0x00001D90 limit 0x00005480 bytes pages bytes bytes bytes bytes bytes bytes bytes bytes pages bytes bytes mouse button to summon this pop up menu Debugging C Programs C79000 G7076 C520 01 G 1b 0xFFFFEFFF G 1b G 1b G 1b G 1b G 1b G 1b G lb G 1b OxFFFFFFFF G 1b G lb AVL 0 AVL 0 AVL 0 AVL 0 AVL 0 AVL 0 AVL 0 AVL 0 AVL 0 AVL 0 AVL 0 PHPPHPdi HH P 1 P 1 by P 1 P 1 DPL 0 attr UWA tes G 4k AVL 0 P 1 DPL 0 attr DWA DPL 0 attr UWX DPL 0 attr UWA DPL 0 attr UWA DPL 0 USE32 attr NRA DPL 0 DPL 0 DPL 0 DPL 0 tes G 4k AVL 0 P 1 DPL 0 attr UWA DPL 0 attr UWA DPL 0 USE32 attr NRA Organon XDB User Interface Modify Reload table Set range Choose one of the items by clicking it or by hitting lt Alt gt and the underlined letter The items are described in the following chapters If you hit lt Return gt while the descriptor table window is active Organon XDB directly goes into the modify mode skipping the pop up menu The descriptor to be modified is the one being displayed in inverted colors in the descriptor table window 1 4 1 1 Modify The following dialog box enables
96. col the debug session This feature enables you to write important informations into files for further examination Choose between the following protocol modes All to get a complete protocol All information is just written into this protocol even if some of the other protocols are opened Command to protocol the commands given in the command window see chapter Source to copy the source code lines executed into the protocol file Assembler to protocol the executed line of the assembler window see chapter 1 3 3 Trace to copy the contents of the trace window see chapter 1 3 9 Evaluate to protocol general information messages as opposed to error messages as shown in the command window see chapter 1 3 1 i Error to protocol all error messages Debugging C Programs C79000 G7076 C520 01 1 15 Organon XDB User Interface Click the type of protocol you want and the file browser see chapter 1 2 2 1 is invoked Choose the directory where you want the protocol file to be in then enter the file name Example You have already opened an assembler protocol Now you wish to protocol the commands you want to issue After hitting lt Alt F gt and lt Alt P gt or clicking the appropriate keywords you see this ENOrganon XDB Display Bun Debug Language Options Windows Help Load Ott Balla ih A Batch Set Module Alt M Search Alt S All Open Protocol Open Logfile Cunmend Close Lusia So
97. d lt label gt A label is a sequence of letters followed by a Example line text aL SET BREAK AT fune 2 label RUN 3 EVALUATE I J 4 GOTO label Reference Label Debugging C Programs 2 52 C79000 G7076 C520 01 Organon XDB Command Set 2 39 HELP Syntax HELP Description You can enter HELP to activate the Windows online help mechanism for XDB By default the F1 key is defined as HELP n in the startup xdb file so that you can also press F1 to activate the online help Example HELP Debugging C Programs C79000 G7076 C520 01 2 53 Organon XDB Command Set 2 40 IF Syntax IF lt expression gt THEN lt commandlist gt ELSE lt commandlist gt END Description lt expression gt lt expression gt is evaluated If the result of lt expression gt is not zero the command list between THEN and ELSE or THEN and END if ELSE is omitted is executed If the result of lt expression gt is zero the optional ELSE part or the command after the END keyword is executed lt commandlist gt The lt commandlist gt is an arbitrary list of commands separated by command delimiters The command delimiter is the character The F command can be nested In batch files it is additionally possible to separate commands with the newline character The whole sequence between F and END is one command If it is itself a member of a command list the command delimiter
98. d E too many labels E no history E missing BATCH file name E not a register name E no BATCH file name Organon XDB Error Messages DESCRIPTION End of input is reached inside the IF body Check the input The keyword THEN is necessary at this point of input The keyword END is necessary to terminate the action list of a true false node in an IF construct The entered string does not form an expression in the current input language The entered word is no keyword This keyword is not allowed here Look at your manual for the correct syntax A label can be defined only once Too many labels are defined Reduce your input The command HISTORY is allowed on WINDOW level only The name of the batchfile is missing This is not a name of any of the target CPU registers The entered string is not a string constant 3 29 Organon XDB Error Messages CODE CLASS TEXT DESCRIPTION U P SELIL E not a language name This is not an identifier for an XDB language name U P TNRET E missing END The END keyword is necessary to terminate the optional action list of the BREAKPOINT or WATCHPOINT command U P UEOC E unexpected EOF by The last read word signals improper command completion Review your input U P UFLAB E unbalanced labels The BATCH File contains undefined label references U P UNID E not a label This is neither a LABEL nor a keyword U P WHNEX E missing WHEN The WHEN expression is expression mis
99. d This is very useful if several search directories are specified Example SHOW SOURCE References SHOW DIRECTORY SET DIRECTORY Debugging C Programs C79000 G7076 C520 01 2 141 Organon XDB Command Set 2 98 SHOW STATUS Syntax SHOW STATUS Description Displays the current task as well as all debug IDs loaded by the debugger Example SHOW STATUS References SET DEBUG SHOW DEBUG Debugging C Programs 2 142 C79000 G7076 C520 01 Organon XDB Command Set 2 99 SHOW SYMBOL Syntax SHOW SYMBOL lt expression gt Description The expression lt expression gt is evaluated and the result is taken as the address of a symbol The nearest global symbol with an optional offset is displayed Examples SHOW SYMBOL ptrtab 4 SHOW SYMBOL funptr References EVALUATE ADDRESS Debugging C Programs C79000 G7076 C520 01 2 143 Organon XDB Command Set 2 100 SHOW TASK Syntax SHOW TASK ID lt task id gt SHOW TASK lt taskname gt Description All or the selected tasks are displayed in the command window Their task names assigned by the target system their command line arguments and their internal task IDs are displayed lt taskname gt This optional argument can include wildcard characters such as and D lt task id gt With the optional D parameter a particular task can be selected If the lt task id gt value is omitted all available task IDs are displayed The current
100. d When you are finished click Ok Debugging C Programs 1 38 C79000 G7076 C520 01 Organon XDB User Interface e Macros The Organon XDB command language is a powerful tool containing features like loops and macros This menu item allows the convenient manipulation of macros Mark the macro you wish to modify or delete by using the mouse or the cursor keys then click the Delete resp Modify button See Command Reference for a description of macros in the command language Modify allows you to change the command list connected to the macro Modify macro step3 x Command Pe Cancel To create a new macro click the Add new button or hit lt Alt A gt The following window appears Name Ok Command Cancel Button r Enter the macro name into the Name field and the macro body into the Command field When you are finished click Ok Debugging C Programs C79000 G7076 C520 01 1 39 Organon XDB User Interface Button When adding a new macro to the list you have the option to create a button with the same name To do so click the checkbutton Button If the macro contains parameters you will be asked to provide them upon activation of the button Note that modification or deletion of the macro deletes the appropriate button while manipulation of the button see below menu item Options Buttons has no effect on the macro e Buttons Organon XDB allows you to define additional buttons and to link
101. d to expressions like 42 or i 1 which do not have a memory address LEVEL lt nr gt If the expression to be evaluated lt expr gt denotes a structure containing sub structures the LEVEL qualifier limits the depth of the evaluation to the number lt nr gt lf the depth number is omitted the complete substructure is taken This is also the case if the option LEVEL is omitted WINDOW lt nr gt lt nr gt denotes the ID number of the evaluation window Using an ID number not in use at the moment creates a new window If an evaluation window with the ID lt nr gt exists already this window now evaluates lt expr gt instead of its old expression If no window number is given a new window is created Debugging C Programs C79000 G7076 C520 01 2 49 Organon XDB Command Set lt size gt The type of memory access is defined by the qualifier lt size gt Possible values are BYTE WORD The amount of memory read from the target must be a multiple of the selected size The default is BYTE The lt size gt option can be used with any access Examples EVALUATE structl memberl EVALUATE 1 5 10 x i b EVALUATE ptr gt pmember a 2 EVALUATE structl array i EVALUATE i 10 structl member2 x EVALUATE DEC pointerl EVALUATE DEC structa EVALUATE BIN ptr gt pmember EVALUATE OCTAL
102. e among the files in the directory you browse The lower left field shows the suffix Browse looks for You can change this suffix by clicking the arrow on the right side of the subwindow then clicking the appropriate suffix or matching all suffixes in the menu that appears Now the middle left field shows all files with the suffix you chose Click the file you want to load or enter the file name into the upper left field As a last step click the OK button and the chosen file will be loaded Maybe the file you look for is in another directory maybe even on another disk In this case you have to find the correct directory first using the fields on the right side Choose the disk drive in the lower right field first click the arrow then click the appropriate disk drive The upper right field shows the available directories Doubleclick a directory to open it When you have found the right directory perform the steps described above to select the right file Note that opening an existing file for writing will destroy the contents of this file therefore the browser asks you to confirm this to avoid accidental destruction of important data 1 2 2 2 The Organon XDB Symbol Browser When the compiler transforms your program into assembler code it marks some of the more interesting points e g subroutine entry points or the location of a variable by giving them an internal name or symbol In the case of variables and Debugging C
103. e one of the following ASCII lt length gt DEC OCTAL BINARY HEX Debugging C Programs 2 82 C79000 G7076 C520 01 Organon XDB Command Set BINARY DEC HEX OCTAL Values are shown in binary decimal hexadecimal or octal notation if you use the BINARY DEC HEX or OCTAL qualifier ASCII lt length gt The qualifier ASC is used to show a char pointer or a char array as a readable string enclosed in double quotes Nonprintable characters are shown as signs By default a string is shown up to the first 0 byte This can be avoided by giving a length declaration after the ASCII qualifier separated by ASCII lt length gt Then up to lt ength gt bytes are shown where lt ength gt is any expression ADDRESS The qualifier ADDRESS shows the address where the result of the expression is stored If the expression refers to a register the register name is printed Note that this option is rather meaningless when applied to expressions like 42 or i 1 which do not have a memory address LEVEL lt nr gt If the expression to be evaluated lt expr gt denotes a structure containing sub structures the LEVEL qualifier limits the depth of the evaluation to the number lt nr gt If the depth number is omitted the complete substructure is taken This is also the case if the option LEVEL is omitted WINDOW lt nr gt lt nr gt denotes the ID number of the evaluation window Using an ID numb
104. e shown debugger variable cannot be converted into a string word The debugger variable used in an expression ID is not defined There is no debugger variable defined with the issued name Wrong debug info is used or no debug info is loaded The shown debug id is invalid Only numbers greater or equal to zero are allowed The tag name of the symbol item is different from that of the type information 3 5 Organon XDB Error Messages CODE L B DIVZ L B DRNF L B DVRD L B ERANS L B ERSNA L B EVIX L B EVMX L B EVRI L B FXCV L B HIID L B HIST 3 6 CLASS TEXT E division by zero directory not found readonly variable can t erase ASSEMBLER without SOURCE can t erase SOURCE without ASSEMBLER invalid index type evaluation string too long invalid range selection unknown type in cast expression no history id no history string DESCRIPTION The current evaluated expression contains a division by zero The specified directory was not found This debugger variable is predefined The user cannot set the value of a predefined debugger variable At least one of the two windows must be displayed At least one of the two windows must be displayed The shown value is not allowed as an array index The string for evaluation window is too long These two values do not forma valid range The start value exceeds the end value The shown tag is
105. e the menu item Debug Evaluate or click the Evaluate button a pop up window appears where you enter the expression to be evaluated If you have copied text into the copy and paste buffer this text is the default value for the expression The same holds for the Search command which can be issued by clicking the Search button or choosing the menu item File Search When the search window pops up the content of the copy and paste buffer is in the pattern field already Example Examining the C program displayed in the source window you wonder whether the condition in the if statement on line 23 is true in the moment Source S22 s22 c asl _32 _234 3 a234 4 if a _ 234 2234 10 tC Ter if pd0 gt flgd 0 printf s22er 1 Upper and lower case letters are different 2 ene a ro 4 if pd0 gt flgd 0 printf s22er 4 Debugging C Programs 1 76 C79000 G7076 C520 01 Organon XDB User Interface You place the mouse at the beginning of the condition press down the left mouse button and drag the mouse across the condition marking it Source S22 s22 c ro rot if pd0 gt flgd 0 printf s22er 1 Upper and lower case letters are different 2 if A a re ro d if pd0 gt flgd 0 printf s22er 4 Now you click the tool bar button Evaluate and this window pops up si Evaluate Expression EWR4cLG TA G Beam Format Memory access def
106. ebug information of a file already loaded The segment specifier must be included in quotation marks Debugging C Programs C79000 G7076 C520 01 2 59 Organon XDB Command Set TASK lt tname gt 2 60 The segment information is assigned to the specified task lt tname gt The taskname must be included in quotation marks If the task name is omitted the current task of the debugger is used Note the debugger searches for a file named tname BD which contains the corresponding debug information This file can be generated using the PE32BND converter which is part of the XDB distribution The PE32 file output of the Borland TLINK is converted to a bound file using the syntax pe32bnd pe32file Single tasks can be loaded from the PC file system with the TASK lt task gt command of the LOAD command or using the Load requester All host versions of XDB386 accept the load command given on the command line LOAD TASK c rmos test test1 386 of testl LOAD TASK a test2 386 of test2 The second way to load a task is the download method The following commands imply that the task resides on floppy disk or on hard disk in the target LOAD BINARY TASK c rmos test test1 386 of testl LOAD BINARY TASK a test2 386 of test2 If the task was loaded successfully the debugger returns a task id To attach that task to the debugger enter set task attach set id lt task id gt This command is available vi
107. ecific data This feature is available for Intel processor targets only See chapter 1 4 for a detailed description e 180386EX Registers This item enables you to manipulate some CPU specific data This feature is available for Intel 386EX targets only 1 2 1 3 Run Run Ctrl R Run until Ctrl N Step Next Recapture This menu offers several ways to execute the target program The execution can be continuous or stepwise You can also issue commands to the host system If the connection between host and target is noisy it can be reestablished You can issue these commands by clicking them or by hitting the underlined letter while pushing down the lt Alt gt key Some commands are linked to hot keys so that Debugging C Programs C79000 G7076 C520 01 1 21 Organon XDB User Interface they can be issued without opening the menu You see these hot keys on the right side of the menu For example you can start the execution without opening the Run menu just by hitting lt ctrl R gt e Run Execute the target program The execution stops if a breakpoint or watchpoint is encountered e Run until Executes the target program until a certain condition is true Possible conditions are Line The execution reaches the specified line of code Note that this line is not executed Expression The location denoted by the expression is reached The execution stops immediately before this location is executed For example if the
108. ed APPEND With this option the output is appended to the selected file instead of overwriting it Debugging C Programs 2 92 C79000 G7076 C520 01 Organon XDB Command Set OVERWRITE With this option no warning is issued if a protocol file exists already Examples SET PROTFILE WINDOW ASSEMBLER bericht prt SET PROFFILE ALL log session prt References CLOSE PROTFILE SHOW PROTFILE Debugging C Programs C79000 G7076 C520 01 2 93 Organon XDB Command Set 2 65 SET REGISTER Syntax SET REGISTER SIZE lt size gt lt register gt lt expr gt Description lt register gt lt expr gt The specified hardware register lt register gt is filled with the value of the expression lt expr gt SIZE lt size gt The optional qualifier SIZE defines the number of bytes which are changed in the register The following values are allowed for lt size gt Value Description 1 byte is written 2 bytes are written 4 bytes are written By default the whole register is set The result of lt expr gt is converted according to the type and size of the register Legal Sizes Debugging C Programs 2 94 C79000 G7076 C520 01 Organon XDB Command Set LONG LONG LONG LONG WORD WORD BYTE WORD BYTE WORD WORD BYTE WORD LONG BYTE WORD LONG BYTE WORD LONG BYTE WORD LONG BYTE WORD LONG BYTE WORD LONG LONG BYTE WORD
109. ed This overrides the default which is the size of the result of lt expression gt For restrictions introduced by the low level hardware interface refer to the command SET TRACEPOINT Debugging C Programs 2 110 C79000 G7076 C520 01 Organon XDB Command Set Examples SET WATCHPOINT AT array 10 SET WATCHPOINT AT badloc HARD 1 SET WATCHPOINT ACCESS WRITE AT deadzone SET WATCHPOINT ACCESS READ AT boxl CONTINUE THEN PRINT fetch mailbox 5d boxl END References DELETE WATCHPOINT DISABLE WATCHPOINT ENABLE WATCHPOINT SET TRACEPOINT Notes XDB issues a warning message if the requested watchpoint cannot be executed in real time Debugging C Programs C79000 G7076 C520 01 2 111 Organon XDB Command Set 2 72 SHOW Commands Syntax SHOW lt show_modes gt The following lt show_modes gt are available 2 112 ACTIVE BREAKPOINT BUTTON CALLS DBVAR DEBUG DECLARATOR DESCRIPTOR DIRECTORY ESCAPE EVALUATE INFO KEY LANGUAGE LEVEL LOGFILE MACRO MEMORY MODULE OPTION PROTFILE REGISTER SEGMENT SCOPE SOURCE STATUS SYMBOL TASK TRACEPOINT TYPE VERSION WATCHPOINT Debugging C Programs C79000 G7076 C520 01 Organon XDB Command Set 2 73 SHOW ACTIVE Syntax SHOW ACTIVE lt level gt lt regexp gt SHOW ACTIVE GLOBAL lt regexp gt SHOW ACTIVE MODULE lt regexp gt SHOW ACTIVE CURRENT lt regexp gt
110. ed by one until it reaches zero Now the execution is halted and lt current _skip gt is set to lt skip gt again A indicates that a non empty list of actions is attached to the watchpoint C is displayed if the option Continue is set lt hara gt If the watchpoint is a hardware maintained watchpoint this is its internal number lt name gt lf a symbolic name was given to the watchpoint it is displayed here lt actions gt If a list of actions is attached to the watchpoint it is displayed here e Set Tracepoint Similar to watchpoints tracepoints can be used to watch a piece of memory e g a variable A trace window is opened for every tracepoint and the value stored in the memory to be traced is displayed Unlike breakpoints or watchpoints the encounter of a tracepoint does not stop the execution Set Tracepoint Location C Hard ni Enter the location into the Location field If the hardware interface supports real time tracepoints including all the specified conditions the program runs on full execution speed If not XDB must simulate them by maintaining a list of set tracepoints and looking whether the execution changed one of them But looking for these events at every step of execution is rather time consuming slowing down the execution speed If you want to use Debugging C Programs 1 32 C79000 G7076 C520 01 Organon XDB User Interface processor maintained tracepoints only to en
111. ed in the moment The symbols known there are accessible now and the source window shows the text of this calling routine the line to be executed next being the current line 1 2 3 10 Display Hide Source Window As the name suggests this button displays the source window if it is hidden or hides it if it is displayed already Identical to the menu item Display Source The source window is explained in chapte 00 01 1 2 3 11 Display Hide Assembler Window MII Hides or displays the assembler window See chapter 1 3 3 for a description of this window 1 2 3 12 Display Hide Register Window Like the menu item Display Register this button hides or displays the register window which is explained in chapter 1 3 4 Debugging C Programs C79000 G7076 C520 01 1 53 Organon XDB User Interface 1 2 3 13 Display Hide Task Window Like the menu item Display Task this button hides or displays the task window 1 2 3 14 Display Hide Remote System Window Displays or hides the remote system window see chapter 1 3 6 like the menu item Display Remote 1 2 3 15 Evaluate Does the same as the menu item Debug Evaluate The user is asked to enter an expression to be evaluated The result is shown either in the command window or in an evaluation window see chapters 1 3 1 and 1 3 7 In the former case the evaluation takes place only once while in the latter case every subsequent change of the result is visible The
112. em File Save Settings Font Lx Font style Size 8 n T Courier New 10 Cancel Fixedsys 12 T MS LineDraw 15 Terminal f i ei Sample AaBbYyZz Script Western X Debugging C Programs 1 42 C79000 G7076 C520 01 Organon XDB User Interface e Edit colors You don t like the color of the texts in the subwindows Choose this menu item and change to your favorite color This change is effective in this session only unless you make it permanent by activating the menu item File Save Settings Some texts are written in a different color to get your attention e g a register value that changed during the last instruction This is called the enhanced color and you can change it too Edit Colors x Enhanced color 255 0 0 ai Cancel Modify Use default colors Use internal color table Basic colors ei I Mero a oE br D r NEI EN E BREE E See ERE E Custom colors tf f f fy ii tf NN penne Custam Salars gt gt Debugging C Programs C79000 G7076 C520 01 1 43 Organon XDB User Interface 1 2 1 7 Windows Tile Cascade Arrange Icons 1 Source CRM crm c 2 Command 3 Assembler 0160 00000000 4 Register 5 Remote While you are free to move the subwindows in the subwindow area this menu enables you to arrange them quickly in one of these ways e Tile All windows are visible no window is fully or partially hidden by another one e
113. ement However the data in this manual are reviewed regularly and any necessary corrections included in subsequent editions Suggestions for improvement are welcomed Technical data subject to change Siemens AG 1997 Siemens Aktiengesellschaft C79000 G7076 C520 01 Preface Purpose Contents Audience Debugging C79000 G C 70 Programs 76 C520 01 The information in this manual will enable you to debug programs using the Organon XDB Debugger This user manual describes the Organon XDB Debugger The manual provides you with information on the following subjects e Organon XDB User Interface Organon XDB Commands e Organon XDB Error Messages This manual is intended for STEP 7 users wishing to create and debug C and C application programs for SIMATIC M7 In order to create and debug M7 applications using textual high language programming in C C the following knowledge is required e using STEP 7 A sound knowledge of the STEP 7 standard software is essential for proj ect management symbol editing and transferring new programs from the programming device to the PLC You will find the relevant information in the STEP 7 User Manual e the programming languages C and C C Knowledge of the programming languages C and C is necessary for creating applications You should also be familiar with the integrated de velopment environment of Borland C C You will find the required information in the docum
114. emicolon which are separated by an unknown number possibly 0 of unknown characters i e letters digits spaces etc The following strings and many more match this search pattern amp amp X amp pointer_7 1 2 3 3 Step Ey This button is identical to the menu item Run Step It tells Organon XDB to execute the next instruction If this instruction is a subroutine call the execution stops at the first instruction of the subroutine 1 2 3 4 Next This button is identical to the menu item Run Next XDB continues the execution until the next line of code If a subroutine call is encountered the whole subroutine is executed Es 1 2 3 5 Run The execution of the target program is continued beginning with the current line the line printed in inverted color in the source window The execution stops if a breakpoint or watchpoint is encountered This button is identical to the menu item Run Run Debugging C Programs C79000 G7076 C520 01 1 51 Organon XDB User Interface 1 2 3 6 Recapture E This button is identical to the menu item Run Recapture Organon XDB tries to restore the current situation Therefore Organon XDB disregards the current status information e g register values task states and does an update from the target 1 2 3 7 Set Scope Up If the execution enters a subroutine the scope is set to this subroutine i e the source window shows the source code of this subroutine and only
115. entation supplied with Borland C C Preface Other Manuals How to Use this Manual Additional Assistance The following table contains a list of manuals you will require in addition to this user manual Standard Software for S7 and M7 STEP 7 Installing and using STEP 7 User Manual M7 300 and M7 400 Introduction to creating M7 applioca Program Design tions in C C Programming Manual System Software for M7 300 and M7 400 Descriptions of the RMOS system calls System and Standard Functions M7 API library and standard CRUN Reference Manual library System Software for M7 300 and M7 400 Installing starting up and operating M7 Installation and Operation PLCs User Manual Pro C C for M7 300 400 Using the optional Package M7 ProC Writing C Programs C and the Symbol Import Editor Borland C C C C Programming Documentation on CD ROM Using the integrated development en vironment and tools To enable you to access specific information more easily this manual con tains the following access help e At the start of the manual you will find a complete list of contents e At the start of each chapter you will find an overview of the chapter If you have any questions regarding the products described in this manual and cannot find the answers here please contact the Siemens representative in your area You can find the address of your local Siemens representative in the appendix Siemens C
116. er not in use at the moment creates a new window If an evaluation window with the ID lt nr gt exists already this window now evaluates lt expr gt instead of its old expression If no window number is given a new window is created Debugging C Programs C79000 G7076 C520 01 2 83 Organon XDB Command Set lt size gt The type of memory access is defined by the qualifier lt size gt Possible values are BYTE WORD LONG The amount of memory read from the target must be a multiple of the selected size The default is BYTE The lt size gt option can be used with any lt format gt qualifier It is ignored when ASCII is used which forces byte access Examples SET EVALUATE statusflag SET EVALUATE iomode write arglen SET EVALUATE token type gt t_base Notes This is not a tracepoint which monitors the expression continuously No special services are requested from the target system References DELETE EVALUATE DISABLE EVALUATE ENABLE EVALUATE EVALUATE SET OPTION SET TRACEPOINT SHOW EVALUATE Debugging C Programs 2 84 C79000 G7076 C520 01 Organon XDB Command Set 2 59 SET INTERFACE Syntax SET INTERFACE lt string gt SET INTERFACE lt var gt Description The string lt string gt or the contents of the debugger variable lt var gt is given to the hardware interface This enables the user to set special target commands without using
117. ess specified by lt expression gt LENGTH lt length gt The optional parameter LENGTH defines the number of bytes to be displayed The default is 16 bytes SIZE lt size gt The optional parameter S ZE defines the grouping of the bits in the memory The size defaults to BYTE The following values are allowed for lt size gt WINDOW The memory is displayed in a memory window rather than in the command window Debugging C Programs C79000 G7076 C520 01 Size Description BYTE The contents are displayed as a sequence of byte values WORD The contents are displayed as a sequence of 16 bit words LONG The contents are displayed as a sequence of 32 bit long words FLOAT The contents are displayed as a sequence of 32bit IEEE floating point variables DOUBLE The contents are displayed as a sequence of 64bit IEEE floating point variables EXTENDED The contents are displayed as a sequence of 96bit IEEE floating point variables 2 133 Organon XDB Command Set lt format gt This option defines the format of the output Following values are allowed for lt format gt BINARY OCTAL DEC HEX which is the default Examples SHOW MEMORY buffer SHOW MEMORY SIZE WORD action statetab SHOW MEMORY SIZE LONG WINDOW ivttab M M Le al A SHOW MEMORY SIZE DOUBLE tschebytab SHOW MEMORY LENGTH 256 area References EVALUATE SET VALUE Debugging C Programs 2 134 C79000 G7076 C520 01 Org
118. ession DISPLAY lt window gt lt window gt may have the following values ASSEMBLER MODULE SYSREG GDT REGISTER TASK IDT REMOTE LDT SOURCE DISPLAY ASSEMBLER Displays the assembler window DISPLAY MODULE Displays the module window This window shows all modules which are mentioned in the debug information DISPLAY REGISTER Displays the register window DISPLAY REMOTE Displays the remote window which works like a terminal and shows the output of the RMOS low level debugger For details see REMOTE DISPLAY SOURCE Displays the source window Debugging C Programs C79000 G7076 C520 01 2 37 Organon XDB Command Set DISPLAY TASK Displays the task window DISPLAY GDT DISPLAY IDT DISPLAY LDT DISPLAY SYSREG These commands are described in the sections following Examples DISPLAY ASSEMBLER DISPLAY REMOTE Reference ERASE REMOTE 2 38 Debugging C Programs C79000 G7076 C520 01 Organon XDB Command Set 2 27 DISPLAY Descriptor Table Syntax DISPLAY GDT REPEAT lt count gt lt first gt DISPLAY IDT REPEAT lt count gt lt first gt DISPLAY LDT REPEAT lt count gt GDT lt index gt lt first gt Description A window displaying one of the descriptor tables GDT Global Descriptor Table LDT Local Descriptor Table or IDT Interrupt Descriptor Table is opened lt first gt This optional expression denotes the
119. explained in chapter By default the Line checkbutton is activated You can enter the line number and click the Ok button or choose one of the other conditions Browse invokes the symbol browser which is explained in chapter 1 2 2 2 e Step Execute the next instruction If a subroutine call is encountered the execution stops at the first instruction of the subroutine If Organon XDB is in assembler mode instruction means assembler instruction otherwise the next source code instruction is executed Debugging C Programs C79000 G7076 C520 01 1 23 Organon XDB User Interface e Next Execute until the next line of code If a subroutine call is encountered the whole subroutine is executed If Organon XDB is in assembler mode line of code means assembler instruction source code line otherwise e Recapture Organon XDB tries to restore the current situation Therefore Organon XDB disregards the current status information e g register values task states and does an update from the target Useful if the connection between host and target is noisy This functionality is also available via the command SET TASK SET see Command Reference e Spawn Opens a window in which a command to the host system can be issued Type the command into the pop up window then click Ok and the command will be transferred to the command interpreter of your host machine Spawn Command Debuggi
120. expression has a memory address If you click the window with the right mouse button the cursor is set to this line and the following menu appears if on a structure otherwise You can click one of these items or hit lt Alt gt the underlined letter and XDB will react as follows e Value You can change arbitrarily the value of the expression in the active evaluation window Just click the word Value in the context menu or doubleclick the value part of the evaluation window to make the Value window pop up Enter an expression into the Value field then choose the appropriate Format When you click Ok the expression is evaluated and its result is assigned to the address of the expression in the active evaluation window If the expression has no address e g i 1 Organon XDB will issue an error message If the expression denotes a structured variable you can change only one component at a time First click the component in the evaluation window then choose the item Value Debugging C Programs C79000 G7076 C520 01 1 67 Organon XDB User Interface A Value Format O default O octal O decimal binary O hexadecimal O ascii e Type Clicking this item or doubleclicking the type part of the evaluation window makes the Type window pop up showing some information about the expression of the active evaluation window like its address and type declaration Note that an expression like i 1 ha
121. f letters and digits The first character has to be a letter The names of internally predefined variables and macro functions must not be used see SET VALUE lt text gt is the replacement text of the macro lt texft gt can contain more than one line The maximum number of parameters for a macro is 20 These parameters can be addressed by lt number gt The macro may contain any text Macros cannot be used recursively The execution of the macro on the command level is done by name parameterl parameter9 Only the parameters actually used must be specified The others are replaced by empty strings The macro is replaced and the replacement text is interpreted like any other input Macros can be nested and used as parameters to other macros The parameters are expanded during the scanning of the parameter list If no parameters are given the parentheses may be omitted Macros must not be recursive Macros and debugger variables use the same designations In case of equal names the macro definition is used OVERWRITE Redefining an existing macro causes an error message But it is possible to redefine a macro if the qualifier OVERWRITE is used In this case only a warning message appears Debugging C Programs C79000 G7076 C520 01 2 15 Organon XDB Command Set BUTTON It is possible to define toolbar buttons for the macro by using the BUTTON qualifier The macro is executed whenever the associated button is pressed
122. feature enables you to jump over pieces of the program leaving them unprocessed or to repeat the execution of a piece of the program As this feature forces the program to behave in a way its author has never intended it should be used carefully Debugging C Programs C79000 G7076 C520 01 1 63 Organon XDB User Interface 1 3 4 Register Window GERE Of x 0000000d a 0000008b 0036a06c 0000008b 6811750b 00004002 0035 07d ffc7efbc ffc7efc4 00243216 vr n 20 Itsz A P c fy This window allows you to examine the contents of the registers Registers which were changed by the last instruction executed are displayed in a different color the so called enhanced color see menu item Options Edit Colors chapter 1 2 1 6 If you click the register window with the right mouse button the following menu appears Value Value Type D ipt i oi Follow Back Selector register or other registers e Value You can change arbitrarily the value of the register in the register window Just click the word Value in the context menu or doubleclick the value part of the register window to make the Value window pop up Enter an expression into the Value field then choose the appropriate Format When you click Ok the expression is evaluated and its result is assigned to the register in the register window Value Format 0x00000000 O default O octal ance O decimal O binary C hexadecimal C ascii Debug
123. for an LINE expression is needed The expression allows a line number or level number only A number constant used as level is requested The is missing between two expressions of an argument list The name of the given operator exceeds 7 characters This is not an identifier name The shown string does not form a unary expression 3 25 Organon XDB Error Messages CODE U E PRBR U E PRPAR U E REGI U E TLP U E XID U E XNUN U E XRBR U E XRPAR U L CHRDEL U L EOI 3 26 CLASS TEXT E expected E expected E invalid register too many path prefixes identifier required no unary expected missing char const delimiter missing unexpected End of Input on DESCRIPTION The closing is missing after an array index The closing after a PASCAL expression is missing This name is no CPU general purpose register of the target processor The path specification of an identifier contains more than the allowed specifications of module procedure and level A C ldentifier is necessary at this point of the expression The shown string does not form a unary expression The closing is missing after an array index The closing is missing after an expression A character constant has to be enclosed in single quotes The end of input condition was set by the mentioned input source Check the source e g a truncated BATCH file or a c
124. g C Programs C79000 G7076 C520 01 1 85 Organon XDB User Interface 1 4 3 2 Segment Registers The behaviour of the segment registers CS ES DS etc is somewhat different Clicking one of them with the right mouse button summons this menu Value Descriptor Only the items Value and Descriptor are enabled The item Value is described in the previous chapter Selecting Descriptor activates the descriptor modification mechanism described in chapter 1 4 1 1 Both menu items can be selected without summoning the menu Doubleclick the segment register name to activate the descriptor modification mechanism or doubleclick the segment register value to activate the value modification mechanism Debugging C Programs 1 86 C79000 G7076 C520 01 Organon XDB Command Set 2 2 1 2 2 2 3 2 4 2 5 2 6 2 7 2 8 2 9 2 10 2 11 2 12 2 13 2 14 2 15 2 16 2 17 2 18 2 19 2 20 2 21 2 22 2 23 2 24 2 25 2 26 2 27 2 28 2 29 2 30 Organon XDB Command Set BATCH BREAK CLOSE CONTINUE DEFINE Commands DEFINE BUTTON DEFINE KEY DEFINE MACRO DEFINE SYMBOL DELETE Commands DELETE BREAKPOINT DELETE BUTTON DELETE DEBUG DELETE DIRECTORY DELETE EVALUATE DELETE KEY DELETE MACRO DELETE MODULE DELETE TRACEPOINT DELETE WATCHPOINT DISABLE Commands DISABLE BREAKPOINT DISABLE EVALUATE DISABLE TRACEPOINT DISABLE WATCHPOINT DISPLAY DISPLAY Descriptor Table DISPLAY SYSREG ENABLE Commands ENABLE BREAKPOINT Debugging C Progr
125. g trees which are addressed by a unique number called lt debug id gt The debugger selects the right debug tree after every program halt automatically according to the current location of the application With SET DEBUG this selection can be changed so that the symbols and types of all other regions of the program can be accessed After the next execution of a command as STEP NEXT or RUN the debugger switches to the right lt debug id gt automatically This allows concurrent debugging of independently linked modules which decreases the size of the images and allows a finer granularity of application modules The actual lt debug id gt is shown enclosed in square brackets at the left field of the baseline of the main window Example SET DEBUG 3 Debugging C Programs 2 76 C79000 G7076 C520 01 References DELETE DEBUG LOAD DEBUG SHOW DEBUG SHOW SCOPE Debugging C Programs C79000 G7076 C520 01 Organon XDB Command Set 2 77 Organon XDB Command Set 2 55 SET DESCRIPTOR Syntax SET DESCRIPTOR LENGTH lt length gt GDT lt GDT index gt lt address gt SET DESCRIPTOR LENGTH lt length gt IDT lt IDT index gt lt address gt SET DESCRIPTOR LENGTH lt length gt LDT lt GDT LDTsel gt lt LDT index gt lt address gt SET DESCRIPTOR LENGTH lt length gt MEMORY lt address gt lt address gt SET DESCRIPTOR LENGTH lt length gt SEL
126. ging C Programs C79000 G7076 C520 01 1 64 Organon XDB User Interface 1 3 5 Task Window HERG STRUCT 003C RMOSOO This window displays all currently active tasks It shows the task names XDB task IDs and the scope information of the tasks You can doubleclick any task to make it the current task for XDB The scope info of this task is set and the source window is updated to reflect this task s source code If you click the task window with the right mouse button this popup window appears Set Task Task Info Current Task You can select each of these items to get the following actions e Set Task Sets the scope of the currently highlighted task this is equal to doubleclicking this task e Task Info Displays the output of the command SHOW TASK ID lt task_id gt in the command window where lt task_id gt is the ID of the highlighted task e Current Task Sets the currently active task As in RMOS the active task is the current task this is a no operation This menu item exists for compatibility reasons only Debugging C Programs C79000 G7076 C520 01 1 65 Organon XDB User Interface 1 3 6 Remote System Window EA Remote BEE gt dir unit aj Cataloged resources Synbolic name kind id Symbolic name kind id BYT_COM1 UNIT 0004H BYT_COM2 UNIT 0005H BYT_EGA_0 UNIT 0000H BYT_EGA_1 UNIT 0001H BYT_EGA_2 UNIT 0002H BYT_EGA_3 UNIT 0003H BYT_LPT1 UNIT 0006H FDO_O UNIT 0000H HDO_O UNIT 0000H MO UNIT 0000H PT
127. h and meta characters which have a special meaning In this case the metacharacters matches any character and matches any string are recognized For example the symbols PDO PD1 and PDX match the pattern PD while DO is matched by DO and PDO The default pattern matches every symbol Debugging C Programs 1 48 C79000 G7076 C520 01 Organon XDB User Interface If you click the Select functions only box only symbols denoting subroutines are shown Now enter the symbol name into the Symbol field or click the symbol on display then click the Ok button or hit lt Alt O gt You can dismiss the symbol browser anytime you want by clicking the Cancel button or hitting lt Alt C gt 1 2 3 Buttons While you can use the full capacity of Organon XDB by typing commands into the command window some of the most important commands are attached to pre defined buttons thus you can issue them by a single click Clicking a button with your left mouse button activates the command while a click with the right mouse button summons a brief explanation text Organon XDB checks whether the use of the buttons is meaningless in the current situation e g search for a pattern when the source window is not visible and disables buttons whose use would make no sense in the moment e MENES aaea a EES KE A Tool Bar 1 2 3 1 Load This button is identical to the menu item File Load which is explained in detai
128. hance the performance click the Hard checkbutton see also SET TRACEPOINT command in the Command Reference As always Browse shows all known symbols You find a detailed description of the symbol browser in chapter e Edit Tracepoints This menu item shows all existing tracepoints and offers the opportunity to Modify them Disable disables the tracepoint i e while the tracepoint still remains existent a change of the traced memory is not displayed Of course disabled tracepoints can be enabled again by clicking the Enable button which is visible only if you click a disabled tracepoint Delete and Delete all delete the tracepoint marked by inverted color display resp all existing tracepoints Edit Tracepoints 5 CRM MAIN PDO addr 0x0290 0x00000090 enabled 6 CRM MAIN DO addr 0x0290 0x00000054 enabled The tracepoints are displayed in the following form lt n gt lt pos1 gt addr lt pos2 gt lt status gt HW lt hard gt where lt n gt is the id number of the tracepoint lt pos1 gt is the symbolic address to be traced lt pos2 gt is the memory address lt status gt is either enabled or disabled lt hard gt If the tracepoint is a hardware maintained one this is its internal number Debugging C Programs C79000 G7076 C520 01 1 33 Organon XDB User Interface e Calls The stack of procedure calls is displayed The procedures are listed with their names addresses and
129. hed by a tracepoint is changed The option is switched off by default Attach segments Can be set to Local default or Global In the latter case all segments specified at initial load or loaded with the menu item File Load are attached to the global segment map Otherwise loaded segments are attached to the current task Assign tasks Can be set to Local or Global default In the Global mode all target system tasks are assigned to one virtual debugger task otherwise all tasks are monitored separately Debugging C Programs C79000 G7076 C520 01 1 37 Organon XDB User Interface e Keys You can use the function keys to store commands The menu item Options Keys shows the strings connected to the function keys so far You can change them by using the Modify button If you want the string to contain a newline write n instead To delete a key mark it by clicking it then click Delete Edit Keys help n set breakpoint at display register n display assembler n set lang asm n set lang cin exitin Whenever you hit a function key the text connected to it is written into the command window To create a new key assignment select an unused key from the list and klick the Modify button The F10 function key is assigned with the default Windows key definition and may not be changed The following window appears Modify key F5 E Command lecita Cancel Enter the command into the Command fiel
130. hese hot keys on the right side of the menu For example you can start a search without opening the file menu just by hitting lt Alt S gt e Load loads the task to be debugged into the debugger Assuming your next Organon XDB session will deal with the same task the information which files to load are stored in the Windows registry and is read at the beginning of every Organon XDB session In other words the values you enter now will be the default values for the next Load The pop up window that asks for the boundfile and task to be loaded looks like this Debugging C Programs 1 10 C79000 G7076 C520 01 Organon XDB User Interface Load Boundfile Cancel O Task Loadable Taskfile Browse O Download from Debugger O Segment Loader Result Segment Task ID The boundfile is the file which contains the debug information It is created by the converter and has the suffix bd Enter the boundfile name and the taskfile name then click Ok You can quit the load mode anytime by clicking the Cancel button If you are not sure which file to load the Browse button gives you the opportunity to check the existing files You find a detailed description of the file browser in chapter 1 2 2 To load a task click the Task button and enter the name of the taskfile The task is supposed to be on the target machine unless you activate the Download from Debugger button in which case Organon XDB l
131. i EVALUATE HEX structl memberl EVALUATE amp i EVALUATE ADDRESS i EVALUATE ADDRESS structl EVALUATE ADDRESS structl memberl EVALUATE ADDRESS ptr gt pmember gt next gt next EVALUATE ASCII char_array 0 EVALUATE ASCII 10 char_pointer EVALUATE DBVPTR gt next idx References SET EVALUATE SET OPTION 2 50 lt format gt qualifier It is ignored when ASCII is used which forces byte Debugging C Programs C79000 G7076 C520 01 Organon XDB Command Set 2 37 EXIT Syntax EXIT Description EXIT terminates the execution of the actual batch file If EX T is used interactively on command level the debug session is finished To avoid leaving XDB by mistake this command must be confirmed by the user The message really quit appears in a pop up window If the Yes button is selected XDB quits In any other cases the command is ignored and XDB resumes execution Example IF quit THEN exit END Reference BATCH Debugging C Programs C79000 G7076 C520 01 2 51 Organon XDB Command Set 2 38 GOTO Syntax GOTO lt label gt Description This command can be used in a batch file only It is not allowed to use this command in interactive mode The command makes the command execution continue at the batch file line marked with lt Label gt Forward references to currently undefined labels are allowed but labels cannot be referenced from outside of the batch file where they are define
132. ible only if XDB detects an access because XDB compares against a reference value SKIP lt count gt The SKIP qualifier allows to specify a value which delays the stop of execution until this counter lt count gt decrements to zero CONTINUE Debugging C Programs C79000 G7076 C520 01 This qualifier lets the program continue after the detection of a watched condition and after execution of the optional action list This will not take place if the debugger variable ERROR has a non zero value 2 109 Organon XDB Command Set SYMBOL lt dbid gt The SYMBOL qualifier forces XDB to place the ID number of this watchpoint into the debugger variable lt dbiad gt HARD lt dbid gt The HARD qualifier forces the hardware interface to select the internal watchpoint specified by lt numbers If this watchpoint is not available an error message is issued With this option the i80386 debug registers can be used directly if they are not set Each of the four debug registers can serve as a trace watch or breakpoint THEN lt actions gt END lt actions gt is an optional command list enclosed between THEN and END These commands are executed at every stop at this watchpoint ACCESS FETCH READ WRITE ALL With the ACCESS qualifier the type of memory access can be specified Type Remark code fetch data read data write any LENGTH lt bytes gt With this qualifier the size of the monitored memory region can be specifi
133. if not present thereby saving the actual start up data for the next session If you decide not to start click the Cancel button which ends the start up routine immediately and cancels the session leaving the start up data untouched Organon XDB Startup Ea Working Directory i Source Directories Candi Initial batch file Target Connection mpi 2 1 2 More Options This is the start up window You can enter the following data e Working Directory This is the directory Organon XDB works in e Organon XDB assumes all files it wants to read or write to be in the working directory unless explicitly stated otherwise Debugging C Programs C79000 G7076 C520 01 1 3 Organon XDB User Interface 1 4 Source Directories In this field you specify the list of directories where Organon XDB looks for source files The working directory is always searched first So you don t have to enter the working directory here again For all other directories you may write the complete directory path or the path relative to the working directory lf you enter more than one directory separate them with commas Initial batch file A batch file is a file containing Organon XDB commands see the Command Reference It is a convenient way to store a list of commands you usually issue If a file name is entered in this line Organon XDB will read and execute this file prior to any command you issue If the initial batch file is
134. in the file Until now the debugger has not read line information of the given file The shown source module has a modification time which is newer than the debugged image An unknown macro name was entered in the emulator window 3 31 Organon XDB Error Messages CODE W I WENASC W I WENESC W I WETOL W I WILM W I WINA W I WINE W I WINH W I WINI W I WINR W I WINT 3 32 CLASS TEXT E non ASCII char E wrong escape sequence E macro identifier too long E negative line number E no ASSEMBLER window displayed E no EVALUATION window displayed E no HISTORY window displayed E no terminal associated E unresizable window E no TRACE window displayed DESCRIPTION A value larger than 7 bits was read from the input to the emulator window Only values between 0 and 127 are allowed ASCll character set Possibly an unmonitored function control key or a mouse button was pressed The read string is no valid escape sequence in the emulator window A macro identifier name longer than 79 characters was entered in the emulator window Line numbers must be greater or equal to zero The assembler window is not displayed at the moment The evaluation window is not displayed at the moment The history window is not displayed at the moment There is no terminal associated with the job This window has fixed geometry No resize is allowed The trace window is not d
135. ing Using Help e Reference manual Invokes the interactive help mechanism which corresponds to the Command Reference Debugging C Programs C79000 G7076 C520 01 1 45 Organon XDB User Interface e Using Help Choose this if you have no experience with online help It offers a good introduction how to work with this feature e About General information about Organon XDB About Organon XDB Organon XDB386 250C HLL Debugger for RMOS 3 c Copyright CAD UL GmbH 1994 1 2 2 Browsers Browsers are mechanisms that help you to look over a set of items and to choose one of them Several features of Organon XDB allow you to browse e g the files of your host system These browse mechanisms are described in this chapter 1 2 2 1 The Windows File Browser Some commands like reading a batch file require you to enter a file name If you are unsure which file is the one to use you can use the Browse function to get a list of available files Note that this function is not a Organon XDB builtin but a Windows library function Debugging C Programs 1 46 C79000 G7076 C520 01 Organon XDB User Interface Open Boundfile 7 1x File name Folders kbd c organon check Cancel ucheck bd yey lt j organon 2 check List files of type Drives Boundfiles bd x c system z This is the pop up window you see after clicking the Browse button The three fields on the left side help you to choos
136. ing point registers are shown as floating point numbers Special register values are encoded and shown in symbolic form The states of status bits are shown in an abbreviated manner Lower case letters mean that the bit is not set upper case letters indicate that the option is set For valid register names see SET REGISTER Examples SHOW REGISTE SHOW REGISTE SHOW REGISTE SHOW REGISTE EAX EBP DI HDI References SET REGISTER DISPLAY REGISTER Debugging C Programs 2 138 C79000 G7076 C520 01 Organon XDB Command Set 2 95 SHOW SCOPE Syntax SHOW SCOPE Description Display the current scope of the debugger If this is not the scope of the program this is marked via wind or walk Example SHOW SCOPE References SET SCOPE SHOW LEVEL Debugging C Programs C79000 G7076 C520 01 2 139 Organon XDB Command Set 2 96 SHOW SEGMENT Syntax SHOW SEGMENT Description Displays the global segment map of the debugger The address ranges for logical and physical addresses and the segment attributes are shown Example SHOW SEGMENT Reference LOAD GLOBAL Debugging C Programs 2 140 C79000 G7076 C520 01 Organon XDB Command Set 2 97 SHOW SOURCE Syntax SHOW SOURCE Description The complete file name of the module currently displayed in the source window is printed This means you can check which source code is displaye
137. ion code issued by the hardware interface is illegal Check your monitor This task cannot be continued because it is in error state Terminate this task and restart it The requested task id is not known by the debugger Neither a task name nor arguments exists The requested command is not allowed for this task 3 19 Organon XDB Error Messages CODE CLASS TEXT DESCRIPTION L B TXNR E no running task There is no monitored running task thus no active stack frame can be shown L B TYFX E cannot fixup The shown type name is typename referenced but its definition is not found in any debug table L B TYMK E can t construct this This type cannot be generated type internally by the debugger L B UDTY E undefined type The shown type is referenced but not defined L B UPLNM E can t build upload file The shown file name cannot be name converted to an upload file name L B UPLOP E can t open file The mentioned file cannot be opened Check its name and your access privileges L B VART E variable return offset The return address offset is variable and there is no prologue information about this function available L B ZSTY E zero sized type The shown type occupies 0 bytes of Memory M D BAOP E can t open BATCH This file cannot be read Check file its name and your permissions M D FMIOE E Disk i o error no The disk i o system interface detects an error M D FMIOW E Disk i o warning no The disk i o system interface
138. is command aborts issuing an error message APPEND If the file lt file gt already exists the commands following are written to the end of the file without destroying the old contents OVERWRITE If the file lt file gt already exists only a warning message is issued and the file is overwritten Example SET LOGFILE reuse bat References BATCH CLOSE LOGFILE SET PROTFILE SHOW LOGFILE Debugging C Programs C79000 G7076 C520 01 2 87 Organon XDB Command Set 2 62 SET MODULE Syntax SET MODULE SET MODULE lt module_name gt ALL LEI Description lt module_name gt The module lt module_name gt is loaded into the debugger and displayed in the source window Now all symbolic information and all line information of this module are available The scope is set to this module ALL MODULE ALL activates all modules of the loaded program The last loaded module is displayed Examples SET MODULE SET MODULE main ALL References DELETE MODULE SET OPTION SHOW DEBUG SHOW MODULE Notes The debugger loads the necessary information automatically A breakpoint at a procedure inside a module can be set even if the debug information of this module is not loaded Debugging C Programs 2 88 C79000 G7076 C520 01 Organon XDB Command Set 2 63 SET OPTION Syntax TION AUTOLOAD ON OFF TION TASK GLOBAL LOCAL TION SEGMENT GLOBAL LOCAL
139. isplayed on the screen Debugging C Programs C79000 G7076 C520 01 CODE W I WIRE W I WIRS W I WISF W I WISL W I WISM W I WISU W I WRLR W I WRUD W W HIID W W WAED Debugging C Programs C79000 G7076 C520 01 CLASS TEXT E can t move E not enough lines for REGISTERS can t open source file can t access line can t set scrollmode for window setup resize left right only resize up down only illegal history id editor Organon XDB Error Messages DESCRIPTION The requested positions would move the window border to invalid positions The register window cannot be displayed because the screen is occupied by other windows Use the RESIZE command The source file which name is stored in the debug information cannot be opened Check your permission and the path name Use the D option to add alternative path names The line cannot be read from the source file The scroll mode continue page is not selectable for all windows Look at the manual for a list of allowed windows The basic window setup failed Look at your configuration files This window border can be moved left or right only This window border can be moved up or down only The shown number is an illegal id number The command line editor has encountered an error 3 33 Organon XDB Error Messages Debugging C Programs 3 34 C79000 G7076 C520 01
140. kets lt module gt All or the selected modules are displayed in the command window They are marked with loaded if their debug information is read in If there is no source file found the module is marked with no source Modules of source files that have a more recent modification date than the program image are marked with modified The optional lt module gt argument can include wildcard characters such as and Examples SHOW DEBUG SHOW DEBUG io SHOW DEBUG data SHOW DEBUG ID SHOW DEBUG ID 1 link References DELETE DEBUG LOAD DEBUG SET DEBUG SET MODULE SET DIRECTORY Debugging C Programs C79000 G7076 C520 01 2 119 Organon XDB Command Set 2 79 SHOW DECLARATOR Syntax SHOW DECLARATOR lt expression gt Description The type definition of the result of the expression lt expression gt is displayed Sub array or member specifications are allowed Examples SHOW DECLARATOR strsok type SHOW DECLARATOR array 0 SHOW DECLARATOR pointer References SHOW INFO SHOW TYPE Debugging C Programs 2 120 C79000 G7076 C520 01 Organon XDB Command Set 2 80 SHOW DESCRIPTOR Syntax SHOW DESCRIPTOR REPEAT lt times gt GDT lt GDT index gt SHOW DESCRIPTOR REPEAT lt times gt IDT lt IDT index gt SHOW DESCRIPTOR REPEAT lt times gt LDT lt GDT LD
141. l in chapter 1 2 1 1 Debugging C Programs C79000 G7076 C520 01 1 49 Organon XDB User Interface 1 2 3 2 Search This button is identical to the menu item File Search This command searches for a specified pattern in the source code of the module displayed in the source window lf the end of the module is encountered a message is issued in the command window and the search starts at the top again The metacharacters matches any character and matches any string are recognized The source window displays the appropriate part of the source code coloring the line containing the matching string in the enhanced color see menu item Options Edit Colors chapter 1 2 1 6 Note that the search always starts at the beginning of the source code unless you search again for the same pattern in which case the search starts at the line after the one where the last matching string was found The search algorithm distinguishes between upper case and lower case unless Organon XDB was started with the option Convert symbols to upper case Examples BR NI searen OOO Ok Patten es conce Search for all strings starting with t followed by two unspecified characters and a s This search will find the strings this those it is for example MM HH 1 OL Debugging C Programs 1 50 C79000 G7076 C520 01 Organon XDB User Interface Search for an ampersand amp and a s
142. language Open the Language menu to see which languages are available The language Organon XDB expects is checkmarked To change to another language click the language name Debugging C Programs C79000 G7076 C520 01 1 25 Organon XDB User Interface gt Evaluate Expression ee Format rMemory access default decimal default O hexadecimal O octal C byte binary ascii O word Length Level ia pte Enter the expression you want to be evaluated using the current language Choose the format you like the result to be in If the expression denotes a pointer to a character string or a character array ascii might be useful If you choose ascii you may enter the number of characters to be displayed into the Length field Memory access Some processors allow byte wise or word wise memory access only If your target processor behaves this very restrictive way click the sort of access it accepts In most cases default works fine Level If the expression denotes a structure containing sub structures you can specify how many levels to step down into the structure Note that arrays may be evaluated partially e g if A is an array of appropriate length A 2 5 denotes the elements 2 3 4 and 5 If you click the Ok button the result is printed to the command window If you click the Window button instead an evaluation window is created e Set Breakpoint When debugging a program you may wish the program
143. m Examples LINE DOWN INE UP 20 INE 127 INE CURRENT Debugging C Programs C79000 G7076 C520 01 2 57 Organon XDB Command Set Reference PAGE Notes This command is not available in assembler mode because it is tied to the source window Debugging C Programs 2 58 C79000 G7076 C520 01 Organon XDB Command Set 2 43 LOAD Syntax LOAD ARGUMENTS lt string gt LOAD BINARY DEBUG lt debug id gt GLOBAL SEGMENT lt Loader Result Segment gt lt RMOS Task ID gt TASK lt tname gt OF lt file gt Description Load parts of an executable file lt file gt The options specify which part of lt file gt is to be loaded ARGUMENTS lt string gt The loaded program gets lt string gt as parameter list Blanks are used to split lt string gt into several parameters During a set task attach command this string is passed to the target process BINARY Binary download of an executable file DEBUG lt debug id gt Debug information of lt file gt is loaded If the optional argument lt debug id gt is omitted a new debug id is created else the symbols are added to the symbols of lt debug id gt GLOBAL The segment is assigned to global level thus the information is not bound to any task This means global sharing of segment information SEGMENT lt Loader Result Segment gt lt RMOS Task ID gt This option allows you to load the d
144. n List field and select the size BYTE the bytes 1000 through 1003 are modified The same operation with the size WORD would affect the bytes 1000 through 1007 e Start Address Set Memory Window Home Address x Address 0x008B 0x0036B103 Cancel Browse You can change the start address of the memory window by selecting this item Enter the new start address in the dialog box popping up This dialog box also offers the ability to invoke the symbol browser which helps you getting the addresses of program symbols Debugging C Programs C79000 G7076 C520 01 1 71 Organon XDB User Interface e Reload This menu item updates the window contents This is especially useful if the memory window is not updated automatically e Home Choosing this item makes the window go back to the start address e Follow If the format is one of the pointer types Near 16 Far 16 etc this menu item makes the memory window follow the pointer marked by the memory window cursor i e the contents of the marked piece of memory are interpreted as memory address which becomes the new start address This menu item is disabled if the format is not a pointer type e Back If the start address is changed by Start Address or Follow the old start address is saved By selecting the menu item Back you reset the start address to its previous value Note that not only the last change but all changes done by Start Address or Follow can be undone in other
145. n the bar below the tool bar load_task set_task go_main e Source path Organon XDB assumes the source files of the task to be debugged to be in the working directory If this is not the case or if the sources are placed in different directories you can tell Organon XDB where to look for them Li h Roe q Click Add new to enter another source path New Directory Arguments Debugging C Programs C79000 G7076 C520 01 1 41 Organon XDB User Interface You can enter the complete path i e the whole way from the root directory down otherwise the path is assumed to be relative to the working directory you specified when you started Organon XDB e Window updates This menu item allows you to determine when to check the content of Evaluation or Memory Window and when to update it This item is applicable only in asynchronous mode Repeat Time specifies the period after which XDB checks the window contents Update Rate specifies the number of check operations after which a recognized change will be updated Repeat Time MME ms Update Rate 300 Cancel Updated Windows Assembler M Registers Calls M Source M Evaluate I System Registers Modules l Task T Execution Trace e Select font As the name implies this menu item allows you to change the font and the size of the displayed text This change is effective in this session only unless you make it permanent by activating the menu it
146. nd lt p2 gt are the location in the source code resp assembler code lt cond gt is the condition if a condition was specified lt status gt may be enabled disabled or current The latter indicates that the execution is halted due to this breakpoint lt skip gt is the skip number lt current_skip gt indicates how many times this breakpoint will be skipped until it stops the execution l e whenever this breakpoint is encountered lt current _ skip gt is decremented by one until it reaches zero Now the execution is halted and lt current _skip gt is set to lt skip gt again A indicates that a non empty list of actions is attached to the breakpoint C is displayed if the option Continue is set Debugging C Programs 1 28 C79000 G7076 C520 01 Organon XDB User Interface lt hara gt If the breakpoint is a hardware breakpoint this is its internal number lt scope gt is S for space usually lt scope gt can be T for task or G for global too lt name gt If a symbolic name was given to the breakpoint it is displayed here lt actions gt If a list of actions is attached to the breakpoint it is displayed here Note that the condition of a breakpoint if existent is always written in the current language see chapter 1 2 1 5 no matter in which language it was entered in the creation of the breakpoint Disable disables the breakpoint i e while the breakpoint still remains existent the execution does
147. nd Set The function key with the symbolic code lt key gt is defined to send the text lt texb Unlike the other DEFINE commands redefining an existing key causes no error or warning message OVERWRITE Although redefining a key without the qualifier OVERWRITE causes no warning message it is good practice to use this qualifier for redefining Currently possible key codes are Key Code Name FI function key F9 function key F11 function key F20 function key F21 function key F24 function key Function Key F10 is reserved for Windows A defined key does not send the newline character automatically thus a command can be combined by pressing a couple of function keys If a string is to be sent to the debugger immediately add the newline escape n backslash n to the end of the string Debugging C Programs C79000 G7076 C520 01 2 13 Organon XDB Command Set XDB does not check whether the key is really available on your current terminal Examples EFINE KEY Fl set break at EFINE EY OVERWRITE F2 step n EFINE EY F3 ALL A A References SHOW KEY DELETE KEY Debugging C Programs 2 14 C79000 G7076 C520 01 Organon XDB Command Set 2 8 DEFINE MACRO Syntax DEFINE MACRO OVERWRITE BUTTON lt name gt lt text gt Description lt name gt The macro lt name gt is defined lt name gt is a name consisting o
148. nd window e Create evalwindow The marked text is evaluated and an evaluation window which displays the result appears e Create evalwindow from pointer Same as Evaluate from pointer but the result is displayed in an evaluation window Debugging C Programs C79000 G7076 C520 01 1 61 Organon XDB User Interface 1 3 3 Assembler Window Ei Assembler 0083 0035F084 OL x 0083 0035F072 68 6C AO 36 PUSH 0036a06c aj 00 0083 0035F077 E8 E 90 00 CALL NEAR PTR CS PRINTF a 00 0083 0035F07C 59 POP ECX 0083 0035F07D C6 05 CC BO Moy BYTE PTR DS ___isGUI 000010b 01 0083 0035F084 DERE 30 BYTE PTR DS isGUI 000010b8 0 0083 0035F08B C6 05 CE BO MOV BYTE PTR DS ___isGUI 000010b9 01 36 00 01 0083 0035F092 C6 05 CF BO Mov BYTE PTR DS __isGUI 000010ba 01 36 00 01 0083 0035F099 C 05 00 BL HOV DWORD PTR DS isGUI 000010eb 0036b0cc 36 00 CC B0 36 00 0083 0035F0A3 33 CO XOR EAX EAX 0083 0035F0A5 89 45 FC HOV DWORD PTR SS 4 EBP EAX 0083 0035F0A8 C7 45 F8 18 HOV DWORD PTR SS 8 EBP 0036a018 AO 36 00 0083 0035F0AF 8B 55 F8 MOV EDX DWORD PTR SS 8 EBP 0083 0035F0B2 FF 32 PUSH DWORD PTR DS EDX 0083 0035F0B4 FF 75 FC PUSH DWORD PTR SS 4 EBP X This window shows the assembler code of the loaded task Similar to the source window the current assembler instruction i e the next to be executed is displayed inverted If you click the left
149. ng C Programs 1 24 C79000 G7076 C520 01 Organon XDB User Interface 1 2 1 4 Debug Evaluate Ctrl E Set Breakpoint Ctrl B Edit Breakpoints Alt B SetWatchpoint Ctrl V Edit Watchpoints Alt W Set Tracepoint Ctrl T Edit Tracepoints Alt T Calls Alt C The menu items described in this chapter allow you to evaluate expressions and watch the variables of the target program display the stack of procedure calls and to manipulate breakpoints watchpoints and tracepoints features which are explained also in this chapter You can issue these commands by clicking them or by hitting the underlined letter while pushing down the lt Alt gt key Some commands are linked to hot keys so that they can be issued without opening the menu You see these hot keys on the right side of the menu For example you can set a breakpoint without opening the Debug menu just by hitting lt ctrl B gt e Evaluate The user is asked to enter an expression to be evaluated The result is shown either in the command window or in an evaluation window see chapters 1 3 1 and 1 3 7 In the former case the evaluation takes place only once while in the latter case every subsequent change of the result is visible The symbols known at this time and scope can be obtained with the Browse button You find a detailed description of the symbol browser in chapter 1 2 2 Organon XDB allows you to write expressions in more than one
150. ng symbol causes an error message If this option is set only a warning message is issued and the old symbol is destroyed Examples EFINE SYMBOL TYPE int VALUE 1 n EFINE SYMBOL OVERWRITE ADDRESS 2000 main Debugging C Programs C79000 G7076 C520 01 2 17 Organon XDB Command Set 2 10 DELETE Commands Syntax DELETE lt item gt The item to be deleted lt item gt may be one of the following BREAKPOINT KEY BUTTON MACRO DEBUG MODULE DIRECTORY TRACEPOINT EVALUATE WATCHPOINT 2 18 Debugging C Programs C79000 G7076 C520 01 Organon XDB Command Set 2 11 DELETE BREAKPOINT Syntax DEL E BREAKPOINT AT lt expression gt DELETE BREAKPOINT ID lt halt id gt DELETE BREAKPOINT ALL Description A breakpoint is deleted It can be selected by the ID number or the location where it is set AT lt expression gt The expression which yields the address of the breakpoint to be deleted ID lt halt id gt This is a decimal number or a debugger variable lt halt id gt is the number of the breakpoint to be deleted The ID number and expression of the deleted breakpoint are displayed in the command window ALL This option deletes all specified breakpoints Examples DEI E BREAKPOINT AT main LINE 256 DEI E BREAKPOINT ID 5 DEI E BREAKPOINT ALL DEI E BR
151. not located in the working directory you may write the complete directory path or the path relative to the working directory Target Connection Here you tell Organon XDB how to connect to the target machine Organon XDB expects this information in the following form mpi lt H gt lt T gt lt H gt is the host address of the communication partner in the MPI segment lt T gt is the TSAP ID for communication with the terminal server Typical values for all boards connected to MPI or partyline CPU 4xx CPU 3xx FM 3xx are mpi 2 12 For other communication boards for example FM 400 the TSAP ID has to be modified as follows Byte 1 Byte 0 0000 1100 Rack Nr Slot Nr A FM 400 in rack 1 at slot 4 240CH has to be addressed with mpi 2 9228 Debugging C Programs C79000 G7076 C520 01 Organon XDB User Interface If you click the button More Options the window changes to this Organon XDB Startup Ea Working Directory Start XDB Source Directories el Initial batch file Target Connection mpi 2 1 2 Mode e sei Add Underscore None C Back Non Interactive Front C Predot CPU 80386 C 80486 Pentium C 80386EX I Use only hardware breakpoints M Convert symbols to upper case Additional Args 10 timeout after 3 seconds About Now you can set or change the following options e Mode You can choose between Interactive which is the default value
152. not accessed following abbreviations are used Symbol Description D expand down U expand up W writeable segment R read only segment A segment accessed X segment not accessed Examples SHOW DESCRIPTOR GDT 5 SHOW DESCRIPTOR REPEAT 6 GDT 5 SHOW DESCRIPTOR IDT idtsel SHOW DESCRIPTOR MEMORY 0x1000 SHOW DESCRIPTOR SEL cs SHOW DESCRIPTOR LDT 10 ldtsel References SET DESCRIPTOR SHOW REGISTER Debugging C Programs C79000 G7076 C520 01 2 123 Organon XDB Command Set 2 81 SHOW DIRECTORY Syntax SHOW DIRECTORY Description The current list of alternative search directories for source files is shown Example SHOW DIRI ECTORY References DELETE DIRECTORY SET DIRECTORY 2 124 Debugging C Programs C79000 G7076 C520 01 Organon XDB Command Set 2 82 SHOW ESCAPE Syntax SHOW ESCAPE Description The escape sequence to switch off the transparent mode is displayed Example SHOW ESCAPE References REMOTE SET ESCAPE Debugging C Programs C79000 G7076 C520 01 2 125 Organon XDB Command Set 2 83 SHOW EVALUATE Syntax SHOW EVALUATE Description All currently monitored expressions are displayed in the command window Example SHOW EVALUATE References DELETE EVALUATE DISABLE EVALUATE ENABLE EVALUATE SET EVALUATE Debugging C Programs 2 126 C79000 G7076 C520 01 Organon XDB Command Set 2 84 SHOW INFO Syntax SHOW
153. not found at the current scope level This history id is not in the history pool No command in the history string matches this string Debugging C Programs C79000 G7076 C520 01 CODE L B HXNM L B ILLOP L B ILLP L B ILTG L B LDHX L B LDIS L B LDMB L B LDNS L B LDNT L B LDSA L B LDSF Debugging C Programs C79000 G7076 C520 01 CLASS TEXT E can t build hex file name E invalid operator for evaluation E illegal pointer sub add E illegal tag reference E can t open hex file E invalid segment number E missing debug image file E invalid segment number E for task DEBUG and SEGMENT option needed E invalid segment loadaddress E invalid segment flag Organon XDB Error Messages DESCRIPTION The shown file name cannot be converted to a hex file name This operator is not a valid identifier for the command EVALUATE These pointers cannot be added or subtracted because they point to different types The tag name of the forward reference is illegal The file with the shown name cannot be opened A segment number consists of decimal numbers 0 9 only The command LOAD needs a debug image file to load segments A segment number must be in the range 0 max The option TASK is not allowed without the options DEBUG and SEGMENT The address must be a decimal or hexadecimal which is prefixed with a number The segment flag can be built up by the letters A P
154. ns with side effects like i don t make much sense in this context and are not supported Apart from that Organon XDB follows the ANSI standard e Pascal Organon XDB follows the standard as described by K Jensen and N Wirth e Assembler When setting the language to Assembler the assembler window is displayed automatically The checkmark in the menu window marks the language Organon XDB expects Note that Organon XDB works in either source code mode or assembler mode The mode influences e g the execution of the command STEP see chapter or Command Reference The only way to switch to assembler mode is to set the language to Assembler To switch back to source code mode change the language to any of the high level languages Debugging C Programs C79000 G7076 C520 01 1 35 Organon XDB User Interface 1 2 1 6 Options Options Keys Macros Buttons Source path Window updates Selectfont Edit colors Ctrl K Ctrl M Ctrl U Ctrl P This set of commands allows you to customize and adapt Organon XDB according to your taste and needs You can change the size and color of texts displayed create new buttons or redefine the function keys of your keyboard The advanced user will find a quick and convenient way to manipulate the command language macros and to change some details in the behaviour of Organon XDB You can issue these commands by clicking them or by hitting the underlined lette
155. ocates the taskfile on the host and downloads it to the target You can connect to a task already loaded by clicking the Segment button and entering the Loader Result Segment which was displayed when loading or is available through tcb low level debugger command and the RMOS Task ID see also LOAD in the Command Reference e Batch asks for the batch file to be executed and the arguments to provide it with A batch file is a file containing Organon XDB commands see Reference It is a convenient way to store a list of commands you usually issue for example you always set a breakpoint at the call of a certain subroutine then let the execution run As the Organon XDB command language can deal with parameters the batch file can be given arguments these parameters are set to The Debugging C Programs C79000 G7076 C520 01 1 11 Organon XDB User Interface commands in the file are executed as if they were typed into the command window however the EXIT command makes Organon XDB leave the batch file rather than quit the session altogether Execute Batchfile File Arguments Cancel Options C Force single stepping Browse Stop on errors Enter the file name into the File field and the batch file arguments if the batch file expects them into the Arguments field When the Ok button is clicked the execution starts If the option Force single stepping is activated the execution stops bef
156. odule multiple lines for this address used line too many memory pushes module not loaded modulo by zero Bad move coordinate no pointer left and right for no active debug tables Organon XDB Error Messages DESCRIPTION The mentioned file cannot be opened Check its name and your access privileges The structure union does not contain this member No more breakpoints available This module is the current location of the program There are more than one lines associated with the evaluated address An internal buffer overflows Your entered expression is too complex The debug information of the requested module is not loaded into the debugger The current evaluated expression contains a modulo operation by zero The given X Y position is a bad position for a window This operator does not allow operands of type pointer on both sides The program halts at an address where no debug information is available 3 9 Organon XDB Error Messages CODE L B NADE L B NADR L B NARR L B NBEA L B NBLK L B NCON L B NCTK L B NDIX L B NEGT L B NFLT L B NFNC L B NIDX 3 10 DESCRIPTION The expression cannot be used as an address The expression cannot be referenced with a pointer This operator does not allow operands of type array The logical end address of the current local block cannot be converted to a physical address The program is not inside a
157. ogram is done up to a break or watchpoint or up to the end of the function The option UNTIL PROCEND is not allowed in the assembler mode If no debug information is available an error message is issued Debugging C Programs C79000 G7076 C520 01 Organon XDB Command Set RUN UNTIL PROCEND cannot work if the function uses non local jumps in the corresponding code part like the function longjmp in the programming language C RUN UNTIL CALLS This stops execution after returning from the current procedure This is also true for own assembler subroutines which effect the execution of the program in a similar way Examples RUN UNTIL PRINT LINE 10 RUN UNTIL callback RUN UNTIL PROCEND References NEXT STEP Debugging C Programs C79000 G7076 C520 01 2 69 Organon XDB Command Set 2 50 SCAN Syntax SCAN HEADER lt header gt lt string gt lt address gt lt address gt Description This command is used to read values from the command window and to store the read values into the memory of the target program lt string gt is a control string following the rules of the C function scanf The addresses following the format string are C style memory addresses viz amp lt name gt HEADER lt header gt You are prompted for input with the string lt header gt in the command window If no header is given the string SCAN gt is used Examples SCAN Sc amp ch SCAN H
158. ompanies and Representatives in the STEP 7 User Manual If you have any questions or remarks on the manual please fill out the re marks format the end of the manual and return it to the address provided We also invite you to enter your personal opinion of the manual in this remarks form We hold training courses to help introduce you to SIMATIC S7 program mable controllers For more information please contact your regional train ing center or the central training center in D 90327 Nuremberg Germany Tel 49 911 895 3154 Debugging C Programs C79000 G7076 C520 01 Preface Up To Date Information Debugging C79000 G C 70 Programs 76 C520 01 You can find up to date information on SIMATIC products from the follow ing sources e On the Internet under http www aut siemens de e Via Fax Polling number 49 8765 9300 5500 In addition the SIMATIC Customer Support provides up to date information and download facilities for users of SIMATIC products e On the Internet under http www aut siemens de simatic cs e Via SIMATIC Customer Support Mailbox under the following number 49 911 895 7100 For dialing into the mailbox use a modem of up to V 34 28 8 Kbps and set the following parameters 8 N 1 ANSI or alternatively use ISDN x 75 64 Kbps The telephone and fax numbers of the SIMATIC Customer Support service are Tel 49 911 895 7000 Fax 49 911 895 7002 You may also ask
159. ore every command and you are asked whether to continue execute batch Exit Cont Ski The next line of the batch file is displayed batch arguments and macros are already expanded in the command window Click Yes or hit lt Alt Y gt to execute it or click Exit resp hit lt Alt E gt to quit the execution of the batch file Cont or lt Alt C gt ends the single step mode i e the rest of the batch file is executed without further questions If you want Organon XDB not to execute the command on display but to continue the single step execution with the next command of the batch file click Skip or hit lt Alt S gt If the command Organon XDB reads from the file is syntactically wrong you are not asked whether to execute it Instead Organon XDB tries to find the next correct command in the file and continues the single step execution here Depending on the sort of error in the batch file Organon XDB might skip one or more correct commands until it finds a point to recover Debugging C Programs 1 12 C79000 G7076 C520 01 Organon XDB User Interface If an error occurs during the execution of the batch file the rest of the batch file is still executed unless the option Stop on errors was activated In this case Organon XDB skips the rest of the batch file Anyway if an error is detected in the batch file Organon XDB issues an error message in the command window telling you the batch file line where this error wa
160. orrupt MACRO body definition Debugging C Programs C79000 G7076 C520 01 CODE U L ICHAR U L IDTOL U L NONASC U L NTOL U L STRNT U L STRTL U L UPBOF U M MAAI U M MADF U M MANA Debugging C Programs C79000 G7076 C520 01 CLASS TEXT E invalid number prefix identifier too long non ASCII char number too long unterminated string constant string constant too long input overflow Wrong parameter number Macro already defined Too many arguments passed Organon XDB Error Messages DESCRIPTION The prefix of a numeric constant is not the regular prefix for OCTAL 0 or HEXADECIMAL 0x numbers An identifier name longer than 79 characters was entered A value larger than 7 bits was read from the input Only values between 0 and 127 are allowed ASCll character set Possibly an unmonitored function control key or a mouse button was pressed A numberic string longer than 79 characters was entered The delimiter character is missing Supply one A string constant longer than 79 characters was entered An overflow of the internal input buffer occurs during scanning the actual input line The shown number is not in the range of the called argument parameter list The issued macro name is used already The issued macro is called with an improper count of arguments 3 27 Organon XDB Error Messages CODE CLASS TEXT DESCRIPTION U M MANF E Mac
161. p of stack E not on active stack E move scope not implemented Organon XDB Error Messages DESCRIPTION The source window cannot be moved to that line The debugger goes to the last line The source window already displays the first lines of this module The source window cannot be moved up so many lines The debugger goes to line 1 The shown pattern was not found in the current source file An illegal return address is fetched during a walk through the dynamic procedure link on the stack This option is no valid argument for the command SET OPTION The symbolic scope is already on top of stack The symbolic scope is not at any of the currently active procedures Use the command SET SCOPE CURRENT to get back on the active frame and then you can use UP and IDOWN This command is currently not usable 3 17 Organon XDB Error Messages CODE CLASS TEXT DESCRIPTION L B STSM E procedure not in The given procedure is not in the current module current module L B STSR E relative scope The relative changes of scope changes not allowed with UP and DOWN are not in assembler allowed in language assembler L B STST W on bottom of stack The symbolic scope has reached the lower end of the stack frame L B STSZ E illegal size The qualifier of the size option is illegal L B STTR W Unable to track call The current frame cannot be frames stop unwind unwinded The loop is stopped thus not all procedures
162. pacing tabs and newlines is done Typing lt ctrl L gt the remote window is closed and you get back to the command mode lt ctrl L gt is the default escape sequence The escape sequence can be changed using the command SET ESCAPE For further information about the low level debugger see in System Software for M7 300 and 400 Installation and Operation User Manual Example REMOTE References DISPLAY REMOTE ERASE REMOTE SET ESCAPE SET INTERFACE SHOW ESCAPE Debugging C Programs C79000 G7076 C520 01 2 67 Organon XDB Command Set 2 49 RUN Syntax RUN RUN RUN RUN RUN UNTIL lt expression gt UNTIL BLOCKEND UNTIL PROCEND UNTIL CALLS Description RUN The execution of the program is done up to a break or watchpoint or up to the end of the program RUN UNTIL lt expression gt The execution of the program is done up to a break or watchpoint or until the program reaches the location denoted by lt expression gt RUN UNTIL BLOCKEND The execution of the program is done up to a break or watchpoint or up to the end of the actual block The option UNTIL BLOCKEND is not allowed in the assembler mode If no debug information is available an error message is issued RUN UNTIL BLOCKEND cannot work if the function uses non local jumps in the corresponding code part like the function longjmp in the programming language C RUN UNTIL PROCEND 2 68 The execution of the pr
163. part of the window i e an address with the right mouse button the line pointer is set to this line and the following menu appears Go here Set Start Address Home Set Breakpoint Ron Ont caler Pan Unt retur Set PC You can click one of these items or hit lt Alt gt the underlined letter and Organon XDB will react as follows e Go here Execute the program until the line pointer is reached The line you clicked is not executed e Set Start Address Start Address for the assembler window Debugging C Programs 1 62 C79000 G7076 C520 01 Organon XDB User Interface e Home Choosing this item makes the assembler window go back to the start address e Set Breakpoint Set a breakpoint at the specified line This menu item is not visible if a breakpoint exists already at this position An alternative way to set a breakpoint is to doubleclick the address e Delete Breakpoint Delete the breakpoint in this line This menu item is visible only if a breakpoint exists at this position An alternative way to delete a breakpoint is to doubleclick the address e Run until caller This item is useful only if the menu is called from the source window Thus it is disabled e Run until return This item is useful only if the menu is called from the source window Thus it is disabled e Set PC The program counter is set to the line marked by the line pointer i e the execution will continue by processing this line This
164. perform the following steps ENorganon XDB BEE File Display Bun Debug Language Options Windows Help at Milza eS A Hit lt Alt L gt or click the word Language with the left mouse button to get the language menu 8 Organon XDB Now choose one language by clicking it Debugging C Programs C79000 G7076 C520 01 1 9 Organon XDB User Interface 1 2 1 1 File Load Ctrl L Batch Set Module Alt M Search Alt S Open Protocol Open Logfile Save Settings Exit The menu File offers the commands you see above Most of them deal with the handling of files on the host system or the target system Using this menu you can load tasks run Organon XDB command files and load additional modules of the target program All your activities and the informations Organon XDB shows can be written to protocol files for further examination A quick method to search for certain strings and patterns in the source code of the target program is offered too If you have changed the appearance of the Organon XDB windows according to your personal taste you can save these changes for subsequent sessions And if your work is done you can end the Organon XDB session using the last item of the menu You can issue these commands by clicking them or by hitting the underlined letter while pushing down the lt Alt gt key Some commands are linked to hot keys so that they can be issued without opening the menu You see t
165. ptional arguments to it Reserved words must be enclosed in double quotes Arguments with non alphanumeric characters except and must be enclosed in double quotes too If the argument lt command gt or lt arguments gt consists of a macro name or a debugger variable not being protected by double quotes the macro is expanded or the value of the debugger variable is used For executing DOS or Windows programs the extension com or exe has to be specified Built In commands of the COMMAND COM dir copy require a special syntax For the DIR command it is SPAWN COMMAND COM K DIR For further details on DOS command processor enter help command ona DOS prompt Example SPAWN notepad exe d tmp notes txt Debugging C Programs C79000 G7076 C520 01 2 149 Organon XDB Command Set 2 106 STEP Syntax STEP lt count gt STEP RETURN STEP INTO Description The next code line of the loaded program is executed If you are debugging in assembler level the next opcode is executed If a subroutine is called the execution of the program stops at the first command of the subroutine lt count gt With the optional lt count gt argument more than 1 line instruction can be stepped The default value for lt count gt is 1 RETURN Using RETURN the actual value on the stack top is interpreted as return address At this address a temporary breakpoint is set There is no check done whether
166. questions directly using E mail on the Internet or via the above mentioned mailbox Debugging C Programs C79000 G7076 C520 01 Contents 1 Organon XDB User Interface 1 1 Starting Organon XDB 1 1 1 Start up Dialog 1 1 2 Starting problems 1 2 Description of the Main Window 1 2 1 Menu Panel 1 2 1 1 File 1 2 1 2 Display 1 2 1 3 Run 1 2 1 4 Debug 1 2 1 5 Language 1 2 1 6 Options 1 2 1 7 Windows 1 2 1 8 Help 1 2 2 Browsers 1 2 2 1 The Windows File Browser 1 2 2 2 The XDB Symbol Browser 1 2 3 Buttons 1 2 3 1 Load 1 2 3 2 Search 1 2 3 3 Step 1 2 3 4 Next 1 2 3 5 Run 1 2 3 6 Recapture 1 2 3 7 Set Scope up 1 2 3 8 Set Scope down 1 2 3 9 Set Scope here 1 2 3 10 Display Hide Source Window 1 2 3 11 Display Hide Assembler Window 1 2 3 12 Display Hide Register Window 1 2 3 13 Display Hide Task Window 2 3 14 Display Hide Remote System Window 3 15 Evaluate 3 16 Create Memory Window 3 17 Display Callstack 3 18 Break Description of the Subwindows Command Window 1 Command Window Editor Source Window Assembler Window Register Window pr VE b b b b to to to bo to do RON Debugging C Programs C79000 G7076 C520 01 1 57 1 57 1 58 1 59 1 62 1 64 vii Contents vili 1 3 5 Task Window 1 3 6 Remote System Window 1 3 7 Evaluation Windows 1 3 8 Memory Windows 1 3 8 1 Memory Window Context Menu 1 3 9 Trace Windows 1 3 10 Copy and Paste 1 4 Descriptor and Register Tables 1 4 1 Desc
167. r while pushing down the lt Alt gt key Some commands are linked to hot keys so that they can be issued without opening the menu You see these hot keys on the right side of the menu For example you can create a button without opening the Options menu just by hitting lt ctrl U gt e Options You can switch on off the following options Use mixed assembly window Format for pointers Automatic debug loading Show tracepoint time Attach segments Assign tasks 1 36 IO Local O Local off Ascii off off Global Global Debugging C Programs C79000 G7076 C520 01 Organon XDB User Interface Use mixed assembly window The mixed assembly window does not only show the assembler code but also the next source code line to be executed This option is switched off by default Format for pointers When displaying a character pointer in an evaluation window the value it points to can either be displayed as a hexadecimal number or as a character which is the default Automatic debug loading When the execution steps into another module this module is loaded automatically if this option is switched on which is the default value Otherwise you are asked whether to load it If you refuse to load it the step command will execute until the next line of the currently loaded module Show tracepoint time If this option is switched on the actual time is shown whenever the memory watc
168. rdware interface supports real time watchpoints including all the specified conditions the program runs on full execution speed If not XDB must simulate them by maintaining a list of watched memory pieces and looking whether they are accessed If you want to use processor maintained watchpoints only choose the Hard option Set Watchpoint Location Actions Cancel Access O Fetch Owrite O Read All Continue gog Hard E th eng Browse Skip Symbol The execution of the target program stops when the watched piece of memory is accessed in the specified way If the Skip number is n n gt 0 the execution stops at every n 1 st access For example a watchpoint with the Skip number 2 and the access mode write would stop the execution at the third sixth ninth attempt to write into the watched memory If a list of Organon XDB commands was entered into the Actions field these commands are processed upon the encounter of the watchpoint If the checkbutton Continue was activated the execution continues after the processing of the Actions list see also SET WATCHPOINT command in the Command Reference Debugging C Programs 1 30 C79000 G7076 C520 01 Organon XDB User Interface e Edit Watchpoints This item shows the list of existing watchpoints To change them choose one and click the Modify button Disable disables the watchpoint i e while the watchpoint still remains
169. ression and therefore cannot be scrolled 1 3 8 1 Memory Window Context Menu If you click the memory part of the window i e not the title bar scroll bar or first line with the right mouse button the following menu pops up Modify Start Address Reload Home Follow Back Assembler Watchpoint Size gt Format gt Based Mode Auto Update The menu can also be summoned by typing lt ctrl Return gt into the window You can choose an item from the menu by either clicking it or by typing the underlined letter e Modify Select this item if you want to change the memory contents The following dialog box pops up Debugging C Programs 1 70 C79000 G7076 C520 01 Organon XDB User Interface Modify Memory x Start Address 0x008B 0x0036B103 Write Size BYTE z Cancel Expression List boo Browse You can enter the address where the modification starts the memory window cursor location is the default value for the address and choose the size of the information to be written Click the Browse button to invoke the symbol browser which helps you getting the addresses of program symbols Enter the value to be written into the Expression List field As the name implies you can enter a list of expressions here separated by commas The amount of memory being accessed is the size times the number of expressions For example if you enter 1000 into the Start Address field and the list 1 0 1 1 into the Expressio
170. riptor Tables 1 4 1 1 Modify 1 4 1 2 Reload Table 1 4 1 3 Set Range 1 4 2 Control Register 1 4 2 1 Modify 1 2 2 Update 1 4 3 Register Window 1 4 3 1 General Register 1 4 3 2 Segment Register Organon XDB Command Set 2 1 BATCH 2 2 BREAK 2 3 CLOSE 2 4 CONTINUE 2 5 DEFINE Commands 2 6 DEFINE Button 2 7 DEFINE KEY 2 8 DEFINE MACRO 2 9 DEFINE SYMBOL 2 10 DELETE Commands 2 11 DELETE BREAKPOINT 2 12 DELETE BUTTON 2 13 DELETE DEBUG 2 14 DELETE DIRECTORY 2 15 DELETE EVALUATE 2 16 DELETE KEY 2 17 DELETE MACRO 2 18 DELETE MODULE 2 19 DELETE TRACEPOINT 2 20 DELETE WATCHPOINT 2 21 DISABLE Commands 2 22 DISABLE BREAKPOINT 2 23 DISABLE EVALUATE 2 24 DISABLE TRACEPOINT 2 25 DISABLE WATCHPOINT 1 65 1 66 1 66 1 69 1 70 1 74 1 75 1 78 1 78 1 80 1 82 1 82 1 82 1 83 1 85 1 85 1 85 1 86 2 6 2 8 2 9 2 10 2 11 2 12 2 13 2 15 2 17 2 18 2 19 2 20 2 21 2 22 2 23 2 24 2 25 2 26 2 27 2 28 2 29 2 30 2 32 2 33 2 35 Debugging C Programs C79000 G7076 C520 01 Contents 2 26 2 27 2 28 2 29 2 30 2 31 2 32 2 33 2 34 2 35 2 36 2 37 2 38 2 39 2 40 2 41 2 42 2 43 2 44 2 45 2 46 2 47 2 48 2 49 2 50 2 51 2 52 2 53 2 54 2 55 2 56 2 57 2 58 2 59 2 60 2 61 2 62 2 63 2 64 2 65 2 66 2 67 DISPLAY DISPLAY Descriptor Table DISPLAY SYSREG ENABLE Commands ENABLE BREAKPOINT ENABLE EVALUATE ENABLE TRACEPOINT ENABLE WATCHPOINT ERASE ERASE SYSREG EVALUATE
171. ro not defined The issued macro is not defined There is no deletion possible U M MARD W Macro redefined This macro is redefined The old definition is lost U M NIMA E Not an immediate The shown expression does not addressing mode form an immediate addressing mode U M SPC E illegal CPU space The shown name does not qualifier specify any legal addressing space of the processor U M SPTK E illegal SPAWN The given string is not allowed argument as argument to SPAWN enclose it in double quotes U M SPTL E too long argument list The maximal size of an argument list for SPAWN is exceeded U P AMBK E Ambiguous keyword The shown string is too short This string matches to more than one keyword Supply more characters U P CUGOTO E bad label name This is not a correct label specifier An alphanumeric name is needed U P EXIT E misplaced EXIT The EXIT call is allowed on WINDOW input level only U P FLAB E not in BATCH File Labels are allowed in BATCH input mode only U P IFNEX E missing expression The boolean expression is missing Debugging C Programs 3 28 C79000 G7076 C520 01 CODE U P IFRET U P IFTHE U P IFTHP U P ILLEX U P ILLRW U P ILLTK U P INLAB U P MLAB U P NHIST U P NOFILE U P NREG U P NSTR Debugging C Programs C79000 G7076 C520 01 CLASS TEXT E dangling END if E THEN expected E END expected E illegal expression E illegal keyword E illegal keyword E label already define
172. s a type but not an address You can summon this pop up window by doubleclicking the left i e component name part of the evaluation window Show Type Symbol CRM MAIN D0 CBITS Address 0x168 0x54 Reference to lt none gt Declaration CRMSMAINNDO CBITS long bits 32 e Follow If the expression denotes a pointer the Follow button makes the evaluation window follow it and show the structure the pointer references to Follow is disabled if the expression is not a pointer Debugging C Programs 1 68 C79000 G7076 C520 01 Organon XDB User Interface e Expand If the expression denotes a structure the Expand button replaces the current evaluation window content with the detailed listing of the structure e Back If the evaluation window followed a pointer or expanded a structure see below menu item Value this item makes it go back again 1 3 8 Memory Windows PJ Mem 0 CRM MAIN ARGS o x 0x0088 0xFFC87FDO d test crm bd CRM MAIN ARGS FFC87FDO 10 37 00 00 00 00 00 7 aj FFC87FD8 00 00 00 00 00 00 00 00 FFC87FEO 00 00 37 00 00 00 00 00 7 FFC87FES FS 7F C8 FF 8B 00 00 00 FFC87FFO 00 00 00 00 00 52 4D 3A RM fia P Mem 1 CRM MAIN DO ioj x 0x0088 0x003710CC diMestherm bd CRMAMAINADO 003710CC 01 01 01 00 00 00 00 003710D4 00 00 00 00 73 32 34 31 s8241 003710DC 20 20 20 00 00 00 00 00 003710E4 00 00 00 00 00 00 00 00 003710EC 00 00 00 00 00 00 00 00 003
173. s found and the sort of error detected You can choose among the existing batch files by clicking the Browse button You find a detailed description of the file browser in chapter e Set Module shows a list of the modules of the task to be debugged Modules Modules Debug I CRH CRH CRUN_IF_EXIT CRUN_IF_PRINTF CRUN_IF_STRCSPN CRUN_IF_STRNCAT CRUN_IF_STRNCMP CRUN_IF_STRNCPY CRUN_IF_STRRCHR 1 1 1 CRUN_IF_STRSPN 1 1 i 1 1 1 1 1 020000 0 0x0000 0x0 0x0000 0x 0x0000 0x 0x0000 0x 0 0 0 0 0 0x0000 0x00 0x0000 0x0000 0x0000 0x00000 0 0 0 0 0 0 oo0000 CSTART OPTIONS 0x0000 0x0 0x0288 0x0 0x0288 0x0 0x0288 0x0 0x0288 0x0 0x0288 0x0 PE 0x0288 0x00001044 loaded no source no debug 5243 5244 1 1 1 1 1 25 5241 The display shows the names of the available modules and their memory addresses By a double click the module is loaded The source window see chapter 1 3 2 shows the source code of this module and the scope is set appropriately If you click the window with the right mouse button the following menu appears Set Module Delete Module Debugging C Programs C79000 G7076 C520 01 1 13 Organon XDB User Interface e Search This menu item searches for a specified pattern in the source code of the module displayed in
174. s option Organon XDB does not distinguish between symbols written in lowercase and in uppercase This setting is on by default and must not be changed e Additional Args This line allows you to enter all options and arguments which are not displayed in this window e 10 timeout after seconds If the connection cannot be built up within this amount of time Organon XDB asks whether to try again or to end the session TRY AGAIN x Click Yes if you want to continue or No to quit If the connection is established but the target machine does not respond to a request within the amount of time given in this field Organon XDB assumes the connection to be lost and quits the session issuing an error message in the command window e About Displays the version of Organon XDB without the need to start Organon XDB and establish a target connection When you dismiss the start up window by clicking Start XDB the debugger will read and execute your initial batch file if such a file was specified Now the file Debugging C Programs 1 6 C79000 G7076 C520 01 Organon XDB User Interface startup xdb is read and executed This file is located in the installation directory and it is assumed to be written in the Organon XDB command language see Command Reference like the initial batch file After this file is processed Organon XDB waits for your commands if the mode was set to Interactive or exits if in Non Interactive mode 1 1 2 St
175. sing U P WHRET E bad WHILE construct A WHILE construct terminates incorrectly U P WHTHE E THEN missing The THEN keyword must precede any action list ina WHILE loop U X STOL E string constant too The shown quoted string is too long long for the internal buffer of the debugger U X XAML E missing after The ADDR modifier needs keyword ADDR parantheses and U X XIMC E illegal mode A mode conversion is not conversion possible here Debugging C Programs 3 30 C79000 G7076 C520 01 CODE U X XIMO U X XNDL U X XNLP W I EOF W I EXMX W I IEMR W I IGDS W I INLF W I ISDS W I MOMD W I NOMAC Debugging C Programs C79000 G7076 C520 01 CLASS TEXT E illegal mode name E missing after number constant E no allowed E unexpected EOF in E reached maximum of monitored expressions 61 W end of module reached E get include file E line not found E yet no source line read W source module E unknown macro Organon XDB Error Messages DESCRIPTION The shown name is not a mode name for type conversions A numeric constant with prefix must be enclosed in single quotes The left parenthesis is not allowed here The source file does not contain as many lines as expected The limit of 61 expression for monitoring expression is reached The end of the module and all its includes are reached The include file for the given line is not found The given line number is not found
176. symbols known at this time and scope can be obtained with the Browse button You find a detailed description of the symbol browser in chapter 1 2 2 Organon XDB allows you to write expressions in more than one language Open the Language menu to see which languages are available The language Organon XDB expects is checkmarked To change to another language click the language name Debugging C Programs 1 54 C79000 G7076 C520 01 Organon XDB User Interface Evaluate Expression P Format Memory access default O decimal default O hexadecimal O octal O byte O binary O ascii O word Length I Level ia Ciena Enter the expression you want to be evaluated using the current language Choose the Format you like the result to be in If the expression denotes a pointer to a character string or a character array ascii might be useful If you choose ascii you may enter the number of characters to be displayed into the Length field Memory access Some processors allow byte wise or word wise memory access only If your target processor behaves this very restrictive way click the sort of access it accepts In most cases default works fine Level If the expression denotes a structure containing sub structures you can specify how many levels to step down into the structure Note that arrays may be evaluated partially e g if A is an array of appropriate length A 2 5 denotes the elements 2 3 4 and 5 If you
177. t selector value gt The expression lt selector value gt is used as index into the GDT or LDT according to the TI bit of the selector LENGTH lt length gt If this option is specified lt ength gt descriptors are copied The default value is 1 Examples SET DESCRIPTOR GDT 5 0x3000 SET DESCRIPTOR MEMORY 0x1000 GDT 5 address SET DESCRIPTOR SELECTOR cs 0x3000 Reference SHOW DESCRIPTOR Debugging C Programs C79000 G7076 C520 01 2 79 Organon XDB Command Set 2 56 SET DIRECTORY Syntax SET DIRECTORY lt directory gt SET DIRECTORY lt var gt Description The name lt directory gt or the contents of the debugger variable lt var gt is added to the list of search paths for source files These are used if a source file cannot be found under the path name stored within the debug information of the program Up to 30 alternative search directories are possible By setting the environment variable XDBMAXSRCDIRS to a value gt 30 this limit can be increased Example SET DIRECTORY c usr src local References DELETE DIRECTORY SHOW DIRECTORY SHOW DEBUG Notes Disk drive specifications in front of a directory name are accepted 2 80 Debugging C Programs C79000 G7076 C520 01 Organon XDB Command Set 2 57 SET ESCAPE Syntax SET ESCAPE lt esc_sequence gt SET ESCAPE lt var gt Description
178. t the test expression Example WHILE i gt 10 THEN EVAL i IF j lt 10 THEN CONTINUE END EVALUATE j END References BREAK WHILE Debugging C Programs 2 10 C79000 G7076 C520 01 Organon XDB Command Set 2 5 DEFINE Commands Syntax DEFINE lt item gt The item lt item gt to be defined can be one of the following BUTTON KEY MACRO SYMBOL Debugging C Programs C79000 G7076 C520 01 2 11 Organon XDB Command Set 2 6 DEFINE BUTTON Syntax DEFINE BUTTON OVERWRITE lt name gt lt text gt Description The DEFINE BUTTON command creates a new button in the toolbar of the command window Whenever this button is pressed the string lt text gt is sent to the command line processor OVERWRITE Redefining an existing button causes an error message But it is possible to redefine a button if the qualifier OVERWRITE is used In this case only a warning message appears Examples EFINE BUTTON step step n EFINE BUTTON break SET breakpoint at EFINE BUTTON Assem SET language assembler n EFINE BUTTON OVERWRITE oldbutton newcommand DG Oso References DELETE BUTTON SHOW BUTTON Debugging C Programs 2 12 C79000 G7076 C520 01 2 7 DEFINE KEY Syntax DEFINE KEY OVERWRITE Description lt key gt lt text gt Organon XDB Comma
179. the REMOTE feature Control characters are denoted as char or as n W or f For further information about the low level debugger see in System Software for M7 300 and 400 Installation and Operation User Manual Examples SET IN TERFACE dir task n SET IN TERFACE calc 1 7 n References REMO TE Debugging C Programs C79000 G7076 C520 01 2 85 Organon XDB Command Set 2 60 SET LANGUAGE Syntax SET LANGUAGE lt language gt Description The language mode is switched to the given language The language names must be fully qualified This switches the scanning of expressions and the style of output to that of the specified language lt language gt Legal values for lt anguage gt are ASSEMBLER ASM C PASCAL ASM is shorthand for ASSEMBLER Example SET LANGUAGE pascal Reference SHOW LANGUAGE Notes SET LANGUAGE C also enables the use of C constructs Debugging C Programs 2 86 C79000 G7076 C520 01 Organon XDB Command Set 2 61 SET LOGFILE Syntax SET LOGFILE APPEND OVERWRITE lt file gt Description All commands given after the command SET LOGFILE are stored in the logfile lt file gt lt file gt can be used as a batch file for further debug sessions Some restrictions apply when using logfiles as batch files if XDB works in the multitasking mode If the file lt file gt already exists th
180. the range of the list of descriptors on display Enter the number of the first table item to be displayed and the number of items to be displayed then click Ok or hit lt Return gt 1 4 2 Control Registers If you choose to display the control registers the following window appears Control Registers lolx EFLAGS 0x00243283 IpvAvr n 20 ItSz a p C GDTR Ox0000A000F9FF GDT base 0x0000A000 limit 0xF9FF LDTR 020020 GDT 4 rpl 0 CRO 0x00000018 pg cd nw am wp ne ET TS em MP PE CR2 0x00000000 Physical page fault address CR3 0x00008000 PDBR 0x00000008 ped pwt CR4 0x00000000 vne pvi tsd de pse nce Clicking a line with the right mouse button summons the following menu whose items are explained in the chapters below Modify Update Force Read If you hit lt Return gt while the control register table window is active Organon XDB directly goes into the modify mode skipping the pop up menu The register to be modified is the one being displayed in inverted colors in the register table window Debugging C Programs 1 82 C79000 G7076 C520 01 Organon XDB User Interface 1 4 2 1 Modify The following dialog box enables you to examine or modify the selected register Modify Register EFLAGS Original Value 0x00000207 Register Yalue 0x20207 Group Value Bits 17 17 Register Layout OVERFLOW INT ENABLE SIGN AUX CARRY i CARRY 31 1000000 0 qedaoldsjaeae EIA T PARITY wu le Sx ZERO ALIGN
181. the source window lf the end of the module is encountered a message is issued in the command window and the search starts at the top again The metacharacters matches any character and matches any string are recognized The source window displays the appropriate part of the source code coloring the line containing the matching string in the enhanced color see menu item Options Edit Colors chapte 1 2 1 6 Note that the search always starts at the beginning of the source code unless you search again for the same pattern in which case the search starts at the line after the one where the last matching string was found The search algorithm distinguishes between uppercase and lowercase unless Organon XDB was started with the option Convert symbols to upper case Examples Search Pattern tres Cancel Search for all strings starting with t followed by two unspecified characters and a s This search will find the strings this those it is for example Pattern a Cancel Search Search for an ampersand amp and a semicolon which are separated by an unknown number possibly 0 of unknown characters i e letters digits spaces etc The following strings and many more match this search pattern Debugging C Programs 1 14 C79000 G7076 C520 01 Organon XDB User Interface amp amp X amp pointer_7 e Open Protocol opens an output file to proto
182. the symbols variable names etc visible within this subroutine are accessible by the symbol browser see chapter 1 2 2 2 Clicking this button moves the scope one level upward i e to the calling routine The symbols known there are accessible now and the source window shows the text of this calling routine the line containing the subroutine call being the current line 1 2 3 8 Set Scope Down If the execution enters a subroutine the scope is set to this subroutine i e the source window shows the source code of this subroutine and only the symbols variable names etc visible within this subroutine are accessible by the symbol browser see chapter 1 2 2 2 The scope can be changed by the menu item Debug Calls Clicking this button moves the scope one level downward i e from the calling routine to the called one The symbols known there are accessible now and the source window shows the text of this routine Debugging C Programs 1 52 C79000 G7076 C520 01 Organon XDB User Interface 1 2 3 9 Set Scope Here If the execution enters a subroutine the scope is set to this subroutine i e the source window shows the source code of this subroutine and only the symbols variable names etc visible within this subroutine are accessible by the symbol browser see chapter 1 2 2 3 The scope can be changed by the menu item Debug Calls Clicking this button moves the scope back to the active subroutine i e the one being execut
183. them to lists of commands Whenever one of these user defined buttons is clicked its command list is issued into the command window and processed as if it was typed there The menu item Options Buttons shows the names of all user defined buttons and their respective command lists and gives you opportunity to delete or modify them or to create a new button To delete or modify an existing button mark it with a mouse click or with the cursor keys then click the Delete resp Modify button Edit Buttons load task a xdbtst ucheck 386 of ucheck Ok set task atta id 1 setset break at crm linel run until main n Cancel Delete Add new Modify allows you to change the command list connected to the button Modify button set_task x Command JAREENTO be di Debugging C Programs 1 40 C79000 G7076 C520 01 Organon XDB User Interface Add new asks for the name and command list of a button to be created Define button Lx Name Ok Command Cancel Enter the name of the button to be created into the first field Type the command list in the second field If you try to write a newline into the command list Organon XDB takes this as a signal that the creation or modification is completed If you want the command list to end with a newline write n instead If the list contains more than one command separate them by a semicolon rather than a newline or n The resulting buttons are placed i
184. this address is valid or not Then the execution is continued You should use RETURN only if the program execution has stopped at the first command of a subroutine and the program stack is unchanged ANTO If the step leads to a part of the program the debugger has no debug information about e g a jump to a system routine the execution runs through this part by performing a NEXT If the option INTO is specified XDB also performs single steps inside such code Debugging C Programs 2 150 C79000 G7076 C520 01 Examples STEP 8 n TEP R ETURN STEP INTO References NEXT RUN Debugging C Programs C79000 G7076 C520 01 Organon XDB Command Set 2 151 Organon XDB Command Set 2 107 WHILE Syntax WHILE lt expression gt THEN lt commandlist gt END Description As long as the result of lt expression gt has a value different from 0 the lt commandlist gt is executed Example WHILE crashvalue 0x1FF THEN STEP END References BREAK CONTINUE GOTO Debugging C Programs 2 152 C79000 G7076 C520 01 Organon XDB Error Messages Debugging C Programs C79000 G7076 C520 01 3 1 Organon XDB Error Messages 3 Error Messages The following table lists the error messages of Organon XDB The error message you get represents the letters of the columns CLASS CODE Note that the code of the messages is sorted in alphabetical order CODE D D DIAR H H HW
185. to stop at a certain line of code so you can examine the state it is in e g the value of a variable This stopping is done by setting a breakpoint Similar to the SET BREAKPOINT command described in the Command Reference a breakpoint can be defined by giving its Location default current line possibly followed by a Condition identical to SET BREAKPOINT option WHEN a list of Debugging C Programs 1 26 C79000 G7076 C520 01 Organon XDB User Interface Actions and a Skip number The condition must be written in the current language see chapter 1 2 1 5 Location i Condition PO Cancel Actions Oooo O Browse Skip Symbol Et T Hard T Continue The execution of the target program stops when the location denoted by the expression in the Location field is reached and the Condition is true If a positive Skip number was specified every n 1 st encounter of the breakpoint only will cause a stop n being the Skip number For example a breakpoint with the Skip number 2 would stop the execution when encountered for the third sixth ninth time Actions may contain a list of Organon XDB commands When the execution is stopped by the breakpoint these commands are processed If the Continue checkbutton is activated the execution of the target program will continue after processing the Actions list Symbol The breakpoint can be given a symbolic name which can be used as a debugger variable in commands Note
186. ture or union pointer The shown module name is not found in the internal list of loaded modules The shown object file is corrupt and cannot be read in by the debugger correctly The end of the procedure is reached already The mentioned boundfile cannot be opened This file contains the symbol and debug information The shown object file cannot be opened The given near pointer with its offset exceeds a 16 bit value 3 13 Organon XDB Error Messages CODE CLASS TEXT DESCRIPTION L B PDIR E illegal PAGE The direction word after the direction PAGE command is not allowed in HLL mode L B PRFM E bad format The shown format string is not specification valid L B PRMA E missing argument The PRINT command is called expression with less argument expressions than required in the given format string L B PRTEX W protfile already exists The protocol file exists already Confirm overwriting L B PRTOP E can t open protfile The mentioned file cannot be opened Check its name and your access privileges L B PSUB E illegal pointer The two pointers cannot be subtraction subtracted because they point to different types L B RGGP E no CPU register This register is not a general purpose CPU register L B RGNV E register not valid This register is not accessible now L B RGSE E can t set value of This register cannot be modified by the debugger L B RGSH E can t show value of This register cannot be shown by the debugger
187. ualifiers STEP NOOUT and ERROR are propagated through nested batch file calls Examples BA CH STEP cmdfile BA CH ERROR validate BA CH STEP ERROR test BA Debugging C Programs C79000 G7076 C520 01 TCH cmddir setup Organon XDB Command Set 2 2 BREAK Syntax BREAK Description BREAK terminates the current WHILE loop This command has no effect if called outside a loop Example WHILE i gt 10 END THEN EVAL j IF j lt 20 THI BRI END References WHILE CONTINUE EN E EAK Debugging C Programs C79000 G7076 C520 01 Organon XDB Command Set 2 3 CLOSE Syntax CLOSE LOGFILE CLOSE PROTFILE WINDOW lt window gt CLOSE PROTFILE ALL Description CLOSE stops writing into the specified logfile or protocol file If the last window of a protocol file is closed the file itself is closed too lt window gt may have the following names ASSEMBLER EVALUATE TRACEPOINT COMMAND REGISTER ERROR SOURCE ALL closes all protocol files immediately Examples CLOSE LOGFILE session CLOSE PROTFILE WINDOW EVAL CLOSE PROTFILE ALL References SET LOGFILE SET PROTFILE SHOW LOGFILE SHOW PROTFILE Debugging C Programs C79000 G7076 C520 01 2 9 Organon XDB Command Set 2 4 CONTINUE Syntax CONTINUE Description CONTINUE skips the remaining part of a loop and resumes a
188. urce Save Settings Pe seh ler Exit crx Register Iae Evaluate Error lolx You see the menu File and its submenu Open Protocol The keyword Assembler is disabled because this protocol is opened already Now click the keyword Command or type lt Alt C gt to open the protocol file Imagine the source window looking like this Source CRM crm c Li These flags dictate 1 the verbosity of i the program Li j lt sizeof sec 7 sizeof sec 0 j Debugging C Programs C79000 G7076 C520 01 Organon XDB User Interface Now you perform the following steps You open a source code protocol file by hitting lt Alt F gt lt Alt P gt lt Alt S gt before you type step eval do into the command window After examining the value of the variable dO you click the line 168 in the source window then you hit lt ctrl N gt shortcut for Run until to let the execution continue to this line After you end the session by typing exit the command protocol file looks like this creation date Thu Feb 9 14 23 51 1995 SET PROTFILE WINDOW SOURCE OVERWRITE C ORGANON CHECK PROT SRC step eval d0 run until line 168 exit The source protocol file contains the lines where the execution stopped SRC creation date Thu Feb 9 14 24 41 1995 I SRC CRM line 164 SRC d0 flgs 1 These flags dictate SRC CRM line 168 SRC pd0 amp d
189. with the cursor left and cursor right keys Debugging C Programs C79000 G7076 C520 01 1 83 Organon XDB User Interface Some bit groups are so large that changing them in the manner described above would be cumbersome Thus a different mechanism to change their contents was implemented Just doubleclick the bit group or its name displayed in the layout field then enter the new value as a decimal octal or hex number Bit groups with this change mechanism are displayed hatched viz You find a short description of the focused bit group and the meaning of its current value below the Register Layout field The Description field at the bottom of the box shows a detailed explanation of the contents of the register Changed bits are displayed in enhanced color in the Register Layout field Bits which are not accessible directly i e by clicking them in the Register Layout field are displayed in gray indicating they are disabled Some registers contain only numerical values rather than single and independent bits These registers are displayed without the Register Layout field e g the register IDTR Modify Register IDTR New Values Original Values Base Address 0x40030 0x00040034 Segment Limit 0x07FF 0x07FF Description IDTR Interrupt Descriptor Table Register This register holds the 32 bit base address and the 16 bit segment limit for the interrupt descriptor table IDT When an interrupt occurs the interrupt
190. xecution is in the main routine it continues until the end of the program is reached e Set PC The program counter is set to the line marked by the line pointer i e the execution will continue by processing this line This feature enables you to jump over pieces of the program leaving them unprocessed or to repeat the execution of a piece of the program As this feature forces the program to behave in a way its author has never intended it should be used carefully Debugging C Programs 1 60 C79000 G7076 C520 01 Organon XDB User Interface If some of the menu items cannot be applied to the source code line you clicked e g setting the program counter into a comment these items are disabled If you mark a piece of source text with the left mouse button then click the window with the right mouse button the following menu appears Evaluate Evaluate from pointer Create evalwindow Create evalwindow from pointer If you click one of these items or hit lt Alt gt the underlined letter Organon XDB will react as follows e Evaluate The marked text is taken as an expression to be evaluated as if you issued the command EVALUATE The result is printed to the command window e Evaluate from pointer The marked text is taken as an expression to be evaluated as if you issued the command EVALUATE The result of the evaluation is taken as a pointer and the contents of the memory this pointer points to are displayed in the comma
191. xpected not The is missing between two expressions in an argument list U E CNUN E no unary The shown string does not form a unary expression U E CRBR E expected The closing is missing after an array index U E CRPAR E missing The closing is missing after an expression U E EP E wrong identifier path An identifier can be prefixed by a name path name which selects an other scope as the default The path name consists of identifiers level numbers and characters only Debugging C Programs 3 24 C79000 G7076 C520 01 CODE U E EXPR U E FCOM U E FNUN U E FOLWORD U E FOPER U E FRPAR U E LNR U E LNV U E LV U E NCMA U E OPTL U E PID U E PNUN Debugging C Programs C79000 G7076 C520 01 CLASS TEXT E missing expression not COMMON block member expected no unary invalid command unknown F77 operator expected line number expected LINE or LEVEL expected level number expected missing argument separator operator name too long identifier expected no unary Organon XDB Error Messages DESCRIPTION An expression was expected during reading of an argument list An identifier containing a common block member name is required The shown string does not form a unary expression The entered word is not allowed This string does not match any F77 operator The closing after a FORTRAN expression is missing A number constant
192. you to examine or modify the chosen item of the GDT LDT or IDT Modify Descriptor GDT 1 New Values Old Values Descriptor Type Data Segment Data Segment _se_ Segment Base 0x00030000 0x00030000 Segment Limit 0x00003FFF 0x00003FFF Descriptor Layout Upper 32 Bits TYPE PRESENT E po BIG _ i mi ED 63 0000000 4IAg0 00 dA agi CEDE COSO 1 32 GRANULARITY l T WRITE ENABLE AVL SEGMENT TYPE DPL This data segment has not been accessed Description GDT 1 at 0x00030008 0xFF3F000003920000 type DATA SEG base 0x00030000 limit 0x00003FFF bytes G 1b AYL 0 P 1 DPL 0 attr UWX The modification becomes effective when you click the Set button The Close button dismisses the dialog box discarding all changes you made Clicking the Debugging C Programs 1 80 C79000 G7076 C520 01 Organon XDB User Interface Restore button discards all changes made since the opening but the dialog box remains open To change the type of the descriptor open the Descriptor Type pull down menu and choose one of the offered types You can modify the values of the segment base address and the segment limit by entering a number octal decimal or hex The Descriptor Layout field helps you modifying the contents of the descriptor bit for bit Click the bit or bit group or its name displayed in the field to set the focus on it The focused bit or bit group can be altered

Download Pdf Manuals

image

Related Search

Related Contents

here - Armasight  CMM User Manual English  10 GA__10 GA P USA  2 - Ricoh    Betriebsanleitung  TEFAL BR400831 Instruction Manual  Data Collection Software User Guide Coating Thickness Meter 1    Valcom VIP-800 User's Manual  

Copyright © All rights reserved.
Failed to retrieve file