Print this page
9210 remove KMDB branch debugging support
9211 ::crregs could do with cr2/cr3 support
9209 ::ttrace should be able to filter by thread
Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/cmd/mdb/intel/kmdb/kvm_isadep.c
+++ new/usr/src/cmd/mdb/intel/kmdb/kvm_isadep.c
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
↓ open down ↓ |
13 lines elided |
↑ open up ↑ |
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21 /*
22 22 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
23 23 * Use is subject to license terms.
24 + *
25 + * Copyright 2018 Joyent, Inc.
24 26 */
25 27
26 -#pragma ident "%Z%%M% %I% %E% SMI"
27 -
28 28 /*
29 29 * isa-dependent portions of the kmdb target
30 30 */
31 31
32 32 #include <kmdb/kvm.h>
33 -#include <kmdb/kvm_cpu.h>
34 33 #include <kmdb/kmdb_kdi.h>
35 34 #include <kmdb/kmdb_asmutil.h>
36 35 #include <mdb/mdb_debug.h>
37 36 #include <mdb/mdb_err.h>
38 37 #include <mdb/mdb_list.h>
39 38 #include <mdb/mdb_target_impl.h>
40 39 #include <mdb/mdb_isautil.h>
41 40 #include <mdb/mdb_kreg_impl.h>
42 41 #include <mdb/mdb.h>
43 42
44 43 #include <sys/types.h>
45 44 #include <sys/frame.h>
46 45 #include <sys/trap.h>
47 46 #include <sys/bitmap.h>
48 47 #include <sys/pci_impl.h>
49 48
50 49 /* Higher than the highest trap number for which we have a defined specifier */
51 50 #define KMT_MAXTRAPNO 0x20
52 51
53 52 #define IOPORTLIMIT 0xffff /* XXX find a new home for this */
54 53
55 54 const char *
56 55 kmt_def_dismode(void)
57 56 {
58 57 #ifdef __amd64
59 58 return ("amd64");
60 59 #else
61 60 return ("ia32");
62 61 #endif
63 62 }
64 63
65 64 int
66 65 kmt_step_out_validate(mdb_tgt_t *t, uintptr_t pc)
67 66 {
68 67 kmt_data_t *kmt = t->t_data;
69 68 int i;
70 69
71 70 for (i = 0; i < sizeof (kmt->kmt_intrsyms) / sizeof (GElf_Sym); i++) {
72 71 GElf_Sym *sym = (GElf_Sym *)&kmt->kmt_intrsyms + i;
73 72
74 73 if (pc >= sym->st_value && pc < sym->st_value + sym->st_size)
75 74 return (0);
76 75 }
77 76
78 77 return (1);
79 78 }
80 79
81 80 /*
82 81 * Determine the return address for the current frame.
83 82 */
84 83 int
85 84 kmt_step_out(mdb_tgt_t *t, uintptr_t *p)
86 85 {
87 86 mdb_instr_t instr;
88 87 kreg_t pc, sp, fp;
89 88
90 89 (void) kmdb_dpi_get_register("pc", &pc);
91 90 (void) kmdb_dpi_get_register("sp", &sp);
92 91 (void) kmdb_dpi_get_register("fp", &fp);
93 92
↓ open down ↓ |
50 lines elided |
↑ open up ↑ |
94 93 if (mdb_tgt_vread(t, &instr, sizeof (mdb_instr_t), pc) !=
95 94 sizeof (mdb_instr_t))
96 95 return (-1); /* errno is set for us */
97 96
98 97 if (!kmt_step_out_validate(t, pc))
99 98 return (set_errno(EMDB_TGTNOTSUP));
100 99
101 100 return (mdb_isa_step_out(t, p, pc, fp, sp, instr));
102 101 }
103 102
104 -int
105 -kmt_step_branch(mdb_tgt_t *t)
106 -{
107 - kmt_data_t *kmt = t->t_data;
108 -
109 - return (kmt_cpu_step_branch(t, kmt->kmt_cpu));
110 -}
111 -
112 103 /*
113 104 * Return the address of the next instruction following a call, or return -1
114 105 * and set errno to EAGAIN if the target should just single-step.
115 106 */
116 107 int
117 108 kmt_next(mdb_tgt_t *t, uintptr_t *p)
118 109 {
119 110 kreg_t pc;
120 111 mdb_instr_t instr;
121 112
122 113 (void) kmdb_dpi_get_register("pc", &pc);
123 114
124 115 if (mdb_tgt_vread(t, &instr, sizeof (mdb_instr_t), pc) !=
125 116 sizeof (mdb_instr_t))
126 117 return (-1); /* errno is set for us */
127 118
128 119 return (mdb_isa_next(t, p, pc, instr));
129 120 }
130 121
131 122 /*ARGSUSED*/
132 123 static int
133 124 kmt_stack_common(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv,
134 125 int cpuid, mdb_tgt_stack_f *func)
135 126 {
136 127 const mdb_tgt_gregset_t *grp = NULL;
137 128 mdb_tgt_gregset_t gregs;
138 129 void *arg = (void *)(uintptr_t)mdb.m_nargs;
139 130
140 131 if (flags & DCMD_ADDRSPEC) {
141 132 bzero(&gregs, sizeof (gregs));
142 133 gregs.kregs[KREG_FP] = addr;
143 134 grp = &gregs;
144 135 } else
145 136 grp = kmdb_dpi_get_gregs(cpuid);
146 137
147 138 if (grp == NULL) {
148 139 warn("failed to retrieve registers for cpu %d", cpuid);
149 140 return (DCMD_ERR);
150 141 }
151 142
152 143 if (argc != 0) {
153 144 if (argv->a_type == MDB_TYPE_CHAR || argc > 1)
154 145 return (DCMD_USAGE);
155 146
156 147 if (argv->a_type == MDB_TYPE_STRING)
157 148 arg = (void *)(uintptr_t)mdb_strtoull(argv->a_un.a_str);
158 149 else
159 150 arg = (void *)(uintptr_t)argv->a_un.a_val;
160 151 }
161 152
162 153 (void) mdb_isa_kvm_stack_iter(mdb.m_target, grp, func, arg);
163 154
164 155 return (DCMD_OK);
165 156 }
166 157
167 158 int
168 159 kmt_cpustack(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv,
169 160 int cpuid, int verbose)
170 161 {
171 162 return (kmt_stack_common(addr, flags, argc, argv, cpuid,
172 163 (verbose ? mdb_isa_kvm_framev : mdb_isa_kvm_frame)));
173 164 }
174 165
175 166 int
176 167 kmt_stack(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
177 168 {
178 169 return (kmt_stack_common(addr, flags, argc, argv, DPI_MASTER_CPUID,
179 170 mdb_isa_kvm_frame));
180 171 }
181 172
182 173 int
183 174 kmt_stackv(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
184 175 {
185 176 return (kmt_stack_common(addr, flags, argc, argv, DPI_MASTER_CPUID,
186 177 mdb_isa_kvm_framev));
187 178 }
188 179
189 180 int
190 181 kmt_stackr(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
191 182 {
192 183 return (kmt_stack_common(addr, flags, argc, argv, DPI_MASTER_CPUID,
193 184 mdb_isa_kvm_framev));
194 185 }
195 186
196 187 /*ARGSUSED*/
197 188 void
198 189 kmt_printregs(const mdb_tgt_gregset_t *gregs)
199 190 {
200 191 mdb_isa_printregs(gregs);
201 192 }
202 193
203 194 #define IOCHECK_NOWARN 0
204 195 #define IOCHECK_WARN 1
205 196
206 197 static int
207 198 kmt_io_check(uint64_t nbytes, uintptr_t addr, int dowarn)
208 199 {
209 200 if (addr > IOPORTLIMIT) {
210 201 if (dowarn)
211 202 warn("port address must be 0-%#x\n", IOPORTLIMIT);
212 203 return (set_errno(EINVAL));
213 204 }
214 205
215 206 if (nbytes != 1 && nbytes != 2 && nbytes != 4) {
216 207 if (dowarn)
217 208 warn("port access must be 1, 2, or 4 bytes\n");
218 209 return (set_errno(EINVAL));
219 210 }
220 211
221 212 if ((addr & (nbytes - 1)) != 0) {
222 213 if (dowarn) {
223 214 warn("address for %llu-byte access must be %llu-byte "
224 215 "aligned\n", (u_longlong_t)nbytes,
225 216 (u_longlong_t)nbytes);
226 217 }
227 218 return (set_errno(EINVAL));
228 219 }
229 220
230 221 return (0);
231 222 }
232 223
233 224 /*ARGSUSED1*/
234 225 int
235 226 kmt_in_dcmd(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
236 227 {
237 228 uint64_t len = 0;
238 229 uint32_t buf;
239 230
240 231 if (mdb_getopts(argc, argv,
241 232 'L', MDB_OPT_UINT64, &len,
242 233 NULL) != argc)
243 234 return (DCMD_USAGE);
244 235
245 236 if (len == 0)
246 237 len = mdb.m_dcount;
247 238
248 239 if (kmt_io_check(len, addr, IOCHECK_WARN) < 0)
249 240 return (DCMD_ERR);
250 241
251 242 if (mdb_tgt_ioread(mdb.m_target, &buf, len, addr) < 0) {
252 243 warn("failed to read from port 0x%llx", (u_longlong_t)addr);
253 244 return (DCMD_ERR);
254 245 }
255 246
256 247 mdb_printf("%x\n", buf);
257 248
258 249 return (DCMD_OK);
259 250 }
260 251
261 252 static uint64_t
262 253 kmt_numarg(const mdb_arg_t *arg)
263 254 {
264 255 if (arg->a_type == MDB_TYPE_STRING)
265 256 return (mdb_strtoull(arg->a_un.a_str));
266 257 else
267 258 return (arg->a_un.a_val);
268 259 }
269 260
270 261 /*ARGSUSED1*/
271 262 int
272 263 kmt_out_dcmd(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
273 264 {
274 265 uint64_t len = 0;
275 266 uint64_t val;
276 267
277 268 if (mdb_getopts(argc, argv,
278 269 'L', MDB_OPT_UINT64, &len,
279 270 NULL) != argc - 1)
280 271 return (DCMD_USAGE);
281 272
282 273 if (len == 0)
283 274 len = mdb.m_dcount;
284 275
285 276 argv += argc - 1;
286 277 val = kmt_numarg(argv);
287 278
288 279 if (kmt_io_check(len, addr, IOCHECK_WARN) < 0)
289 280 return (DCMD_ERR);
290 281
291 282 if (val > (1ULL << (len * NBBY)) - 1) {
292 283 warn("value is out of range for port size\n");
293 284 return (DCMD_ERR);
294 285 }
295 286
296 287 if (mdb_tgt_iowrite(mdb.m_target, &val, len, addr) < 0) {
297 288 warn("failed to write to port %llx", (u_longlong_t)addr);
298 289 return (DCMD_ERR);
299 290 }
300 291
301 292 return (DCMD_OK);
302 293 }
303 294
304 295 static int
305 296 kmt_rwmsr(uint32_t addr, uint64_t *valp, void (*rw)(uint32_t, uint64_t *))
306 297 {
307 298 jmp_buf pcb, *oldpcb = NULL;
308 299
309 300 if (setjmp(pcb) != 0) {
310 301 kmdb_dpi_restore_fault_hdlr(oldpcb);
311 302 return (-1); /* errno is set for us */
312 303 }
313 304
314 305 oldpcb = kmdb_dpi_set_fault_hdlr(&pcb);
315 306 rw(addr, valp);
316 307 kmdb_dpi_restore_fault_hdlr(oldpcb);
317 308
318 309 return (0);
319 310 }
320 311
321 312 /*ARGSUSED*/
322 313 int
323 314 kmt_rdmsr(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
324 315 {
325 316 uint64_t val;
326 317
327 318 if (!(flags & DCMD_ADDRSPEC))
328 319 return (DCMD_USAGE);
329 320
330 321 if (kmt_rwmsr(addr, &val, rdmsr) < 0) {
331 322 warn("rdmsr failed");
332 323 return (DCMD_ERR);
333 324 }
334 325
335 326 mdb_printf("%llx\n", (u_longlong_t)val);
336 327
337 328 return (DCMD_OK);
338 329 }
339 330
340 331 /*ARGSUSED*/
341 332 int
342 333 kmt_wrmsr(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
343 334 {
344 335 uint64_t val;
345 336
346 337 if (!(flags & DCMD_ADDRSPEC) || argc != 1)
347 338 return (DCMD_USAGE);
348 339
↓ open down ↓ |
227 lines elided |
↑ open up ↑ |
349 340 val = kmt_numarg(argv);
350 341
351 342 if (kmt_rwmsr(addr, &val, wrmsr)) {
352 343 warn("wrmsr failed");
353 344 return (DCMD_ERR);
354 345 }
355 346
356 347 return (DCMD_OK);
357 348 }
358 349
359 -int
360 -kmt_msr_validate(const kdi_msr_t *msr)
361 -{
362 - uint64_t val;
363 -
364 - for (/* */; msr->msr_num != 0; msr++) {
365 - if (kmt_rwmsr(msr->msr_num, &val, rdmsr) < 0)
366 - return (0);
367 - }
368 -
369 - return (1);
370 -}
371 -
372 350 /*ARGSUSED*/
373 351 ssize_t
374 352 kmt_write(mdb_tgt_t *t, const void *buf, size_t nbytes, uintptr_t addr)
375 353 {
376 354 if (!(t->t_flags & MDB_TGT_F_ALLOWIO) &&
377 355 (nbytes = kmdb_kdi_range_is_nontoxic(addr, nbytes, 1)) == 0)
378 356 return (set_errno(EMDB_NOMAP));
379 357
380 358 /*
381 359 * No writes to user space are allowed. If we were to allow it, we'd
382 360 * be in the unfortunate situation where kmdb could place a breakpoint
383 361 * on a userspace executable page; this dirty page would end up being
384 362 * flushed back to disk, incurring sadness when it's next executed.
385 363 * Besides, we can't allow trapping in from userspace anyway.
386 364 */
387 365 if (addr < kmdb_kdi_get_userlimit())
388 366 return (set_errno(EMDB_TGTNOTSUP));
389 367
390 368 return (kmt_rw(t, (void *)buf, nbytes, addr, kmt_writer));
391 369 }
392 370
393 371 /*ARGSUSED*/
394 372 static ssize_t
395 373 kmt_iorw(mdb_tgt_t *t, void *buf, size_t nbytes, uint64_t addr,
396 374 void (*iorw)(void *, size_t, uintptr_t))
397 375 {
398 376 jmp_buf pcb, *oldpcb = NULL;
399 377
400 378 if (kmt_io_check(nbytes, addr, IOCHECK_NOWARN) < 0)
401 379 return (-1); /* errno is set for us */
402 380
403 381 if (setjmp(pcb) != 0) {
404 382 kmdb_dpi_restore_fault_hdlr(oldpcb);
405 383 return (-1); /* errno is set for us */
406 384 }
407 385
408 386 oldpcb = kmdb_dpi_set_fault_hdlr(&pcb);
409 387 iorw(buf, nbytes, addr);
410 388 kmdb_dpi_restore_fault_hdlr(oldpcb);
411 389
412 390 return (nbytes);
413 391 }
414 392
415 393 /*ARGSUSED*/
416 394 ssize_t
417 395 kmt_ioread(mdb_tgt_t *t, void *buf, size_t nbytes, uintptr_t addr)
418 396 {
419 397 return (kmt_iorw(t, buf, nbytes, addr, kmt_in));
420 398 }
421 399
422 400 /*ARGSUSED*/
423 401 ssize_t
424 402 kmt_iowrite(mdb_tgt_t *t, const void *buf, size_t nbytes, uintptr_t addr)
425 403 {
426 404 return (kmt_iorw(t, (void *)buf, nbytes, addr, kmt_out));
427 405 }
428 406
429 407 static int
430 408 kmt_pcicfg_common(uintptr_t off, uint32_t *valp, const mdb_arg_t *argv,
431 409 void (*rw)(void *, size_t, uintptr_t))
432 410 {
433 411 uint32_t bus, dev, func;
434 412 uint32_t addr;
435 413
436 414 bus = kmt_numarg(&argv[0]);
437 415 dev = kmt_numarg(&argv[1]);
438 416 func = kmt_numarg(&argv[2]);
439 417
440 418 if ((bus & 0xffff) != bus) {
441 419 warn("invalid bus number (must be 0-0xffff)\n");
442 420 return (DCMD_ERR);
443 421 }
444 422
445 423 if ((dev & 0x1f) != dev) {
446 424 warn("invalid device number (must be 0-0x1f)\n");
447 425 return (DCMD_ERR);
448 426 }
449 427
450 428 if ((func & 0x7) != func) {
451 429 warn("invalid function number (must be 0-7)\n");
452 430 return (DCMD_ERR);
453 431 }
454 432
455 433 if ((off & 0xfc) != off) {
456 434 warn("invalid register number (must be 0-0xff, and 4-byte "
457 435 "aligned\n");
458 436 return (DCMD_ERR);
459 437 }
460 438
461 439 addr = PCI_CADDR1(bus, dev, func, off);
462 440
463 441 if (kmt_iowrite(mdb.m_target, &addr, sizeof (addr), PCI_CONFADD) !=
464 442 sizeof (addr)) {
465 443 warn("write of PCI_CONFADD failed");
466 444 return (DCMD_ERR);
467 445 }
468 446
469 447 if (kmt_iorw(mdb.m_target, valp, sizeof (*valp), PCI_CONFDATA, rw) !=
470 448 sizeof (*valp)) {
471 449 warn("access to PCI_CONFDATA failed");
472 450 return (DCMD_ERR);
473 451 }
474 452
475 453 return (DCMD_OK);
476 454 }
477 455
478 456 /*ARGSUSED*/
479 457 int
480 458 kmt_rdpcicfg(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
481 459 {
482 460 uint32_t val;
483 461
484 462 if (argc != 3 || !(flags & DCMD_ADDRSPEC))
485 463 return (DCMD_USAGE);
486 464
487 465 if (kmt_pcicfg_common(addr, &val, argv, kmt_in) != DCMD_OK)
488 466 return (DCMD_ERR);
489 467
490 468 mdb_printf("%llx\n", (u_longlong_t)val);
491 469
492 470 return (DCMD_OK);
493 471 }
494 472
495 473 /*ARGSUSED*/
496 474 int
497 475 kmt_wrpcicfg(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
498 476 {
499 477 uint32_t val;
500 478
501 479 if (argc != 4 || !(flags & DCMD_ADDRSPEC))
502 480 return (DCMD_USAGE);
503 481
504 482 val = (uint32_t)kmt_numarg(&argv[3]);
505 483
506 484 if (kmt_pcicfg_common(addr, &val, argv, kmt_out) != DCMD_OK)
507 485 return (DCMD_ERR);
508 486
509 487 return (DCMD_OK);
510 488 }
511 489
512 490 const char *
513 491 kmt_trapname(int trapnum)
514 492 {
515 493 static char trapname[11];
516 494
517 495 switch (trapnum) {
518 496 case T_ZERODIV:
519 497 return ("division by zero (#de) trap");
520 498 case T_SGLSTP:
521 499 return ("single-step (#db) trap");
522 500 case T_NMIFLT:
523 501 return ("NMI");
524 502 case T_BPTFLT:
525 503 return ("breakpoint (#bp) trap");
526 504 case T_ILLINST:
527 505 return ("illegal instruction (#ud) trap");
528 506 case T_SEGFLT:
529 507 return ("segment not present (#np) trap");
530 508 case T_STKFLT:
531 509 return ("stack (#ss) trap");
532 510 case T_GPFLT:
533 511 return ("general protection (#gp) trap");
534 512 case T_PGFLT:
535 513 return ("page fault (#pf) trap");
536 514 case T_ALIGNMENT:
537 515 return ("alignment check (#ac) trap");
538 516 case T_MCE:
539 517 return ("machine check (#mc) trap");
540 518 case T_SIMDFPE:
541 519 return ("SSE/SSE2 (#xm) trap");
542 520 case T_DBGENTR:
543 521 return ("debugger entry trap");
544 522 default:
545 523 (void) mdb_snprintf(trapname, sizeof (trapname), "trap %#x",
546 524 trapnum);
547 525 return (trapname);
548 526 }
549 527 }
550 528
551 529 void
552 530 kmt_init_isadep(mdb_tgt_t *t)
553 531 {
554 532 kmt_data_t *kmt = t->t_data;
555 533
556 534 kmt->kmt_rds = mdb_isa_kregs;
557 535
558 536 kmt->kmt_trapmax = KMT_MAXTRAPNO;
559 537 kmt->kmt_trapmap = mdb_zalloc(BT_SIZEOFMAP(kmt->kmt_trapmax), UM_SLEEP);
560 538
561 539 /* Traps for which we want to provide an explicit message */
562 540 (void) mdb_tgt_add_fault(t, T_ZERODIV, MDB_TGT_SPEC_INTERNAL,
563 541 no_se_f, NULL);
564 542 (void) mdb_tgt_add_fault(t, T_ILLINST, MDB_TGT_SPEC_INTERNAL,
565 543 no_se_f, NULL);
566 544 (void) mdb_tgt_add_fault(t, T_SEGFLT, MDB_TGT_SPEC_INTERNAL,
567 545 no_se_f, NULL);
568 546 (void) mdb_tgt_add_fault(t, T_STKFLT, MDB_TGT_SPEC_INTERNAL,
569 547 no_se_f, NULL);
570 548 (void) mdb_tgt_add_fault(t, T_GPFLT, MDB_TGT_SPEC_INTERNAL,
571 549 no_se_f, NULL);
572 550 (void) mdb_tgt_add_fault(t, T_PGFLT, MDB_TGT_SPEC_INTERNAL,
573 551 no_se_f, NULL);
574 552 (void) mdb_tgt_add_fault(t, T_ALIGNMENT, MDB_TGT_SPEC_INTERNAL,
575 553 no_se_f, NULL);
576 554 (void) mdb_tgt_add_fault(t, T_MCE, MDB_TGT_SPEC_INTERNAL,
577 555 no_se_f, NULL);
578 556 (void) mdb_tgt_add_fault(t, T_SIMDFPE, MDB_TGT_SPEC_INTERNAL,
579 557 no_se_f, NULL);
580 558
581 559 /*
582 560 * Traps which will be handled elsewhere, and which therefore don't
583 561 * need the trap-based message.
584 562 */
585 563 BT_SET(kmt->kmt_trapmap, T_SGLSTP);
586 564 BT_SET(kmt->kmt_trapmap, T_BPTFLT);
587 565 BT_SET(kmt->kmt_trapmap, T_DBGENTR);
588 566
589 567 /* Catch-all for traps not explicitly listed here */
590 568 (void) mdb_tgt_add_fault(t, KMT_TRAP_NOTENUM, MDB_TGT_SPEC_INTERNAL,
591 569 no_se_f, NULL);
592 570 }
593 571
594 572 void
595 573 kmt_startup_isadep(mdb_tgt_t *t)
596 574 {
597 575 kmt_data_t *kmt = t->t_data;
598 576
599 577 /*
600 578 * The stack trace and ::step out code need to detect "interrupt"
601 579 * frames. The heuristic they use to detect said frames requires the
602 580 * addresses of routines that can generate them.
603 581 */
604 582 (void) mdb_tgt_lookup_by_name(t, MDB_TGT_OBJ_EXEC,
605 583 "cmnint", &kmt->kmt_intrsyms._kmt_cmnint, NULL);
606 584 (void) mdb_tgt_lookup_by_name(t, MDB_TGT_OBJ_EXEC,
607 585 "cmntrap", &kmt->kmt_intrsyms._kmt_cmntrap, NULL);
608 586 (void) mdb_tgt_lookup_by_name(t, MDB_TGT_OBJ_EXEC,
609 587 "sys_sysenter", &kmt->kmt_intrsyms._kmt_sysenter, NULL);
610 588 (void) mdb_tgt_lookup_by_name(t, MDB_TGT_OBJ_EXEC,
611 589 "brand_sys_sysenter", &kmt->kmt_intrsyms._kmt_brand_sysenter, NULL);
612 590 #if defined(__amd64)
613 591 (void) mdb_tgt_lookup_by_name(t, MDB_TGT_OBJ_EXEC,
614 592 "sys_syscall", &kmt->kmt_intrsyms._kmt_syscall, NULL);
615 593 (void) mdb_tgt_lookup_by_name(t, MDB_TGT_OBJ_EXEC,
616 594 "brand_sys_syscall", &kmt->kmt_intrsyms._kmt_brand_syscall, NULL);
617 595 #endif
618 596 }
↓ open down ↓ |
237 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX