| 13 | | The &condition_info_ptr parameter is supposed to expand to a virtual pointer |
| 14 | | (<segment_number>|<offset>) locating a condition_info structure |
| 15 | | describing the condition being handled. This permits a command or |
| 16 | | active function to access added details about the event being handled |
| 17 | | by the current on-unit invocation. For example, the on-unit shown above |
| 18 | | sets the status_code variable to the name of the Multics status code |
| 19 | | being reported in a com_err_ or active_fnc_err_ subroutine call. |
| | 19 | The &condition_info_ptr parameter is documented to expand to a |
| | 20 | virtual pointer (<segment_number>|<offset>) locating a |
| | 21 | condition_info structure describing the condition being handled. |
| 21 | | However, the exec_com interpreter does not properly call the |
| 22 | | find_condition_info_ subroutine to fill-in elements of the |
| 23 | | condition_info structure before executing line of the on-unit. The |
| 24 | | &condition_info_ptr parameter does locate a data structure, but |
| 25 | | elements of that structure contain previous stack data because |
| 26 | | the structure was not properly initialized with details from the |
| 27 | | reported event. |
| | 23 | This description is wrong. &condition_info_ptr actually locates |
| | 24 | a condition_info_header structure that begins the specific data |
| | 25 | structure associated with the signaled condition named &condition_name. |
| 29 | | Executing an exec_com program with the statements above currently |
| 30 | | generates a virtual_ptr value for the &condition_info_ptr that has |
| 31 | | a correct format for a pointer locator, but points to storage for a |
| 32 | | condition_info structure with bogus element contents. |
| | 27 | For example, the data structure associated with a command_error or |
| | 28 | active_function_error condition is called com_af_error_info. It is |
| | 29 | declared as shown below. |
| | 30 | |
| | 31 | {{{ |
| | 32 | /* BEGIN INCLUDE FILE com_af_error_info.incl.pl1 April 81 BIM */ |
| | 33 | /* format: style2 */ |
| | 34 | |
| | 35 | /* info structures for command error and active function error */ |
| | 36 | /* The include file condition_info_header must be included to */ |
| | 37 | /* use this file */ |
| | 38 | |
| | 39 | dcl com_af_error_info_ptr pointer; |
| | 40 | dcl 1 com_af_error_info aligned based (com_af_error_info_ptr), |
| | 41 | 2 header aligned like condition_info_header, |
| | 42 | 2 name_ptr ptr, |
| | 43 | 2 name_lth fixed bin, |
| | 44 | 2 errmess_ptr ptr, |
| | 45 | 2 errmess_lth fixed bin (21), |
| | 46 | 2 max_errmess_lth fixed bin (21), |
| | 47 | 2 print_sw bit (1); |
| | 48 | |
| | 49 | dcl com_af_error_info_version_3 internal static options (constant) |
| | 50 | init (3); |
| | 51 | |
| | 52 | /* END INCLUDE FILE com_af_error_info */ |
| | 53 | |
| | 54 | /* BEGIN INCLUDE FILE condition_info_header.incl.pl1 BIM 1981 */ |
| | 55 | /* format: style2 */ |
| | 56 | |
| | 57 | dcl condition_info_header_ptr pointer; |
| | 58 | dcl 1 condition_info_header based (condition_info_header_ptr) |
| | 59 | aligned, |
| | 60 | 2 length fixed bin, /* length in words of this structure */ |
| | 61 | 2 version fixed bin, /* version number of this structure */ |
| | 62 | 2 action_flags aligned, /* tell handler how to proceed */ |
| | 63 | 3 cant_restart bit (1) unaligned, /* caller doesn't ever want to be returned to */ |
| | 64 | 3 default_restart bit (1) unaligned, /* caller can be returned to with no further action */ |
| | 65 | 3 quiet_restart bit (1) unaligned, /* return, and print no message */ |
| | 66 | 3 support_signal bit (1) unaligned, /* treat this signal as if the signalling procedure had the support bit set */ |
| | 67 | /* if the signalling procedure had the support bit set, do the same for its caller */ |
| | 68 | 3 pad bit (32) unaligned, |
| | 69 | 2 info_string char (256) varying, /* may contain printable message */ |
| | 70 | 2 status_code fixed bin (35); /* if^=0, code interpretable by com_err_ */ |
| | 71 | |
| | 72 | /* END INCLUDE FILE condition_info_header.incl.pl1 */ |
| | 73 | }}} |
| | 74 | |
| | 75 | The value displayed by the &condition_info_ptr parameter is |
| | 76 | associated with a condition_info structure only in the sense |
| | 77 | that condition_info.info_ptr holds the value reported by that |
| | 78 | parameter. |
| | 79 | |
| | 80 | Executing an exec_com program with the statements above correctly |
| | 81 | reports the value stored in com_af_error_info.status_code. |