MCPcopy Create free account
hub / github.com/WheretIB/nullc / UpdateWatchedVariables

Function UpdateWatchedVariables

SuperCalc.cpp:1587–1620  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1585}
1586
1587void UpdateWatchedVariables()
1588{
1589 char name[256];
1590 HTREEITEM elem = TreeView_GetRoot(hWatch);
1591 while(elem)
1592 {
1593 TVITEMEX item;
1594 memset(&item, 0, sizeof(item));
1595 item.mask = TVIF_HANDLE | TVIF_PARAM;
1596 item.hItem = elem;
1597 TreeView_GetItem(hVars, &item);
1598
1599 item.mask = TVIF_TEXT;
1600 item.hItem = elem;
1601 item.cchTextMax = 0;
1602
1603 TreeItemExtra extra = tiWatch[item.lParam];
1604 const ExternTypeInfo &type = *extra.type;
1605
1606 char *it = name;
1607 memset(name, 0, 256);
1608 it += safeprintf(it, 256 - int(it - name), "0x%x: %s %s", extra.address, codeSymbols + type.offsetToName, extra.name);
1609
1610 if(type.subCat == ExternTypeInfo::CAT_NONE || type.subCat == ExternTypeInfo::CAT_POINTER)
1611 it += safeprintf(it, 256 - int(it - name), " = %s", GetBasicVariableInfo(type, (char*)extra.address));
1612 else if(&type == &codeTypes[8]) // for typeid
1613 it += safeprintf(it, 256 - int(it - name), " = %s", codeSymbols + codeTypes[*(int*)(extra.address)].offsetToName);
1614
1615 item.pszText = name;
1616 TreeView_SetItem(hWatch, &item);
1617 FillVariableInfo(type, (char*)extra.address, elem, true);
1618 elem = TreeView_GetNextSibling(hWatch, elem);
1619 }
1620}
1621
1622struct RunResult
1623{

Callers 1

WndProcFunction · 0.85

Calls 3

safeprintfFunction · 0.85
GetBasicVariableInfoFunction · 0.85
FillVariableInfoFunction · 0.85

Tested by

no test coverage detected