• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ Puthex函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中Puthex函数的典型用法代码示例。如果您正苦于以下问题:C++ Puthex函数的具体用法?C++ Puthex怎么用?C++ Puthex使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了Puthex函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: bit_field_class

/*
 * bit_field_class - dump info
 */
static void bit_field_class( unsigned_8 *buff, bool bit )
/*******************************************************/
{
    unsigned_8  *ptr;
    unsigned_16 index;
    char        name[256];

    ptr = buff+3;
    Wdputs( "          field locator = " );
    ptr = Dump_location_expression( ptr, "            " );
    if( bit ) {
        ptr += 2;
    }
    ptr = Get_type_index( ptr, &index );
    Get_local_name( name, ptr, buff );
    Wdputs( "          name = \"" );
    Wdputs( name );
    Wdputs( "\"  type idx = " );
    Putdec( index );
    Wdputslc( "\n          attribute = " );
    attribute_byte( buff[2] );
    if( bit ) {
        Wdputslc( "  start bit = " );
        ptr++;
        Puthex( *ptr, 2 );
        Wdputslc( "  bit size = " );
        ptr++;
        Puthex( *ptr, 2 );
    }
    Wdputslc( "\n" );
}
开发者ID:Azarien,项目名称:open-watcom-v2,代码行数:34,代码来源:typewv.c


示例2: dmp_cmd_list

/*
 * Dump the Mach-O command list.
 */
static void dmp_cmd_list( unsigned_32 start, int n )
{
    int                         i;
    unsigned_32                 offset;
    uint32_t                    cmd, cmdsize;
    struct segment_command      seg;

    offset = start + sizeof( struct mach_header );
    for( i = 0; i < n; ++i ) {
        Wlseek( offset );
        Wread( &cmd, sizeof( cmd ) );
        Wread( &cmdsize, sizeof( cmdsize ) );
        Wlseek( offset );

        switch( cmd ) {
        case LC_SEGMENT:
            Wread( &seg, sizeof( seg ) );
            Dump_header( &seg, m_segment_msg );
            break;
        default:
            Wdputs( "\ncmd       = " );
            Puthex( cmd, 8 );
            Wdputs( "H\ncmdsize   = " );
            Puthex( cmdsize, 8 );
            Wdputs( "H" );
        }
        Wdputslc( "\n" );
        offset += cmdsize;
        Wlseek( offset );
    }
}
开发者ID:bhanug,项目名称:open-watcom-v2,代码行数:34,代码来源:machoexe.c


示例3: Dmp_hll_head

/*
 * Dmp_hll_head - dump IBM HLL or MS CodeView debugging information
 */
bool Dmp_hll_head( void )
/**********************/
{
    off_t           end_off;
    off_t           dbg_off;
    hll_trailer     trailer;

    end_off = lseek( Handle, 0, SEEK_END );
    Wlseek( end_off - sizeof( trailer ) );
    Wread( &trailer, sizeof( trailer ) );
    dbg_off = end_off - trailer.offset;
    if( memcmp( trailer.sig, HLL_NB04, HLL_SIG_SIZE ) == 0 ) {
        Banner( "HLL NB04 debugging information" );
        Wdputs( "debugging information base  = " );
        Puthex( dbg_off, 8 );
        Wdputslc( "H\n" );
        Wdputs( "subsection directory offset = " );
        Puthex( trailer.offset, 8 );
        Wdputslc( "H\n\n" );
        dump_hll( dbg_off );
        return( true );
    } else if( memcmp( trailer.sig, HLL_NB02, HLL_SIG_SIZE ) == 0 ) {
        Banner( "CodeView NB02 debugging information" );
        Wdputs( "debugging information base  = " );
        Puthex( dbg_off, 8 );
        Wdputslc( "H\n" );
        Wdputs( "subsection directory offset = " );
        Puthex( trailer.offset, 8 );
        Wdputslc( "H\n\n" );
        dump_cv( dbg_off );
        return( true );
    }
    return( false );
} /* Dmp_hll_head */
开发者ID:Azarien,项目名称:open-watcom-v2,代码行数:37,代码来源:dumphll.c


示例4: dmp_resrc_tab_os2

/*
 * Dump The Resource Table for OS/2 NE module
 */
static void dmp_resrc_tab_os2( void )
/***********************************/
{
    unsigned_16     i;
    unsigned_16     id;
    os2_res_entry   res_tab;

    id = 30;                /* if id > 22 a name won't be printed out */
    Wdputslc( "    seg#   type id   name id\n" );
    Wdputslc( "    ====   =======   =======\n" );
    for( i = 0; i < Os2_head.resource; i++ ) {
        Wread( &res_tab, sizeof( os2_res_entry ) );
        if( res_tab.type_id != id ) {
            id = res_tab.type_id;
            if( id < 23 ) {
                Wdputs( "type:  " );
                Wdputslc( resource_type_os2[ res_tab.type_id ] );
            }
        }
        Wdputs( "    " );
        Puthex( i + Os2_head.segments - Os2_head.resource + 1, 4 );
        Wdputs( "   " );
        Puthex( res_tab.type_id, 4 );
        Wdputs( "      " );
        Puthex( res_tab.name_id, 4 );
        Wdputs( "      " );
        Wdputslc( "\n" );
    }
    Wdputslc( "\n" );
}
开发者ID:Ukusbobra,项目名称:open-watcom-v2,代码行数:33,代码来源:wdres.c


示例5: bit_field_struct

/*
 * bit_field_struct - dump info
 */
static void bit_field_struct( unsigned_8 *buff, unsigned_8 size, bool bit )
/*************************************************************************/
{
    unsigned_8  *ptr;
    unsigned_16 index;
    char        name[256];

    ptr = buff+2+size;
    if( bit ) {
        ptr += 2;
    }
    ptr = Get_type_index( ptr, &index );
    Get_local_name( name, ptr, buff );
    Wdputs( "          \"" );
    Wdputs( name );
    Wdputs( "\"  offset = " );
    ptr = buff+2;
    Puthex( *ptr, 2*size );
    Wdputs( "  type idx = " );
    Putdec( index );
    if( bit ) {
        Wdputslc( "\n        start bit = " );
        ptr++;
        Puthex( *ptr, 2 );
        Wdputslc( "  bit size = " );
        ptr++;
        Puthex( *ptr, 2 );
    }
    Wdputslc( "\n" );
}
开发者ID:Azarien,项目名称:open-watcom-v2,代码行数:33,代码来源:typewv.c


示例6: desc_array

/*
 * desc_array - dump info
 */
static void desc_array( unsigned_8 *ptr, bool is386 )
/***************************************************/
{
    addr32_ptr  *p32;
    addr48_ptr  *p48;

    Wdputs( "          scalar type 1 = " );
    scalar_type( ptr[0] );
    Wdputs( "  scalar type 2 = " );
    scalar_type( ptr[1] );
    ptr += 2;
    Wdputslc( "\n          addr = " );
    if( is386 ) {
        p48 = (addr48_ptr *)ptr;
        ptr += sizeof(addr48_ptr);
        Puthex( p48->segment, 4 );
        Wdputc( ':' );
        Puthex( p48->offset, 8 );
    } else {
        p32 = (addr32_ptr *)ptr;
        ptr += sizeof(addr32_ptr);
        Puthex( p32->segment, 4 );
        Wdputc( ':' );
        Puthex( p32->offset, 4 );
    }
    base_type_index( ptr );

} /* desc_array */
开发者ID:Azarien,项目名称:open-watcom-v2,代码行数:31,代码来源:typewv.c


示例7: dmp_resrc

/*
 * Dump resources.
 */
static void dmp_resrc( unsigned_16 size, unsigned_32 offset )
/***********************************************************/
{
    unsigned_16     i;
    lmf_resource    resrc;

    Wdputslc( "\n" );
    Banner( "Resource Table" );
    Wread( &resrc, sizeof( lmf_resource ) );
    Wdputs( "resource type (0==usage) = " );
    Puthex( resrc.res_type, 4 );
    Wdputslc( "H\n" );
    Wdputs( "zeros                    = " );
    for( i = 0; i < 3; i++ ) {              // 3 spares (zeros)
        Puthex( resrc.spare[i], 4 );
        Wdputs( "H   " );
    }
    Wdputslc( "\n" );
    size -= sizeof( lmf_resource );
    Wdputs( "size                     = " );
    Puthex( size, 4 );
    Wdputslc( "H\n" );
    offset += sizeof( lmf_resource );
    if( Options_dmp & RESRC_DMP ) {
        Dmp_seg_data( offset, size );
    }
}
开发者ID:Ukusbobra,项目名称:open-watcom-v2,代码行数:30,代码来源:qnxexe.c


示例8: dump_state

