예제 #1
0
/******************************************************************
 *		pe_load_stabs
 *
 * look for stabs information in PE header (it's how the mingw compiler provides 
 * its debugging information)
 */
static BOOL pe_load_stabs(const struct process* pcs, struct module* module)
{
    struct image_file_map*      fmap = &module->format_info[DFI_PE]->u.pe_info->fmap;
    struct image_section_map    sect_stabs, sect_stabstr;
    BOOL                        ret = FALSE;

    if (pe_find_section(fmap, ".stab", &sect_stabs) && pe_find_section(fmap, ".stabstr", &sect_stabstr))
    {
        const char* stab;
        const char* stabstr;

        stab = image_map_section(&sect_stabs);
        stabstr = image_map_section(&sect_stabstr);
        if (stab != IMAGE_NO_MAP && stabstr != IMAGE_NO_MAP)
        {
            ret = stabs_parse(module,
                              module->module.BaseOfImage - fmap->u.pe.ntheader.OptionalHeader.ImageBase,
                              stab, image_get_map_size(&sect_stabs),
                              stabstr, image_get_map_size(&sect_stabstr),
                              NULL, NULL);
        }
        image_unmap_section(&sect_stabs);
        image_unmap_section(&sect_stabstr);
        if (ret) pe_locate_with_coff_symbol_table(module);
    }
    TRACE("%s the STABS debug info\n", ret ? "successfully loaded" : "failed to load");

    return ret;
}
예제 #2
0
/******************************************************************
 *		pe_load_rsym
 *
 * look for ReactOS's own rsym format
 */
static BOOL pe_load_rsym(struct module* module)
{
    struct image_file_map*      fmap = &module->format_info[DFI_PE]->u.pe_info->fmap;
    struct image_section_map    sect_rsym;
    BOOL                        ret = FALSE;

    if (pe_find_section(fmap, ".rossym", &sect_rsym))
    {
        const char* rsym = image_map_section(&sect_rsym);
        if (rsym != IMAGE_NO_MAP)
        {
            ret = rsym_parse(module, module->module.BaseOfImage,
                             rsym, image_get_map_size(&sect_rsym));
        }
        image_unmap_section(&sect_rsym);
    }
    TRACE("%s the RSYM debug info\n", ret ? "successfully loaded" : "failed to load");

    return ret;
}