7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 */
26 /*
27 * Copyright 2015 Joyent, Inc.
28 * Copyright (c) 2014 by Delphix. All rights reserved.
29 */
30
31 /*
32 * User Process Target
33 *
34 * The user process target is invoked when the -u or -p command-line options
35 * are used, or when an ELF executable file or ELF core file is specified on
36 * the command-line. This target is also selected by default when no target
37 * options are present. In this case, it defaults the executable name to
38 * "a.out". If no process or core file is currently attached, the target
39 * functions as a kind of virtual /dev/zero (in accordance with adb(1)
40 * semantics); reads from the virtual address space return zeroes and writes
41 * fail silently. The proc target itself is designed as a wrapper around the
42 * services provided by libproc.so: t->t_pshandle is set to the struct
43 * ps_prochandle pointer returned as a handle by libproc. The target also
44 * opens the executable file itself using the MDB GElf services, for
45 * interpreting the .symtab and .dynsym if no libproc handle has been
46 * initialized, and for handling i/o to and from the object file. Currently,
47 * the only ISA-dependent portions of the proc target are the $r and ::fpregs
4678 (ssize_t (*)()) mdb_tgt_notsup, /* t_pread */
4679 (ssize_t (*)()) mdb_tgt_notsup, /* t_pwrite */
4680 pt_fread, /* t_fread */
4681 pt_fwrite, /* t_fwrite */
4682 (ssize_t (*)()) mdb_tgt_notsup, /* t_ioread */
4683 (ssize_t (*)()) mdb_tgt_notsup, /* t_iowrite */
4684 (int (*)()) mdb_tgt_notsup, /* t_vtop */
4685 pt_lookup_by_name, /* t_lookup_by_name */
4686 pt_lookup_by_addr, /* t_lookup_by_addr */
4687 pt_symbol_iter, /* t_symbol_iter */
4688 pt_mapping_iter, /* t_mapping_iter */
4689 pt_object_iter, /* t_object_iter */
4690 pt_addr_to_map, /* t_addr_to_map */
4691 pt_name_to_map, /* t_name_to_map */
4692 pt_addr_to_ctf, /* t_addr_to_ctf */
4693 pt_name_to_ctf, /* t_name_to_ctf */
4694 pt_status, /* t_status */
4695 pt_run, /* t_run */
4696 pt_step, /* t_step */
4697 pt_step_out, /* t_step_out */
4698 (int (*)()) mdb_tgt_notsup, /* t_step_branch */
4699 pt_next, /* t_next */
4700 pt_continue, /* t_cont */
4701 pt_signal, /* t_signal */
4702 pt_add_vbrkpt, /* t_add_vbrkpt */
4703 pt_add_sbrkpt, /* t_add_sbrkpt */
4704 (int (*)()) mdb_tgt_null, /* t_add_pwapt */
4705 pt_add_vwapt, /* t_add_vwapt */
4706 (int (*)()) mdb_tgt_null, /* t_add_iowapt */
4707 pt_add_sysenter, /* t_add_sysenter */
4708 pt_add_sysexit, /* t_add_sysexit */
4709 pt_add_signal, /* t_add_signal */
4710 pt_add_fault, /* t_add_fault */
4711 pt_getareg, /* t_getareg */
4712 pt_putareg, /* t_putareg */
4713 pt_stack_iter, /* t_stack_iter */
4714 pt_auxv /* t_auxv */
4715 };
4716
4717 /*
4718 * Utility function for converting libproc errno values to mdb error values
|
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 */
26 /*
27 * Copyright 2018 Joyent, Inc.
28 * Copyright (c) 2014 by Delphix. All rights reserved.
29 */
30
31 /*
32 * User Process Target
33 *
34 * The user process target is invoked when the -u or -p command-line options
35 * are used, or when an ELF executable file or ELF core file is specified on
36 * the command-line. This target is also selected by default when no target
37 * options are present. In this case, it defaults the executable name to
38 * "a.out". If no process or core file is currently attached, the target
39 * functions as a kind of virtual /dev/zero (in accordance with adb(1)
40 * semantics); reads from the virtual address space return zeroes and writes
41 * fail silently. The proc target itself is designed as a wrapper around the
42 * services provided by libproc.so: t->t_pshandle is set to the struct
43 * ps_prochandle pointer returned as a handle by libproc. The target also
44 * opens the executable file itself using the MDB GElf services, for
45 * interpreting the .symtab and .dynsym if no libproc handle has been
46 * initialized, and for handling i/o to and from the object file. Currently,
47 * the only ISA-dependent portions of the proc target are the $r and ::fpregs
4678 (ssize_t (*)()) mdb_tgt_notsup, /* t_pread */
4679 (ssize_t (*)()) mdb_tgt_notsup, /* t_pwrite */
4680 pt_fread, /* t_fread */
4681 pt_fwrite, /* t_fwrite */
4682 (ssize_t (*)()) mdb_tgt_notsup, /* t_ioread */
4683 (ssize_t (*)()) mdb_tgt_notsup, /* t_iowrite */
4684 (int (*)()) mdb_tgt_notsup, /* t_vtop */
4685 pt_lookup_by_name, /* t_lookup_by_name */
4686 pt_lookup_by_addr, /* t_lookup_by_addr */
4687 pt_symbol_iter, /* t_symbol_iter */
4688 pt_mapping_iter, /* t_mapping_iter */
4689 pt_object_iter, /* t_object_iter */
4690 pt_addr_to_map, /* t_addr_to_map */
4691 pt_name_to_map, /* t_name_to_map */
4692 pt_addr_to_ctf, /* t_addr_to_ctf */
4693 pt_name_to_ctf, /* t_name_to_ctf */
4694 pt_status, /* t_status */
4695 pt_run, /* t_run */
4696 pt_step, /* t_step */
4697 pt_step_out, /* t_step_out */
4698 pt_next, /* t_next */
4699 pt_continue, /* t_cont */
4700 pt_signal, /* t_signal */
4701 pt_add_vbrkpt, /* t_add_vbrkpt */
4702 pt_add_sbrkpt, /* t_add_sbrkpt */
4703 (int (*)()) mdb_tgt_null, /* t_add_pwapt */
4704 pt_add_vwapt, /* t_add_vwapt */
4705 (int (*)()) mdb_tgt_null, /* t_add_iowapt */
4706 pt_add_sysenter, /* t_add_sysenter */
4707 pt_add_sysexit, /* t_add_sysexit */
4708 pt_add_signal, /* t_add_signal */
4709 pt_add_fault, /* t_add_fault */
4710 pt_getareg, /* t_getareg */
4711 pt_putareg, /* t_putareg */
4712 pt_stack_iter, /* t_stack_iter */
4713 pt_auxv /* t_auxv */
4714 };
4715
4716 /*
4717 * Utility function for converting libproc errno values to mdb error values
|