Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | *** empty log message *** |
|---|---|
| Timelines: | family | ancestors | descendants | both | trunk | Release4_1 | Release3_2 | Release3_1 | Release3_0 | Release2_8 | Release2_7 | Release2_6 | Release2_5 | Release2_0 |
| Files: | files | file ages | folders |
| SHA1: |
67783a3377bd04e0319d4bc03410e12a |
| User & Date: | ramsan 2002-09-09 17:29:44 |
Context
|
2002-09-10
| ||
| 09:10 | *** empty log message *** check-in: 55ee05ba14 user: ramsan tags: trunk, Release2_0 | |
|
2002-09-09
| ||
| 17:29 | *** empty log message *** check-in: 67783a3377 user: ramsan tags: trunk, Release4_1, Release3_2, Release3_1, Release3_0, Release2_8, Release2_7, Release2_6, Release2_5, Release2_0 | |
|
2002-09-02
| ||
| 06:35 | Near version 2 check-in: af6e541992 user: ramsan tags: trunk | |
Changes
Changes to Makefile_win_wrap.tcl.
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
set TEXI2HTML {perl "/Gid Project/info/html-version/texi2html" \
-split_node -menu}
set ZIP /utils/zip.exe
set ZIPFILES [list RamDebugger/RamDebugger.tcl RamDebugger/license.terms RamDebugger/Readme \
RamDebugger/addons RamDebugger/scripts RamDebugger/Examples RamDebugger/help]
set files [list RamDebugger.tcl]
pack [text .t -width 70 -height 4]
if { [eval MustCompile RamDebugger.exe $files] } {
file delete RamDebugger.exe
eval [concat Execute $FREEWRAP -e $files]
}
update
after 500
exit
|
| |
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
set TEXI2HTML {perl "/Gid Project/info/html-version/texi2html" \
-split_node -menu}
set ZIP /utils/zip.exe
set ZIPFILES [list RamDebugger/RamDebugger.tcl RamDebugger/license.terms RamDebugger/Readme \
RamDebugger/addons RamDebugger/scripts RamDebugger/Examples RamDebugger/help]
set files [concat [list RamDebugger.tcl] [glob -dir scripts *.tcl]]
pack [text .t -width 70 -height 4]
if { [eval MustCompile RamDebugger.exe $files] } {
file delete RamDebugger.exe
eval [concat Execute $FREEWRAP -e $files]
}
update
after 500
exit
|
Changes to RamDebugger.tcl.
1 2 3 4 5 6 7 8 9 10 11 12 .. 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ... 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 ... 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 ... 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 ... 249 250 251 252 253 254 255 256 257 258 259 260 261 262 ... 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 ... 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 ... 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 ... 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 ... 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 ... 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 ... 707 708 709 710 711 712 713 714 715 716 717 718 719 720 ... 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 ... 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 .... 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 .... 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 .... 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 .... 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 .... 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 .... 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 .... 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 .... 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 .... 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 .... 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 .... 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 .... 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 .... 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 .... 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 .... 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 .... 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 .... 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 .... 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 .... 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 .... 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 .... 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 .... 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 .... 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 .... 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 .... 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 .... 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 .... 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 .... 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 .... 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 .... 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 .... 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 .... 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 .... 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 .... 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769 5770 5771 5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782 5783 5784 5785 5786 5787 5788 5789 5790 5791 5792 5793 5794 5795 5796 5797 5798 5799 5800 5801 5802 5803 5804 5805 5806 5807 5808 5809 5810 5811 5812 5813 5814 5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830 5831 5832 5833 5834 5835 5836 5837 5838 5839 5840 5841 5842 5843 5844 5845 5846 5847 5848 5849 5850 5851 5852 5853 5854 5855 5856 5857 5858 5859 5860 5861 5862 5863 5864 5865 5866 5867 5868 5869 5870 5871 5872 5873 5874 5875 5876 5877 5878 5879 5880 5881 5882 5883 5884 5885 5886 5887 5888 5889 5890 5891 5892 5893 5894 5895 5896 5897 5898 5899 5900 5901 5902 5903 5904 5905 5906 5907 5908 5909 5910 5911 5912 5913 5914 5915 5916 5917 5918 5919 5920 5921 5922 5923 5924 5925 5926 5927 5928 5929 5930 5931 5932 5933 5934 5935 5936 5937 5938 5939 5940 5941 5942 5943 5944 5945 5946 5947 5948 5949 5950 5951 5952 5953 5954 5955 5956 5957 5958 5959 5960 5961 5962 5963 5964 5965 5966 5967 5968 5969 5970 5971 5972 5973 5974 5975 5976 5977 5978 5979 5980 5981 5982 5983 5984 5985 5986 5987 5988 5989 5990 5991 5992 5993 5994 5995 5996 5997 5998 5999 6000 6001 6002 6003 6004 6005 6006 6007 6008 6009 6010 6011 6012 6013 6014 6015 6016 6017 6018 6019 6020 6021 6022 6023 6024 6025 6026 6027 6028 6029 6030 6031 6032 6033 6034 6035 6036 6037 6038 6039 6040 6041 6042 6043 6044 6045 6046 6047 6048 6049 6050 6051 6052 6053 6054 6055 6056 6057 6058 6059 6060 6061 6062 6063 6064 6065 6066 6067 6068 6069 6070 6071 6072 6073 6074 6075 6076 6077 6078 6079 6080 6081 6082 6083 6084 6085 6086 6087 6088 6089 6090 6091 6092 6093 6094 6095 6096 6097 6098 6099 6100 6101 6102 6103 6104 6105 6106 6107 6108 6109 6110 6111 6112 6113 6114 6115 6116 6117 6118 6119 6120 6121 6122 6123 6124 6125 6126 6127 6128 6129 6130 6131 6132 6133 6134 6135 6136 6137 6138 6139 6140 6141 6142 6143 6144 6145 6146 6147 6148 6149 6150 6151 6152 6153 6154 6155 6156 6157 6158 6159 6160 6161 6162 6163 6164 6165 6166 6167 6168 6169 6170 6171 6172 6173 6174 6175 6176 6177 6178 6179 6180 6181 6182 6183 6184 6185 6186 6187 6188 6189 6190 6191 6192 6193 6194 6195 6196 6197 6198 6199 6200 6201 6202 6203 6204 6205 6206 6207 6208 6209 6210 6211 6212 6213 6214 6215 6216 6217 6218 6219 6220 6221 6222 6223 6224 6225 6226 6227 6228 6229 6230 6231 6232 6233 6234 6235 6236 6237 6238 6239 6240 6241 6242 6243 6244 6245 6246 6247 6248 6249 .... 6254 6255 6256 6257 6258 6259 6260 6261 6262 6263 6264 6265 6266 6267 6268 .... 6284 6285 6286 6287 6288 6289 6290 6291 6292 6293 6294 6295 6296 6297 6298 6299 6300 6301 6302 6303 6304 6305 6306 6307 6308 .... 6463 6464 6465 6466 6467 6468 6469 6470 6471 6472 6473 6474 6475 6476 6477 .... 6737 6738 6739 6740 6741 6742 6743 6744 6745 6746 6747 6748 6749 6750 6751 6752 .... 6818 6819 6820 6821 6822 6823 6824 6825 6826 6827 6828 6829 6830 6831 6832 6833 6834 6835 6836 6837 6838 6839 6840 6841 6842 6843 6844 .... 6852 6853 6854 6855 6856 6857 6858 6859 6860 6861 6862 6863 6864 6865 6866 6867 6868 6869 6870 6871 6872 6873 6874 6875 6876 6877 6878 6879 6880 6881 6882 6883 6884 6885 6886 6887 6888 6889 6890 6891 6892 6893 6894 6895 6896 6897 6898 6899 6900 6901 6902 6903 6904 6905 6906 6907 6908 6909 6910 6911 6912 6913 6914 6915 6916 6917 6918 6919 6920 6921 6922 6923 6924 6925 6926 6927 6928 6929 6930 6931 6932 6933 6934 6935 6936 6937 6938 6939 6940 6941 6942 6943 6944 6945 6946 6947 6948 6949 6950 6951 6952 6953 6954 6955 6956 6957 6958 6959 6960 6961 6962 6963 6964 6965 6966 6967 6968 6969 6970 6971 6972 6973 6974 6975 6976 6977 6978 6979 6980 6981 6982 6983 6984 6985 6986 6987 6988 6989 6990 6991 6992 6993 6994 6995 6996 6997 6998 6999 7000 7001 7002 7003 7004 7005 7006 7007 7008 7009 7010 7011 7012 7013 7014 7015 7016 7017 7018 7019 7020 7021 7022 7023 7024 7025 7026 7027 7028 7029 7030 7031 7032 7033 7034 7035 7036 7037 7038 7039 7040 7041 7042 7043 7044 7045 7046 7047 7048 7049 7050 7051 7052 7053 7054 7055 7056 7057 7058 7059 7060 7061 7062 7063 7064 7065 7066 7067 7068 7069 7070 7071 7072 7073 7074 7075 7076 7077 7078 7079 7080 7081 7082 7083 7084 7085 7086 7087 7088 7089 7090 7091 7092 7093 7094 7095 7096 7097 7098 7099 7100 7101 7102 7103 7104 7105 7106 7107 7108 7109 7110 7111 7112 7113 7114 7115 7116 7117 7118 7119 7120 7121 7122 7123 7124 7125 7126 7127 7128 7129 7130 7131 7132 7133 7134 7135 7136 7137 7138 7139 7140 7141 7142 7143 7144 7145 7146 7147 7148 7149 7150 7151 7152 7153 7154 7155 7156 7157 7158 7159 7160 7161 7162 7163 7164 7165 7166 7167 7168 7169 7170 7171 7172 7173 7174 7175 7176 7177 7178 7179 7180 7181 7182 7183 7184 7185 7186 7187 7188 7189 7190 7191 7192 7193 7194 7195 7196 7197 7198 7199 7200 7201 7202 7203 7204 7205 7206 7207 7208 7209 7210 7211 7212 7213 7214 7215 7216 7217 7218 7219 7220 7221 7222 7223 7224 7225 7226 7227 7228 7229 7230 7231 7232 7233 7234 7235 7236 7237 .... 7307 7308 7309 7310 7311 7312 7313 7314 7315 7316 7317 7318 7319 7320 7321 .... 7334 7335 7336 7337 7338 7339 7340 7341 7342 7343 7344 7345 7346 7347 7348 7349 7350 7351 7352 7353 7354 7355 7356 7357 7358 7359 .... 7393 7394 7395 7396 7397 7398 7399 7400 7401 7402 7403 7404 7405 7406 7407 7408 7409 7410 7411 7412 .... 7483 7484 7485 7486 7487 7488 7489 7490 7491 7492 7493 7494 7495 7496 7497 7498 .... 7531 7532 7533 7534 7535 7536 7537 7538 7539 7540 7541 7542 7543 7544 7545 7546 7547 7548 7549 7550 7551 7552 7553 7554 7555 7556 7557 7558 7559 7560 7561 7562 7563 7564 7565 7566 7567 7568 7569 7570 7571 7572 7573 7574 7575 7576 7577 7578 7579 7580 7581 7582 7583 7584 .... 7679 7680 7681 7682 7683 7684 7685 7686 7687 7688 7689 7690 7691 7692 .... 7782 7783 7784 7785 7786 7787 7788 7789 7790 7791 7792 7793 7794 7795 7796 7797 7798 7799 7800 7801 7802 7803 .... 7810 7811 7812 7813 7814 7815 7816 7817 7818 7819 7820 7821 7822 7823 .... 7827 7828 7829 7830 7831 7832 7833 7834 7835 7836 7837 7838 7839 7840 7841 7842 7843 7844 7845 7846 7847 7848 7849 7850 |
#!/bin/sh # the next line restarts using wish \ exec wish "$0" "$@" # $Id: RamDebugger.tcl,v 1.10 2002/09/02 08:35:46 ramsan Exp $ # RamDebugger -*- TCL -*- Created: ramsan Jul-2002, Modified: ramsan Aug-2002 ################################################################################ # This software is copyrighted by Ramon Ribó (RAMSAN) ramsan@cimne.upc.es. # (http://gid.cimne.upc.es/ramsan) The following terms apply to all files # associated with the software unless explicitly disclaimed in individual files. ................................................................................ variable TextMotionAfterId "" variable ExpressionResult "" variable count variable listbox "" variable progressvar variable status variable WindowFilesList "" variable WindowFilesListCurr -1 ################################################################################ # Preferences ################################################################################ variable options ................................................................................ ################################################################################ # Setting preferences ################################################################################ set options_def(indentsizeTCL) 4 set options_def(indentsizeC++) 2 set options_def(ConfirmStartDebugging) 1 set options_def(LocalDebuggingType) tk switch $::tcl_platform(platform) { windows { set options_def(NormalFont) { -family "MS Sans Serif" -size 8 -weight normal \ -slant roman -underline 0 -overstrike 0 } set options_def(FixedFont) { -family "Courier" -size 8 -weight normal \ -slant roman -underline 0 -overstrike 0 } ................................................................................ # this variable is only used on windows. It can be: # 0: Only check remote programs on demand (useful if not making remote debugging, the # start up is faster) # 1: Register as remote and check remote programs on start up. It can be slower the # start up but is better when making remote debugging if { $::tcl_platform(platform) == "windows" } { set options_def(CheckRemotes) 0 } ################################################################################ # Reading preferences (they are only saved in GUI mode) ################################################################################ ................................................................................ set data [read $fin] close $fin } array set options $data } } ################################################################################ # Increasing the path variable (just to ckeck typical locations) ################################################################################ if { $::tcl_platform(platform) == "windows" } { set err [catch { set shortname [file native [file attributes [file join $MainDir addons] \ -shortname]] }] if { !$err } { if { [info exists ::env(PATH)] && $::env(PATH) != "" } { append ::env(PATH) ";$shortname" } else { set ::env(PATH) "$shortname" } } set dirs [list "c:/tcltk/mingw1.1" "c:/mingw1.1" "c:/mingw" "c:/mingw32"] foreach i $dirs { foreach j [list $i [file join $i bin] [file join $i mingw bin] \ [file join $i mingw32 bin]] { set err [catch { set shortname [file native [file attributes $j -shortname]] }] if { !$err } { if { [info exists ::env(PATH)] && $::env(PATH) != "" } { append ::env(PATH) ";$shortname" } else { set ::env(PATH) "$shortname" } } } } } ################################################################################ # Registering as remote server ################################################################################ if { $debuggerserver != "" } { return } ................................................................................ if { [info command wm] != "" } { package require Tk wm withdraw . } set debuggerserver [tk appname $debuggerserver] } } ################################################################################ # Main non GUI functions ################################################################################ proc RamDebugger::rhelp { args } { ................................................................................ FindActivePrograms 1 } else { FindActivePrograms 0 } if { $opts(-actives) } { return [array names services] } if { $opts(-disconnect) } { if { $remoteserver == "" } { error "error. There is no connected remote server" } if { $remoteserverType == "local" } { interp delete local } elseif { $remoteserverType == "gdb" } { catch { close [lindex $remoteserver 0] } } set remoteserver "" ................................................................................ # dirty trick to avoid the slave interp block interp eval local { proc updatemaster {} { sendmaster update after 3000 updatemaster } } interp alias local exit "" interp delete local local eval { set argc 0 ; set argv "" } set err [catch {package present registry} ver] if { !$err } { interp alias local registry "" registry interp eval local package provide registry $ver } if { ![info exists options(LocalDebuggingType)] || $options(LocalDebuggingType) == "tk" } { interp eval local [list load {} Tk] } set remoteserverType local if { $currentfile == "" } { error "Error. there is no current file" } set remoteserver $currentfile TakeArrowOutFromText } elseif { $opts(-debugcplusplus) } { ................................................................................ set pwd [pwd] cd $dir set fid [open "|gdb -q |& cat" r+] cd $pwd set remoteserver [list $fid $opts(program) start] fconfigure $fid -blocking 0 -buffering line fileevent $fid readable RamDebugger::RecieveFromGdb TakeArrowOutFromText } else { if { $opts(program) == "" } { if { $remoteserver != "" } { return $remoteserver } else { error "error. $usagestring\nActive programs: [array names services]" } } if { [lsearch [array names services] $opts(program)] == -1 } { ................................................................................ variable stopnext 0 variable contto "" variable outputline 0 variable lastprocname "" variable lastlevel 0 variable currentfile "" } if { [info commands ::RDC::bgerror_base] == "" } { auto_import ::bgerror if { [info commands ::bgerror] != "" } { rename ::bgerror ::RDC::bgerror_base } proc ::bgerror err { RDC::SendDev [list RamDebugger::RecieveErrorFromProgram $err $::errorInfo] } } if { [info commands ::RDC::puts_base] == "" } { rename ::puts ::RDC::puts_base proc ::puts args { set argsN $args set hasnewline 1 if { [lindex $argsN 0] == "-nonewline" } { set hasnewline 0 set argsN [lrange $argsN 1 end] } set channelId stdout if { [llength $argsN] == 2 } { set channelId [lindex $argsN 0] set argsN [lrange $argsN 1 end] } if { [llength $argsN] == 1 && [regexp {stdout|stderr} $channelId] } { RDC::SendDev [list RamDebugger::RecieveOutputFromProgram $channelId \ [lindex $argsN 0] $hasnewline] } else { eval ::RDC::puts_base $args } } } if { [info commands ::RDC::infoproc] == "" } { rename ::info ::RDC::infoproc proc ::info { args } { set retval [uplevel 1 ::RDC::infoproc $args] if { [lindex $args 0] == "script" && $retval == "" } { return $::RDC::currentfile } return $retval } } proc RDC::SendDev { comm } { SENDDEVBODY } proc RDC::MeasureTime { name timestr } { SendDev [list RamDebugger::RecieveTimeFromProgram $name [lindex $timestr 0]] } proc RDC::Continue {} { ................................................................................ if { $evalhandler != "" } { RDC::SendDev "$evalhandler [list [list $err $returnvalue]]" } else { RDC::SendDev [list RamDebugger::RecieveFromProgramExpr $err $returnvalue] } } } } if { $remoteserverType == "local" } { set remotecomm [string map [list SENDDEVBODY "sendmaster \$comm"] \ $remotecomm] } elseif { $remoteserverType == "gdb" } { set remotecomm "set confirm off\n" append remotecomm "file \"[lindex $opts(program) 0]\"\n" if { [lindex $opts(program) 1] != "" } { append remotecomm "set args [lindex $opts(program) 2]" } } elseif { $::tcl_platform(platform) == "windows" } { set remotecomm [string map [list SENDDEVBODY "comm::comm send $debuggerserverNum \$comm"] \ $remotecomm] } else { set remotecomm [string map [list SENDDEVBODY "send \"$debuggerserver\" \$comm"] \ $remotecomm] } ................................................................................ EvalRemote $remotecomm catch { unset instrumentedfilesSent } if { $debuggerstate == "" || $debuggerstate == "debug" } { set debuggerstate debug UpdateRemoteBreaks } if { $opts(-currentfile) } { EvalRemote [list set ::RDC::currentfile $currentfile] after idle [list RamDebugger::rlist -quiet -asmainfile $currentfile] } if { $opts(-debugcplusplus) } { EvalRemote "run" } return "Begin debugging of program '$remoteserver'" } proc RamDebugger::reval { args } { variable ExpressionResult variable debuggerstate ................................................................................ proc RamDebugger::rcont { args } { variable currentfile variable instrumentedfilesP variable instrumentedfilesR variable currentline variable fileslist variable debuggerstate variable remoteserverType if { $debuggerstate == "time" } { error "Command rcont cannot be used in 'time' mode. Check rtime" } set usagestring {usage: rcont ?switches? ?line? ................................................................................ ParseArgs $args $usagestring opts if { ![string is integer $opts(line)] } { error "line '$opts(line)' must be a number\n$usagestring" } if { $currentfile == "" } { error "There is no file selected\$usagestring" } if { $opts(line) != "" } { set currentline $opts(line) set filenum [lsearchfile $fileslist $currentfile] if { $remoteserverType != "gdb" } { set ipos [string first "RDC::F $filenum $currentline ;" $instrumentedfilesP($currentfile)] if { $ipos == -1 } { ................................................................................ set filenum [lsearchfile $fileslist $currentfile] EvalRemote [list set ::RDC::contto [list $filenum $currentline]] } EvalRemote [list set ::RDC::stopnext 0] EvalRemote ::RDC::Continue } else { if { $opts(line) != "" } { EvalRemote "tbreak [file tail $currentfile]:$currentline" } EvalRemote "cont" } } proc RamDebugger::rnext { args } { variable debuggerstate ................................................................................ variable remoteserver variable remoteserverType variable debuggerstate variable TimeMeasureData variable options set usagestring {usage: rlist ?switches? ?file? ?line? -h: displays usage -quiet: do not print anything -force: force to reload file -reinstrument: force to reinstrument -asmainfile: When debugging locally, the first file, first time must be list like this --: end of options } ParseArgs $args $usagestring opts set force $opts(-force) set reinstrument $opts(-reinstrument) if { ![string is integer $opts(line)] } { error "line '$opts(line)' must be a number\n$usagestring" ................................................................................ if { [regexp {\.(h|c|cc)$} $currentfile] } { set filetype c++ } else { set filetype tcl } if { $currentfileIsModified && ![info exists instrumentedfilesP($currentfile)] } { variable text set map [list "\n[string repeat { } 16]" "\n\t\t" "\n[string repeat { } 8]" "\n\t"] set files($currentfile) [string map $map [$text get 1.0 end-1c]] if { [lsearchfile $fileslist $currentfile] == -1 } { lappend fileslist $currentfile } ................................................................................ if { $debuggerstate == "time" && [info exists files($currentfile)] && \ (![info exists instrumentedfilesTime($currentfile)] || $force || $reinstrument) } { SetMessage "Instrumenting file '$currentfile' for time measure..." Instrumenter::DoWorkForTime $files($currentfile) $currentfile \ instrumentedfilesTime($currentfile) $TimeMeasureData SetMessage "" } if { $debuggerstate != "" && $remoteserver != "" && \ [info exists instrumentedfilesP($currentfile)] &&\ (![info exists instrumentedfilesSent($currentfile)] || \ $instrumentedfilesSent($currentfile) != $debuggerstate || $force) } { if { [catch { if { $debuggerstate == "debug" } { EvalRemote $instrumentedfilesP($currentfile) if { $opts(-asmainfile) } { EvalRemote $instrumentedfilesR($currentfile) } } else { EvalRemote $instrumentedfilesTime($currentfile) } set instrumentedfilesSent($currentfile) $debuggerstate FillListBox } errstring] } { set err $::errorInfo if { [catch { WarnWin $err }] } { puts $err ................................................................................ } } } if { $opts(line) != "" } { set currentline $opts(line) } if { $opts(-quiet) } { return "" } set lines [split $files($currentfile) \n] set retval "" for { set i -1 } { $i < 3 } { incr i } { append retval "[format %4d [expr $currentline+$i+1]] --> " append retval "[lindex $lines [expr $currentline+$i]]\n" } ................................................................................ ################################################################################ # Helper basic functions ################################################################################ proc RamDebugger::filenormalize { file } { if { $file == "New file" } { return $file } if { $::tcl_platform(platform) == "windows" } { catch { set file [file attributes $file -longname] } } else { set pwd [pwd] catch { cd [file dirname $file] set file [file join [pwd] [file tail $file]] } cd $pwd } return $file } proc RamDebugger::ParseArgs { args usagestring OptsName } { upvar 1 $OptsName opts set switches "" foreach i [lrange [split $usagestring \n] 1 end] { if { [string trim $i] == "" } { break } regexp {(.*):} $i {} sw ................................................................................ error "error. $usagestring" } else { set opts([string trim [lindex $normalargs $i] ?]) "" } } } proc RamDebugger::MyNameIs { name id } { variable services set services($name) $id } proc RamDebugger::FindActivePrograms { force } { variable services variable debuggerserver variable debuggerserverNum ................................................................................ for { set i 12350 } { $i < 12360 } { incr i } { if { $i == $debuggerserverNum } { continue } incr iprogress 40 if { $iprogress > 90 } { set iprogress 90 } RamDebugger::ProgressVar $iprogress set comm [list comm::comm send -async $i \ [list catch [list comm::givename $debuggerserverNum]]] if { [catch $comm] && $force != 2 } { break } } # dirty trick to make array exist set services(11) "" unset services(11) WaitState 0 RamDebugger::ProgressVar 100 RamDebugger::SetMessage "Searching external programs...done" ................................................................................ stderr { TextOutInsertRed $string } } TextOutRaise update } proc RamDebugger::EvalRemote { comm } { variable remoteserver variable remoteserverNum variable remoteserverType variable gdblog ................................................................................ } else { send $remoteserver $comm } } proc RamDebugger::GiveInstFile { file onlyifnewer filetype } { variable CacheDir if { [info exists CacheDir] } { regsub -all {(/|:)} [file join [pwd] [file dirname $file]] \# modpath set modpath [string trimright $modpath ".\#"] if { $filetype == "I" } { set instfile [file join $CacheDir [file tail $file]_$modpath.info] } elseif { $filetype == "P" } { ................................................................................ if { [regexp {^\s*([0-9]+)} $aa {} line] } { set file $currentfile } else { set line "" #puts ---$aa--- #WarnWin "Could not do a '$state'" } } if { $line != "" } { set remoteserver [lreplace $remoteserver 2 2 ""] set filenum [lsearch $fileslist $file] if { $filenum == -1 } { set err [catch {OpenFileF $file} errstring] if { $err } { WarnWin "Could not open file '$file' for stopping program" return } set filenum [lsearch $fileslist $file] } RecieveFromProgram "" $filenum $line "" "" "" return } } ................................................................................ } } CheckEvalEntries res "" [list 0 $list] } return } setbreakpoints { if { [regexp {FINISHED SET BREAKPOINTS\s*$} $aa] } { set remoteserver [lreplace $remoteserver 2 2 ""] } return } } if { [regexp {Breakpoint\s[0-9]+,\s+(\S+\s+\([^\)]*\))\s+at\s+([^:]+):([0-9]+)} \ $aa {} procname file line] } { if { [file pathtype $file] == "relative" } { set executable [lindex $options(debugcplusplus) 0] set dir [file dirname $executable] if { [file exists [file join $dir $file]] } { set file [file join $dir $file] } if { [info exists cproject::project] && \ ................................................................................ } } if { [file pathtype $file] == "volumerelative" } { set drive [string trim [lindex [file split [pwd]] 0] /] set file $drive$file } set file [filenormalize $file] set found 0 foreach i $breakpoints { set breaknum [lindex $i 0] set line_in [lindex $i 2] set file_in [lindex $i 1] if { $line == $line_in && [AreFilesEqual $file $file_in] } { set found 1 break } # CONDITION is forgotten by now } if { $found } { set filenum [lsearch $fileslist $file] if { $filenum == -1 } { set err [catch {OpenFileF $file} errstring] if { $err } { WarnWin "Could not open file '$file' for stopping program" return } set filenum [lsearch $fileslist $file] } RecieveFromProgram $breaknum $filenum $line $procname "" "" return } else { WarnWin "Problems finding breakpoint in file $file ($aa)" } return } if { [regexp {Program exited[^\n]*} $aa mess] } { set err [catch { close $fid } errstring] set debuggerstate "" set remoteserverType "" set remoteserver "" if { $err } { append mess " ($errstring)" } WarnWin $mess } TextOutInsert $aa TextOutRaise } ################################################################################ # RamDebugger::Instrumenter ################################################################################ namespace eval RamDebugger::Instrumenter { variable stack variable words variable currentword variable wordtype variable wordtypeline variable wordtypepos variable DoInstrument variable OutputType variable NeedsNamespaceClose variable braceslevel variable level variable colors } proc RamDebugger::Instrumenter::InitState {} { variable stack "" variable words "" variable currentword "" variable wordtype "" variable wordtypeline "" variable wordtypepos "" variable DoInstrument 0 variable OutputType variable NeedsNamespaceClose 0 variable braceslevel 0 variable level 0 variable colors foreach i [list return break while eval foreach for if else elseif error switch default \ continue] { set colors($i) magenta } foreach i [list variable set global] { set colors($i) green } } proc RamDebugger::Instrumenter::PushState { type line newblocknameP newblocknameR } { variable stack variable words variable currentword variable wordtype variable wordtypeline variable wordtypepos variable DoInstrument variable OutputType variable NeedsNamespaceClose variable braceslevel variable level set NewDoInstrument 0 if { $OutputType == "P" } { set NewOutputType PP } else { set NewOutputType $OutputType } set PushState 0 if { $type == "\[" } { set PushState 1 if { $DoInstrument == 1 } { set NewDoInstrument 1 } else { set NewDoInstrument 0 } } else { if { [lindex $words 0] == "proc" && [llength $words] == 3 } { set NewDoInstrument 1 } elseif { $DoInstrument == 0 } { if { [lindex $words 0] == "namespace" && [lindex $words 1] == "eval" && \ [llength $words] >= 3 } { set PushState 1 # if { $OutputType == "R" } { # upvar 2 $newblocknameP newblock # } else { upvar 2 $newblocknameR newblock } # append newblock "namespace eval [lindex $words 2] \{\n" # set NeedsNamespaceClose 1 } } elseif { $DoInstrument == 1 } { switch -- [lindex $words 0] { "if" { if { [llength $words] == 2 } { set NewDoInstrument 1 } elseif { [lindex $words end] == "then" || [lindex $words end] == "else" } { set NewDoInstrument 1 } elseif { [lindex $words end-1] == "elseif" } { set NewDoInstrument 1 } } "namespace" { if { [lindex $words 1] == "eval" && [llength $words] >= 3 } { set NewDoInstrument 1 if { $OutputType == "R" } { upvar 2 $newblocknameP newblockP append newblockP "namespace eval [lindex $words 2] \{\n" set NeedsNamespaceClose 1 } } } "catch" { if { [llength $words] == 1 } { set NewDoInstrument 1 } } "while" { if { [llength $words] == 2 } { set NewDoInstrument 1 } } "foreach" { if { [llength $words] >= 3 } { set NewDoInstrument 1 } } "for" { if { [llength $words] == 4 } { set NewDoInstrument 1 } } "eval" { set NewDoInstrument 1 } "uplevel" { set len [llength $words] if { [regexp {[\#]?[0-9]+} [lindex $words 1]] } { incr len -1 } if { $len > 0 } { set NewDoInstrument 1 } } "switch" { for { set i 1 } { $i < [llength $words] } { incr i } { if { [lindex $words $i] == "--" } { incr i break } elseif { ![string match -* [lindex $words $i]] } { break } } set len [expr [llength $words]-$i] if { $len == 1 } { set NewDoInstrument 2 } } } } elseif { $DoInstrument == 2 } { if { [llength $words]%2 } { set NewDoInstrument 1 } } } if { !$PushState && !$NewDoInstrument } { return 1 } incr level lappend stack [list $words $currentword $wordtype $wordtypeline \ $wordtypepos $DoInstrument $OutputType $NeedsNamespaceClose $braceslevel $line $type] set words "" set currentword "" set wordtype "" set wordtypeline "" set wordtypepos "" set DoInstrument $NewDoInstrument set OutputType $NewOutputType set NeedsNamespaceClose 0 set braceslevel 0 return 0 } proc RamDebugger::Instrumenter::PopState { type line newblocknameP newblocknameR } { variable stack variable wordtype variable words variable currentword variable wordtype variable wordtypeline variable wordtypepos variable DoInstrument variable OutputType variable NeedsNamespaceClose variable braceslevel variable level set lasttype [lindex [lindex $stack end] end] if { $type == "\]" && $lasttype != "\[" } { return 1 } if { $type == "\}" } { if { $wordtype == "w" } { set numopen 0 for { set i 0 } { $i < [string length $currentword] } { incr i } { switch -- [string index $currentword $i] { "\\" { incr i } \{ { incr numopen } \} { incr numopen -1 } } } if { $numopen } { return 1 } } if { $lasttype != "\{" } { foreach i $stack { if { [lindex $i end] == "\{" } { set text "Using a close brace (\}) in line $line when there is an open brace " append text "in line [lindex $i end-1] and an open bracket (\[) in line " append text "[lindex [lindex $stack end] end-1]" error $text } return 1 } } } foreach [list words currentword wordtype wordtypeline wordtypepos DoInstrument OutputType \ NeedsNamespaceClose braceslevel] [lindex $stack end] break set stack [lreplace $stack end end] incr level -1 if { $NeedsNamespaceClose } { upvar 2 $newblocknameP newblockP append newblockP "\}\n" set NeedsNamespaceClose 0 } return 0 } proc RamDebugger::Instrumenter::CheckEndOfFileState {} { variable stack set text "" foreach i $stack { set line [lindex $i end-1] set type [lindex $i end] append text "There is a block of type ($type) beginning at line $line " append text "that is not closed at the end of the file\n" } if { $text != "" } { error $text } } # newblocknameP is for procs # newblocknameR is for the rest proc RamDebugger::Instrumenter::DoWork { block filenum newblocknameP newblocknameR blockinfoname } { variable words variable currentword variable wordtype variable wordtypeline variable DoInstrument variable OutputType variable braceslevel variable level variable colors set length [string length $block] if { $length >= 1000 } { RamDebugger::ProgressVar 0 1 } # a trick: it is the same to use newblockP or newblockPP. Only convenience upvar $newblocknameP newblockP upvar $newblocknameP newblockPP upvar $newblocknameR newblockR upvar $blockinfoname blockinfo set newblockP "" set newblockR "" set blockinfo "" set blockinfocurrent [list 0 n] InitState set DoInstrument 1 set OutputType R append newblockP "# RamDebugger instrumented file. InstrumentProcs=1\n" append newblockR "# RamDebugger instrumented file. InstrumentProcs=0\n" set braceslevelNoEval 0 set checkExtraCharsAfterCQB "" set lastc "" set lastinstrumentedline "" set line 1 set ichar 0 set icharline 0 foreach c [split $block ""] { if { $ichar%1000 == 0 } { RamDebugger::ProgressVar [expr $ichar*100/$length] } if { $checkExtraCharsAfterCQB != "" } { if { ![string is space $c] && $c != "\}" && $c != "\]" && $c != "\\" && $c != ";" } { if { $c == "\"" && $checkExtraCharsAfterCQB == "\}" } { # nothing } else { set text "There is a non valid character ($c) in line $line " append text "after a closing block with ($checkExtraCharsAfterCQB)" error $text } } set checkExtraCharsAfterCQB "" } if { $DoInstrument == 1 && $lastinstrumentedline != $line && \ ![string is space $c] && \ $c != "\#" && $words == "" } { append newblock$OutputType "RDC::F $filenum $line ; " set lastinstrumentedline $line } set consumed 0 switch -- $c { \" { if { $lastc != "\\" && [lindex $words 0] != "\#" } { if { $wordtype == "" } { set wordtype \" set wordtypeline $line set wordtypepos $icharline set consumed 1 } elseif { $wordtype == "\"" } { set wordtype "" lappend words $currentword set currentword "" set consumed 1 set checkExtraCharsAfterCQB \" if { $wordtypeline == $line } { lappend blockinfocurrent grey $wordtypepos [expr $icharline+1] } else { lappend blockinfocurrent grey 0 [expr $icharline+1] } set wordtypeline 0 if { $OutputType == "R" && $words == "proc" } { if { $lastinstrumentedline == $line } { set numdel [expr 4+[string length "RDC::F $filenum $line ; "]] } else { set numdel 4 } set newblockR [string range $newblockR 0 end-$numdel] append newblockP $words set OutputType P } } elseif { $wordtype == "\{" } { if { ![info exists quoteintobraceline] } { set quoteintobraceline $line set quoteintobracepos $icharline } else { if { $line == $quoteintobraceline } { lappend blockinfocurrent grey $quoteintobracepos [expr $icharline+1] } unset quoteintobraceline quoteintobracepos } } } } \{ { if { $lastc != "\\" } { if { $wordtype == "\{" } { incr braceslevelNoEval } elseif { $wordtype == "\"" || $wordtype == "w" } { incr braceslevel } else { set consumed 1 set fail [PushState \{ $line $newblocknameP $newblocknameR] if { $fail } { set wordtype \{ set wordtypeline $line set braceslevelNoEval 1 } else { set lastinstrumentedline $line } } } } \} { if { $lastc != "\\" } { if { $wordtype == "\{" } { incr braceslevelNoEval -1 if { $braceslevelNoEval == 0 } { set wordtype "" lappend words $currentword set currentword "" set consumed 1 if { [lindex $words 0] != "\#" } { set checkExtraCharsAfterCQB \} } if { $OutputType == "R" && $words == "proc" } { if { $lastinstrumentedline == $line } { set numdel [expr 4+[string length "RDC::F $filenum $line ; "]] } else { set numdel 4 } set newblockR [string range $newblockR 0 end-$numdel] append newblockP $words set OutputType P } } } elseif { $braceslevel > 0 } { incr braceslevel -1 } else { set wordtype_before $wordtype set fail [PopState \} $line $newblocknameP $newblocknameR] if { !$fail } { if { $wordtype_before == "\"" } { set text "Quoted text (\") in line $line " append text "contains and invalid brace (\})" error $text } set consumed 1 lappend words "" if { [lindex $words 0] != "\#" } { set checkExtraCharsAfterCQB \} } } } } } " " - \t { if { $lastc != "\\" } { if { $wordtype == "w" } { set consumed 1 set wordtype "" lappend words $currentword set currentword "" if { $OutputType == "R" && $words == "proc" } { if { $lastinstrumentedline == $line } { set numdel [expr 4+[string length "RDC::F $filenum $line ; "]] } else { set numdel 4 } set newblockR [string range $newblockR 0 end-$numdel] append newblockP $words set OutputType P } if { [lindex $words 0] == "proc" } { if { [llength $words] == 1 } { set icharlineold [expr $icharline-4] lappend blockinfocurrent magenta $icharlineold $icharline } elseif { [llength $words] == 2 } { set icharlineold [expr $icharline-[string length [lindex $words end]]] lappend blockinfocurrent blue $icharlineold $icharline } } elseif { [info exists colors([lindex $words end])] } { set icharlineold [expr $icharline-[string length [lindex $words end]]] lappend blockinfocurrent $colors([lindex $words end]) $icharlineold \ $icharline } } elseif { $wordtype == "" } { set consumed 1 } } } \[ { if { $lastc != "\\" && $wordtype != "\{" } { if { $wordtype == "" } { set wordtype "w" } set consumed 1 PushState \[ $line $newblocknameP $newblocknameR set lastinstrumentedline $line } } \] { if { $lastc != "\\" && $wordtype != "\"" && $wordtype != "\{" } { set fail [PopState \] $line $newblocknameP $newblocknameR] if { !$fail } { set consumed 1 } # note: the word inside words is not correct when using [] } } \n { if { [lindex $words 0] == "\#" } { lappend blockinfocurrent red $commentpos $icharline } elseif { $wordtype == "\"" } { if { $wordtypeline == $line } { lappend blockinfocurrent grey $wordtypepos $icharline } else { lappend blockinfocurrent grey 0 $icharline } } elseif { $wordtype == "w" && [info exists colors($currentword)] } { set icharlineold [expr $icharline-[string length $currentword]] lappend blockinfocurrent $colors($currentword) $icharlineold \ $icharline } lappend blockinfo $blockinfocurrent incr line set blockinfocurrent [expr $level+$braceslevelNoEval] if { ($wordtype == "w" || $wordtype == "\"") && $braceslevel > 0 } { lappend blockinfocurrent "n" } elseif { $wordtype != "\{" } { set consumed 1 if { $lastc != "\\" && $wordtype != "\"" } { # if { $wordtype == "\"" } { # set text "Quotes (\") in line [expr $line-1] " # append text "are not closed" # error $text # } set words "" set currentword "" set wordtype "" if { $OutputType == "P" } { append newblockP $c set OutputType R } lappend blockinfocurrent "n" } else { if { $wordtype == "w" } { set wordtype "" lappend words $currentword set currentword "" } lappend blockinfocurrent "c" } } else { lappend blockinfocurrent "n" } } \# { if { [llength $words] == 0 && $currentword == "" && $wordtype == "" } { set consumed 1 lappend words \# set commentpos $icharline } } ; { if { $lastc != "\\" && $wordtype != "\"" && $wordtype != "\{" && \ [lindex $words 0] != "\#"} { set consumed 1 set words "" set currentword "" set wordtype "" if { $OutputType == "P" } { append newblockP $c set OutputType R } } } } append newblock$OutputType $c if { !$consumed } { if { $wordtype == "" } { set wordtype w set wordtypeline $line } append currentword $c } if { $lastc == "\\" && $c == "\\" } { set lastc "\\\\" } else { set lastc $c } incr ichar if { $c == "\t" } { incr icharline 8 } elseif { $c != "\n" } { incr icharline } else { set icharline 0 } } lappend blockinfo $blockinfocurrent if { $wordtype != "" && $wordtype != "w" } { set text "There is a block of type ($wordtype) beginning at line $wordtypeline " append text "that is not closed at the end of the file" error $text } CheckEndOfFileState if { $length >= 1000 } { RamDebugger::ProgressVar 100 } } proc RamDebugger::Instrumenter::DoWorkForTime { block filename newblockname timedata } { upvar $newblockname newblock set newblock "# RamDebugger time instrumented file\n" set lines [split $block \n] set lastline "" set lastpos "" foreach i $timedata { foreach "name file lineini lineend lasttime" $i { if { $file != $filename } { continue } if { $lineini != $lastline } { set lastpos 0 } set text "RDC::MeasureTime [list $name] \[time { " set linepos [expr $lineini-1] set line [lindex $lines $linepos] set newline [string range $line 0 [expr $lastpos-1]] append newline $text [string range $line $lastpos end] set lines [lreplace $lines $linepos $linepos $newline] set lastline $lineini set lastpos [expr $lastpos+[string length $text]] set linepos [expr $lineend-1] set newline "[lindex $lines $linepos] }]" set lines [lreplace $lines $linepos $linepos $newline] } } regsub -all {RDC::F [0-9]+ [0-9+] ; } [join $lines \n] {} newblock2 append newblock $newblock2 } proc RamDebugger::Instrumenter::DoWorkForC++ { block blockinfoname { braceslevelIni 0 } } { set length [string length $block] if { $length >= 5000 } { RamDebugger::ProgressVar 0 1 } upvar $blockinfoname blockinfo set blockinfo "" set blockinfocurrent [list $braceslevelIni n] foreach i [list \#include static const if else new delete for return sizeof while continue \ break class typedef struct \#else \#endif \#if] { set colors($i) magenta } foreach i [list \#ifdef \#ifndef \#define \#undef] { set colors($i) magenta2 } foreach i [list char int double void ] { set colors($i) green } set wordtype "" set wordtypeline "" # = -1 -> // ; > 0 -> comment type /* set commentlevel 0 set braceslevel $braceslevelIni set braceshistory "" set lastc "" set line 1 set ichar 0 set icharline 0 set finishedline 0 set nextiscyan 0 set simplechar "" foreach c [split $block ""] { if { $ichar%5000 == 0 } { RamDebugger::ProgressVar [expr $ichar*100/$length] } if { $simplechar != "" } { foreach "iline icharinto" $simplechar break if { $line > $iline } { error "error in line $iline, position $icharinto. There is no closing (')" } if { $c == "'" } { set simplechar "" } set lastc $c incr ichar if { $c == "\t" } { incr icharline 8 } elseif { $c != "\n" } { incr icharline } else { set icharline 0 } continue } switch -- $c { \" { if { $commentlevel } { # nothing } elseif { $wordtype != "\"" } { set wordtype \" set wordtypeline $line set wordtypepos $icharline set finishedline 0 } elseif { $lastc != "\\" } { set wordtype "" lappend blockinfocurrent grey $wordtypepos [expr $icharline+1] } } ' { if { !$commentlevel && $wordtype != "\"" } { set simplechar [list $line $icharline] } } \{ { if { $commentlevel || $wordtype == "\"" } { #nothing } else { if { $wordtype == "w" } { if { [info exists colors($currentword)] } { lappend blockinfocurrent $colors($currentword) $wordtypepos \ $icharline if { $colors($currentword) == "green" } { set nextiscyan 1 } } elseif { $nextiscyan } { lappend blockinfocurrent cyan $wordtypepos \ $icharline set nextiscyan 0 } set wordtype "" } incr braceslevel lappend braceshistory [list o $braceslevel $line $icharline] set finishedline 1 } } \} { if { $commentlevel || $wordtype == "\"" } { #nothing } else { if { $wordtype == "w" } { if { [info exists colors($currentword)] } { lappend blockinfocurrent $colors($currentword) $wordtypepos \ $icharline if { $colors($currentword) == "green" || \ $colors($currentword) == "magenta2" } { set nextiscyan 1 } } elseif { $nextiscyan } { lappend blockinfocurrent cyan $wordtypepos \ $icharline set nextiscyan 0 } set wordtype "" } incr braceslevel -1 lappend braceshistory [list c $braceslevel $line $icharline] if { $braceslevel < 0 } { if { $braceslevelIni == 0 } { RamDebugger::TextOutClear RamDebugger::TextOutRaise RamDebugger::TextOutInsert "BRACES POSITIONS\n" set file $RamDebugger::currentfile foreach i $braceshistory { switch [lindex $i 0] { o { set tt "open brace" } c { set tt "close brace" } } set data "$file:[lindex $i 2] $tt pos=[lindex $i 3] " append data "Level after=[lindex $i 1]\n" RamDebugger::TextOutInsert $data } } error "error in line $line. There is one unmatched closing brace (\})" } set finishedline 1 } } * { if { $commentlevel == -1 || $wordtype == "\"" } { #nothing } elseif { $lastc == "/" } { if { $commentlevel == 0 } { set wordtype "" set wordtypepos [expr $icharline-1] } incr commentlevel } elseif { !$commentlevel && $wordtype == "w" } { if { [info exists colors($currentword)] } { lappend blockinfocurrent $colors($currentword) $wordtypepos \ $icharline if { $colors($currentword) == "green" || \ $colors($currentword) == "magenta2" } { set nextiscyan 1 } } elseif { $nextiscyan } { lappend blockinfocurrent cyan $wordtypepos \ $icharline set nextiscyan 0 } set wordtype "" } } / { if { $commentlevel == -1 || $wordtype == "\"" } { #nothing } elseif { !$commentlevel && $lastc == "/" } { set wordtype "" set wordtypepos [expr $icharline-1] set commentlevel -1 } elseif { $lastc == "*" } { set wordtype "" if { $commentlevel >= 1 } { incr commentlevel -1 if { $commentlevel == 0 } { lappend blockinfocurrent red $wordtypepos [expr $icharline+1] } } } elseif { !$commentlevel && $wordtype == "w" } { if { [info exists colors($currentword)] } { lappend blockinfocurrent $colors($currentword) $wordtypepos \ $icharline if { $colors($currentword) == "green" || \ $colors($currentword) == "magenta2" } { set nextiscyan 1 } } elseif { $nextiscyan } { lappend blockinfocurrent cyan $wordtypepos \ $icharline set nextiscyan 0 } set wordtype "" } } \( { if { !$commentlevel && $braceslevel == 0 && $wordtype != "\"" } { set ipos [string first :: $currentword] if { $ipos == -1 } { lappend blockinfocurrent blue $wordtypepos $icharline } else { lappend blockinfocurrent green $wordtypepos [expr $wordtypepos+$ipos+2] lappend blockinfocurrent blue [expr $wordtypepos+$ipos+2] $icharline } set nextiscyan 0 } elseif { $wordtype == "w" } { if { [info exists colors($currentword)] } { lappend blockinfocurrent $colors($currentword) $wordtypepos \ $icharline if { $colors($currentword) == "green" || \ $colors($currentword) == "magenta2" } { set nextiscyan 1 } } elseif { $nextiscyan } { lappend blockinfocurrent cyan $wordtypepos \ $icharline set nextiscyan 0 } set wordtype "" } } ";" { if { !$commentlevel && $wordtype == "w" } { if { [info exists colors($currentword)] } { lappend blockinfocurrent $colors($currentword) $wordtypepos \ $icharline if { $colors($currentword) == "green" || \ $colors($currentword) == "magenta2" } { set nextiscyan 1 } } elseif { $nextiscyan } { lappend blockinfocurrent cyan $wordtypepos \ $icharline set nextiscyan 0 } set wordtype "" } if { !$commentlevel && $wordtype != "\"" } { set finishedline 1 } } \n { if { $wordtype == "\"" } { lappend blockinfocurrent grey $wordtypepos $icharline set wordtypepos 0 } elseif { $wordtype == "w" } { if { [info exists colors($currentword)] } { set icharlineold [expr $icharline-[string length $currentword]] lappend blockinfocurrent $colors($currentword) $icharlineold \ $icharline if { $colors($currentword) == "green" || \ $colors($currentword) == "magenta2" } { set nextiscyan 1 } } elseif { $nextiscyan } { lappend blockinfocurrent cyan $wordtypepos \ $icharline set nextiscyan 0 } set wordtype "" } elseif { $commentlevel } { lappend blockinfocurrent red $wordtypepos $icharline set wordtypepos 0 if { $commentlevel == -1 } { set commentlevel 0 } set finishedline 1 } lappend blockinfo $blockinfocurrent incr line set blockinfocurrent [expr $braceslevel] if { $finishedline } { lappend blockinfocurrent "n" } else { lappend blockinfocurrent "c" } } default { if { $commentlevel || $wordtype == "\"" } { # nothing } elseif { $wordtype == "" } { if { [string is wordchar $c] || $c == "\#" || $c == ":" || $c == "," } { set wordtype w set wordtypepos $icharline set currentword $c set finishedline 0 } } elseif { $wordtype == "w" } { if { [string is wordchar $c] || $c == "\#" || $c == ":" || $c == "," } { append currentword $c } else { if { [info exists colors($currentword)] } { lappend blockinfocurrent $colors($currentword) $wordtypepos \ $icharline if { $colors($currentword) == "green" || \ $colors($currentword) == "magenta2" } { set nextiscyan 1 } } elseif { $nextiscyan } { lappend blockinfocurrent cyan $wordtypepos \ $icharline set nextiscyan 0 } set wordtype "" } } } } if { $lastc == "\\" && $c == "\\" } { set lastc "\\\\" } else { set lastc $c } incr ichar if { $c == "\t" } { incr icharline 8 } elseif { $c != "\n" } { incr icharline } else { set icharline 0 } } lappend blockinfo $blockinfocurrent if { $wordtype != "" && $wordtype != "w" } { set text "There is a block of type ($wordtype) beginning at line $wordtypeline " append text "that is not closed at the end of the file" error $text } if { $commentlevel > 0 } { error "error: There is a non-closed comment beginning at line $wordtypeline" } if { $braceslevel } { if { $braceslevelIni == 0 } { RamDebugger::TextOutClear RamDebugger::TextOutRaise RamDebugger::TextOutInsert "BRACES POSITIONS\n" set file $RamDebugger::currentfile foreach i $braceshistory { switch [lindex $i 0] { o { set tt "open brace" } c { set tt "close brace" } } set data "$file:[lindex $i 2] $tt pos=[lindex $i 3] Level after=[lindex $i 1]\n" RamDebugger::TextOutInsert $data } } error "error: There is a non-closed brace at the end of the file (see Output for details)" } if { $length >= 1000 } { RamDebugger::ProgressVar 100 } } ################################################################################ # RamDebugger GUI ################################################################################ # tkTabToWindow -- # This procedure moves the focus to the given widget. If the widget ................................................................................ -title "Savefile"] if { $file == "" } { return } set options(defaultdir) [file dirname $file] } else { set file $currentfile if { [file mtime $file] > $filesmtime($file) } { set ret [DialogWin::messageBox -default yes -icon question -message \ "File '$currentfile' has been modified outside RamDebugger. Loose external changes?" \ -parent $text -title "Warning" -type yescancel] if { $ret == "cancel" } { return -1 } } } SaveFileF $file return 0 } ................................................................................ {{All Files} * } } if { ![info exists options(defaultdir)] } { set options(defaultdir) [pwd] } set file [tk_getOpenFile -filetypes $types -initialdir $options(defaultdir) -parent $w \ -title "Open source file"] if { $file == "" } { return } OpenFileF $file -1 } proc RamDebugger::OpenFileF { file { force 0 } } { variable marker variable text variable files variable breakpoints variable currentfile variable currentfileIsModified variable WindowFilesList variable WindowFilesListCurr variable options if { $force == -1 } { set force 0 } else { if { [SaveFile ask] == -1 } { return } } WaitState 1 if { !$force } { set comm [list rlist -quiet $file {}] } elseif { $force == 2 } { set comm [list rlist -quiet -reinstrument $file {}] } else { set comm [list rlist -quiet -force $file {}] ................................................................................ if { [catch $comm errstring] } { WaitState 0 WarnWin [lindex [split $errstring \n] 0] return 1 } if { $file == $currentfile } { set idx [$text index insert] } else { set idx 1.0 } $marker delete arrow $marker delete break $marker delete arrowbreak set ed [$text cget -editable] $text conf -editable 1 $text clearundo ................................................................................ foreach i $breakpoints { if { ![AreFilesEqual [lindex $i 1] $file] } { continue } set line [lindex $i 2] UpdateArrowAndBreak $line 1 "" } UpdateRemoteBreaks set Numlines [scan [$text index end-1c] %d] set font [$text cget -font] $marker configure -scrollregion [list 0 0 [winfo reqwidth $marker] \ [expr $Numlines*[font metrics $font -linespace]]] $text mark set insert $idx $text see $idx wm title [winfo toplevel $text] "RamDebugger [file tail $currentfile]" set currentfileIsModified 0 if { [lsearch $WindowFilesList $file] != -1 } { set WindowFilesListCurr [lsearch $WindowFilesList $file] } else { incr WindowFilesListCurr if { $WindowFilesListCurr == [llength $WindowFilesList] } { lappend WindowFilesList $file } else { set WindowFilesList [lreplace $WindowFilesList $WindowFilesListCurr end $file] } } $text conf -editable 1 if { ![info exists options(RecentFiles)] } { set options(RecentFiles) "" } ................................................................................ set options(RecentFiles) [lreplace $options(RecentFiles) $ipos $ipos] } set options(RecentFiles) [linsert $options(RecentFiles) 0 $file] if { [llength $options(RecentFiles)] > 6 } { set options(RecentFiles) [lreplace $options(RecentFiles) 5 end] } set options(defaultdir) [file dirname $file] FillListBox WaitState 0 return 0 } proc RamDebugger::NewFile {} { variable marker ................................................................................ variable files variable instrumentedfilesInfo variable breakpoints variable currentfile variable currentfileIsModified variable WindowFilesList variable WindowFilesListCurr if { [SaveFile ask] == -1 } { return } WaitState 1 set currentfile "New file" set currentfileIsModified 0 $marker delete arrow $marker delete break $marker delete arrowbreak ................................................................................ set textO [$text original] $textO del 1.0 end $textO tag add normal 1.0 end $text conf -editable $ed FillListBox set Numlines [scan [$text index end-1c] %d] set font [$text cget -font] $marker configure -scrollregion [list 0 0 [winfo reqwidth $marker] \ [expr $Numlines*[font metrics $font -linespace]]] $text mark set insert 1.0 $text see 1.0 set instrumentedfilesInfo($currentfile) "" ................................................................................ SetMessage "Saved file '$file'" } proc RamDebugger::ViewInstrumentedFile { what } { variable marker variable text variable currentfile variable instrumentedfilesP variable instrumentedfilesR variable instrumentedfilesInfo variable gdblog if { [SaveFile ask] == -1 } { return } ................................................................................ } else { if { ![info exists instrumentedfilesInfo($currentfile)] } { WarnWin "There is no instrumented info file for file '$currentfile'" return } } WaitState 1 set ed [$text cget -editable] $text conf -editable 1 $text clearundo set textO [$text original] $textO del 1.0 end if { $what == "instrumentedP" } { ................................................................................ } else { set word "" set idx [$text index insert] set idx0 $idx while { [string is wordchar [$text get $idx0]] } { set word [$text get $idx0]$word set idx0 [$text index $idx0-1c] } set idx1 [$text index $idx+1c] while { [string is wordchar [$text get $idx1]] } { append word [$text get $idx1] set idx1 [$text index $idx1+1c] } if { $word == "" } { return } } HelpViewer::HelpSearchWord $word } proc RamDebugger::DebugProgram { name } { variable currentfile rdebug $name if { $currentfile != "" } { rlist -quiet $currentfile } } proc RamDebugger::ActualizeActivePrograms { menu { force 0 } } { variable mainframe variable remoteserver WaitState 1 SetMessage "Searching for active programs..." if { $force == 2 } { set services [rdebug -forceupdate2 -actives] } elseif { $force } { set services [rdebug -forceupdate -actives] } else { set services [rdebug -actives] } $menu del 0 end if { [llength $services] == 0 } { $menu add command -label "There are no active programs" -state disabled } else { foreach i $services { $menu add command -label $i -command [list RamDebugger::DebugProgram $i] } } $menu add separator $menu add command -label "Current file" -command { RamDebugger::rdebug -currentfile } $menu add command -label "Debug c++" -command "RamDebugger::DebugCplusPlusWindow" $menu add command -label "Debug c++ (no ask)" -command "RamDebugger::DebugCplusPlusWindow 1" if { $::tcl_platform(platform) == "windows" } { $menu add command -label "Update remotes" -command \ "RamDebugger::ActualizeActivePrograms $menu 1" $menu add command -label "Update remotes slow" -command \ "RamDebugger::ActualizeActivePrograms $menu 2" } $menu add command -label Disconnect/Stop -command { if { [catch [list RamDebugger::rdebug -disconnect] errstring] } { WarnWin $errstring } } if { $remoteserver == "" } { $menu entryconfigure end -state disabled } SetMessage "" WaitState 0 } proc RamDebugger::GotoPreviusNextInWinList { what } { variable WindowFilesList variable WindowFilesListCurr switch $what { prev { incr WindowFilesListCurr -1 if { $WindowFilesListCurr < 0 } { set WindowFilesListCurr [expr [llength $WindowFilesList]-1] } OpenFileF [lindex $WindowFilesList $WindowFilesListCurr] } next { incr WindowFilesListCurr 1 if { $WindowFilesListCurr >= [llength $WindowFilesList] } { set WindowFilesListCurr 0 } OpenFileF [lindex $WindowFilesList $WindowFilesListCurr] } } } proc RamDebugger::ActualizeWindowsList { menu } { variable WindowFilesList variable WindowFilesListCurr variable text $menu del 0 end $menu add command -label "Previus" -acc "Alt-Left" -command \ "RamDebugger::GotoPreviusNextInWinList prev" $menu add command -label "Next" -acc "Alt-Right" -command \ "RamDebugger::GotoPreviusNextInWinList next" $menu add separator set ipos 0 foreach i $WindowFilesList { if { $ipos == $WindowFilesListCurr } { $menu add checkbutton -label $i -variable ::pp -command [list RamDebugger::OpenFileF $i] set ::pp 1 } else { $menu add command -label $i -command [list RamDebugger::OpenFileF $i] } incr ipos } } proc RamDebugger::AddRecentfilesToMenu { menu } { variable options $menu del 0 end if { ![info exists options(RecentFiles)] } { return } foreach i $options(RecentFiles) { $menu add command -label $i -command [list RamDebugger::OpenFileF $i] } } proc RamDebugger::SetGUIBreakpoint {} { variable images variable marker ................................................................................ } elseif { $hasarrow } { $marker create image 0 $ypos -anchor sw -image $images(arrow) -tags "arrow l$line" } elseif { $hasbreak } { $marker create image 0 $ypos -anchor sw -image $images(break) -tags "break l$line" } if { $hasarrow } { if { [focus] != $text } { after 100 "raise [winfo toplevel $text] ; focus -force $text" } $text see $line.0 $text mark set insert $line.0 } if { $IsInStop } { ................................................................................ variable options if { $remoteserver == "" || ($remoteserverType == "local" && !$IsInStop) } { if { $currentfile == "" } { WarnWin "Cannot start debugging. There is no currentfile" $text return } if { [regexp {\.(h|c|cc)$} $currentfile] } { if { $options(ConfirmStartDebugging) } { set ret [DialogWin::messageBox -default yes -icon question -message \ "Do you want to start to debug c++ program?" -parent $text \ -title "start debugging" -type yesnocancel] } else { set ret yes } if { $ret == "cancel" } { return } ................................................................................ after cancel $TextMotionAfterId if { [winfo exists $text.help] } { destroy $text.help } if { $X == -1 || $currentfile == "" || !$IsInStop } { return } set TextMotionAfterId [after 500 RamDebugger::DisplayVar $X $Y $x $y] } proc RamDebugger::DisplayVar { X Y x y } { variable text variable remoteserverType variable debuggerstate if { $debuggerstate != "debug" } { return } if { $X != [winfo pointerx $text] || $Y != [winfo pointery $text] } { return } set idx [$text index @$x,$y] set range [$text tag ranges sel] if { $range != "" && [$text compare [lindex $range 0] <= $idx] && \ [$text compare [lindex $range 1] >= $idx] } { set var [eval $text get $range] } else { set var "" set idx0 $idx while { [string is wordchar [$text get $idx0]] } { set var [$text get $idx0]$var set idx0 [$text index $idx0-1c] } set idx1 [$text index $idx+1c] while { [string is wordchar [$text get $idx1]] } { append var [$text get $idx1] set idx1 [$text index $idx1+1c] } if { $var == "" } { return } } if { $remoteserverType == "gdb" } { set comm "$var" } else { set comm "if { \[array exists $var] } { array get $var } else { set $var }" } # catch is here for strange situations, like when changing source file catch { set res [reval -handler [list RamDebugger::DisplayVar2 $var $X $Y $x $y] $comm] } } proc RamDebugger::DisplayVar2 { var X Y x y res } { variable text if { [lindex $res 0] == 0 } { set w $text.help if { [winfo exists $w] } { destroy $w } toplevel $w wm overrideredirect $w 1 wm transient $w $text wm geom $w +$X+$Y pack [label $w.l -bg white] $w.l conf -bd 1 -relief solid set val [lindex $res 1] if { [string length $val] > 50 } { set val [string range $val 0 46]... } $w.l conf -text "$var=$val" } } proc RamDebugger::DisplayVarWindowEval { what f { res "" } } { variable remoteserver variable remoteserverType set w [winfo toplevel $f] if { $what == "do" } { if { [string trim $DialogWinTop::user($w,expression)] == "" } { set DialogWinTop::user($w,type) "" return } set var $DialogWinTop::user($w,expression) if { $remoteserverType == "gdb" } { if { ![regexp {\[([0-9]+):([0-9]+)\]} $var {} ini1 end1] } { set ini1 1 set end1 1 } if { ![regexp {\[([0-9]+)::([0-9]+)\]} $var {} ini2 end2] } { set ini2 1 set end2 1 } set remoteserver [lreplace $remoteserver 2 2 [list getdata \ "RamDebugger::DisplayVarWindowEval res $f"]] set comm "" set isinit 0 for { set i1 $ini1 } { $i1 <= $end1 } { incr i1 } { regsub {\[([0-9]+):([0-9]+)\]} $var \[$i1\] varn for { set i2 $ini2 } { $i2 <= $end2 } { incr i2 } { regsub {\[([0-9]+)::([0-9]+)\]} $varn \[$i2\] varn if { !$isinit } { if { $ini1 != $end1 || $ini2 != $end2 } { append comm "printf \"MULTIPLE RESULT\\n\"\n" } append comm "whatis $varn\n" set isinit 1 } append comm "printf \"\\n$varn=\"\noutput $varn\nprintf \"\\n\"\n" } } append comm "printf \"FINISHED GETDATA\\n\"" EvalRemote $comm return } else { set comm { if { [array exists {VAR}] } { list array [array get {VAR}] } elseif { [info exists {VAR}] } { list variable [set {VAR}] } else { list expression [expr {VAR}] } } set comm [string map [list VAR [string trim $var]] $comm] } reval -handler [list RamDebugger::DisplayVarWindowEval res $f] $comm } else { set var $DialogWinTop::user($w,expression) $DialogWinTop::user($w,textv) conf -state normal $DialogWinTop::user($w,textv) del 1.0 end if { $remoteserverType == "gdb" } { if { [regexp {^(\s*MULTIPLE RESULT\s*type\s+=\s+char\s)(.*)} $res {} ini rest] } { set res $ini append res " \"" foreach "i c" [regexp -all -inline {'(.)'\n} $rest] { append res "$c" } append res "\"\n$rest" } set res [list 0 [list variable $res]] } switch [lindex $res 0] { 0 { $DialogWinTop::user($w,textv) conf -fg black set DialogWinTop::user($w,type) [lindex [lindex $res 1] 0] if { $DialogWinTop::user($w,type) == "array" } { foreach "name val" [lindex [lindex $res 1] 1] { $DialogWinTop::user($w,textv) insert end "${var}($name) = $val\n" } } elseif { $DialogWinTop::user($w,aslist) } { set DialogWinTop::user($w,type) list if { [catch { set list [lrange [lindex [lindex $res 1] 1] 0 end] }] } { $DialogWinTop::user($w,textv) insert end "Error: variable is not a list" } else { set ipos 0 foreach i $list { $DialogWinTop::user($w,textv) insert end "$ipos = $i\n" incr ipos } } } else { $DialogWinTop::user($w,textv) insert end [lindex [lindex $res 1] 1] } } 1 { set DialogWinTop::user($w,type) error $DialogWinTop::user($w,textv) conf -fg red $DialogWinTop::user($w,textv) insert end [lindex $res 1] } } $DialogWinTop::user($w,textv) conf -state disabled } } proc RamDebugger::DisplayVarWindowCancel { f } { destroy [winfo toplevel $f] } proc RamDebugger::DisplayVarWindow {} { variable text set range [$text tag ranges sel] if { $range != "" } { set var [eval $text get $range] } else { set idx [$text index insert] if { $idx != "" } { set var "" set idx0 $idx while { [string is wordchar [$text get $idx0]] } { set var [$text get $idx0]$var set idx0 [$text index $idx0-1c] } set idx1 [$text index $idx+1c] while { [string is wordchar [$text get $idx1]] } { append var [$text get $idx1] set idx1 [$text index $idx1+1c] } } else { set var "" } } set commands [list "RamDebugger::DisplayVarWindowEval do" RamDebugger::DisplayVarWindowCancel] set f [DialogWinTop::Init $text "View expression or variable" separator $commands \ "" Eval] set w [winfo toplevel $f] label $f.l1 -text "Expression:" -grid "0 px3" entry $f.e1 -textvariable DialogWinTop::user($w,expression) -grid "1 px3" set DialogWinTop::user($w,expression) $var set sw [ScrolledWindow $f.lf -relief sunken -borderwidth 0 -grid "0 2"] set DialogWinTop::user($w,textv) [text $sw.text -background white -wrap word -width 40 -height 10 \ -exportselection 0 -font FixedFont -highlightthickness 0] $sw setwidget $DialogWinTop::user($w,textv) if { $::tcl_platform(platform) != "windows" } { $sw.text conf -exportselection 1 } label $f.l2 -textvar DialogWinTop::user($w,type) -grid "0 w" -bg [CCColorActivo [$w cget -bg]] checkbutton $f.cb1 -text "As list" -variable DialogWinTop::user($w,aslist) -grid "1 w" \ -command "DialogWinTop::InvokeOK $f" set DialogWinTop::user($w,aslist) 0 supergrid::go $f tkTabToWindow $f.e1 bind [winfo toplevel $f] <Return> "DialogWinTop::InvokeOK $f" $DialogWinTop::user($w,textv) conf -state disabled bind $DialogWinTop::user($w,textv) <1> "focus $DialogWinTop::user($w,textv)" DialogWinTop::CreateWindow $f DialogWinTop::InvokeOK $f } proc RamDebugger::DisplayBreakpointsWindowSetCond {} { set curr [$DialogWinBreak::user(list) curselection] if { [llength $curr] != 1 } { return } set DialogWinBreak::user(cond) [lindex [$DialogWinBreak::user(list) get $curr] 3] } proc RamDebugger::DisplayBreakpointsWindow {} { variable text variable breakpoints variable currentfile CopyNamespace ::DialogWin ::DialogWinBreak set f [DialogWinBreak::Init $text "Breakpoints window" separator [list Delete \ "Delete all" View] "Apply Cond" Close] set w [winfo toplevel $f] label $f.l1 -text "Condition:" -grid 0 entry $f.e1 -textvariable DialogWinBreak::user(cond) -width 80 -grid "1 px3 py3" set sw [ScrolledWindow $f.lf -relief sunken -borderwidth 0 -grid "0 2"] set DialogWinBreak::user(list) [tablelist::tablelist $sw.lb -width 55\ -exportselection 0 \ -columns [list \ 4 Num left \ 15 File right \ 5 Line left \ 40 Condition left \ 40 Path left ] \ -labelcommand tablelist::sortByColumn \ -background white \ -selectbackground navy -selectforeground white \ -stretch 1 -selectmode extended \ -highlightthickness 0] $sw setwidget $DialogWinBreak::user(list) supergrid::go $f focus $DialogWinBreak::user(list) bind [$DialogWinBreak::user(list) bodypath] <Double-1> { focus $DialogWinBreak::user(list) RamDebugger::DisplayBreakpointsWindowSetCond } bind [$DialogWinBreak::user(list) bodypath] <ButtonPress-3> \ [bind TablelistBody <ButtonPress-1>] bind [$DialogWinBreak::user(list) bodypath] <ButtonRelease-3> { catch { destroy %W.menu } set menu [menu %W.menu] $menu add command -label "Apply condition" -command "DialogWinBreak::InvokeOK" $menu add command -label "View" -command "DialogWinBreak::InvokeButton 4" $menu add separator $menu add command -label "Delete" -command "DialogWinBreak::InvokeButton 2" tk_popup $menu %X %Y } foreach i $breakpoints { foreach "num file line cond" $i break $DialogWinBreak::user(list) insert end [list $num [file tail $file] $line $cond \ [file dirname $file]] } set action [DialogWinBreak::CreateWindow] while 1 { switch $action { 0 { DialogWinBreak::DestroyWindow namespace delete ::DialogWinBreak return } 1 { set curr [$DialogWinBreak::user(list) curselection] if { [llength $curr] != 1 } { WarnWin "Select just one breakpoint before applying condition" $w } else { set val [$DialogWinBreak::user(list) get $curr] rcond [lindex $val 0] $DialogWinBreak::user(cond) $DialogWinBreak::user(list) delete $curr $DialogWinBreak::user(list) insert $curr [lreplace $val 3 3 \ $DialogWinBreak::user(cond)] set file [file join [lindex $val 4 ] [lindex $val 1]] set line [lindex $val 2] if { $file == $currentfile } { $text mark set insert $line.0 $text see $line.0 } } } 2 { foreach i [$DialogWinBreak::user(list) curselection] { set ent [$DialogWinBreak::user(list) get $i] set num [lindex $ent 0] set file [file join [lindex $ent 4 ] [lindex $ent 1]] set line [lindex $ent 2] if { $file == $currentfile } { UpdateArrowAndBreak $line 0 "" } rdel $num } $DialogWinBreak::user(list) del 0 end foreach i $breakpoints { foreach "num file line cond" $i break $DialogWinBreak::user(list) insert end [list $num [file tail $file] $line $cond \ [file dirname $file]] } } 3 { set ret [DialogWinBreak::messageBox -default ok -icon warning -message \ "Are you sure to delete all breakpoints?" -parent $f \ -title "delete all breakpoints" -type okcancel] if { $ret == "ok" } { $DialogWinBreak::user(list) del 0 end foreach i $breakpoints { set num [lindex $i 0] set file [lindex $i 1] set line [lindex $i 2] if { $file == $currentfile } { UpdateArrowAndBreak $line 0 "" } rdel $num } } } 4 { set curr [$DialogWinBreak::user(list) curselection] if { [llength $curr] != 1 } { WarnWin "Select just one breakpoint in order to see the file" $w return } set val [$DialogWinBreak::user(list) get $curr] set file [file join [lindex $val 4 ] [lindex $val 1]] set line [lindex $val 2] if { $file != $currentfile } { OpenFileF $file } $text mark set insert $line.0 $text see $line.0 } } set action [DialogWinBreak::WaitForWindow] } } proc RamDebugger::CreateModifyFonts {} { variable options if { [lsearch [font names] NormalFont] == -1 } { font create NormalFont } if { [lsearch [font names] FixedFont] == -1 } { font create FixedFont } if { [lsearch [font names] HelpFont] == -1 } { font create HelpFont } eval font configure NormalFont $options(NormalFont) eval font configure FixedFont $options(FixedFont) eval font configure HelpFont $options(HelpFont) option add *font NormalFont } proc RamDebugger::UpdateFont { w but fontname } { set newfont [SelectFont $w.fonts -type dialog -parent $w -sampletext \ "RamDebugger is nice" -title "Select font"] if { $newfont == "" } { return } set list [list family size weight slant underline overstrike] foreach $list $newfont break set comm "font configure" lappend comm $fontname foreach i [lrange $list 0 3] { lappend comm -$i [set $i] } if { [info exists underline] && $underline != "" } { lappend comm -underline 1 } else { lappend comm -underline 0 } if { [info exists overstrike] && $overstrike != "" } { lappend comm -overstrike 1 } else { lappend comm -overstrike 0 } eval $comm regexp {^[^:]+} [$but cget -text] type set btext "$type: [font conf $fontname -family] [font conf $fontname -size] " append btext "[font conf $fontname -weight] [font conf $fontname -slant]" $but configure -text $btext } proc RamDebugger::PreferencesWindow {} { variable text variable options variable options_def set f [DialogWin::Init $text "Preferences window" separator [list Apply Defaults]] set w [winfo toplevel $f] TitleFrame $f.f1 -text [_ debugging] -grid 0 set f1 [$f.f1 getframe] if { $::tcl_platform(platform) == "windows" } { checkbutton $f1.cb0 -text "Automatically check remote files" -variable \ DialogWin::user(CheckRemotes) -grid "0 3 w" DynamicHelp::register $f1.cb0 balloon [string trim { this variable is only used on windows. It can be: 0: Only check remote programs on demand (useful if not making remote debugging, the start up is faster) 1: Register as remote and check remote programs on start up. The start up can be slower but is better when making remote debugging }] set DialogWin::user(CheckRemotes) $options(CheckRemotes) } checkbutton $f1.cb1 -text "Confirm start debugging" -variable \ DialogWin::user(ConfirmStartDebugging) -grid "0 3 w" DynamicHelp::register $f1.cb1 balloon [string trim { If this option is set, a confirmation window will be displayed when starting the execution of the debugger }] set DialogWin::user(ConfirmStartDebugging) $options(ConfirmStartDebugging) set helptext "When debugging locally, choose here if the debugged script is only TCL " append helptext "or also TK" Label $f1.l15 -text "Local debugging type:" -helptext $helptext -grid "0 e" radiobutton $f1.r1 -text "TCL" -variable DialogWin::user(LocalDebuggingType) -value tcl \ -grid "1 w" radiobutton $f1.r2 -text "TK" -variable DialogWin::user(LocalDebuggingType) -value tk \ -grid "2 w" set DialogWin::user(LocalDebuggingType) $options(LocalDebuggingType) Label $f1.l2 -text "Indent size TCL:" -helptext "Size used when indenting TCL with key: <Tab>" \ -grid "0 e" SpinBox $f1.sb -range "0 10 1" -textvariable DialogWin::user(indentsizeTCL) \ -width 4 -grid "1 2 px3" set DialogWin::user(indentsizeTCL) $options(indentsizeTCL) Label $f1.l3 -text "Indent size c++:" -helptext "Size used when indenting c++ with key: <Tab>" \ -grid "0 e" SpinBox $f1.sb2 -range "0 10 1" -textvariable DialogWin::user(indentsizeC++) \ -width 4 -grid "1 2 px3" set DialogWin::user(indentsizeC++) $options(indentsizeC++) TitleFrame $f.f2 -text [_ fonts] -grid 0 set f2 [$f.f2 getframe] foreach "but type fontname" [list $f2.b1 {GUI font} NormalFont $f2.b2 {Text font} FixedFont \ $f2.b3 {Help font} HelpFont] { set btext "$type: [font conf $fontname -family] [font conf $fontname -size] " append btext "[font conf $fontname -weight] [font conf $fontname -slant]" Button $but -text $btext -font $fontname -relief link -command \ "RamDebugger::UpdateFont $w $but $fontname" -grid "0 w" } supergrid::go $f1 supergrid::go $f2 supergrid::go $f focus $f1.cb1 set action [DialogWin::CreateWindow "" "" 200] while 1 { switch $action { 0 { DialogWin::DestroyWindow return } 1 - 2 { if { ![string is integer -strict $DialogWin::user(indentsizeTCL)] || \ $DialogWin::user(indentsizeTCL) < 0 || $DialogWin::user(indentsizeTCL) > 10 } { WarnWin "Error: indent size must be between 0 and 10" $w } elseif { ![string is integer -strict $DialogWin::user(indentsizeC++)] || \ $DialogWin::user(indentsizeC++) < 0 || $DialogWin::user(indentsizeC++) > 10 } { WarnWin "Error: indent size must be between 0 and 10" $w } else { set options(indentsizeTCL) $DialogWin::user(indentsizeTCL) set options(indentsizeC++) $DialogWin::user(indentsizeC++) set options(ConfirmStartDebugging) $DialogWin::user(ConfirmStartDebugging) set options(LocalDebuggingType) $DialogWin::user(LocalDebuggingType) if { [info exists options(CheckRemotes)] } { set options(CheckRemotes) $DialogWin::user(CheckRemotes) } if { $action == 1 } { DialogWin::DestroyWindow return } } } 3 { foreach i [list indentsizeTCL indentsizeC++ ConfirmStartDebugging LocalDebuggingType \ CheckRemotes NormalFont FixedFont HelpFont] { if { [info exists options_def($i)] } { set options($i) $options_def($i) set DialogWin::user($i) $options_def($i) } } CreateModifyFonts foreach "but fontname" [list $f2.b1 NormalFont $f2.b2 FixedFont $f2.b3 HelpFont] { regexp {^[^:]+} [$but cget -text] type set btext "$type: [font conf $fontname -family] [font conf $fontname -size] " append btext "[font conf $fontname -weight] [font conf $fontname -slant]" $but configure -text $btext } } } set action [DialogWin::WaitForWindow] } } proc RamDebugger::DisplayTimesWindowStart { f } { rtime -start } proc RamDebugger::DisplayTimesWindowReport { f } { variable text set f [DialogWin::Init $text "Timing report" separator "" -] set w [winfo toplevel $f] ComboBox $f.cb1 -textvariable DialogWin::user(units) -editable 0 \ -modifycmd { $DialogWin::user(text) del 1.0 end $DialogWin::user(text) ins end [RamDebugger::rtime -display $DialogWin::user(units)] } -width 10 -values [list microsec milisec sec min] -grid "0 w" set DialogWin::user(units) sec set sw [ScrolledWindow $f.lf -relief sunken -borderwidth 0 -grid "0 2"] text $sw.t $sw setwidget $sw.t set DialogWin::user(text) $sw.t bind $sw.t <1> "focus $sw.t" supergrid::go $f focus $sw.t $sw.t ins end [rtime -display sec] set action [DialogWin::CreateWindow] DialogWin::DestroyWindow } proc RamDebugger::DisplayTimesWindowCancel { f } { rtime -stop destroy [winfo toplevel $f] } proc RamDebugger::PickSelection { w } { variable text if { [catch { set DialogWinTop::user($w,lineini) [scan [$text index sel.first] %d] set DialogWinTop::user($w,lineend) [scan [$text index sel.last] %d] }]} { WarnWin "It is necessary to select some text in main window" $w } } proc RamDebugger::DrawSelection { w } { variable text if { [catch { $text tag add sel "$DialogWinTop::user($w,lineini).0 linestart" \ "$DialogWinTop::user($w,lineend).0 lineend" $text see $DialogWinTop::user($w,lineini).0 }] } { WarnWin "Lines are not correct" $w } } proc RamDebugger::ModifyTimingBlock { w what } { variable TimeMeasureData set idx [$DialogWinTop::user($w,list) curselection] switch $what { create { set err [catch [list rtime -add $DialogWinTop::user($w,name) \ $DialogWinTop::user($w,lineini) $DialogWinTop::user($w,lineend)] errstring] if { $err } { WarnWin [lindex [split $errstring \n] 0] return $err } else { ModifyTimingBlock $w update return 0 } } edit { set err [ModifyTimingBlock $w delete] if { !$err } { ModifyTimingBlock $w create } } delete { if { [llength $idx] != 1 } { WarnWin "Error: it is necessary to select one block in list" return 1 } set selname [lindex [$DialogWinTop::user($w,list) get $idx] 0] set err [catch [list rtime -delete $selname] errstring] if { $err } { WarnWin [lindex [split $errstring \n] 0] return $err } else { ModifyTimingBlock $w update return 0 } } updatecurrent { if { [llength $idx] != 1 } { WarnWin "Error: it is necessary to select one block in list" return 1 } set DialogWinTop::user($w,name) [lindex [$DialogWinTop::user($w,list) get $idx] 0] set DialogWinTop::user($w,lineini) [lindex [$DialogWinTop::user($w,list) get $idx] 2] set DialogWinTop::user($w,lineend) [lindex [$DialogWinTop::user($w,list) get $idx] 3] } update { $DialogWinTop::user($w,list) del 0 end foreach i $TimeMeasureData { $DialogWinTop::user($w,list) insert end [lrange $i 0 3] } } } } proc RamDebugger::DisplayTimesWindow {} { variable text set commands [list RamDebugger::DisplayTimesWindowStart RamDebugger::DisplayTimesWindowReport \ RamDebugger::DisplayTimesWindowCancel] set f [DialogWinTop::Init $text "Timing control" separator $commands \ [list Report] Start] set w [winfo toplevel $f] TitleFrame $f.f1 -text [_ "current block"] -grid "0 ew" set f1 [$f.f1 getframe] label $f1.l1 -text "Name" -grid 0 entry $f1.e1 -textvariable DialogWinTop::user($w,name) -grid "1 ew" label $f1.l2 -text "Initial line:" -grid "0 e" entry $f1.e2 -textvariable DialogWinTop::user($w,lineini) -grid "1 w py2" -width 8 label $f1.l3 -text "End line:" -grid "0 e" entry $f1.e3 -textvariable DialogWinTop::user($w,lineend) -grid "1 w py2" -width 8 set bbox [ButtonBox $f1.bbox1 -spacing 0 -padx 1 -pady 1 -homogeneous 1 -grid "0 2 w"] $bbox add -text "Pick selection" \ -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1 -padx 1 -pady 1 \ -helptext [_ "Gets the selection from the text window"] \ -command "RamDebugger::PickSelection $w" $bbox add -text "Draw selection" \ -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1 -padx 1 -pady 1 \ -helptext [_ "Selects current block in text"] \ -command "RamDebugger::DrawSelection $w" TitleFrame $f.f2 -text [_ "blocks"] -grid 0 set f2 [$f.f2 getframe] set sw [ScrolledWindow $f2.lf -relief sunken -borderwidth 0 -grid "0 ewns"] set DialogWinTop::user($w,list) [tablelist::tablelist $sw.lb -width 55 \ -exportselection 0 \ -columns [list \ 10 "Name" left \ 10 "File" right \ 7 "Initial line" right \ 7 "End line" right \ ] \ -labelcommand tablelist::sortByColumn \ -background white \ -selectbackground navy -selectforeground white \ -stretch "0 1" -selectmode browse \ -highlightthickness 0] $sw setwidget $DialogWinTop::user($w,list) bind [$DialogWinTop::user($w,list) bodypath] <Double-1> \ "RamDebugger::ModifyTimingBlock $w updatecurrent" set bbox [ButtonBox $f2.bbox1 -spacing 0 -padx 1 -pady 1 -homogeneous 1 -grid "0 w"] $bbox add -image acttick16 \ -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1 -padx 1 -pady 1 \ -helptext [_ "Create new block"] \ -command "RamDebugger::ModifyTimingBlock $w create" $bbox add -image edit16 \ -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1 -padx 1 -pady 1 \ -helptext [_ "Update selected block"] \ -command "RamDebugger::ModifyTimingBlock $w edit" $bbox add -image actcross16 \ -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1 -padx 1 -pady 1 \ -helptext [_ "Delete selected block"] \ -command "RamDebugger::ModifyTimingBlock $w delete" supergrid::go $f1 supergrid::go $f2 supergrid::go $f tkTabToWindow $f1.e1 bind [winfo toplevel $f] <Return> "DialogWinTop::InvokeOK $f" ModifyTimingBlock $w update DialogWinTop::CreateWindow $f DialogWinTop::InvokeOK $f } proc RamDebugger::AboutWindow {} { variable text set par [winfo toplevel $text] set w $par.about toplevel $w wm protocol $w WM_DELETE_WINDOW { # nothing } label $w.l -text RamDebugger -font "-family {new century schoolbook} -size 24 -weight bold" \ -fg \#d3513d -grid 0 set tt "Author: Ramon Ribó (RAMSAN)\n" append tt "ramsan@cimne.upc.es\nhttp://gid.cimne.upc.es/ramsan\n" append tt "http://gid.cimne.upc.es/RamDebugger" label $w.l2 -grid 0 -text $tt canvas $w.c -height 50 -grid 0 -bg white -highlightthickness 0 ScrolledWindow $w.lf -relief sunken -borderwidth 0 -grid 0 tablelist::tablelist $w.lf.lb -width 55\ -exportselection 0 \ -columns [list \ 10 Package left \ 10 Author left \ 10 License right\ 4 Mod left \ ] \ -labelcommand tablelist::sortByColumn \ -background white \ -selectbackground navy -selectforeground white \ -stretch 1 -selectmode extended \ -highlightthickness 0 $w.lf setwidget $w.lf.lb frame $w.buts -height 35 -bg [CCColorActivo [$w cget -bg]] -grid 0 supergrid::go $w button $w.close -text Close -width 10 place $w.close -in $w.buts -anchor n -y 3 wm withdraw $w update idletasks set x [expr [winfo x $par]+[winfo width $par]/2-[winfo reqwidth $w]/2] set y [expr [winfo y $par]+[winfo height $par]/2-[winfo reqheight $w]/2] wm geom $w +$x+$y wm deiconify $w wm transient $w $par bind $w.close <Enter> "RamDebugger::MotionInAbout $w.close ; break" bind $w.close <ButtonPress-1> "WarnWin [list {Congratulations, you got it!!!}] ; destroy $w; break" $w.c create text 0 0 -anchor n -font "-family {new century schoolbook} -size 16 -weight bold"\ -fill \#d3513d -text "Version 1.3" -tags text RamDebugger::AboutMoveCanvas $w.c 0 set data { tkcon "Jeffrey Hobbs" BSD SLIGHTLY comm "Open Group Res. Ins." BSD YES BWidgets "Unifix" BSD YES dialogwin RAMSAN BSD NO helpviewer RAMSAN BSD NO supergrid RAMSAN BSD NO supertext "Bryan Oakley" "FREE SOFT" YES tablelist "Csaba Nemethi" "FREE SOFT" NO "visual regexp" "Laurent Riesterer" GPL NO Tkhtml "D. Richard Hipp" LGPL NO tcllib Many BSD NO icons "Adrian Davis" BSD NO } foreach "pack author lic mod" $data { $w.lf.lb insert end [list $pack $author $lic $mod] } } proc RamDebugger::AboutMoveCanvas { c t } { if { ![winfo exists $c] } { return } set w [winfo width $c] set h [winfo height $c] set x [expr $w/2*(1.0-sin($t))] set y [expr $h/2*(cos($t)+1)] $c coords text $x $y set t [expr $t+.2] after 100 [list RamDebugger::AboutMoveCanvas $c $t] } proc RamDebugger::MotionInAbout { but } { if { ![winfo exists $but] } { return } set w [winfo toplevel $but] while 1 { if { ![winfo exists $but] } { return } set x [expr [winfo pointerx $w]-[winfo rootx $w]] set y [expr [winfo pointery $w]-[winfo rooty $w]] set x1 [expr [winfo rootx $but]-[winfo rootx $w]] set y1 [expr [winfo rooty $but]-[winfo rooty $w]] set x2 [expr $x1+[winfo width $but]] set y2 [expr $y1+[winfo height $but]] if { $x < $x1-2 || $x > $x2+2 || $y < $y1-2 || $y > $y2+2 } { return } set xmax [winfo width $w] set ymax [winfo height $w] if { $x < ($x1+$x2)/2 } { set newx [expr $x1+int((rand()-.2)*5.1)] } else { set newx [expr $x1+int((rand()-.8)*5.1)] } if { $newx < 0 } { set newx 0 } if { $newx > $xmax-[winfo width $but] } { set newx [expr $xmax-[winfo width $but]] } if { $y < ($y1+$y2)/2 } { set newy [expr $y1+int((rand()-.2)*5.1)] } else { set newy [expr $y1+int((rand()-.8)*5.1)] } if { $newy < 0 } { set newy 0 } if { $newy > $ymax-[winfo height $but] } { set newy [expr $ymax-[winfo height $but]] } place $but -in $w -x $newx -y $newy -anchor nw update } } proc RamDebugger::DisplayWindowsHierarchyInfo { canvas w x y } { variable TextMotionAfterId after cancel $TextMotionAfterId set TextMotionAfterId "" if { [winfo exists $canvas.help] } { destroy $canvas.help } if { $w != "" } { set TextMotionAfterId [after 100 RamDebugger::DisplayWindowsHierarchyInfoDo \ $canvas $w $x $y] } } proc RamDebugger::DisplayWindowsHierarchyInfoDo { canvas w x y } { variable TextMotionAfterId set TextMotionAfterId "" set comm { set retval "WIDGET\n\n" if { [winfo class WIDGET] == "Toplevel" } { append retval "TITLE: [wm title WIDGET]\n" } if { [winfo class WIDGET] == "Label" || [winfo class WIDGET] == "Button" || \ [winfo class WIDGET] == "Radiobutton" || [winfo class WIDGET] == "Checkbutton" } { if { [WIDGET cget -text] != "" } { append retval "LABEL: [WIDGET cget -text]\n" } } foreach "cols rows" [grid size WIDGET] break if { $cols > 0 } { append retval "GRID MASTER\n" for { set i 0 } { $i < $rows } { incr i } { for { set j 0 } { $j < $cols } { incr j } { set slave [grid slaves WIDGET -row $i -column $j] if { $slave != "" } { append retval " $i,$j $slave [grid info $slave]\n" } } } append retval " ROWS\n" for { set i 0 } { $i < $rows } { incr i } { append retval " $i [grid rowconfigure WIDGET $i]\n" } append retval " COLUMNS\n" for { set j 0 } { $j < $cols } { incr j } { append retval " $i [grid columnconfigure WIDGET $j]\n" } } set info [grid info WIDGET] if { $info != "" } { append retval "GRID SLAVE\n$info\n" } if { [pack slaves WIDGET] != "" } { append retval "PACK MASTER\n" foreach i [pack slaves WIDGET] { append retval " $i [pack info $i]\n" } } if { ![catch [list pack info WIDGET] info] } { append retval "PACK SLAVE\n$info\n" } append retval "OPTIONS\n" set retval_in "" foreach i [WIDGET configure] { append retval_in "[lindex $i 0] [WIDGET cget [lindex $i 0]] " while { [string length $retval_in] > 80 } { append retval [string range $retval_in 0 79]\n set retval_in [string range $retval_in 80 end] } if { [string length $retval_in] > 40 } { append retval $retval_in\n set retval_in "" } } if { [string index $retval_in end] != "\n" } { append retval_in \n } append retval $retval_in append retval "SIZES\n" append retval " width=[winfo width WIDGET] reqwidth=[winfo reqwidth WIDGET]\n" append retval " height=[winfo height WIDGET] reqheight=[winfo reqheight WIDGET]\n" EVAL } if { $DialogWinHier::user(type) == "ramdebugger" } { set retcomm "RamDebugger::DisplayWindowsHierarchyInfoDo2 $canvas $w $x $y \[set retval]" } else { set retcomm "RDC::SendDev \[list RamDebugger::DisplayWindowsHierarchyInfoDo2 $canvas \ $w $x $y \[set retval]]" } set comm [string map [list EVAL $retcomm] $comm] set comm [string map [list WIDGET $w] $comm] if { $DialogWinHier::user(type) == "ramdebugger" } { eval $comm } else { EvalRemote $comm } } proc RamDebugger::DisplayWindowsHierarchyInfoDo2 { canvas w x y res } { set w $canvas.help if { [winfo exists $w] } { destroy $w } toplevel $w wm overrideredirect $w 1 wm transient $w $canvas pack [label $w.l -bg white -justify left -anchor w] $w.l conf -bd 1 -relief solid $w.l conf -text $res bind $w <Motion> "destroy $w" wm withdraw $w update idletasks incr x 5 incr y 5 if { $x+[winfo reqwidth $w]+5 > [winfo screenwidth $w] } { set x [expr [winfo screenwidth $w]-[winfo reqwidth $w]-5] } if { $x < 5 } { set x 5 } if { $y+[winfo reqheight $w]+5 > [winfo screenheight $w] } { set y [expr [winfo screenheight $w]-[winfo reqheight $w]-5] } if { $y < 0 } { set y 5 } wm geom $w +$x+$y wm deiconify $w focus $w.l bind $w.l <Control-c> "clipboard clear; clipboard append [list $res]" } proc RamDebugger::DisplayWindowsHierarchyDoDraw { canvas list x y linespace } { set maxwidth 0 foreach "w info rest" $list { foreach i $info { set width [font measure NormalFont $i] if { $width > $maxwidth } { set maxwidth $width } } } set maxwidth [expr $maxwidth+10] set maxx [expr $x+$maxwidth] set maxy $y set ty $y set num 0 foreach "w info rest" $list { if { $rest != "-" } { foreach "newx newy" [DisplayWindowsHierarchyDoDraw $canvas $rest [expr $x+$maxwidth] \ $maxy $linespace] break if { $newx > $maxx } { set maxx $newx} set ty [expr ($maxy+$newy)/2-$linespace/2] set maxy $newy set width 0 foreach i $info { set widthi [font measure NormalFont $i] if { $widthi > $width } { set width $widthi } } $canvas create line [expr $x+$width+2] [expr $ty+$linespace/2] \ [expr $x+$maxwidth-5] [expr $ty+$linespace/2] -width 2 -fill red -tags "items $w" incr maxy 12 } set inum 0 foreach i $info { if { $i != "" } { switch $inum { 0 { set color black } 1 { set color blue } 2 { set color green } } $canvas create text $x $ty -text $i -tags "items $w" -font NormalFont -anchor nw \ -fill $color set ty [expr $ty+$linespace] } incr inum } $canvas bind $w <Enter> "RamDebugger::DisplayWindowsHierarchyInfo $canvas $w %X %Y" $canvas bind $w <Leave> "RamDebugger::DisplayWindowsHierarchyInfo $canvas {} %X %Y" if { $ty > $maxy } { set maxy $ty } else { set ty $maxy } incr num } if { $num > 1 } { $canvas create line [expr $x-5] $y [expr $x-1] [expr $y-4] -width 2 -fill red -tags items $canvas create line [expr $x-5] $y [expr $x-5] $maxy -width 2 -fill red -tags items $canvas create line [expr $x-5] $maxy [expr $x-1] [expr $maxy+4] -width 2 -fill red -tags items } return [list $maxx $maxy] } proc RamDebugger::DisplayWindowsHierarchyDo { what { res "" } } { variable remoteserver if { $what == "do" } { set comm { namespace eval ::RDC {} proc ::RDC::WindowsHierarchy { w } { set info [list "[winfo name $w] [winfo class $w]"] if { [winfo class $w] == "Label" || [winfo class $w] == "Button" || \ [winfo class $w] == "Radiobutton" || [winfo class $w] == "Checkbutton" } { if { [$w cget -text] != "" } { lappend info [$w cget -text] } } elseif { [winfo class $w] == "Toplevel" && [wm title $w] != "" } { lappend info "" [wm title $w] } set retval [list $w $info] set retval_in "" foreach i [winfo children $w] { eval lappend retval_in [RDC::WindowsHierarchy $i] } if { $retval_in == "" } { lappend retval - } else { lappend retval $retval_in } return $retval } EVAL } if { $DialogWinHier::user(type) == "ramdebugger" } { set retcomm "RamDebugger::DisplayWindowsHierarchyDo res \[::RDC::WindowsHierarchy .]" } else { set retcomm "RDC::SendDev \[list RamDebugger::DisplayWindowsHierarchyDo res \ \[::RDC::WindowsHierarchy .]]" } set comm [string map [list EVAL $retcomm] $comm] if { [info exists RamDebugger::DisplayWindowsHierarchyFindLastId] } { unset RamDebugger::DisplayWindowsHierarchyFindLastId } if { $DialogWinHier::user(type) == "ramdebugger" } { eval $comm } else { if { $remoteserver == "" } { after 100 [list WarnWin "Error: there is no debugged application" \ $DialogWinHier::user(canvas)] $DialogWinHier::user(canvas) delete items return } EvalRemote $comm } } else { $DialogWinHier::user(canvas) delete items set linespace [expr [font metrics NormalFont -linespace]+1] foreach "newx newy" [DisplayWindowsHierarchyDoDraw $DialogWinHier::user(canvas) $res \ 5 5 $linespace] break $DialogWinHier::user(canvas) conf -scrollregion [list 0 0 $newx $newy] } } proc RamDebugger::DisplayWindowsHierarchyFind {} { variable DisplayWindowsHierarchyFindLastId set canvas $DialogWinHier::user(canvas) if { ![info exists DisplayWindowsHierarchyFindLastId] } { set DisplayWindowsHierarchyFindLastId -1 } set found 0 foreach i [$canvas find all] { if { $DisplayWindowsHierarchyFindLastId > -1 && $i <= $DisplayWindowsHierarchyFindLastId } { continue } if { [$canvas type $i] == "text" } { set text [$canvas itemcget $i -text] if { [string match -nocase *$DialogWinHier::user(find)* $text] } { set found 1 set DisplayWindowsHierarchyFindLastId $i break } } } if { $found } { $canvas select from $i 0 $canvas select to $i end foreach "x y" [$canvas coords $i] break foreach "- - width height" [$canvas cget -scrollregion] break foreach "f1 f2" [$canvas xview] break set xs [expr $x/double($width)-($f2-$f1)/2.0] if { $xs < 0 } { set xs 0 } $canvas xview moveto $xs foreach "f1 f2" [$canvas yview] break set ys [expr $y/double($height)-($f2-$f1)/2.0] if { $ys < 0 } { set ys 0 } $canvas yview moveto $ys } else { unset RamDebugger::DisplayWindowsHierarchyFindLastId bell } } proc RamDebugger::DisplayWindowsHierarchy {} { variable text CopyNamespace ::DialogWin ::DialogWinHier set f [DialogWinHier::Init $text "Windows hierarchy" separator "" -] set w [winfo toplevel $f] radiobutton $f.r1 -text "In debugged app" -variable DialogWinHier::user(type) -value debug \ -command "RamDebugger::DisplayWindowsHierarchyDo do" -grid "0 w" radiobutton $f.r2 -text "In RamDebugger" -variable DialogWinHier::user(type) -value ramdebugger \ -command "RamDebugger::DisplayWindowsHierarchyDo do" -grid "1 w" frame $f.f -grid "0 2" label $f.f.l -text "Find:" -grid 0 entry $f.f.e -textvar DialogWinHier::user(find) -grid 1 tkTabToWindow $f.f.e button $f.f.b1 -text Go -width 5 -grid "2 px3 py3" -command \ "RamDebugger::DisplayWindowsHierarchyFind" bind $f.f.e <Return> "$f.f.b1 invoke" set DialogWinHier::user(type) debug set sw [ScrolledWindow $f.lf -relief sunken -borderwidth 0 -grid "0 2"] set DialogWinHier::user(canvas) [canvas $sw.t -width 600 -height 400 -bg white -bd 0 ] $sw setwidget $DialogWinHier::user(canvas) bind $DialogWinHier::user(canvas) <2> { %W scan mark %x %y set tkPriv(x) %x set tkPriv(y) %y set tkPriv(mouseMoved) 0 } bind $DialogWinHier::user(canvas) <B2-Motion> { if {(%x != $tkPriv(x)) || (%y != $tkPriv(y))} { set tkPriv(mouseMoved) 1 } if {$tkPriv(mouseMoved)} { %W scan dragto %x %y } } supergrid::go $f DisplayWindowsHierarchyDo do set action [DialogWinHier::CreateWindow] DialogWinHier::DestroyWindow namespace delete ::DialogWinHier } proc RamDebugger::GotoLine {} { variable text set f [DialogWin::Init $text "Goto line" separator ""] set w [winfo toplevel $f] label $f.l -text "Go to line:" -grid "0 px3 py5" SpinBox $f.sb -range "1 1000 1" -textvariable DialogWin::user(line) \ -width 8 -grid "1 px3" checkbutton $f.cb1 -text "Relative to current line" -variable DialogWin::user(relative) \ -grid "0 2 w" set DialogWin::user(relative) 0 tkTabToWindow $f.sb bind $w <Return> "DialogWin::InvokeOK" supergrid::go $f set action [DialogWin::CreateWindow] while 1 { switch $action { 0 { DialogWin::DestroyWindow return } 1 { set line $DialogWin::user(line) set good 1 if { ![string is integer -strict $line] } { WarnWin "Line number must be a positive number" $w set good 0 } if { $good && $DialogWin::user(relative) } { set insline [scan [$text index insert] %d] set lastline [scan [$text index end-1c] %d] set line [expr $insline+$line] if { $line < 1 || $line > $lastline } { WarnWin "Trying to go to line $line. Out of limits" $w set good 0 } } if { $good } { set lastline [scan [$text index end-1c] %d] if { $line < 1 } { set line 1 } if { $line > $lastline } { set line $lastline } $text mark set insert $line.0 $text see $line.0 focus $text DialogWin::DestroyWindow return } } } set action [DialogWin::WaitForWindow] } } proc RamDebugger::DebugCplusPlusWindow { { tryautomatic 0 } } { variable text variable options if { ![info exists options(debugcplusplus)] } { set options(debugcplusplus) "" } set exes "" set dirs "" set args "" foreach "exe dir arg" $options(debugcplusplus) { lappend exes $exe lappend dirs $dir lappend args $arg } set exe "" foreach "exe dir args" [cproject::GiveDebugData] break if { $tryautomatic && $exe != "" } { set found 0 set ipos 0 foreach "exe_in dir_in args_in" $options(debugcplusplus) { if { $exe == $exe_in && $dir == $dir_in && $args == $args_in } { set found 1 break } incr ipos 3 } if { $found && $ipos != 0 } { set options(debugcplusplus) [lreplace $options(debugcplusplus) $ipos \ [expr $ipos+2]] } if { !$found || $ipos != 0 } { set options(debugcplusplus) [linsert $options(debugcplusplus) 0 \ $exe $dir $args] } rdebug -debugcplusplus [list $exe $dir $args] return } if { $tryautomatic && $options(debugcplusplus) != "" } { rdebug -debugcplusplus [lrange $options(debugcplusplus) 0 2] return } set f [DialogWin::Init $text "Debug c++" separator ""] set w [winfo toplevel $f] label $f.l -text "Program to debug:" -grid "0 e px3 py5" ComboBox $f.cb1 -textvariable DialogWin::user(executable) -width 40 -grid 1 -values \ $exes Button $f.b1 -image [Bitmap::get file] -width 16 -grid 2 -relief link label $f.l2 -text "Directory:" -grid "0 e px3 py5" ComboBox $f.cb2 -textvariable DialogWin::user(directory) -width 40 -grid "1" -values \ $dirs Button $f.b2 -image [Bitmap::get folder] -grid 2 -relief link label $f.l3 -text "Arguments:" -grid "0 e" ComboBox $f.cb3 -textvariable DialogWin::user(arguments) -width 40 -grid "1 2" -values \ $args set comm { set DialogWin::user(executable) [tk_getOpenFile -filetypes {{{All Files} *}} \ -initialdir $RamDebugger::options(defaultdir) -initialfile \ $DialogWin::user(executable) -parent PARENT -title "Debug executable"] } set comm [string map [list PARENT $w] $comm] $f.b1 configure -command $comm set comm { set initial $RamDebugger::options(defaultdir) catch { set initial [file dirname $DialogWin::user(executable)] } set DialogWin::user(directory) [tk_chooseDirectory \ -initialdir $initial -parent PARENT \ -title "Debug directory" -mustexist 1] } set comm [string map [list PARENT $w] $comm] $f.b2 configure -command $comm if { [info exists options(debugcplusplus)] } { set DialogWin::user(executable) [lindex $options(debugcplusplus) 0] set DialogWin::user(directory) [lindex $options(debugcplusplus) 1] set DialogWin::user(arguments) [lindex $options(debugcplusplus) 2] } tkTabToWindow $f.cb1 bind $w <Return> "DialogWin::InvokeOK" supergrid::go $f set action [DialogWin::CreateWindow] while 1 { switch $action { 0 { DialogWin::DestroyWindow return } 1 { set found 0 set ipos 0 foreach "exe dir args" $options(debugcplusplus) { if { $exe == $DialogWin::user(executable) && \ $dir == $DialogWin::user(directory) && \ $args == $DialogWin::user(arguments) } { set found 1 break } incr ipos 3 } if { $found && $ipos != 0 } { set options(debugcplusplus) [lreplace $options(debugcplusplus) $ipos \ [expr $ipos+2]] } if { !$found || $ipos != 0 } { set options(debugcplusplus) [linsert $options(debugcplusplus) 0 \ $DialogWin::user(executable) $DialogWin::user(directory) \ $DialogWin::user(arguments)] } rdebug -debugcplusplus [list $DialogWin::user(executable) \ $DialogWin::user(directory) $DialogWin::user(arguments)] DialogWin::DestroyWindow return } } set action [DialogWin::WaitForWindow] } } proc RamDebugger::CheckEvalEntries { what { name "" } { res "" } } { variable EvalEntries variable IsInStop variable remoteserver variable remoteserverType variable gdblog if { !$IsInStop } { return } if { $name == "" } { if { $what == "do" } { set vars "" set i 0 while 1 { ................................................................................ } } else { if { $what == "do" } { regexp {[0-9]+} $name i set var [string trim $EvalEntries($i,left)] if { $var == "" } { return } set value [string trim $EvalEntries($name)] if { $remoteserverType == "gdb" } { set remoteserver [lreplace $remoteserver 2 2 setvariable] EvalRemote "set variable $var=$value" return } set comm [list set $var $value] reval -handler [list RamDebugger::CheckEvalEntries res $name] $comm ................................................................................ } proc RamDebugger::CheckEvalEntriesL { what { name "" } { res "" } } { variable EvalEntries variable IsInStop variable remoteserver variable remoteserverType if { !$IsInStop } { return } if { $name == "" } { if { $what == "do" } { if { $remoteserverType == "gdb" } { while { [lindex $remoteserver 2] != "" } { vwait RamDebugger::remoteserver } set remoteserver [lreplace $remoteserver 2 2 infolocals] ................................................................................ } while 1 { if { ![info exists EvalEntries($i,leftL)] } { break } set EvalEntries($i,leftL) "" set EvalEntries($i,rightL) "" incr i } } } else { if { $what == "do" } { regexp {[0-9]+} $name i set var [string trim $EvalEntries($i,leftL)] if { $var == "" } { return } set value [string trim $EvalEntries($name)] if { $remoteserverType == "gdb" } { set remoteserver [lreplace $remoteserver 2 2 setvariable] EvalRemote "set variable $var=$value" return } set comm [list set $var $value] reval -handler [list RamDebugger::CheckEvalEntriesL res $name] $comm } else { regexp {[0-9]+} $name i set RamDebugger::EvalEntries($i,rightR) [lindex $res 1] switch [lindex $res 0] { 0 { $RamDebugger::EvalEntries($i,rightentryL) conf -fg black } 1 { $RamDebugger::EvalEntries($i,rightentryL) conf -fg red } } ................................................................................ } proc RamDebugger::TextOutInsert { data } { variable textOUT if { ![info exists textOUT] || ![winfo exists $textOUT] } { return } $textOUT conf -state normal $textOUT ins end $data $textOUT conf -state disabled $textOUT yview moveto 1 } proc RamDebugger::TextOutInsertRed { data } { variable textOUT if { ![info exists textOUT] || ![winfo exists $textOUT] } { return } $textOUT conf -state normal $textOUT ins end $data red $textOUT tag configure red -foreground red $textOUT conf -state disabled $textOUT yview moveto 1 } proc RamDebugger::TextCompClear {} { variable textCOMP if { ![info exists textCOMP] || ![winfo exists $textCOMP] } { return } ................................................................................ } proc RamDebugger::TextCompInsert { data } { variable textCOMP if { ![info exists textCOMP] || ![winfo exists $textCOMP] } { return } $textCOMP conf -state normal $textCOMP ins end $data $textCOMP conf -state disabled $textCOMP yview moveto 1 } proc RamDebugger::ProgressVar { value { canstop 0 } } { variable progressvar variable text ................................................................................ regsub -all {\W} $string _ item while { [$listbox exists $item] } { append item _ } return $item } proc RamDebugger::FillListBox {} { variable listbox variable options variable instrumentedfilesP variable instrumentedfilesR variable instrumentedfilesSent variable remoteserverType variable images if { $listbox == "" || ![winfo exists $listbox] } { return } $listbox delete [$listbox items] set parent [file dirname $options(defaultdir)] $listbox insert end .. -image [Bitmap::get folder] -text ".." -data [list folder $parent] set idxfolder 1 set files "" foreach i [glob -nocomplain -dir $options(defaultdir) *] { lappend files [file tail $i] } ................................................................................ incr idxfolder } elseif { [regexp {(\.tcl|\.h|\.c|\.cc|Makefil.*[^~])$} $i] } { if { [info exists instrumentedfilesSent($fullpath)] } { switch $instrumentedfilesSent($fullpath) { debug { set img $images(file_blue) } time { set img $images(file_magenta) } } } elseif { [GiveInstFile $fullpath 1 I] != "" } { set img $images(file_yellow) } else { set img [Bitmap::get file] } $listbox insert end $item -image $img -text $i -data \ [list file [file join $options(defaultdir) $i]] } } } proc RamDebugger::PrevNextCompileError { what } { variable textCOMP set err [catch { $textCOMP index sel.first} idx] if { $err } { switch $what { next { set idx 1.0 } prev { set idx end-1c } } } else { switch $what { next { set idx [$textCOMP index $idx+1l] if { [$textCOMP compare $idx > end-1c] } { set idx 1.0 } } prev { set idx [$textCOMP index $idx-1l] if { [$textCOMP compare $idx < 1.0] } { set idx end-1c } } } } $textCOMP tag remove sel 1.0 end $textCOMP tag add sel "$idx linestart" "$idx lineend" $textCOMP see $idx StackDouble1 $textCOMP $idx } proc RamDebugger::StackDouble1 { textstack idx } { variable text ................................................................................ set data [$textstack get "$idx linestart" "$idx lineend"] foreach pattern [list {((?:[a-zA-Z]:/)?[-/\w.]+):([0-9]+)} \ {((?:[a-zA-Z]:/)?[-/\w. ]+):([0-9]+)}] { if { [regexp $pattern $data {} file line] } { if { ![file exists $file] && [file exists [file join $options(defaultdir) \ $file]] } { set file [file join $options(defaultdir) $file] } if { ![file exists $file] } { set fullfile [cproject::TryToFindPath $file] ................................................................................ focus $text return } } } } proc RamDebugger::Compile { name } { variable text variable mainframe variable MainDir $mainframe setmenustate debugentry disabled set dir [file dirname $name] set pwd [pwd] cd $dir if { [regexp {\.(c|cc)$} $name] } { if { [auto_execok gcc] == "" } { $mainframe setmenustate debug normal cd $pwd set ret [DialogWin::messageBox -default yes -icon question -message \ "Could not find command 'gcc'. Do you want to see the help?" -parent $text \ -title "Command not found" -type yesno] if { $ret == "yes" } { RamDebugger::ViewHelpFile "01RamDebugger/RamDebugger_12.html" } return } set comm "gcc -c -I$dir $name" set commS "gcc -c -I$dir $name" } elseif { [regexp {Makefil.*[^~]$} $name] } { $mainframe setmenustate debug normal if { [auto_execok make] == "" } { cd $pwd set ret [DialogWin::messageBox -default yes -icon question -message \ "Could not find command 'make'. Do you want to see the help?" -parent $text \ -title "Command not found" -type yesno] if { $ret == "yes" } { RamDebugger::ViewHelpFile "01RamDebugger/RamDebugger_12.html" } return } set comm "make -f $name" set commS "make -f $name" } # if {$::tcl_platform(platform) == "windows" && \ # [info exists ::env(COMSPEC)]} { # set comm "[file join $::env(COMSPEC)] /c $comm" # } if { $::tcl_platform(platform) == "windows" } { set cat [file join $MainDir addons cat.exe] } else { set cat cat } set fin [open "|$comm |& $cat" r] fconfigure $fin -blocking 0 fileevent $fin readable [list RamDebugger::CompileFeedback $fin $name] cd $pwd TextCompClear TextCompRaise TextCompInsert "[string repeat - 20]Compiling [file tail $name][string repeat - 20]\n" TextCompInsert "--> $commS\n" update } proc RamDebugger::CompileFeedback { fin name } { variable text variable mainframe if { [eof $fin] } { if { $name != "" } { TextCompInsert "End compilation of [file tail $name]\n" TextCompRaise } set err [catch { close $fin } errstring] $mainframe setmenustate debugentry normal if { $err } { TextCompInsert $errstring\n TextCompRaise set cproject::compilationstatus 1 } else { set cproject::compilationstatus 0 } return } gets $fin aa if { $aa != "" } { TextCompInsert $aa\n update } } proc RamDebugger::FindFilesWithPattern { dir patternlist recurse } { set retval [eval glob -nocomplain -dir [list $dir] -types f -- $patternlist] if { $recurse } { foreach i [glob -nocomplain -dir $dir -type d *] { set retval [concat $retval [FindFilesWithPattern $i $patternlist $recurse]] } } return $retval } proc RamDebugger::SearchInFilesDo {} { variable options variable MainDir # if { $::tcl_platform(platform) == "windows" } { # set grep [file join $MainDir addons grep.exe] # } else { set grep grep } set comm "\"grep\" -ns " switch -- $::RamDebugger::searchmode { -exact { append comm "-F " } -regexp { append comm "-E " } } if { !$::RamDebugger::searchcase } { append comm "-i " } append comm "\"$RamDebugger::searchstring\" " set patternlist [regexp -inline -all {[^\s,;]+} $RamDebugger::searchextensions] set files [FindFilesWithPattern $RamDebugger::searchdir $patternlist \ $RamDebugger::searchrecursedirs] if { [llength $files] == 0 } { TextOutClear TextOutInsert "No files found" TextOutRaise return } append comm "\"[join $files {" "}]\"" set fin [open "|$comm" r] set result "" while { ![eof $fin] } { append result [gets $fin]\n } set err [catch { close $fin } errstring] if { [string trim $result] == "" } { set result "Nothing found" } TextOutClear TextOutInsert $result TextOutRaise foreach "i j search" [list texts RamDebugger::searchstring lsearch \ exts RamDebugger::searchextensions lsearchfile \ dirs RamDebugger::searchdir lsearchfile] { set ipos [$search $options(SearchInFiles,$i) [set $j]] if { $ipos != -1 } { set options(SearchInFiles,$i) [lreplace $options(SearchInFiles,$i) $ipos $ipos] } set options(SearchInFiles,$i) [linsert $options(SearchInFiles,$i) 0 [set $j]] if { [llength $options(SearchInFiles,$i)] > 6 } { set options(SearchInFiles,$i) [lreplace $options(SearchInFiles,$i) 6 end] } } } proc RamDebugger::SearchInFiles {} { variable options variable text set range [$text tag ranges sel] if { $range != "" } { set txt [eval $text get $range] } else { set idx [$text index insert] if { $idx != "" } { set txt "" set idx0 $idx while { [string is wordchar [$text get $idx0]] } { set txt [$text get $idx0]$txt set idx0 [$text index $idx0-1c] if { [$text compare $idx0 <= 1.0] } { break } } set idx1 [$text index $idx+1c] while { [string is wordchar [$text get $idx1]] } { append txt [$text get $idx1] set idx1 [$text index $idx1+1c] if { [$text compare $idx1 >= end] } { break } } } else { set txt "" } } set f [DialogWin::Init $text "Search in files" separator] set w [winfo toplevel $f] if { ![info exists options(SearchInFiles,texts)] } { set options(SearchInFiles,texts) "" set options(SearchInFiles,exts) "" set options(SearchInFiles,dirs) "" } label $f.l1 -text "Text:" -grid 0 ComboBox $f.e1 -textvariable ::RamDebugger::searchstring -grid "1 2 px3 py3" \ -values $options(SearchInFiles,texts) -width 30 if { [string trim $txt] != "" } { set ::RamDebugger::searchstring $txt } else { set ::RamDebugger::searchstring [lindex $options(SearchInFiles,texts) 0] } label $f.l2 -text "File ext:" -grid 0 ComboBox $f.e2 -textvariable ::RamDebugger::searchextensions -grid "1 2 px3 py3" \ -values [concat $options(SearchInFiles,exts) [list "*.tcl" "*.h,*.cc,*.c"]] set ::RamDebugger::searchextensions [lindex [$f.e2 cget -values] 0] label $f.l3 -text "Directory:" -grid 0 ComboBox $f.e3 -textvariable ::RamDebugger::searchdir -grid "1 1 px3 py3" \ -values $options(SearchInFiles,dirs) Button $f.b3 -image [Bitmap::get folder] -relief link -grid "2" set comm { set initial $::RamDebugger::searchdir set ::RamDebugger::searchdir [tk_chooseDirectory \ -initialdir $initial -parent PARENT \ -title "Search directory" -mustexist 1] } set comm [string map [list PARENT $w] $comm] $f.b3 configure -command $comm set ::RamDebugger::searchdir $options(defaultdir) set f1 [frame $f.f1 -bd 0 -grid "0 3 w"] set f2 [frame $f1.f2 -bd 1 -relief ridge -grid "0 w px3"] radiobutton $f2.r1 -text Exact -variable ::RamDebugger::searchmode \ -value -exact -grid "0 w" radiobutton $f2.r2 -text Regexp -variable ::RamDebugger::searchmode \ -value -regexp -grid "0 w" set f3 [frame $f1.f3 -grid "1 w"] checkbutton $f3.cb1 -text "Consider case" -variable ::RamDebugger::searchcase \ -grid 0 checkbutton $f3.cb2 -text "Recurse dirs" -variable ::RamDebugger::searchrecursedirs \ -grid 0 supergrid::go $f set ::RamDebugger::searchmode -exact set ::RamDebugger::searchcase 0 set ::RamDebugger::searchrecursedirs 1 tkTabToWindow $f.e1 bind $w <Return> "DialogWin::InvokeOK" set action [DialogWin::CreateWindow] switch $action { 0 { DialogWin::DestroyWindow return } 1 { if { $::RamDebugger::searchstring == "" } { DialogWin::DestroyWindow return } DialogWin::DestroyWindow update SearchInFilesDo return } } } proc RamDebugger::SearchWindow {} { variable text set f [DialogWin::Init $text "Search" separator] set w [winfo toplevel $f] label $f.l1 -text "Text:" -grid 0 entry $f.e1 -textvariable ::RamDebugger::searchstring -grid "1 2 px3 py3" set f2 [frame $f.f2 -bd 1 -relief ridge -grid "0 2 w px3"] radiobutton $f2.r1 -text Exact -variable ::RamDebugger::searchmode \ -value -exact -grid "0 w" radiobutton $f2.r2 -text Regexp -variable ::RamDebugger::searchmode \ -value -regexp -grid "0 w" set f25 [frame $f.f25 -bd 1 -relief ridge -grid "2 w px3"] radiobutton $f25.r1 -text Forward -variable ::RamDebugger::SearchType \ -value -forwards -grid "0 w" radiobutton $f25.r2 -text Backward -variable ::RamDebugger::SearchType \ -value -backwards -grid "0 w" set f3 [frame $f.f3 -grid "0 3 w"] checkbutton $f3.cb1 -text "Consider case" -variable ::RamDebugger::searchcase \ -grid 0 checkbutton $f3.cb2 -text "From beginning" -variable ::RamDebugger::searchFromBegin \ -grid 1 supergrid::go $f set ::RamDebugger::searchstring "" catch { set ::RamDebugger::searchstring [$text get sel.first sel.last] } set ::RamDebugger::searchmode -exact set ::RamDebugger::searchcase 0 set ::RamDebugger::searchFromBegin 0 set ::RamDebugger::SearchType -forwards tkTabToWindow $f.e1 bind $w <Return> "DialogWin::InvokeOK" set action [DialogWin::CreateWindow] switch $action { 0 { DialogWin::DestroyWindow return } 1 { if { $::RamDebugger::searchstring == "" } { DialogWin::DestroyWindow return } if { $::RamDebugger::searchFromBegin } { if { $::RamDebugger::SearchType == "-forwards" } { set idx 1.0 } else { set idx [$text index end] } } else { set idx [$text index insert] } set ::RamDebugger::SearchIni $idx set ::RamDebugger::SearchPos $idx set ::RamDebugger::Lastsearchstring "" Search [winfo toplevel $text] any DialogWin::DestroyWindow } } } proc RamDebugger::Search { w { what {} } } { variable text if { ![winfo exists $w.search] && $what != "any" } { entry $w.search -width 25 -textvariable RamDebugger::searchstring place $w.search -in $w -x 0 -rely 1 -y -1 -anchor sw focus $text bindtags $text [linsert [bindtags $text] 0 $w.search] bind $w.search <FocusOut> "destroy $w.search ; break" bind $w.search <Escape> "destroy $w.search ; break" bind $w.search <KeyPress> [list if { [string is wordchar %A] || [string is punct %A] \ || [string is space %A] } \ "tkEntryInsert $w.search %A ; break" else "destroy $w.search ; break"] bind $w.search <Delete> "$w.search delete insert ; break" bind $w.search <BackSpace> "tkEntryBackspace $w.search ; break" bind $w.search <1> "destroy $w.search ; break" bind $w.search <3> "destroy $w.search ; break" bind $w.search <Return> "destroy $w.search ; break" bind $w.search <Control-i> "RamDebugger::Search $w iforward ; break" bind $w.search <Control-r> "RamDebugger::Search $w ibackward ; break" bind $w.search <Control-g> "RamDebugger::Search $w stop ; break" trace var RamDebugger::searchstring w "RamDebugger::Search $w ;#" bind $w.search <Destroy> [list trace vdelete RamDebugger::searchstring w \ "RamDebugger::Search $w ;#"] bind $w.search <Destroy> "+ [list bindtags $text [lreplace [bindtags $text] 0 0]] ; break" foreach i [bind Text] { if { [bind $w.search $i] == "" } { if { [string match *nothing* [bind Text $i]] } { bind $w.search $i [bind Text $i] } else { bind $w.search $i "destroy $w.search" } } } set idx [$text index insert] if { $idx == "" } { set idx 1.0 } set ::RamDebugger::SearchIni $idx set ::RamDebugger::SearchPos $idx set ::RamDebugger::searchcase -1 set ::RamDebugger::searchmode -exact set ::RamDebugger::Lastsearchstring "" set ::RamDebugger::searchstring "" } switch $what { iforward { set ::RamDebugger::SearchType -forwards } ibackward { set ::RamDebugger::SearchType -backwards } any { if { ![info exists ::RamDebugger::Lastsearchstring] } { WarnWin "Before using 'Continue search', use 'Search'" $w return } } stop { destroy $w.search return } } if { $RamDebugger::searchstring != "" || $RamDebugger::Lastsearchstring != "" } { if { $RamDebugger::SearchType == "-forwards" } { set stopindex end } else { set stopindex 1.0 } if { $RamDebugger::searchstring == $RamDebugger::Lastsearchstring } { set len [string length $RamDebugger::searchstring] if { $RamDebugger::SearchType == "-forwards" } { set idx [$text index $RamDebugger::SearchPos+${len}c] } else { set idx [$text index $RamDebugger::SearchPos-${len}c] } } elseif { [string length $RamDebugger::searchstring] < \ [string length $RamDebugger::Lastsearchstring] } { set idx $RamDebugger::SearchIni } else { set idx $RamDebugger::SearchPos } set options $RamDebugger::SearchType lappend options $::RamDebugger::searchmode if { $::RamDebugger::searchcase == 1 } { # nothing } elseif { $::RamDebugger::searchcase == 0 } { lappend options -nocase } elseif { $RamDebugger::searchstring == [string tolower $RamDebugger::searchstring] } { lappend options -nocase } lappend options -- set idx [eval $text search $options [list $RamDebugger::searchstring] \ $idx $stopindex] if { $idx == "" } { bell } else { set RamDebugger::SearchPos $idx set len [string length $RamDebugger::searchstring] if { $RamDebugger::SearchType == "-forwards" } { set idx2 [$text index $RamDebugger::SearchPos+${len}c] } else { set idx2 $RamDebugger::SearchPos set RamDebugger::SearchPos [$text index $RamDebugger::SearchPos+${len}c] } set ed [$text cget -editable] $text conf -editable 1 $text tag remove sel 1.0 end if { $RamDebugger::SearchType == "-forwards" } { $text tag add sel $RamDebugger::SearchPos $idx2 } else { $text tag add sel $idx2 $RamDebugger::SearchPos } $text conf -editable $ed $text mark set insert $idx2 $text see $RamDebugger::SearchPos } set RamDebugger::Lastsearchstring $RamDebugger::searchstring } } # proc RamDebugger::OpenVisualRegexp {} { # variable MainDir # exec [info nameofexecutable] [file join $MainDir addons visual_regexp-2.2 visual_regexp.tcl] & # } proc RamDebugger::OpenProgram { what } { variable MainDir switch $what { visualregexp { set file [file join $MainDir addons visual_regexp-2.2 visual_regexp.tcl] } tkcvs { set file [file join $MainDir addons tkcvs bin tkcvs.tcl] } tkdiff { set file [file join $MainDir addons tkcvs bin tkdiff.tcl] } } if { [interp exists $what] } { interp delete $what } interp create $what interp alias $what exit "" interp delete $what $what eval [list load {} Tk] $what eval { set argc 0 ; set argv "" } $what eval [list source $file] } proc RamDebugger::OpenConsole {} { variable MainDir set tkcon [file join $MainDir addons tkcon tkcon.tcl] if { $tkcon == "" } { WarnWin "Could not find tkcon" return } set tkconprefs { if { $::tcl_platform(platform) == "windows" } { tkcon font "MS Sans Serif" 8 } else { tkcon font "new century schoolbook" 12 } # Keep 50 commands in history set ::tkcon::OPT(history) 50 set ::tkcon::OPT(buffer) 5000 # Use a pink prompt set ::tkcon::COLOR(prompt) red # set tkcon(autoload) "Tk" set ::tkcon::OPT(cols) 80 set ::tkcon::OPT(rows) 24 set ::tkcon::OPT(gc-delay) 0 #set tkcon(cols) 60 #set tkcon(rows) 18 catch [list namespace import RamDebugger::*] puts "Welcome to Ramdebugger inside tkcon. Use 'rhelp' for help" } if { [winfo exists .tkcon] } { destroy .tkcon } set argv [list -rcfile "" -exec "" -root .tkcon -eval $tkconprefs] uplevel \#0 [list source $tkcon] uplevel \#0 ::tkcon::Init $argv proc ::tkcon::FinalExit { args } { destroy .tkcon } } proc RamDebugger::CutCopyPasteText { what } { variable text switch $what { undo { $text undo } ................................................................................ tk_textCopy $text } paste { tk_textPaste $text } } } proc RamDebugger::ListBoxDouble1 { listb item } { variable options set data [$listb itemcget $item -data] if { [lindex $data 0] == "folder" } { set options(defaultdir) [lindex $data 1] ................................................................................ RamDebugger::options(defaultdir) \ [lindex $data 1]] \; RamDebugger::FillListBox] } else { set name [lindex $data 1] $menu add command -label Open -command [list RamDebugger::OpenFileF $name] $menu add command -label Reinstrument -command [list RamDebugger::OpenFileF \ $name 2] # by now, disconnected on windows #if { $::tcl_platform(platform) != "windows" } { if { [regexp {\.(c|cc)$} $name] } { $menu add separator $menu add command -label Compile -command [list RamDebugger::Compile $name] } if { [regexp {Makefil.*[^~]$} $name] } { $menu add separator $menu add command -label Compile -command [list RamDebugger::Compile $name] } #} } tk_popup $menu $x $y } proc RamDebugger::SearchInListbox { listb ev char exec_callback } { variable SearchListboxString ................................................................................ del* { set l1_old $l1 set l2_old $l2 set l1_new $l1 set l2_new $l1 } } set Numlines [scan [$text index end-1c] %d] set font [$text cget -font] $marker configure -scrollregion [list 0 0 [winfo reqwidth $marker] \ [expr $Numlines*[font metrics $font -linespace]]] set diff [expr $l2-$l1] while { $l1_old > 1 && [lindex [lindex $instrumentedfilesInfo($currentfile) \ ................................................................................ proc RamDebugger::UpdateLineNum { command args } { variable LineNum variable text variable filesmtime variable currentfile variable currentfileIsModified if { $command == "index" } { return } if { [regexp {^(ins|del)} $command] } { CheckText $command $args } if { [regexp {^(ins|del)} $command] && !$currentfileIsModified } { wm title [winfo toplevel $text] [wm title [winfo toplevel $text]]* set currentfileIsModified 1 } ................................................................................ %W icursor end } bind $pane1.e$i <Down> {tkTabToWindow [tk_focusNext %W]} bind $pane1.e$i <Up> {tkTabToWindow [tk_focusPrev %W]} } else { $EvalEntries($i,leftentry$suffix) configure -state disabled } set comm { set w $pane2.e[expr $i+1] if { ![winfo exists $w] } { RamDebugger::CreatePanedEntries [expr $i+2] $pane1 $pane2 {$suffix} } tkTabToWindow $w } set comm [string map [list \$i $i \$pane1 $pane1 \$pane2 $pane2 \ \$suffix $suffix] $comm] bind $pane2.e$i <Return> $comm bind $pane2.e$i <FocusOut> "RamDebugger::CheckEvalEntries$suffix do $i,right$suffix" bind $pane2.e$i <ButtonRelease-1> { %W selection range 0 end %W icursor end } bind $pane2.e$i <Down> {tkTabToWindow [tk_focusNext %W]} bind $pane2.e$i <Up> {tkTabToWindow [tk_focusPrev %W]} } ................................................................................ grid columnconf $pane1 0 -weight 1 grid columnconf $pane2 0 -weight 1 # dirty trick to make the paned window actualize sizes after idle event generate $panew <Configure> } proc RamDebugger::CreateImages {} { variable images set images(break) [image create photo -data { R0lGODlhCwALAIQAAMQ4OMQ6OsZBQchGRsZCQslLS9NsbNd7e9RubspNTcU6 OuKfn+q5ueOiotRvb8dDQ/Xd3eu8vNl/f8lJSeSlpdVxccpPT/////////// /////////////////////////yH5BAEKAB8ALAAAAAALAAsAAAU94CcCJCme ZYoCgTAQgUkGhXEgiZIKxsI0jkdqcGBAIpJJioBoRCgVIeDDSjgkFYtuSlI8 Jo/tKjU9jUqnEAA7 }] set images(arrow) [image create photo -data { R0lGODlhCwALAIQAAM/Ptbq6ltjYw8zMsb6+nby8ma2thLa2kd7ezb6+nKys ga2tgrOzjM3Ns8DAn729m66uhLe3kt/fzrq6l9nZxdDQt/////////////// /////////////////////////yH5BAEKAB8ALAAAAAALAAsAAAUn4CeOZGme H4CKgTAOREwUxoGIiaLvC6N8DYfQ8YBEJKgJZVVZOU0hADs= }] set images(arrowbreak) [image create photo -data { R0lGODlhCwALAKUAAMQ4OMQ6OsZBQchGRsZCQs/PtclLS9NsbNd7e9Rubrq6 ltjYw8zMsb6+nby8ma2thLa2kd7ezb6+nKysga2tgrOzjM3Ns8DAn729m66u hLe3kt/fzspNTdRvb9l/f9Vxcbq6l9nZxcU6OsdDQ8lJSdDQt/////////// //////////////////////////////////////////////////////////// /////////////////////////////////yH5BAEKAD8ALAAAAAALAAsAAAZF wJ8QQCQKj8UkEhAQDAgFIzFgOCASikWR0eg2HA9IhCiZmM+UygRgubgvmIxm A/gxOR3PBxSSAkQjJCMlRkNJhUd2RUdBADs= }] set images(blank) [image create photo -data { R0lGODlhCwALAIAAAP///////yH5BAEKAAEALAAAAAALAAsAAAIKjI+py+0P o5yhAAA7 }] set images(file_blue) [image create photo -data { R0lGODlhCwANAKEAAAAAAFl48v///////yH5BAEAAAMALAAAAAALAA0AAAIh nI8Gy3sQogRCyelgmwNeri0X0H1g0HikZ67ohpZmnKYFADs= }] set images(file_magenta) [image create photo -data { R0lGODlhCwANAKEAAAAAANw35f///////yH5BAEAAAMALAAAAAALAA0AAAIh nI8Gy3sQogRCyelgmwNeri0X0H1g0HikZ67ohpZmnKYFADs= }] set images(file_yellow) [image create photo -data { R0lGODlhCwANAKEAAAAAAOi/PP///////yH5BAEAAAMALAAAAAALAA0AAAIh nI8Gy3sQogRCyelgmwNeri0X0H1g0HikZ67ohpZmnKYFADs= }] image create photo filenew16 -data { R0lGODlhEAAQAIUAAPwCBFxaXNze3Ly2rJyanPz+/Ozq7GxqbPz6/GxubNTK xDQyNIyKhHRydERCROTi3PT29Pz29Pzy7PTq3My2pPzu5PTi1NS+rPTq5PTe zMyynPTm1Pz69OzWvMyqjPTu5PTm3OzOtOzGrMSehNTCtNS+tAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAZ/ QAAgQCwWhUhhQMBkDgKEQFIpKFgLhgMiOl1eC4iEYrtIer+MxsFRRgYe3wLk MWC0qXE5/T6sfiMSExR8Z1YRFRMWF4RwYIcYFhkahH6AGBuRk2YCCBwSFZgd HR6UgB8gkR0hpJsSGCAZoiEiI4QKtyQlFBQeHrVmC8HCw21+QQAh/mhDcmVh dGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAx OTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRl dmVsY29yLmNvbQA7 } image create photo fileopen16 -data { R0lGODlhEAAQAIUAAPwCBAQCBOSmZPzSnPzChPzGhPyuZEwyHExOTFROTFxa VFRSTMSGTPT29Ozu7Nze3NTS1MzKzMTGxLy6vLS2tLSytDQyNOTm5OTi5Ly+ vKyqrKSmpIyOjLR+RNTW1MzOzJyenGxqZBweHKSinJSWlExKTMTCxKyurGxu bBQSFAwKDJyanERCRERGRAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAaR QIBwGCgGhkhkEWA8HpNPojFJFU6ryitTiw0IBgRBkxsYFAiGtDodDZwPCERC EV8sEk0CI9FoOB4BEBESExQVFgEEBw8PFxcYEBIZGhscCEwdCxAPGA8eHxkU GyAhIkwHEREQqxEZExUjJCVWCBAZJhEmGRUnoygpQioZGxsnxsQrHByzQiJx z3EsLSwWpkJ+QQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9u IDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2 ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7 } image create photo folderopen16 -data { R0lGODlhEAAQAIYAAPwCBAQCBExKTBQWFOzi1Ozq7ERCRCwqLPz+/PT29Ozu 7OTm5FRSVHRydIR+fISCfMTCvAQ6XARqnJSKfIx6XPz6/MzKxJTa9Mzq9JzO 5PTy7OzizJSOhIyCdOTi5Dy65FTC7HS2zMzm7OTSvNTCnIRyVNza3Dw+PASq 5BSGrFyqzMyyjMzOzAR+zBRejBxqnBx+rHRmTPTy9IyqvDRylFxaXNze3DRu jAQ2VLSyrDQ2NNTW1NTS1AQ6VJyenGxqbMTGxLy6vGRiZKyurKyqrKSmpDw6 PDw6NAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAA LAAAAAAQABAAAAfCgACCAAECg4eIAAMEBQYCB4mHAQgJCgsLDAEGDQGIkw4P BQkJBYwQnRESEREIoRMUE6IVChYGERcYGaoRGhsbHBQdHgu2HyAhGSK6qxsj JCUmJwARKCkpKsjKqislLNIRLS4vLykw2MkRMRAGhDIJMzTiLzDXETUQ0gAG CgU2HjM35N3AkYMdAB0EbCjcwcPCDBguevjIR0jHDwgWLACBECRIBB8GJekQ MiRIjhxEIlBMFOBADR9FIhiJ5OnAEQB+AgEAIf5oQ3JlYXRlZCBieSBCTVBU b0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBB bGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20A Ow== } image create photo filesave16 -data { R0lGODlhEAAQAIUAAPwCBAQCBFRSVMTCxKyurPz+/JSWlFRWVJyenKSipJSS lOzu7ISChISGhIyOjHR2dJyanIyKjHx6fMzOzGRiZAQGBFxeXGRmZHRydGxq bAwODOTm5ExOTERGRExKTHx+fGxubNza3Dw+PDQ2NAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAaA QIAQECgOj0jBgFAoBpBHpaFAbRqRh0F1a30ClAhuNZHwZhViqgFhJizSjIZX QCAoHOKHYw5xRBiAElQTFAoVQgINFBYXGBkZFxYHGRqIDBQbmRwdHgKeH2Yg HpmkIR0HAhFeTqSZIhwCFIdIrBsjAgcPXlBERZ4Gu7xCRZVDfkEAIf5oQ3Jl YXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3Ig MTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5k ZXZlbGNvci5jb20AOw== } image create photo acttick16 -data { R0lGODlhEAAQAIIAAPwCBMT+xATCBASCBARCBAQCBEQCBAAAACH5BAEAAAAA LAAAAAAQABAAAAM2CLrc/itAF8RkdVyVye4FpzUgJwijORCGUhDDOZbLG6Nd 2xjwibIQ2y80sRGIl4IBuWk6Af4EACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYg UHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJp Z2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs= } image create photo edit16 -data { R0lGODlhEAAQAIYAAPwCBFxaVMR+RPzKjNze3AQCBMR6RPzGjPyODPz+/MzO zPyKDPyKBPz29OTWzPyGDPyGBOx6BOza1OR2BKROBNSOXKRKBBwOBOzu7PTW xPzizOySZPyCDFxaXOy2lNRyRMxmJCQOBPTm1OzStPTKrMR+XIRWLFxGNCQS BDQyNIRSNDQuJERGRLyqlNzSvIx6ZKRuVEw6LLSyrLymhKSShBwaFFROTJyW jMS+vNzW1OTazNzKrHRqXOzezOTOpPTq3OzWvOTStLyedMS+rLy2pMSynMSu lAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAA LAAAAAAQABAAAAewgAAAAYSFhoQCA4IBBI2OjgUGBwiLBAmXlpcKkgsMlZcJ BA0JDpIPEBGVjwkSBgOnExSfmBIVBxAMExYXswkYGRobHLq8gh2PHhoeHyAW IYKzIiMkJSYnKCnQg5YNHtQqKywtK9qMBC4vMDEBMjIz2dCMDTQ1Njc4OToz 5PEEOzw3ZPToMcLHO23HfogQ0QMIkCA+hPBbhAPHECJFjMyYIUQIvEUpUqwQ OXKkSEF+AgEAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAy LjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVk Lg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw== } image create photo actcross16 -data { R0lGODlhEAAQAIIAAASC/PwCBMQCBEQCBIQCBAAAAAAAAAAAACH5BAEAAAAA LAAAAAAQABAAAAMuCLrc/hCGFyYLQjQsquLDQ2ScEEJjZkYfyQKlJa2j7AQn MM7NfucLze1FLD78CQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJz aW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVz ZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7 } image create photo filenew22 -data { R0lGODlhFgAWAIUAAPwCBExOTERCRDw6PCwuLBwaHAwODAQCBOze1NTW1OTi 5Nze3MTGxLS2tJyanPz+/Ozu7OTi3BQSFCwqLDw+PDQyNFRSVPTu7MzKxLyy rIR+fCQmJPz6/NTOxPz69Pzy7PTu5Pz29Pzu5PTq5PTm1My6pBQWFPTq3PTm 3NS+rAwKDPTi1PTezOzWxMy2pPz27PTazOzSvMyynOzaxOzOtPTaxOzKrMyq jOzGpMymhPTizOTCpNzSzNTGvMymjMSihCH5BAEAAAAALAAAAAAWABYAAAbo QIBwSCwaiYGAYEAgFAqGg/Q4DCASCsTiymgcHAcqQLB4mM+QiIQBppLPcMjk wQ4bB2X4maKgt4sVCHpnFhQTElNFE3mDDxcYGRp2RBuMgxwIHX9EBZZwHh8g CBmTQ52NISEiIyQlpUImng8hHyInKAgprwAqgnC0IKwrLLpGB4wctLYkwy0u uwd9Z8AnJywsLcVFx2YcL7UnJCwwLTEy0GXJoSgrCCwzNDTnxgjeH9UrKzXw NDY36LRGhEOwLx4NHDmgJbh3QoeOgv127EhojEeHDj16pEhRQoZHHzl+QJNC sqTJSXaCAAAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIu NQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQu DQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7 } image create photo fileopen-22 -data { R0lGODlhFgAWAIYAAPwCBAQCBCQWDCwaDDwmFPSubPzGhPzCfPy2dOSmZPzK lPzSnPzOlPzKjBQODPzChPzWnPy2bPSmXPyuZOyeXIRSLEQuFEwyHEQqFDQi FCweDKRuPFRSTPT29PTy9Ozq7OTi3Nze3NTW1MzOzMTGxMTCxLy6tLSytKyu rDQyNMzKxOTm5OTi5Nza1NTS1MTCvLS2tLSyrKSmpJyenJSWlIyKjHx+fFxe XBwaHKxuPMzKzLy6vIyOjHx6fDw6NPy6dGxubLy+vISChCQmJNza3KyqrBQS FLR2RKSinJyanGxqZAwGBJSSlCwqLAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAA LAAAAAAWABYAAAf/gACCg4SFhoeDAYqKiIeLj4wBjQCMhY+NkoiLk5qbhQID oJyGBAUGBwgEo4MECQoLDA2pDrS1tKQPEAwHERITE77AvxKqhAQNDA8UFRYX Fs8YBAQZGqGPxw0RGxwdHR4eHyAhIiMkJSYnKCgpBAYPEhcqHyssLS4kLzAx MjM0NTY3cBA4UCAHBw8gVnhgEcKFjhc7UPDj0cMHAAI/KFgY4YLFio/jRpTY sW8GDyCSCEQw2DChOHIqgsCQSEPIEEEEJFhAoUNECCJEyOk4d6KIyRtGcB7h IJKjixEjHu4oimSGEIs4d8IIUoKECnNB0ElMwkNJJgBLlJBAcQKGiR07KGAU RVGViY0mhIwwSTKjr99+THjUoIg0r48hTRIrRtxkiOMhDgrZCQQAIf5oQ3Jl YXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3Ig MTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5k ZXZlbGNvci5jb20AOw== } image create photo filesave22 -data { R0lGODlhFgAWAIUAAPwCBGxqbAQCBLy+vERCRExKTHRydIyKjMTCxFxaXGRi ZFRSVFRWVPz6/Nze3Nzm5Pz+/JyanDw+PExOTHR2dMTGxBQWFLSytHx+fISC hOzy9Ly6vAQGBJSWlMzKzAwODJSSlHx6fIyOjOTi5DQ2NISGhGxubCwuLOzq 7ERGRFxeXNTW1CwqLPT29Dw6PGRmZKSmpAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAWABYAAAb/ QIBQGBAMj8ikUDAgFAzKKCBwQCQUCcICKh0SEAhGw5EIZAmBrgCxeDQgcDJW yz0GIggJfL+XGwQJRxNgC3yGDwwUFUZDFhdthnwMGAZNQwEZFwQakXANBBQb HIIdERIBnRAOiR4ERx8gsSEMBBmGCyEGG3YGBwcgIr8UCwQHECOgG4xCtRkE JAvBJRklJgkSFBQeJ68hJiEoESkFKiEZIbkGARsLlwEGExENGhorGSkpFAYm 66NDLAECpGiBYsUIFA8wLHBBQMWLVkdUCFCwaYVFBOymkVCgYEMgOykEpICB ccMBAhhELFigTEqAAgIIwCiQ4eRKDyS6EAlJIAI0EpaudF4iIKDAAn9CkRT5 eMROEAAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0K qSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpo dHRwOi8vd3d3LmRldmVsY29yLmNvbQA7 } image create photo wizard-22 -data { R0lGODlhFgAWAIQAAPwCBNzaTPz6BAQCBPz+BExKBMzOTPz+rPz+3ISCBPTy hISCLISChPz+xOTiVPz+/MTCxKSipKyqrExOTDw+PDQyNAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAWABYAAAV+ICCOZAkE ZqoKqoqKAzHAb1sIxhAQwWAQhRaJd0AcdgkhqaBAOBUL5WjAaD6TUqog0DAi ldqcg+cDtgaPACTCiM0AOhV6sG4DWOAHnf2uyfV1b1lsgVIwEgwTFHaGA2yK FYJgiJCSQo6JFJGGcJSalkKPn5wimZukAJWoIgYhACH+aENyZWF0ZWQgYnkg Qk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5 OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3Iu Y29tADs= } image create photo actundo22 -data { R0lGODlhFgAWAIUAAPwCBCReDJzGjMzivOTu3PT69MTivHy+VJTWbIzKZEym JESmFESiHDyiHESqLAQCBFzKNGzWPFS2LNTmzCxqDDRqHPz+/KTGnBQqBAQO BAwaBESCHHy2XBxGDOzy7HTCTEyyJDSqFHzWTAwSBBQ6BIy+dESKJFySPFSS NAwiBCRGFBQmDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAWABYAAAal QIBwSCwaj8ikMsBkKotMwYAwEDiXgYLhwD0gCFZiQKxNKBYMRqPh+D6G16y5 AYnYIxBJAyF4AwITTAUJdBESD4gPFBV6Fn6ABBcJDIYPGEQZGhQbHAIdfx4J Hw2VSBodGwWfAR4LDSALfkgYAQurBiAhICKfSSMkvQElGyYnGyi9Rxkdj4nO skUYyU9FpxnURikdGtjRKivdRKfQ2Inh5+jpRwZBACH+aENyZWF0ZWQgYnkg Qk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5 OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3Iu Y29tADs= } image create photo editcut22 -data { R0lGODlhFgAWAIMAAPwCBAQCBAwCBPz+/OTi5JyanOzq7DQyNGxqbAAAAAAA AAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAWABYAAARbEMhJq704gxBE 0Bf3cZo4kRJqBQNRfBucyudgvJS6VaxLzyMa6/bLiWA9HOg4VIIkL5vzuRkc pkvRIIAorphJLzBW84WEuRZWp6uaT7J2Sh1Hit3OY/ZO7WvsEQAh/mhDcmVh dGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAx OTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRl dmVsY29yLmNvbQA7 } image create photo editcopy-22 -data { R0lGODlhFgAWAIUAAPwCBBQSFPz+/DQyNISChDw6PMzKzMTGxERGRIyKjFxa XMTCvKSmpHR2dPz6/Pz29PTq3MS2rPz69MTCxFxWVHx6dJyWjNzSzPz27Pzy 7Pzu5PTm3NTKvIR+fJyGfHxuZHxqXNTCtPTq5PTi1PTezNS+rExOTFRORMyy lPTaxOzWxOzSvNze3NTOxMy2nMyulMyqjAQCBAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAWABYAAAbY QIBwSCwahYGkUnk0BgTQ6IAQaBKfUWhBYKhaAU+CgXAQIAyChLeJzSIQhcH6 GFaM0QtGY5kstqEODw8QEQELAhJTc08KBBMEFBUWDRcBE1pca20SGBkaEBsc AY5maFRIAgoLHRQRHh8gIQFlZnByqA8ZGSIQIyQjJQEmYgJ5p2ACrK4gJx4g KIZZAgdeAQ4ZI9kjKSor0AwEjeAs1S0cHAslLi4vMDDRWeRIfEsxMeET4ATy VoYLC5fizXEiAR84BeMG+pEm8EsAFhAjSlR4hR6fLxiF0AkCACH+aENyZWF0 ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5 OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2 ZWxjb3IuY29tADs= } image create photo editpaste22 -data { R0lGODlhFgAWAIYAAPwCBBQWFDw6FHRuFGRaBFxSBAQCBAQKBCQiBIx6HPz6 /NTOfKyiXDQuFOTm5Pz+/Ozu7PTq5Pz63PTyxNTOjKSeRExGLMTGxMzKzNTS 1NTW1Dw2NKSmpKyqrKSipJyanNzWlLy6ZLSuVIx6FISChIyKhJSSlCQiJLS2 tDw6NDQyNCQiFCQmHBQSDGRiZHRydGxubHx6dGxqbFxeXGRmZFxaXCwuLOzq 7KyurHx+fDwmFEQuFCweFCQWDBQODBwaHBweHKSinJSWlOTi5JyepHR2dDw6 PBQSFNze3ERGRIyKjIyOjISGhPz29Pzy7MS2rMzOzFRWVHx2dHxybDQiFPz2 7Pzu5PTq3PTm1NTCtJyGdHxuZHxqXPzq3PTaxNS6pFxWVFRKRNS2nPTi1PTS tNSulNzOxNSynMymhAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAA LAAAAAAWABYAAAf/gACCgwABAgMEBYSLggaOjgcICQoLDA2Pj4MGDg8QEZ4F DxITFBUWFxcYGRobjQ8cHR4fCQ8gCyEiFSMWJCUkJieNEB4dKB4pKissK8wr LS4vMDHBAAYQHx8dFx0fJDIzNDU0M+IyHzaNNyg43Ng5Ojs7Ojw9Pj9AMkCN DiZB/h9CSOx4QLCgihItqBkYgqIDESElitAYWJCgkQcXjjRCgi1Ihw4BB5LA QOLCgyQYHihpUU3DBw5ElpAgAYNixSRJjKjQaECDCRPZPDB5IbIGSQwKLnh4 wbInLA4kmJB4oaPiAwVNnER40hRK1BIAaVatUZJEFCkmpmjgCeWDCalFe4q4 oFKwSRUrEa5gycLzwq8lUnPQ4PEgSpYcUZ5o2cIlS1O/JHLEDdfjQZMIVrpg weLFy5e+M6WSmBGlxYMYYBRzCaOFi5imHWBIfOEiShLTVjaP6eyFTBmN1TA5 OvLDjJksWb58OVMGDRqWjAYdmU79SIvpjqJr104nEAAh/mhDcmVhdGVkIGJ5 IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5 OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29y LmNvbQA7 } image create photo find-22 -data { R0lGODlhFgAWAIYAAPwCBBQSFJSWlFxaXJyanKy2tLzCxDw+PHyChNTa3Nzq 7Nz29NTy9Mzu9OT29Nzi5Oz6/Mzy9Kzi7Jze5Lze5Nzy9JyenIyKjHR2dMTu 9Kzm7JzW3ITW3ISChGxubERGROz+/Lzq9IzW5HzK1LTm7FRSVHTS3GS+zLTS 1DQ2NMzOzMTq7Lzq7ITW5FS2vMTi5ExOTKTm7EzCzEy2vEyutJTa5FTK1ESi rGy+zMzi5ESerESmtITa5OTy9KTe5KyqrAz+/Azi3ASutERCRExKTFRWVAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAA LAAAAAAWABYAAAf/gACCggGFhYOIAAIDiYUEBQYFAoeJAweKhAgJCgsLDA0O CAGJg4wBCA8QDhENEhMUFaKDFhcYgwEJCxAQDBkaGxwSFaMAFh0eAx8AAQIK ECAODCEaIiMjJJMAtQMlygEGEBkVva4mJycTKKMYJd0pyyoOKyssGhMtIycu Gi/EMB/vlhmoQEFDjHsmZMygUUMdqWUCGgCbYMKEjRk3cEjI9jBADg3Wzs3Q sYOHA2IdO1SQkI/GjRMtFhBA2RFBDwk+OASrMPMHkIe3AhBA8QLFzAAHgvyg 2dEQMSEHPCwltQgooSFSmVpSxKjjh6wPtwINgHVqsVpWESEFeywZ17RkED2s 40YEgFirlIq4SwvUQCAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVy c2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJl c2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw== } image create photo player_end-22 -data { R0lGODlhFgAWAIUAAPwCBDQyNFxeXAQCBMTCxGReZBQSFOzm7AwKDKymrJSS lFRSVCwqLLy6vPTy9OTe5Ozq7CQiJLSytOTi5BwaHPz+/HRydMzKzKSepJSO lKSipJyanIyGjIyKjKyurISGhMzGzJyWnHR2dISChIyOjLSutDw+PERCRHx6 fJSWlIR+hJyenGRmZHx2fAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAWABYAAAa6 QIBwSCwaj8ikMBBQKgOCgRMZIBSkxYHWoDVWD9EigpBQLLBERsPxCA8NDUhj gTBGJJNGG02RVBQWdUV3FxgZe0IGfoAGdhoXGxwdiAYef4FGFBoeHB8dGSBR ihUhIo1FBhkbIyMkJRYmAwYal4JEBh2RChIWJ1IIGxUZFqdECCgkHR6wWAYp FR2YWSobvL5vFgfDaEMDIivMRBEsD9HcQgMWvecDLB0tZ0btsfJa9vLXU/X6 /P3+b0EAACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41 DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4N Cmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs= } image create photo player_stop-22 -data { R0lGODlhFgAWAIUAAPwCBAQCBAwKDBQSFBwaHCQmJJSSlISChJSOlJSWlGxq bGRiZNTS1PTy9Pz+/Ozm7OTi5FRSVIyKjOTe5MTCxIR+hExOTHR2dLy6vLSy tLy2vHRydFxWXIyGjIyOjPz2/FRWVHx6fExKTMzOzJyanKSmpKyqrKSipAQG BLSutHx2fDw6PAwODAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAWABYAAAa1 QIBwSCwaj8ikcslsAgKCAWEQjQ4KgSwyYDAcugZEQqFYYJECA6PhaLcfEEUk gJZAGJB8fkKpWOhHAxcOGBQZGBoaGQgbHIBGAhUOGR0SBxISBh4Xf0iCHxQS lRIIXhsgj0UCIaCXmJgHGyKpRJ+hmB5dHQqOaCENIx0epBIkBhdzngoPGCQl JifQJBvJRygRKRcKGxcXGypys1srEREc5SLnICLiR1koLFVUWfRO9vf4+Uwy QQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBE ZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRw Oi8vd3d3LmRldmVsY29yLmNvbQA7 } image create photo finish-22 -data { R0lGODlhFgAWAIUAAPwCBAw2VAQCBBxCXDR+nIS21Aw+XJTC1Nzu/KzO3Pz+ /Nzq9Pz6/MTe7KTW5FzC1Nzu9CRKZMzi7IzK3Lzi7LTe7HzG3Gy+3AyuzAye xFzC3DRSbHy+1Dy61CSqzAySvAyStLze7IzO5AyGrEze7BRmjCTC1ETS3ETa 5BTC3Bx2nAyWvAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAWABYAAAak QIBwSCwaj8hkMqBsBgTN5IAAJQqqykCBasUmDQcEV3gtBs7oATihGJeJgcOC QWc0HA8Ig/seRiQTFAsVFhcYGRp6VH1CGwscHQ8dGB4fIBkPIWKMAAMLIiAj IJcgH5gkGSWcARIiJicoJikpHikoHqqrKiW8JSogKymoqgCrV8cCARgkuFWc RwYeqVjPRgEExEPVRQbZ2l5IBuBRQ0zk5+hRBkEAIf5oQ3JlYXRlZCBieSBC TVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4 LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5j b20AOw== } image create photo down-22 -data { R0lGODlhFgAWAIUAAPwCBAw2VCRKZDRSbBxCXJTC1Mzi7Nzq9NTm9Bx2nAQC BNzu9JzG3Hy+1HzG3IzO5BRmjPz6/LTe7Dy61AyStCTC1FzC1AyGrETS3ETC 1ETa5BRulAyuzBRylAw+XMTe7Gy+3CSqzAyexBTC3DR+nIS21KTW5Nzu/KzO 3FzC3Pz+/ByixEze7AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAWABYAAAaR QIBwSCwaj8ikcnkMBAQDgjPAFAYKhsMBkVBUAYEFo+F4QLzVQEQyoVTOX/XB csHA0+vMRbNBMwkRDhxuHX5GTlIeHh8gISIjFAEeiVRECiQlDAUmgxQjIhwi JHdFlycoKSIUFCEjGiGkRpcqCxYijxorsUezcxYsuoZJsxLAu0qXB7DCTJfH VQrMX9PU1Uh0QQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9u IDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2 ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7 } } proc RamDebugger::TkBackCompatibility {} { set comms [list tkButtonInvoke tkTextSelectTo tkEntryInsert tkEntryBackspace \ tk_textCut tk_textCopy tk_textPaste tk_focusNext tk_focusPrev tkTextClosestGap \ tkTextAutoScan tkCancelRepeat] foreach i $comms { auto_load $i if {![llength [info commands $i]]} { tk::unsupported::ExposePrivateCommand $i } } } proc RamDebugger::InitGUI { { w .gui } } { variable options variable options_def variable marker variable text variable mainframe variable listbox variable pane2in1 variable images variable textST variable textOUT variable textCOMP variable breakpoints variable MainDir proc ::bgerror { errstring } { RamDebugger::TextOutRaise RamDebugger::TextOutInsertRed "-------------ERROR FROM RAMDEBUGGER-----------\n" RamDebugger::TextOutInsertRed $::errorInfo RamDebugger::TextOutInsertRed "----------------------------------------------\n" WarnWin $errstring } package require Tablelist package require BWidgetR package require supertext package require supergrid package require dialogwin ................................................................................ -command "RamDebugger::PreferencesWindow"] \ ] \ "&View" all view 0 [list \ [list command "&View text/all" {} \ "Toggle between viewing all windows or only text window" "Ctrl t" \ -command "RamDebugger::ViewOnlyTextOrAll"] \ separator \ [list cascad "&Windows" {} windowslist 0 {}] \ ] \ "&Debug" all debug 0 [list \ [list command "&Continue/Go" debugentry "begin/continue execution" "F5" \ -command "RamDebugger::ContNextGUI rcont"] \ [list command "Set/unset &breakpoint" debugentry "Set/unset breakpoint" "F9" \ -command "RamDebugger::SetGUIBreakpoint"] \ [list command "&Next" debugentry "continue one command" "F10" \ ................................................................................ [list command "&Timing control..." debugentry \ "Open a window to control execution times" "" \ -command "RamDebugger::DisplayTimesWindow"] \ ] \ "&C++ project" all c++ 0 [list \ [list command "&Create/Edit" c++entry "Create or edit a c++ compile project" "Alt F7" \ -command "cproject::Create $w"] \ [list cascad "&Active configuration" {} activeconfiguration 0 [list \ [list radiobutton "Debug" {} "Compile debug version" "" \ -variable ::cproject::debugrelease -value debug] \ [list radiobutton "Release" {} "Compile release version" "" \ -variable ::cproject::debugrelease -value release] \ ] \ ] \ [list command "&Compile" c++entry "Compile project" "F7" \ -command "cproject::Compile $w"] \ separator \ [list command "&Clean" c++entry "Clean compiled project files" "" \ -command "cproject::CompileClean $w"] \ ] \ "&Utilities" all utilities 0 [list \ [list command "&Open console" {} "Open console" "" \ -command "RamDebugger::OpenConsole"] \ [list command "O&pen VisualRegexp" {} "Open VisualRegexp" "" \ -command "RamDebugger::OpenProgram visualregexp"] \ separator \ ................................................................................ set label [$mainframe addindicator -textvariable RamDebugger::remoteserver -width 15 \ -anchor e -padx 3] set menu [$mainframe getmenu activeprograms] $menu configure -postcommand [list RamDebugger::ActualizeActivePrograms $menu] bind $label <1> "tk_popup $menu %X %Y" set menu [$mainframe getmenu windowslist] $menu configure -postcommand [list RamDebugger::ActualizeWindowsList $menu] set menu [$mainframe getmenu recentfiles] $menu configure -postcommand [list RamDebugger::AddRecentfilesToMenu $menu] ################################################################################ # The toolbar ################################################################################ set toolbar [$mainframe addtoolbar] ................................................................................ foreach "weight1 weight2 weight3" [ManagePanes $pw h "1 6 2"] break set pane1 [$pw add -weight $weight1] if { ![info exists options(defaultdir)] } { set options(defaultdir) [pwd] } label $pane1.l -textvar RamDebugger::options(defaultdir) -anchor e -relief raised -bd 1 \ -padx 5 -grid "0 ew" set sw [ScrolledWindow $pane1.lf -relief sunken -borderwidth 0 -grid 0] set listbox [ListBox $sw.lb -background white -multicolumn 0 -selectmode single] $sw setwidget $listbox if { $::tcl_platform(platform) != "windows" } { $listbox configure -selectbackground \#48c96f -selectforeground white ................................................................................ [list RamDebugger::ScrollTextAndCanvas $fulltext.text $fulltext.can] scrollbar $fulltext.xscroll -orient horizontal -grid "0 2" -command "$fulltext.text xview" if { $::tcl_platform(platform) != "windows" } { $text conf -exportselection 1 -selectbackground \#48c96f -selectforeground white } proc ScrollTextAndCanvas { text canvas args } { eval $text yview $args $canvas yview moveto [lindex [$text yview] 0] } proc ScrollScrollAndCanvas { text yscroll canvas args } { eval $yscroll set $args $canvas yview moveto [lindex [$text yview] 0] } set pane2in2 [$pwin add -weight $weight2in] NoteBook $pane2in2.nb -homogeneous 1 -bd 1 -internalborderwidth 0 \ -grid "0 py2" -side bottom set f1 [$pane2in2.nb insert end stacktrace -text "Stack trace"] set sw2 [ScrolledWindow $f1.lf2 -relief sunken -borderwidth 0 -grid "0" \ -scrollbar both -auto both] set textST [text $sw2.text2 -background white -wrap none -width 80 -height 4 \ -highlightthickness 0] $sw2 setwidget $textST supergrid::go $f1 set f2 [$pane2in2.nb insert end output -text "Output"] set sw2 [ScrolledWindow $f2.lf2 -relief sunken -borderwidth 0 -grid "0" \ -scrollbar both -auto both] set textOUT [text $sw2.text2 -background white -wrap none -width 80 -height 4 \ -highlightthickness 0] $sw2 setwidget $textOUT supergrid::go $f2 set f3 [$pane2in2.nb insert end compile -text "Compile"] set sw2 [ScrolledWindow $f3.lf3 -relief sunken -borderwidth 0 -grid "0" \ -scrollbar both -auto both] set textCOMP [text $sw2.text2 -background white -wrap none -width 80 -height 4 \ -highlightthickness 0] $sw2 setwidget $textCOMP supergrid::go $f3 #$pane2in2.nb compute_size $pane2in2.nb raise stacktrace ................................................................................ supergrid::go $pane2in2 supergrid::go $pane1 supergrid::go $pane2 supergrid::go $pane3 supergrid::go $f supergrid::go $w if {[string equal "unix" $::tcl_platform(platform)]} { foreach "but units" [list 4 -5 5 5] { set comm { set w %W while { $w != [winfo toplevel $w] } { catch { set ycomm [$w cget -yscrollcommand] ................................................................................ } bind $marker <ButtonRelease-1> { tkCancelRepeat } bind all <Control-Key-1> "RamDebugger::DisplayWindowsHierarchy ;break" if { ![info exists options(maingeometry)] } { set options(maingeometry) 800x600 } if { [info exists options(ViewOnlyTextOrAll)] && $options(ViewOnlyTextOrAll) == "OnlyText" } { RamDebugger::ViewOnlyTextOrAll } # trick to know if we are debugging RamDebugger if { [info command sendmaster] != "" } { if { [regexp {(\d+)x(\d+)[+](\d+)[+](\d+)} $options(maingeometry) {} wi he xpos ypos] } { incr xpos 20 incr ypos 20 wm geom $w ${wi}x$he+$xpos+$ypos ................................................................................ wm geom $w 800x600 wm state $w zoomed } else { wm geom $w $options(maingeometry) } } ActualizeActivePrograms $menu if { [info exists options(breakpoints)] } { set breakpoints $options(breakpoints) } # if { [info exists options(remoteserverType)] && $options(remoteserverType) == "remote" && \ ................................................................................ # SetMessage "" # } if { [info exists options(currentfile)] && $options(currentfile) != "" && \ [file exists $options(currentfile)] } { SetMessage "Opening file '$options(currentfile)'..." OpenFileF $options(currentfile) if { [winfo exists options(currentidx)] } { $text see $options(currentidx) $text mark set insert $options(currentidx) } SetMessage "" } else { NewFile } focus $text cproject::Init $w # for tkcon rename ::exit ::exit_final proc ::exit { args } {} # for defining what is a word for text widgets |
| > > > > | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | > > > > > > > > > > | > > > > > > > > > > > > > > | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > < > > > > | > > > | | | < > | > > > | > > | | | > | > | > > | > > > | > > > > | > > | > > > < < < | | | | | | | > > > > > | | > > > > > > > > > > > > > > > > > > > > > > > > > > > > | | | | | | | > > > > > > < < < < < < < < < < < < > > > > > > > > > > > > > > > > > > > > > > > > | | | | < > | | | | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | < < < < < < | < < | < < < < < < < < | | > | > > > > > > > | | > > > > > | > > > > > > > | > > > > > > > > > > < < < < < < < < > > > > > > > > > > > > > > > > | > < < | < < < | < > | | > > | > > > | | > > > > > > > > > > > > > > > > > > > > > > > > > > > > | > | > | > > | > > > > > > | > > | | > > > | > > > > > > > < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | > | > > > > > > > > > > > > > > | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | | > > > | > > > > | | | | | | | | | | | | | | > > | < < > > > > > > > < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < > | | > | | | | | | < | | < < < < < < < < < < < | | | < | > | | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < > > > > | | < < < < < < < < < < < < | < < < < < < < < < < < < < < < < < < | > < < < < < < < < < < < < > | > > > < < < < < < > > > > > > > > > > > > > > < < < < < < < < < < < < < < < < < | < < < < < < | < < < < < < < < < < < < < < > > > | < < < < < < < < < < < < < < < < < < < < | < < < < < < < < < < < < < < < > > > > | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < > > | | | | | > < | | | | | | | > > > > | | | | > > > | | > < < < < < < < < < | | | > > > > > > > > > > > > > < > > < |
1 2 3 4 5 6 7 8 9 10 11 12 .. 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 ... 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 ... 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 ... 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 ... 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 ... 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 ... 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 ... 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 ... 482 483 484 485 486 487 488 489 490 491 492 493 494 495 ... 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 ... 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 ... 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 ... 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 ... 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 .... 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 .... 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 .... 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 .... 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 .... 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 .... 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 .... 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 .... 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 .... 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 .... 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 .... 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 .... 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 .... 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 .... 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 .... 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 .... 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 .... 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 .... 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 .... 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 .... 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 .... 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 .... 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 .... 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 .... 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 .... 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 .... 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 .... 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 .... 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 .... 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 .... 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 .... 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 .... 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 .... 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 .... 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 .... 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 .... 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 .... 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 .... 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 .... 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 .... 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 .... 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 .... 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 .... 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 .... 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 .... 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 .... 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 .... 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 .... 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 .... 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 |
#!/bin/sh # the next line restarts using wish \ exec wish "$0" "$@" # $Id: RamDebugger.tcl,v 1.11 2002/09/09 19:30:04 ramsan Exp $ # RamDebugger -*- TCL -*- Created: ramsan Jul-2002, Modified: ramsan Aug-2002 ################################################################################ # This software is copyrighted by Ramon Ribó (RAMSAN) ramsan@cimne.upc.es. # (http://gid.cimne.upc.es/ramsan) The following terms apply to all files # associated with the software unless explicitly disclaimed in individual files. ................................................................................ variable TextMotionAfterId "" variable ExpressionResult "" variable count variable listbox "" variable progressvar variable status variable WindowFilesList "" variable WindowFilesListLineNums "" variable WindowFilesListCurr -1 ################################################################################ # Preferences ################################################################################ variable options ................................................................................ ################################################################################ # Setting preferences ################################################################################ set options_def(indentsizeTCL) 4 set options_def(indentsizeC++) 2 set options_def(ConfirmStartDebugging) 1 set options_def(instrument_source) auto set options_def(ConfirmModifyVariable) 1 set options_def(LocalDebuggingType) tk set options_def(executable_dirs) "" switch $::tcl_platform(platform) { windows { set options_def(NormalFont) { -family "MS Sans Serif" -size 8 -weight normal \ -slant roman -underline 0 -overstrike 0 } set options_def(FixedFont) { -family "Courier" -size 8 -weight normal \ -slant roman -underline 0 -overstrike 0 } ................................................................................ # this variable is only used on windows. It can be: # 0: Only check remote programs on demand (useful if not making remote debugging, the # start up is faster) # 1: Register as remote and check remote programs on start up. It can be slower the # start up but is better when making remote debugging if { $::tcl_platform(platform) == "windows" } { set options_def(CheckRemotes) 1 } ################################################################################ # Reading preferences (they are only saved in GUI mode) ################################################################################ ................................................................................ set data [read $fin] close $fin } array set options $data } } UpdateExecDirs ################################################################################ # Registering as remote server ################################################################################ if { $debuggerserver != "" } { return } ................................................................................ if { [info command wm] != "" } { package require Tk wm withdraw . } set debuggerserver [tk appname $debuggerserver] } } proc RamDebugger::UpdateExecDirs {} { variable options variable MainDir if { $::tcl_platform(platform) == "windows" } { set file [filenormalize [file join $MainDir addons]] if { [lsearch $options(executable_dirs) $file] == -1 } { lappend options(executable_dirs) $file } foreach i [glob -nocomplain -dir c: mingw*] { set dirs_in [glob -nocomplain -dir $i mingw*] foreach j [concat [list $i] $dirs_in] { if { [file exists [file join $j bin]] } { set file [filenormalize [file join $j bin]] if { [lsearch $options(executable_dirs) $file] == -1 } { lappend options(executable_dirs) $file } } } } } if { ![info exists ::env(PATH)] } { set list "" } else { set list [split $::env(PATH) \;] } set haschanged 0 foreach i $options(executable_dirs) { if { $::tcl_platform(platform) == "windows" } { set err [catch { set shortname [file native [file attributes $i -shortname]] }] if { !$err } { set i $shortname } } if { [lsearch $list $i] == -1 } { lappend list $i set haschanged 1 } } if { $haschanged } { set ::env(PATH) [join $list \;] } } ################################################################################ # Main non GUI functions ################################################################################ proc RamDebugger::rhelp { args } { ................................................................................ FindActivePrograms 1 } else { FindActivePrograms 0 } if { $opts(-actives) } { return [array names services] } if { $opts(-disconnect) } { if { $remoteserver == "" } { error "error. There is no debugging session active" } if { $remoteserverType == "local" } { interp delete local } elseif { $remoteserverType == "gdb" } { catch { close [lindex $remoteserver 0] } } set remoteserver "" ................................................................................ # dirty trick to avoid the slave interp block interp eval local { proc updatemaster {} { sendmaster update after 3000 updatemaster } } proc exit_slave { args } { if { [catch [list RamDebugger::rdebug -disconnect] errstring] } { WarnWin $errstring } else { set code 0 if { [llength $args] == 1 } { set code [lindex $args 0] } TextOutRaise TextOutInsertRed "Program exited with code $code" } } interp alias local exit "" RamDebugger::exit_slave local eval { set argc 0 ; set argv "" } local eval [list set argv0 $currentfile] if { [info exists options(currentfileargs)] } { foreach "curr dir_in arg_in" $options(currentfileargs) { if { $curr == $currentfile } { if { [file isdirectory $dir_in] } { cd $dir_in } local eval [list set argc [llength $arg_in]] local eval [list set argv $arg_in] break } } } set err [catch {package present registry} ver] if { !$err } { interp alias local registry "" registry interp eval local package provide registry $ver } if { ![info exists options(LocalDebuggingType)] || $options(LocalDebuggingType) == "tk" } { interp eval local [list load {} Tk] } #local eval { catch { bind . <Destroy> exit } } set remoteserverType local if { $currentfile == "" } { error "Error. there is no current file" } set remoteserver $currentfile TakeArrowOutFromText } elseif { $opts(-debugcplusplus) } { ................................................................................ set pwd [pwd] cd $dir set fid [open "|gdb -q |& cat" r+] cd $pwd set remoteserver [list $fid $opts(program) start] fconfigure $fid -blocking 0 -buffering line fileevent $fid readable RamDebugger::RecieveFromGdb TakeArrowOutFromText } else { if { $opts(program) == "" } { if { $remoteserver != "" } { return $remoteserver } else { error "error. $usagestring\nActive programs: [array names services]" } } if { [lsearch [array names services] $opts(program)] == -1 } { ................................................................................ variable stopnext 0 variable contto "" variable outputline 0 variable lastprocname "" variable lastlevel 0 variable currentfile "" } proc RDC::SendDev { comm } { SENDDEVBODY } proc RDC::MeasureTime { name timestr } { SendDev [list RamDebugger::RecieveTimeFromProgram $name [lindex $timestr 0]] } proc RDC::Continue {} { ................................................................................ if { $evalhandler != "" } { RDC::SendDev "$evalhandler [list [list $err $returnvalue]]" } else { RDC::SendDev [list RamDebugger::RecieveFromProgramExpr $err $returnvalue] } } } if { [info commands ::RDC::bgerror_base] == "" } { auto_import ::bgerror if { [info commands ::bgerror] != "" } { rename ::bgerror ::RDC::bgerror_base } proc ::bgerror err { RDC::SendDev [list RamDebugger::RecieveErrorFromProgram $err $::errorInfo] } } if { [info commands ::RDC::puts_base] == "" } { rename ::puts ::RDC::puts_base proc ::puts args { set argsN $args set hasnewline 1 if { [lindex $argsN 0] == "-nonewline" } { set hasnewline 0 set argsN [lrange $argsN 1 end] } set channelId stdout if { [llength $argsN] == 2 } { set channelId [lindex $argsN 0] set argsN [lrange $argsN 1 end] } if { [llength $argsN] == 1 && [regexp {stdout|stderr} $channelId] } { RDC::SendDev [list RamDebugger::RecieveOutputFromProgram $channelId \ [lindex $argsN 0] $hasnewline] } else { eval ::RDC::puts_base $args } } } if { [info commands ::RDC::infoproc] == "" } { rename ::info ::RDC::infoproc proc ::info { args } { set retval [uplevel 1 ::RDC::infoproc $args] if { [lindex $args 0] == "script" && $retval == "" } { return $::RDC::currentfile } return $retval } } if { [info commands ::RDC::sourceproc] == "" } { rename ::source ::RDC::sourceproc proc ::source { file } { set file [file join [pwd] $file] set retval [RDC::SendDev [list RamDebugger::RecieveFromProgramSource $file]] if { $retval != "" } { uplevel 1 $retval } } } } if { $remoteserverType == "local" } { set remotecomm [string map [list SENDDEVBODY "sendmaster \$comm"] \ $remotecomm] } elseif { $remoteserverType == "gdb" } { set remotecomm "set confirm off\n" append remotecomm "file \"[lindex $opts(program) 0]\"\n" if { [lindex $opts(program) 1] != "" } { append remotecomm "set args [lindex $opts(program) 2]" } } elseif { $::tcl_platform(platform) == "windows" } { set remotecomm [string map [list SENDDEVBODY "comm::comm send $debuggerserverNum \$comm"] \ $remotecomm] } else { set remotecomm [string map [list SENDDEVBODY "send \"$debuggerserver\" \$comm"] \ $remotecomm] } ................................................................................ EvalRemote $remotecomm catch { unset instrumentedfilesSent } if { $debuggerstate == "" || $debuggerstate == "debug" } { set debuggerstate debug UpdateRemoteBreaks } if { $debuggerstate == "debug" } { switch $remoteserverType { remote { if { $currentfile != "" } { rlist -quiet $currentfile } } local { EvalRemote [list set ::RDC::currentfile $currentfile] after idle [list RamDebugger::rlist -quiet -asmainfile $currentfile] } gdb { EvalRemote "run" } } } return "Begin debugging of program '$remoteserver'" } proc RamDebugger::reval { args } { variable ExpressionResult variable debuggerstate ................................................................................ proc RamDebugger::rcont { args } { variable currentfile variable instrumentedfilesP variable instrumentedfilesR variable currentline variable fileslist variable debuggerstate variable remoteserver variable remoteserverType if { $debuggerstate == "time" } { error "Command rcont cannot be used in 'time' mode. Check rtime" } set usagestring {usage: rcont ?switches? ?line? ................................................................................ ParseArgs $args $usagestring opts if { ![string is integer $opts(line)] } { error "line '$opts(line)' must be a number\n$usagestring" } if { $currentfile == "" } { error "There is no file selected\n$usagestring" } if { $opts(line) != "" } { set currentline $opts(line) set filenum [lsearchfile $fileslist $currentfile] if { $remoteserverType != "gdb" } { set ipos [string first "RDC::F $filenum $currentline ;" $instrumentedfilesP($currentfile)] if { $ipos == -1 } { ................................................................................ set filenum [lsearchfile $fileslist $currentfile] EvalRemote [list set ::RDC::contto [list $filenum $currentline]] } EvalRemote [list set ::RDC::stopnext 0] EvalRemote ::RDC::Continue } else { if { $opts(line) != "" } { set remoteserver [lreplace $remoteserver 2 2 setbreakpoints] EvalRemote "tbreak [file tail $currentfile]:$currentline" EvalRemote "printf \"FINISHED SET BREAKPOINTS\\n\"" } EvalRemote "cont" } } proc RamDebugger::rnext { args } { variable debuggerstate ................................................................................ variable remoteserver variable remoteserverType variable debuggerstate variable TimeMeasureData variable options set usagestring {usage: rlist ?switches? ?file? ?line? -h: displays usage -quiet: do not print anything -force: force to reload file -reinstrument: force to reinstrument -asmainfile: When debugging locally, the first file, first time must be list like this -returndata: Instead of sending instr file, return it --: end of options } ParseArgs $args $usagestring opts set force $opts(-force) set reinstrument $opts(-reinstrument) if { ![string is integer $opts(line)] } { error "line '$opts(line)' must be a number\n$usagestring" ................................................................................ if { [regexp {\.(h|c|cc)$} $currentfile] } { set filetype c++ } else { set filetype tcl } if { ($currentfile == "New file" || $currentfileIsModified ) && \ ![info exists instrumentedfilesP($currentfile)] } { variable text set map [list "\n[string repeat { } 16]" "\n\t\t" "\n[string repeat { } 8]" "\n\t"] set files($currentfile) [string map $map [$text get 1.0 end-1c]] if { [lsearchfile $fileslist $currentfile] == -1 } { lappend fileslist $currentfile } ................................................................................ if { $debuggerstate == "time" && [info exists files($currentfile)] && \ (![info exists instrumentedfilesTime($currentfile)] || $force || $reinstrument) } { SetMessage "Instrumenting file '$currentfile' for time measure..." Instrumenter::DoWorkForTime $files($currentfile) $currentfile \ instrumentedfilesTime($currentfile) $TimeMeasureData SetMessage "" } set retval "" if { $debuggerstate != "" && $remoteserver != "" && \ [info exists instrumentedfilesP($currentfile)] &&\ (![info exists instrumentedfilesSent($currentfile)] || \ $instrumentedfilesSent($currentfile) != $debuggerstate || $force || $opts(-returndata)) } { if { [catch { if { $debuggerstate == "debug" } { if { $opts(-returndata) } { append retval $instrumentedfilesP($currentfile)\n } else { EvalRemote $instrumentedfilesP($currentfile) } if { $opts(-asmainfile) } { if { $opts(-returndata) } { append retval $instrumentedfilesR($currentfile) } else { EvalRemote $instrumentedfilesR($currentfile) } } } else { EvalRemote $instrumentedfilesTime($currentfile) } set instrumentedfilesSent($currentfile) $debuggerstate FillListBox } errstring] } { set err $::errorInfo if { [catch { WarnWin $err }] } { puts $err ................................................................................ } } } if { $opts(line) != "" } { set currentline $opts(line) } if { $opts(-returndata) || $opts(-quiet) } { return $retval } set lines [split $files($currentfile) \n] set retval "" for { set i -1 } { $i < 3 } { incr i } { append retval "[format %4d [expr $currentline+$i+1]] --> " append retval "[lindex $lines [expr $currentline+$i]]\n" } ................................................................................ ################################################################################ # Helper basic functions ################################################################################ proc RamDebugger::filenormalize { file } { if { $file == "New file" } { return $file } if { $file == "" } { return "" } set pwd [pwd] catch { cd [file dirname $file] set file [file join [pwd] [file tail $file]] } cd $pwd if { $::tcl_platform(platform) == "windows" } { catch { set file [file attributes $file -longname] } } return $file } proc RamDebugger::ParseArgs { args usagestring OptsName } { upvar 1 $OptsName opts set switches "" foreach i [lrange [split $usagestring \n] 1 end] { if { [string trim $i] == "" } { break } regexp {(.*):} $i {} sw ................................................................................ error "error. $usagestring" } else { set opts([string trim [lindex $normalargs $i] ?]) "" } } } proc RamDebugger::MyNameIs { name id } { variable services SetMessage "Remote program: $name" set services($name) $id } proc RamDebugger::FindActivePrograms { force } { variable services variable debuggerserver variable debuggerserverNum ................................................................................ for { set i 12350 } { $i < 12360 } { incr i } { if { $i == $debuggerserverNum } { continue } incr iprogress 40 if { $iprogress > 90 } { set iprogress 90 } RamDebugger::ProgressVar $iprogress set comm [list comm::comm send -async $i \ [list catch [list comm::givename $debuggerserverNum]]] set err [catch $comm errstring] } # dirty trick to make array exist set services(11) "" unset services(11) WaitState 0 RamDebugger::ProgressVar 100 RamDebugger::SetMessage "Searching external programs...done" ................................................................................ stderr { TextOutInsertRed $string } } TextOutRaise update } proc RamDebugger::RecieveFromProgramSource { file } { variable currentfile set retval [RamDebugger::DoinstrumentThisfile $file] if { $retval } { TextOutRaise TextOutInsertBlue "Sending Instrumented file '$file'\n" set currentfile_save $currentfile set retval [rlist -returndata -asmainfile $file] set currentfile $currentfile_save return $retval } return [list ::RDC::sourceproc $file] } proc RamDebugger::EvalRemote { comm } { variable remoteserver variable remoteserverNum variable remoteserverType variable gdblog ................................................................................ } else { send $remoteserver $comm } } proc RamDebugger::GiveInstFile { file onlyifnewer filetype } { variable CacheDir if { $file == "New file" } { return } if { [info exists CacheDir] } { regsub -all {(/|:)} [file join [pwd] [file dirname $file]] \# modpath set modpath [string trimright $modpath ".\#"] if { $filetype == "I" } { set instfile [file join $CacheDir [file tail $file]_$modpath.info] } elseif { $filetype == "P" } { ................................................................................ if { [regexp {^\s*([0-9]+)} $aa {} line] } { set file $currentfile } else { set line "" #puts ---$aa--- #WarnWin "Could not do a '$state'" } } else { if { ![file exists $file] } { set fullfile [cproject::TryToFindPath $file] if { $fullfile != "" } { set file $fullfile if { [file exists $file] } { set file [filenormalize $file] } } } } if { $line != "" } { set remoteserver [lreplace $remoteserver 2 2 ""] set filenum [lsearch $fileslist $file] if { $filenum == -1 } { set err [catch {OpenFileF $file} errstring] if { $err } { WarnWin "Could not open file '$file' for stopping program" return } set filenum [lsearch $fileslist $file] } RecieveFromProgram "" $filenum $line "" "" "" return } } ................................................................................ } } CheckEvalEntries res "" [list 0 $list] } return } setbreakpoints { if { [regexp {FINISHED SET BREAKPOINTS\s*(.*)$} $aa {} rest] } { set remoteserver [lreplace $remoteserver 2 2 ""] if { [string trim $rest] == "" } { return } } else { return } } } if { [regexp {(Breakpoint\s[0-9]+,\s+)?(\S+\s+\([^\)]*\))\s+at\s+([^:]+):([0-9]+)} \ $aa {} {} procname file line] } { if { ![file exists $file] } { set fullfile [cproject::TryToFindPath $file] if { $fullfile != "" } { set file $fullfile } } if { [file pathtype $file] == "relative" } { set executable [lindex $options(debugcplusplus) 0] set dir [file dirname $executable] if { [file exists [file join $dir $file]] } { set file [file join $dir $file] } if { [info exists cproject::project] && \ ................................................................................ } } if { [file pathtype $file] == "volumerelative" } { set drive [string trim [lindex [file split [pwd]] 0] /] set file $drive$file } set file [filenormalize $file] set filenum [lsearch $fileslist $file] if { $filenum == -1 } { set err [catch {OpenFileF $file} errstring] if { $err } { WarnWin "Could not open file '$file' for stopping program" return } set filenum [lsearch $fileslist $file] } RecieveFromProgram "" $filenum $line $procname "" "" return # set found 0 # foreach i $breakpoints { # set breaknum [lindex $i 0] # set line_in [lindex $i 2] # set file_in [lindex $i 1] # if { $line == $line_in && [AreFilesEqual $file $file_in] } { # set found 1 # break # } # # CONDITION is forgotten by now # } # if { $found } { # set filenum [lsearch $fileslist $file] # if { $filenum == -1 } { # set err [catch {OpenFileF $file} errstring] # if { $err } { # WarnWin "Could not open file '$file' for stopping program" # return # } # set filenum [lsearch $fileslist $file] # } # RecieveFromProgram $breaknum $filenum $line $procname "" "" # return # } else { # WarnWin "Problems finding breakpoint in file $file ($aa)" # } # return } if { [regexp {Program exited[^\n]*} $aa mess] } { set err [catch { close $fid } errstring] set debuggerstate "" set remoteserverType "" set remoteserver "" if { $err } { append mess " ($errstring)" } WarnWin $mess } if { [string match "*No executable specified, use `target exec'.*" $aa] } { WarnWin "Error defining the debugged executable. Use 'Utilities->gdb log' for details" } TextOutInsert $aa TextOutRaise } ################################################################################ # RamDebugger GUI ################################################################################ # tkTabToWindow -- # This procedure moves the focus to the given widget. If the widget ................................................................................ -title "Savefile"] if { $file == "" } { return } set options(defaultdir) [file dirname $file] } else { set file $currentfile if { [file mtime $file] > $filesmtime($file) } { set ret [DialogWin::messageBox -default ok -icon question -message \ "File '$currentfile' has been modified outside RamDebugger. Loose external changes?" \ -parent $text -title "Warning" -type okcancel] if { $ret == "cancel" } { return -1 } } } SaveFileF $file return 0 } ................................................................................ {{All Files} * } } if { ![info exists options(defaultdir)] } { set options(defaultdir) [pwd] } set file [tk_getOpenFile -filetypes $types -initialdir $options(defaultdir) -parent $w \ -title "Open source file"] if { $file == "" } { return } OpenFileF $file -1 FillListBox } proc RamDebugger::OpenFileF { file { force 0 } { linenum 1 } } { variable marker variable text variable files variable breakpoints variable currentfile variable currentfileIsModified variable WindowFilesList variable WindowFilesListLineNums variable WindowFilesListCurr variable options if { $force == -1 } { set force 0 } else { if { [SaveFile ask] == -1 } { return } } WaitState 1 if { [lsearch $WindowFilesList $currentfile] != -1 } { set pos [lsearch $WindowFilesList $currentfile] set line [scan [$text index insert] %d] set WindowFilesListLineNums [lreplace $WindowFilesListLineNums $pos $pos $line] } if { !$force } { set comm [list rlist -quiet $file {}] } elseif { $force == 2 } { set comm [list rlist -quiet -reinstrument $file {}] } else { set comm [list rlist -quiet -force $file {}] ................................................................................ if { [catch $comm errstring] } { WaitState 0 WarnWin [lindex [split $errstring \n] 0] return 1 } if { $file == $currentfile } { set idx [$text index insert] } else { set idx $linenum.0 } $marker delete arrow $marker delete break $marker delete arrowbreak set ed [$text cget -editable] $text conf -editable 1 $text clearundo ................................................................................ foreach i $breakpoints { if { ![AreFilesEqual [lindex $i 1] $file] } { continue } set line [lindex $i 2] UpdateArrowAndBreak $line 1 "" } UpdateRemoteBreaks set Numlines [scan [$text index end] %d] set font [$text cget -font] $marker configure -scrollregion [list 0 0 [winfo reqwidth $marker] \ [expr $Numlines*[font metrics $font -linespace]]] $text mark set insert $idx $text see $idx wm title [winfo toplevel $text] "RamDebugger [file tail $currentfile]" set currentfileIsModified 0 if { [lsearch $WindowFilesList $file] != -1 } { set WindowFilesListCurr [lsearch $WindowFilesList $file] } else { incr WindowFilesListCurr if { $WindowFilesListCurr == [llength $WindowFilesList] } { lappend WindowFilesList $file lappend WindowFilesListLineNums 1 } else { set WindowFilesList [lreplace $WindowFilesList $WindowFilesListCurr end $file] set WindowFilesListLineNums [lreplace $WindowFilesListLineNums $WindowFilesListCurr \ end 1] } } $text conf -editable 1 if { ![info exists options(RecentFiles)] } { set options(RecentFiles) "" } ................................................................................ set options(RecentFiles) [lreplace $options(RecentFiles) $ipos $ipos] } set options(RecentFiles) [linsert $options(RecentFiles) 0 $file] if { [llength $options(RecentFiles)] > 6 } { set options(RecentFiles) [lreplace $options(RecentFiles) 5 end] } set options(defaultdir) [file dirname $file] #FillListBox WaitState 0 return 0 } proc RamDebugger::NewFile {} { variable marker ................................................................................ variable files variable instrumentedfilesInfo variable breakpoints variable currentfile variable currentfileIsModified variable WindowFilesList variable WindowFilesListCurr variable WindowFilesListLineNums if { [SaveFile ask] == -1 } { return } WaitState 1 if { [lsearch $WindowFilesList $currentfile] != -1 } { set pos [lsearch $WindowFilesList $currentfile] set line [scan [$text index insert] %d] set WindowFilesListLineNums [lreplace $WindowFilesListLineNums $pos $pos $line] } set currentfile "New file" set currentfileIsModified 0 $marker delete arrow $marker delete break $marker delete arrowbreak ................................................................................ set textO [$text original] $textO del 1.0 end $textO tag add normal 1.0 end $text conf -editable $ed FillListBox set Numlines [scan [$text index end] %d] set font [$text cget -font] $marker configure -scrollregion [list 0 0 [winfo reqwidth $marker] \ [expr $Numlines*[font metrics $font -linespace]]] $text mark set insert 1.0 $text see 1.0 set instrumentedfilesInfo($currentfile) "" ................................................................................ SetMessage "Saved file '$file'" } proc RamDebugger::ViewInstrumentedFile { what } { variable marker variable text variable currentfile variable WindowFilesList variable WindowFilesListLineNums variable instrumentedfilesP variable instrumentedfilesR variable instrumentedfilesInfo variable gdblog if { [SaveFile ask] == -1 } { return } ................................................................................ } else { if { ![info exists instrumentedfilesInfo($currentfile)] } { WarnWin "There is no instrumented info file for file '$currentfile'" return } } WaitState 1 if { [lsearch $WindowFilesList $currentfile] != -1 } { set pos [lsearch $WindowFilesList $currentfile] set line [scan [$text index insert] %d] set WindowFilesListLineNums [lreplace $WindowFilesListLineNums $pos $pos $line] } set ed [$text cget -editable] $text conf -editable 1 $text clearundo set textO [$text original] $textO del 1.0 end if { $what == "instrumentedP" } { ................................................................................ } else { set word "" set idx [$text index insert] set idx0 $idx while { [string is wordchar [$text get $idx0]] } { set word [$text get $idx0]$word set idx0 [$text index $idx0-1c] if { [$text compare $idx0 <= 1.0] } { break } } set idx1 [$text index $idx+1c] while { [string is wordchar [$text get $idx1]] } { append word [$text get $idx1] set idx1 [$text index $idx1+1c] if { [$text compare $idx1 >= end-1c] } { break } } if { $word == "" } { return } } HelpViewer::HelpSearchWord $word } proc RamDebugger::ActualizeActivePrograms { menu { force 0 } } { variable mainframe variable remoteserver variable remoteserverType WaitState 1 SetMessage "Searching for active programs..." if { $force == 2 } { set services [rdebug -forceupdate2 -actives] } elseif { $force } { set services [rdebug -forceupdate -actives] } else { set services [rdebug -actives] } $menu del 0 end set fontbold [font actual [$menu cget -font]] set ipos [lsearch $fontbold -weight] incr ipos set fontbold [lreplace $fontbold $ipos $ipos bold] $menu add command -label "Remote TCL debugging" -font $fontbold -state disabled \ -background grey85 if { [llength $services] == 0 } { $menu add command -label "There are no active programs" -state disabled $menu add command -label "Use 'Remote TCL update' to actualize" -state disabled } else { foreach i $services { if { $remoteserverType == "remote" && $i == $remoteserver } { $menu add check -label $i -command [list RamDebugger::rdebug $i] \ -variable ::checked set ::checked 1 } else { $menu add command -label $i -command [list RamDebugger::rdebug $i] } } } $menu add separator if { $::tcl_platform(platform) == "windows" } { $menu add command -label "Remote TCL update" -font $fontbold -state disabled \ -background grey85 $menu add command -label "Update remotes" -command \ "RamDebugger::ActualizeActivePrograms $menu 1" $menu add separator } $menu add command -label "Local TCL debugging" -font $fontbold -state disabled \ -background grey85 if { $remoteserverType == "local" } { $menu add check -label "Current file" -command { RamDebugger::rdebug -currentfile } -variable ::checked set ::checked 1 } else { $menu add command -label "Current file" -command { RamDebugger::rdebug -currentfile } } $menu add command -label "Current file args" -command { RamDebugger::DebugCurrentFileArgsWindow } $menu add separator $menu add command -label "Local c/c++ debugging" -font $fontbold -state disabled \ -background grey85 if { $remoteserverType == "gdb" } { $menu add check -label "Debug c++" -command "RamDebugger::DebugCplusPlusWindow" \ -variable ::checked set ::checked 1 } else { $menu add command -label "Debug c++" -command "RamDebugger::DebugCplusPlusWindow" } $menu add command -label "Debug c++ (no ask)" -command "RamDebugger::DebugCplusPlusWindow 1" $menu add separator $menu add command -label Disconnect/Stop -command RamDebugger::DisconnectStop -acc "Shift+F5" if { $remoteserver == "" } { $menu entryconfigure end -state disabled } SetMessage "" WaitState 0 } proc RamDebugger::DisconnectStop {} { if { [catch [list RamDebugger::rdebug -disconnect] errstring] } { WarnWin $errstring } } proc RamDebugger::GotoPreviusNextInWinList { what } { variable WindowFilesList variable WindowFilesListLineNums variable WindowFilesListCurr switch $what { prev { incr WindowFilesListCurr -1 if { $WindowFilesListCurr < 0 } { set WindowFilesListCurr [expr [llength $WindowFilesList]-1] } OpenFileF [lindex $WindowFilesList $WindowFilesListCurr] 0 \ [lindex $WindowFilesListLineNums $WindowFilesListCurr] } next { incr WindowFilesListCurr 1 if { $WindowFilesListCurr >= [llength $WindowFilesList] } { set WindowFilesListCurr 0 } OpenFileF [lindex $WindowFilesList $WindowFilesListCurr] 0 \ [lindex $WindowFilesListLineNums $WindowFilesListCurr] } } } proc RamDebugger::ActualizeViewMenu { menu } { variable WindowFilesList variable WindowFilesListLineNums variable WindowFilesListCurr variable text if { [$menu index end] > 1 } { $menu del 2 end } $menu add command -label "Previus" -acc "Alt-Left" -command \ "RamDebugger::GotoPreviusNextInWinList prev" $menu add command -label "Next" -acc "Alt-Right" -command \ "RamDebugger::GotoPreviusNextInWinList next" $menu add separator set ipos 0 foreach i $WindowFilesList { set line [lindex $WindowFilesListLineNums $ipos] if { $ipos == $WindowFilesListCurr } { set label $i if { [string length $label] > 25 } { set label ...[string range $label end-22 end] } $menu add checkbutton -label $label -variable ::pp -command \ [list RamDebugger::OpenFileF $i 0 $line] set ::pp 1 } else { set label $i if { [string length $label] > 25 } { set label ...[string range $label end-22 end] } $menu add command -label $label -command [list RamDebugger::OpenFileF $i 0 $line] } incr ipos } } proc RamDebugger::AddRecentfilesToMenu { menu } { variable options $menu del 0 end if { ![info exists options(RecentFiles)] } { return } foreach i $options(RecentFiles) { $menu add command -label $i -command \ "[list RamDebugger::OpenFileF $i] ; RamDebugger::FillListBox" } } proc RamDebugger::SetGUIBreakpoint {} { variable images variable marker ................................................................................ } elseif { $hasarrow } { $marker create image 0 $ypos -anchor sw -image $images(arrow) -tags "arrow l$line" } elseif { $hasbreak } { $marker create image 0 $ypos -anchor sw -image $images(break) -tags "break l$line" } if { $hasarrow } { if { $::tcl_platform(platform) == "windows" } { set doit 1 } elseif { [focus] != $text } { # the horrible bug in Linux with the raise command set doit 1 } else { set doit 0 } if { $doit } { after 100 "raise [winfo toplevel $text] ; focus -force $text" } $text see $line.0 $text mark set insert $line.0 } if { $IsInStop } { ................................................................................ variable options if { $remoteserver == "" || ($remoteserverType == "local" && !$IsInStop) } { if { $currentfile == "" } { WarnWin "Cannot start debugging. There is no currentfile" $text return } #if { $currentfile == "New file" } { #} if { [regexp {\.(h|c|cc)$} $currentfile] } { if { $options(ConfirmStartDebugging) } { set ret [DialogWin::messageBox -default yes -icon question -message \ "Do you want to start to debug c++ program?" -parent $text \ -title "start debugging" -type yesnocancel] } else { set ret yes } if { $ret == "cancel" } { return } ................................................................................ after cancel $TextMotionAfterId if { [winfo exists $text.help] } { destroy $text.help } if { $X == -1 || $currentfile == "" || !$IsInStop } { return } set TextMotionAfterId [after 500 RamDebugger::DisplayVar $X $Y $x $y] } proc RamDebugger::CheckEvalEntries { what { name "" } { res "" } } { variable EvalEntries variable IsInStop variable remoteserver variable remoteserverType variable gdblog variable options if { !$IsInStop } { return } if { $name == "" } { if { $what == "do" } { set vars "" set i 0 while 1 { ................................................................................ } } else { if { $what == "do" } { regexp {[0-9]+} $name i set var [string trim $EvalEntries($i,left)] if { $var == "" } { return } set value [string trim $EvalEntries($name)] if { $options(ConfirmModifyVariable) } { set ret [DialogWin::messageBox -default ok -icon question -message \ "Are you sure to change variable '$var' to value '$value'?" \ -title "Warning" -type okcancel] if { $ret == "cancel" } { return } } if { $remoteserverType == "gdb" } { set remoteserver [lreplace $remoteserver 2 2 setvariable] EvalRemote "set variable $var=$value" return } set comm [list set $var $value] reval -handler [list RamDebugger::CheckEvalEntries res $name] $comm ................................................................................ } proc RamDebugger::CheckEvalEntriesL { what { name "" } { res "" } } { variable EvalEntries variable IsInStop variable remoteserver variable remoteserverType variable options if { !$IsInStop } { return } if { $name == "" } { if { $what == "do" } { if { $remoteserverType == "gdb" } { while { [lindex $remoteserver 2] != "" } { vwait RamDebugger::remoteserver } set remoteserver [lreplace $remoteserver 2 2 infolocals] ................................................................................ } while 1 { if { ![info exists EvalEntries($i,leftL)] } { break } set EvalEntries($i,leftL) "" set EvalEntries($i,rightL) "" incr i } } } elseif { [string match *leftL $name] } { if { $what == "do" } { regexp {[0-9]+} $name i set var $EvalEntries($name) if { [string trim $var] == "" } { $RamDebugger::EvalEntries($i,rightentryL) conf -fg black set RamDebugger::EvalEntries($i,rightL) "" return } if { $remoteserverType == "gdb" } { set remoteserver [lreplace $remoteserver 2 2 [list getdata \ "RamDebugger::CheckEvalEntriesL res $name"]] set comm "output $var\n" append comm "printf \"FINISHED GETDATA\\n\"" EvalRemote $comm return } set comm { if { [array exists {VAR}] } { set ::RDC::retval [list array [array get {VAR}]] } elseif { [info exists {VAR}] } { set ::RDC::retval [list variable [set {VAR}]] } else { set ::RDC::err [catch {expr {VAR}} ::RDC::val] if { !$::RDC::err } { set ::RDC::retval [list expr $::RDC::val] } else { set ::RDC::retval [list error "variable or expr 'VAR' does not exist"] } } set ::RDC::retval } set comm [string map [list VAR [string trim $var]] $comm] reval -handler [list RamDebugger::CheckEvalEntriesL res $name] $comm } else { regexp {[0-9]+} $name i if { $remoteserverType == "gdb" } { set res [list 0 [list variable $res]] } foreach "type val" [lindex $res 1] break if { [string length $val] > 50 } { set val [string range $val 0 46]... } set RamDebugger::EvalEntries($i,rightL) $val if { $type == "error" } { $RamDebugger::EvalEntries($i,rightentryL) conf -fg red } else { $RamDebugger::EvalEntries($i,rightentryL) conf -fg black } } } else { if { $what == "do" } { regexp {[0-9]+} $name i set var [string trim $EvalEntries($i,leftL)] if { $var == "" } { return } set value [string trim $EvalEntries($name)] if { $options(ConfirmModifyVariable) } { # its necessary to take out the focus out binding to avoid interaction # with this func set comm [bind $RamDebugger::EvalEntries($i,rightentryL) <FocusOut>] bind $RamDebugger::EvalEntries($i,rightentryL) <FocusOut> "" set ret [DialogWin::messageBox -default ok -icon question -message \ "Are you sure to change variable '$var' to value '$value'?" \ -title "Warning" -type okcancel] bind $RamDebugger::EvalEntries($i,rightentryL) <FocusOut> $comm if { $ret == "cancel" } { return } } if { $remoteserverType == "gdb" } { set remoteserver [lreplace $remoteserver 2 2 setvariable] EvalRemote "set variable $var=$value" return } set comm [list set $var $value] reval -handler [list RamDebugger::CheckEvalEntriesL res $name] $comm } else { regexp {[0-9]+} $name i set RamDebugger::EvalEntries($i,rightR) [lindex $res 1] switch [lindex $res 0] { 0 { $RamDebugger::EvalEntries($i,rightentryL) conf -fg black } 1 { $RamDebugger::EvalEntries($i,rightentryL) conf -fg red } } ................................................................................ } proc RamDebugger::TextOutInsert { data } { variable textOUT if { ![info exists textOUT] || ![winfo exists $textOUT] } { return } foreach "- yend" [$textOUT yview] break $textOUT conf -state normal $textOUT ins end $data $textOUT conf -state disabled if { $yend == 1 } { $textOUT yview moveto 1 } } proc RamDebugger::TextOutInsertRed { data } { variable textOUT if { ![info exists textOUT] || ![winfo exists $textOUT] } { return } foreach "- yend" [$textOUT yview] break $textOUT conf -state normal $textOUT ins end $data red $textOUT tag configure red -foreground red $textOUT conf -state disabled if { $yend == 1 } { $textOUT yview moveto 1 } } proc RamDebugger::TextOutInsertBlue { data } { variable textOUT if { ![info exists textOUT] || ![winfo exists $textOUT] } { return } foreach "- yend" [$textOUT yview] break $textOUT conf -state normal $textOUT ins end $data blue $textOUT tag configure blue -foreground blue $textOUT conf -state disabled if { $yend == 1 } { $textOUT yview moveto 1 } } proc RamDebugger::TextCompClear {} { variable textCOMP if { ![info exists textCOMP] || ![winfo exists $textCOMP] } { return } ................................................................................ } proc RamDebugger::TextCompInsert { data } { variable textCOMP if { ![info exists textCOMP] || ![winfo exists $textCOMP] } { return } foreach "- yend" [$textCOMP yview] break $textCOMP conf -state normal $textCOMP ins end $data $textCOMP conf -state disabled if { $yend == 1 } { $textCOMP yview moveto 1 } } proc RamDebugger::TextCompInsertRed { data } { variable textCOMP if { ![info exists textCOMP] || ![winfo exists $textCOMP] } { return } foreach "- yend" [$textCOMP yview] break $textCOMP conf -state normal $textCOMP ins end $data red $textCOMP tag configure red -foreground red $textCOMP conf -state disabled if { $yend == 1 } { $textCOMP yview moveto 1 } } proc RamDebugger::ProgressVar { value { canstop 0 } } { variable progressvar variable text ................................................................................ regsub -all {\W} $string _ item while { [$listbox exists $item] } { append item _ } return $item } proc RamDebugger::ConfigureLabel { label } { set tt [$label cget -text] if { [string match "...*" $tt] } { set tt [$label cget -helptext] } set lwidth [expr [winfo width $label]-5] if { [font measure [$label cget -font] $tt] <= $lwidth } { $label configure -text $tt -helptext "" } else { $label configure -helptext $tt while { [string length $tt] > 3 } { set tt [string range $tt 1 end] if { [font measure [$label cget -font] ...$tt] <= $lwidth } { break } } $label configure -text ...$tt } } proc RamDebugger::FillListBox {} { variable listbox variable listboxlabel variable options variable instrumentedfilesP variable instrumentedfilesR variable instrumentedfilesSent variable remoteserverType variable images if { $listbox == "" || ![winfo exists $listbox] } { return } $listboxlabel configure -text $options(defaultdir) ConfigureLabel $listboxlabel $listbox delete [$listbox items] set parent [file dirname $options(defaultdir)] $listbox insert end .. -image [Bitmap::get folder] -text ".." -data [list folder $parent] set idxfolder 1 set files "" foreach i [glob -nocomplain -dir $options(defaultdir) *] { lappend files [file tail $i] } ................................................................................ incr idxfolder } elseif { [regexp {(\.tcl|\.h|\.c|\.cc|Makefil.*[^~])$} $i] } { if { [info exists instrumentedfilesSent($fullpath)] } { switch $instrumentedfilesSent($fullpath) { debug { set img $images(file_blue) } time { set img $images(file_magenta) } } } elseif { [GiveInstFile $fullpath 1 P] != "" } { set img $images(file_yellow) } else { set img [Bitmap::get file] } $listbox insert end $item -image $img -text $i -data \ [list file [file join $options(defaultdir) $i]] } } } proc RamDebugger::PrevNextCompileError { what } { variable textCOMP $textCOMP tag conf sel2 -background [$textCOMP tag cget sel -background] $textCOMP tag conf sel2 -foreground [$textCOMP tag cget sel -foreground] set err [catch { $textCOMP index sel2.first} idx] if { $err } { switch $what { next { set idx 1.0 } prev { set idx end-1c } } $textCOMP tag add sel2 "$idx linestart" "$idx lineend" } else { $textCOMP tag remove sel2 1.0 end set idxini $idx while { [$textCOMP tag range sel2] == "" } { switch $what { next { set idx [$textCOMP index $idx+1l] if { [$textCOMP compare $idx > end-1c] } { set idx 1.0 } } prev { set idx [$textCOMP index $idx-1l] if { [$textCOMP compare $idx < 1.0] } { set idx end-1c } } } $textCOMP tag add sel2 "$idx linestart" "$idx lineend" if { $idx == $idxini } { break } } } $textCOMP see $idx StackDouble1 $textCOMP $idx } proc RamDebugger::StackDouble1 { textstack idx } { variable text ................................................................................ set data [$textstack get "$idx linestart" "$idx lineend"] foreach pattern [list {((?:[a-zA-Z]:/)?[-/\w.]+):([0-9]+)} \ {((?:[a-zA-Z]:/)?[-/\w. ]+):([0-9]+)}] { if { [regexp $pattern $data {} file line] } { # strange case in Windows mingw if { [regexp {^//([a-zA-Z])(/.*)} $file {} letter sfile] && \ [file exists $letter:$sfile] } { set file $letter:$sfile } if { ![file exists $file] && [file exists [file join $options(defaultdir) \ $file]] } { set file [file join $options(defaultdir) $file] } if { ![file exists $file] } { set fullfile [cproject::TryToFindPath $file] ................................................................................ focus $text return } } } } proc RamDebugger::CutCopyPasteText { what } { variable text switch $what { undo { $text undo } ................................................................................ tk_textCopy $text } paste { tk_textPaste $text } } } proc RamDebugger::ListBoxDouble1 { listb item } { variable options set data [$listb itemcget $item -data] if { [lindex $data 0] == "folder" } { set options(defaultdir) [lindex $data 1] ................................................................................ RamDebugger::options(defaultdir) \ [lindex $data 1]] \; RamDebugger::FillListBox] } else { set name [lindex $data 1] $menu add command -label Open -command [list RamDebugger::OpenFileF $name] $menu add command -label Reinstrument -command [list RamDebugger::OpenFileF \ $name 2] if { [regexp {\.(c|cc)$} $name] } { $menu add separator set w [winfo toplevel $listb] $menu add command -label Compile -command [list cproject::Compile $w $name] } if { [regexp {Makefil.*[^~]$} $name] } { $menu add separator $menu add command -label Compile -command [list RamDebugger::Compile $name] } } tk_popup $menu $x $y } proc RamDebugger::SearchInListbox { listb ev char exec_callback } { variable SearchListboxString ................................................................................ del* { set l1_old $l1 set l2_old $l2 set l1_new $l1 set l2_new $l1 } } set Numlines [scan [$text index end] %d] set font [$text cget -font] $marker configure -scrollregion [list 0 0 [winfo reqwidth $marker] \ [expr $Numlines*[font metrics $font -linespace]]] set diff [expr $l2-$l1] while { $l1_old > 1 && [lindex [lindex $instrumentedfilesInfo($currentfile) \ ................................................................................ proc RamDebugger::UpdateLineNum { command args } { variable LineNum variable text variable filesmtime variable currentfile variable currentfileIsModified if { [regexp {index|bbox|get} $command] } { return } if { [regexp {^(ins|del)} $command] } { CheckText $command $args } if { [regexp {^(ins|del)} $command] && !$currentfileIsModified } { wm title [winfo toplevel $text] [wm title [winfo toplevel $text]]* set currentfileIsModified 1 } ................................................................................ %W icursor end } bind $pane1.e$i <Down> {tkTabToWindow [tk_focusNext %W]} bind $pane1.e$i <Up> {tkTabToWindow [tk_focusPrev %W]} } else { $EvalEntries($i,leftentry$suffix) configure -state disabled } bind $pane2.e$i <Return> "RamDebugger::CheckEvalEntries$suffix do $i,right$suffix" bind $pane2.e$i <FocusOut> "RamDebugger::CheckEvalEntries$suffix do $i,left$suffix" bind $pane2.e$i <ButtonRelease-1> { %W selection range 0 end %W icursor end } bind $pane2.e$i <Down> {tkTabToWindow [tk_focusNext %W]} bind $pane2.e$i <Up> {tkTabToWindow [tk_focusPrev %W]} } ................................................................................ grid columnconf $pane1 0 -weight 1 grid columnconf $pane2 0 -weight 1 # dirty trick to make the paned window actualize sizes after idle event generate $panew <Configure> } proc RamDebugger::TkBackCompatibility {} { set comms [list tkButtonInvoke tkTextSelectTo tkEntryInsert tkEntryBackspace \ tk_textCut tk_textCopy tk_textPaste tk_focusNext tk_focusPrev tkTextClosestGap \ tkTextAutoScan tkCancelRepeat] foreach i $comms { auto_load $i if {![llength [info commands $i]]} { tk::unsupported::ExposePrivateCommand $i } } } proc RamDebugger::MoveCanvas { text canvas } { $canvas yview moveto [lindex [$text yview] 0] # fine adjustment # as the text widget adds arbitrarily more space at the end of the text, # it is necessary to fine tune by hand set yb1 [$canvas canvasy 0] set yb2 [$canvas canvasy [winfo height $text]] foreach i [$canvas find overlapping 0 $yb1 20 $yb2] { regexp {l([0-9]+)} [$canvas gettags $i] {} line set yline "" foreach "- yline - -" [$text bbox $line.0] break if { $yline == "" } { continue } set yline [$canvas canvasy $yline] foreach "- ycanvas - -" [$canvas bbox [$canvas find withtag l$line]] break incr ycanvas -3 foreach "cy1 cy2" [$canvas yview] break set 1p [expr ($cy2-$cy1)/double([winfo height $text])] $canvas yview moveto [expr $cy1+($ycanvas-$yline)*$1p] return } } proc RamDebugger::ScrollTextAndCanvas { text canvas args } { eval $text yview $args MoveCanvas $text $canvas } proc RamDebugger::ScrollScrollAndCanvas { text yscroll canvas args } { eval $yscroll set $args $canvas yview moveto [lindex [$text yview] 0] MoveCanvas $text $canvas } proc RamDebugger::InitGUI { { w .gui } } { variable options variable options_def variable marker variable text variable mainframe variable listbox variable listboxlabel variable pane2in1 variable images variable textST variable textOUT variable textCOMP variable breakpoints variable MainDir proc ::bgerror { errstring } { if { [info command RamDebugger::TextOutRaise] != "" } { RamDebugger::TextOutRaise RamDebugger::TextOutInsertRed "-------------ERROR FROM RAMDEBUGGER-----------\n" RamDebugger::TextOutInsertRed $::errorInfo RamDebugger::TextOutInsertRed "----------------------------------------------\n" WarnWin $errstring } else { puts "$errstring ($::errorInfo)" } } package require Tablelist package require BWidgetR package require supertext package require supergrid package require dialogwin ................................................................................ -command "RamDebugger::PreferencesWindow"] \ ] \ "&View" all view 0 [list \ [list command "&View text/all" {} \ "Toggle between viewing all windows or only text window" "Ctrl t" \ -command "RamDebugger::ViewOnlyTextOrAll"] \ separator \ ] \ "&Debug" all debug 0 [list \ [list command "&Continue/Go" debugentry "begin/continue execution" "F5" \ -command "RamDebugger::ContNextGUI rcont"] \ [list command "Set/unset &breakpoint" debugentry "Set/unset breakpoint" "F9" \ -command "RamDebugger::SetGUIBreakpoint"] \ [list command "&Next" debugentry "continue one command" "F10" \ ................................................................................ [list command "&Timing control..." debugentry \ "Open a window to control execution times" "" \ -command "RamDebugger::DisplayTimesWindow"] \ ] \ "&C++ project" all c++ 0 [list \ [list command "&Create/Edit" c++entry "Create or edit a c++ compile project" "Alt F7" \ -command "cproject::Create $w"] \ [list cascad "C&onfiguration" {} activeconfiguration 0 [list \ [list radiobutton "Debug" {} "Compile debug version" "" \ -variable ::cproject::debugrelease -value debug -selectcolor black] \ [list radiobutton "Release" {} "Compile release version" "" \ -variable ::cproject::debugrelease -value release -selectcolor black] \ ] \ ] \ [list command "Co&mpile" c++entry "Compile project" "F7" \ -command "cproject::Compile $w"] \ [list command "Compile all" c++entry "Compile project, all targets" "" \ -command "cproject::CompileAll $w"] \ separator \ [list command "&Touch files" c++entry "Actualize date for all compilation files" "" \ -command "cproject::TouchFiles $w"] \ [list command "Cl&ean" c++entry "Clean compiled project files" "" \ -command "cproject::CleanCompiledFiles $w"] \ ] \ "&Utilities" all utilities 0 [list \ [list command "&Open console" {} "Open console" "" \ -command "RamDebugger::OpenConsole"] \ [list command "O&pen VisualRegexp" {} "Open VisualRegexp" "" \ -command "RamDebugger::OpenProgram visualregexp"] \ separator \ ................................................................................ set label [$mainframe addindicator -textvariable RamDebugger::remoteserver -width 15 \ -anchor e -padx 3] set menu [$mainframe getmenu activeprograms] $menu configure -postcommand [list RamDebugger::ActualizeActivePrograms $menu] bind $label <1> "tk_popup $menu %X %Y" set menu [$mainframe getmenu view] $menu configure -postcommand [list RamDebugger::ActualizeViewMenu $menu] set menu [$mainframe getmenu recentfiles] $menu configure -postcommand [list RamDebugger::AddRecentfilesToMenu $menu] # very dirty. Without it, the radiobutton indicator is not drawn. Why??? set menu [$mainframe getmenu activeconfiguration] $menu conf -postcommand "$menu conf -selectcolor black" ################################################################################ # The toolbar ################################################################################ set toolbar [$mainframe addtoolbar] ................................................................................ foreach "weight1 weight2 weight3" [ManagePanes $pw h "1 6 2"] break set pane1 [$pw add -weight $weight1] if { ![info exists options(defaultdir)] } { set options(defaultdir) [pwd] } set listboxlabel [Label $pane1.l -anchor e -relief raised -bd 1 \ -padx 5 -grid "0 ew"] bind $listboxlabel <Configure> "RamDebugger::ConfigureLabel $listboxlabel" set sw [ScrolledWindow $pane1.lf -relief sunken -borderwidth 0 -grid 0] set listbox [ListBox $sw.lb -background white -multicolumn 0 -selectmode single] $sw setwidget $listbox if { $::tcl_platform(platform) != "windows" } { $listbox configure -selectbackground \#48c96f -selectforeground white ................................................................................ [list RamDebugger::ScrollTextAndCanvas $fulltext.text $fulltext.can] scrollbar $fulltext.xscroll -orient horizontal -grid "0 2" -command "$fulltext.text xview" if { $::tcl_platform(platform) != "windows" } { $text conf -exportselection 1 -selectbackground \#48c96f -selectforeground white } set pane2in2 [$pwin add -weight $weight2in] NoteBook $pane2in2.nb -homogeneous 1 -bd 1 -internalborderwidth 0 \ -grid "0 py2" -side bottom set f1 [$pane2in2.nb insert end stacktrace -text "Stack trace"] set sw2 [ScrolledWindow $f1.lf2 -relief sunken -borderwidth 0 -grid "0" \ -scrollbar both -auto both] set textST [text $sw2.text2 -background white -wrap none -width 80 -height 4 \ -highlightthickness 0 -exportselection 0] $sw2 setwidget $textST supergrid::go $f1 set f2 [$pane2in2.nb insert end output -text "Output"] set sw2 [ScrolledWindow $f2.lf2 -relief sunken -borderwidth 0 -grid "0" \ -scrollbar both -auto both] set textOUT [text $sw2.text2 -background white -wrap none -width 80 -height 4 \ -highlightthickness 0 -exportselection 0] $sw2 setwidget $textOUT supergrid::go $f2 set f3 [$pane2in2.nb insert end compile -text "Compile"] set sw2 [ScrolledWindow $f3.lf3 -relief sunken -borderwidth 0 -grid "0" \ -scrollbar both -auto both] set textCOMP [text $sw2.text2 -background white -wrap none -width 80 -height 4 \ -highlightthickness 0 -exportselection 0] $sw2 setwidget $textCOMP supergrid::go $f3 #$pane2in2.nb compute_size $pane2in2.nb raise stacktrace ................................................................................ supergrid::go $pane2in2 supergrid::go $pane1 supergrid::go $pane2 supergrid::go $pane3 supergrid::go $f supergrid::go $w ################################################################################ # the bindings ################################################################################ if {[string equal "unix" $::tcl_platform(platform)]} { foreach "but units" [list 4 -5 5 5] { set comm { set w %W while { $w != [winfo toplevel $w] } { catch { set ycomm [$w cget -yscrollcommand] ................................................................................ } bind $marker <ButtonRelease-1> { tkCancelRepeat } bind all <Control-Key-1> "RamDebugger::DisplayWindowsHierarchy ;break" # BWidgets automatically sets these because they are in the main main # we only want them individually in every widget bind $w <Control-c> "" bind $w <Control-v> "" ################################################################################ # start up options ################################################################################ if { ![info exists options(maingeometry)] } { set options(maingeometry) 800x600 } if { [info exists options(ViewOnlyTextOrAll)] && $options(ViewOnlyTextOrAll) == "OnlyText" } { RamDebugger::ViewOnlyTextOrAll } # trick to know if we are debugging RamDebugger if { [info command sendmaster] != "" } { if { [regexp {(\d+)x(\d+)[+](\d+)[+](\d+)} $options(maingeometry) {} wi he xpos ypos] } { incr xpos 20 incr ypos 20 wm geom $w ${wi}x$he+$xpos+$ypos ................................................................................ wm geom $w 800x600 wm state $w zoomed } else { wm geom $w $options(maingeometry) } } set menu [$mainframe getmenu recentfiles] ActualizeActivePrograms $menu if { [info exists options(breakpoints)] } { set breakpoints $options(breakpoints) } # if { [info exists options(remoteserverType)] && $options(remoteserverType) == "remote" && \ ................................................................................ # SetMessage "" # } if { [info exists options(currentfile)] && $options(currentfile) != "" && \ [file exists $options(currentfile)] } { SetMessage "Opening file '$options(currentfile)'..." OpenFileF $options(currentfile) FillListBox if { [winfo exists options(currentidx)] } { $text see $options(currentidx) $text mark set insert $options(currentidx) } SetMessage "" } else { NewFile } focus $text cproject::Init $w # for tkcon rename ::exit ::exit_final proc ::exit { args } {} # for defining what is a word for text widgets |
Changes to RamDebugger.texinfo.
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 .. 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ... 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 ... 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 ... 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 ... 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 ... 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 ... 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 ... 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 ... 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 ... 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 |
@end iftex @c %**end of header ptype.texinfo @setchapternewpage odd @set photo @set Version $Revision: 1.5 $ @set Date August 2002 @ifinfo Copyright 2002 Ramon Ribó @end ifinfo @titlepage ................................................................................ RamDebugger: A graphical and interactive debugger for Tcl-TK @menu * Introduction and Setup:: * Using RamDebugger:: * How does it work?:: * Additional packages included in the distribution:: * License:: @detailmenu --- The Detailed Node Listing --- Introduction and Setup ................................................................................ * Introduction:: * Changes:: * Download:: * Installation and prerequisites:: * Starting RamDebugger:: @end menu @node Introduction, , Introduction and Setup, Introduction and Setup @section Introduction RamDebugger is a graphical debugger for the scripting lenguage Tcl-TK. It can operate basically in two modes: @itemize @bullet @item @b{GUI mode:} The normal one, is the one that appears when opening normally the program and has a Graphical User Interface. ................................................................................ @section Changes Changes From version 1 to version 2 @itemize @bullet @item Tested for Tcl/Tk @b{8.3.4} and @b{8.4} @item When @b{Tkhtml} is not compiled for the given platform, gives message and continues @item Added contextual help for programming commands @item When debugging local, possibility to choose debug TCL or TK @item Improved the build process and the debugging for C/C++ @item Improved several windows, like the @b{Breakpoints window} and @b{Goto line} @item Added option to search in files @item Several speed problems in linux were related to the TCL bug with @b{raise} command. Implemented one workaround. @item Fixed many bugs related to parsing files and other. ................................................................................ RamDebugger can be download from @url{http://gid.cimne.upc.es/RamDebugger/RamDebugger1.3.zip} @node Installation and prerequisites, Starting RamDebugger, Download, Introduction and Setup @section Installation and prerequisites The only prerequisite before executing RamDebugger is to have Tcl-Tk installed. The tested version is Tcl-Tk 8.3.4 It can be obtained from @url{http://tcl.activestate.com}. @sp 1 RamDebugger has been tested on Windows and on Linux. For other UNIXes and MAC, it is necessary to obtain, separately, the package Tkhtml compiled for the platform. Without it, the help cannot be visualized. @sp 1 All the additional packages that RamDebugger uses, are already contained in the distribution. @sp 1 ................................................................................ @item Load the TCL file inside RamDebugger with @code{Files->Open file}. In this case, use the example located in @b{<RamDebugger directory>/Examples/example2.tcl} @item Set a breakpoint in line 29 with @code{Debug->Set breakpoint} or press @b{F9} after having the cursor in the desired line. @item Start debugging remotely with @b{File->Debug on->example2} @sp 1 @strong{Note:} Depending on the preferences, it may be necessary to do @code{File->Debug on->Update} before finding the remote program in the menu list. @item Press button @b{Go} in the remote application @item Program should stop in line 29. From now, it is possible to use similar commands than in local debugging (@pxref{Debugging locally}) @end itemize To debug remotely, in Windows it is necessary to load the package @t{comm} in the remote program. To do so use add something similar to the code below in you program, in any ................................................................................ of your program): @example lappend ::auto_path <RamDebugger path>/addons package require commR comm::register application_name 1 @end example @strong{Note:} The package @t{commR} included in RamDebugger is based on the package @b{comm} in tcllib with some modifications. Use always @b{commR} instead of @b{comm} @sp 1 In Linux/Unix, the communication is made with the command @b{send}, So, it is only necessary to have this command enabled in the program, which is true by default. @sp 1 @strong{Note:} It can be necessary to check the security of the server in Unix before being able to use @b{send}. As a fast workaround, write command @b{xhost -} in the UNIX command line. ................................................................................ Check section @ref{Debugging remotely} for the rest of the steps to follow. @node Debugging RamDebugger, Compiling/Debugging c++, Debugging GiD, Using RamDebugger @section Debugging RamDebugger As a good debugger must do, RamDebugger permmits to debugger itself. As it is not a simple code, this is a good testing of the program capabilities. It can be debugged either locally or remotely. To debug itself locally, open TCL source file @b{RamDebugger.tcl} and choose @code{File->Debug on->Currentfile}. See @ref{Debugging locally} for details. To debug itself remotely, open two RamDebuggers. From one of them, connect to the other with @code{File->Debug on->RamDebugger}. @node Compiling/Debugging c++, Timing control, Debugging RamDebugger, Using RamDebugger @section Compiling/Debugging c++ RamDebugger can also compile and debug c/c++ projects. It uses as a backend the program gdb. It is necessary to have @code{gdb} and/or @code{gcc} installed in the computer. @sp 1 @strong{CODE FOR COMPILING AND DEBUGGING C++ IS STILL EXPERIMENTAL AND NEEDS FINE TUNING} Use at your own risk. @sp 1 @strong{Note:} It can also be used in Windows, if the @b{mingw} compiler and debugger have been previously installed. In this case, the directories where the executables are, must be in the @b{PATH}. Use something similar to: @example SET PATH=C:\mingw\bin @end example in file @b{AUTOEXEC.BAT} or search for environment variables in Windows200/XP. Using mingw causes some very dirty black windows to appear from time to time. @node Timing control, Windows hierarchy, Compiling/Debugging c++, Using RamDebugger @section Timing control An additional feature of RamDebugger is the possibility of controlling the computing time of several parts of the program. To proceed with the control of time, make the following steps: ................................................................................ <table><tr> <td><img src="images/timing_control.gif"><td><img src="images/timing_control_report.gif"> <tr><td>Timing control window<td>Timing control report </table> </center><p> @end ifhtml @node Windows hierarchy, , Timing control, Using RamDebugger @section Windows hierarchy With this command, it is possible to draw a graph of the widgets hierarchy in either the debugged program or in RamDebugger. Moving the cursor over the widgets names, it is possible to obtain some information on the widget and on its packing/gridding options. ................................................................................ To open the window use: @code{Debug->Expressions...} Examples of possible expressions in TCL: @itemize @bullet @item @b{variablename}: Enter the name of a variable @item @b{$variablename+4}: Enter a expression like the ones accepted by @b{expr}. @item @b{[lindex $variablename 2]}: Enter any command between brackets @end itemize Examples of possible expressions in C++: @itemize @bullet @item @b{variablename}: Enter the name of a variable @item @b{$variablename+4}: Enter any expression that @b{gdb} accepts. @item @b{$variablename[4:2][6::8]}: One extension to the @b{gdb} expressions. Permmits to print part of a string or vector. @end itemize @node How does it work?, Additional packages included in the distribution, Using RamDebugger, Top @chapter How does it work? RamDebugger instruments the source code TCL files in order to make the debugging. Instrumenting means to add additional lines to the TCL code so as to be able to stop it whereever is desired. Depending on the context, it instruments all the file or only the @b{proc}'s. To see the instrumentation of a file, use @code{Utilities->View instrumented file}. ................................................................................ to identify the interps. This is the package chosen in Windows. @end itemize Due to the high dynamics nature of TCL, it is unpossible to make a direct correlation between source code lines and execution lines. Anyway, it works quite well for normal TCL code. Try and comment. @node Additional packages included in the distribution, License, How does it work?, Top @chapter Additional packages included in the distribution RamDebugger needs several packages to work properly. Other packages are just included to give additional functionality to the user. All the needed packages are included in the distribution as a convenience to the final user. Some of the packages have been modified, either to fix some errors or to improve |
| > | | > | | | > > | > | < > | > > < < < | | < > > | | > | | | > > > > > > > > > > > > > | |
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 .. 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 ... 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 ... 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 ... 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 ... 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 ... 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 ... 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 ... 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 ... 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 ... 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 |
@end iftex @c %**end of header ptype.texinfo @setchapternewpage odd @set photo @set Version $Revision: 1.6 $ @set Date August 2002 @ifinfo Copyright 2002 Ramon Ribó @end ifinfo @titlepage ................................................................................ RamDebugger: A graphical and interactive debugger for Tcl-TK @menu * Introduction and Setup:: * Using RamDebugger:: * How does it work?:: * Known bugs:: * Additional packages included in the distribution:: * License:: @detailmenu --- The Detailed Node Listing --- Introduction and Setup ................................................................................ * Introduction:: * Changes:: * Download:: * Installation and prerequisites:: * Starting RamDebugger:: @end menu @node Introduction, Changes, Introduction and Setup, Introduction and Setup @section Introduction RamDebugger is a graphical debugger for the scripting lenguage Tcl-TK. It can operate basically in two modes: @itemize @bullet @item @b{GUI mode:} The normal one, is the one that appears when opening normally the program and has a Graphical User Interface. ................................................................................ @section Changes Changes From version 1 to version 2 @itemize @bullet @item Tested for Tcl/Tk @b{8.3.4} and @b{8.4} @item When @b{Tkhtml} is not compiled for the given platform, gives message and continues @item Added contextual help for programming commands. If there are manual pages (UNIX), it also uses them if @b{man2html} is found in the system. @item When debugging local, possibility to choose debug TCL or TK @item Improved the build process and the debugging for C/C++ @item Improved several windows, like the @b{Breakpoints window} and @b{Goto line} @item Added option to search in files @item Several speed problems in linux were related to the TCL bug with @b{raise} command. Implemented one workaround. @item Fixed many bugs related to parsing files and other. ................................................................................ RamDebugger can be download from @url{http://gid.cimne.upc.es/RamDebugger/RamDebugger1.3.zip} @node Installation and prerequisites, Starting RamDebugger, Download, Introduction and Setup @section Installation and prerequisites The only prerequisite before executing RamDebugger is to have Tcl-Tk installed. The tested version are Tcl-Tk 8.3.4 and 8.4b2 They can be obtained from @url{http://tcl.activestate.com}. @sp 1 RamDebugger has been tested on Windows and on Linux. For other UNIXes and MAC, it is necessary to obtain, separately, the package Tkhtml compiled for the platform. Without it, the help cannot be visualized. @sp 1 All the additional packages that RamDebugger uses, are already contained in the distribution. @sp 1 ................................................................................ @item Load the TCL file inside RamDebugger with @code{Files->Open file}. In this case, use the example located in @b{<RamDebugger directory>/Examples/example2.tcl} @item Set a breakpoint in line 29 with @code{Debug->Set breakpoint} or press @b{F9} after having the cursor in the desired line. @item Start debugging remotely with @b{File->Debug on->example2} @sp 1 @strong{Note:} Depending on the preferences, it may be necessary to do @code{File->Debug on->Update remotes} before finding the remote program in the menu list. Depending on the computer (in Windows), it can be necessary to wait for several seconds for RamDebugger to find the remote program. @item Press button @b{Go} in the remote application @item Program should stop in line 29. From now, it is possible to use similar commands than in local debugging (@pxref{Debugging locally}) @end itemize To debug remotely, in Windows it is necessary to load the package @t{comm} in the remote program. To do so use add something similar to the code below in you program, in any ................................................................................ of your program): @example lappend ::auto_path <RamDebugger path>/addons package require commR comm::register application_name 1 @end example @strong{Note:} The package @t{commR} included in RamDebugger is based on the package @b{comm} in tcllib with some modifications. Use always @b{commR} instead of @b{comm}. This package uses sockets for communication. If you have a firewall in your computer, maybe it will not work. @sp 1 In Linux/Unix, the communication is made with the command @b{send}, So, it is only necessary to have this command enabled in the program, which is true by default. @sp 1 @strong{Note:} It can be necessary to check the security of the server in Unix before being able to use @b{send}. As a fast workaround, write command @b{xhost -} in the UNIX command line. ................................................................................ Check section @ref{Debugging remotely} for the rest of the steps to follow. @node Debugging RamDebugger, Compiling/Debugging c++, Debugging GiD, Using RamDebugger @section Debugging RamDebugger As a good debugger must do, RamDebugger permmits to debugger itself. As it is not a simple code, this is a good testing of the program capabilities. @sp 1 It can be debugged either locally or remotely. To debug itself locally, open TCL source file @b{RamDebugger.tcl} and choose @code{File->Debug on->Currentfile}. See @ref{Debugging locally} for details. @sp 1 To debug itself remotely, open two RamDebuggers. From one of them, connect to the other with @code{File->Debug on->RamDebugger}. In @b{Windows}, if option @code{Automatically check remote files} is unset (the default), it can be necessary to use @code{Debug on-> Update remotes} on both RamDebuggers. @node Compiling/Debugging c++, Timing control, Debugging RamDebugger, Using RamDebugger @section Compiling/Debugging c++ RamDebugger can also compile and debug c/c++ projects. It uses as a backend the program gdb. It is necessary to have @code{gdb} and/or @code{gcc} installed in the computer. @sp 1 @strong{Note:} It can also be used in Windows, if the @b{mingw} compiler and debugger have been previously installed. In this case, the directories where the executables are, must be in the @b{PATH}. Use something similar to: @example SET PATH=C:\mingw\bin @end example in file @b{AUTOEXEC.BAT} or search for environment variables in Windows200/XP. @sp 1 Alternatively, it is possible to set in the Preferences window @code{Edit->Preferences}, the directories where the @b{mingw} tools can be found. @node Timing control, Windows hierarchy, Compiling/Debugging c++, Using RamDebugger @section Timing control An additional feature of RamDebugger is the possibility of controlling the computing time of several parts of the program. To proceed with the control of time, make the following steps: ................................................................................ <table><tr> <td><img src="images/timing_control.gif"><td><img src="images/timing_control_report.gif"> <tr><td>Timing control window<td>Timing control report </table> </center><p> @end ifhtml @node Windows hierarchy, Expressions window, Timing control, Using RamDebugger @section Windows hierarchy With this command, it is possible to draw a graph of the widgets hierarchy in either the debugged program or in RamDebugger. Moving the cursor over the widgets names, it is possible to obtain some information on the widget and on its packing/gridding options. ................................................................................ To open the window use: @code{Debug->Expressions...} Examples of possible expressions in TCL: @itemize @bullet @item @b{variablename}: Enter the name of a variable @item @b{$variablename+4}: Enter a expression like the ones accepted by @b{expr} @item @b{[lindex $variablename 2]}: Enter any command between brackets @item @b{[set variablename 6]}: modify variable @end itemize Examples of possible expressions in C++: @itemize @bullet @item @b{variablename}: Enter the name of a variable @item @b{$variablename+4}: Enter any expression that @b{gdb} accepts @item @b{$variablename[4:2][6::8]}: One extension to the @b{gdb} expressions. Permmits to print part of a string or vector @end itemize @node How does it work?, Known bugs, Using RamDebugger, Top @chapter How does it work? RamDebugger instruments the source code TCL files in order to make the debugging. Instrumenting means to add additional lines to the TCL code so as to be able to stop it whereever is desired. Depending on the context, it instruments all the file or only the @b{proc}'s. To see the instrumentation of a file, use @code{Utilities->View instrumented file}. ................................................................................ to identify the interps. This is the package chosen in Windows. @end itemize Due to the high dynamics nature of TCL, it is unpossible to make a direct correlation between source code lines and execution lines. Anyway, it works quite well for normal TCL code. Try and comment. @node Known bugs, Additional packages included in the distribution, How does it work?, Top @chapter Known bugs That's for sure that there are many not listed bugs. This is only a list of known bugs that the author could not fix at the time of the release. @itemize @bullet @item TCL code that returns a value without using @code{return}, will fail when being debugged @item When using help, program crashes from time to time. This is probably a bug in the @b{tkhtml} package @end itemize @node Additional packages included in the distribution, License, Known bugs, Top @chapter Additional packages included in the distribution RamDebugger needs several packages to work properly. Other packages are just included to give additional functionality to the user. All the needed packages are included in the distribution as a convenience to the final user. Some of the packages have been modified, either to fix some errors or to improve |
Added scripts/HelperWindows.tcl.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 |
################################################################################ # DisplayVar ################################################################################ proc RamDebugger::DisplayVar { X Y x y } { variable text variable remoteserverType variable debuggerstate if { $debuggerstate != "debug" } { return } if { $X != [winfo pointerx $text] || $Y != [winfo pointery $text] } { return } set var [GetSelOrWordInIndex @$x,$y] if { $var == "" } { return } if { $remoteserverType == "gdb" } { set comm "$var" } else { set comm { if { [array exists {VAR}] } { array get {VAR} } elseif { [info exists {VAR}] } { set {VAR} } else { expr {VAR} } } set comm [string map [list VAR [string trim $var]] $comm] #set comm "if { \[array exists $var] } { array get $var } else { set $var }" } # catch is here for strange situations, like when changing source file catch { set res [reval -handler [list RamDebugger::DisplayVar2 $var $X $Y $x $y] $comm] } } proc RamDebugger::DisplayVar2 { var X Y x y res } { variable text if { [lindex $res 0] == 0 } { set w $text.help if { [winfo exists $w] } { destroy $w } toplevel $w wm overrideredirect $w 1 wm transient $w $text wm geom $w +$X+$Y pack [label $w.l -bg white] $w.l conf -bd 1 -relief solid set val [lindex $res 1] if { [string length $val] > 50 } { set val [string range $val 0 46]... } $w.l conf -text "$var=$val" } } ################################################################################ # DisplayVarWindow ################################################################################ proc RamDebugger::DisplayVarWindowEval { what f { res "" } } { variable remoteserver variable remoteserverType variable options set w [winfo toplevel $f] if { $what == "do" } { if { [string trim $DialogWinTop::user($w,expression)] == "" } { set DialogWinTop::user($w,type) "" return } set var $DialogWinTop::user($w,expression) if { $remoteserver == "" } { WarnWin "Debugger is not active" return } set ipos [lsearch $options(old_expressions) $var] if { $ipos != -1 } { set options(old_expressions) [lreplace $options(old_expressions) $ipos $ipos] } set options(old_expressions) [linsert [lrange $options(old_expressions) 0 20] 0 $var] $DialogWinTop::user($w,combo) configure -values $options(old_expressions) if { $remoteserverType == "gdb" } { if { ![regexp {\[([0-9]+):([0-9]+)\]} $var {} ini1 end1] } { set ini1 1 set end1 1 } if { ![regexp {\[([0-9]+)::([0-9]+)\]} $var {} ini2 end2] } { set ini2 1 set end2 1 } set remoteserver [lreplace $remoteserver 2 2 [list getdata \ "RamDebugger::DisplayVarWindowEval res $f"]] set comm "" set isinit 0 for { set i1 $ini1 } { $i1 <= $end1 } { incr i1 } { regsub {\[([0-9]+):([0-9]+)\]} $var \[$i1\] varn for { set i2 $ini2 } { $i2 <= $end2 } { incr i2 } { regsub {\[([0-9]+)::([0-9]+)\]} $varn \[$i2\] varn if { !$isinit } { if { $ini1 != $end1 || $ini2 != $end2 } { append comm "printf \"MULTIPLE RESULT\\n\"\n" } append comm "whatis $varn\n" set isinit 1 } append comm "printf \"\\n$varn=\"\noutput $varn\nprintf \"\\n\"\n" } } append comm "printf \"FINISHED GETDATA\\n\"" EvalRemote $comm return } else { set comm { if { [array exists {VAR}] } { list array [array get {VAR}] } elseif { [info exists {VAR}] } { list variable [set {VAR}] } else { list expression [expr {VAR}] } } set comm [string map [list VAR [string trim $var]] $comm] } reval -handler [list RamDebugger::DisplayVarWindowEval res $f] $comm } else { set var $DialogWinTop::user($w,expression) $DialogWinTop::user($w,textv) conf -state normal $DialogWinTop::user($w,textv) del 1.0 end if { $remoteserverType == "gdb" } { if { [regexp {^(\s*MULTIPLE RESULT\s*type\s+=\s+char\s)(.*)} $res {} ini rest] } { set res $ini append res " \"" foreach "i c" [regexp -all -inline {'(.[^\)]*)'\n} $rest] { append res "$c" } append res "\"\n$rest" } set res [list 0 [list variable $res]] } switch [lindex $res 0] { 0 { $DialogWinTop::user($w,textv) conf -fg black set DialogWinTop::user($w,type) [lindex [lindex $res 1] 0] if { $DialogWinTop::user($w,type) == "array" } { foreach "name val" [lindex [lindex $res 1] 1] { $DialogWinTop::user($w,textv) insert end "${var}($name) = $val\n" } } elseif { $DialogWinTop::user($w,aslist) } { set DialogWinTop::user($w,type) list if { [catch { set list [lrange [lindex [lindex $res 1] 1] 0 end] }] } { $DialogWinTop::user($w,textv) insert end "Error: variable is not a list" } else { set ipos 0 foreach i $list { $DialogWinTop::user($w,textv) insert end "$ipos = $i\n" incr ipos } } } else { $DialogWinTop::user($w,textv) insert end [lindex [lindex $res 1] 1] } } 1 { set DialogWinTop::user($w,type) error $DialogWinTop::user($w,textv) conf -fg red $DialogWinTop::user($w,textv) insert end [lindex $res 1] } } $DialogWinTop::user($w,textv) conf -state disabled } } proc RamDebugger::DisplayVarWindowCancel { f } { destroy [winfo toplevel $f] } proc RamDebugger::GetSelOrWordInIndex { idx } { variable text set range [$text tag ranges sel] if { $range != "" && [$text compare [lindex $range 0] <= $idx] && \ [$text compare [lindex $range 1] >= $idx] } { return [eval $text get $range] } else { if { $idx != "" } { set var "" set idx0 $idx while { [string is wordchar [$text get $idx0]] } { set var [$text get $idx0]$var set idx0 [$text index $idx0-1c] if { [$text compare $idx0 <= 1.0] } { break } } set idx1 [$text index $idx+1c] while { [string is wordchar [$text get $idx1]] } { append var [$text get $idx1] set idx1 [$text index $idx1+1c] if { [$text compare $idx1 >= end-1c] } { break } } } else { set var "" } } return $var } proc RamDebugger::DisplayVarWindow {} { variable text variable options set var [GetSelOrWordInIndex insert] set commands [list "RamDebugger::DisplayVarWindowEval do" RamDebugger::DisplayVarWindowCancel] set f [DialogWinTop::Init $text "View expression or variable" separator $commands \ "" Eval Close] set w [winfo toplevel $f] Label $f.l1 -text "Expression:" -grid "0 px3" $f.l1 configure -helptext { Examples of possible expressions in TCL: * variablename: Enter the name of a variable * $variablename+4: Enter a expression like the ones accepted by expr * [lindex $variablename 2]: Enter any command between brackets * [set variablename 6]: modify variable Examples of possible expressions in C++: * variablename: Enter the name of a variable * $variablename+4: Enter any expression that gdb accepts * $variablename[4:2][6::8]: One extension to the gdb expressions. Permmits to print part of a string or vector } if { ![info exists options(old_expressions)] } { set options(old_expressions) "" } set DialogWinTop::user($w,combo) [ComboBox $f.e1 -textvariable DialogWinTop::user($w,expression) \ -values $options(old_expressions) -grid "1 px3"] set DialogWinTop::user($w,expression) $var set sw [ScrolledWindow $f.lf -relief sunken -borderwidth 0 -grid "0 2"] set DialogWinTop::user($w,textv) [text $sw.text -background white -wrap word -width 40 -height 10 \ -exportselection 0 -font FixedFont -highlightthickness 0] $sw setwidget $DialogWinTop::user($w,textv) if { $::tcl_platform(platform) != "windows" } { $sw.text conf -exportselection 1 } label $f.l2 -textvar DialogWinTop::user($w,type) -grid "0 w" -bg [CCColorActivo [$w cget -bg]] checkbutton $f.cb1 -text "As list" -variable DialogWinTop::user($w,aslist) -grid "1 w" \ -command "DialogWinTop::InvokeOK $f" set DialogWinTop::user($w,aslist) 0 supergrid::go $f tkTabToWindow $f.e1 bind [winfo toplevel $f] <Return> "DialogWinTop::InvokeOK $f" $DialogWinTop::user($w,textv) conf -state disabled bind $DialogWinTop::user($w,textv) <1> "focus $DialogWinTop::user($w,textv)" DialogWinTop::CreateWindow $f DialogWinTop::InvokeOK $f } ################################################################################ # DisplayBreakpoints ################################################################################ proc RamDebugger::DisplayBreakpointsWindowSetCond {} { set curr [$DialogWinBreak::user(list) curselection] if { [llength $curr] != 1 } { return } set DialogWinBreak::user(cond) [lindex [$DialogWinBreak::user(list) get $curr] 3] } proc RamDebugger::DisplayBreakpointsWindow {} { variable text variable breakpoints variable currentfile CopyNamespace ::DialogWin ::DialogWinBreak set f [DialogWinBreak::Init $text "Breakpoints window" separator [list Delete \ "Delete all" View] "Apply Cond" Close] set w [winfo toplevel $f] label $f.l1 -text "Condition:" -grid 0 entry $f.e1 -textvariable DialogWinBreak::user(cond) -width 80 -grid "1 px3 py3" set sw [ScrolledWindow $f.lf -relief sunken -borderwidth 0 -grid "0 2"] set DialogWinBreak::user(list) [tablelist::tablelist $sw.lb -width 55\ -exportselection 0 \ -columns [list \ 4 Num left \ 20 File right \ 5 Line left \ 20 Condition left \ 40 Path left ] \ -labelcommand tablelist::sortByColumn \ -background white \ -selectbackground navy -selectforeground white \ -stretch 1 -selectmode extended \ -highlightthickness 0] $sw setwidget $DialogWinBreak::user(list) supergrid::go $f focus $DialogWinBreak::user(list) bind [$DialogWinBreak::user(list) bodypath] <Double-1> { focus $DialogWinBreak::user(list) RamDebugger::DisplayBreakpointsWindowSetCond } bind [$DialogWinBreak::user(list) bodypath] <ButtonPress-3> \ [bind TablelistBody <ButtonPress-1>] bind [$DialogWinBreak::user(list) bodypath] <ButtonRelease-3> { catch { destroy %W.menu } set menu [menu %W.menu] $menu add command -label "Apply condition" -command "DialogWinBreak::InvokeOK" $menu add command -label "View" -command "DialogWinBreak::InvokeButton 4" $menu add separator $menu add command -label "Delete" -command "DialogWinBreak::InvokeButton 2" tk_popup $menu %X %Y } foreach i $breakpoints { foreach "num file line cond" $i break $DialogWinBreak::user(list) insert end [list $num [file tail $file] $line $cond \ [file dirname $file]] } set action [DialogWinBreak::CreateWindow] while 1 { switch $action { 0 { DialogWinBreak::DestroyWindow namespace delete ::DialogWinBreak return } 1 { set curr [$DialogWinBreak::user(list) curselection] if { [llength $curr] != 1 } { WarnWin "Select just one breakpoint before applying condition" $w } else { set val [$DialogWinBreak::user(list) get $curr] rcond [lindex $val 0] $DialogWinBreak::user(cond) $DialogWinBreak::user(list) delete $curr $DialogWinBreak::user(list) insert $curr [lreplace $val 3 3 \ $DialogWinBreak::user(cond)] set file [file join [lindex $val 4 ] [lindex $val 1]] set line [lindex $val 2] if { $file == $currentfile } { $text mark set insert $line.0 $text see $line.0 } } } 2 { foreach i [$DialogWinBreak::user(list) curselection] { set ent [$DialogWinBreak::user(list) get $i] set num [lindex $ent 0] set file [file join [lindex $ent 4 ] [lindex $ent 1]] set line [lindex $ent 2] if { $file == $currentfile } { UpdateArrowAndBreak $line 0 "" } rdel $num } $DialogWinBreak::user(list) del 0 end foreach i $breakpoints { foreach "num file line cond" $i break $DialogWinBreak::user(list) insert end [list $num [file tail $file] $line $cond \ [file dirname $file]] } } 3 { set ret [DialogWinBreak::messageBox -default ok -icon warning -message \ "Are you sure to delete all breakpoints?" -parent $f \ -title "delete all breakpoints" -type okcancel] if { $ret == "ok" } { $DialogWinBreak::user(list) del 0 end foreach i $breakpoints { set num [lindex $i 0] set file [lindex $i 1] set line [lindex $i 2] if { $file == $currentfile } { UpdateArrowAndBreak $line 0 "" } rdel $num } } } 4 { set curr [$DialogWinBreak::user(list) curselection] if { [llength $curr] != 1 } { WarnWin "Select just one breakpoint in order to see the file" $w return } set val [$DialogWinBreak::user(list) get $curr] set file [file join [lindex $val 4 ] [lindex $val 1]] set line [lindex $val 2] if { $file != $currentfile } { OpenFileF $file } $text mark set insert $line.0 $text see $line.0 } } set action [DialogWinBreak::WaitForWindow] } } ################################################################################ # fonts ################################################################################ proc RamDebugger::CreateModifyFonts {} { variable options if { [lsearch [font names] NormalFont] == -1 } { font create NormalFont } if { [lsearch [font names] FixedFont] == -1 } { font create FixedFont } if { [lsearch [font names] HelpFont] == -1 } { font create HelpFont } eval font configure NormalFont $options(NormalFont) eval font configure FixedFont $options(FixedFont) eval font configure HelpFont $options(HelpFont) option add *font NormalFont } proc RamDebugger::UpdateFont { w but fontname } { set newfont [SelectFont $w.fonts -type dialog -parent $w -sampletext \ "RamDebugger is nice" -title "Select font"] if { $newfont == "" } { return } set list [list family size weight slant underline overstrike] foreach $list $newfont break set comm "font configure" lappend comm $fontname foreach i [lrange $list 0 3] { lappend comm -$i [set $i] } if { [info exists underline] && $underline != "" } { lappend comm -underline 1 } else { lappend comm -underline 0 } if { [info exists overstrike] && $overstrike != "" } { lappend comm -overstrike 1 } else { lappend comm -overstrike 0 } eval $comm regexp {^[^:]+} [$but cget -text] type set btext "$type: [font conf $fontname -family] [font conf $fontname -size] " append btext "[font conf $fontname -weight] [font conf $fontname -slant]" $but configure -text $btext } ################################################################################ # Preferences ################################################################################ proc RamDebugger::PreferencesAddDelDirectories { listbox what } { variable options switch $what { add { set dir [RamDebugger::filenormalize [tk_chooseDirectory -initialdir $options(defaultdir) \ -parent $listbox \ -title "Add directories" -mustexist 1]] if { $dir == "" } { return } $listbox insert end $dir } delete { set num 0 foreach i [$listbox curselection] { set ipos [expr $i-$num] $listbox delete $ipos incr num } $listbox selection clear 0 end } up { foreach i [$listbox curselection] { set dir [$listbox get $i] $listbox delete $i $listbox insert [expr $i-1] $dir } $listbox selection clear 0 end } } } proc RamDebugger::PreferencesWindow {} { variable text variable options variable options_def set fb [DialogWin::Init $text "Preferences window" separator [list Apply Defaults]] set w [winfo toplevel $fb] set notebook [NoteBook $fb.nb -homogeneous 1 -bd 1 -internalborderwidth 3 \ -grid "0 px3 py3"] set f [$fb.nb insert end basic -text "Basic"] TitleFrame $f.f1 -text [_ debugging] -grid 0 set f1 [$f.f1 getframe] if { $::tcl_platform(platform) == "windows" } { checkbutton $f1.cb0 -text "Automatically check remote files" -variable \ DialogWin::user(CheckRemotes) -grid "0 3 w" DynamicHelp::register $f1.cb0 balloon [string trim { this variable is only used on windows. It can be: 0: Only check remote programs on demand (useful if not making remote debugging, the start up is faster) 1: Register as remote and check remote programs on start up. The start up can be slower but is better when making remote debugging }] set DialogWin::user(CheckRemotes) $options(CheckRemotes) } checkbutton $f1.cb1 -text "Confirm start debugging" -variable \ DialogWin::user(ConfirmStartDebugging) -grid "0 3 w" DynamicHelp::register $f1.cb1 balloon "\ If this option is set, a confirmation window will be displayed\n\ when starting the execution of the debugger" set DialogWin::user(ConfirmStartDebugging) $options(ConfirmStartDebugging) checkbutton $f1.cb2 -text "Confirm modify variable" -variable \ DialogWin::user(ConfirmModifyVariable) -grid "0 3 w" DynamicHelp::register $f1.cb2 balloon "\ If this option is set, a confirmation window will be displayed\n\ before changing the value of a variable in the debugged program\n\ by pressing return in the 'User defined variables' or in the\n\ 'Local variables'" set DialogWin::user(ConfirmModifyVariable) $options(ConfirmModifyVariable) label $f1.isf -text "Instrument sourced files" -grid "0 e" tk_optionMenu $f1.cb3 DialogWin::user(instrument_source) auto always never ask $f1.cb3 conf -width 10 supergrid::gridinfo $f1.cb3 "1 w" DynamicHelp::register $f1.isf balloon "\ This variable controls what to do when the debugged program tries\n\ to source a file. Depending on the option chosen, the source file\n\ will be instrumented or not.\n\ If 'auto' is chosen, only the already instrumented files will be sent\n\ instrumented" set DialogWin::user(instrument_source) $options(instrument_source) if { [string match *ask* $DialogWin::user(instrument_source)] } { set DialogWin::user(instrument_source) ask } set helptext "When debugging locally, choose here if the debugged script is only TCL " append helptext "or also TK" Label $f1.l15 -text "Local debugging type:" -helptext $helptext -grid "0 e" radiobutton $f1.r1 -text "TCL" -variable DialogWin::user(LocalDebuggingType) -value tcl \ -grid "1 w" radiobutton $f1.r2 -text "TK" -variable DialogWin::user(LocalDebuggingType) -value tk \ -grid "2 w" set DialogWin::user(LocalDebuggingType) $options(LocalDebuggingType) Label $f1.l2 -text "Indent size TCL:" -helptext "Size used when indenting TCL with key: <Tab>" \ -grid "0 e" SpinBox $f1.sb -range "0 10 1" -textvariable DialogWin::user(indentsizeTCL) \ -width 4 -grid "1 2 px3" set DialogWin::user(indentsizeTCL) $options(indentsizeTCL) Label $f1.l3 -text "Indent size c++:" -helptext "Size used when indenting c++ with key: <Tab>" \ -grid "0 e" SpinBox $f1.sb2 -range "0 10 1" -textvariable DialogWin::user(indentsizeC++) \ -width 4 -grid "1 2 px3" set DialogWin::user(indentsizeC++) $options(indentsizeC++) TitleFrame $f.f2 -text [_ fonts] -grid 0 set f2 [$f.f2 getframe] foreach "but type fontname" [list $f2.b1 {GUI font} NormalFont $f2.b2 {Text font} FixedFont \ $f2.b3 {Help font} HelpFont] { set btext "$type: [font conf $fontname -family] [font conf $fontname -size] " append btext "[font conf $fontname -weight] [font conf $fontname -slant]" Button $but -text $btext -font $fontname -relief link -command \ "RamDebugger::UpdateFont $w $but $fontname" -grid "0 w" } set fd [$fb.nb insert end directories -text "Directories"] TitleFrame $fd.f1 -text "executable directories" -grid 0 set fd1 [$fd.f1 getframe] set sw [ScrolledWindow $fd1.lf -relief sunken -borderwidth 0 -grid "0"] listbox $sw.lb -listvariable DialogWin::user(executable_dirs) -selectmode extended $sw setwidget $sw.lb set bbox [ButtonBox $fd1.bbox1 -spacing 0 -padx 1 -pady 1 -homogeneous 1 -grid "0 wn"] $bbox add -image folderopen16 \ -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1 -padx 1 -pady 1 \ -helptext [_ "Add include directory"] \ -command "RamDebugger::PreferencesAddDelDirectories $sw.lb add" $bbox add -image actcross16 \ -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1 -padx 1 -pady 1 \ -helptext [_ "Delete include directory"] \ -command "RamDebugger::PreferencesAddDelDirectories $sw.lb delete" $bbox add -image playeject16 \ -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1 -padx 1 -pady 1 \ -helptext [_ "Increase directory priority"] \ -command "RamDebugger::PreferencesAddDelDirectories $sw.lb up" set DialogWin::user(executable_dirs) $options(executable_dirs) set tt "Include here all directories where RamDebugger should find executables\n" append tt "This is primary useful in Windows to describe where mingw is installed" DynamicHelp::register $sw.lb balloon $tt supergrid::go $f1 supergrid::go $f2 supergrid::go $f supergrid::go $fd supergrid::go $fd1 $fb.nb compute_size $fb.nb raise basic supergrid::go $fb focus $f1.cb1 set action [DialogWin::CreateWindow "" "" 200] while 1 { switch $action { 0 { DialogWin::DestroyWindow return } 1 - 2 { if { ![string is integer -strict $DialogWin::user(indentsizeTCL)] || \ $DialogWin::user(indentsizeTCL) < 0 || $DialogWin::user(indentsizeTCL) > 10 } { WarnWin "Error: indent size must be between 0 and 10" $w } elseif { ![string is integer -strict $DialogWin::user(indentsizeC++)] || \ $DialogWin::user(indentsizeC++) < 0 || $DialogWin::user(indentsizeC++) > 10 } { WarnWin "Error: indent size must be between 0 and 10" $w } else { set options(indentsizeTCL) $DialogWin::user(indentsizeTCL) set options(indentsizeC++) $DialogWin::user(indentsizeC++) set options(ConfirmStartDebugging) $DialogWin::user(ConfirmStartDebugging) set options(ConfirmModifyVariable) $DialogWin::user(ConfirmModifyVariable) set options(instrument_source) $DialogWin::user(instrument_source) set options(LocalDebuggingType) $DialogWin::user(LocalDebuggingType) if { [info exists options(CheckRemotes)] } { set options(CheckRemotes) $DialogWin::user(CheckRemotes) } set options(executable_dirs) $DialogWin::user(executable_dirs) UpdateExecDirs if { $action == 1 } { DialogWin::DestroyWindow return } } } 3 { foreach i [list indentsizeTCL indentsizeC++ ConfirmStartDebugging \ ConfirmModifyVariable instrument_source LocalDebuggingType \ CheckRemotes NormalFont FixedFont HelpFont executable_dirs] { if { [info exists options_def($i)] } { set options($i) $options_def($i) set DialogWin::user($i) $options_def($i) } } CreateModifyFonts foreach "but fontname" [list $f2.b1 NormalFont $f2.b2 FixedFont $f2.b3 HelpFont] { regexp {^[^:]+} [$but cget -text] type set btext "$type: [font conf $fontname -family] [font conf $fontname -size] " append btext "[font conf $fontname -weight] [font conf $fontname -slant]" $but configure -text $btext } } } set action [DialogWin::WaitForWindow] } } ################################################################################ # DisplayTimes ################################################################################ proc RamDebugger::DisplayTimesWindowStart { f } { rtime -start } proc RamDebugger::DisplayTimesWindowReport { f } { variable text set f [DialogWin::Init $text "Timing report" separator "" -] set w [winfo toplevel $f] ComboBox $f.cb1 -textvariable DialogWin::user(units) -editable 0 \ -modifycmd { $DialogWin::user(text) del 1.0 end $DialogWin::user(text) ins end [RamDebugger::rtime -display $DialogWin::user(units)] } -width 10 -values [list microsec milisec sec min] -grid "0 w" set DialogWin::user(units) sec set sw [ScrolledWindow $f.lf -relief sunken -borderwidth 0 -grid "0 2"] text $sw.t $sw setwidget $sw.t set DialogWin::user(text) $sw.t bind $sw.t <1> "focus $sw.t" supergrid::go $f focus $sw.t $sw.t ins end [rtime -display sec] set action [DialogWin::CreateWindow] DialogWin::DestroyWindow } proc RamDebugger::DisplayTimesWindowCancel { f } { rtime -stop destroy [winfo toplevel $f] } proc RamDebugger::DisplayTimesPickSelection { w } { variable text if { [catch { set DialogWinTop::user($w,lineini) [scan [$text index sel.first] %d] set DialogWinTop::user($w,lineend) [scan [$text index sel.last] %d] }]} { WarnWin "It is necessary to select some text in main window" $w } } proc RamDebugger::DisplayTimesDrawSelection { w } { variable text if { [catch { $text tag add sel "$DialogWinTop::user($w,lineini).0 linestart" \ "$DialogWinTop::user($w,lineend).0 lineend" $text see $DialogWinTop::user($w,lineini).0 }] } { WarnWin "Lines are not correct" $w } } proc RamDebugger::ModifyTimingBlock { w what } { variable TimeMeasureData set idx [$DialogWinTop::user($w,list) curselection] switch $what { create { set err [catch [list rtime -add $DialogWinTop::user($w,name) \ $DialogWinTop::user($w,lineini) $DialogWinTop::user($w,lineend)] errstring] if { $err } { WarnWin [lindex [split $errstring \n] 0] return $err } else { ModifyTimingBlock $w update return 0 } } edit { set err [ModifyTimingBlock $w delete] if { !$err } { ModifyTimingBlock $w create } } delete { if { [llength $idx] != 1 } { WarnWin "Error: it is necessary to select one block in list" return 1 } set selname [lindex [$DialogWinTop::user($w,list) get $idx] 0] set err [catch [list rtime -delete $selname] errstring] if { $err } { WarnWin [lindex [split $errstring \n] 0] return $err } else { ModifyTimingBlock $w update return 0 } } updatecurrent { if { [llength $idx] != 1 } { WarnWin "Error: it is necessary to select one block in list" return 1 } set DialogWinTop::user($w,name) [lindex [$DialogWinTop::user($w,list) get $idx] 0] set DialogWinTop::user($w,lineini) [lindex [$DialogWinTop::user($w,list) get $idx] 2] set DialogWinTop::user($w,lineend) [lindex [$DialogWinTop::user($w,list) get $idx] 3] } update { $DialogWinTop::user($w,list) del 0 end foreach i $TimeMeasureData { $DialogWinTop::user($w,list) insert end [lrange $i 0 3] } } } } proc RamDebugger::DisplayTimesWindow {} { variable text set commands [list RamDebugger::DisplayTimesWindowStart RamDebugger::DisplayTimesWindowReport \ RamDebugger::DisplayTimesWindowCancel] set f [DialogWinTop::Init $text "Timing control" separator $commands \ [list Report] Start] set w [winfo toplevel $f] TitleFrame $f.f1 -text [_ "current block"] -grid "0 ew" set f1 [$f.f1 getframe] label $f1.l1 -text "Name" -grid 0 entry $f1.e1 -textvariable DialogWinTop::user($w,name) -grid "1 ew" label $f1.l2 -text "Initial line:" -grid "0 e" entry $f1.e2 -textvariable DialogWinTop::user($w,lineini) -grid "1 w py2" -width 8 label $f1.l3 -text "End line:" -grid "0 e" entry $f1.e3 -textvariable DialogWinTop::user($w,lineend) -grid "1 w py2" -width 8 set bbox [ButtonBox $f1.bbox1 -spacing 0 -padx 1 -pady 1 -homogeneous 1 -grid "0 2 w"] $bbox add -text "Pick selection" \ -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1 -padx 1 -pady 1 \ -helptext [_ "Gets the selection from the text window"] \ -command "RamDebugger::DisplayTimesPickSelection $w" $bbox add -text "Draw selection" \ -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1 -padx 1 -pady 1 \ -helptext [_ "Selects current block in text"] \ -command "RamDebugger::DisplayTimesDrawSelection $w" TitleFrame $f.f2 -text [_ "blocks"] -grid 0 set f2 [$f.f2 getframe] set sw [ScrolledWindow $f2.lf -relief sunken -borderwidth 0 -grid "0 ewns"] set DialogWinTop::user($w,list) [tablelist::tablelist $sw.lb -width 55 \ -exportselection 0 \ -columns [list \ 10 "Name" left \ 10 "File" right \ 7 "Initial line" right \ 7 "End line" right \ ] \ -labelcommand tablelist::sortByColumn \ -background white \ -selectbackground navy -selectforeground white \ -stretch "0 1" -selectmode browse \ -highlightthickness 0] $sw setwidget $DialogWinTop::user($w,list) bind [$DialogWinTop::user($w,list) bodypath] <Double-1> \ "RamDebugger::ModifyTimingBlock $w updatecurrent" set bbox [ButtonBox $f2.bbox1 -spacing 0 -padx 1 -pady 1 -homogeneous 1 -grid "0 w"] $bbox add -image acttick16 \ -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1 -padx 1 -pady 1 \ -helptext [_ "Create new block"] \ -command "RamDebugger::ModifyTimingBlock $w create" $bbox add -image edit16 \ -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1 -padx 1 -pady 1 \ -helptext [_ "Update selected block"] \ -command "RamDebugger::ModifyTimingBlock $w edit" $bbox add -image actcross16 \ -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1 -padx 1 -pady 1 \ -helptext [_ "Delete selected block"] \ -command "RamDebugger::ModifyTimingBlock $w delete" supergrid::go $f1 supergrid::go $f2 supergrid::go $f tkTabToWindow $f1.e1 bind [winfo toplevel $f] <Return> "DialogWinTop::InvokeOK $f" ModifyTimingBlock $w update DialogWinTop::CreateWindow $f DialogWinTop::InvokeOK $f } ################################################################################ # About ################################################################################ proc RamDebugger::AboutWindow {} { variable text set par [winfo toplevel $text] set w $par.about toplevel $w wm protocol $w WM_DELETE_WINDOW { # nothing } label $w.l -text RamDebugger -font "-family {new century schoolbook} -size 24 -weight bold" \ -fg \#d3513d -grid 0 set tt "Author: Ramon Ribó (RAMSAN)\n" append tt "ramsan@cimne.upc.es\nhttp://gid.cimne.upc.es/ramsan\n" append tt "http://gid.cimne.upc.es/RamDebugger" text $w.l2 -grid "0 px20 py10" -bd 0 -bg [$w cget -bg] -width 10 -height 4 $w.l2 ins end $tt $w.l2 conf -state disabled bind $w.l2 <1> "focus $w.l2" canvas $w.c -height 50 -grid 0 -bg white -highlightthickness 0 ScrolledWindow $w.lf -relief sunken -borderwidth 0 -grid 0 tablelist::tablelist $w.lf.lb -width 55\ -exportselection 0 \ -columns [list \ 10 Package left \ 10 Author left \ 10 License right\ 4 Mod left \ ] \ -labelcommand tablelist::sortByColumn \ -background white \ -selectbackground navy -selectforeground white \ -stretch 1 -selectmode extended \ -highlightthickness 0 $w.lf setwidget $w.lf.lb frame $w.buts -height 35 -bg [CCColorActivo [$w cget -bg]] -grid 0 supergrid::go $w button $w.close -text Close -width 10 place $w.close -in $w.buts -anchor n -y 3 wm withdraw $w update idletasks set x [expr [winfo x $par]+[winfo width $par]/2-[winfo reqwidth $w]/2] set y [expr [winfo y $par]+[winfo height $par]/2-[winfo reqheight $w]/2] wm geom $w +$x+$y wm deiconify $w wm transient $w $par bind $w.close <Enter> "RamDebugger::MotionInAbout $w.close ; break" bind $w.close <ButtonPress-1> "WarnWin [list {Congratulations, you got it!!!}] ; destroy $w; break" $w.c create text 0 0 -anchor n -font "-family {new century schoolbook} -size 16 -weight bold"\ -fill \#d3513d -text "Version 1.3" -tags text RamDebugger::AboutMoveCanvas $w.c 0 set data { tkcon "Jeffrey Hobbs" BSD SLIGHTLY comm "Open Group Res. Ins." BSD YES BWidgets "Unifix" BSD YES dialogwin RAMSAN BSD NO helpviewer RAMSAN BSD NO supergrid RAMSAN BSD NO supertext "Bryan Oakley" "FREE SOFT" YES tablelist "Csaba Nemethi" "FREE SOFT" NO "visual regexp" "Laurent Riesterer" GPL NO Tkhtml "D. Richard Hipp" LGPL NO tcllib Many BSD NO icons "Adrian Davis" BSD NO } foreach "pack author lic mod" $data { $w.lf.lb insert end [list $pack $author $lic $mod] } } proc RamDebugger::AboutMoveCanvas { c t } { if { ![winfo exists $c] } { return } set w [winfo width $c] set h [winfo height $c] set x [expr $w/2*(1.0-sin($t))] set y [expr $h/2*(cos($t)+1)] $c coords text $x $y set t [expr $t+.2] after 100 [list RamDebugger::AboutMoveCanvas $c $t] } proc RamDebugger::MotionInAbout { but } { if { ![winfo exists $but] } { return } set w [winfo toplevel $but] while 1 { if { ![winfo exists $but] } { return } set x [expr [winfo pointerx $w]-[winfo rootx $w]] set y [expr [winfo pointery $w]-[winfo rooty $w]] set x1 [expr [winfo rootx $but]-[winfo rootx $w]] set y1 [expr [winfo rooty $but]-[winfo rooty $w]] set x2 [expr $x1+[winfo width $but]] set y2 [expr $y1+[winfo height $but]] if { $x < $x1-2 || $x > $x2+2 || $y < $y1-2 || $y > $y2+2 } { return } set xmax [winfo width $w] set ymax [winfo height $w] if { $x < ($x1+$x2)/2 } { set newx [expr $x1+int((rand()-.2)*5.1)] } else { set newx [expr $x1+int((rand()-.8)*5.1)] } if { $newx < 0 } { set newx 0 } if { $newx > $xmax-[winfo width $but] } { set newx [expr $xmax-[winfo width $but]] } if { $y < ($y1+$y2)/2 } { set newy [expr $y1+int((rand()-.2)*5.1)] } else { set newy [expr $y1+int((rand()-.8)*5.1)] } if { $newy < 0 } { set newy 0 } if { $newy > $ymax-[winfo height $but] } { set newy [expr $ymax-[winfo height $but]] } place $but -in $w -x $newx -y $newy -anchor nw update } } ################################################################################ # GotoLine ################################################################################ proc RamDebugger::GotoLine {} { variable text set f [DialogWin::Init $text "Goto line" separator ""] set w [winfo toplevel $f] label $f.l -text "Go to line:" -grid "0 px3 py5" SpinBox $f.sb -range "1 1000 1" -textvariable DialogWin::user(line) \ -width 8 -grid "1 px3" checkbutton $f.cb1 -text "Relative to current line" -variable DialogWin::user(relative) \ -grid "0 2 w" set DialogWin::user(relative) 0 tkTabToWindow $f.sb bind $w <Return> "DialogWin::InvokeOK" supergrid::go $f set action [DialogWin::CreateWindow] while 1 { switch $action { 0 { DialogWin::DestroyWindow return } 1 { set line $DialogWin::user(line) set good 1 if { ![string is integer -strict $line] } { WarnWin "Line number must be a positive number" $w set good 0 } if { $good && $DialogWin::user(relative) } { set insline [scan [$text index insert] %d] set lastline [scan [$text index end-1c] %d] set line [expr $insline+$line] if { $line < 1 || $line > $lastline } { WarnWin "Trying to go to line $line. Out of limits" $w set good 0 } } if { $good } { set lastline [scan [$text index end-1c] %d] if { $line < 1 } { set line 1 } if { $line > $lastline } { set line $lastline } $text mark set insert $line.0 $text see $line.0 focus $text DialogWin::DestroyWindow return } } } set action [DialogWin::WaitForWindow] } } ################################################################################ # DebugCplusPlus ################################################################################ proc RamDebugger::DebugCplusPlusWindow { { tryautomatic 0 } } { variable text variable options if { ![info exists options(debugcplusplus)] } { set options(debugcplusplus) "" } set exes "" set dirs "" set args "" foreach "exe dir arg" $options(debugcplusplus) { lappend exes $exe lappend dirs $dir lappend args $arg } set exe "" foreach "exe dir args" [cproject::GiveDebugData] break if { $tryautomatic && $exe != "" } { set found 0 set ipos 0 foreach "exe_in dir_in args_in" $options(debugcplusplus) { if { $exe == $exe_in && $dir == $dir_in && $args == $args_in } { set found 1 break } incr ipos 3 } if { $found && $ipos != 0 } { set options(debugcplusplus) [lreplace $options(debugcplusplus) $ipos \ [expr $ipos+2]] } if { !$found || $ipos != 0 } { set options(debugcplusplus) [linsert $options(debugcplusplus) 0 \ $exe $dir $args] } rdebug -debugcplusplus [list $exe $dir $args] return } if { $tryautomatic && $options(debugcplusplus) != "" } { rdebug -debugcplusplus [lrange $options(debugcplusplus) 0 2] return } set f [DialogWin::Init $text "Debug c++" separator ""] set w [winfo toplevel $f] label $f.l -text "Program to debug:" -grid "0 e px3 py5" ComboBox $f.cb1 -textvariable DialogWin::user(executable) -width 40 -grid 1 -values \ $exes Button $f.b1 -image [Bitmap::get file] -width 16 -grid 2 -relief link label $f.l2 -text "Directory:" -grid "0 e px3 py5" ComboBox $f.cb2 -textvariable DialogWin::user(directory) -width 40 -grid "1" -values \ $dirs Button $f.b2 -image [Bitmap::get folder] -grid 2 -relief link label $f.l3 -text "Arguments:" -grid "0 e" ComboBox $f.cb3 -textvariable DialogWin::user(arguments) -width 40 -grid "1 2" -values \ $args set comm { set DialogWin::user(executable) [tk_getOpenFile -filetypes {{{All Files} *}} \ -initialdir $RamDebugger::options(defaultdir) -initialfile \ $DialogWin::user(executable) -parent PARENT -title "Debug executable"] } set comm [string map [list PARENT $w] $comm] $f.b1 configure -command $comm set comm { set initial $RamDebugger::options(defaultdir) catch { set initial [file dirname $DialogWin::user(executable)] } set DialogWin::user(directory) [RamDebugger::filenormalize [tk_chooseDirectory \ -initialdir $initial -parent PARENT \ -title "Debug directory" -mustexist 1]] } set comm [string map [list PARENT $w] $comm] $f.b2 configure -command $comm if { [info exists options(debugcplusplus)] } { set DialogWin::user(executable) [lindex $options(debugcplusplus) 0] set DialogWin::user(directory) [lindex $options(debugcplusplus) 1] set DialogWin::user(arguments) [lindex $options(debugcplusplus) 2] } tkTabToWindow $f.cb1 bind $w <Return> "DialogWin::InvokeOK" supergrid::go $f set action [DialogWin::CreateWindow] while 1 { switch $action { 0 { DialogWin::DestroyWindow return } 1 { set found 0 set ipos 0 foreach "exe dir args" $options(debugcplusplus) { if { $exe == $DialogWin::user(executable) && \ $dir == $DialogWin::user(directory) && \ $args == $DialogWin::user(arguments) } { set found 1 break } incr ipos 3 } if { $found && $ipos != 0 } { set options(debugcplusplus) [lreplace $options(debugcplusplus) $ipos \ [expr $ipos+2]] } if { !$found || $ipos != 0 } { set options(debugcplusplus) [linsert $options(debugcplusplus) 0 \ $DialogWin::user(executable) $DialogWin::user(directory) \ $DialogWin::user(arguments)] } rdebug -debugcplusplus [list $DialogWin::user(executable) \ $DialogWin::user(directory) $DialogWin::user(arguments)] DialogWin::DestroyWindow return } } set action [DialogWin::WaitForWindow] } } ################################################################################ # DebugCplusPlus ################################################################################ proc RamDebugger::DebugCurrentFileArgsWindow {} { variable text variable options variable currentfile if { $currentfile == "" } { WarnWin "Error. there is no current file" return } if { [regexp {\.(h|c|cc)$} $currentfile] } { WarnWin "Current file is not TCL" return } if { ![info exists options(currentfileargs)] } { set options(currentfileargs) "" } set dir [file dirname $currentfile] set arg "" set currs "" set dirs "" set args "" foreach "curr dir_in arg_in" $options(currentfileargs) { if { $curr == $currentfile } { set dir $dir_in set arg $arg_in } lappend currs $curr lappend dirs $dirs lappend args $args } set f [DialogWin::Init $text "TCL Execution arguments" separator [list Clear]] set w [winfo toplevel $f] label $f.l -text "Currentfile to debug:" -grid "0 e px3 py5" ComboBox $f.cb1 -textvariable DialogWin::user(curr) -width 40 -grid 1 -values \ $currs Button $f.b1 -image [Bitmap::get file] -width 16 -grid 2 -relief link label $f.l2 -text "Directory:" -grid "0 e px3 py5" ComboBox $f.cb2 -textvariable DialogWin::user(directory) -width 40 -grid "1" -values \ $dirs Button $f.b2 -image [Bitmap::get folder] -grid 2 -relief link label $f.l3 -text "Arguments:" -grid "0 e" ComboBox $f.cb3 -textvariable DialogWin::user(arguments) -width 40 -grid "1 2" -values \ $args set DialogWin::user(curr) $currentfile set DialogWin::user(directory) $dir set DialogWin::user(arguments) $arg set comm { set initial $RamDebugger::options(defaultdir) catch { set initial [file dirname $DialogWin::user(curr)] } set DialogWin::user(curr) [tk_getOpenFile -filetypes {{{TCL Scripts} {.tcl} }{{All Files} *}} \ -initialdir $initial -parent PARENT -title "Debug TCL file"] } set comm [string map [list PARENT $w] $comm] $f.b1 configure -command $comm set comm { set initial $RamDebugger::options(defaultdir) catch { set initial [file dirname $DialogWin::user(curr)] } set DialogWin::user(directory) [RamDebugger::filenormalize [tk_chooseDirectory \ -initialdir $initial -parent PARENT \ -title "Debug directory" -mustexist 1]] } set comm [string map [list PARENT $w] $comm] $f.b2 configure -command $comm tkTabToWindow $f.cb1 bind $w <Return> "DialogWin::InvokeOK" supergrid::go $f set action [DialogWin::CreateWindow] while 1 { switch $action { 0 { DialogWin::DestroyWindow return } 1 - 2 { if { $action == 2 } { set DialogWin::user(directory) "" set DialogWin::user(arguments) "" } set ipos 0 foreach "curr dir args" $options(currentfileargs) { if { $curr == $DialogWin::user(curr) } { set options(currentfileargs) [lreplace $options(currentfileargs) $ipos \ [expr $ipos+2]] break } incr ipos 3 } if { $DialogWin::user(directory) != "" || $DialogWin::user(arguments) != "" } { lappend options(currentfileargs) $DialogWin::user(curr) \ $DialogWin::user(directory) $DialogWin::user(arguments) } DialogWin::DestroyWindow return } } set action [DialogWin::WaitForWindow] } } ################################################################################ # Compile ################################################################################ proc RamDebugger::Compile { name } { variable text variable mainframe variable MainDir $mainframe setmenustate debugentry disabled set dir [file dirname $name] set pwd [pwd] cd $dir if { [regexp {\.(c|cc)$} $name] } { if { [auto_execok gcc] == "" } { $mainframe setmenustate debug normal cd $pwd set ret [DialogWin::messageBox -default yes -icon question -message \ "Could not find command 'gcc'. Do you want to see the help?" -parent $text \ -title "Command not found" -type yesno] if { $ret == "yes" } { RamDebugger::ViewHelpFile "01RamDebugger/RamDebugger_12.html" } return } set comm "gcc -c -I$dir $name" set commS "gcc -c -I$dir $name" } elseif { [regexp {Makefil.*[^~]$} $name] } { $mainframe setmenustate debug normal if { [auto_execok make] == "" } { cd $pwd set ret [DialogWin::messageBox -default yes -icon question -message \ "Could not find command 'make'. Do you want to see the help?" -parent $text \ -title "Command not found" -type yesno] if { $ret == "yes" } { RamDebugger::ViewHelpFile "01RamDebugger/RamDebugger_12.html" } return } set comm "make -f $name" set commS "make -f $name" } # if {$::tcl_platform(platform) == "windows" && \ # [info exists ::env(COMSPEC)]} { # set comm "[file join $::env(COMSPEC)] /c $comm" # } if { $::tcl_platform(platform) == "windows" } { set cat [file join $MainDir addons cat.exe] } else { set cat cat } set fin [open "|$comm |& $cat" r] fconfigure $fin -blocking 0 fileevent $fin readable [list RamDebugger::CompileFeedback $fin $name] cd $pwd TextCompClear TextCompRaise TextCompInsert "[string repeat - 20]Compiling [file tail $name][string repeat - 20]\n" TextCompInsert "--> $commS\n" update } proc RamDebugger::CompileFeedback { fin name } { variable text variable mainframe if { [eof $fin] } { if { $name != "" } { TextCompInsert "End compilation of [file tail $name]\n" TextCompRaise } set err [catch { close $fin } errstring] $mainframe setmenustate debugentry normal if { $err } { TextCompInsert $errstring\n TextCompRaise set cproject::compilationstatus 1 } else { set cproject::compilationstatus 0 } return } gets $fin aa if { $aa != "" } { TextCompInsert $aa\n update } } ################################################################################ # SearchInFiles ################################################################################ proc RamDebugger::FindFilesWithPattern { dir patternlist recurse } { set retval [eval glob -nocomplain -dir [list $dir] -types f -- $patternlist] if { $recurse } { foreach i [glob -nocomplain -dir $dir -type d *] { set retval [concat $retval [FindFilesWithPattern $i $patternlist $recurse]] } } return $retval } proc RamDebugger::SearchInFilesDo {} { variable options variable MainDir if { $::tcl_platform(platform) == "windows" } { set grep [file join $MainDir addons grep.exe] } else { set grep grep } set comm "\"$grep\" -ns " switch -- $::RamDebugger::searchmode { -exact { append comm "-F " } -regexp { append comm "-E " } } if { !$::RamDebugger::searchcase } { append comm "-i " } append comm "\"$RamDebugger::searchstring\" " set patternlist [regexp -inline -all {[^\s,;]+} $RamDebugger::searchextensions] set files [FindFilesWithPattern $RamDebugger::searchdir $patternlist \ $RamDebugger::searchrecursedirs] if { [llength $files] == 0 } { TextOutClear TextOutInsert "No files found" TextOutRaise return } append comm "\"[join $files {" "}]\"" set fin [open "|$comm" r] set result "" while { ![eof $fin] } { append result [gets $fin]\n } set err [catch { close $fin } errstring] if { [string trim $result] == "" } { set result "Nothing found" } TextOutClear TextOutInsert $result TextOutRaise foreach "i j search" [list texts RamDebugger::searchstring lsearch \ exts RamDebugger::searchextensions lsearchfile \ dirs RamDebugger::searchdir lsearchfile] { set ipos [$search $options(SearchInFiles,$i) [set $j]] if { $ipos != -1 } { set options(SearchInFiles,$i) [lreplace $options(SearchInFiles,$i) $ipos $ipos] } set options(SearchInFiles,$i) [linsert $options(SearchInFiles,$i) 0 [set $j]] if { [llength $options(SearchInFiles,$i)] > 6 } { set options(SearchInFiles,$i) [lreplace $options(SearchInFiles,$i) 6 end] } } } proc RamDebugger::SearchInFiles {} { variable options variable text set txt [GetSelOrWordInIndex insert] set f [DialogWin::Init $text "Search in files" separator] set w [winfo toplevel $f] if { ![info exists options(SearchInFiles,texts)] } { set options(SearchInFiles,texts) "" set options(SearchInFiles,exts) "" set options(SearchInFiles,dirs) "" } label $f.l1 -text "Text:" -grid 0 ComboBox $f.e1 -textvariable ::RamDebugger::searchstring -grid "1 2 px3 py3" \ -values $options(SearchInFiles,texts) -width 30 if { [string trim $txt] != "" } { set ::RamDebugger::searchstring $txt } else { set ::RamDebugger::searchstring [lindex $options(SearchInFiles,texts) 0] } label $f.l2 -text "File ext:" -grid 0 ComboBox $f.e2 -textvariable ::RamDebugger::searchextensions -grid "1 2 px3 py3" \ -values [concat $options(SearchInFiles,exts) [list "*.tcl" "*.h,*.cc,*.c"]] set ::RamDebugger::searchextensions [lindex [$f.e2 cget -values] 0] label $f.l3 -text "Directory:" -grid 0 ComboBox $f.e3 -textvariable ::RamDebugger::searchdir -grid "1 1 px3 py3" \ -values $options(SearchInFiles,dirs) Button $f.b3 -image [Bitmap::get folder] -relief link -grid "2" set comm { set initial $::RamDebugger::searchdir set ::RamDebugger::searchdir [RamDebugger::filenormalize [tk_chooseDirectory \ -initialdir $initial -parent PARENT \ -title "Search directory" -mustexist 1]] } set comm [string map [list PARENT $w] $comm] $f.b3 configure -command $comm set ::RamDebugger::searchdir $options(defaultdir) set f1 [frame $f.f1 -bd 0 -grid "0 3 w"] set f2 [frame $f1.f2 -bd 1 -relief ridge -grid "0 w px3"] radiobutton $f2.r1 -text Exact -variable ::RamDebugger::searchmode \ -value -exact -grid "0 w" radiobutton $f2.r2 -text Regexp -variable ::RamDebugger::searchmode \ -value -regexp -grid "0 w" set f3 [frame $f1.f3 -grid "1 w"] checkbutton $f3.cb1 -text "Consider case" -variable ::RamDebugger::searchcase \ -grid 0 checkbutton $f3.cb2 -text "Recurse dirs" -variable ::RamDebugger::searchrecursedirs \ -grid 0 supergrid::go $f set ::RamDebugger::searchmode -exact set ::RamDebugger::searchcase 0 set ::RamDebugger::searchrecursedirs 1 tkTabToWindow $f.e1 bind $w <Return> "DialogWin::InvokeOK" set action [DialogWin::CreateWindow] switch $action { 0 { DialogWin::DestroyWindow return } 1 { if { $::RamDebugger::searchstring == "" } { DialogWin::DestroyWindow return } DialogWin::DestroyWindow update SearchInFilesDo return } } } ################################################################################ # Search ################################################################################ proc RamDebugger::SearchWindow {} { variable text variable options if { ![info exists options(old_searchs)] } { set options(old_searchs) "" } set f [DialogWin::Init $text "Search" separator] set w [winfo toplevel $f] label $f.l1 -text "Text:" -grid 0 ComboBox $f.e1 -textvariable ::RamDebugger::searchstring -values $options(old_searchs) \ -grid "1 2 px3 py3" set f2 [frame $f.f2 -bd 1 -relief ridge -grid "0 2 w px3"] radiobutton $f2.r1 -text Exact -variable ::RamDebugger::searchmode \ -value -exact -grid "0 w" radiobutton $f2.r2 -text Regexp -variable ::RamDebugger::searchmode \ -value -regexp -grid "0 w" set f25 [frame $f.f25 -bd 1 -relief ridge -grid "2 w px3"] radiobutton $f25.r1 -text Forward -variable ::RamDebugger::SearchType \ -value -forwards -grid "0 w" radiobutton $f25.r2 -text Backward -variable ::RamDebugger::SearchType \ -value -backwards -grid "0 w" set f3 [frame $f.f3 -grid "0 3 w"] checkbutton $f3.cb1 -text "Consider case" -variable ::RamDebugger::searchcase \ -grid 0 checkbutton $f3.cb2 -text "From beginning" -variable ::RamDebugger::searchFromBegin \ -grid 1 supergrid::go $f set ::RamDebugger::searchstring [GetSelOrWordInIndex insert] set ::RamDebugger::searchmode -exact set ::RamDebugger::searchcase 0 set ::RamDebugger::searchFromBegin 0 set ::RamDebugger::SearchType -forwards tkTabToWindow $f.e1 bind $w <Return> "DialogWin::InvokeOK" set action [DialogWin::CreateWindow] switch $action { 0 { DialogWin::DestroyWindow return } 1 { if { $::RamDebugger::searchstring == "" } { DialogWin::DestroyWindow return } set ipos [lsearch $options(old_searchs) $::RamDebugger::searchstring] if { $ipos != -1 } { set options(old_searchs) [lreplace $options(old_searchs) $ipos $ipos] } set options(old_searchs) [linsert [lrange $options(old_searchs) 0 6] 0 \ $::RamDebugger::searchstring] if { $::RamDebugger::searchFromBegin } { if { $::RamDebugger::SearchType == "-forwards" } { set idx 1.0 } else { set idx [$text index end] } } else { set idx [$text index insert] } set ::RamDebugger::SearchIni $idx set ::RamDebugger::SearchPos $idx set ::RamDebugger::Lastsearchstring "" Search [winfo toplevel $text] any DialogWin::DestroyWindow } } } proc RamDebugger::Search { w { what {} } } { variable text if { ![winfo exists $w.search] && $what != "any" } { entry $w.search -width 25 -textvariable RamDebugger::searchstring place $w.search -in $w -x 0 -rely 1 -y -1 -anchor sw focus $text bindtags $text [linsert [bindtags $text] 0 $w.search] bind $w.search <FocusOut> "destroy $w.search ; break" bind $w.search <Escape> "destroy $w.search ; break" bind $w.search <KeyPress> [list if { [string is wordchar %A] || [string is punct %A] \ || [string is space %A] } \ "tkEntryInsert $w.search %A ; break" else "destroy $w.search ; break"] bind $w.search <Delete> "$w.search delete insert ; break" bind $w.search <BackSpace> "tkEntryBackspace $w.search ; break" bind $w.search <1> "destroy $w.search ; break" bind $w.search <3> "destroy $w.search ; break" bind $w.search <Return> "destroy $w.search ; break" bind $w.search <Control-i> "RamDebugger::Search $w iforward ; break" bind $w.search <Control-r> "RamDebugger::Search $w ibackward ; break" bind $w.search <Control-g> "RamDebugger::Search $w stop ; break" trace var RamDebugger::searchstring w "RamDebugger::Search $w ;#" bind $w.search <Destroy> [list trace vdelete RamDebugger::searchstring w \ "RamDebugger::Search $w ;#"] bind $w.search <Destroy> "+ [list bindtags $text [lreplace [bindtags $text] 0 0]] ; break" foreach i [bind Text] { if { [bind $w.search $i] == "" } { if { [string match *nothing* [bind Text $i]] } { bind $w.search $i [bind Text $i] } else { bind $w.search $i "destroy $w.search" } } } set idx [$text index insert] if { $idx == "" } { set idx 1.0 } set ::RamDebugger::SearchIni $idx set ::RamDebugger::SearchPos $idx set ::RamDebugger::searchcase -1 set ::RamDebugger::searchmode -exact set ::RamDebugger::Lastsearchstring "" set ::RamDebugger::searchstring "" } switch $what { iforward { set ::RamDebugger::SearchType -forwards } ibackward { set ::RamDebugger::SearchType -backwards } any { if { ![info exists ::RamDebugger::Lastsearchstring] } { WarnWin "Before using 'Continue search', use 'Search'" $w return } } stop { destroy $w.search return } } if { $RamDebugger::searchstring != "" || $RamDebugger::Lastsearchstring != "" } { if { $RamDebugger::SearchType == "-forwards" } { set stopindex end } else { set stopindex 1.0 } if { $RamDebugger::searchstring == $RamDebugger::Lastsearchstring } { set len [string length $RamDebugger::searchstring] if { $RamDebugger::SearchType == "-forwards" } { set idx [$text index $RamDebugger::SearchPos+${len}c] } else { set idx [$text index $RamDebugger::SearchPos-${len}c] } } elseif { [string length $RamDebugger::searchstring] < \ [string length $RamDebugger::Lastsearchstring] } { set idx $RamDebugger::SearchIni } else { set idx $RamDebugger::SearchPos } set options $RamDebugger::SearchType lappend options $::RamDebugger::searchmode if { $::RamDebugger::searchcase == 1 } { # nothing } elseif { $::RamDebugger::searchcase == 0 } { lappend options -nocase } elseif { $RamDebugger::searchstring == [string tolower $RamDebugger::searchstring] } { lappend options -nocase } lappend options -- set idx [eval $text search $options [list $RamDebugger::searchstring] \ $idx $stopindex] if { $idx == "" } { bell if { $RamDebugger::SearchType == "-forwards" } { set RamDebugger::SearchPos 1.0 } else { set RamDebugger::SearchPos end } } else { set RamDebugger::SearchPos $idx set len [string length $RamDebugger::searchstring] if { $RamDebugger::SearchType == "-forwards" } { set idx2 [$text index $RamDebugger::SearchPos+${len}c] } else { set idx2 $RamDebugger::SearchPos set RamDebugger::SearchPos [$text index $RamDebugger::SearchPos+${len}c] } set ed [$text cget -editable] $text conf -editable 1 $text tag remove sel 1.0 end if { $RamDebugger::SearchType == "-forwards" } { $text tag add sel $RamDebugger::SearchPos $idx2 } else { $text tag add sel $idx2 $RamDebugger::SearchPos } $text conf -editable $ed $text mark set insert $idx2 $text see $RamDebugger::SearchPos } set RamDebugger::Lastsearchstring $RamDebugger::searchstring } } ################################################################################ # OpenProgram OpenConsole ################################################################################ proc RamDebugger::OpenProgram { what } { variable MainDir switch $what { visualregexp { set file [file join $MainDir addons visual_regexp-2.2 visual_regexp.tcl] } tkcvs { set file [file join $MainDir addons tkcvs bin tkcvs.tcl] } tkdiff { set file [file join $MainDir addons tkcvs bin tkdiff.tcl] } } if { [interp exists $what] } { interp delete $what } interp create $what interp alias $what exit "" interp delete $what $what eval [list load {} Tk] $what eval { set argc 0 ; set argv "" } $what eval [list source $file] } proc RamDebugger::OpenConsole {} { variable MainDir set tkcon [file join $MainDir addons tkcon tkcon.tcl] if { $tkcon == "" } { WarnWin "Could not find tkcon" return } set tkconprefs { if { $::tcl_platform(platform) == "windows" } { tkcon font "MS Sans Serif" 8 } else { tkcon font "new century schoolbook" 12 } # Keep 50 commands in history set ::tkcon::OPT(history) 50 set ::tkcon::OPT(buffer) 5000 # Use a pink prompt set ::tkcon::COLOR(prompt) red # set tkcon(autoload) "Tk" set ::tkcon::OPT(cols) 80 set ::tkcon::OPT(rows) 24 set ::tkcon::OPT(gc-delay) 0 #set tkcon(cols) 60 #set tkcon(rows) 18 catch [list namespace import RamDebugger::*] puts "Welcome to Ramdebugger inside tkcon. Use 'rhelp' for help" } if { [winfo exists .tkcon] } { destroy .tkcon } set argv [list -rcfile "" -exec "" -root .tkcon -eval $tkconprefs] uplevel \#0 [list source $tkcon] uplevel \#0 ::tkcon::Init $argv proc ::tkcon::FinalExit { args } { destroy .tkcon } } ################################################################################ # DoinstrumentThisfile ################################################################################ proc RamDebugger::DoinstrumentThisfile { file } { variable text variable options variable WindowFilesList if { ![info exists options(instrument_source)] } { set options(instrument_source) auto } if { $options(instrument_source) == "auto" } { set file [filenormalize $file] if { [lsearch $WindowFilesList $file] != -1 || [GiveInstFile $file 1 P] != "" } { return 1 } else { return 0 } } elseif { $options(instrument_source) == "always" } { return 1 } elseif { $options(instrument_source) == "never" } { return 0 } set f [DialogWin::Init $text "Debugged program source" separator "" - OK] set w [winfo toplevel $f] label $f.l1 -text "The debugged program is trying to source file:" -grid "0 nw" set fname $file if { [string length $fname] > 60 } { set fname ...[string range $fname end-57 end] } label $f.l2 -text $fname -width 60 -grid "0 nw px8" label $f.l3 -text "What do you want to do?" -grid "0 nw" set f1 [frame $f.f1 -grid 0] radiobutton $f1.r1 -text "Instrument this file" -grid "0 w" -var DialogWin::user(opt) \ -value thisfile radiobutton $f1.r2 -text "Instrument all files" -grid "0 w" -var DialogWin::user(opt) \ -value always radiobutton $f1.r3 -text "Do not instrument this file" -grid "0 w" -var DialogWin::user(opt) \ -value thisfileno radiobutton $f1.r4 -text "Do not instrument any file" -grid "0 w" -var DialogWin::user(opt) \ -value never radiobutton $f1.r5 -text "Instrument only load files (auto)" -grid "0 w" -var DialogWin::user(opt) \ -value auto if { $options(instrument_source) == "ask_yes" } { set DialogWin::user(opt) thisfile } else { set DialogWin::user(opt) thisfileno } label $f.l4 -text "Check preferences to change these options" -grid "0 nw" supergrid::go $f bind $w <Return> DialogWin::InvokeCancel DialogWin::FocusCancel set action [DialogWin::CreateWindow] DialogWin::DestroyWindow switch $DialogWin::user(opt) { thisfile { set options(instrument_source) ask_yes return 1 } thisfileno { set options(instrument_source) ask_no return 0 } } set options(instrument_source) $DialogWin::user(opt) if { $options(instrument_source) == "auto" } { set file [filenormalize $file] if { [lsearch $WindowFilesList $file] != -1 || [GiveInstFile $file 1 P] != "" } { return 1 } else { return 0 } } elseif { $options(instrument_source) == "always" } { return 1 } elseif { $options(instrument_source) == "never" } { return 0 } } |
Added scripts/Images.tcl.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 |
proc RamDebugger::CreateImages {} { variable images set images(break) [image create photo -data { R0lGODlhCwALAIQAAMQ4OMQ6OsZBQchGRsZCQslLS9NsbNd7e9RubspNTcU6 OuKfn+q5ueOiotRvb8dDQ/Xd3eu8vNl/f8lJSeSlpdVxccpPT/////////// /////////////////////////yH5BAEKAB8ALAAAAAALAAsAAAU94CcCJCme ZYoCgTAQgUkGhXEgiZIKxsI0jkdqcGBAIpJJioBoRCgVIeDDSjgkFYtuSlI8 Jo/tKjU9jUqnEAA7 }] set images(arrow) [image create photo -data { R0lGODlhCwALAIQAAM/Ptbq6ltjYw8zMsb6+nby8ma2thLa2kd7ezb6+nKys ga2tgrOzjM3Ns8DAn729m66uhLe3kt/fzrq6l9nZxdDQt/////////////// /////////////////////////yH5BAEKAB8ALAAAAAALAAsAAAUn4CeOZGme H4CKgTAOREwUxoGIiaLvC6N8DYfQ8YBEJKgJZVVZOU0hADs= }] set images(arrowbreak) [image create photo -data { R0lGODlhCwALAKUAAMQ4OMQ6OsZBQchGRsZCQs/PtclLS9NsbNd7e9Rubrq6 ltjYw8zMsb6+nby8ma2thLa2kd7ezb6+nKysga2tgrOzjM3Ns8DAn729m66u hLe3kt/fzspNTdRvb9l/f9Vxcbq6l9nZxcU6OsdDQ8lJSdDQt/////////// //////////////////////////////////////////////////////////// /////////////////////////////////yH5BAEKAD8ALAAAAAALAAsAAAZF wJ8QQCQKj8UkEhAQDAgFIzFgOCASikWR0eg2HA9IhCiZmM+UygRgubgvmIxm A/gxOR3PBxSSAkQjJCMlRkNJhUd2RUdBADs= }] set images(blank) [image create photo -data { R0lGODlhCwALAIAAAP///////yH5BAEKAAEALAAAAAALAAsAAAIKjI+py+0P o5yhAAA7 }] set images(file_blue) [image create photo -data { R0lGODlhCwANAKEAAAAAAFl48v///////yH5BAEAAAMALAAAAAALAA0AAAIh nI8Gy3sQogRCyelgmwNeri0X0H1g0HikZ67ohpZmnKYFADs= }] set images(file_magenta) [image create photo -data { R0lGODlhCwANAKEAAAAAANw35f///////yH5BAEAAAMALAAAAAALAA0AAAIh nI8Gy3sQogRCyelgmwNeri0X0H1g0HikZ67ohpZmnKYFADs= }] set images(file_yellow) [image create photo -data { R0lGODlhCwANAKEAAAAAAOi/PP///////yH5BAEAAAMALAAAAAALAA0AAAIh nI8Gy3sQogRCyelgmwNeri0X0H1g0HikZ67ohpZmnKYFADs= }] image create photo filenew16 -data { R0lGODlhEAAQAIUAAPwCBFxaXNze3Ly2rJyanPz+/Ozq7GxqbPz6/GxubNTK xDQyNIyKhHRydERCROTi3PT29Pz29Pzy7PTq3My2pPzu5PTi1NS+rPTq5PTe zMyynPTm1Pz69OzWvMyqjPTu5PTm3OzOtOzGrMSehNTCtNS+tAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAZ/ QAAgQCwWhUhhQMBkDgKEQFIpKFgLhgMiOl1eC4iEYrtIer+MxsFRRgYe3wLk MWC0qXE5/T6sfiMSExR8Z1YRFRMWF4RwYIcYFhkahH6AGBuRk2YCCBwSFZgd HR6UgB8gkR0hpJsSGCAZoiEiI4QKtyQlFBQeHrVmC8HCw21+QQAh/mhDcmVh dGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAx OTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRl dmVsY29yLmNvbQA7 } image create photo fileopen16 -data { R0lGODlhEAAQAIUAAPwCBAQCBOSmZPzSnPzChPzGhPyuZEwyHExOTFROTFxa VFRSTMSGTPT29Ozu7Nze3NTS1MzKzMTGxLy6vLS2tLSytDQyNOTm5OTi5Ly+ vKyqrKSmpIyOjLR+RNTW1MzOzJyenGxqZBweHKSinJSWlExKTMTCxKyurGxu bBQSFAwKDJyanERCRERGRAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAaR QIBwGCgGhkhkEWA8HpNPojFJFU6ryitTiw0IBgRBkxsYFAiGtDodDZwPCERC EV8sEk0CI9FoOB4BEBESExQVFgEEBw8PFxcYEBIZGhscCEwdCxAPGA8eHxkU GyAhIkwHEREQqxEZExUjJCVWCBAZJhEmGRUnoygpQioZGxsnxsQrHByzQiJx z3EsLSwWpkJ+QQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9u IDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2 ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7 } image create photo folderopen16 -data { R0lGODlhEAAQAIYAAPwCBAQCBExKTBQWFOzi1Ozq7ERCRCwqLPz+/PT29Ozu 7OTm5FRSVHRydIR+fISCfMTCvAQ6XARqnJSKfIx6XPz6/MzKxJTa9Mzq9JzO 5PTy7OzizJSOhIyCdOTi5Dy65FTC7HS2zMzm7OTSvNTCnIRyVNza3Dw+PASq 5BSGrFyqzMyyjMzOzAR+zBRejBxqnBx+rHRmTPTy9IyqvDRylFxaXNze3DRu jAQ2VLSyrDQ2NNTW1NTS1AQ6VJyenGxqbMTGxLy6vGRiZKyurKyqrKSmpDw6 PDw6NAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAA LAAAAAAQABAAAAfCgACCAAECg4eIAAMEBQYCB4mHAQgJCgsLDAEGDQGIkw4P BQkJBYwQnRESEREIoRMUE6IVChYGERcYGaoRGhsbHBQdHgu2HyAhGSK6qxsj JCUmJwARKCkpKsjKqislLNIRLS4vLykw2MkRMRAGhDIJMzTiLzDXETUQ0gAG CgU2HjM35N3AkYMdAB0EbCjcwcPCDBguevjIR0jHDwgWLACBECRIBB8GJekQ MiRIjhxEIlBMFOBADR9FIhiJ5OnAEQB+AgEAIf5oQ3JlYXRlZCBieSBCTVBU b0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBB bGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20A Ow== } image create photo filesave16 -data { R0lGODlhEAAQAIUAAPwCBAQCBFRSVMTCxKyurPz+/JSWlFRWVJyenKSipJSS lOzu7ISChISGhIyOjHR2dJyanIyKjHx6fMzOzGRiZAQGBFxeXGRmZHRydGxq bAwODOTm5ExOTERGRExKTHx+fGxubNza3Dw+PDQ2NAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAaA QIAQECgOj0jBgFAoBpBHpaFAbRqRh0F1a30ClAhuNZHwZhViqgFhJizSjIZX QCAoHOKHYw5xRBiAElQTFAoVQgINFBYXGBkZFxYHGRqIDBQbmRwdHgKeH2Yg HpmkIR0HAhFeTqSZIhwCFIdIrBsjAgcPXlBERZ4Gu7xCRZVDfkEAIf5oQ3Jl YXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3Ig MTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5k ZXZlbGNvci5jb20AOw== } image create photo acttick16 -data { R0lGODlhEAAQAIIAAPwCBMT+xATCBASCBARCBAQCBEQCBAAAACH5BAEAAAAA LAAAAAAQABAAAAM2CLrc/itAF8RkdVyVye4FpzUgJwijORCGUhDDOZbLG6Nd 2xjwibIQ2y80sRGIl4IBuWk6Af4EACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYg UHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJp Z2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs= } image create photo edit16 -data { R0lGODlhEAAQAIYAAPwCBFxaVMR+RPzKjNze3AQCBMR6RPzGjPyODPz+/MzO zPyKDPyKBPz29OTWzPyGDPyGBOx6BOza1OR2BKROBNSOXKRKBBwOBOzu7PTW xPzizOySZPyCDFxaXOy2lNRyRMxmJCQOBPTm1OzStPTKrMR+XIRWLFxGNCQS BDQyNIRSNDQuJERGRLyqlNzSvIx6ZKRuVEw6LLSyrLymhKSShBwaFFROTJyW jMS+vNzW1OTazNzKrHRqXOzezOTOpPTq3OzWvOTStLyedMS+rLy2pMSynMSu lAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAA LAAAAAAQABAAAAewgAAAAYSFhoQCA4IBBI2OjgUGBwiLBAmXlpcKkgsMlZcJ BA0JDpIPEBGVjwkSBgOnExSfmBIVBxAMExYXswkYGRobHLq8gh2PHhoeHyAW IYKzIiMkJSYnKCnQg5YNHtQqKywtK9qMBC4vMDEBMjIz2dCMDTQ1Njc4OToz 5PEEOzw3ZPToMcLHO23HfogQ0QMIkCA+hPBbhAPHECJFjMyYIUQIvEUpUqwQ OXKkSEF+AgEAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAy LjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVk Lg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw== } image create photo actcross16 -data { R0lGODlhEAAQAIIAAASC/PwCBMQCBEQCBIQCBAAAAAAAAAAAACH5BAEAAAAA LAAAAAAQABAAAAMuCLrc/hCGFyYLQjQsquLDQ2ScEEJjZkYfyQKlJa2j7AQn MM7NfucLze1FLD78CQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJz aW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVz ZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7 } image create photo filenew22 -data { R0lGODlhFgAWAIUAAPwCBExOTERCRDw6PCwuLBwaHAwODAQCBOze1NTW1OTi 5Nze3MTGxLS2tJyanPz+/Ozu7OTi3BQSFCwqLDw+PDQyNFRSVPTu7MzKxLyy rIR+fCQmJPz6/NTOxPz69Pzy7PTu5Pz29Pzu5PTq5PTm1My6pBQWFPTq3PTm 3NS+rAwKDPTi1PTezOzWxMy2pPz27PTazOzSvMyynOzaxOzOtPTaxOzKrMyq jOzGpMymhPTizOTCpNzSzNTGvMymjMSihCH5BAEAAAAALAAAAAAWABYAAAbo QIBwSCwaiYGAYEAgFAqGg/Q4DCASCsTiymgcHAcqQLB4mM+QiIQBppLPcMjk wQ4bB2X4maKgt4sVCHpnFhQTElNFE3mDDxcYGRp2RBuMgxwIHX9EBZZwHh8g CBmTQ52NISEiIyQlpUImng8hHyInKAgprwAqgnC0IKwrLLpGB4wctLYkwy0u uwd9Z8AnJywsLcVFx2YcL7UnJCwwLTEy0GXJoSgrCCwzNDTnxgjeH9UrKzXw NDY36LRGhEOwLx4NHDmgJbh3QoeOgv127EhojEeHDj16pEhRQoZHHzl+QJNC sqTJSXaCAAAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIu NQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQu DQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7 } image create photo fileopen-22 -data { R0lGODlhFgAWAIYAAPwCBAQCBCQWDCwaDDwmFPSubPzGhPzCfPy2dOSmZPzK lPzSnPzOlPzKjBQODPzChPzWnPy2bPSmXPyuZOyeXIRSLEQuFEwyHEQqFDQi FCweDKRuPFRSTPT29PTy9Ozq7OTi3Nze3NTW1MzOzMTGxMTCxLy6tLSytKyu rDQyNMzKxOTm5OTi5Nza1NTS1MTCvLS2tLSyrKSmpJyenJSWlIyKjHx+fFxe XBwaHKxuPMzKzLy6vIyOjHx6fDw6NPy6dGxubLy+vISChCQmJNza3KyqrBQS FLR2RKSinJyanGxqZAwGBJSSlCwqLAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAA LAAAAAAWABYAAAf/gACCg4SFhoeDAYqKiIeLj4wBjQCMhY+NkoiLk5qbhQID oJyGBAUGBwgEo4MECQoLDA2pDrS1tKQPEAwHERITE77AvxKqhAQNDA8UFRYX Fs8YBAQZGqGPxw0RGxwdHR4eHyAhIiMkJSYnKCgpBAYPEhcqHyssLS4kLzAx MjM0NTY3cBA4UCAHBw8gVnhgEcKFjhc7UPDj0cMHAAI/KFgY4YLFio/jRpTY sW8GDyCSCEQw2DChOHIqgsCQSEPIEEEEJFhAoUNECCJEyOk4d6KIyRtGcB7h IJKjixEjHu4oimSGEIs4d8IIUoKECnNB0ElMwkNJJgBLlJBAcQKGiR07KGAU RVGViY0mhIwwSTKjr99+THjUoIg0r48hTRIrRtxkiOMhDgrZCQQAIf5oQ3Jl YXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3Ig MTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5k ZXZlbGNvci5jb20AOw== } image create photo filesave22 -data { R0lGODlhFgAWAIUAAPwCBGxqbAQCBLy+vERCRExKTHRydIyKjMTCxFxaXGRi ZFRSVFRWVPz6/Nze3Nzm5Pz+/JyanDw+PExOTHR2dMTGxBQWFLSytHx+fISC hOzy9Ly6vAQGBJSWlMzKzAwODJSSlHx6fIyOjOTi5DQ2NISGhGxubCwuLOzq 7ERGRFxeXNTW1CwqLPT29Dw6PGRmZKSmpAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAWABYAAAb/ QIBQGBAMj8ikUDAgFAzKKCBwQCQUCcICKh0SEAhGw5EIZAmBrgCxeDQgcDJW yz0GIggJfL+XGwQJRxNgC3yGDwwUFUZDFhdthnwMGAZNQwEZFwQakXANBBQb HIIdERIBnRAOiR4ERx8gsSEMBBmGCyEGG3YGBwcgIr8UCwQHECOgG4xCtRkE JAvBJRklJgkSFBQeJ68hJiEoESkFKiEZIbkGARsLlwEGExENGhorGSkpFAYm 66NDLAECpGiBYsUIFA8wLHBBQMWLVkdUCFCwaYVFBOymkVCgYEMgOykEpICB ccMBAhhELFigTEqAAgIIwCiQ4eRKDyS6EAlJIAI0EpaudF4iIKDAAn9CkRT5 eMROEAAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0K qSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpo dHRwOi8vd3d3LmRldmVsY29yLmNvbQA7 } image create photo wizard-22 -data { R0lGODlhFgAWAIQAAPwCBNzaTPz6BAQCBPz+BExKBMzOTPz+rPz+3ISCBPTy hISCLISChPz+xOTiVPz+/MTCxKSipKyqrExOTDw+PDQyNAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAWABYAAAV+ICCOZAkE ZqoKqoqKAzHAb1sIxhAQwWAQhRaJd0AcdgkhqaBAOBUL5WjAaD6TUqog0DAi ldqcg+cDtgaPACTCiM0AOhV6sG4DWOAHnf2uyfV1b1lsgVIwEgwTFHaGA2yK FYJgiJCSQo6JFJGGcJSalkKPn5wimZukAJWoIgYhACH+aENyZWF0ZWQgYnkg Qk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5 OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3Iu Y29tADs= } image create photo actundo22 -data { R0lGODlhFgAWAIUAAPwCBCReDJzGjMzivOTu3PT69MTivHy+VJTWbIzKZEym JESmFESiHDyiHESqLAQCBFzKNGzWPFS2LNTmzCxqDDRqHPz+/KTGnBQqBAQO BAwaBESCHHy2XBxGDOzy7HTCTEyyJDSqFHzWTAwSBBQ6BIy+dESKJFySPFSS NAwiBCRGFBQmDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAWABYAAAal QIBwSCwaj8ikMsBkKotMwYAwEDiXgYLhwD0gCFZiQKxNKBYMRqPh+D6G16y5 AYnYIxBJAyF4AwITTAUJdBESD4gPFBV6Fn6ABBcJDIYPGEQZGhQbHAIdfx4J Hw2VSBodGwWfAR4LDSALfkgYAQurBiAhICKfSSMkvQElGyYnGyi9Rxkdj4nO skUYyU9FpxnURikdGtjRKivdRKfQ2Inh5+jpRwZBACH+aENyZWF0ZWQgYnkg Qk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5 OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3Iu Y29tADs= } image create photo editcut22 -data { R0lGODlhFgAWAIMAAPwCBAQCBAwCBPz+/OTi5JyanOzq7DQyNGxqbAAAAAAA AAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAWABYAAARbEMhJq704gxBE 0Bf3cZo4kRJqBQNRfBucyudgvJS6VaxLzyMa6/bLiWA9HOg4VIIkL5vzuRkc pkvRIIAorphJLzBW84WEuRZWp6uaT7J2Sh1Hit3OY/ZO7WvsEQAh/mhDcmVh dGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAx OTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRl dmVsY29yLmNvbQA7 } image create photo editcopy-22 -data { R0lGODlhFgAWAIUAAPwCBBQSFPz+/DQyNISChDw6PMzKzMTGxERGRIyKjFxa XMTCvKSmpHR2dPz6/Pz29PTq3MS2rPz69MTCxFxWVHx6dJyWjNzSzPz27Pzy 7Pzu5PTm3NTKvIR+fJyGfHxuZHxqXNTCtPTq5PTi1PTezNS+rExOTFRORMyy lPTaxOzWxOzSvNze3NTOxMy2nMyulMyqjAQCBAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAWABYAAAbY QIBwSCwahYGkUnk0BgTQ6IAQaBKfUWhBYKhaAU+CgXAQIAyChLeJzSIQhcH6 GFaM0QtGY5kstqEODw8QEQELAhJTc08KBBMEFBUWDRcBE1pca20SGBkaEBsc AY5maFRIAgoLHRQRHh8gIQFlZnByqA8ZGSIQIyQjJQEmYgJ5p2ACrK4gJx4g KIZZAgdeAQ4ZI9kjKSor0AwEjeAs1S0cHAslLi4vMDDRWeRIfEsxMeET4ATy VoYLC5fizXEiAR84BeMG+pEm8EsAFhAjSlR4hR6fLxiF0AkCACH+aENyZWF0 ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5 OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2 ZWxjb3IuY29tADs= } image create photo editpaste22 -data { R0lGODlhFgAWAIYAAPwCBBQWFDw6FHRuFGRaBFxSBAQCBAQKBCQiBIx6HPz6 /NTOfKyiXDQuFOTm5Pz+/Ozu7PTq5Pz63PTyxNTOjKSeRExGLMTGxMzKzNTS 1NTW1Dw2NKSmpKyqrKSipJyanNzWlLy6ZLSuVIx6FISChIyKhJSSlCQiJLS2 tDw6NDQyNCQiFCQmHBQSDGRiZHRydGxubHx6dGxqbFxeXGRmZFxaXCwuLOzq 7KyurHx+fDwmFEQuFCweFCQWDBQODBwaHBweHKSinJSWlOTi5JyepHR2dDw6 PBQSFNze3ERGRIyKjIyOjISGhPz29Pzy7MS2rMzOzFRWVHx2dHxybDQiFPz2 7Pzu5PTq3PTm1NTCtJyGdHxuZHxqXPzq3PTaxNS6pFxWVFRKRNS2nPTi1PTS tNSulNzOxNSynMymhAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAA LAAAAAAWABYAAAf/gACCgwABAgMEBYSLggaOjgcICQoLDA2Pj4MGDg8QEZ4F DxITFBUWFxcYGRobjQ8cHR4fCQ8gCyEiFSMWJCUkJieNEB4dKB4pKissK8wr LS4vMDHBAAYQHx8dFx0fJDIzNDU0M+IyHzaNNyg43Ng5Ojs7Ojw9Pj9AMkCN DiZB/h9CSOx4QLCgihItqBkYgqIDESElitAYWJCgkQcXjjRCgi1Ihw4BB5LA QOLCgyQYHihpUU3DBw5ElpAgAYNixSRJjKjQaECDCRPZPDB5IbIGSQwKLnh4 wbInLA4kmJB4oaPiAwVNnER40hRK1BIAaVatUZJEFCkmpmjgCeWDCalFe4q4 oFKwSRUrEa5gycLzwq8lUnPQ4PEgSpYcUZ5o2cIlS1O/JHLEDdfjQZMIVrpg weLFy5e+M6WSmBGlxYMYYBRzCaOFi5imHWBIfOEiShLTVjaP6eyFTBmN1TA5 OvLDjJksWb58OVMGDRqWjAYdmU79SIvpjqJr104nEAAh/mhDcmVhdGVkIGJ5 IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5 OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29y LmNvbQA7 } image create photo find-22 -data { R0lGODlhFgAWAIYAAPwCBBQSFJSWlFxaXJyanKy2tLzCxDw+PHyChNTa3Nzq 7Nz29NTy9Mzu9OT29Nzi5Oz6/Mzy9Kzi7Jze5Lze5Nzy9JyenIyKjHR2dMTu 9Kzm7JzW3ITW3ISChGxubERGROz+/Lzq9IzW5HzK1LTm7FRSVHTS3GS+zLTS 1DQ2NMzOzMTq7Lzq7ITW5FS2vMTi5ExOTKTm7EzCzEy2vEyutJTa5FTK1ESi rGy+zMzi5ESerESmtITa5OTy9KTe5KyqrAz+/Azi3ASutERCRExKTFRWVAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAA LAAAAAAWABYAAAf/gACCggGFhYOIAAIDiYUEBQYFAoeJAweKhAgJCgsLDA0O CAGJg4wBCA8QDhENEhMUFaKDFhcYgwEJCxAQDBkaGxwSFaMAFh0eAx8AAQIK ECAODCEaIiMjJJMAtQMlygEGEBkVva4mJycTKKMYJd0pyyoOKyssGhMtIycu Gi/EMB/vlhmoQEFDjHsmZMygUUMdqWUCGgCbYMKEjRk3cEjI9jBADg3Wzs3Q sYOHA2IdO1SQkI/GjRMtFhBA2RFBDwk+OASrMPMHkIe3AhBA8QLFzAAHgvyg 2dEQMSEHPCwltQgooSFSmVpSxKjjh6wPtwINgHVqsVpWESEFeywZ17RkED2s 40YEgFirlIq4SwvUQCAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVy c2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJl c2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw== } image create photo player_end-22 -data { R0lGODlhFgAWAIUAAPwCBDQyNFxeXAQCBMTCxGReZBQSFOzm7AwKDKymrJSS lFRSVCwqLLy6vPTy9OTe5Ozq7CQiJLSytOTi5BwaHPz+/HRydMzKzKSepJSO lKSipJyanIyGjIyKjKyurISGhMzGzJyWnHR2dISChIyOjLSutDw+PERCRHx6 fJSWlIR+hJyenGRmZHx2fAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAWABYAAAa6 QIBwSCwaj8ikMBBQKgOCgRMZIBSkxYHWoDVWD9EigpBQLLBERsPxCA8NDUhj gTBGJJNGG02RVBQWdUV3FxgZe0IGfoAGdhoXGxwdiAYef4FGFBoeHB8dGSBR ihUhIo1FBhkbIyMkJRYmAwYal4JEBh2RChIWJ1IIGxUZFqdECCgkHR6wWAYp FR2YWSobvL5vFgfDaEMDIivMRBEsD9HcQgMWvecDLB0tZ0btsfJa9vLXU/X6 /P3+b0EAACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41 DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4N Cmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs= } image create photo player_stop-22 -data { R0lGODlhFgAWAIUAAPwCBAQCBAwKDBQSFBwaHCQmJJSSlISChJSOlJSWlGxq bGRiZNTS1PTy9Pz+/Ozm7OTi5FRSVIyKjOTe5MTCxIR+hExOTHR2dLy6vLSy tLy2vHRydFxWXIyGjIyOjPz2/FRWVHx6fExKTMzOzJyanKSmpKyqrKSipAQG BLSutHx2fDw6PAwODAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAWABYAAAa1 QIBwSCwaj8ikcslsAgKCAWEQjQ4KgSwyYDAcugZEQqFYYJECA6PhaLcfEEUk gJZAGJB8fkKpWOhHAxcOGBQZGBoaGQgbHIBGAhUOGR0SBxISBh4Xf0iCHxQS lRIIXhsgj0UCIaCXmJgHGyKpRJ+hmB5dHQqOaCENIx0epBIkBhdzngoPGCQl JifQJBvJRygRKRcKGxcXGypys1srEREc5SLnICLiR1koLFVUWfRO9vf4+Uwy QQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBE ZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRw Oi8vd3d3LmRldmVsY29yLmNvbQA7 } image create photo finish-22 -data { R0lGODlhFgAWAIUAAPwCBAw2VAQCBBxCXDR+nIS21Aw+XJTC1Nzu/KzO3Pz+ /Nzq9Pz6/MTe7KTW5FzC1Nzu9CRKZMzi7IzK3Lzi7LTe7HzG3Gy+3AyuzAye xFzC3DRSbHy+1Dy61CSqzAySvAyStLze7IzO5AyGrEze7BRmjCTC1ETS3ETa 5BTC3Bx2nAyWvAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAWABYAAAak QIBwSCwaj8hkMqBsBgTN5IAAJQqqykCBasUmDQcEV3gtBs7oATihGJeJgcOC QWc0HA8Ig/seRiQTFAsVFhcYGRp6VH1CGwscHQ8dGB4fIBkPIWKMAAMLIiAj IJcgH5gkGSWcARIiJicoJikpHikoHqqrKiW8JSogKymoqgCrV8cCARgkuFWc RwYeqVjPRgEExEPVRQbZ2l5IBuBRQ0zk5+hRBkEAIf5oQ3JlYXRlZCBieSBC TVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4 LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5j b20AOw== } image create photo down-22 -data { R0lGODlhFgAWAIUAAPwCBAw2VCRKZDRSbBxCXJTC1Mzi7Nzq9NTm9Bx2nAQC BNzu9JzG3Hy+1HzG3IzO5BRmjPz6/LTe7Dy61AyStCTC1FzC1AyGrETS3ETC 1ETa5BRulAyuzBRylAw+XMTe7Gy+3CSqzAyexBTC3DR+nIS21KTW5Nzu/KzO 3FzC3Pz+/ByixEze7AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAWABYAAAaR QIBwSCwaj8ikcnkMBAQDgjPAFAYKhsMBkVBUAYEFo+F4QLzVQEQyoVTOX/XB csHA0+vMRbNBMwkRDhxuHX5GTlIeHh8gISIjFAEeiVRECiQlDAUmgxQjIhwi JHdFlycoKSIUFCEjGiGkRpcqCxYijxorsUezcxYsuoZJsxLAu0qXB7DCTJfH VQrMX9PU1Uh0QQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9u IDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2 ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7 } image create photo playeject16 -data { R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIbhI+py+0R 3IFQUtruXVqn3kkWyIARR4rqKvoFACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYg UHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJp Z2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs= } } |
Added scripts/Instrumenter.tcl.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 |
################################################################################ # RamDebugger::Instrumenter ################################################################################ namespace eval RamDebugger::Instrumenter { variable stack variable words variable currentword variable wordtype variable wordtypeline variable wordtypepos variable DoInstrument variable OutputType variable NeedsNamespaceClose variable braceslevel variable level variable colors } proc RamDebugger::Instrumenter::InitState {} { variable stack "" variable words "" variable currentword "" variable wordtype "" variable wordtypeline "" variable wordtypepos "" variable DoInstrument 0 variable OutputType variable NeedsNamespaceClose 0 variable braceslevel 0 variable level 0 variable colors foreach i [list return break while eval foreach for if else elseif error switch default \ continue] { set colors($i) magenta } foreach i [list variable set global] { set colors($i) green } } proc RamDebugger::Instrumenter::PushState { type line newblocknameP newblocknameR } { variable stack variable words variable currentword variable wordtype variable wordtypeline variable wordtypepos variable DoInstrument variable OutputType variable NeedsNamespaceClose variable braceslevel variable level set NewDoInstrument 0 if { $OutputType == "P" } { set NewOutputType PP } else { set NewOutputType $OutputType } set PushState 0 if { $type == "\[" } { set PushState 1 if { $DoInstrument == 1 } { set NewDoInstrument 1 } else { set NewDoInstrument 0 } } else { if { [lindex $words 0] == "proc" && [llength $words] == 3 } { set NewDoInstrument 1 } elseif { $DoInstrument == 0 } { if { [lindex $words 0] == "namespace" && [lindex $words 1] == "eval" && \ [llength $words] >= 3 } { set PushState 1 # if { $OutputType == "R" } { # upvar 2 $newblocknameP newblock # } else { upvar 2 $newblocknameR newblock } # append newblock "namespace eval [lindex $words 2] \{\n" # set NeedsNamespaceClose 1 } } elseif { $DoInstrument == 1 } { switch -- [lindex $words 0] { "if" { if { [llength $words] == 2 } { set NewDoInstrument 1 } elseif { [lindex $words end] == "then" || [lindex $words end] == "else" } { set NewDoInstrument 1 } elseif { [lindex $words end-1] == "elseif" } { set NewDoInstrument 1 } } "namespace" { if { [lindex $words 1] == "eval" && [llength $words] >= 3 } { set NewDoInstrument 1 if { $OutputType == "R" } { upvar 2 $newblocknameP newblockP append newblockP "namespace eval [lindex $words 2] \{\n" set NeedsNamespaceClose 1 } } } "catch" { if { [llength $words] == 1 } { set NewDoInstrument 1 } } "while" { if { [llength $words] == 2 } { set NewDoInstrument 1 } } "foreach" { if { [llength $words] >= 3 } { set NewDoInstrument 1 } } "for" { if { [llength $words] == 4 } { set NewDoInstrument 1 } } "eval" { set NewDoInstrument 1 } "uplevel" { set len [llength $words] if { [regexp {[\#]?[0-9]+} [lindex $words 1]] } { incr len -1 } if { $len > 0 } { set NewDoInstrument 1 } } "switch" { for { set i 1 } { $i < [llength $words] } { incr i } { if { [lindex $words $i] == "--" } { incr i break } elseif { ![string match -* [lindex $words $i]] } { break } } set len [expr [llength $words]-$i] if { $len == 1 } { set NewDoInstrument 2 } } } } elseif { $DoInstrument == 2 } { if { [llength $words]%2 } { set NewDoInstrument 1 } } } if { !$PushState && !$NewDoInstrument } { return 1 } incr level lappend stack [list $words $currentword $wordtype $wordtypeline \ $wordtypepos $DoInstrument $OutputType $NeedsNamespaceClose $braceslevel $line $type] set words "" set currentword "" set wordtype "" set wordtypeline "" set wordtypepos "" set DoInstrument $NewDoInstrument set OutputType $NewOutputType set NeedsNamespaceClose 0 set braceslevel 0 return 0 } proc RamDebugger::Instrumenter::PopState { type line newblocknameP newblocknameR } { variable stack variable wordtype variable words variable currentword variable wordtype variable wordtypeline variable wordtypepos variable DoInstrument variable OutputType variable NeedsNamespaceClose variable braceslevel variable level set lasttype [lindex [lindex $stack end] end] if { $type == "\]" && $lasttype != "\[" } { return 1 } if { $type == "\}" } { if { $wordtype == "w" } { set numopen 0 for { set i 0 } { $i < [string length $currentword] } { incr i } { switch -- [string index $currentword $i] { "\\" { incr i } \{ { incr numopen } \} { incr numopen -1 } } } if { $numopen } { return 1 } } if { $lasttype != "\{" } { foreach i $stack { if { [lindex $i end] == "\{" } { set text "Using a close brace (\}) in line $line when there is an open brace " append text "in line [lindex $i end-1] and an open bracket (\[) in line " append text "[lindex [lindex $stack end] end-1]" error $text } return 1 } } } foreach [list words currentword wordtype wordtypeline wordtypepos DoInstrument OutputType \ NeedsNamespaceClose braceslevel] [lindex $stack end] break set stack [lreplace $stack end end] incr level -1 if { $NeedsNamespaceClose } { upvar 2 $newblocknameP newblockP append newblockP "\}\n" set NeedsNamespaceClose 0 } return 0 } proc RamDebugger::Instrumenter::CheckEndOfFileState {} { variable stack set text "" foreach i $stack { set line [lindex $i end-1] set type [lindex $i end] append text "There is a block of type ($type) beginning at line $line " append text "that is not closed at the end of the file\n" } if { $text != "" } { error $text } } # newblocknameP is for procs # newblocknameR is for the rest proc RamDebugger::Instrumenter::DoWork { block filenum newblocknameP newblocknameR blockinfoname } { variable words variable currentword variable wordtype variable wordtypeline variable DoInstrument variable OutputType variable braceslevel variable level variable colors set length [string length $block] if { $length >= 1000 } { RamDebugger::ProgressVar 0 1 } # a trick: it is the same to use newblockP or newblockPP. Only convenience upvar $newblocknameP newblockP upvar $newblocknameP newblockPP upvar $newblocknameR newblockR upvar $blockinfoname blockinfo set newblockP "" set newblockR "" set blockinfo "" set blockinfocurrent [list 0 n] InitState set DoInstrument 1 set OutputType R append newblockP "# RamDebugger instrumented file. InstrumentProcs=1\n" append newblockR "# RamDebugger instrumented file. InstrumentProcs=0\n" set braceslevelNoEval 0 set checkExtraCharsAfterCQB "" set lastc "" set lastinstrumentedline "" set line 1 set ichar 0 set icharline 0 foreach c [split $block ""] { if { $ichar%1000 == 0 } { RamDebugger::ProgressVar [expr {$ichar*100/$length}] } if { $checkExtraCharsAfterCQB != "" } { if { ![string is space $c] && $c != "\}" && $c != "\]" && $c != "\\" && $c != ";" } { if { $c == "\"" && $checkExtraCharsAfterCQB == "\}" } { # nothing } else { set text "There is a non valid character ($c) in line $line " append text "after a closing block with ($checkExtraCharsAfterCQB)" error $text } } set checkExtraCharsAfterCQB "" } if { $DoInstrument == 1 && $lastinstrumentedline != $line && \ ![string is space $c] && \ $c != "\#" && $words == "" } { append newblock$OutputType "RDC::F $filenum $line ; " set lastinstrumentedline $line } set consumed 0 switch -- $c { \" { if { $lastc != "\\" && [lindex $words 0] != "\#" } { if { $wordtype == "" } { set wordtype \" set wordtypeline $line set wordtypepos $icharline set consumed 1 } elseif { $wordtype == "\"" } { set wordtype "" lappend words $currentword set currentword "" set consumed 1 set checkExtraCharsAfterCQB \" if { $wordtypeline == $line } { lappend blockinfocurrent grey $wordtypepos [expr $icharline+1] } else { lappend blockinfocurrent grey 0 [expr $icharline+1] } set wordtypeline 0 if { $OutputType == "R" && $words == "proc" } { if { $lastinstrumentedline == $line } { set numdel [expr 4+[string length "RDC::F $filenum $line ; "]] } else { set numdel 4 } set newblockR [string range $newblockR 0 end-$numdel] append newblockP $words set OutputType P } } elseif { $wordtype == "\{" } { if { ![info exists quoteintobraceline] } { set quoteintobraceline $line set quoteintobracepos $icharline } else { if { $line == $quoteintobraceline } { lappend blockinfocurrent grey $quoteintobracepos [expr $icharline+1] } unset quoteintobraceline quoteintobracepos } } } } \{ { if { $lastc != "\\" } { if { $wordtype == "\{" } { incr braceslevelNoEval } elseif { $wordtype == "\"" || $wordtype == "w" } { incr braceslevel } else { set consumed 1 set fail [PushState \{ $line $newblocknameP $newblocknameR] if { $fail } { set wordtype \{ set wordtypeline $line set braceslevelNoEval 1 } else { set lastinstrumentedline $line } } } } \} { if { $lastc != "\\" } { if { $wordtype == "\{" } { incr braceslevelNoEval -1 if { $braceslevelNoEval == 0 } { set wordtype "" lappend words $currentword set currentword "" set consumed 1 if { [lindex $words 0] != "\#" } { set checkExtraCharsAfterCQB \} } if { $OutputType == "R" && $words == "proc" } { if { $lastinstrumentedline == $line } { set numdel [expr 4+[string length "RDC::F $filenum $line ; "]] } else { set numdel 4 } set newblockR [string range $newblockR 0 end-$numdel] append newblockP $words set OutputType P } } } elseif { $braceslevel > 0 } { incr braceslevel -1 } else { set wordtype_before $wordtype set fail [PopState \} $line $newblocknameP $newblocknameR] if { !$fail } { if { $wordtype_before == "\"" } { set text "Quoted text (\") in line $line " append text "contains and invalid brace (\})" error $text } set consumed 1 lappend words "" if { [lindex $words 0] != "\#" } { set checkExtraCharsAfterCQB \} } } } } } " " - \t { if { $lastc != "\\" } { if { $wordtype == "w" } { set consumed 1 set wordtype "" lappend words $currentword set currentword "" if { $OutputType == "R" && $words == "proc" } { if { $lastinstrumentedline == $line } { set numdel [expr 4+[string length "RDC::F $filenum $line ; "]] } else { set numdel 4 } set newblockR [string range $newblockR 0 end-$numdel] append newblockP $words set OutputType P } if { [lindex $words 0] == "proc" } { if { [llength $words] == 1 } { set icharlineold [expr $icharline-4] lappend blockinfocurrent magenta $icharlineold $icharline } elseif { [llength $words] == 2 } { set icharlineold [expr $icharline-[string length [lindex $words end]]] lappend blockinfocurrent blue $icharlineold $icharline } } elseif { [info exists colors([lindex $words end])] } { set icharlineold [expr $icharline-[string length [lindex $words end]]] lappend blockinfocurrent $colors([lindex $words end]) $icharlineold \ $icharline } } elseif { $wordtype == "" } { set consumed 1 } } } \[ { if { $lastc != "\\" && $wordtype != "\{" } { if { $wordtype == "" } { set wordtype "w" } set consumed 1 PushState \[ $line $newblocknameP $newblocknameR set lastinstrumentedline $line } } \] { if { $lastc != "\\" && $wordtype != "\"" && $wordtype != "\{" } { set fail [PopState \] $line $newblocknameP $newblocknameR] if { !$fail } { set consumed 1 } # note: the word inside words is not correct when using [] } } \n { if { [lindex $words 0] == "\#" } { lappend blockinfocurrent red $commentpos $icharline } elseif { $wordtype == "\"" } { if { $wordtypeline == $line } { lappend blockinfocurrent grey $wordtypepos $icharline } else { lappend blockinfocurrent grey 0 $icharline } } elseif { $wordtype == "w" && [info exists colors($currentword)] } { set icharlineold [expr $icharline-[string length $currentword]] lappend blockinfocurrent $colors($currentword) $icharlineold \ $icharline } lappend blockinfo $blockinfocurrent incr line set blockinfocurrent [expr $level+$braceslevelNoEval] if { ($wordtype == "w" || $wordtype == "\"") && $braceslevel > 0 } { lappend blockinfocurrent "n" } elseif { $wordtype != "\{" } { set consumed 1 if { $lastc != "\\" && $wordtype != "\"" } { set words "" set currentword "" set wordtype "" if { $OutputType == "P" } { append newblockP $c set OutputType R } lappend blockinfocurrent "n" } else { if { $wordtype == "w" } { set wordtype "" lappend words $currentword set currentword "" } lappend blockinfocurrent "c" } } else { lappend blockinfocurrent "n" } } \# { if { [llength $words] == 0 && $currentword == "" && $wordtype == "" } { set consumed 1 lappend words \# set commentpos $icharline } } ; { if { $lastc != "\\" && $wordtype != "\"" && $wordtype != "\{" && \ [lindex $words 0] != "\#"} { set consumed 1 set words "" set currentword "" set wordtype "" if { $OutputType == "P" } { append newblockP $c set OutputType R } } } } append newblock$OutputType $c if { !$consumed } { if { $wordtype == "" } { set wordtype w set wordtypeline $line } append currentword $c } if { $lastc == "\\" && $c == "\\" } { set lastc "\\\\" } else { set lastc $c } incr ichar if { $c == "\t" } { incr icharline 8 } elseif { $c != "\n" } { incr icharline } else { set icharline 0 } } lappend blockinfo $blockinfocurrent if { $wordtype != "" && $wordtype != "w" } { set text "There is a block of type ($wordtype) beginning at line $wordtypeline " append text "that is not closed at the end of the file" error $text } CheckEndOfFileState if { $length >= 1000 } { RamDebugger::ProgressVar 100 } } proc RamDebugger::Instrumenter::DoWorkForTime { block filename newblockname timedata } { upvar $newblockname newblock set newblock "# RamDebugger time instrumented file\n" set lines [split $block \n] set lastline "" set lastpos "" foreach i $timedata { foreach "name file lineini lineend lasttime" $i { if { $file != $filename } { continue } if { $lineini != $lastline } { set lastpos 0 } set text "RDC::MeasureTime [list $name] \[time { " set linepos [expr $lineini-1] set line [lindex $lines $linepos] set newline [string range $line 0 [expr $lastpos-1]] append newline $text [string range $line $lastpos end] set lines [lreplace $lines $linepos $linepos $newline] set lastline $lineini set lastpos [expr $lastpos+[string length $text]] set linepos [expr $lineend-1] set newline "[lindex $lines $linepos] }]" set lines [lreplace $lines $linepos $linepos $newline] } } regsub -all {RDC::F [0-9]+ [0-9+] ; } [join $lines \n] {} newblock2 append newblock $newblock2 } proc RamDebugger::Instrumenter::DoWorkForC++ { block blockinfoname { braceslevelIni 0 } } { set length [string length $block] if { $length >= 5000 } { RamDebugger::ProgressVar 0 1 } upvar $blockinfoname blockinfo set blockinfo "" set blockinfocurrent [list $braceslevelIni n] foreach i [list \#include static const if else new delete for return sizeof while continue \ break class typedef struct \#else \#endif \#if] { set colors($i) magenta } foreach i [list \#ifdef \#ifndef \#define \#undef] { set colors($i) magenta2 } foreach i [list char int double void ] { set colors($i) green } set wordtype "" set wordtypeline "" # = -1 -> // ; > 0 -> comment type /* set commentlevel 0 set braceslevel $braceslevelIni set braceshistory "" set lastc "" set line 1 set ichar 0 set icharline 0 set finishedline 0 set nextiscyan 0 set simplechar "" foreach c [split $block ""] { if { $ichar%5000 == 0 } { RamDebugger::ProgressVar [expr $ichar*100/$length] } if { $simplechar != "" } { foreach "iline icharinto" $simplechar break if { $line > $iline } { error "error in line $iline, position $icharinto. There is no closing (')" } if { $c == "'" } { set simplechar "" } set lastc $c incr ichar if { $c == "\t" } { incr icharline 8 } elseif { $c != "\n" } { incr icharline } else { set icharline 0 } continue } switch -- $c { \" { if { $commentlevel } { # nothing } elseif { $wordtype != "\"" } { set wordtype \" set wordtypeline $line set wordtypepos $icharline set finishedline 0 } elseif { $lastc != "\\" } { set wordtype "" lappend blockinfocurrent grey $wordtypepos [expr $icharline+1] } } ' { if { !$commentlevel && $wordtype != "\"" } { set simplechar [list $line $icharline] } } \{ { if { $commentlevel || $wordtype == "\"" } { #nothing } else { if { $wordtype == "w" } { if { [info exists colors($currentword)] } { lappend blockinfocurrent $colors($currentword) $wordtypepos \ $icharline if { $colors($currentword) == "green" } { set nextiscyan 1 } } elseif { $nextiscyan } { lappend blockinfocurrent cyan $wordtypepos \ $icharline set nextiscyan 0 } set wordtype "" } incr braceslevel lappend braceshistory [list o $braceslevel $line $icharline] set finishedline 1 } } \} { if { $commentlevel || $wordtype == "\"" } { #nothing } else { if { $wordtype == "w" } { if { [info exists colors($currentword)] } { lappend blockinfocurrent $colors($currentword) $wordtypepos \ $icharline if { $colors($currentword) == "green" || \ $colors($currentword) == "magenta2" } { set nextiscyan 1 } } elseif { $nextiscyan } { lappend blockinfocurrent cyan $wordtypepos \ $icharline set nextiscyan 0 } set wordtype "" } incr braceslevel -1 lappend braceshistory [list c $braceslevel $line $icharline] if { $braceslevel < 0 } { if { $braceslevelIni == 0 } { RamDebugger::TextOutClear RamDebugger::TextOutRaise RamDebugger::TextOutInsert "BRACES POSITIONS\n" set file $RamDebugger::currentfile foreach i $braceshistory { switch [lindex $i 0] { o { set tt "open brace" } c { set tt "close brace" } } set data "$file:[lindex $i 2] $tt pos=[lindex $i 3] " append data "Level after=[lindex $i 1]\n" RamDebugger::TextOutInsert $data } } error "error in line $line. There is one unmatched closing brace (\})" } set finishedline 1 } } * { if { $commentlevel == -1 || $wordtype == "\"" } { #nothing } elseif { $lastc == "/" } { if { $commentlevel == 0 } { set wordtype "" set wordtypepos [expr $icharline-1] } incr commentlevel } elseif { !$commentlevel && $wordtype == "w" } { if { [info exists colors($currentword)] } { lappend blockinfocurrent $colors($currentword) $wordtypepos \ $icharline if { $colors($currentword) == "green" || \ $colors($currentword) == "magenta2" } { set nextiscyan 1 } } elseif { $nextiscyan } { lappend blockinfocurrent cyan $wordtypepos \ $icharline set nextiscyan 0 } set wordtype "" } } / { if { $commentlevel == -1 || $wordtype == "\"" } { #nothing } elseif { !$commentlevel && $lastc == "/" } { set wordtype "" set wordtypepos [expr $icharline-1] set commentlevel -1 } elseif { $lastc == "*" } { set wordtype "" if { $commentlevel >= 1 } { incr commentlevel -1 if { $commentlevel == 0 } { lappend blockinfocurrent red $wordtypepos [expr $icharline+1] } } } elseif { !$commentlevel && $wordtype == "w" } { if { [info exists colors($currentword)] } { lappend blockinfocurrent $colors($currentword) $wordtypepos \ $icharline if { $colors($currentword) == "green" || \ $colors($currentword) == "magenta2" } { set nextiscyan 1 } } elseif { $nextiscyan } { lappend blockinfocurrent cyan $wordtypepos \ $icharline set nextiscyan 0 } set wordtype "" } } \( { if { !$commentlevel && $braceslevel == 0 && $wordtype != "\"" } { set ipos [string first :: $currentword] if { $ipos == -1 } { lappend blockinfocurrent blue $wordtypepos $icharline } else { lappend blockinfocurrent green $wordtypepos [expr $wordtypepos+$ipos+2] lappend blockinfocurrent blue [expr $wordtypepos+$ipos+2] $icharline } set nextiscyan 0 } elseif { $wordtype == "w" } { if { [info exists colors($currentword)] } { lappend blockinfocurrent $colors($currentword) $wordtypepos \ $icharline if { $colors($currentword) == "green" || \ $colors($currentword) == "magenta2" } { set nextiscyan 1 } } elseif { $nextiscyan } { lappend blockinfocurrent cyan $wordtypepos \ $icharline set nextiscyan 0 } set wordtype "" } } ";" { if { !$commentlevel && $wordtype == "w" } { if { [info exists colors($currentword)] } { lappend blockinfocurrent $colors($currentword) $wordtypepos \ $icharline if { $colors($currentword) == "green" || \ $colors($currentword) == "magenta2" } { set nextiscyan 1 } } elseif { $nextiscyan } { lappend blockinfocurrent cyan $wordtypepos \ $icharline set nextiscyan 0 } set wordtype "" } if { !$commentlevel && $wordtype != "\"" } { set finishedline 1 } } \n { if { $wordtype == "\"" } { lappend blockinfocurrent grey $wordtypepos $icharline set wordtypepos 0 } elseif { $wordtype == "w" } { if { [info exists colors($currentword)] } { set icharlineold [expr $icharline-[string length $currentword]] lappend blockinfocurrent $colors($currentword) $icharlineold \ $icharline if { $colors($currentword) == "green" || \ $colors($currentword) == "magenta2" } { set nextiscyan 1 } } elseif { $nextiscyan } { lappend blockinfocurrent cyan $wordtypepos \ $icharline set nextiscyan 0 } set wordtype "" } elseif { $commentlevel } { lappend blockinfocurrent red $wordtypepos $icharline set wordtypepos 0 if { $commentlevel == -1 } { set commentlevel 0 } set finishedline 1 } lappend blockinfo $blockinfocurrent incr line set blockinfocurrent [expr $braceslevel] if { $finishedline } { lappend blockinfocurrent "n" } else { lappend blockinfocurrent "c" } } default { if { $commentlevel || $wordtype == "\"" } { # nothing } elseif { $wordtype == "" } { if { [string is wordchar $c] || $c == "\#" || $c == ":" || $c == "," } { set wordtype w set wordtypepos $icharline set currentword $c set finishedline 0 } } elseif { $wordtype == "w" } { if { [string is wordchar $c] || $c == "\#" || $c == ":" || $c == "," } { append currentword $c } else { if { [info exists colors($currentword)] } { lappend blockinfocurrent $colors($currentword) $wordtypepos \ $icharline if { $colors($currentword) == "green" || \ $colors($currentword) == "magenta2" } { set nextiscyan 1 } } elseif { $nextiscyan } { lappend blockinfocurrent cyan $wordtypepos \ $icharline set nextiscyan 0 } set wordtype "" } } } } if { $lastc == "\\" && $c == "\\" } { set lastc "\\\\" } else { set lastc $c } incr ichar if { $c == "\t" } { incr icharline 8 } elseif { $c != "\n" } { incr icharline } else { set icharline 0 } } lappend blockinfo $blockinfocurrent if { $wordtype != "" && $wordtype != "w" } { set text "There is a block of type ($wordtype) beginning at line $wordtypeline " append text "that is not closed at the end of the file" error $text } if { $commentlevel > 0 } { error "error: There is a non-closed comment beginning at line $wordtypeline" } if { $braceslevel } { if { $braceslevelIni == 0 } { RamDebugger::TextOutClear RamDebugger::TextOutRaise RamDebugger::TextOutInsert "BRACES POSITIONS\n" set file $RamDebugger::currentfile foreach i $braceshistory { switch [lindex $i 0] { o { set tt "open brace" } c { set tt "close brace" } } set data "$file:[lindex $i 2] $tt pos=[lindex $i 3] Level after=[lindex $i 1]\n" RamDebugger::TextOutInsert $data } } error "error: There is a non-closed brace at the end of the file (see Output for details)" } if { $length >= 1000 } { RamDebugger::ProgressVar 100 } } |
Added scripts/WindowsHierarchy.tcl.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 |
################################################################################ # Windows Hierarchy ################################################################################ proc RamDebugger::DisplayWindowsHierarchyInfo { canvas w x y } { variable TextMotionAfterId after cancel $TextMotionAfterId set TextMotionAfterId "" if { [winfo exists $canvas.help] } { destroy $canvas.help } if { $w != "" } { set TextMotionAfterId [after 100 RamDebugger::DisplayWindowsHierarchyInfoDo \ $canvas $w $x $y] } } proc RamDebugger::DisplayWindowsHierarchyInfoDo { canvas w x y } { variable TextMotionAfterId set TextMotionAfterId "" set comm { set retval "WIDGET\n\n" if { [winfo class WIDGET] == "Toplevel" } { append retval "TITLE: [wm title WIDGET]\n" } if { [winfo class WIDGET] == "Label" || [winfo class WIDGET] == "Button" || \ [winfo class WIDGET] == "Radiobutton" || [winfo class WIDGET] == "Checkbutton" } { if { [WIDGET cget -text] != "" } { append retval "LABEL: [WIDGET cget -text]\n" } } foreach "cols rows" [grid size WIDGET] break if { $cols > 0 } { append retval "GRID MASTER\n" for { set i 0 } { $i < $rows } { incr i } { for { set j 0 } { $j < $cols } { incr j } { set slave [grid slaves WIDGET -row $i -column $j] if { $slave != "" } { append retval " $i,$j $slave [grid info $slave]\n" } } } append retval " ROWS\n" for { set i 0 } { $i < $rows } { incr i } { append retval " $i [grid rowconfigure WIDGET $i]\n" } append retval " COLUMNS\n" for { set j 0 } { $j < $cols } { incr j } { append retval " $i [grid columnconfigure WIDGET $j]\n" } } set info [grid info WIDGET] if { $info != "" } { append retval "GRID SLAVE\n$info\n" } if { [pack slaves WIDGET] != "" } { append retval "PACK MASTER\n" foreach i [pack slaves WIDGET] { append retval " $i [pack info $i]\n" } } if { ![catch [list pack info WIDGET] info] } { append retval "PACK SLAVE\n$info\n" } append retval "OPTIONS\n" set retval_in "" foreach i [WIDGET configure] { append retval_in "[lindex $i 0] [WIDGET cget [lindex $i 0]] " while { [string length $retval_in] > 80 } { append retval [string range $retval_in 0 79]\n set retval_in [string range $retval_in 80 end] } if { [string length $retval_in] > 40 } { append retval $retval_in\n set retval_in "" } } if { [string index $retval_in end] != "\n" } { append retval_in \n } append retval $retval_in append retval "SIZES\n" append retval " width=[winfo width WIDGET] reqwidth=[winfo reqwidth WIDGET]\n" append retval " height=[winfo height WIDGET] reqheight=[winfo reqheight WIDGET]\n" EVAL } if { $DialogWinHier::user(type) == "ramdebugger" } { set retcomm "RamDebugger::DisplayWindowsHierarchyInfoDo2 $canvas $w $x $y \[set retval]" } else { set retcomm "RDC::SendDev \[list RamDebugger::DisplayWindowsHierarchyInfoDo2 $canvas \ $w $x $y \[set retval]]" } set comm [string map [list EVAL $retcomm] $comm] set comm [string map [list WIDGET $w] $comm] if { $DialogWinHier::user(type) == "ramdebugger" } { eval $comm } else { EvalRemote $comm } } proc RamDebugger::DisplayWindowsHierarchyInfoDo2 { canvas w x y res } { set w $canvas.help if { [winfo exists $w] } { destroy $w } toplevel $w wm overrideredirect $w 1 wm transient $w $canvas pack [label $w.l -bg white -justify left -anchor w] $w.l conf -bd 1 -relief solid $w.l conf -text $res bind $w <Motion> "destroy $w" wm withdraw $w update idletasks incr x 5 incr y 5 if { $x+[winfo reqwidth $w]+5 > [winfo screenwidth $w] } { set x [expr [winfo screenwidth $w]-[winfo reqwidth $w]-5] } if { $x < 5 } { set x 5 } if { $y+[winfo reqheight $w]+5 > [winfo screenheight $w] } { set y [expr [winfo screenheight $w]-[winfo reqheight $w]-5] } if { $y < 0 } { set y 5 } wm geom $w +$x+$y wm deiconify $w focus $w.l bind $w.l <Control-c> "clipboard clear; clipboard append [list $res]" } proc RamDebugger::DisplayWindowsHierarchyDoDraw { canvas list x y linespace } { set maxwidth 0 foreach "w info rest" $list { foreach i $info { set width [font measure NormalFont $i] if { $width > $maxwidth } { set maxwidth $width } } } set maxwidth [expr $maxwidth+10] set maxx [expr $x+$maxwidth] set maxy $y set ty $y set num 0 foreach "w info rest" $list { if { $rest != "-" } { foreach "newx newy" [DisplayWindowsHierarchyDoDraw $canvas $rest [expr $x+$maxwidth] \ $maxy $linespace] break if { $newx > $maxx } { set maxx $newx} set ty [expr ($maxy+$newy)/2-$linespace/2] set maxy $newy set width 0 foreach i $info { set widthi [font measure NormalFont $i] if { $widthi > $width } { set width $widthi } } $canvas create line [expr $x+$width+2] [expr $ty+$linespace/2] \ [expr $x+$maxwidth-5] [expr $ty+$linespace/2] -width 2 -fill red -tags "items $w" incr maxy 12 } set inum 0 foreach i $info { if { $i != "" } { switch $inum { 0 { set color black } 1 { set color blue } 2 { set color green } } $canvas create text $x $ty -text $i -tags "items $w" -font NormalFont -anchor nw \ -fill $color set ty [expr $ty+$linespace] } incr inum } $canvas bind $w <Enter> "RamDebugger::DisplayWindowsHierarchyInfo $canvas $w %X %Y" $canvas bind $w <Leave> "RamDebugger::DisplayWindowsHierarchyInfo $canvas {} %X %Y" if { $ty > $maxy } { set maxy $ty } else { set ty $maxy } incr num } if { $num > 1 } { $canvas create line [expr $x-5] $y [expr $x-1] [expr $y-4] -width 2 -fill red -tags items $canvas create line [expr $x-5] $y [expr $x-5] $maxy -width 2 -fill red -tags items $canvas create line [expr $x-5] $maxy [expr $x-1] [expr $maxy+4] -width 2 -fill red -tags items } return [list $maxx $maxy] } proc RamDebugger::DisplayWindowsHierarchyDo { what { res "" } } { variable remoteserver if { $what == "do" } { set comm { namespace eval ::RDC {} proc ::RDC::WindowsHierarchy { w } { set info [list "[winfo name $w] [winfo class $w]"] if { [winfo class $w] == "Label" || [winfo class $w] == "Button" || \ [winfo class $w] == "Radiobutton" || [winfo class $w] == "Checkbutton" } { if { [$w cget -text] != "" } { lappend info [$w cget -text] } } elseif { [winfo class $w] == "Toplevel" && [wm title $w] != "" } { lappend info "" [wm title $w] } set retval [list $w $info] set retval_in "" foreach i [winfo children $w] { eval lappend retval_in [RDC::WindowsHierarchy $i] } if { $retval_in == "" } { lappend retval - } else { lappend retval $retval_in } return $retval } EVAL } if { $DialogWinHier::user(type) == "ramdebugger" } { set retcomm "RamDebugger::DisplayWindowsHierarchyDo res \[::RDC::WindowsHierarchy .]" } else { set retcomm "RDC::SendDev \[list RamDebugger::DisplayWindowsHierarchyDo res \ \[::RDC::WindowsHierarchy .]]" } set comm [string map [list EVAL $retcomm] $comm] if { [info exists RamDebugger::DisplayWindowsHierarchyFindLastId] } { unset RamDebugger::DisplayWindowsHierarchyFindLastId } if { $DialogWinHier::user(type) == "ramdebugger" } { eval $comm } else { if { $remoteserver == "" } { after 100 [list WarnWin "Error: there is no debugged application" \ $DialogWinHier::user(canvas)] $DialogWinHier::user(canvas) delete items return } EvalRemote $comm } } else { $DialogWinHier::user(canvas) delete items set linespace [expr [font metrics NormalFont -linespace]+1] foreach "newx newy" [DisplayWindowsHierarchyDoDraw $DialogWinHier::user(canvas) $res \ 5 5 $linespace] break $DialogWinHier::user(canvas) conf -scrollregion [list 0 0 $newx $newy] } } proc RamDebugger::DisplayWindowsHierarchyFind {} { variable DisplayWindowsHierarchyFindLastId set canvas $DialogWinHier::user(canvas) if { ![info exists DisplayWindowsHierarchyFindLastId] } { set DisplayWindowsHierarchyFindLastId -1 } set found 0 foreach i [$canvas find all] { if { $DisplayWindowsHierarchyFindLastId > -1 && $i <= $DisplayWindowsHierarchyFindLastId } { continue } if { [$canvas type $i] == "text" } { set text [$canvas itemcget $i -text] if { [string match -nocase *$DialogWinHier::user(find)* $text] } { set found 1 set DisplayWindowsHierarchyFindLastId $i break } } } if { $found } { $canvas select from $i 0 $canvas select to $i end foreach "x y" [$canvas coords $i] break foreach "- - width height" [$canvas cget -scrollregion] break foreach "f1 f2" [$canvas xview] break set xs [expr $x/double($width)-($f2-$f1)/2.0] if { $xs < 0 } { set xs 0 } $canvas xview moveto $xs foreach "f1 f2" [$canvas yview] break set ys [expr $y/double($height)-($f2-$f1)/2.0] if { $ys < 0 } { set ys 0 } $canvas yview moveto $ys } else { unset RamDebugger::DisplayWindowsHierarchyFindLastId bell } } proc RamDebugger::DisplayWindowsHierarchy {} { variable text CopyNamespace ::DialogWin ::DialogWinHier set f [DialogWinHier::Init $text "Windows hierarchy" separator "" -] set w [winfo toplevel $f] radiobutton $f.r1 -text "In debugged app" -variable DialogWinHier::user(type) -value debug \ -command "RamDebugger::DisplayWindowsHierarchyDo do" -grid "0 w" radiobutton $f.r2 -text "In RamDebugger" -variable DialogWinHier::user(type) -value ramdebugger \ -command "RamDebugger::DisplayWindowsHierarchyDo do" -grid "1 w" frame $f.f -grid "0 2" label $f.f.l -text "Find:" -grid 0 entry $f.f.e -textvar DialogWinHier::user(find) -grid 1 tkTabToWindow $f.f.e button $f.f.b1 -text Go -width 5 -grid "2 px3 py3" -command \ "RamDebugger::DisplayWindowsHierarchyFind" bind $f.f.e <Return> "$f.f.b1 invoke" set DialogWinHier::user(type) debug set sw [ScrolledWindow $f.lf -relief sunken -borderwidth 0 -grid "0 2"] set DialogWinHier::user(canvas) [canvas $sw.t -width 600 -height 400 -bg white -bd 0 ] $sw setwidget $DialogWinHier::user(canvas) bind $DialogWinHier::user(canvas) <2> { %W scan mark %x %y set tkPriv(x) %x set tkPriv(y) %y set tkPriv(mouseMoved) 0 } bind $DialogWinHier::user(canvas) <B2-Motion> { if {(%x != $tkPriv(x)) || (%y != $tkPriv(y))} { set tkPriv(mouseMoved) 1 } if {$tkPriv(mouseMoved)} { %W scan dragto %x %y } } supergrid::go $f DisplayWindowsHierarchyDo do set action [DialogWinHier::CreateWindow] DialogWinHier::DestroyWindow namespace delete ::DialogWinHier } |
Added scripts/cplusplusproject.tcl.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 |
namespace eval cproject { variable project "" variable group All variable groupbefore "" variable groups All variable links variable debugreleasebefore "" variable debugrelease debug variable files "" variable thisdataC variable dataC variable thisdataL variable dataL variable thisdataE variable dataE variable compilationstatus } proc cproject::Init { w } { variable project trace var ::cproject::group w "cproject::SetGroupActive;#" trace var ::cproject::debugrelease w "cproject::SetDebugReleaseActive;#" if { [info exists RamDebugger::options(recentprojects)] && \ [llength $RamDebugger::options(recentprojects)] > 0 } { set project [lindex $RamDebugger::options(recentprojects) 0] catch { OpenProject $w 0 } } } proc cproject::synctoUI {} { variable thisdataC variable dataC variable thisdataL variable dataL variable thisdataE variable dataE variable group variable debugrelease foreach i [array names dataC $group,$debugrelease,*] { regexp {^[^,]+,[^,]+,(.*)} $i {} prop set thisdataC($prop) $dataC($i) } foreach i [array names dataL $debugrelease,*] { regexp {^[^,]+,(.*)} $i {} prop set thisdataL($prop) $dataL($i) } foreach i [array names dataE $debugrelease,*] { regexp {^[^,]+,(.*)} $i {} prop set thisdataE($prop) $dataE($i) } } proc cproject::syncfromUI {} { variable thisdataC variable dataC variable thisdataL variable dataL variable thisdataE variable dataE variable groupbefore variable debugreleasebefore if { $debugreleasebefore == "" } { return } foreach i [array names dataC $groupbefore,$debugreleasebefore,*] { regexp {^[^,]+,[^,]+,(.*)} $i {} prop if { $groupbefore == "All" || $debugreleasebefore == "both" } { TransferDataToLowerGroups $groupbefore $debugreleasebefore $prop $dataC($i) \ $thisdataC($prop) dataC } set dataC($i) $thisdataC($prop) } foreach i [array names dataL $debugreleasebefore,*] { regexp {^[^,]+,(.*)} $i {} prop if { $debugreleasebefore == "both" } { TransferDataToLowerGroups "" $debugreleasebefore $prop $dataL($i) $thisdataL($prop) \ dataL } set dataL($i) $thisdataL($prop) } foreach i [array names dataE $debugreleasebefore,*] { regexp {^[^,]+,(.*)} $i {} prop if { $debugreleasebefore == "both" } { TransferDataToLowerGroups "" $debugreleasebefore $prop $dataE($i) $thisdataE($prop) \ dataE } set dataE($i) $thisdataE($prop) } } proc cproject::TransferDataToLowerGroups { gr dr prop olddata newdata dataname } { variable dataC variable dataL variable dataE upvar 0 $dataname data set toadd "" set todel "" if { ![string match *dirs $prop] } { set olddataL [regexp -inline -all {[^\s;]+} $olddata] set newdataL [regexp -inline -all {[^\s;]+} $newdata] set searchcmd lsearch } else { set olddataL $olddata set newdataL $newdata set searchcmd RamDebugger::lsearchfile } foreach i $newdataL { if { [$searchcmd $olddataL $i] == -1 } { lappend toadd $i } } foreach i $olddataL { if { [$searchcmd $newdataL $i] == -1 } { lappend todel $i } } foreach i [array names data *,$prop] { switch $dataname { dataC { regexp {^([^,]+),([^,]+),(.*)} $i {} gr_in dr_in prop_in } dataL - dataE { set gr_in "" regexp {^([^,]+),(.*)} $i {} dr_in prop_in } } if { $gr_in == $gr && $dr_in == $dr } { continue } if { $gr == "All" && $dr == "both" } { # nothing } elseif { $gr == "All" } { if { $dr != $dr_in } { continue } } elseif { $dr == "both" } { if { $gr != $gr_in } { continue } } else { continue } if { ![string match *dirs $prop] } { set dataLocal [regexp -inline -all {[^\s;]+} $data($i)] } else { set dataLocal $data($i) } foreach j $toadd { if { [$searchcmd $dataLocal $j] == -1 } { if { ![string match *dirs $prop] } { append data($i) " $j" } else { lappend data($i) $j } } } foreach j $todel { if { [$searchcmd $dataLocal $j] != -1 } { if { ![string match *dirs $prop] } { set ipos [$searchcmd $dataLocal $j] set data($i) [join [lreplace $dataLocal $ipos $ipos]] } else { set ipos [$searchcmd $dataLocal $j] set data($i) [lreplace $data($i) $ipos $ipos] } } } if { ![string match *dirs $prop] } { set data($i) [string trim $data($i)] } } } proc cproject::SaveProjectC { w } { variable project variable group variable groups variable links variable debugrelease variable files variable thisdataC variable dataC variable thisdataL variable dataL variable thisdataE variable dataE if { $project == "" } { return } syncfromUI set err [catch { open $project w } fout] if { $err } { WarnWin "Could not open file '$project' to save ($fout)" $w return } foreach i [list groups group links debugrelease files thisdataC dataC thisdataL dataL \ thisdataE dataE ] { if { [array exists $i] } { puts $fout [list array set $i [array get $i]] } else { puts $fout [list set $i [set $i]] } } close $fout if { [RamDebugger::lsearchfile $RamDebugger::options(recentprojects) $project] != -1 } { set ipos [RamDebugger::lsearchfile $RamDebugger::options(recentprojects) $project] set RamDebugger::options(recentprojects) [lreplace $RamDebugger::options(recentprojects) \ $ipos $ipos] } set RamDebugger::options(recentprojects) [linsert $RamDebugger::options(recentprojects) \ 0 $project] } proc cproject::UpdateComboValues { combo varname } { if { ![winfo exists $combo] } { return } $combo configure -values [set $varname] } proc cproject::NewProject { w } { variable project variable groupbefore variable group variable groups variable links variable debugrelease variable files variable thisdataC variable dataC variable thisdataL variable dataL variable thisdataE variable dataE set types { {{Project files} {.prj} } {{All Files} * } } set dir $RamDebugger::options(defaultdir) set file [tk_getSaveFile -filetypes $types -initialdir $dir -parent $w \ -title "New project" -defaultextension .prj] if { $file == "" } { return } set RamDebugger::options(defaultdir) [file dirname $file] set project $file set debugreleasebefore "" set groups All set links Link set files "" NewData set debugrelease debug set group All } proc cproject::NewData {} { variable project variable thisdataC variable dataC variable thisdataL variable dataL variable thisdataE variable dataE variable groups variable links foreach i [list C L E] { catch { unset data$i } catch { unset thisdata$i } } foreach i [list debug release both] { foreach group $groups { set dataC($group,$i,includedirs) . set dataC($group,$i,defines) "" set dataC($group,$i,compiler) "gcc" switch $i { debug { set dataC($group,$i,flags) "-c -g" } release { set dataC($group,$i,flags) "-c -O3" } both { set dataC($group,$i,flags) "-c" } } } foreach link $links { set dataL($i,$link,librariesdirs) . set dataL($i,$link,linkgroups) All set dataL($i,$link,libraries) "libc libm" set dataL($i,$link,linker) "gcc" set dataL($i,$link,linkflags) "" set dataL($i,$link,linkexe) [file root [file tail $project]] if { $i != "both" } { set dataE($i,execdir) [file join [file dirname $project] [file root $project]_$i] set dataE($i,exe) [file root [file tail $project]] } else { set dataE($i,execdir) "" set dataE($i,exe) "" } set dataE($i,exeargs) "" } } } proc cproject::GiveDebugData {} { variable debugrelease variable dataE if { [info exists dataE($debugrelease,exe)] } { set exe [file join $dataE($debugrelease,execdir) $dataE($debugrelease,exe)] return [list $exe $dataE($debugrelease,execdir) \ $dataE($debugrelease,exeargs)] } return "" } proc cproject::OpenProject { w { ask 1 } } { variable project variable groupbefore variable group variable groups variable links variable debugrelease variable files variable dataC variable dataL variable dataE variable debugreleasebefore if { $ask } { set ret [DialogWin::messageBox -default ok -icon warning -message \ "Are you sure to discard all project data?" -parent $w \ -title "discard data" -type okcancel] if { $ret == "cancel" } { return } set types { {{Project files} {.prj} } {{All Files} * } } set dir $RamDebugger::options(defaultdir) set file [tk_getOpenFile -filetypes $types -initialdir $dir -parent $w \ -title "Open existing project" -defaultextension .prj] if { $file == "" } { return } } else { set file $project } set project $file set err [catch { interp create cproject_tmp cproject_tmp eval [list source $file] set groups [cproject_tmp eval set groups] if { [catch { set links [cproject_tmp eval set links] }]} { set links Link } interp delete cproject_tmp # trick because NewData needs to have groups and links defined NewData source $file } errstring] if { $err } { WarnWin "Error opening project '$file' ($errstring)" $w return } if { [array exists data] } { # upgrade old versions set links Link foreach i [array names data] { if { [regexp {(librariesdirs|libraries|linkflags)$} $i] } { regexp {^([^,]+),(.*)} $i {} dr r set dataL($dr,Link,$r) $data($i) } elseif { [regexp {(execdir|exe|exeargs)$} $i] } { set dataE($i) $data($i) } else { set dataC($i) $data($i) } } } # to activate the trace set groupbefore "" set debugreleasebefore "" set group $group set groupbefore $group set debugreleasebefore $debugrelease } proc cproject::SaveProject { w } { variable project set types { {{Project files} {.prj} } {{All Files} * } } set dir $RamDebugger::options(defaultdir) set file [tk_getSaveFile -filetypes $types -initialdir $dir -parent $w \ -title "Save project" -defaultextension .prj] if { $file == "" } { return } #set RamDebugger::options(defaultdir) [file dirname $file] set project $file SaveProjectC $w } proc cproject::SetGroupActive {} { variable groupbefore variable group variable debugrelease variable thisdata variable data set dir [IsProjectNameOk] syncfromUI set groupbefore $group synctoUI } proc cproject::SetDebugReleaseActive {} { variable debugreleasebefore variable debugrelease variable thisdata variable data set dir [IsProjectNameOk] syncfromUI set debugreleasebefore $debugrelease synctoUI } proc cproject::CreateModifyGroup { w what } { variable group variable groups variable files variable dataC variable groupbefore set dir [IsProjectNameOk] syncfromUI if { $what == "delete" } { if { $group == "All" } { WarnWin "Group 'All' cannot be deleted" $w return } set ret [DialogWin::messageBox -default ok -icon warning -message \ "Are you sure to delete group '$group'?" -parent $w \ -title "delete group" -type okcancel] if { $ret == "cancel" } { return } for { set i 0 } { $i < [llength $files] } { incr i } { foreach "file type group_in path" [lindex $files $i] break if { $group == $group_in } { set files [lreplace $files $i $i [list $file $type All $path]] } } set ipos [lsearch $groups $group] set groups [lreplace $groups $ipos $ipos] foreach i [array names dataC $group,*] { unset dataC($i) } set groupbefore "" set group All return } CopyNamespace ::DialogWin ::DialogWinCR switch $what { create { set title "New group" set label "Enter new group name" } rename { set title "Rename group" set label "Enter new name for group '$group'" } } set f [DialogWinCR::Init $w $title separator ""] set w [winfo toplevel $f] label $f.l -text $label -grid "0 px3 py3" entry $f.e -textvariable DialogWinCR::user(name) -grid "0 px10 py3" -width 30 set DialogWinCR::user(name) $group tkTabToWindow $f.e supergrid::go $f bind $w <Return> "DialogWinCR::InvokeOK" set action [DialogWinCR::CreateWindow] while 1 { switch $action { 0 { DialogWinCR::DestroyWindow namespace delete ::DialogWinCR return } 1 { if { [string trim $DialogWinCR::user(name)] == "" } { WarnWin "Group name cannot be void" $w } elseif { [lsearch $groups $DialogWinCR::user(name)] != -1 } { WarnWin "Group name already exists" $w } elseif { ![string is wordchar $DialogWinCR::user(name)] } { WarnWin "Group name is not OK" $w } else { set newname $DialogWinCR::user(name) DialogWinCR::DestroyWindow namespace delete ::DialogWinCR break } } } set action [DialogWinCR::WaitForWindow] } if { $what == "rename" } { for { set i 0 } { $i < [llength $files] } { incr i } { foreach "file type group_in path" [lindex $files $i] break if { $group == $group_in } { set files [lreplace $files $i $i [list $file $type $newname $path]] } } set ipos [lsearch $groups $group] set groups [lreplace $groups $ipos $ipos $newname] foreach i [array names dataC $group,*] { regexp {,(.*)} $i {} rest set dataC($newname,$rest) $dataC($i) unset dataC($i) } } else { lappend groups $newname foreach i [array names dataC All,*] { regexp {,(.*)} $i {} rest set dataC($newname,$rest) $dataC($i) } } set groupbefore "" set group $newname } proc cproject::Create { par } { variable notebook if { ![info exists RamDebugger::options(recentprojects)] } { set RamDebugger::options(recentprojects) "" } set f [DialogWin::Init $par "C++ compilation project" separator [list Apply]] set w [winfo toplevel $f] set f1 [frame $f.f1 -grid "0 n"] Label $f1.l1 -text "Project:" -grid 0 -helptext \ "A project includes all the compilation information. Create a project before entering data" ComboBox $f1.cb1 -textvariable cproject::project -grid "1 3" -width 100 -editable 0 \ -values $RamDebugger::options(recentprojects) -modifycmd "cproject::OpenProject $w 0" focus $f1.cb1 set bbox [ButtonBox $f1.bbox1 -spacing 0 -padx 1 -pady 1 -homogeneous 1 -grid "4 w"] $bbox add -image filenew16 \ -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1 -padx 1 -pady 1 \ -helptext [_ "Create new project"] \ -command "cproject::NewProject $w" $bbox add -image fileopen16 \ -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1 -padx 1 -pady 1 \ -helptext [_ "Open existing project"] \ -command "cproject::OpenProject $w" $bbox add -image filesave16 \ -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1 -padx 1 -pady 1 \ -helptext [_ "Save as project"] \ -command "cproject::SaveProject $w" Label $f1.l2 -text "Group:" -grid "0 py3" -helptext \ "A group is a set of files with common compilation options. The special group all\ always exists and affects all files" ComboBox $f1.cb2 -textvariable cproject::group -grid 1 -values $cproject::groups \ -editable 0 trace var cproject::groups w "cproject::UpdateComboValues $f1.cb2 cproject::groups ;#" set bbox [ButtonBox $f1.bbox2 -spacing 0 -padx 1 -pady 1 -homogeneous 1 -grid "2 w"] $bbox add -image acttick16 \ -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1 -padx 1 -pady 1 \ -helptext [_ "Create new group"] \ -command "cproject::CreateModifyGroup $w create" $bbox add -image edit16 \ -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1 -padx 1 -pady 1 \ -helptext [_ "Rename group"] \ -command "cproject::CreateModifyGroup $w rename" $bbox add -image actcross16 \ -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1 -padx 1 -pady 1 \ -helptext [_ "Delete group"] \ -command "cproject::CreateModifyGroup $w delete" frame $f1.f1 -grid "3 2 px3 py3" -bd 2 -relief raised radiobutton $f1.f1.r1 -text Debug -variable cproject::debugrelease -value debug \ -grid 0 radiobutton $f1.f1.r2 -text Release -variable cproject::debugrelease -value release \ -grid "1" radiobutton $f1.f1.r3 -text Both -variable cproject::debugrelease -value both \ -grid "2" set pw [PanedWindow $f.pw -side top -pad 0 -weights available -grid 0 -activator line] foreach "weight1 weight2" [RamDebugger::ManagePanes $pw h "2 3"] break set pane1 [$pw add -weight $weight1] set sw [ScrolledWindow $pane1.lf -relief sunken -borderwidth 0 -grid "0"] set DialogWin::user(list) [tablelist::tablelist $sw.lb -width 55 -height 20\ -exportselection 0 \ -columns [list \ 14 File left \ 5 Type center \ 11 Group right \ 15 Path left \ ] \ -labelcommand tablelist::sortByColumn \ -background white \ -selectbackground navy -selectforeground white \ -stretch 1 -selectmode extended \ -highlightthickness 0 \ -listvariable cproject::files] $sw setwidget $DialogWin::user(list) bind [$sw.lb bodypath] <1> "focus $sw.lb" set bbox [ButtonBox $pane1.bbox1 -spacing 0 -padx 1 -pady 1 -homogeneous 1 -grid "0 wn py3"] $bbox add -image fileopen16 \ -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1 -padx 1 -pady 1 \ -helptext [_ "Add file to project"] \ -command "cproject::AddModFiles $sw.lb file" $bbox add -image folderopen16 \ -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1 -padx 1 -pady 1 \ -helptext [_ "Add files from directory to project"] \ -command "cproject::AddModFiles $sw.lb dir" $bbox add -image edit16 \ -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1 -padx 1 -pady 1 \ -helptext [_ "Assign selected files to active group"] \ -command "cproject::AddModFiles $sw.lb edit" $bbox add -image actcross16 \ -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1 -padx 1 -pady 1 \ -helptext [_ "Delete files from project"] \ -command "cproject::AddModFiles $sw.lb delete" $bbox add -image acttick16 \ -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1 -padx 1 -pady 1 \ -helptext [_ "View file"] \ -command "cproject::AddModFiles $sw.lb view" bind [$DialogWin::user(list) bodypath] <ButtonPress-3> \ [bind TablelistBody <ButtonPress-1>] bind [$DialogWin::user(list) bodypath] <ButtonRelease-3> { catch { destroy %W.menu } set menu [menu %W.menu] set lb [winfo parent %W] $menu add command -label "Assign group" -command "cproject::AddModFiles $lb edit" $menu add command -label "View file" -command "cproject::AddModFiles $lb view" $menu add separator $menu add command -label "Delete from project" -command "cproject::AddModFiles $lb delete" tk_popup $menu %X %Y } set pane2 [$pw add -weight $weight2] set notebook [NoteBook $pane2.nb -homogeneous 1 -bd 1 -internalborderwidth 3 \ -grid "0 px3 py3"] set f21 [$pane2.nb insert end compilation -text "Compilation"] TitleFrame $f21.f1 -text "include directories" -grid 0 set f121 [$f21.f1 getframe] set sw [ScrolledWindow $f121.lf -relief sunken -borderwidth 0 -grid "0"] listbox $sw.lb -listvariable cproject::thisdataC(includedirs) $sw setwidget $sw.lb set bbox [ButtonBox $f121.bbox1 -spacing 0 -padx 1 -pady 1 -homogeneous 1 -grid "0 wn"] $bbox add -image folderopen16 \ -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1 -padx 1 -pady 1 \ -helptext [_ "Add include directory"] \ -command "cproject::AddDelDirectories $sw.lb add" $bbox add -image actcross16 \ -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1 -padx 1 -pady 1 \ -helptext [_ "Delete include directory"] \ -command "cproject::AddDelDirectories $sw.lb delete" TitleFrame $f21.f15 -text "compiler" -grid "0 n" set f1215 [$f21.f15 getframe] set values [list "" gcc g++] ComboBox $f1215.cb -textvariable cproject::thisdataC(compiler) -values $values \ -grid "0 w" -width 10 TitleFrame $f21.f2 -text "defines" -grid "0 n" set f122 [$f21.f2 getframe] entry $f122.e -grid 0 -textvariable cproject::thisdataC(defines) TitleFrame $f21.f3 -text "additional compile flags" -grid "0 n" set f123 [$f21.f3 getframe] entry $f123.e -grid 0 -textvariable cproject::thisdataC(flags) set f23 [$pane2.nb insert end execute -text "Execute"] TitleFrame $f23.f1 -text "executable file" -grid "0 n" set f321 [$f23.f1 getframe] entry $f321.e -grid 0 -textvariable cproject::thisdataE(exe) Button $f321.b1 -image [Bitmap::get file] -width 16 -grid 1 -relief link TitleFrame $f23.f2 -text "working directory" -grid "0 n" set f322 [$f23.f2 getframe] entry $f322.e -grid 0 -textvariable cproject::thisdataE(execdir) Button $f322.b1 -image [Bitmap::get folder] -width 16 -grid 1 -relief link TitleFrame $f23.f3 -text "arguments" -grid "0 n" set f323 [$f23.f3 getframe] entry $f323.e -grid 0 -textvariable cproject::thisdataE(exeargs) set comm { set cproject::thisdataE(exe) [tk_getOpenFile -filetypes {{{All Files} *}} \ -initialdir $RamDebugger::options(defaultdir) -initialfile \ [file tail $cproject::thisdataE(exe)] -parent PARENT -title "Executable file"] } set comm [string map [list PARENT $w] $comm] $f321.b1 configure -command $comm set comm { set initial $RamDebugger::options(defaultdir) catch { set initial [file dirname $cproject::thisdataE(exe)] } set cproject::thisdataE(execdir) [RamDebugger::filenormalize [tk_chooseDirectory \ -initialdir $initial -parent PARENT \ -title "Working directory" -mustexist 1]] } set comm [string map [list PARENT $w] $comm] $f322.b1 configure -command $comm $pane2.nb compute_size $pane2.nb raise compilation supergrid::go $pane1 supergrid::go $f121 supergrid::go $f1215 supergrid::go $f122 supergrid::go $f123 supergrid::go $f21 supergrid::go $f321 supergrid::go $f322 supergrid::go $f323 supergrid::go $f23 supergrid::go $pane2 supergrid::go $f UpdateLinktabs trace var cproject::links w "UpdateLinktabs ;#" bind $w <Return> "DialogWin::InvokeOK" set action [DialogWin::CreateWindow "" "" 500] while 1 { switch $action { 0 { DialogWin::DestroyWindow return } 1 { SaveProjectC $w DialogWin::DestroyWindow return } 2 { SaveProjectC $w } } set action [DialogWin::WaitForWindow] } } proc cproject::UpdateLinktabs {} { variable notebook variable links if { ![info exists notebook] || ![winfo exists $notebook] } { return } if { ![info exists links] } { set links Link } set pages [$notebook pages 1 end-1] foreach i $pages { if { [lsearch $links $i] == -1 } { $notebook delete $i } } foreach i $links { regsub -all {\W} $i {X} page if { [lsearch $pages $page] == -1 } { set f [$notebook insert end-1 $page -text $i] AddLinkTab $f $i } } } proc cproject::AddGroupInLinkGroups { but entry } { variable groups set menu $but.menu catch { destroy $menu } menu $menu foreach i $groups { set comm { set str [ENTRY get] append str " GROUP" ENTRY del 0 end ENTRY insert end [string trim $str] } set comm [string map [list ENTRY $entry GROUP $i] $comm] $menu add command -label $i -command $comm } tk_popup $menu [winfo rootx $but] [winfo rooty $but] } proc cproject::AddLinkTab { f link } { TitleFrame $f.f0 -text "link groups" -grid "0 n" set f0 [$f.f0 getframe] entry $f0.e -grid 0 -textvariable cproject::thisdataL($link,linkgroups) Button $f0.b1 -image acttick16 \ -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1 -padx 1 -pady 1 \ -helptext [_ "Add group"] \ -command "cproject::AddGroupInLinkGroups $f0.b1 $f0.e" -grid 1 TitleFrame $f.f1 -text "libraries directories" -grid 0 set f1 [$f.f1 getframe] set sw [ScrolledWindow $f1.lf -relief sunken -borderwidth 0 -grid "0"] listbox $sw.lb -listvariable cproject::thisdataL($link,librariesdirs) $sw setwidget $sw.lb set bbox [ButtonBox $f1.bbox1 -spacing 0 -padx 1 -pady 1 -homogeneous 1 -grid "0 wn"] $bbox add -image folderopen16 \ -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1 -padx 1 -pady 1 \ -helptext [_ "Add link directories"] \ -command "cproject::AddDelDirectories $sw.lb add" $bbox add -image actcross16 \ -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1 -padx 1 -pady 1 \ -helptext [_ "Delete link directories"] \ -command "cproject::AddDelDirectories $sw.lb delete" TitleFrame $f.f2 -text "libraries" -grid "0 n" set f2 [$f.f2 getframe] set values [list gcc g++ ar] if { $::tcl_platform(platform) == "windows" } { lappend values windres } ComboBox $f2.cb -textvariable cproject::thisdataL($link,linker) -values $values \ -grid "0 w" -width 7 entry $f2.e -grid 1 -textvariable cproject::thisdataL($link,libraries) TitleFrame $f.f3 -text "additional link flags" -grid "0 n" set f3 [$f.f3 getframe] entry $f3.e -grid 0 -textvariable cproject::thisdataL($link,linkflags) TitleFrame $f.f4 -text "output name" -grid "0 n" set f4 [$f.f4 getframe] entry $f4.e -grid 0 -textvariable cproject::thisdataL($link,linkexe) set bbox [ButtonBox $f.bbox -spacing 0 -padx 1 -pady 1 -homogeneous 1 -grid "0 nw"] $bbox add -image acttick16 \ -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1 -padx 1 -pady 1 \ -helptext [_ "Create new link tab"] \ -command [list cproject::CreateDeleteLinkTab $link create] $bbox add -image actcross16 \ -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1 -padx 1 -pady 1 \ -helptext [_ "Delete link tab"] \ -command [list cproject::CreateDeleteLinkTab $link delete] $bbox add -image edit16 \ -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1 -padx 1 -pady 1 \ -helptext [_ "Rename link tab"] \ -command [list cproject::CreateDeleteLinkTab $link rename] supergrid::go $f0 supergrid::go $f1 supergrid::go $f2 supergrid::go $f3 supergrid::go $f4 supergrid::go $f } proc cproject::CreateDeleteLinkTab { currentlink what } { variable links variable dataL variable notebook syncfromUI switch $what { create { set num [expr [llength $links]+1] set newlink Link$num foreach i [array names dataL *,$currentlink,*] { regexp {([^,]+),[^,]+,([^,]+)} $i {} dr v set dataL($dr,$newlink,$v) $dataL($i) } lappend links $newlink $notebook raise $newlink } delete { if { [llength $links] == 1 } { WarnWin "Error: There must be at least one link tab" $notebook return } set ret [DialogWin::messageBox -default ok -icon warning -message \ "Are you sure to delete link tab '$currentlink'?" -parent $notebook \ -title "delete link tab" -type okcancel] if { $ret == "cancel" } { return } set delpos [lsearch $links $currentlink] foreach i [array names dataL *,$currentlink,*] { unset dataL($i) } set links [lreplace $links $delpos $delpos] if { $delpos >= [llength $links] } { set delpos 0 } $notebook raise [lindex $links $delpos] } rename { CopyNamespace ::DialogWin ::DialogWinCR set f [DialogWinCR::Init $notebook "Enter link name" separator ""] set w [winfo toplevel $f] label $f.l -text "Enter new name for link tab '$currentlink'" -grid "0 px3 py3" entry $f.e -textvariable DialogWinCR::user(name) -grid "0 px10 py3" -width 30 set DialogWinCR::user(name) $currentlink tkTabToWindow $f.e supergrid::go $f bind $w <Return> "DialogWinCR::InvokeOK" set action [DialogWinCR::CreateWindow] while 1 { switch $action { 0 { DialogWinCR::DestroyWindow namespace delete ::DialogWinCR return } 1 { set newlink [string trim $DialogWinCR::user(name)] if { ![string match "Link *" $newlink] } { set newlink "Link $newlink" } if { $newlink == "" } { WarnWin "Link tab name cannot be void" $w } elseif { [lsearch $links $newlink] != -1 } { WarnWin "Link tab name already exists" $w } else { DialogWinCR::DestroyWindow namespace delete ::DialogWinCR break } } } set action [DialogWinCR::WaitForWindow] } set pos [lsearch $links $currentlink] foreach i [array names dataL *,$currentlink,*] { regexp {([^,]+),[^,]+,([^,]+)} $i {} dr v set dataL($dr,$newlink,$v) $dataL($i) unset dataL($i) } set links [lreplace $links $pos $pos $newlink] } } synctoUI } proc cproject::AreFilesEqual { file1 file2 } { if { $::tcl_platform(platform) == "windows" } { return [string equal -nocase $file1 $file2] } else { return [string equal $file1 $file2] } } proc cproject::ConvertToRelative { dir file } { set list1 [file split $dir] set list2 [file split $file] for { set i 0 } { $i < [llength $list2] } { incr i } { if { ![AreFilesEqual [lindex $list1 $i] [lindex $list2 $i]] } { break } } set listres "" for { set j $i } { $j < [llength $list1] } { incr j } { lappend listres .. } for { set j $i } { $j < [llength $list2] } { incr j } { lappend listres [lindex $list2 $j] } if { $listres == "" } { return . } return [eval file join $listres] } proc cproject::IsProjectNameOk {} { variable project variable notebook if { [info exists notebook] && [winfo exists notebook] } { set w [winfo toplevel $notebook] } else { set w . } if { [string trim $project] == "" } { WarnWin "Define a project name before entering data" $w return -code return } if { [file pathtype $project] != "absolute" } { set project [file join [pwd] $project] if { ![file isdir [file dirname $project]] } { WarnWin "Project pathname is not correct" $w return -code return } } return [file dirname $project] } proc cproject::AddModFiles { listbox what } { variable project variable files variable group set projectdir [IsProjectNameOk] switch $what { "view" { if { [llength [$listbox curselection]] != 1 } { WarnWin "Error: Select just one file to see it" $listbox return } foreach "file_in type group_in path" [lindex $files [$listbox curselection]] break set file [file join [file dirname $project] $path $file_in] RamDebugger::OpenFileF [RamDebugger::filenormalize $file] } "file" { set types { {{C Source Files} {.c .cc .h} } {{All Files} * } } set file [tk_getOpenFile -filetypes $types -initialdir $projectdir -parent $listbox \ -title "Insert file into project"] if { $file == "" } { return } set file [ConvertToRelative $projectdir $file] foreach i $files { foreach "file_in type group_in path" $i break if { [AreFilesEqual $file $file_in] } { WarnWin "Error: file '$file' is already in the project" $listbox return } } lappend files [list [file tail $file] [string trimleft [file ext $file] .] $group \ [file dirname $file]] } "dir" { set dir [RamDebugger::filenormalize [tk_chooseDirectory -initialdir $projectdir \ -parent $listbox \ -title "Insert files from directory into project" -mustexist 1]] if { $dir == "" } { return } set fileslist "" foreach i $files { foreach "file_in type group_in path" $i break lappend fileslist $file_in } set num 0 foreach i [glob -nocomplain -dir $dir *.c *.cc] { set file [ConvertToRelative $projectdir $i] if { [RamDebugger::lsearchfile $fileslist $file] != -1 } { continue } lappend files [list [file tail $file] [string trimleft [file ext $file] .] $group \ [file dirname $file]] incr num } WarnWin "Inserted $num new files" $listbox } edit { set num 0 set numdiff 0 foreach i [$listbox curselection] { foreach "file_in type group_in path" [lindex $files $i] break if { $group != $group_in } { incr numdiff } set files [lreplace $files $i $i [list $file_in $type $group $path]] incr num } WarnWin "Replaced group to $num files ($numdiff new)" } delete { set num 0 foreach i [$listbox curselection] { set ipos [expr $i-$num] set files [lreplace $files $ipos $ipos] incr num } $listbox selection clear 0 end WarnWin "Deleted from project $num files" } } } proc cproject::AddDelDirectories { listbox what } { set projectdir [IsProjectNameOk] set dir [IsProjectNameOk] switch $what { add { set dir [RamDebugger::filenormalize [tk_chooseDirectory -initialdir $dir -parent $listbox \ -title "Add directories" -mustexist 1]] if { $dir == "" } { return } $listbox insert end [ConvertToRelative $projectdir $dir] } delete { set num 0 foreach i [$listbox curselection] { set ipos [expr $i-$num] $listbox delete $ipos incr num } $listbox selection clear 0 end } } } proc cproject::TryToFindPath { file } { variable project variable files set last_path "" set base_dir [file dirname $project] if { [file exists [file join $base_dir $file]] } { return [file join $base_dir $file] } foreach i $files { foreach "file_in type group_in path" $i break if { $path == $last_path } { continue } if { [file exists [file join $base_dir $path $file]] } { return [file join $base_dir $path $file] } set last_path $path } return "" } proc cproject::ScanHeaders { file } { set fin [open $file r] set aa [read $fin] close $fin set headers "" foreach "- header" [regexp -inline -all {\#include\s+\"([^\"]+)\"} $aa] { set file [file join [file dirname $file] $header] if { [file exist $file] } { lappend headers [file join [file dirname $file] $header] } } return $headers } proc cproject::CleanCompiledFiles { w } { variable project variable files variable debugrelease variable dataC variable dataL variable dataE RamDebugger::SetMessage "Cleaning compilation files..." RamDebugger::WaitState 1 if { $project == "" } { if { [info exists RamDebugger::options(recentprojects)] && \ [llength $RamDebugger::options(recentprojects)] > 0 } { set project [lindex $RamDebugger::options(recentprojects) 0] set err [catch { cproject::OpenProject $w 0 }] if { $err } { set project "" } } if { $project == "" } { cproject::Create $w return } } if { $debugrelease == "both" } { WarnWin "error: program must be in debug or in release mode" RamDebugger::WaitState 0 return } set objdir [file join [file dirname $project] [file root $project]_$debugrelease] foreach i [glob -nocomplain -dir $objdir *] { file delete $i } # foreach i $files { # foreach "file_in type group_in path" $i break # set objfile [file join $objdir [file root $file_in].o] # if { [file exists $objfile] } { file delete $objfile } # } # set exename [file join $dataE($debugrelease,execdir) $dataE($debugrelease,exe)] # if { $::tcl_platform(platform) == "windows" && [file ext $exename] != ".exe" } { # append exename .exe # } # if { [file exists $exename] } { file delete $exename } RamDebugger::TextCompClear RamDebugger::TextCompRaise RamDebugger::TextCompInsert "Compilation files deleted" RamDebugger::WaitState 0 RamDebugger::SetMessage "Cleaning compilation files...done" } proc cproject::TouchFiles { w } { variable project variable files variable debugrelease variable dataC variable dataL variable dataE RamDebugger::SetMessage "Actualizing date for compilation files..." RamDebugger::WaitState 1 if { $project == "" } { if { [info exists RamDebugger::options(recentprojects)] && \ [llength $RamDebugger::options(recentprojects)] > 0 } { set project [lindex $RamDebugger::options(recentprojects) 0] set err [catch { cproject::OpenProject $w 0 }] if { $err } { set project "" } } if { $project == "" } { cproject::Create $w return } } if { $debugrelease == "both" } { WarnWin "error: program must be in debug or in release mode" RamDebugger::WaitState 0 return } set objdir [file join [file dirname $project] [file root $project]_$debugrelease] set time [clock seconds] foreach i [glob -nocomplain -dir $objdir *] { file mtime $i $time } RamDebugger::TextCompClear RamDebugger::TextCompRaise RamDebugger::TextCompInsert "Actualized date for compilation files" RamDebugger::WaitState 0 RamDebugger::SetMessage "Actualizing date for compilation files...done" } proc cproject::CompileAll { w } { RamDebugger::TextCompClear foreach i [list debug release] { CompileDo $w $i "" } } proc cproject::Compile { w { unique_file "" } } { variable debugrelease RamDebugger::TextCompClear CompileDo $w $debugrelease $unique_file } proc cproject::CompileDo { w debugrelease { unique_file "" } } { variable project variable files variable dataC variable dataL variable dataE variable links variable compilationstatus if { $project == "" } { if { [info exists RamDebugger::options(recentprojects)] && \ [llength $RamDebugger::options(recentprojects)] > 0 } { set project [lindex $RamDebugger::options(recentprojects) 0] set err [catch { cproject::OpenProject $w 0 }] if { $err } { set project "" } } if { $project == "" } { cproject::Create $w return } } if { $debugrelease != "debug" && $debugrelease != "release" } { WarnWin "error: program must be in debug or in release mode" return } if { [auto_execok gcc] == "" } { set ret [DialogWin::messageBox -default yes -icon question -message \ "Could not find command 'gcc'. Do you want to see the help?" -parent $w \ -title "Command not found" -type yesno] if { $ret == "yes" } { RamDebugger::ViewHelpFile "01RamDebugger/RamDebugger_12.html" } return } $RamDebugger::mainframe setmenustate debugentry disabled $RamDebugger::mainframe setmenustate c++entry disabled set menu [$RamDebugger::mainframe getmenu c++] $menu add separator $menu add command -label "Stop compiling" -command \ "set ::cproject::compilationstatus 2" set pwd [pwd] cd [file dirname $project] set objdir [file tail [file root $project]]_$debugrelease if { ![file exists $objdir] } { file mkdir $objdir } set cproject::compilationstatus -1 if { $unique_file != "" } { set found 0 set unique_file [RamDebugger::filenormalize $unique_file] foreach i $files { foreach "file_in type group_in path" $i break set file_in2 [RamDebugger::filenormalize [file join [file dirname $project] $path $file_in]] if { [string equal $file_in2 $unique_file] } { set compfiles [list $i] set found 1 break } } if { !$found } { WarnWin "error: file '$unique_file' is not included in the compile project" set cproject::compilationstatus 1 set compfiles "" } set forcecompile 1 set project_short "$file_in $debugrelease" } else { set compfiles $files set forcecompile 0 set project_short "[file root [file tail $project]] $debugrelease" } RamDebugger::TextCompRaise RamDebugger::TextCompInsert "[string repeat - 20]Compiling $project_short" RamDebugger::TextCompInsert "[string repeat - 20]\n" update set make [file join $objdir Makefile.ramdebugger] if { $unique_file != "" } { append make 1 } set fout [open $make w] puts -nonewline $fout "\n# Makefile -*- makefile -*- " puts $fout "Created: [clock format [clock seconds] -format {%Y-%m-%d %H:%M:%S}]" puts $fout "\n[string repeat # 80]" puts $fout "# Makefile automatically made by RamDebugger" puts $fout "# execute it from the upper directory" puts $fout "[string repeat # 80]\n" if { $unique_file == "" } { puts -nonewline $fout "all: " foreach link $links { puts -nonewline $fout "[file join $objdir $dataL($debugrelease,$link,linkexe)] " } puts $fout "\n" } foreach i $compfiles { foreach "file_in type group_in path" $i break if { [string trim $dataC($group_in,$debugrelease,compiler)] == "" } { continue } set file [file join $path $file_in] set objfile [file join $objdir [file root $file_in].o] if { $forcecompile && [file exists $objfile] } { file delete $objfile } set dependencies [ScanHeaders $file] puts $fout "$objfile: $file $dependencies" puts -nonewline $fout "\t$dataC($group_in,$debugrelease,compiler) " foreach j $dataC($group_in,$debugrelease,flags) { puts -nonewline $fout "$j " } foreach j $dataC($group_in,$debugrelease,includedirs) { puts -nonewline $fout "-I$j " } foreach j $dataC($group_in,$debugrelease,defines) { puts -nonewline $fout "-D$j " } puts -nonewline $fout "\\\n\t\t-o $objfile " puts $fout "$file\n" } if { $unique_file == "" } { foreach link $links { set objfiles "" foreach i $files { foreach "file_in type group_in path" $i break if { [lsearch $dataL($debugrelease,$link,linkgroups) $group_in] != -1 || \ [lsearch $dataL($debugrelease,$link,linkgroups) All] != -1 } { if { [file ext $file_in] == ".rc" } { lappend objfiles [file join $path $file_in] } else { lappend objfiles [file join $objdir [file root $file_in].o] } } } set outputname [file join $objdir $dataL($debugrelease,$link,linkexe)] set target [string toupper OBJFILES_$link] set string "$target = " foreach i $objfiles { append string "$i " if { [string length $string] > 70 } { puts $fout "$string \\" set string "" } } puts $fout "$string\n" puts $fout "$outputname: \$($target)" puts -nonewline $fout "\t$dataL($debugrelease,$link,linker) " foreach j $dataL($debugrelease,$link,linkflags) { puts -nonewline $fout "$j " } puts -nonewline $fout "-o $outputname \$($target) " foreach j $dataL($debugrelease,$link,librariesdirs) { if { $dataL($debugrelease,$link,linker) != "windres" } { puts -nonewline $fout "-L$j " } else { puts -nonewline $fout "--include $j " } } if { $dataL($debugrelease,$link,linker) != "windres" } { puts -nonewline $fout "-L$objdir " } foreach j $dataL($debugrelease,$link,libraries) { if { [regexp {^lib([^.]+)} $j {} j2] } { puts -nonewline $fout "-l$j2 " } elseif { [file exists $j] } { puts -nonewline $fout "$j " } else { puts -nonewline $fout "[file join $objdir $j] " } } puts $fout "\n" } } close $fout if { $::tcl_platform(platform) == "windows" } { set comm [list start /w /m make -f $make] } else { set comm [list make -f $make] } RamDebugger::TextCompInsert "make -f $make\n" set fin [open "|$comm |& cat" r] fconfigure $fin -blocking 0 fileevent $fin readable [list cproject::CompileFeedback $fin] vwait cproject::compilationstatus if { $compilationstatus == 2 } { if { $::tcl_platform(platform) == "windows" } { # maybe it kills also other compilations from other RamDebugger's or manual make's # but that's live and that's windows foreach i [split [exec tlist] \n] { if { [string match -nocase "*make.exe*" $i] } { catch { exec kill /f [scan $i %d] } } } } catch { close $fin } } switch -- $compilationstatus { -1 { RamDebugger::TextCompInsert "Project '$project_short' is up to date" } 0 { RamDebugger::TextCompInsert "[string repeat - 20]Ending compilation of " RamDebugger::TextCompInsert "$project_short" RamDebugger::TextCompInsert "[string repeat - 20]\n" } 1 { RamDebugger::TextCompInsert "[string repeat - 20]Failing compilation of $project_short" RamDebugger::TextCompInsert "[string repeat - 20]\n" update } 2 { RamDebugger::TextCompInsert "[string repeat - 20]compilation of $project_short stopped " RamDebugger::TextCompInsert "at user demand[string repeat - 20]\n" update } } cd $pwd $menu delete end $menu delete end $RamDebugger::mainframe setmenustate c++entry normal $RamDebugger::mainframe setmenustate debugentry normal } proc cproject::CompileFeedback { fin} { variable compilationstatus if { [eof $fin] } { set err [catch { close $fin } errstring] if { $err } { RamDebugger::TextCompInsert $errstring\n set compilationstatus 1 } else { set compilationstatus 0 } return } gets $fin aa if { $aa != "" } { RamDebugger::TextCompInsert $aa\n update } } |
Added scripts/tclIndex.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# Tcl autoload index file, version 2.0 # This file is generated by the "auto_mkindex" command # and sourced to set up indexing information for one or # more commands. Typically each line is a command that # sets an element in the auto_index array, where the # element name is the name of a command and the value is # a script that loads the command. set auto_index(::cproject::Init) [list source [file join $dir cplusplusproject.tcl]] set auto_index(::cproject::synctoUI) [list source [file join $dir cplusplusproject.tcl]] set auto_index(::cproject::syncfromUI) [list source [file join $dir cplusplusproject.tcl]] set auto_index(::cproject::TranferDataToLowerGroups) [list source [file join $dir cplusplusproject.tcl]] set auto_index(::cproject::SaveProjectC) [list source [file join $dir cplusplusproject.tcl]] set auto_index(::cproject::UpdateComboValues) [list source [file join $dir cplusplusproject.tcl]] set auto_index(::cproject::NewProject) [list source [file join $dir cplusplusproject.tcl]] set auto_index(::cproject::GiveDebugData) [list source [file join $dir cplusplusproject.tcl]] set auto_index(::cproject::OpenProject) [list source [file join $dir cplusplusproject.tcl]] set auto_index(::cproject::SaveProject) [list source [file join $dir cplusplusproject.tcl]] set auto_index(::cproject::SetGroupActive) [list source [file join $dir cplusplusproject.tcl]] set auto_index(::cproject::SetDebugReleaseActive) [list source [file join $dir cplusplusproject.tcl]] set auto_index(::cproject::CreateModifyGroup) [list source [file join $dir cplusplusproject.tcl]] set auto_index(::cproject::Create) [list source [file join $dir cplusplusproject.tcl]] set auto_index(::cproject::AreFilesEqual) [list source [file join $dir cplusplusproject.tcl]] set auto_index(::cproject::ConvertToRelative) [list source [file join $dir cplusplusproject.tcl]] set auto_index(::cproject::IsProjectNameOk) [list source [file join $dir cplusplusproject.tcl]] set auto_index(::cproject::AddModFiles) [list source [file join $dir cplusplusproject.tcl]] set auto_index(::cproject::AddDelDirectories) [list source [file join $dir cplusplusproject.tcl]] set auto_index(::cproject::TryToFindPath) [list source [file join $dir cplusplusproject.tcl]] set auto_index(::cproject::ScanHeaders) [list source [file join $dir cplusplusproject.tcl]] set auto_index(::cproject::CompileClean) [list source [file join $dir cplusplusproject.tcl]] set auto_index(::cproject::Compile) [list source [file join $dir cplusplusproject.tcl]] set auto_index(::cproject::CompileFeedback) [list source [file join $dir cplusplusproject.tcl]] set auto_index(::RamDebugger::Instrumenter::InitState) [list source [file join $dir Instrumenter.tcl]] set auto_index(::RamDebugger::Instrumenter::PushState) [list source [file join $dir Instrumenter.tcl]] set auto_index(::RamDebugger::Instrumenter::PopState) [list source [file join $dir Instrumenter.tcl]] set auto_index(::RamDebugger::Instrumenter::CheckEndOfFileState) [list source [file join $dir Instrumenter.tcl]] set auto_index(::RamDebugger::Instrumenter::DoWork) [list source [file join $dir Instrumenter.tcl]] set auto_index(::RamDebugger::Instrumenter::DoWorkForTime) [list source [file join $dir Instrumenter.tcl]] set auto_index(::RamDebugger::Instrumenter::DoWorkForC++) [list source [file join $dir Instrumenter.tcl]] set auto_index(::RamDebugger::DisplayWindowsHierarchyInfo) [list source [file join $dir WindowsHierarchy.tcl]] set auto_index(::RamDebugger::DisplayWindowsHierarchyInfoDo) [list source [file join $dir WindowsHierarchy.tcl]] set auto_index(::RamDebugger::DisplayWindowsHierarchyInfoDo2) [list source [file join $dir WindowsHierarchy.tcl]] set auto_index(::RamDebugger::DisplayWindowsHierarchyDoDraw) [list source [file join $dir WindowsHierarchy.tcl]] set auto_index(::RamDebugger::DisplayWindowsHierarchyDo) [list source [file join $dir WindowsHierarchy.tcl]] set auto_index(::RamDebugger::DisplayWindowsHierarchyFind) [list source [file join $dir WindowsHierarchy.tcl]] set auto_index(::RamDebugger::DisplayWindowsHierarchy) [list source [file join $dir WindowsHierarchy.tcl]] set auto_index(::RamDebugger::CreateImages) [list source [file join $dir Images.tcl]] set auto_index(::RamDebugger::DisplayVar) [list source [file join $dir HelperWindows.tcl]] set auto_index(::RamDebugger::DisplayVar2) [list source [file join $dir HelperWindows.tcl]] set auto_index(::RamDebugger::DisplayVarWindowEval) [list source [file join $dir HelperWindows.tcl]] set auto_index(::RamDebugger::DisplayVarWindowCancel) [list source [file join $dir HelperWindows.tcl]] set auto_index(::RamDebugger::DisplayVarWindow) [list source [file join $dir HelperWindows.tcl]] set auto_index(::RamDebugger::DisplayBreakpointsWindowSetCond) [list source [file join $dir HelperWindows.tcl]] set auto_index(::RamDebugger::DisplayBreakpointsWindow) [list source [file join $dir HelperWindows.tcl]] set auto_index(::RamDebugger::CreateModifyFonts) [list source [file join $dir HelperWindows.tcl]] set auto_index(::RamDebugger::UpdateFont) [list source [file join $dir HelperWindows.tcl]] set auto_index(::RamDebugger::PreferencesWindow) [list source [file join $dir HelperWindows.tcl]] set auto_index(::RamDebugger::DisplayTimesWindowStart) [list source [file join $dir HelperWindows.tcl]] set auto_index(::RamDebugger::DisplayTimesWindowReport) [list source [file join $dir HelperWindows.tcl]] set auto_index(::RamDebugger::DisplayTimesWindowCancel) [list source [file join $dir HelperWindows.tcl]] set auto_index(::RamDebugger::DisplayTimesPickSelection) [list source [file join $dir HelperWindows.tcl]] set auto_index(::RamDebugger::DisplayTimesDrawSelection) [list source [file join $dir HelperWindows.tcl]] set auto_index(::RamDebugger::ModifyTimingBlock) [list source [file join $dir HelperWindows.tcl]] set auto_index(::RamDebugger::DisplayTimesWindow) [list source [file join $dir HelperWindows.tcl]] set auto_index(::RamDebugger::AboutWindow) [list source [file join $dir HelperWindows.tcl]] set auto_index(::RamDebugger::AboutMoveCanvas) [list source [file join $dir HelperWindows.tcl]] set auto_index(::RamDebugger::MotionInAbout) [list source [file join $dir HelperWindows.tcl]] set auto_index(::RamDebugger::GotoLine) [list source [file join $dir HelperWindows.tcl]] set auto_index(::RamDebugger::DebugCplusPlusWindow) [list source [file join $dir HelperWindows.tcl]] set auto_index(::RamDebugger::Compile) [list source [file join $dir HelperWindows.tcl]] set auto_index(::RamDebugger::CompileFeedback) [list source [file join $dir HelperWindows.tcl]] set auto_index(::RamDebugger::FindFilesWithPattern) [list source [file join $dir HelperWindows.tcl]] set auto_index(::RamDebugger::SearchInFilesDo) [list source [file join $dir HelperWindows.tcl]] set auto_index(::RamDebugger::SearchInFiles) [list source [file join $dir HelperWindows.tcl]] set auto_index(::RamDebugger::SearchWindow) [list source [file join $dir HelperWindows.tcl]] set auto_index(::RamDebugger::Search) [list source [file join $dir HelperWindows.tcl]] set auto_index(::RamDebugger::OpenProgram) [list source [file join $dir HelperWindows.tcl]] set auto_index(::RamDebugger::OpenConsole) [list source [file join $dir HelperWindows.tcl]] |