IBM Support

Getting program and task control block (TCB) information

Troubleshooting


Problem

How does a IBM® Rational® VADS® user get program and task control block (TCB) information? This technote describes where to find the interfaces and how they work for getting program and task control block (TCB) information for Ada tasks in your application.

Resolving The Problem

To get access to the TCB from an application, use the types and interface routines defined in ada_krn_defs.a, ada_krn_i.a, and krn_defs.a in the standard library. Here is a snippet of code that will get the TCB:

-- Get the program control block for our executable.
current_pcb := ada_krn_i.program_get_krn_id (ada_krn_i.program_self);

-- Get a pointer to the head of our program's task control block list
current_tcb := current_pcb.t_head;

The TCB is a record type named krn_tcb_t, which is defined in krn_defs.a. Each field of the record contains information about the task.

The cpu_state field is of type cpu_state_t that is defined in krn_cpu_defs.a. This would be used to find out the address that the task will resume after being suspended or the return address.

The q_next field is for placing a task on a queue. For example, when a task waits at a condition variable, it's placed on that condition variable's queue. It's also used for the delay queue, run queue, etc.

The t_link field is a list of the active tasks in your program.

[{"Product":{"code":"SSSHXB","label":"Rational VADS"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"General Support Issues","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF015","label":"IRIX"},{"code":"PF026","label":"Reliant UNIX"},{"code":"PF027","label":"Solaris"},{"code":"PF030","label":"TRU64 UNIX"}],"Version":"6.2.5","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Historical Number

23624

Document Information

Modified date:
16 June 2018

UID

swg21125689