Exemple #1
0
void AddItem(DEBUG_INFO *dbg, VARINFO *var, 
             int cursoreip, int page)
{
    WATCHINFO *x = MatchItem(var, page);
    if (x)
    {
        FreeVarInfo(var);
    }
    else
    {
        HTREEITEM previous = 0;
        if (watchinfo_count[page] >= watchinfo_max[page])
        {
            if (watchinfo_max[page] >= 128)
            {
                ExtendedMessageBox("Watch Error", MB_SETFOREGROUND |
                    MB_SYSTEMMODAL, 
                    "There are too many items in the watch window\nNot adding the current selection");
                return ;
            }
            watchinfo_max[page] += 64;
            watchinfo_list[page] = realloc(watchinfo_list[page], watchinfo_max[page] *sizeof
                (WATCHINFO));
        }
        if (watchinfo_count[page])
            previous = watchinfo_list[page][watchinfo_count[page] - 1].info->hTreeItem;
        memset(&watchinfo_list[page][watchinfo_count[page]], 0, sizeof(watchinfo_list[page][0]));
        watchinfo_list[page][watchinfo_count[page]].info = var;
        watchinfo_list[page][watchinfo_count[page]].dbg_info = dbg;
        watchinfo_list[page][watchinfo_count[page]++].cursoreip = cursoreip;
        RefreshItem(&watchinfo_list[page][watchinfo_count[page] - 1], var->address, NULL);
        InsertSubTree(0, previous, var, watchinfo_count[page] - 1, page);
    }
}
Exemple #2
0
static void AddItem(DEBUG_INFO *dbg, VARINFO *var,
                    int cursoreip, WATCHDATA *ptr)
{
    WATCHINFO *x = MatchItem(var, ptr);
    if (x)
    {
        x->marked = FALSE;
        FreeVarInfo(var);
    }
    else
    {
        HTREEITEM previous = 0;
        if (ptr->watchinfo_count >= ptr->watchinfo_max)
        {
            if (ptr->watchinfo_max >= 128)
            {
                ExtendedMessageBox("Watch Error", MB_SETFOREGROUND |
                                   MB_SYSTEMMODAL,
                                   "There are too many items in the watch window\nNot adding the current selection");
                return ;
            }
            ptr->watchinfo_max += 64;
            ptr->watchinfo_list = realloc(ptr->watchinfo_list, ptr->watchinfo_max *sizeof
                                          (WATCHINFO));
        }
        if (ptr->watchinfo_count)
            previous = ptr->watchinfo_list[ptr->watchinfo_count - 1].info->hTreeItem;
        memset(&ptr->watchinfo_list[ptr->watchinfo_count], 0, sizeof(ptr->watchinfo_list[0]));
        ptr->watchinfo_list[ptr->watchinfo_count].info = var;
        ptr->watchinfo_list[ptr->watchinfo_count].dbg_info = dbg;
        ptr->watchinfo_list[ptr->watchinfo_count++].cursoreip = cursoreip;
        RefreshItem(ptr, &ptr->watchinfo_list[ptr->watchinfo_count - 1], var->address, NULL, TRUE);
        InsertSubTree(0, previous, var, ptr->watchinfo_count - 1, ptr);
    }
}