static void dump_state( state_info *state )
/*****************************************/
{
    Wdputs( "-- file " );
    Putdec( state->file );
    Wdputs( " addr  " );
    if( state->segment != 0 ) {
        Puthex( state->segment, 4 );
        Wdputs( ":" );
    }
    Puthex( state->address, 8 );
    Wdputs( " line " );
    Putdec( state->line );
    Wdputs( " column " );
    Putdec( state->column );
    if( state->is_stmt ) {
        Wdputs( " is_stmt" );
    }
    if( state->basic_block ) {
        Wdputs( " basic_block" );
    }
    if( state->end_sequence ) {
        Wdputs( " end_sequence" );
    }
    Wdputslc( "\n" );
}
开发者ID:ABratovic,项目名称:open-watcom-v2,代码行数:26,代码来源:wline.c


示例9: DmpLocList

static void DmpLocList( uint_32 start, uint addr_size )
/*****************************************************/
{
    uint_32         low;
    uint_32         high;
    int             len;
    uint_8 const    *p;
    uint_8 const    *stop;

    p = Sections[ DW_DEBUG_LOC ].data;
    stop = p + Sections[ DW_DEBUG_LOC ].max_offset;
    if( p == NULL ) {
        Wdputslc( "Error: No location list section\n" );
        return;
    }
    p += start;
    while( p < stop ) {
        p = GetInt( p, &low, addr_size );
        p = GetInt( p, &high, addr_size );
        if( low == high && low == 0 ) {
            Wdputslc( "        <end>\n" );
            return;
        }
        len = get_u16( (uint_16 *)p );
        p+= sizeof( uint_16 );
        Wdputslc( "\n         Range: " );
        Puthex( low, addr_size * 2 );
        Wdputs( ":" );
        Puthex( high, addr_size * 2 );
        Wdputslc( "\n" );
        DmpLoc( p, len, addr_size );
        p += len;
    }
}
开发者ID:Azarien,项目名称:open-watcom-v2,代码行数:34,代码来源:wsect.c


示例10: dmp_type_offset

/*
 * Dump the type and offsets.
 */
static void dmp_type_offset( unsigned_32 bsize )
/**********************************************/
{
    unsigned_32             i;
    unsigned                prev;
    pe_fixup_entry          entry;

    Wdputslc( "type:offset               type --\n" );
    Wdputslc( "0 = ABSOLUTE, 1 = LOW, 2 = HIGH, 3 = HIGHLOW, 4 = HIGHADJUST, 5 = MIPSJMPADDR\n" );
    prev = 0;
    for( i = 0; i < bsize; i++ ) {
        Wread( &entry, sizeof( pe_fixup_entry ) );
        if( i != 0 ) {
            if( (i) % 8 == 0 ) {
                Wdputslc( "\n" );
            } else {
                Wdputs( "     " );
            }
        }
        if( prev == 4 ) {
            Wdputc( ' ' );
            Puthex( entry, 4 );
            prev = 0;
        } else {
            prev = entry >> 12;
            Puthex( prev, 1 );
            Wdputc( ':' );
            Puthex( entry, 3 );
        }
    }
    Wdputslc( "\n" );
}
开发者ID:ABratovic,项目名称:open-watcom-v2,代码行数:35,代码来源:wperes.c


示例11: dmp_res_data

/*
 * Dump the Resource Data.
 */
static void dmp_res_data( void )
/******************************/
{
    resource_entry          res_data;
    unsigned_16             i;

    Wdputslc( "\n" );
    Wdputslc( "       data rva     data size    codepage     reserved\n" );
    Wdputslc( "       ========     ========     ========     ========\n" );
    Wlseek( Data_off );
    for( i = 0; ; i++ ) {
        Wread( &res_data, sizeof( resource_entry ) );
        if( res_data.rsvd != 0 ) break;
        Putdecl( i, 3 );
        Wdputs( ":   " );
        Puthex( res_data.data_rva, 8 );
        Wdputs( "     " );
        Puthex( res_data.size, 8 );
        Wdputs( "     " );
        Puthex( res_data.code_page, 8 );
        Wdputs( "     " );
        Puthex( res_data.rsvd, 8 );
        Wdputslc( "\n" );
    }
}
开发者ID:ABratovic,项目名称:open-watcom-v2,代码行数:28,代码来源:wperes.c


示例12: dmp_res_dir

/*
 * Dump the Resource Directory.
 */
