Пример #1
0
void job_addr(mstr *rtn, mstr *label, int4 offset, char **hdr, char **labaddr)
{
    rhdtyp		*rt_hdr;
    int4		*lp;
    error_def	(ERR_JOBLABOFF);

    if ((rt_hdr = find_rtn_hdr(rtn)) == 0)
    {
        mval rt;

        rt.mvtype = MV_STR;
        rt.str = *rtn;
        op_zlink(&rt,0);
        if ((rt_hdr = find_rtn_hdr (rtn)) == 0)
            GTMASSERT;
    }
    lp = NULL;
    if ((rt_hdr->compiler_qlf & CQ_LINE_ENTRY) || 0 == offset)
    {   /* label offset with routine compiled with NOLINE_ENTRY should cause error */
        lp = find_line_addr(rt_hdr, label, offset, NULL);
    }
    if (!lp)
        rts_error(VARLSTCNT(1) ERR_JOBLABOFF);
    *labaddr = (char *) LINE_NUMBER_ADDR(rt_hdr, lp);
    *hdr = (char *)rt_hdr;
}
Пример #2
0
boolean_t job_addr(mstr *rtn, mstr *label, int4 offset, char **hdr, char **labaddr, boolean_t *need_rtnobj_shm_free)
{
	rhdtyp		*rt_hdr;
	int4		*lp;
	mval		rt;
	DCL_THREADGBL_ACCESS;

	SETUP_THREADGBL_ACCESS;
	if (NULL == (rt_hdr = find_rtn_hdr(rtn)))
	{
		rt.mvtype = MV_STR;
		rt.str = *rtn;
		op_zlink(&rt, NULL);
		rt_hdr = find_rtn_hdr(rtn);
		if (NULL == rt_hdr)
			rts_error_csa(CSA_ARG(NULL) VARLSTCNT(8) ERR_ZLINKFILE, 2, rtn->len, rtn->addr,
				      ERR_ZLMODULE, 2, STRLEN(&zlink_mname.c[0]), &zlink_mname);
		*need_rtnobj_shm_free = ARLINK_ONLY(rt_hdr->shared_object) NON_ARLINK_ONLY(FALSE);
		*hdr = (char *)rt_hdr;
	} else
		*need_rtnobj_shm_free = FALSE;
	lp = NULL;
	if ((rt_hdr->compiler_qlf & CQ_LINE_ENTRY) || (0 == offset))
		/* Label offset with routine compiled with NOLINE_ENTRY should cause error. */
		lp = find_line_addr(rt_hdr, label, offset, NULL);
	if (!lp)
		return (FALSE);
	/* Set the pointer to address / offset for line number entry storage in TABENT_PROXY. */
#	ifdef USHBIN_SUPPORTED
	ARLINK_ONLY((TABENT_PROXY).rtnhdr_adr = rt_hdr);
	(TABENT_PROXY).lnr_adr = lp;
#	else
	/* 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 TABENT_PROXY structure.
	 */
	(TABENT_PROXY).lab_ln_ptr = ((int4)lp - (int4)rt_hdr);
#	endif
	if (NULL != labaddr)
		*labaddr = (char *)LINE_NUMBER_ADDR(rt_hdr, lp);
	*hdr = (char *)rt_hdr;
	return (TRUE);
}
Пример #3
0
void job_addr(mstr *rtn, mstr *label, int4 offset, char **hdr, char **labaddr)
{
	rhdtyp		*rt_hdr;
	int4		*lp;
	mval		rt;
	DCL_THREADGBL_ACCESS;

	SETUP_THREADGBL_ACCESS;
	if (NULL == (rt_hdr = find_rtn_hdr(rtn)))
	{
		rt.mvtype = MV_STR;
		rt.str = *rtn;
		op_zlink(&rt, NULL);
		assertpro(NULL != (rt_hdr = find_rtn_hdr(rtn)));
	}
	lp = NULL;
	if ((rt_hdr->compiler_qlf & CQ_LINE_ENTRY) || (0 == offset))
		/* Label offset with routine compiled with NOLINE_ENTRY should cause error. */
		lp = find_line_addr(rt_hdr, label, offset, NULL);
	if (!lp)
		rts_error(VARLSTCNT(1) ERR_JOBLABOFF);
	/* Set the pointer to address / offset for line number entry storage in lab_proxy. */
	USHBIN_ONLY((TREF(lab_proxy)).lnr_adr = lp;)
Пример #4
0
void job_addr(mstr *rtn, mstr *label, int4 offset, char **hdr, char **labaddr)
{
	rhdtyp		*rt_hdr;
	int4		*lp;
	error_def	(ERR_JOBLABOFF);

	if ((rt_hdr = find_rtn_hdr(rtn)) == 0)
	{
		mval rt;

		rt.mvtype = MV_STR;
		rt.str = *rtn;
		op_zlink(&rt,0);
		if ((rt_hdr = find_rtn_hdr (rtn)) == 0)
			GTMASSERT;
	}
	lp = NULL;
	if (!rt_hdr->label_only || 0 == offset)  /* If label_only and offset != 0 should cause error */
		lp = find_line_addr (rt_hdr, label, offset);
	if (!lp)
		rts_error(VARLSTCNT(1) ERR_JOBLABOFF);
	*labaddr = (char *) LINE_NUMBER_ADDR(rt_hdr, lp);
	*hdr = (char *)rt_hdr;
}