2012-02-05 11:35:58 -05:00
|
|
|
/****************************************************************
|
|
|
|
* *
|
2024-07-19 11:43:27 -04:00
|
|
|
* Copyright 2001, 2013 Fidelity Information Services, Inc *
|
2012-02-05 11:35:58 -05:00
|
|
|
* *
|
|
|
|
* This source code contains the intellectual property *
|
|
|
|
* of its copyright holder(s), and is made available *
|
|
|
|
* under a license. If you do not know the terms of *
|
|
|
|
* the license, please stop and do not read further. *
|
|
|
|
* *
|
|
|
|
****************************************************************/
|
|
|
|
|
|
|
|
#include "mdef.h"
|
|
|
|
#include "cmd_qlf.h"
|
2024-07-19 11:43:27 -04:00
|
|
|
#include <rtnhdr.h>
|
2012-02-05 11:35:58 -05:00
|
|
|
#include "op.h"
|
|
|
|
#include "job_addr.h"
|
|
|
|
#include "zbreak.h"
|
|
|
|
|
2012-03-24 14:06:46 -04:00
|
|
|
error_def(ERR_JOBLABOFF);
|
|
|
|
|
2024-07-19 11:43:27 -04:00
|
|
|
boolean_t job_addr(mstr *rtn, mstr *label, int4 offset, char **hdr, char **labaddr)
|
2012-02-05 11:35:58 -05:00
|
|
|
{
|
|
|
|
rhdtyp *rt_hdr;
|
|
|
|
int4 *lp;
|
2012-03-24 14:06:46 -04:00
|
|
|
mval rt;
|
|
|
|
DCL_THREADGBL_ACCESS;
|
2012-02-05 11:35:58 -05:00
|
|
|
|
2012-03-24 14:06:46 -04:00
|
|
|
SETUP_THREADGBL_ACCESS;
|
|
|
|
if (NULL == (rt_hdr = find_rtn_hdr(rtn)))
|
2012-02-05 11:35:58 -05:00
|
|
|
{
|
|
|
|
rt.mvtype = MV_STR;
|
|
|
|
rt.str = *rtn;
|
2012-03-24 14:06:46 -04:00
|
|
|
op_zlink(&rt, NULL);
|
|
|
|
assertpro(NULL != (rt_hdr = find_rtn_hdr(rtn)));
|
2012-02-05 11:35:58 -05:00
|
|
|
}
|
|
|
|
lp = NULL;
|
2012-03-24 14:06:46 -04:00
|
|
|
if ((rt_hdr->compiler_qlf & CQ_LINE_ENTRY) || (0 == offset))
|
|
|
|
/* Label offset with routine compiled with NOLINE_ENTRY should cause error. */
|
2012-02-05 11:35:58 -05:00
|
|
|
lp = find_line_addr(rt_hdr, label, offset, NULL);
|
|
|
|
if (!lp)
|
2024-07-19 11:43:27 -04:00
|
|
|
return (FALSE);
|
2012-03-24 14:06:46 -04:00
|
|
|
/* Set the pointer to address / offset for line number entry storage in lab_proxy. */
|
|
|
|
USHBIN_ONLY((TREF(lab_proxy)).lnr_adr = lp;)
|
|
|
|
/* On non-shared-binary, calculcate the offset to the corresponding lnr_tabent record by subtracting
|
|
|
|
* the base address (routine header) from line number entry's address, and save the result in
|
|
|
|
* lab_ln_ptr field of lab_tabent structure.
|
|
|
|
*/
|
|
|
|
NON_USHBIN_ONLY((TREF(lab_proxy)).lab_ln_ptr = ((int4)lp - (int4)rt_hdr));
|
|
|
|
if (NULL != labaddr)
|
|
|
|
*labaddr = (char *)LINE_NUMBER_ADDR(rt_hdr, lp);
|
2012-02-05 11:35:58 -05:00
|
|
|
*hdr = (char *)rt_hdr;
|
2024-07-19 11:43:27 -04:00
|
|
|
return (TRUE);
|
2012-02-05 11:35:58 -05:00
|
|
|
}
|