static void dmp_res_dir( void )
/*****************************/
{
    resource_dir_header     res_head;
    resource_dir_entry      res_dir;
    unsigned_16             count, i;

    Wdputslc( "\n" );
    Wdputslc( "80000000H = name rva,        else integer id\n" );
    Wdputslc( "80000000H = sudirectory rva, else data entry rva\n" );
    Wdputslc( "  #id ents    #name ents    name rva/id    data/subdir rva\n" );
    Wdputslc( "    ====         ====         ========        ========\n" );
    Wlseek( Res_off );
    for( ;; ) {
        Wread( &res_head, sizeof( resource_dir_header ) );
        count = res_head.num_name_entries + res_head.num_id_entries;
        if( count == 0 ) break;
        Wdputs( "    " );
        Puthex( res_head.num_id_entries, 4 );
        Wdputs( "         " );
        Puthex( res_head.num_name_entries, 4 );
        Wdputs( "         " );
        for( i = 0; i < count; i++ ) {
            Wread( &res_dir, sizeof( resource_dir_entry ) );
            if( i != 0 ) {
                Wdputs( "                              " );
            }
            Puthex( res_dir.id_name, 8 );
            Wdputs( "        " );
            Puthex( res_dir.entry_rva, 8 );
            Wdputslc( "\n" );
        }
    }
}
开发者ID:ABratovic,项目名称:open-watcom-v2,代码行数:37,代码来源:wperes.c


示例13: dmp_resrc_desc

/*
 * dump a resource description
 */
static void dmp_resrc_desc( struct resource_record * res_ent )
/************************************************************/
{
    unsigned_32                   res_off;
    unsigned_32                   res_len;
    unsigned_32                   res_end;

    dmp_resrc_nam( res_ent->name );
    Wdputs( " file offset " );
    res_off = (unsigned_32)res_ent->offset
        << Resrc_shift_cnt;
    Puthex( res_off, 8 );
    Wdputs( "H len " );
    res_len = (unsigned_32)res_ent->length
        << Resrc_shift_cnt;
    Puthex( res_len, 8 );
    Wdputs( " flag " );
    dmp_resrc_flag( res_ent->flags );
    Wdputslc( "\n" );
    if( Options_dmp & RESRC_DMP ) {
        Wdputslc( "    data =\n" );
        Dmp_seg_data( res_off, res_len );
    }
    res_end = res_off + res_len;
    if( res_end > Resrc_end ) {
        Resrc_end = res_end;
    }
}
开发者ID:Ukusbobra,项目名称:open-watcom-v2,代码行数:31,代码来源:wdres.c


示例14: range

/*
 * range - dump info
 */
static void range( unsigned_8 *ptr, unsigned_8 size )
/***************************************************/
{
    Wdputs( "          low bound = " );
    Puthex( *ptr, 2*size );
    Wdputs( "   high bound = " );
    ptr += size;
    Puthex( *ptr, 2*size );
    ptr += size;
    base_type_index( ptr );
}
开发者ID:Azarien,项目名称:open-watcom-v2,代码行数:14,代码来源:typewv.c


示例15: dump_aranges

static void dump_aranges( const uint_8 *p, uint length )
/******************************************************/
{
    const uint_8    *end;
    const uint_8    *unit_end;
    uint_32         unit_length;
    uint_32         dbg_offset;
    uint_32         addr;
    uint_32         seg;
    uint_32         len;
    int             addr_size;
    int             seg_size;

    end = &p[length];
    addr_size = 0;
    while( p  < end ) {
        unit_length = get_u32( (uint_32 *)p );
        unit_end = &p[unit_length + sizeof( uint_32 )];
        Wdputs( "Length: " );
        Puthex( unit_length, 8 );
        Wdputslc( "\nVersion: " );
        Puthex( get_u16( (uint_16 *)(p + 4) ), 4 );
        Wdputslc( "\nDbg Info: " );
        dbg_offset = get_u32( (uint_32 *)(p + 6) );
        Puthex( dbg_offset, 8 );
        addr_size = *(p + 10);
        Wdputslc( "\nAddress Size " );
        Puthex( addr_size, 2 );
        seg_size = *(p + 11);
        Wdputslc( "\nSegment Size " );
        Puthex( seg_size, 2 );
        Wdputslc( "\n" );
        p += 12;
        Wdputslc( "    Address       Length\n" );
        while( p < unit_end ) {
            p = GetInt( p, &addr, addr_size );
            p = GetInt( p, &seg, seg_size );
            p = GetInt( p, &len, addr_size );
            if( addr == 0 && seg == 0 && len == 0 )
                break;
            Wdputs( "    " );
            if( seg_size != 0 ) {
                Puthex( seg, seg_size * 2 );
                Wdputs( ":" );
                Puthex( addr, addr_size * 2 );
            } else {
                Puthex( addr, addr_size * 2 );
                Wdputs( "     " );
            }
            Wdputs( " " );
            Puthex( len, addr_size * 2 );
            Wdputslc( "\n" );
        }
        p = unit_end;
    }
}
开发者ID:Azarien,项目名称:open-watcom-v2,代码行数:56,代码来源:wsect.c


