/* parse a statement number for PL/I symbolic debugger %include 'statement.inc' to get the definition of the external structure in which information on the statement is returned */ statement: procedure; %include 'knldef.pli'; %include 'scandef.pli'; %include 'workdef.pli'; %include 'rundef.pli'; %include 'breakdef.pli'; %include 'moddef.pli'; %include 'block.inc'; %include 'overlaym.inc'; %include 'statement.inc'; dcl dostma pointer external, ( ostmat, ostmao, ostman ) fixed bin(15) external; /*defined in debasm*/ dcl s char(10) varying, ttype fixed bin(7), x fixed bin(15), block_fileaddr fixed bin(23), module_prolog fixed bin(15); /**************************************************************************************************************/ call block(block_fileaddr); if debprocedure_define_level = 0 then do; if block_fileaddr = null_fileaddr then statement_module = default_module; else do; call workgrab(block_fileaddr, scratch_workp); statement_module = scratch_workp->workbuf.parent; end; call workgrab(statement_module, scratch_workp); module_prolog = scratch_workp->workbuf.value; statement_prolog = module_prolog; /**temp for finding statement address at overlay load time*/ statement_module_name = scratch_workp->workbuf.name; call workgrab(scratch_workp->workbuf.parent, scratch_workp); /*get overlay segment record*/ statement_overlay = scratch_workp->workbuf.value; /*overlay segment descriptor address*/ end; ttype = nexttoken(s); if ttype = decimal_constant_type then do; statement_number = s; if statement_number = 1 then do; call warning('breakpoints should not be set on PROCEDURE statements'); call put_skip_list(' - breakpoint set on statement 2 instead'); statement_number = 2; /* note - this doesnt catch breakpoints on local PROCEDURE statements. to do so, check the address against all local procedure addresses in the module blocks array, and either give a warning message without changing the statement, or else bump to the next statement only if it was specified in decimal (rather than octal address) and we weren't called by SN command (must be able to set a breakpoint anywhere by octal address, and find the address via SN. address of statement 1 can be found via XP) */ end; statement_address = to_be_determined; /***temp*/ if (debprocedure_define_level = 0) & overlay_mapped(statement_overlay) /***temp no code to get addr if not mapped*/ then do; /***note: the following code is temporarily duplicated in stmtaddr in gocmd.pli**/ x = getword(module_prolog+prolog_static) + getword(module_prolog+prolog_stmtoffset); /*must get before fill - getword uses packet*/ call fillpacket(dostma); packet(ostmat) = x; packet(ostman) = statement_number; call sendknl; call rcvknl; x = packet(ostmao); if x = -1 then call error('statement to the left not found'); statement_address = module_prolog + x; end; return; end; if ttype = octal_constant_type then do; statement_number = by_octal_address; statement_address = s; return; end; call error('invalid syntax for statement number'); end/*statement*/;