Ignore:
Timestamp:
Oct 7, 2017, 12:21:39 PM (2 years ago)
Author:
matszpk
Message:

CLRadeonExtender: Add new exception class to distinguish errors in GPUId, assembler, disassembler, binary readers and binary generators.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • CLRadeonExtender/trunk/amdbin/ROCmBinaries.cpp

    r3444 r3457  
    6868    }
    6969    if (code==nullptr && regionsNum!=0)
    70         throw Exception("No code if regions number is not zero");
     70        throw BinException("No code if regions number is not zero");
    7171    regions.reset(new ROCmRegion[regionsNum]);
    7272    size_t j = 0;
     
    8282        const size_t value = ULEV(sym.st_value);
    8383        if (value < codeOffset)
    84             throw Exception("Region offset is too small!");
     84            throw BinException("Region offset is too small!");
    8585        const size_t size = ULEV(sym.st_size);
    8686       
     
    9999            symOffsets[j] = std::make_pair(value, j);
    100100            if (type!=ROCmRegionType::DATA && value+0x100 > codeOffset+codeSize)
    101                 throw Exception("Kernel or code offset is too big!");
     101                throw BinException("Kernel or code offset is too big!");
    102102            regions[j++] = { getSymbolName(i), size, value, type };
    103103        }
     
    113113        ROCmRegion& region = regions[symOffsets[i-1].second];
    114114        if (region.type==ROCmRegionType::KERNEL && symOffsets[i-1].first+0x100 > end)
    115             throw Exception("Kernel size is too small!");
     115            throw BinException("Kernel size is too small!");
    116116       
    117117        const size_t regSize = end - symOffsets[i-1].first;
     
    144144        const cxbyte* noteContent = (const cxbyte*)getNotes();
    145145        if (noteContent==nullptr)
    146             throw Exception("Missing notes in inner binary!");
     146            throw BinException("Missing notes in inner binary!");
    147147        size_t notesSize = getNotesSize();
    148148        // find note about AMDGPU
     
    153153            size_t descsz = ULEV(nhdr->n_descsz);
    154154            if (usumGt(offset, namesz+descsz, notesSize))
    155                 throw Exception("Note offset+size out of range");
     155                throw BinException("Note offset+size out of range");
    156156            if (ULEV(nhdr->n_type) == 0x3 && namesz==4 && descsz>=0x1a &&
    157157                ::strcmp((const char*)noteContent+offset+sizeof(Elf64_Nhdr), "AMD")==0)
     
    180180                             regionsMap.end(), name);
    181181    if (it == regionsMap.end())
    182         throw Exception("Can't find region name");
     182        throw BinException("Can't find region name");
    183183    return regions[it->second];
    184184}
Note: See TracChangeset for help on using the changeset viewer.