30 byval sym
as FBSYMBOL
ptr _
34 byval sym
as FBSYMBOL
ptr _
38 byref dtype
as integer _
42 byval sym
as FBSYMBOL
ptr _
47 byval sym
as FBSYMBOL
ptr, _
48 byval do_array_typing
as integer =
FALSE _
55 dim shared remapTB(0
to FB_DATATYPES-1)
as integer = _
78 dim shared stabsTb(0
to 14)
as const zstring ptr = _
89 @
"ulongint:t10=-32", _
92 @
"string:t13=s12data:15,0,32;len:1,32,32;size:1,64,32;;", _
104 assert( fbCpuTypeIs64bit( ) =
FALSE )
110 byval _type
as integer, _
111 byval _string
as const zstring ptr, _
112 byval _other
as integer = 0, _
113 byval _desc
as integer = 0, _
114 byval _value
as const zstring ptr = @
"0" _
119 ostr =
".stabs " + QUOTE
124 ostr +=
str( _other )
137 byval _type
as integer, _
138 byval _other
as integer = 0, _
139 byval _desc
as integer = 0, _
140 byval _value
as const zstring ptr _
141 )
as zstring ptr static
143 static as string ostr
148 ostr +=
str( _other )
154 function =
strptr( ostr )
161 byval _type
as integer, _
162 byval _other
as integer = 0, _
163 byval _desc
as integer = 0, _
164 byval _value
as const zstring ptr = @
"0" _
175 byval _type
as integer, _
176 byval _other
as integer = 0, _
177 byval _desc
as integer = 0 _
185 ostr +=
str( _other )
196 byval label as zstring ptr _
210 if( env.clopt.debug =
FALSE )
then
232 emitSECTION( IR_SECTION_CODE, 0 )
250 if( env.clopt.debug =
FALSE )
then
254 emitSECTION( IR_SECTION_CODE, 0 )
267 byval proc as FBSYMBOL
ptr, _
268 byval lnum as integer, _
269 byval pos_
as integer _
272 if( env.clopt.debug =
FALSE )
then
297 byval proc as FBSYMBOL
ptr, _
298 byval lnum as integer, _
299 byval pos_
as integer _
302 if( env.clopt.debug =
FALSE )
then
320 byval proc as FBSYMBOL
ptr, _
321 byval lnum as integer, _
322 byval label as FBSYMBOL
ptr _
327 if( env.clopt.debug =
FALSE )
then
350 byval proc as FBSYMBOL
ptr, _
351 byval lnum as integer, _
352 byval label as FBSYMBOL
ptr _
355 if( env.clopt.debug =
FALSE )
then
369 byval s
as FBSYMBOL
ptr _
374 if( env.clopt.debug =
FALSE )
then
378 s->scp.dbg.iniline = lexLineNum( )
386 byval s
as FBSYMBOL
ptr _
391 if( env.clopt.debug =
FALSE )
then
395 s->scp.dbg.endline = lexLineNum( )
403 byval s
as FBSYMBOL
ptr _
406 if( env.clopt.debug =
FALSE )
then
417 byval s
as FBSYMBOL
ptr _
420 if( env.clopt.debug =
FALSE )
then
431 byval proc as FBSYMBOL
ptr _
436 proc->
proc.ext->dbg.iniline = lexLineNum( )
443 byval proc as FBSYMBOL
ptr _
448 proc->
proc.ext->dbg.endline = lexLineNum( )
455 byval proc as FBSYMBOL
ptr _
466 dim as FBSYMBOL
ptr s = symbGetProcSymbTbHead(
proc )
468 if (symbIsVar(s))
then
470 if (symbIsParam(s))
then
481 byval proc as FBSYMBOL
ptr _
484 dim as string desc, procname
486 if( env.clopt.debug =
FALSE )
then
496 if( symbGetIsMainProc(
proc ) )
then
509 proc->
proc.ext->dbg.endline = lexLineNum( )
519 if( symbIsPublic(
proc ) )
then
542 byval proc as FBSYMBOL
ptr, _
543 byval blk
as FBSYMBOL
ptr, _
544 byval inilabel
as FBSYMBOL
ptr, _
545 byval endlabel
as FBSYMBOL
ptr _
548 dim as FBSYMBOL
ptr shead, s
549 static as integer scopecnt
552 if( symbIsProc( blk ) )
then
553 shead = symbGetProcSymbTbHead( blk )
557 shead = symbGetScopeSymbTbHead( blk )
563 do while( s <>
NULL )
565 select case symbGetClass( s )
567 case FB_SYMBCLASS_VAR
570 if( (symbGetAttrib( s )
and _
571 (FB_SYMBATTRIB_PARAMBYDESC
or _
572 FB_SYMBATTRIB_PARAMBYVAL
or _
573 FB_SYMBATTRIB_PARAMBYREF
or _
574 FB_SYMBATTRIB_TEMP
or _
575 FB_SYMBATTRIB_DESCRIPTOR
or _
576 FB_SYMBATTRIB_FUNCRESULT)) = 0 )
then
579 if( symbGetIsImplicit( s ) =
FALSE )
then
585 case FB_SYMBCLASS_SCOPE
598 if( scopecnt > 0 )
then
601 do while( s <>
NULL )
602 if( symbIsScope( s ) )
then
620 byval proc as FBSYMBOL
ptr, _
621 byval initlabel
as FBSYMBOL
ptr, _
622 byval exitlabel
as FBSYMBOL
ptr _
625 dim as string procname, lname
627 if( env.clopt.debug =
FALSE )
then
641 hEmitSTABS( STAB_TYPE_FUN,
"", 0, 0, lname +
"-" + procname )
653 byval fld
as FBSYMBOL
ptr, _
654 byval stypeopt
as zstring ptr =
NULL, _
655 byval idprefix
as zstring ptr =
NULL, _
656 byval baseoffset
as integer = 0 _
660 dim as integer dtype =
any
666 desc += *symbGetName( fld )
669 dtype = symbGetType( fld )
670 if( typeIsPtr( dtype ) )
then
674 if( stypeopt =
NULL )
then
680 desc +=
"," +
str( (baseoffset + symbGetOfs( fld )) * 8 )
681 desc +=
"," +
str( symbGetLen( fld ) * 8 )
688 dim as string desc, dimdesc
689 dim as FBVARDIM
ptr d =
any
690 dim as integer baseoffset =
any, i =
any
691 dim as FBSYMBOL
ptr fld =
any
694 desc =
str(
ctx.
typecnt ) +
"=s" +
str( symbGetLen( symb.fbarray ) )
725 baseoffset = symbGetOfs( fld )
727 d = symbGetArrayFirstDim( sym )
729 dimdesc =
"dim" +
str( i ) +
"_"
745 baseoffset += symbGetLen( symb.fbarraydim )
762 byref dtype
as integer _
768 do while( typeIsPtr( dtype ) )
769 dtype = typeDeref( dtype )
781 byval sym
as FBSYMBOL
ptr _
784 dim as FBVARDIM
ptr d
790 d = symbGetArrayFirstDim( sym )
791 do while( d <>
NULL )
793 desc +=
str( d->lower ) +
";"
794 desc +=
str( d->upper ) +
";"
805 byval sym
as FBSYMBOL
ptr, _
806 byval do_array_typing
as integer _
810 dim as FBSYMBOL
ptr subtype
813 if( sym =
NULL )
then
814 return str(
remapTB(FB_DATATYPE_VOID) )
818 if( do_array_typing =
FALSE )
then
821 if( symbIsDynamic( sym )
or symbIsParamByDesc( sym ) )
then
833 dtype = symbGetType( sym )
834 subtype = symbGetSubtype( sym )
836 if( do_array_typing )
then
837 dtype = typeAddrOf( dtype )
841 if( typeIsPtr( dtype ) )
then
846 dtype = typeUnsetIsConst( dtype )
848 select case as const dtype
850 case FB_DATATYPE_STRUCT
851 if( symbIsDescriptor( sym ) =
FALSE )
then
852 if( subtype->udt.dbg.typenum = INVALID )
then
856 desc +=
str( subtype->udt.dbg.typenum )
860 case FB_DATATYPE_ENUM
861 if( subtype->enum_.dbg.typenum = INVALID )
then
865 desc +=
str( subtype->enum_.dbg.typenum )
868 case FB_DATATYPE_FUNCTION
874 case FB_DATATYPE_FWDREF
875 desc +=
str(
remapTB(FB_DATATYPE_VOID) )
878 case FB_DATATYPE_BITFIELD
892 dim as FBSYMBOL
ptr fld =
any
900 desc +=
":Tt" +
str( sym->udt.dbg.typenum ) +
"=s" +
str( symbGetLen( sym ) )
905 desc +=
"," +
str( symbGetUDTElmBitOfs( fld ) )
906 desc +=
"," +
str( symbGetUDTElmBitLen( fld ) )
919 byval sym
as FBSYMBOL
ptr _
922 dim as FBSYMBOL
ptr e
930 desc +=
":T" +
str( sym->enum_.dbg.typenum ) +
"=e"
932 e = symbGetENUMFirstElm( sym )
933 do while( e <>
NULL )
934 desc += *symbGetName( e ) +
":" +
str( symbGetConstInt( e ) ) +
","
936 e = symbGetENUMNextElm( e )
948 byval sym
as FBSYMBOL
ptr, _
949 byval section
as integer _
952 dim as integer t, attrib
954 dim as zstring ptr sname
956 if( env.clopt.debug =
FALSE )
then
961 if( symbIsTemp( sym ) )
then
966 if( symbIsLocal( sym ) )
then
972 case IR_SECTION_CONST
983 attrib = symbGetAttrib( sym )
984 if( (attrib
and (FB_SYMBATTRIB_PUBLIC
or FB_SYMBATTRIB_COMMON)) > 0 )
then
986 elseif( (attrib
and FB_SYMBATTRIB_STATIC) > 0 )
then
999 if(
right(desc, 2) =
":S" )
then
1005 if( symbIsDynamic( sym ) )
then
1019 byval sym
as FBSYMBOL
ptr, _
1020 byval isstatic
as integer _
1024 dim as string desc, value
1026 if( env.clopt.debug =
FALSE )
then
1030 desc = *symbGetName( sym )
1035 if( symbGetIsAccessed( sym ) =
FALSE )
then
1040 if( symbGetIsInitialized( sym ) )
then
1048 if( symbIsDynamic( sym ) )
then
1058 if( symbIsDynamic( sym ) )
then
1059 value =
str( symbGetOfs( symbGetArrayDescriptor( sym ) ) )
1061 value =
str( symbGetOfs( sym ) )
1076 byval sym
as FBSYMBOL
ptr _
1081 if( env.clopt.debug =
FALSE )
then
1085 desc = *symbGetName( sym ) +
":"
1087 if( symbIsParamByVal( sym ) )
then
1090 elseif( symbIsParamByRef( sym ) )
then
1093 elseif( symbIsParamByDesc( sym ) )
then
1101 hEmitSTABS( STAB_TYPE_PSYM, desc, 0, 0,
str( symbGetOfs( sym ) ) )
1127 emitSECTION( IR_SECTION_CODE, 0 )
1139 emitSECTION( IR_SECTION_CODE, 0 )