ibm-information-center/dist/eclipse/plugins/i5OS.ic.apis_5.4.0.1/QTERTVTH.htm

671 lines
21 KiB
HTML
Raw Normal View History

2024-04-02 14:02:31 +00:00
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Copyright" content="Copyright (c) 2006 by IBM Corporation">
<title>Retrieve Debugged Threads (QteRetrieveDebuggedThreads) API</title>
<!-- Begin Header Records ========================================== -->
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<!-- DEBUG1 SCRIPT A converted by B2H R4.1 (346) (CMS) by V2KEA304 -->
<!-- at RCHVMW2 on 29 Jan 1999 at 16:05:09 -->
<!-- Change History: -->
<!-- YYMMDD USERID Change description -->
<!--File Edited November 2001 -->
<!--End Header Records -->
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
</head>
<body>
<a name="top_Of_Page"></a>
<!-- Java sync-link -->
<script language="Javascript" src="../rzahg/synch.js" type="text/javascript">
</script>
<h2>Retrieve Debugged Threads (QteRetrieveDebuggedThreads) API</h2>
<div class="box" style="width: 70%;">
<br>
&nbsp;&nbsp;Required Parameter Group:<br>
<!-- iddvc RMBR -->
<br>
<table width="100%">
<tr>
<td align="center" valign="top" width="10%">1</td>
<td align="left" valign="top" width="50%">Receiver variable</td>
<td align="left" valign="top" width="20%">Output</td>
<td align="left" valign="top" width="20%">Char(*)</td>
</tr>
<tr>
<td align="center" valign="top">2</td>
<td align="left" valign="top">Length of receiver variable</td>
<td align="left" valign="top">Input</td>
<td align="left" valign="top">Binary(4)</td>
</tr>
<tr>
<td align="center" valign="top">3</td>
<td align="left" valign="top">Format name</td>
<td align="left" valign="top">Input</td>
<td align="left" valign="top">Char(8)</td>
</tr>
<tr>
<td align="center" valign="top">4</td>
<td align="left" valign="top">Thread array</td>
<td align="left" valign="top">Input</td>
<td align="left" valign="top">Array of Char(8)</td>
</tr>
<tr>
<td align="center" valign="top">5</td>
<td align="left" valign="top">Number of threads</td>
<td align="left" valign="top">Input</td>
<td align="left" valign="top">Binary(4)</td>
</tr>
<tr>
<td align="center" valign="top">6</td>
<td align="left" valign="top">Error code</td>
<td align="left" valign="top">I/O</td>
<td align="left" valign="top">Char(*)</td>
</tr>
</table>
<br>
&nbsp;&nbsp;Service Program: QTETHRD<br>
<!-- iddvc RMBR -->
<br>
&nbsp;&nbsp;Threadsafe: No<br>
<!-- iddvc RMBR -->
<br>
</div>
<p>The Retrieve Debugged Threads (QteRetrieveDebuggedThreads) API retrieves information for threads being debugged.</p>
<blockquote>
<p><strong>Note:</strong> A job may have several threads, each of which is debugged if the job is debugged. By default, the current thread is the initial thread of the debugged job or the thread at a debug stop.</p>
</blockquote>
<p>Information about the requested threads is returned in the receiver variable. This allows the writer of a debugger to maintain and control a list of threads that are being debugged. If this API is processed when threads are active, the information returned by the API may no longer be accurate. Check the job status flag to see what state the job was in when the API was processed.</p>
<p>Threads debugging is supported if a service job is used to debug a job that was spawned by native threads support. If this is not the debug environment present when this API is called, a CPF958B error is
returned.</p>
<br>
<h3>Authorities and Locks</h3>
<p>None</p>
<br>
<h3>Required Parameter Group</h3>
<dl>
<dt><strong>Receiver variable</strong></dt>
<dd>OUTPUT; CHAR(*)
<p>The receiver variable that receives the information requested. You can specify the size of this area to be smaller than the format requested as long as you specify the length parameter correctly. As a result, the API returns only the data the area can hold. For more information, see <a href="#HDRRTHRCV">Format of Receiver Variable</a>. Entries are only returned in their entirety. The API never returns anything less. If there is not enough space for the entire entry, that entry is not returned and bytes available and bytes returned are not equal.</p>
</dd>
<dt><strong>Length of receiver variable</strong></dt>
<dd>INPUT; BINARY(4)
<p>The length of the receiver variable. The length of receiver variable parameter may be specified up to the size of the receiver variable specified in the user program. If the length of receiver variable parameter specified is larger than the allocated size of the receiver variable in the user program, the results are not predictable. The minimum length is 8 bytes.</p>
</dd>
<dt><strong>Format name</strong></dt>
<dd>INPUT; CHAR(8)
<p>The content and format of the information returned in the receiver variable. The possible format names are:</p>
<table cellpadding="3">
<!-- cols="15 85" -->
<tr>
<td valign="top"><em>THDL0100</em></td>
<td valign="top">Basic thread debug information.</td>
</tr>
<tr>
<td valign="top"><em>THDL0200</em></td>
<td valign="top">Extended thread debug information.</td>
</tr>
</table>
<br>
</dd>
<dt><strong>Thread array</strong></dt>
<dd>INPUT; ARRAY OF CHAR(8)
<p>The thread identifiers (IDs) for which debug information is returned. In the thread array parameter, thread IDs are specified and debug information about the requested threads is returned in the receiver variable. Each thread identifier in the thread array is 8 bytes long. The number of thread identifiers is specified in the number of threads parameter.</p>
<p>If the number of threads parameter is minus one, the first thread array parameter must be a special value. In this case, all other thread array parameters are ignored. Valid special values are:</p>
<table cellpadding="3">
<!-- cols="15 85" -->
<tr>
<td valign="top"><em>*ALL</em></td>
<td valign="top">Thread debug information for all threads is returned.</td>
</tr>
<tr>
<td valign="top"><em>*CURRENT</em></td>
<td valign="top">Thread debug information for the current thread is returned.</td>
</tr>
<tr>
<td valign="top"><em>*INITIAL</em></td>
<td valign="top">Thread debug information for the initial thread is returned.</td>
</tr>
<tr>
<td valign="top"><em>*ENABLE</em></td>
<td valign="top">Thread debug information for all enabled threads is returned.</td>
</tr>
<tr>
<td valign="top"><em>*DISABLE</em></td>
<td valign="top">Thread debug information for all disabled threads is returned.</td>
</tr>
</table>
<br>
</dd>
<dt><strong>Number of threads</strong></dt>
<dd>INPUT; BINARY(4)
<p>The number of thread identifiers provided in the thread array parameter. The number of threads parameter must be greater than zero or minus one. If it has a value of minus one, the first and only thread array parameter must be a special value. If it is greater than zero, the number specified is the number of thread array parameters that must be provided.</p>
</dd>
<dt><strong>Error code</strong></dt>
<dd>I/O; CHAR(*)
<p>The structure in which to return error information. For the format of the structure, see <a href="../apiref/error.htm#hdrerrcod">Error Code Parameter</a>.</p>
</dd>
</dl>
<br>
<h3><a name="HDRRTHRCV">Format of Receiver Variable</a></h3>
<p>The following receiver variable formats are returned based on the format name parameter:</p>
<br>
<h3><a name="HDRTHD0100">THDL0100 Format</a></h3>
<p>The following table shows the format of the receiver variable for the THDL0100 format. For more information on the fields, see <a href="#HDRRTHFD">Field Descriptions</a>.</p>
<table border width="80%">
<tr>
<th align="center" valign="bottom" colspan="2">Offset</th>
<th align="left" valign="bottom" rowspan="2">Type</th>
<th align="left" valign="bottom" rowspan="2">Field</th>
</tr>
<tr>
<th align="center" valign="bottom">Dec</th>
<th align="center" valign="bottom">Hex</th>
</tr>
<tr>
<td align="center" valign="top" width="10%">0</td>
<td align="center" valign="top" width="10%">0</td>
<td align="left" valign="top" width="20%">BINARY(4)</td>
<td align="left" valign="top" width="60%">Bytes returned</td>
</tr>
<tr>
<td align="center" valign="top">4</td>
<td align="center" valign="top">4</td>
<td align="left" valign="top">BINARY(4)</td>
<td align="left" valign="top">Bytes available</td>
</tr>
<tr>
<td align="center" valign="top">8</td>
<td align="center" valign="top">8</td>
<td align="left" valign="top">CHAR(1)</td>
<td align="left" valign="top">Job status flag</td>
</tr>
<tr>
<td align="center" valign="top">9</td>
<td align="center" valign="top">9</td>
<td align="left" valign="top">CHAR(3)</td>
<td align="left" valign="top">Reserved</td>
</tr>
<tr>
<td align="center" valign="top">12</td>
<td align="center" valign="top">C</td>
<td align="left" valign="top">BINARY(4)</td>
<td align="left" valign="top">Offset to thread records</td>
</tr>
<tr>
<td align="center" valign="top">16</td>
<td align="center" valign="top">10</td>
<td align="left" valign="top">BINARY(4)</td>
<td align="left" valign="top">Number of thread records</td>
</tr>
<tr>
<td align="center" valign="top">20</td>
<td align="center" valign="top">14</td>
<td align="left" valign="top">BINARY(4)</td>
<td align="left" valign="top">Size of thread record</td>
</tr>
<tr>
<td align="center" valign="top">&nbsp;</td>
<td align="center" valign="top">&nbsp;</td>
<td align="left" valign="top">CHAR(*)</td>
<td align="left" valign="top">Reserved</td>
</tr>
<tr>
<td align="left" valign="top" colspan="4"><strong>Note:</strong> The following fields repeat the number of times specified in the number of thread records field.</td>
</tr>
<tr>
<td align="center" valign="top">&nbsp;</td>
<td align="center" valign="top">&nbsp;</td>
<td align="left" valign="top">CHAR(8)</td>
<td align="left" valign="top">Thread ID</td>
</tr>
<tr>
<td align="center" valign="top">&nbsp;</td>
<td align="center" valign="top">&nbsp;</td>
<td align="left" valign="top">CHAR(1)</td>
<td align="left" valign="top">Current thread flag</td>
</tr>
<tr>
<td align="center" valign="top">&nbsp;</td>
<td align="center" valign="top">&nbsp;</td>
<td align="left" valign="top">CHAR(1)</td>
<td align="left" valign="top">Initial thread flag</td>
</tr>
<tr>
<td align="center" valign="top">&nbsp;</td>
<td align="center" valign="top">&nbsp;</td>
<td align="left" valign="top">CHAR(1)</td>
<td align="left" valign="top">Thread run state</td>
</tr>
<tr>
<td align="center" valign="top">&nbsp;</td>
<td align="center" valign="top">&nbsp;</td>
<td align="left" valign="top">CHAR(1)</td>
<td align="left" valign="top">Thread debug status</td>
</tr>
</table>
<br><br>
<h3><a name="HDRTHD0200">THDL0200 Format</a></h3>
<p>The following table shows the format of the receiver variable for the THDL0200 format. For more information on the fields, see <a href="#HDRRTHFD">Field Descriptions</a>.</p>
<table border width="80%">
<tr>
<th align="center" valign="bottom" colspan="2">Offset</th>
<th align="left" valign="bottom" rowspan="2">Type</th>
<th align="left" valign="bottom" rowspan="2">Field</th>
</tr>
<tr>
<th align="center" valign="bottom">Dec</th>
<th align="center" valign="bottom">Hex</th>
</tr>
<tr>
<td align="center" valign="top" width="10%">0</td>
<td align="center" valign="top" width="10%">0</td>
<td align="left" valign="top" width="20%">BINARY(4)</td>
<td align="left" valign="top" width="60%">Bytes returned</td>
</tr>
<tr>
<td align="center" valign="top">4</td>
<td align="center" valign="top">4</td>
<td align="left" valign="top">BINARY(4)</td>
<td align="left" valign="top">Bytes available</td>
</tr>
<tr>
<td align="center" valign="top">8</td>
<td align="center" valign="top">8</td>
<td align="left" valign="top">CHAR(1)</td>
<td align="left" valign="top">Job status flag</td>
</tr>
<tr>
<td align="center" valign="top">9</td>
<td align="center" valign="top">9</td>
<td align="left" valign="top">CHAR(3)</td>
<td align="left" valign="top">Reserved</td>
</tr>
<tr>
<td align="center" valign="top">12</td>
<td align="center" valign="top">C</td>
<td align="left" valign="top">BINARY(4)</td>
<td align="left" valign="top">Offset to thread records</td>
</tr>
<tr>
<td align="center" valign="top">16</td>
<td align="center" valign="top">10</td>
<td align="left" valign="top">BINARY(4)</td>
<td align="left" valign="top">Number of thread records</td>
</tr>
<tr>
<td align="center" valign="top">20</td>
<td align="center" valign="top">14</td>
<td align="left" valign="top">BINARY(4)</td>
<td align="left" valign="top">Size of thread record</td>
</tr>
<tr>
<td align="center" valign="top">&nbsp;</td>
<td align="center" valign="top">&nbsp;</td>
<td align="left" valign="top">CHAR(*)</td>
<td align="left" valign="top">Reserved</td>
</tr>
<tr>
<td align="left" valign="top" colspan="4"><strong>Note:</strong> The following fields repeat the number of times specified in the number of thread records field.</td>
</tr>
<tr>
<td align="center" valign="top">&nbsp;</td>
<td align="center" valign="top">&nbsp;</td>
<td align="left" valign="top">CHAR(8)</td>
<td align="left" valign="top">Thread ID</td>
</tr>
<tr>
<td align="center" valign="top">&nbsp;</td>
<td align="center" valign="top">&nbsp;</td>
<td align="left" valign="top">CHAR(1)</td>
<td align="left" valign="top">Current thread flag</td>
</tr>
<tr>
<td align="center" valign="top">&nbsp;</td>
<td align="center" valign="top">&nbsp;</td>
<td align="left" valign="top">CHAR(1)</td>
<td align="left" valign="top">Initial thread flag</td>
</tr>
<tr>
<td align="center" valign="top">&nbsp;</td>
<td align="center" valign="top">&nbsp;</td>
<td align="left" valign="top">CHAR(1)</td>
<td align="left" valign="top">Thread run state</td>
</tr>
<tr>
<td align="center" valign="top">&nbsp;</td>
<td align="center" valign="top">&nbsp;</td>
<td align="left" valign="top">CHAR(1)</td>
<td align="left" valign="top">Thread debug status</td>
</tr>
<tr>
<td align="center" valign="top">&nbsp;</td>
<td align="center" valign="top">&nbsp;</td>
<td align="left" valign="top">CHAR(3)</td>
<td align="left" valign="top">Reserved</td>
</tr>
<tr>
<td align="center" valign="top">&nbsp;</td>
<td align="center" valign="top">&nbsp;</td>
<td align="left" valign="top">CHAR(1)</td>
<td align="left" valign="top">top of stack flag</td>
</tr>
<tr>
<td align="center" valign="top">&nbsp;</td>
<td align="center" valign="top">&nbsp;</td>
<td align="left" valign="top">BINARY(4)</td>
<td align="left" valign="top">Statement view ID stopped in</td>
</tr>
<tr>
<td align="center" valign="top">&nbsp;</td>
<td align="center" valign="top">&nbsp;</td>
<td align="left" valign="top">BINARY(4)</td>
<td align="left" valign="top">Line in statement view stopped in</td>
</tr>
</table>
<br>
<br>
<h3><a name="HDRRTHFD">Field Descriptions</a></h3>
<p><strong>Bytes available.</strong> The number of bytes of data available to be returned to the user.</p>
<p><strong>Bytes returned.</strong> The number of bytes of data returned to the user.</p>
<p><strong>Current thread flag.</strong> Whether the thread is the current thread or not. Possible values are:</p>
<table cellpadding="3">
<!-- cols="5 95" -->
<tr>
<td valign="top"><em>0</em></td>
<td valign="top">The thread is not the current thread.</td>
</tr>
<tr>
<td valign="top"><em>1</em></td>
<td valign="top">The thread is the current thread.</td>
</tr>
</table>
<p><strong>Initial thread flag.</strong> Whether the thread is the initial thread or not. Possible values are:</p>
<table cellpadding="3">
<!-- cols="5 95" -->
<tr>
<td valign="top"><em>0</em></td>
<td valign="top">The thread is not the initial thread.</td>
</tr>
<tr>
<td valign="top"><em>1</em></td>
<td valign="top">The thread is the initial thread.</td>
</tr>
</table>
<p><strong>Job status flag.</strong> The status of the job when the API was processed.</p>
<table cellpadding="3">
<!-- cols="5 95" -->
<tr>
<td valign="top"><em>0</em></td>
<td valign="top">The job is stopped by debug. The information returned by this API is accurate.</td>
</tr>
<tr>
<td valign="top"><em>1</em></td>
<td valign="top">The job is running and has not been stopped by debug (for example, breakpoint, step, watch, or unmonitored exception). If threads are running it is not possible for debug to present a stable debugging environment. The information returned by this API may no longer be accurate.</td>
</tr>
</table>
<p><strong>Line in statement view stopped in.</strong> If the thread is stopped in a module that has been registered under debug, this is the line number in the module's statement view where the thread is stopped. See the statement view ID stopped in field for more information. This field is only applicable for the current thread. If the thread being returned is not the current thread then this field will contain a -1.</p>
<p><strong>Number of thread records.</strong> The number of thread records that are returned in the receiver variable. Each record has the same format, and is repeated in the receiver variable.</p>
<p><strong>Offset to thread records.</strong> The offset in bytes from the start of the receiver variable to the first requested thread information record.</p>
<p><strong>Reserved.</strong> An ignored field.</p>
<p><strong>Size of thread record.</strong> The number of bytes occupied by each thread record.</p>
<p><strong>Statement view ID stopped in.</strong> The view ID of a previously registered debug statement view. It is the statement view ID of the highest module found on the call stack that has been registered under debug. If no statement views on the stack are registered, the thread is not stopped by debug, or if the thread is not the current thread a value of -1 is returned.</p>
<p><strong>Thread debug status.</strong> The debug status of the thread.</p>
<table cellpadding="3">
<!-- cols="5 95" -->
<tr>
<td valign="top"><em>0</em></td>
<td valign="top">The thread is disabled.</td>
</tr>
<tr>
<td valign="top"><em>1</em></td>
<td valign="top">The thread is enabled.</td>
</tr>
</table>
<p><strong>Thread ID.</strong> This is an 8-byte thread handle assigned by the system.</p>
<p><strong>Thread run state.</strong> The debug run status of the thread.</p>
<table cellpadding="3">
<!-- cols="5 95" -->
<tr>
<td valign="top"><em>0</em></td>
<td valign="top">The thread is running.</td>
</tr>
<tr>
<td valign="top"><em>1</em></td>
<td valign="top">The thread is currently stopped at a breakpoint, step, watch or unmonitored exception. When this happens all other threads are halted.</td>
</tr>
<tr>
<td valign="top"><em>2</em></td>
<td valign="top">This is a thread that was halted by debug because of a debug stop that occurred in one of the debugged job's threads. The reason for stopping or halting all threads is to provide a static debugging environment.</td>
</tr>
</table>
<p><strong>Top of stack flag.</strong> Whether the stopped view ID is at the top of the call stack or not. Possible values are:</p>
<table cellpadding="3">
<!-- cols="10 90" -->
<tr>
<td valign="top"><em>blank</em></td>
<td valign="top">This is not the current thread. This field is only applicable for the current thread.</td>
</tr>
<tr>
<td valign="top"><em>0</em></td>
<td valign="top">The view ID is not at the top of the call stack.</td>
</tr>
<tr>
<td valign="top"><em>1</em></td>
<td valign="top">The view ID is at the top of the call stack.</td>
</tr>
</table>
<br><br>
<h3>Error Messages</h3>
<table width="100%" cellpadding="3">
<!-- cols="15 85" -->
<tr>
<th align="left" valign="top">Message ID</th>
<th align="left" valign="top">Error Message Text</th>
</tr>
<tr>
<td align="left" valign="top">CPF3C19 E</td>
<td valign="top">Error occurred with receiver variable specified.</td>
</tr>
<tr>
<td align="left" valign="top">CPF3C1E E</td>
<td valign="top">Required parameter &amp;1 omitted.</td>
</tr>
<tr>
<td align="left" valign="top">CPF3C21 E</td>
<td valign="top">Format name &amp;1 is not valid.</td>
</tr>
<tr>
<td align="left" valign="top">CPF3C24 E</td>
<td valign="top">Length of the receiver variable is not valid.</td>
</tr>
<tr>
<td align="left" valign="top">CPF3CF1 E</td>
<td valign="top">Error code parameter not valid.</td>
</tr>
<tr>
<td align="left" valign="top">CPF3CF2 E</td>
<td valign="top">Error(s) occurred during running of &amp;1 API.</td>
</tr>
<tr>
<td align="left" valign="top">CPF9541 E</td>
<td valign="top">Not in debug mode.</td>
</tr>
<tr>
<td align="left" valign="top">CPF9549 E</td>
<td valign="top">Error addressing API parameter.</td>
</tr>
<tr>
<td align="left" valign="top">CPF958A E</td>
<td valign="top">Thread &amp;1 not found.</td>
</tr>
<tr>
<td align="left" valign="top">CPF958B E</td>
<td valign="top">Threads debugging not supported.</td>
</tr>
<tr>
<td align="left" valign="top">CPF958C E</td>
<td valign="top">Number of threads not valid.</td>
</tr>
<tr>
<td align="left" valign="top">CPF958E E</td>
<td valign="top">Thread array special value not valid.</td>
</tr>
<tr>
<td align="left" valign="top">CPF9872 E</td>
<td valign="top">Program or service program &amp;1 in library &amp;2 ended. Reason code &amp;3.</td>
</tr>
</table>
<br>
<hr>
API introduced: V4R2
<hr>
<center>
<table cellpadding="2" cellspacing="2">
<tr align="center">
<td valign="middle" align="center">
<a href="#top_Of_Page">Top</a> |
<a href="debug1.htm">Debugger APIs</a> |
<a href="aplist.htm">APIs by category</a></td>
</tr>
</table>
</center>
<br>
</body>
</html>