示例16: dmp_rw_end

/*
 * Dump rw end.
 */
static void dmp_rw_end( void )
/****************************/
{
    lmf_rw_end      rw_end;

    Wdputslc( "\n" );
    Banner( "Read/Write end" );
    Wread( &rw_end, sizeof( lmf_rw_end ) );
    Wdputs( "verify = " );
    Puthex( rw_end.verify, 4 );
    Wdputs( "H     signature = " );
    Puthex( rw_end.signature, 8 );
    Wdputslc( "H\n" );
}
开发者ID:Ukusbobra,项目名称:open-watcom-v2,代码行数:17,代码来源:qnxexe.c


示例17: Dmp_coff_head

/*
 * Dump the coff object, if any.
 */
bool Dmp_coff_head( void )
/************************/
{
    coff_file_header    header;

    Wlseek( Coff_off );
    Wread( &header, sizeof( coff_file_header ) );
    if( header.cpu_type != IMAGE_FILE_MACHINE_I386
        && header.cpu_type != IMAGE_FILE_MACHINE_ALPHA
        && header.cpu_type != IMAGE_FILE_MACHINE_UNKNOWN
        && header.cpu_type != IMAGE_FILE_MACHINE_POWERPC ) {
        return 0;
    }
    Banner( "COFF object file" );
    Wdputs( "file offset = " );
    Puthex( Coff_off, 8 );
    Wdputslc( "H\n" );
    Wdputslc( "\n" );
    Dump_header( (char *)&header, coff_hdr_msg );
    DumpCoffHdrFlags( header.flags );
    load_string_table( &header );
    Wlseek( Coff_off + sizeof(coff_file_header) + header.opt_hdr_size );
    dmp_objects( header.num_sections );
    unload_string_table();
    dmp_symtab( header.sym_table, header.num_symbols );
    return 1;
}
开发者ID:ABratovic,项目名称:open-watcom-v2,代码行数:30,代码来源:coff.c


示例18: Dump_section

/*
 * dump_section - dump the current section
 */
void Dump_section( void )
/***********************/
{
    section_dbg_header  sdh;

    Wread( &sdh, sizeof( section_dbg_header ) );
    Wdputs( "Section " );
    Putdec( sdh.section_id );
    Wdputs( " (off=" );
    Puthex( Curr_sectoff, 8 );
    Wdputslc( ")\n" );
    Wdputslc( "=========================\n" );
    Dump_header( (char *)&sdh.mod_offset, sdh_msg );
    Wdputslc( "\n" );
    currSect = sdh.section_id;

    if( Debug_options & MODULE_INFO ) {
        dump_module_info( &sdh );
    }
    if( Debug_options & GLOBAL_INFO ) {
        dump_global_info( &sdh );
    }
    if( Debug_options & ADDR_INFO ) {
        dump_addr_info( &sdh );
    }
} /* dump_section */
开发者ID:NoSuchProcess,项目名称:open-watcom-v2,代码行数:29,代码来源:dumpwv.c


示例19: dmp_seg

/*
 * Dump segments.
 */
static void dmp_seg( unsigned_16 size )
/*************************************/
{
    unsigned_16     i;
    unsigned_32     seg;

    if( !size ) {
        return;
    }
    Wdputslc( "segments = type:size\n" );
    Wdputslc( "type  0==read/write, 1==read-only, 2==execute/read, 3==execute-only\n" );
    for( i = 0; i < size; i++ ) {
        if( i != 0 ) {
            if( i % 6 == 0 ) {
                Wdputslc( "\n" );
            } else {
                Wdputs( "    " );
            }
        }
        Wread( &seg, sizeof( unsigned_32 ) );
        Puthex( seg >> 28, 1 );
        Wdputc( ':' );
        Puthex( seg, 7 );
    }
    Wdputslc( "\n" );
}
开发者ID:Ukusbobra,项目名称:open-watcom-v2,代码行数:29,代码来源:qnxexe.c


示例20: array_index

/*
 * array_index - dump info
 */
static void array_index( unsigned_8 *ptr, unsigned_8 size )
/*********************************************************/
{
    Wdputs( "          high bound = " );
    Puthex( *ptr, 2*size );
    base_type_index( ptr+size );
}
开发者ID:Azarien,项目名称:open-watcom-v2,代码行数:10,代码来源:typewv.c



注:本文中的Puthex函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ PxVec3函数代码示例发布时间:2022-05-30
下一篇:
C++ Putc函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap