⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tcl-debug.ps

📁 Linux下的tcl语言调试器
💻 PS
📖 第 1 页 / 共 5 页
字号:
4 .7 FMFILL5 .9 FMFILL6 .97 FMFILL7 1 FMFILL8 <0f1e3c78f0e1c387> FMFILL9 <0f87c3e1f0783c1e> FMFILL10 <cccccccccccccccc> FMFILL11 <ffff0000ffff0000> FMFILL12 <8142241818244281> FMFILL13 <03060c183060c081> FMFILL14 <8040201008040201> FMFILL16 1 FMFILL17 .9 FMFILL18 .7 FMFILL19 .5 FMFILL20 .3 FMFILL21 .1 FMFILL22 0.03 FMFILL23 0 FMFILL24 <f0e1c3870f1e3c78> FMFILL25 <f0783c1e0f87c3e1> FMFILL26 <3333333333333333> FMFILL27 <0000ffff0000ffff> FMFILL28 <7ebddbe7e7dbbd7e> FMFILL29 <fcf9f3e7cf9f3f7e> FMFILL30 <7fbfdfeff7fbfdfe> FMFILL%%EndSetup%%Page: "3" 1%%BeginPaperSize: Letter%%EndPaperSize612 792 0 FMBEGINPAGE0 12 Q0 X0 K(T) 72 27 T(cl/Tk W) 78.9 27 T(orkshop - June 10-1) 119.89 27 T(1, 1993 - Berkeley) 220.85 27 T(, CA) 311.46 27 T1 10 Q(3) 553 27 T0 18 Q(Intr) 72 177.67 T(oduction) 102.65 177.67 T1 12 Q0.48 (T) 72 156.67 P0.48 (cl [1][2] is a language speci\336cally intended for) 78.49 156.67 P2.75 (generic application control.  In some applica-) 72 142.67 P6.1 (tions it dominates the user) 72 128.67 P6.1 (\325) 222.76 128.67 P6.1 (s view of the) 226.09 128.67 P0.56 (application.  Expect [3][4] is a good example of) 72 114.67 P0.81 (this.  Expect is always executing T) 72 100.67 P0.81 (cl statements) 242.9 100.67 P1.46 (\320 usually from a script.  When the script ends,) 72 86.67 P(Expect ends.) 72 72.67 T1.37 (This type of application is common.  W) 324 157.83 P1.37 (ith this) 523.64 157.83 P1.07 (heavy reliance on T) 324 143.83 P1.07 (cl, it is useful to have a de-) 421.28 143.83 P2.76 (bugger that understands T) 324 129.83 P2.76 (cl.  For example, it) 456.35 129.83 P0.77 (should be able to single-step and print values at) 324 115.83 P(user discretion.) 324 101.83 T0.59 (The debugger described herein works in exactly) 324 82.83 P2.15 (this way) 324 68.83 P2.15 (.  It works best with applications like) 365.69 68.83 P126 225 504 684 R7 XV0 24 Q0 X(A Debugger for T) 148.87 668 T(cl Applications) 328.53 668 T2 14 Q(Don Libes) 286.04 632.67 T1 F(National Institute of Standards and T) 182.77 611.67 T(echnology) 388.93 611.67 T2 F(Abstract) 291.29 548.67 T1 12 Q0.51 (T) 126 529 P0.51 (cl is a language speci\336cally intended for generic application control.  By us-) 132.49 529 P2.79 (ing it, application programmers escape the dilemma of whether to design) 126 515 P2.36 (sophisticated application-speci\336c languages or whether to build tools more) 126 501 P0.5 (quickly but that are limited in \337exibility) 126 487 P0.5 (.  T) 320.13 487 P0.5 (cl is easy for application program-) 336.62 487 P0.49 (mers to use, however) 126 473 P0.49 (, up to now) 228.91 473 P0.49 (, there has been no general-purpose debugger) 283.58 473 P(for application users.) 126 459 T1.88 (This paper describes an implementation of a debugger for T) 126 440 P1.88 (cl applications.) 429.5 440 P1.02 (The debugger has a typical front-end but with some extremely unusual com-) 126 426 P0.37 (mands, in part because of the features and limitations of T) 126 412 P0.37 (cl.  The debugger is) 407.61 412 P1.47 (modeless, allowing users to issue T) 126 398 P1.47 (cl and application commands along with) 302.42 398 P0.58 (debugger commands.  Each type of command may invoke the other) 126 384 P0.58 (, allowing) 455.44 384 P(debugging to be programmed, dynamically or in advance.) 126 370 T0.43 (The debugger is written in C and is very fast.  When linked in but not used, it) 126 351 P0.99 (does not slow applications at all.  The debugger requires no modi\336cations to) 126 337 P(the T) 126 323 T(cl core, and can be plugged into applications with little ef) 150.14 323 T(fort.) 425.4 323 T(Keywords: T) 126 285 T(cl, Tk, T) 188.11 285 T(ool Command Language, Expect, debugger) 228.58 285 T(, interpreter) 436.62 285 T2 F0.57 (Reprinted fr) 126 247 P0.57 (om Pr) 184.42 247 P0.57 (oceedings of the 1993 T) 214.2 247 P0.57 (cl/Tk W) 329.96 247 P0.57 (orkshop, Berkeley) 366.4 247 P0.57 (, CA, June) 452.9 247 P(10-1) 126 233 T(1, 1993.) 147.1 233 TFMENDPAGE%%EndPage: "3" 2%%Page: "4" 2612 792 0 FMBEGINPAGE0 12 Q0 X0 K(A Debugger for T) 54 758.33 T(cl Applications) 143.83 758.33 T(Don Libes) 487.68 758.33 T1 10 Q(4) 54 27 T0 12 Q(T) 277.22 27 T(cl/Tk W) 284.12 27 T(orkshop - June 10-1) 325.11 27 T(1, 1993 - Berkeley) 426.08 27 T(, CA) 516.68 27 T1 F0.6 (Expect that sequentially execute T) 54 730 P0.6 (cl commands,) 220.77 730 P0.81 (although it can also be used with any T) 54 716 P0.81 (cl appli-) 247.55 716 P(cation.) 54 702 T2.39 (This paper has three parts.  The \336rst part de-) 54 683 P-0.12 (scribes the debugger in terms of how it is used in) 54 669 P-0.08 (a typical application.   The second part of the pa-) 54 655 P8.03 (per describes how the debugger can be) 54 641 P1.48 (integrated into T) 54 627 P1.48 (cl applications.  The third part) 136.06 627 P1.36 (describes the design and implementation of the) 54 613 P(debugger) 54 599 T(.) 97.97 599 T0 18 Q(V) 54 567 T(iew by the Application User) 66.32 567 T1 12 Q1.35 (This section of the paper is a debugger tutorial) 54 546 P1.34 (which shows the application user) 54 532 P1.34 (\325) 219.02 532 P1.34 (s view of the) 222.36 532 P0.84 (debugger) 54 518 P0.84 (.  For the sake of concreteness, Expect) 97.97 518 P2.08 ([1] will be used as the application.  However) 54 504 P2.08 (,) 285 504 P2.8 (any other application using the debugger will) 54 490 P(work similarly) 54 476 T(.) 123.51 476 T0 F(Starting the Debugger) 54 454 T1 F0.93 (The debugger is initially invoked in an applica-) 54 435 P0.75 (tion-dependent way) 54 421 P0.75 (.  In Expect, the debugger is) 148.9 421 P(started by using the \337ag \322-D 1\323.  For example:) 54 407 T3 11 Q(% expect -D 1 script) 72 388.67 T1 12 Q2.78 (If the system supports the #! mechanism, the) 54 374 P(script may also be started as:) 54 360 T3 11 Q(% script -D 1) 72 341.67 T1 12 Q0.25 (In either case, additional ar) 54 327 P0.25 (guments may be sup-) 184.99 327 P(plied as usual.) 54 313 T1.72 (The user is prompted for a command.  At this) 54 294 P1.73 (point either Expect commands, T) 54 280 P1.73 (cl commands,) 219.65 280 P0.48 (or debugger commands may be entered.  This is) 54 266 P-0.25 (true at all other times that the user is prompted as) 54 252 P(well.  The debugger is modeless.) 54 238 T1.5 (The following T) 54 219 P1.5 (cl commands illustrate that the) 134.77 219 P(debugger evaluates T) 54 205 T(cl commands as usual.) 155.74 205 T3 11 Q(expect2.1> set m {a b c}) 72 186.67 T(a b c) 72 175.67 T(expect2.2> llength $m) 72 164.67 T(3) 72 153.67 T(expect2.3>) 72 142.67 T1 12 Q1.21 (The command prompt is changeable by the ap-) 54 128 P-0.09 (plication or user) 54 114 P-0.09 (.  Here, the second number is the) 131.1 114 P2.41 (T) 54 100 P2.41 (cl history identi\336er) 60.49 100 P2.41 (.  The \336rst number is the) 155.93 100 P(depth of the evaluation stack.) 54 86 T0.51 (In the context of a script, the initial depth of the) 306 730 P0.02 (evaluation stack is 1 but the debugger always in-) 306 716 P0.02 (troduces a new level to the stack.  Hence, we see) 306 702 P(a \3222\323 in the prompt.) 306 688 T0.54 (Expect also allows the application to take initial) 306 669 P1.31 (control.  By using the \337ag \322-D 0\323, the applica-) 306 655 P0.39 (tion runs until the user presses ^C at which time) 306 641 P0.69 (the debugger begins running.  The remainder of) 306 627 P1.97 (this tutorial will assume that the debugger has) 306 613 P(started up immediately from the \337ag \322-D 1\323.) 306 599 T0 F(Command Overview and Philosophy) 306 577 T1 F(The debugger commands are:) 306 558 T352.64 537.69 324 537.69 2 LV0.59 H0 ZN(Name) 324 539 T424.96 537.69 369 537.69 2 LVN(Description) 369 539 T(s) 338.11 523 T(step into procedure) 369 523 T(n) 338.11 508 T(step over procedure) 369 508 T(r) 338.11 493 T(return from procedure) 369 493 T(b) 338.11 478 T(set, clear) 369 478 T(, or show breakpoint) 411.14 478 T(c) 338.11 463 T(continue) 369 463 T(w) 338.11 448 T(show stack) 369 448 T(u) 338.11 433 T(move scope up) 369 433 T(d) 338.11 418 T(move scope down) 369 418 T(h) 338.11 403 T(help) 369 403 T0.12 (The debugger commands are all one letter) 306 386 P0.12 (. Short) 507.89 386 P0.7 (procedure names are desirable in an interactive-) 306 372 P1.31 (only application such as the debugger) 306 358 P1.31 (.  In con-) 492.77 358 P1.9 (trast, scripted applications rarely use one-letter) 306 344 P2.03 (commands.  The chances of name con\337ict be-) 306 330 P0.03 (tween the debugger and scripted applications are) 306 316 P(very low) 306 302 T(.) 347.52 302 T2.5 (The command names are very similar and, in) 306 283 P0.19 (some cases, identical to other popular debuggers) 306 269 P0.54 (\050gdb, dbx, etc.\051.  Existing T) 306 255 P0.54 (cl procedures are di-) 440.13 255 P0.23 (rectly usable so there are no new commands, for) 306 241 P-0.14 (example, to print variables since T) 306 227 P-0.14 (cl already pro-) 470.35 227 P2.58 (vides such commands \050e.g., set, puts, parray\051.) 306 213 P1.76 (The intent of the debugger is that it should be) 306 199 P0.83 (easy to learn and use, and otherwise stay out of) 306 185 P(the way) 306 171 T(.) 342.86 171 T0.03 (The debugger uses the application\325) 306 152 P0.03 (s top-level in-) 473.32 152 P0.47 (teractor) 306 138 P0.47 (.  In the case of Expect, for example, the) 341.97 138 P-0.03 (debugger uses Expect\325) 306 124 P-0.03 (s interact command which) 413.85 124 P(prompts for commands and evaluates them.) 306 110 T3.8 (For the purposes of describing the debugger) 306 91 P0.02 (commands, the following script is assumed to be) 306 77 P2.34 (named) 306 63 P2 F2.34 (debug-test.exp) 343.31 63 P1 F2.34 (.) 412.92 63 P1 10 Q1.95 (1) 415.92 67.8 P1 12 Q2.34 (  The script doesn\325) 420.92 63 P2.34 (t do) 519.33 63 PFMENDPAGE%%EndPage: "4" 3%%Page: "5" 3612 792 0 FMBEGINPAGE0 12 Q0 X0 K(Don Libes) 72 758.33 T(A Debugger for T) 391.87 758.33 T(cl Applications) 481.7 758.33 T(T) 72 27 T(cl/Tk W) 78.9 27 T(orkshop - June 10-1) 119.89 27 T(1, 1993 - Berkeley) 220.85 27 T(, CA) 311.46 27 T1 10 Q(5) 553 27 T1 12 Q2.4 (anything useful.  It merely serves to illustrate) 72 730 P(how the debugger is used.) 72 716 T3 11 Q(set b 1) 90 697.67 T(proc p4 {x} {) 90 675.67 T(return [) 126 664.67 T(    expr 5+[expr 1+$x]]) 126 653.67 T(}) 90 642.67 T(set z [) 90 620.67 T(   expr 1+[expr 2+[p4 $b]]) 90 609.67 T(]) 90 598.67 T(proc p3 {} {) 90 576.67 T(set m 0) 126 565.67 T(}) 90 554.67 T(proc p2 {} {) 90 532.67 T(set c 4) 126 521.67 T(p3) 126 510.67 T(set d 5) 126 499.67 T(}) 90 488.67 T(proc p1 {} {) 90 466.67 T(set a 2) 126 455.67 T(p2) 126 444.67 T(set a 3) 126 433.67 T(set a 5) 126 422.67 T(}) 90 411.67 T(p1) 90 389.67 T(set k 7) 90 378.67 T(p1) 90 367.67 T1 12 Q0.43 (If the debugger is started at the beginning of the) 72 353 P2.1 (script, no statements have been executed.  T) 72 339 P2.1 (cl) 297.34 339 P(and application commands have global scope.) 72 325 T3 11 Q(% expect -D 1 debug-test.exp) 90 306.67 T(1: set b 1) 90 295.67 T(expect2.1>) 90 284.67 T1 12 Q0.98 (When a new command is about to be executed,) 72 270 P-0.02 (the debugger prints the command.  It is preceded) 72 256 P1.78 (by the evaluation stack level.  \322set b 1\323 is the) 72 242 P-0.05 (\336rst line in the script.  It has not yet been execut-) 72 228 P(ed.  \322info exists\323 con\336rms this.) 72 214 T3 11 Q(expect2.1> info exists b) 90 195.67 T(0) 90 184.67 T0 14 Q(The \322n\323 command \320 \322Next\323) 72 161.67 T1 12 Q0.36 (The) 72 142 P2 F0.36 (n) 94.01 142 P1 F0.36 ( command executes the pending command) 100.01 142 P1.26 (\320 in this case \322set b 1\323 \320 and displays the next) 72 128 P(command to be executed.) 72 114 T3 11 Q(expect2.2> n) 90 95.67 T(1: proc p4 {} {) 90 84.67 T72 66 306 81 C81 79 225 79 2 L0.5 H2 Z0 X0 KN0 0 612 792 C1 10 Q0 X0 K(1. Italics indicate something being de\336ned.) 90 59.33 T3 11 Q(return [) 378 730.67 T(expr 5+[expr 1+$x]]) 414 719.67 T(}) 342 708.67 T(expect2.3> info exists b) 342 697.67 T(1) 342 686.67 T1 12 Q-0.15 (The command \322info exists b\323 con\336rms that b has) 324 672 P1.58 (been set.  The procedure p4 is about to be de-) 324 658 P(\336ned.) 324 644 T3 11 Q(expect2.4> n) 342 625.67 T(4: p4 $b) 342 614.67 T(expect5.5>) 342 603.67 T1 12 Q1.9 (The procedure p4 has now been de\336ned.  The) 324 589 P0.32 (next command to be executed is p4 itself.  It ap-) 324 575 P(pears in the statement:) 324 561 T3 11 Q(set z [) 342 542.67 T(expr 1+[expr 2+[p4 $b]]) 378 531.67 T(]) 342 520.67 T1 12 Q0.11 (The three sets of braces introduce three new lev-) 324 506 P0.23 (els on the evaluation stack, hence the stack level) 324 492 P0.62 (in which p4 is about to be executed is shown as) 324 478 P(\3224\323.) 324 464 T1 10 Q(1) 343.64 468.8 T1 12 Q1.88 (Notice that the evaluation stack level does not) 324 445 P2.22 (af) 324 431 P2.22 (fect the scope.  W) 333.1 431 P2.22 (e are still in the top-level) 427.3 431 P(scope and b is still visible.) 324 417 T3 11 Q(expect5.5> info exists b) 342 398.67 T(1) 342 387.67 T1 12 Q0.4 (The ar) 324 373 P0.4 (gument to p4 is $b.  The value of this can) 355.15 373 P(be evaluated by using set or puts.) 324 359 T3 11 Q(expect5.6> set b) 342 340.67 T(1) 342 329.67 T(expect5.7> puts $b) 342 318.67 T(1) 342 307.67 T1 12 Q2.19 (Another n command executes p4, popping the) 324 293 P0.21 (stack one level.  Additional n commands contin-) 324 279 P0.15 (ue evaluation of the \322set z\323 command, each time) 324 265 P(popping the stack one level.) 324 251 T3 11 Q(expect5.8> n) 342 232.67 T(3: expr 2+[p4 $b]) 342 221.67 T(expect4.9> n) 342 210.67 T(2: expr 1+[expr 2+[p4 $b]]) 342 199.67 T(expect3.10> n) 342 188.67 T(1: set z [) 342 177.67 T(expr 1+[expr 2+[p4 $b]]) 378 166.67 T(]) 342 155.67 T(expect2.11>) 342 144.67 T324 90 558 105 C333 103 477 103 2 L0.5 H2 Z0 X0 KN0 0 612 792 C1 10 Q0 X0 K0.85 (1. Whether the word \322stack\323 refers to procedure) 342 83.33 P2.31 (call stack or evaluation stack should either be) 342 71.33 P(explicit or clearly implied by context.) 342 59.33 TFMENDPAGE%%EndPage: "5" 4%%Page: "6" 4612 792 0 FMBEGINPAGE0 12 Q0 X0 K(A Debugger for T) 54 758.33 T(cl Applications) 143.83 758.33 T(Don Libes) 487.68 758.33 T

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -