'Create a jump table.
inst_addr: address of the jump
table_addr: address of the table
nb_entries: number of entries to read
entry_size: size of each address in the table
dont_analyze should be used internally ONLY.
returns True if ok'

def create_jmptable(self, inst_addr, table_addr, nb_entries, entry_size, dont_analyze=False):

    table = self.read_array(table_addr, nb_entries, entry_size)
    if (not table):
        return False
    if (entry_size == 2):
        entry_type = MEM_WOFFSET
    elif (entry_size == 4):
        entry_type = MEM_DOFFSET
    elif (entry_size == 8):
        entry_type = MEM_QOFFSET
    self.set_array(table_addr, nb_entries, entry_type, dont_analyze=True)
    name = ('jmptable_%x' % table_addr)
    self.add_symbol(table_addr, name, force=True)
    self.__db.jmptables[inst_addr] = Jmptable(inst_addr, table_addr, table, name)
    self.__db.internal_inline_comments[inst_addr] = ('switch    statement    %s[%d]' % (name, nb_entries))
    all_cases = {}
    for ad in table:
        all_cases[ad] = []
    case = 0
    for ad in table:
        all_cases[ad].append(case)
        case += 1
    for ad in all_cases:
        self.__db.internal_previous_comments[ad] = [('case    %s        %s' % (',    '.join(map(str, all_cases[ad])), name))]
    if dont_analyze:
        return True
    func_id = self.mem.get_func_id(inst_addr)
    if (func_id == (-1)):
        self.__analyzer.msg.put((inst_addr, False, True, True, self.__queue_wait))
    else:
        ad = self.__db.func_id[func_id]
        self.__analyzer.msg.put((ad, True, True, True, self.__queue_wait))
    self.__queue_wait.get()
    return True
