def debug_die(die, text):
    if ('DW_AT_decl_file' not in die.attributes):
        abs_orig_val = die.attributes['DW_AT_abstract_origin'].value
        offset = (abs_orig_val + die.cu.cu_offset)
        for var in variables:
            if (var.offset == offset):
                die = var
                break
    lp_header = die.dwarfinfo.line_program_for_CU(die.cu).header
    files = lp_header['file_entry']
    includes = lp_header['include_directory']
    fileinfo = files[(die.attributes['DW_AT_decl_file'].value - 1)]
    filename = fileinfo.name.decode('utf-8')
    filedir = includes[(fileinfo.dir_index - 1)].decode('utf-8')
    path = os.path.join(filedir, filename)
    lineno = die.attributes['DW_AT_decl_line'].value
    debug(str(die))
    debug(("File '%s', line %d:" % (path, lineno)))
    debug(('    %s' % text))
def debug_die(die, text):
    if ('DW_AT_decl_file' not in die.attributes):
        abs_orig_val = die.attributes['DW_AT_abstract_origin'].value
        offset = (abs_orig_val + die.cu.cu_offset)
        for var in variables:
            if (var.offset == offset):
                die = var
                break
    lp_header = die.dwarfinfo.line_program_for_CU(die.cu).header
    files = lp_header['file_entry']
    includes = lp_header['include_directory']
    fileinfo = files[(die.attributes['DW_AT_decl_file'].value - 1)]
    filename = fileinfo.name.decode('utf-8')
    filedir = includes[(fileinfo.dir_index - 1)].decode('utf-8')
    path = os.path.join(filedir, filename)
    lineno = die.attributes['DW_AT_decl_line'].value
    debug(str(die))
    debug(("File '%s', line %d:" % (path, lineno)))
    debug(('    %s' % text))