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

📄 ptrace.2

📁 Unix操作系统minix 2.0源码
💻 2
📖 第 1 页 / 共 2 页
字号:
10 I3189(user)S10 R3387(structure)S3765(in)S3868(the)S4016(system.)S5304 V1080(PT_WRITE_I,)S1702(PT_WRITE_D)S5424 V1280(The)S1465(given)S10 I1716(data)S10 R1922(is)S(written)286 2017 A2331(at)S2432(the)S2583(word)S2818(in)S2924(the)S3075(process's)S3478(address)S(space)224 3808 A(corresponding)575 4061 A4665(to)S10 I(addr,)214 4772 A10 R5015(which)S5544 V1280(must)S1513(be)S1646(even)S1874(on)S2012(some)S2262(machines.)S2730(No)S2891(useful)S3175(value)S3431(is)S3536(returned.)S3960(If)S4066(I)S4138(and)S4321(D)S(space)224 4432 A4694(are)S4855(separated,)S5664 V1280(request)S1604(PT_WRITE_I)S2209(indicates)S2600(I)S(space,)249 2668 A2951(PT_WRITE_D)S3596(D)S(space.)249 3703 A4011(Attempts)S4414(to)S4526(write)S4768(in)S4880(pure)S5093(pro-)S5784 V1280(cedure)S1574(fail)S1734(if)S1821(another)S2148(process)S2475(is)S2567(executing)S2983(the)S3131(same)S3363(\256le.)S5952 V1080(PT_WRITE_U)S6072 V1280(The)S1471(process's)S1880(system)S2193(data)S2396(is)S(written,)311 2498 A2844(as)S2963(it)S3054(is)S3156(read)S3365(with)S3579(request)S3905(PT_READ_U.)S4556(Only)S4792(a)S4872(few)S5059(loca-)S6192 V1280(tions)S1509(can)S1683(be)S(written)286 1812 A2132(in)S2244(this)S2423(way:)S2653(the)S2810(general)S3141(registers,)S3541(the)S3697(\257oating)S4037(point)S4276(status)S4538(and)S4716(registers,)S5116(and)S6312 V1280(certain)S1580(bits)S1750(of)S1859(the)S2007(processor)S2418(status)S2672(word.)S6480 V1080(PT_CONTINUE)S6600 V1280(The)S10 I1462(data)S10 R1665(argument)S2070(is)S2162(taken)S2405(as)S2514(a)S2584(signal)S2849(number)S3181(and)S3351(the)S3499(child's)S3798(execution)S4214(continues)S4624(at)S4722(location)S10 I(addr)189 5072 A6720 V10 R1280(as)S1398(if)S1494(it)S1584(had)S1763(incurred)S2132(that)S2316(signal.)S2639(Normally)S3058(the)S3214(signal)S3487(number)S(will)157 3827 A4017(be)S4145(either)S4408(0)S4491(to)S4602(indicate)S4954(that)S5138(the)S6840 V1280(signal)S1545(that)S1721(caused)S2020(the)S2168(stop)S(should)267 2360 A2652(be)S(ignored,)332 2773 A3131(or)S3241(that)S3418(value)S3662(fetched)S3985(out)S4139(of)S4249(the)S4398(process's)S4799(image)S5071(indi-)S6960 V1280(cating)S1563(which)S1846(signal)S2123(caused)S2434(the)S2594(stop.)S2848(If)S10 I(addr)189 2953 A10 R3179(is)S3283(\(int)S3460(*\)1)S3631(then)S3841(execution)S4269(continues)S4690(from)S4922(where)S5205(it)S7080 V(stopped.)337 1280 A7248 V1080(PT_KILL)S7368 V1280(The)S(traced)247 1462 A1734(process)S2061(terminates.)S7903 V720(Page)S941(1)S2669(\()S2711(May)S2920(23,)S(1986)200 3070 A3278(\))S4455(September)S4911(13,)S(1996)200 5061 A8143 VEP%%Page: 2 2BP/slant 0 def/height 0 def480 V10 R720(PTRACE)S1115(\()S1157(2)S1215(\))S2696(Eighth)S(Edition)296 2989 A4732(PTRACE)S5127(\()S5169(2)S5227(\))S960 V1080(PT_STEP)S1080 V1280(Execution)S1720(continues)S2137(as)S2253(in)S2363(request)S2686(PT_CONTINUE;)S3431(however,)S3835(as)S(soon)189 3951 A4172(as)S4289(possible)S4651(after)S4870(execution)S1200 V1280(of)S1396(at)S1501(least)S1718(one)S1895(instruction,)S2382(execution)S2805(stops)S3042(again.)S3341(The)S3529(signal)S3800(number)S4138(from)S4365(the)S4519(stop)S4717(is)S4815(SIGTRAP.)S1320 V1280(\(On)S1483(the)S(VAX-11)353 1652 A2051(the)S2220(T-bit)S2468(is)S2581(used)S2811(and)S3002(just)S3193(one)S3384(instruction)S3860(is)S3974(executed.\))S4463(This)S4689(is)S4803(part)S5007(of)S5138(the)S1440 V1280(mechanism)S1763(for)S1906(implementing)S(breakpoints.)494 2489 A1608 V1080(As)S1222(indicated,)S1646(these)S1883(calls)S2098(\(except)S2425(for)S2573(request)S2894(PT_TRACE_ME\))S3658(can)S3828(be)S3953(used)S4167(only)S4375(when)S4623(the)S4777(subject)S5093(pro-)S1728 V1080(cess)S1278(has)S(stopped.)337 1441 A1832(The)S10 B2018(wait)S10 R2232(call)S2407(is)S2503(used)S2716(to)S2823(determine)S3255(when)S3502(a)S3576(process)S3907(stops;)S4170(in)S4277(such)S4490(a)S4564(case)S4767(the)S4919(termina-)S1848 V1080(tion)S1261(status)S1515(returned)S1876(by)S10 B2001(wait)S10 R2211(has)S2370(the)S2518(value)S(0177)200 2761 A2986(to)S3089(indicate)S(stoppage)357 3433 A3815(rather)S4076(than)S4274(genuine)S4617(termination.)S2016 V1080(To)S1234(forestall)S1608(possible)S1980(fraud,)S10 B2261(ptrace)S10 R2579(inhibits)S2923(the)S3089(set-user-id)S3558(and)S(set-group-id)492 3746 A(facilities)348 4281 A4672(on)S4815(subsequent)S2136 V10 B1080(execve)S10 R1360(\(2\))S1505(calls.)S1767(If)S1862(a)S(traced)247 1934 A2208(process)S2537(calls)S10 B2749(execve)S10 R3029(,)S3081(it)S(will)157 3163 A3346(stop)S3539(before)S3823(executing)S4240(the)S4389(\256rst)S4572(instruction)S5028(of)S5138(the)S2256 V1080(new)S1273(image)S1544(showing)S1909(signal)S2174(SIGTRAP.)S2424 V1080(On)S1228(a)S(VAX-11,)378 1298 A1701(word)S1933(also)S2120(means)S2402(a)S2472(32-bit)S2737(integer,)S3067(but)S3220(the)S3368(even)S3583(restriction)S4017(does)S4226(not)S4379(apply.)S2592 V9 R720(R)S722(RE)S784(ET)S842(TU)S900(UR)S968(RN)S1030(N)S1121(V)S1123(VA)S1191(AL)S1259(LU)S1317(UE)S1385(E)S2712 V10 R1080(A)S1182(0)S1261(value)S1508(is)S1604(returned)S1969(if)S2060(the)S2212(call)S(succeeds.)383 2387 A2824(If)S2921(the)S3073(call)S3248(fails)S3451(then)S3653(a)S10 R-13727(-)S10 R3784(1)S3864(is)S3961(returned)S4327(and)S4502(the)S4655(global)S4936(variable)S2832 V10 I1080(errno)S10 R1328(is)S1420(set)S1557(to)S1660(indicate)S2004(the)S2152(error.)S3000 V9 R720(E)S722(ER)S780(RR)S842(RO)S904(OR)S972(RS)S1034(S)S3120 V10 R1080([EIO])S1830(The)S2012(request)S2328(code)S2543(is)S2635(invalid.)S3288 V1080([ESRCH])S1830(The)S2012(speci\256ed)S2395(process)S2722(does)S2931(not)S3084(exist.)S3456 V1080([EIO])S1830(The)S2012(given)S2260(signal)S2525(number)S2857(is)S2949(invalid.)S3624 V1080([EIO])S1830(The)S2012(speci\256ed)S2395(address)S2722(is)S2814(out)S2967(of)S(bounds.)314 3076 A3792 V1080([EPERM])S1830(The)S2012(speci\256ed)S2395(process)S(cannot)268 2722 A3015(be)S(traced.)272 3135 A3960 V9 R720(S)S722(SE)S774(EE)S832(E)S913(A)S915(AL)S983(LS)S1041(SO)S1093(O)S4080 V10 B1080(wait)S10 R1265(\(2\),)S10 B1433(sigaction)S10 R1813(\(2\),)S10 B1981(mdb)S10 R2177(\(1\).)S4248 V9 R720(B)S722(BU)S784(UG)S852(GS)S920(S)S4368 V10 B1080(Ptrace)S10 R1392(is)S1490(unique)S1794(and)S1970(arcane;)S2293(it)S(should)267 2380 A2678(be)S(replaced)342 2804 A3177(with)S3387(a)S3463(special)S3774(\256le)S3934(that)S4116(can)S4287(be)S4413(opened)S4734(and)S4910(read)S5116(and)S4488 V(written.)311 1080 A1449(The)S1639(control)S1957(functions)S2364(could)S2620(then)S2826(be)S2954(implemented)S3512(with)S10 B3724(ioctl)S10 R3909(\(2\))S4060(calls)S4278(on)S4411(this)S4588(\256le.)S4799(This)S5010(would)S4608 V1080(be)S1200(simpler)S1527(to)S(understand)441 1630 A2096(and)S2266(have)S2481(much)S2729(higher)S3011(performance.)S4776 V1080(The)S1266(request)S1586(PT_TRACE_ME)S2316(call)S(should)267 2492 A2789(be)S2914(able)S3112(to)S3220(specify)S3541(signals)S3850(that)S4031(are)S4185(to)S4293(be)S4418(treated)S4723(normally)S5116(and)S4896 V1080(not)S1242(cause)S1500(a)S1579(stop.)S1830(In)S1947(this)S2125(way,)S2351(for)S2502(example,)S2901(programs)S3314(with)S3526(simulated)S3950(\257oating)S4290(point)S4529(\(which)S4842(use)S(illegal)252 5009 A5016 V1080(instruction)S1535(signals)S1839(at)S1937(a)S2007(very)S2211(high)S2414(rate\))S2625(could)S2873(be)S2993(ef\256ciently)S(debugged.)415 3427 A5184 V1080(The)S1262(error)S1484(indication,)S10 R-11936(-)S10 R1993(1,)S2093(is)S2185(a)S(legitimate)403 2255 A2683(function)S3043(value;)S10 B(errno)241 3314 A10 R3555(,)S3605(\(see)S10 B3793(intro)S10 R4006(\(2\)\),)S4208(can)S4374(be)S4495(used)S4705(to)S4809(disambigu-)S5304 V1080(ate.)S5472 V1080(It)S(should)267 1176 A1477(be)S1606(possible)S1969(to)S2081(stop)S2282(a)S2361(process)S2697(on)S2831(occurrence)S3308(of)S3426(a)S3505(system)S(call;)174 3818 A4026(in)S4138(this)S4317(way)S4520(a)S4600(completely)S5082(con-)S5592 V1080(trolled)S1368(environment)S1901(could)S2149(be)S2269(provided.)S7903 V720(September)S1176(13,)S(1996)200 1326 A2669(\()S2711(May)S2920(23,)S(1986)200 3070 A3278(\))S4990(Page)S5211(2)S8143 VEP%%Trailer%%DocumentFonts: Times-Roman Times-Bold Times-Italic%%Pages: 2

⌨️ 快捷键说明

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