Changeset 13 for trunk/src/helpers/debug.c
- Timestamp:
- Nov 23, 2000, 7:36:41 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/helpers/debug.c
r8 r13 700 700 NrPublic = pubfunc_ofs = pxdi->sspub32.offset; 701 701 read_types = TRUE; 702 sprintf(pxdi->szNrPub, "%s %s (%s, seg %04X : ofs %08X\n", 702 sprintf(pxdi->szNrPub, 703 "%s %s (%s, seg %04lX : ofs %08lX\n", 703 704 (pxdi->sspub32.type == 1) ? " Abs" : " ", 704 705 ename, 705 706 ModName, // () 706 pxdi->sspub32.segment,707 (ULONG)pxdi->sspub32.segment, 707 708 pxdi->sspub32.offset 708 709 ); … … 1177 1178 sprintf(pszBuf, "%f", *(double*)varptr); 1178 1179 else if (type == 10) 1179 sprintf(pszBuf, "%f", *(long double*)varptr);1180 sprintf(pszBuf, "%f", (double)(*(long double*)varptr)); 1180 1181 else if (type == 16) 1181 1182 sprintf(pszBuf, "%s", *(char*)varptr ? "TRUE" : "FALSE"); … … 1187 1188 sprintf(pszBuf, "%c", *(char*)varptr); 1188 1189 else if (type == 21) 1189 sprintf(pszBuf, "% lc", *(short*)varptr);1190 sprintf(pszBuf, "%hd", (*(short*)varptr)); 1190 1191 else if (type == 22) 1191 sprintf(pszBuf, "%l c", *(long*)varptr);1192 sprintf(pszBuf, "%ld", *(long*)varptr); 1192 1193 else if (type == 23) 1193 1194 sprintf(pszBuf, "void"); 1194 1195 else if (type >= 32) 1195 1196 { 1196 sprintf(pszBuf, "0x%p", *(ULONG *) varptr);1197 sprintf(pszBuf, "0x%p", (void*)(*(ULONG*)varptr)); 1197 1198 if (Attr & PAG_FREE) 1198 1199 { … … 1247 1248 one_userdef[pos].type_index - 0x80); 1248 1249 1249 fprintf(LogFile, " %- 6d %- 20.20s %- 33.33s %s (user)\n", 1250 fprintf(LogFile, 1251 " %- 6ld %- 20.20s %- 33.33s %s (user)\n", 1250 1252 autovar_def[var_no].stack_offset, // stack offset 1251 1253 autovar_def[var_no].name, // identifier … … 1295 1297 sszVar, 1296 1298 32); 1297 fprintf(LogFile, " %- 6 d %- 20.20s %- 33.33s %s (ptr1)\n",1299 fprintf(LogFile, " %- 6ld %- 20.20s %- 33.33s %s (ptr1)\n", 1298 1300 autovar_def[var_no].stack_offset, 1299 1301 autovar_def[var_no].name, … … 1319 1321 sszVar, 1320 1322 32); 1321 fprintf(LogFile, " %- 6 d %- 20.20s %- 33.33s %s (ptr2)\n",1323 fprintf(LogFile, " %- 6ld %- 20.20s %- 33.33s %s (ptr2)\n", 1322 1324 autovar_def[var_no].stack_offset, 1323 1325 autovar_def[var_no].name, … … 1335 1337 sszVar, 1336 1338 32); 1337 fprintf(LogFile, " %- 6 d %- 20.20s %- 33.33s %s (ptr3)\n",1339 fprintf(LogFile, " %- 6ld %- 20.20s %- 33.33s %s (ptr3)\n", 1338 1340 autovar_def[var_no].stack_offset, 1339 1341 autovar_def[var_no].name, … … 1372 1374 { 1373 1375 AutoVarsFound = TRUE; 1374 fprintf(LogFile, " List of auto variables at EBP %p in %s:\n", stackofs, func_name); 1376 fprintf(LogFile, " List of auto variables at EBP %p in %s:\n", 1377 (PVOID)stackofs, 1378 func_name); 1375 1379 fprintf(LogFile, " Offset Name Type Value \n"); 1376 1380 fprintf(LogFile, " ÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\n"); … … 1388 1392 autovar_def[n].type_idx - 0x80); 1389 1393 1390 fprintf(LogFile, " %- 6 d %- 20.20s %- 33.33s %s (simple)\n",1394 fprintf(LogFile, " %- 6ld %- 20.20s %- 33.33s %s (simple)\n", 1391 1395 autovar_def[n].stack_offset, 1392 1396 autovar_def[n].name, … … 1400 1404 if (!search_pointers(LogFile, stackofs, n)) 1401 1405 { 1402 fprintf(LogFile, " %- 6 d %-20.20s 0x%X (unknown)\n",1406 fprintf(LogFile, " %- 6ld %-20.20s 0x%X (unknown)\n", 1403 1407 autovar_def[n].stack_offset, 1404 1408 autovar_def[n].name, … … 1506 1510 { 1507 1511 // symbol found 1508 fprintf(LogFile, "between %s + 0x% X ", Buffer, TrapOffset - LastVal);1509 fprintf(LogFile, "(ppLineDef: 0x%lX) ",1512 fprintf(LogFile, "between %s + 0x%lX ", Buffer, TrapOffset - LastVal); 1513 /* fprintf(LogFile, "(ppLineDef: 0x%lX) ", 1510 1514 LINEDEFOFFSET(SegDef) 1511 ); 1515 ); */ 1512 1516 fprintf(LogFile, "\n"); 1513 1517 } … … 1522 1526 // symbol found, as above 1523 1527 fprintf(LogFile, " " 1524 "and %s - 0x% X ", Buffer, LastVal - TrapOffset);1528 "and %s - 0x%lX ", Buffer, LastVal - TrapOffset); 1525 1529 fprintf(LogFile, "\n"); 1526 1530 break; … … 1534 1538 if (SymDef16.wSymVal > TrapOffset) 1535 1539 { 1536 fprintf(LogFile, "between %s + % X\n",1540 fprintf(LogFile, "between %s + %lX\n", 1537 1541 Buffer, 1538 1542 TrapOffset - LastVal); … … 1545 1549 { 1546 1550 fprintf(LogFile, " " 1547 "and %s - % X\n",1551 "and %s - %lX\n", 1548 1552 Buffer, 1549 1553 LastVal - TrapOffset); … … 1681 1685 else if (arc != 0) 1682 1686 fprintf(LogFile, 1683 "Error % dreading symbol file %s\n",1687 "Error %lu reading symbol file %s\n", 1684 1688 arc, 1685 1689 szSymName); … … 1743 1747 if (rc != NO_ERROR) 1744 1748 { 1745 fprintf(LogFile, "Invalid EBP %8.8 p (DosQueryMem returned %d)\n",Ebp, rc);1749 fprintf(LogFile, "Invalid EBP %8.8lX (DosQueryMem returned %lu)\n", (ULONG)Ebp, rc); 1746 1750 break; 1747 1751 } 1748 1752 if (!(Attr & PAG_COMMIT)) 1749 1753 { 1750 fprintf(LogFile, "Invalid EBP %8.8 p (not committed)\n",Ebp);1754 fprintf(LogFile, "Invalid EBP %8.8lX (not committed)\n", (ULONG)Ebp); 1751 1755 break; 1752 1756 } 1753 1757 if (Size < 10) 1754 1758 { 1755 fprintf(LogFile, "Invalid EBP %8.8 p (mem block size < 10)\n",Ebp);1759 fprintf(LogFile, "Invalid EBP %8.8lX (mem block size < 10)\n", (ULONG)Ebp); 1756 1760 break; 1757 1761 } … … 1853 1857 fprintf(LogFile, " Trap -> "); 1854 1858 else 1855 fprintf(LogFile, " %8.8 p ",Ebp);1859 fprintf(LogFile, " %8.8lX ", (ULONG)Ebp); 1856 1860 1857 1861 // "Address" column 1858 1862 if (f32bit) 1859 fprintf(LogFile, ":%8.8 p ",RetAddr);1863 fprintf(LogFile, ":%8.8lX ", (ULONG)RetAddr); 1860 1864 else 1861 1865 fprintf(LogFile, "%04.04X:%04.04X ", Cs, Ip); … … 1874 1878 if (rc != NO_ERROR || !(Attr & PAG_COMMIT)) 1875 1879 { 1876 fprintf(LogFile, "Invalid RetAddr: %8.8 p\n",RetAddr);1880 fprintf(LogFile, "Invalid RetAddr: %8.8lX\n", (ULONG)RetAddr); 1877 1881 break; // avoid infinite loops 1878 1882 } … … 1895 1899 1896 1900 // print module and object 1897 fprintf(LogFile, "%-8s %04 X ", szName, ObjNum + 1);1901 fprintf(LogFile, "%-8s %04lX ", szName, ObjNum + 1); 1898 1902 1899 1903 if (strlen(Name) > 3) … … 1907 1911 else 1908 1912 fprintf(LogFile, 1909 "DosQueryModFromEIP failed, returned % d\n",1913 "DosQueryModFromEIP failed, returned %lu\n", 1910 1914 rc); 1911 1915 } … … 1949 1953 if ((rc != NO_ERROR) || (Size < 4)) 1950 1954 { 1951 fprintf(LogFile, "... lost stack chain - invalid EBP: %8.8 p\n",Ebp);1955 fprintf(LogFile, "... lost stack chain - invalid EBP: %8.8lX\n", (ULONG)Ebp); 1952 1956 break; 1953 1957 }
Note:
See TracChangeset
for help on using the changeset viewer.