Example #1
0
void InitDebugPubnames(
    dw_client                   cli )
{
    static uint_16  const version = 2;

    /* write the set header */
    CLISeek( DW_DEBUG_PUBNAMES, sizeof( uint_32 ), DW_SEEK_CUR );
    CLIWrite( DW_DEBUG_PUBNAMES, &version, sizeof( version ) );
    CLIReloc3( DW_DEBUG_PUBNAMES, DW_W_SECTION_POS, DW_DEBUG_INFO );
    CLIReloc2( DW_DEBUG_PUBNAMES, DW_W_UNIT_SIZE );
}
Example #2
0
void DWLineAddr(  dw_client  cli, dw_sym_handle sym, dw_addr_offset addr )
{
    uint_8                      buf[1 + MAX_LEB128 + sizeof( dw_targ_addr )];
    uint_8                      *end;

    buf[ 0 ] = 0;  //extended
    end = ULEB128(buf+1, 1+cli->offset_size ); // write the opcode size
    *end = DW_LNE_set_address;
    ++end;
    CLIWrite( DW_DEBUG_LINE, buf, end-buf );
    CLIReloc3( DW_DEBUG_LINE, DW_W_LABEL, sym );
    cli->debug_line.addr = addr;
}
Example #3
0
void DWLineSeg(  dw_client  cli, dw_sym_handle sym )
{
    uint_8                      buf[1 + MAX_LEB128 + sizeof( dw_targ_addr )];
    uint_8                      *end;

    if( cli->segment_size != 0 ) {
        buf[ 0 ] = 0;  //extended
        end = ULEB128(buf+1, 1+cli->segment_size ); // write the opcode size
        *end = DW_LNE_set_segment;
        ++end;
        CLIWrite( DW_DEBUG_LINE, buf, end-buf );
        CLIReloc3( DW_DEBUG_LINE, DW_W_LABEL_SEG, sym );
    }
}
Example #4
0
void InitDebugInfo(  dw_client                   cli )
{

    /* leave room for the length field */
    CLISeek( DW_DEBUG_INFO, sizeof( uint_32 ), DW_SEEK_CUR );
    Info16( cli, 2 );   /* dwarf version */
    /* abbrev start */
    if( cli->compiler_options & DW_CM_ABBREV_PRE ){
        CLIReloc4( DW_DEBUG_INFO, DW_W_EXT_REF, cli->abbrev_sym, 0 );
    }else{
        CLISeek( DW_DEBUG_ABBREV, 0, DW_SEEK_SET );
        CLIReloc3( DW_DEBUG_INFO, DW_W_SECTION_POS, DW_DEBUG_ABBREV );
        CLISeek( DW_DEBUG_ABBREV, 0, DW_SEEK_END );
    }
    Info8( cli, cli->offset_size );
}