コード例 #1
0
ファイル: dbgwatch.c プロジェクト: doniexun/OrangeC
void ExpandPointer(VARINFO *v, int code, int page)
{
    if (v->pointer)
    {
        if (code == TVE_EXPAND)
        {
            int val;
            int outofscope = (val = v->derefaddress) == -1 && !ReadValue(v->address, &val, 4, v) || !val;
            if (!v->subtype && watchinfo_list[page][v->watchindex].dbg_info)
            {
                TreeView_DeleteItem(hwndTree[page], v->hTreeHolder);
                ExpandPointerInfo(watchinfo_list[page][v->watchindex].dbg_info, v);
                if (v->subtype->structure)
                {
                    InsertSubTree(v->hTreeItem, 0, v->subtype->subtype, v->watchindex, page);
                }
                else
                    InsertSubTree(v->hTreeItem, 0, v->subtype, v->watchindex, page);
            }
            RefreshAddresses(v->subtype, val, NULL, outofscope);
            RefreshData(watchinfo_list[page][v->watchindex].dbg_info, v);
        }
        else if (code == TVE_COLLAPSE)
        {
            if (v->subtype)
            {
                FreeTree(v->subtype, page);
                FreeVarInfo(v->subtype);
                v->subtype = 0;
                v->hTreeHolder = InsertItem(v->hTreeItem, TVI_LAST, v, page);
            }
        }
    }
}
コード例 #2
0
ファイル: dbgwatch.c プロジェクト: bencz/OrangeC
static void ExpandPointer(VARINFO *v, int code, WATCHDATA *ptr)
{
    if (v->pointer)
    {
        if (code == TVE_EXPAND)
        {
            int val;
            int outofscope;
            outofscope = ((val = v->derefaddress) == -1 && !ReadValue(v->address, &val, 4, v)) || !val;
            if (!v->subtype && ptr->watchinfo_list[v->watchindex].dbg_info)
            {
                TreeView_DeleteItem(ptr->hwndWatchTree, v->hTreeHolder);
                ExpandPointerInfo(ptr->watchinfo_list[v->watchindex].dbg_info, v);
                if (v->subtype->structure)
                {
                    InsertSubTree(v->hTreeItem, 0, v->subtype->subtype, v->watchindex, ptr);
                }
                else
                    InsertSubTree(v->hTreeItem, 0, v->subtype, v->watchindex, ptr);
            }
            ptr->structNesting[ptr->nestingCount++] = v;
            RefreshAddresses(ptr, v->subtype, val, NULL, outofscope);
            ptr->nestingCount--;
            RefreshData(ptr->watchinfo_list[v->watchindex].dbg_info, v, TRUE);
        }
        else if (code == TVE_COLLAPSE)
        {
            if (v->subtype && !v->derefaddress)
            {
                FreeTree(v->subtype, ptr);
                FreeVarInfo(v->subtype);
                v->subtype = 0;
                v->hTreeHolder = InsertItem(v->hTreeItem, TVI_LAST, v, ptr);
            }
        }
    }
}