static void TestString( void ) { dw_loc_handle string_length; dw_handle string_hdl; dw_loc_handle a_loc; dw_loc_id id; /* type InputBuffer = String( 512 ); -- I forget exact Ada syntax */ DWDeclPos( Client, 50, 1 ); DWString( Client, NULL, 512, "InputBuffer", 0, 0 ); /* CHARACTER*(*) A */ /* we'll pretend the length of the string is at -4[ebp] */ DWDeclPos( Client, 50, 8 ); id = DWLocInit( Client ); DWLocOp( Client, id, DW_LOC_fbreg, -4 ); string_length = DWLocFini( Client, id ); string_hdl = DWString( Client, string_length, sizeof( uint_32 ), NULL, 0, 0 ); DWLocTrash( Client, string_length ); id = DWLocInit( Client ); DWLocOp( Client, id, DW_LOC_fbreg, -8 ); a_loc = DWLocFini( Client, id ); DWDeclPos( Client, 50, 16 ); DWVariable( Client, string_hdl, a_loc, 0, NULL, "A", 0, 0 ); DWLocTrash( Client, a_loc ); }
static dw_handle BIGetType( sym_id ste_ptr ) { //============================================ // Get the Symbol's NON COMPOUND DWARF TYPE, TYPE typ = ste_ptr->u.ns.u1.s.typ; dw_handle ret = 0; switch( typ ) { case( FT_LOGICAL_1 ): case( FT_LOGICAL ): case( FT_INTEGER_1 ): case( FT_INTEGER_2 ): case( FT_INTEGER ): case( FT_HEX ): case( FT_REAL ): case( FT_DOUBLE ): case( FT_TRUE_EXTENDED ): case( FT_COMPLEX ): case( FT_DCOMPLEX ): case( FT_TRUE_XCOMPLEX ): ret = baseTypes[ typ ]; break; case( FT_CHAR ): ret = DWString(cBIId, 0, ste_ptr->u.ns.xt.size, "", 0, 0); break; case( FT_UNION ): ret = BIGetUnionType( ste_ptr ); break; case( FT_STRUCTURE ): ret = BIGetStructType( ste_ptr, 0 ); break; } DWDeclPos( cBIId, CurrFile->rec, 0 ); return( ret ); }