6c2659886f
I'd like to enable the -Wmissing-declarations warning. However, it
warns for every _initialize function, for example:
CXX dcache.o
/home/smarchi/src/binutils-gdb/gdb/dcache.c: In function ‘void _initialize_dcache()’:
/home/smarchi/src/binutils-gdb/gdb/dcache.c:688:1: error: no previous declaration for ‘void _initialize_dcache()’ [-Werror=missing-declarations]
_initialize_dcache (void)
^~~~~~~~~~~~~~~~~~
The only practical way forward I found is to add back the declarations,
which were removed by this commit:
commit 481695ed5f
Author: John Baldwin <jhb@FreeBSD.org>
Date: Sat Sep 9 11:02:37 2017 -0700
Remove unnecessary function prototypes.
I don't think it's a big problem to have the declarations for these
functions, but if anybody has a better solution for this, I'll be happy
to use it.
gdb/ChangeLog:
* aarch64-fbsd-nat.c (_initialize_aarch64_fbsd_nat): Add declaration.
* aarch64-fbsd-tdep.c (_initialize_aarch64_fbsd_tdep): Add declaration.
* aarch64-linux-nat.c (_initialize_aarch64_linux_nat): Add declaration.
* aarch64-linux-tdep.c (_initialize_aarch64_linux_tdep): Add declaration.
* aarch64-newlib-tdep.c (_initialize_aarch64_newlib_tdep): Add declaration.
* aarch64-tdep.c (_initialize_aarch64_tdep): Add declaration.
* ada-exp.y (_initialize_ada_exp): Add declaration.
* ada-lang.c (_initialize_ada_language): Add declaration.
* ada-tasks.c (_initialize_tasks): Add declaration.
* agent.c (_initialize_agent): Add declaration.
* aix-thread.c (_initialize_aix_thread): Add declaration.
* alpha-bsd-nat.c (_initialize_alphabsd_nat): Add declaration.
* alpha-linux-nat.c (_initialize_alpha_linux_nat): Add declaration.
* alpha-linux-tdep.c (_initialize_alpha_linux_tdep): Add declaration.
* alpha-nbsd-tdep.c (_initialize_alphanbsd_tdep): Add declaration.
* alpha-obsd-tdep.c (_initialize_alphaobsd_tdep): Add declaration.
* alpha-tdep.c (_initialize_alpha_tdep): Add declaration.
* amd64-darwin-tdep.c (_initialize_amd64_darwin_tdep): Add declaration.
* amd64-dicos-tdep.c (_initialize_amd64_dicos_tdep): Add declaration.
* amd64-fbsd-nat.c (_initialize_amd64fbsd_nat): Add declaration.
* amd64-fbsd-tdep.c (_initialize_amd64fbsd_tdep): Add declaration.
* amd64-linux-nat.c (_initialize_amd64_linux_nat): Add declaration.
* amd64-linux-tdep.c (_initialize_amd64_linux_tdep): Add declaration.
* amd64-nbsd-nat.c (_initialize_amd64nbsd_nat): Add declaration.
* amd64-nbsd-tdep.c (_initialize_amd64nbsd_tdep): Add declaration.
* amd64-obsd-nat.c (_initialize_amd64obsd_nat): Add declaration.
* amd64-obsd-tdep.c (_initialize_amd64obsd_tdep): Add declaration.
* amd64-sol2-tdep.c (_initialize_amd64_sol2_tdep): Add declaration.
* amd64-tdep.c (_initialize_amd64_tdep): Add declaration.
* amd64-windows-nat.c (_initialize_amd64_windows_nat): Add declaration.
* amd64-windows-tdep.c (_initialize_amd64_windows_tdep): Add declaration.
* annotate.c (_initialize_annotate): Add declaration.
* arc-newlib-tdep.c (_initialize_arc_newlib_tdep): Add declaration.
* arc-tdep.c (_initialize_arc_tdep): Add declaration.
* arch-utils.c (_initialize_gdbarch_utils): Add declaration.
* arm-fbsd-nat.c (_initialize_arm_fbsd_nat): Add declaration.
* arm-fbsd-tdep.c (_initialize_arm_fbsd_tdep): Add declaration.
* arm-linux-nat.c (_initialize_arm_linux_nat): Add declaration.
* arm-linux-tdep.c (_initialize_arm_linux_tdep): Add declaration.
* arm-nbsd-nat.c (_initialize_arm_netbsd_nat): Add declaration.
* arm-nbsd-tdep.c (_initialize_arm_netbsd_tdep): Add declaration.
* arm-obsd-tdep.c (_initialize_armobsd_tdep): Add declaration.
* arm-pikeos-tdep.c (_initialize_arm_pikeos_tdep): Add declaration.
* arm-symbian-tdep.c (_initialize_arm_symbian_tdep): Add declaration.
* arm-tdep.c (_initialize_arm_tdep): Add declaration.
* arm-wince-tdep.c (_initialize_arm_wince_tdep): Add declaration.
* auto-load.c (_initialize_auto_load): Add declaration.
* auxv.c (_initialize_auxv): Add declaration.
* avr-tdep.c (_initialize_avr_tdep): Add declaration.
* ax-gdb.c (_initialize_ax_gdb): Add declaration.
* bfin-linux-tdep.c (_initialize_bfin_linux_tdep): Add declaration.
* bfin-tdep.c (_initialize_bfin_tdep): Add declaration.
* break-catch-sig.c (_initialize_break_catch_sig): Add declaration.
* break-catch-syscall.c (_initialize_break_catch_syscall): Add declaration.
* break-catch-throw.c (_initialize_break_catch_throw): Add declaration.
* breakpoint.c (_initialize_breakpoint): Add declaration.
* bsd-uthread.c (_initialize_bsd_uthread): Add declaration.
* btrace.c (_initialize_btrace): Add declaration.
* charset.c (_initialize_charset): Add declaration.
* cli/cli-cmds.c (_initialize_cli_cmds): Add declaration.
* cli/cli-dump.c (_initialize_cli_dump): Add declaration.
* cli/cli-interp.c (_initialize_cli_interp): Add declaration.
* cli/cli-logging.c (_initialize_cli_logging): Add declaration.
* cli/cli-script.c (_initialize_cli_script): Add declaration.
* cli/cli-style.c (_initialize_cli_style): Add declaration.
* coff-pe-read.c (_initialize_coff_pe_read): Add declaration.
* coffread.c (_initialize_coffread): Add declaration.
* compile/compile-cplus-types.c (_initialize_compile_cplus_types): Add declaration.
* compile/compile.c (_initialize_compile): Add declaration.
* complaints.c (_initialize_complaints): Add declaration.
* completer.c (_initialize_completer): Add declaration.
* copying.c (_initialize_copying): Add declaration.
* corefile.c (_initialize_core): Add declaration.
* corelow.c (_initialize_corelow): Add declaration.
* cp-abi.c (_initialize_cp_abi): Add declaration.
* cp-namespace.c (_initialize_cp_namespace): Add declaration.
* cp-support.c (_initialize_cp_support): Add declaration.
* cp-valprint.c (_initialize_cp_valprint): Add declaration.
* cris-linux-tdep.c (_initialize_cris_linux_tdep): Add declaration.
* cris-tdep.c (_initialize_cris_tdep): Add declaration.
* csky-linux-tdep.c (_initialize_csky_linux_tdep): Add declaration.
* csky-tdep.c (_initialize_csky_tdep): Add declaration.
* ctfread.c (_initialize_ctfread): Add declaration.
* d-lang.c (_initialize_d_language): Add declaration.
* darwin-nat-info.c (_initialize_darwin_info_commands): Add declaration.
* darwin-nat.c (_initialize_darwin_nat): Add declaration.
* dbxread.c (_initialize_dbxread): Add declaration.
* dcache.c (_initialize_dcache): Add declaration.
* disasm-selftests.c (_initialize_disasm_selftests): Add declaration.
* disasm.c (_initialize_disasm): Add declaration.
* dtrace-probe.c (_initialize_dtrace_probe): Add declaration.
* dummy-frame.c (_initialize_dummy_frame): Add declaration.
* dwarf-index-cache.c (_initialize_index_cache): Add declaration.
* dwarf-index-write.c (_initialize_dwarf_index_write): Add declaration.
* dwarf2-frame-tailcall.c (_initialize_tailcall_frame): Add declaration.
* dwarf2-frame.c (_initialize_dwarf2_frame): Add declaration.
* dwarf2expr.c (_initialize_dwarf2expr): Add declaration.
* dwarf2loc.c (_initialize_dwarf2loc): Add declaration.
* dwarf2read.c (_initialize_dwarf2_read): Add declaration.
* elfread.c (_initialize_elfread): Add declaration.
* exec.c (_initialize_exec): Add declaration.
* extension.c (_initialize_extension): Add declaration.
* f-lang.c (_initialize_f_language): Add declaration.
* f-valprint.c (_initialize_f_valprint): Add declaration.
* fbsd-nat.c (_initialize_fbsd_nat): Add declaration.
* fbsd-tdep.c (_initialize_fbsd_tdep): Add declaration.
* filesystem.c (_initialize_filesystem): Add declaration.
* findcmd.c (_initialize_mem_search): Add declaration.
* findvar.c (_initialize_findvar): Add declaration.
* fork-child.c (_initialize_fork_child): Add declaration.
* frame-base.c (_initialize_frame_base): Add declaration.
* frame-unwind.c (_initialize_frame_unwind): Add declaration.
* frame.c (_initialize_frame): Add declaration.
* frv-linux-tdep.c (_initialize_frv_linux_tdep): Add declaration.
* frv-tdep.c (_initialize_frv_tdep): Add declaration.
* ft32-tdep.c (_initialize_ft32_tdep): Add declaration.
* gcore.c (_initialize_gcore): Add declaration.
* gdb-demangle.c (_initialize_gdb_demangle): Add declaration.
* gdb_bfd.c (_initialize_gdb_bfd): Add declaration.
* gdbarch-selftests.c (_initialize_gdbarch_selftests): Add declaration.
* gdbarch.c (_initialize_gdbarch): Add declaration.
* gdbtypes.c (_initialize_gdbtypes): Add declaration.
* gnu-nat.c (_initialize_gnu_nat): Add declaration.
* gnu-v2-abi.c (_initialize_gnu_v2_abi): Add declaration.
* gnu-v3-abi.c (_initialize_gnu_v3_abi): Add declaration.
* go-lang.c (_initialize_go_language): Add declaration.
* go32-nat.c (_initialize_go32_nat): Add declaration.
* guile/guile.c (_initialize_guile): Add declaration.
* h8300-tdep.c (_initialize_h8300_tdep): Add declaration.
* hppa-linux-nat.c (_initialize_hppa_linux_nat): Add declaration.
* hppa-linux-tdep.c (_initialize_hppa_linux_tdep): Add declaration.
* hppa-nbsd-nat.c (_initialize_hppanbsd_nat): Add declaration.
* hppa-nbsd-tdep.c (_initialize_hppanbsd_tdep): Add declaration.
* hppa-obsd-nat.c (_initialize_hppaobsd_nat): Add declaration.
* hppa-obsd-tdep.c (_initialize_hppabsd_tdep): Add declaration.
* hppa-tdep.c (_initialize_hppa_tdep): Add declaration.
* i386-bsd-nat.c (_initialize_i386bsd_nat): Add declaration.
* i386-cygwin-tdep.c (_initialize_i386_cygwin_tdep): Add declaration.
* i386-darwin-nat.c (_initialize_i386_darwin_nat): Add declaration.
* i386-darwin-tdep.c (_initialize_i386_darwin_tdep): Add declaration.
* i386-dicos-tdep.c (_initialize_i386_dicos_tdep): Add declaration.
* i386-fbsd-nat.c (_initialize_i386fbsd_nat): Add declaration.
* i386-fbsd-tdep.c (_initialize_i386fbsd_tdep): Add declaration.
* i386-gnu-nat.c (_initialize_i386gnu_nat): Add declaration.
* i386-gnu-tdep.c (_initialize_i386gnu_tdep): Add declaration.
* i386-go32-tdep.c (_initialize_i386_go32_tdep): Add declaration.
* i386-linux-nat.c (_initialize_i386_linux_nat): Add declaration.
* i386-linux-tdep.c (_initialize_i386_linux_tdep): Add declaration.
* i386-nbsd-nat.c (_initialize_i386nbsd_nat): Add declaration.
* i386-nbsd-tdep.c (_initialize_i386nbsd_tdep): Add declaration.
* i386-nto-tdep.c (_initialize_i386nto_tdep): Add declaration.
* i386-obsd-nat.c (_initialize_i386obsd_nat): Add declaration.
* i386-obsd-tdep.c (_initialize_i386obsd_tdep): Add declaration.
* i386-sol2-nat.c (_initialize_amd64_sol2_nat): Add declaration.
* i386-sol2-tdep.c (_initialize_i386_sol2_tdep): Add declaration.
* i386-tdep.c (_initialize_i386_tdep): Add declaration.
* i386-windows-nat.c (_initialize_i386_windows_nat): Add declaration.
* ia64-libunwind-tdep.c (_initialize_libunwind_frame): Add declaration.
* ia64-linux-nat.c (_initialize_ia64_linux_nat): Add declaration.
* ia64-linux-tdep.c (_initialize_ia64_linux_tdep): Add declaration.
* ia64-tdep.c (_initialize_ia64_tdep): Add declaration.
* ia64-vms-tdep.c (_initialize_ia64_vms_tdep): Add declaration.
* infcall.c (_initialize_infcall): Add declaration.
* infcmd.c (_initialize_infcmd): Add declaration.
* inflow.c (_initialize_inflow): Add declaration.
* infrun.c (_initialize_infrun): Add declaration.
* interps.c (_initialize_interpreter): Add declaration.
* iq2000-tdep.c (_initialize_iq2000_tdep): Add declaration.
* jit.c (_initialize_jit): Add declaration.
* language.c (_initialize_language): Add declaration.
* linux-fork.c (_initialize_linux_fork): Add declaration.
* linux-nat.c (_initialize_linux_nat): Add declaration.
* linux-tdep.c (_initialize_linux_tdep): Add declaration.
* linux-thread-db.c (_initialize_thread_db): Add declaration.
* lm32-tdep.c (_initialize_lm32_tdep): Add declaration.
* m2-lang.c (_initialize_m2_language): Add declaration.
* m32c-tdep.c (_initialize_m32c_tdep): Add declaration.
* m32r-linux-nat.c (_initialize_m32r_linux_nat): Add declaration.
* m32r-linux-tdep.c (_initialize_m32r_linux_tdep): Add declaration.
* m32r-tdep.c (_initialize_m32r_tdep): Add declaration.
* m68hc11-tdep.c (_initialize_m68hc11_tdep): Add declaration.
* m68k-bsd-nat.c (_initialize_m68kbsd_nat): Add declaration.
* m68k-bsd-tdep.c (_initialize_m68kbsd_tdep): Add declaration.
* m68k-linux-nat.c (_initialize_m68k_linux_nat): Add declaration.
* m68k-linux-tdep.c (_initialize_m68k_linux_tdep): Add declaration.
* m68k-tdep.c (_initialize_m68k_tdep): Add declaration.
* machoread.c (_initialize_machoread): Add declaration.
* macrocmd.c (_initialize_macrocmd): Add declaration.
* macroscope.c (_initialize_macroscope): Add declaration.
* maint-test-options.c (_initialize_maint_test_options): Add declaration.
* maint-test-settings.c (_initialize_maint_test_settings): Add declaration.
* maint.c (_initialize_maint_cmds): Add declaration.
* mdebugread.c (_initialize_mdebugread): Add declaration.
* memattr.c (_initialize_mem): Add declaration.
* mep-tdep.c (_initialize_mep_tdep): Add declaration.
* mi/mi-cmd-env.c (_initialize_mi_cmd_env): Add declaration.
* mi/mi-cmds.c (_initialize_mi_cmds): Add declaration.
* mi/mi-interp.c (_initialize_mi_interp): Add declaration.
* mi/mi-main.c (_initialize_mi_main): Add declaration.
* microblaze-linux-tdep.c (_initialize_microblaze_linux_tdep): Add declaration.
* microblaze-tdep.c (_initialize_microblaze_tdep): Add declaration.
* mips-fbsd-nat.c (_initialize_mips_fbsd_nat): Add declaration.
* mips-fbsd-tdep.c (_initialize_mips_fbsd_tdep): Add declaration.
* mips-linux-nat.c (_initialize_mips_linux_nat): Add declaration.
* mips-linux-tdep.c (_initialize_mips_linux_tdep): Add declaration.
* mips-nbsd-nat.c (_initialize_mipsnbsd_nat): Add declaration.
* mips-nbsd-tdep.c (_initialize_mipsnbsd_tdep): Add declaration.
* mips-sde-tdep.c (_initialize_mips_sde_tdep): Add declaration.
* mips-tdep.c (_initialize_mips_tdep): Add declaration.
* mips64-obsd-nat.c (_initialize_mips64obsd_nat): Add declaration.
* mips64-obsd-tdep.c (_initialize_mips64obsd_tdep): Add declaration.
* mipsread.c (_initialize_mipsread): Add declaration.
* mn10300-linux-tdep.c (_initialize_mn10300_linux_tdep): Add declaration.
* mn10300-tdep.c (_initialize_mn10300_tdep): Add declaration.
* moxie-tdep.c (_initialize_moxie_tdep): Add declaration.
* msp430-tdep.c (_initialize_msp430_tdep): Add declaration.
* nds32-tdep.c (_initialize_nds32_tdep): Add declaration.
* nios2-linux-tdep.c (_initialize_nios2_linux_tdep): Add declaration.
* nios2-tdep.c (_initialize_nios2_tdep): Add declaration.
* nto-procfs.c (_initialize_procfs): Add declaration.
* objc-lang.c (_initialize_objc_language): Add declaration.
* observable.c (_initialize_observer): Add declaration.
* opencl-lang.c (_initialize_opencl_language): Add declaration.
* or1k-linux-tdep.c (_initialize_or1k_linux_tdep): Add declaration.
* or1k-tdep.c (_initialize_or1k_tdep): Add declaration.
* osabi.c (_initialize_gdb_osabi): Add declaration.
* osdata.c (_initialize_osdata): Add declaration.
* p-valprint.c (_initialize_pascal_valprint): Add declaration.
* parse.c (_initialize_parse): Add declaration.
* ppc-fbsd-nat.c (_initialize_ppcfbsd_nat): Add declaration.
* ppc-fbsd-tdep.c (_initialize_ppcfbsd_tdep): Add declaration.
* ppc-linux-nat.c (_initialize_ppc_linux_nat): Add declaration.
* ppc-linux-tdep.c (_initialize_ppc_linux_tdep): Add declaration.
* ppc-nbsd-nat.c (_initialize_ppcnbsd_nat): Add declaration.
* ppc-nbsd-tdep.c (_initialize_ppcnbsd_tdep): Add declaration.
* ppc-obsd-nat.c (_initialize_ppcobsd_nat): Add declaration.
* ppc-obsd-tdep.c (_initialize_ppcobsd_tdep): Add declaration.
* printcmd.c (_initialize_printcmd): Add declaration.
* probe.c (_initialize_probe): Add declaration.
* proc-api.c (_initialize_proc_api): Add declaration.
* proc-events.c (_initialize_proc_events): Add declaration.
* proc-service.c (_initialize_proc_service): Add declaration.
* procfs.c (_initialize_procfs): Add declaration.
* producer.c (_initialize_producer): Add declaration.
* psymtab.c (_initialize_psymtab): Add declaration.
* python/python.c (_initialize_python): Add declaration.
* ravenscar-thread.c (_initialize_ravenscar): Add declaration.
* record-btrace.c (_initialize_record_btrace): Add declaration.
* record-full.c (_initialize_record_full): Add declaration.
* record.c (_initialize_record): Add declaration.
* regcache-dump.c (_initialize_regcache_dump): Add declaration.
* regcache.c (_initialize_regcache): Add declaration.
* reggroups.c (_initialize_reggroup): Add declaration.
* remote-notif.c (_initialize_notif): Add declaration.
* remote-sim.c (_initialize_remote_sim): Add declaration.
* remote.c (_initialize_remote): Add declaration.
* reverse.c (_initialize_reverse): Add declaration.
* riscv-fbsd-nat.c (_initialize_riscv_fbsd_nat): Add declaration.
* riscv-fbsd-tdep.c (_initialize_riscv_fbsd_tdep): Add declaration.
* riscv-linux-nat.c (_initialize_riscv_linux_nat): Add declaration.
* riscv-linux-tdep.c (_initialize_riscv_linux_tdep): Add declaration.
* riscv-tdep.c (_initialize_riscv_tdep): Add declaration.
* rl78-tdep.c (_initialize_rl78_tdep): Add declaration.
* rs6000-aix-tdep.c (_initialize_rs6000_aix_tdep): Add declaration.
* rs6000-lynx178-tdep.c (_initialize_rs6000_lynx178_tdep):
Add declaration.
* rs6000-nat.c (_initialize_rs6000_nat): Add declaration.
* rs6000-tdep.c (_initialize_rs6000_tdep): Add declaration.
* run-on-main-thread.c (_initialize_run_on_main_thread): Add declaration.
* rust-exp.y (_initialize_rust_exp): Add declaration.
* rx-tdep.c (_initialize_rx_tdep): Add declaration.
* s12z-tdep.c (_initialize_s12z_tdep): Add declaration.
* s390-linux-nat.c (_initialize_s390_nat): Add declaration.
* s390-linux-tdep.c (_initialize_s390_linux_tdep): Add declaration.
* s390-tdep.c (_initialize_s390_tdep): Add declaration.
* score-tdep.c (_initialize_score_tdep): Add declaration.
* ser-go32.c (_initialize_ser_dos): Add declaration.
* ser-mingw.c (_initialize_ser_windows): Add declaration.
* ser-pipe.c (_initialize_ser_pipe): Add declaration.
* ser-tcp.c (_initialize_ser_tcp): Add declaration.
* ser-uds.c (_initialize_ser_socket): Add declaration.
* ser-unix.c (_initialize_ser_hardwire): Add declaration.
* serial.c (_initialize_serial): Add declaration.
* sh-linux-tdep.c (_initialize_sh_linux_tdep): Add declaration.
* sh-nbsd-nat.c (_initialize_shnbsd_nat): Add declaration.
* sh-nbsd-tdep.c (_initialize_shnbsd_tdep): Add declaration.
* sh-tdep.c (_initialize_sh_tdep): Add declaration.
* skip.c (_initialize_step_skip): Add declaration.
* sol-thread.c (_initialize_sol_thread): Add declaration.
* solib-aix.c (_initialize_solib_aix): Add declaration.
* solib-darwin.c (_initialize_darwin_solib): Add declaration.
* solib-dsbt.c (_initialize_dsbt_solib): Add declaration.
* solib-frv.c (_initialize_frv_solib): Add declaration.
* solib-svr4.c (_initialize_svr4_solib): Add declaration.
* solib-target.c (_initialize_solib_target): Add declaration.
* solib.c (_initialize_solib): Add declaration.
* source-cache.c (_initialize_source_cache): Add declaration.
* source.c (_initialize_source): Add declaration.
* sparc-linux-nat.c (_initialize_sparc_linux_nat): Add declaration.
* sparc-linux-tdep.c (_initialize_sparc_linux_tdep): Add declaration.
* sparc-nat.c (_initialize_sparc_nat): Add declaration.
* sparc-nbsd-nat.c (_initialize_sparcnbsd_nat): Add declaration.
* sparc-nbsd-tdep.c (_initialize_sparcnbsd_tdep): Add declaration.
* sparc-obsd-tdep.c (_initialize_sparc32obsd_tdep): Add declaration.
* sparc-sol2-tdep.c (_initialize_sparc_sol2_tdep): Add declaration.
* sparc-tdep.c (_initialize_sparc_tdep): Add declaration.
* sparc64-fbsd-nat.c (_initialize_sparc64fbsd_nat): Add declaration.
* sparc64-fbsd-tdep.c (_initialize_sparc64fbsd_tdep): Add declaration.
* sparc64-linux-nat.c (_initialize_sparc64_linux_nat): Add declaration.
* sparc64-linux-tdep.c (_initialize_sparc64_linux_tdep): Add declaration.
* sparc64-nat.c (_initialize_sparc64_nat): Add declaration.
* sparc64-nbsd-nat.c (_initialize_sparc64nbsd_nat): Add declaration.
* sparc64-nbsd-tdep.c (_initialize_sparc64nbsd_tdep): Add declaration.
* sparc64-obsd-nat.c (_initialize_sparc64obsd_nat): Add declaration.
* sparc64-obsd-tdep.c (_initialize_sparc64obsd_tdep): Add declaration.
* sparc64-sol2-tdep.c (_initialize_sparc64_sol2_tdep): Add declaration.
* sparc64-tdep.c (_initialize_sparc64_adi_tdep): Add declaration.
* stabsread.c (_initialize_stabsread): Add declaration.
* stack.c (_initialize_stack): Add declaration.
* stap-probe.c (_initialize_stap_probe): Add declaration.
* std-regs.c (_initialize_frame_reg): Add declaration.
* symfile-debug.c (_initialize_symfile_debug): Add declaration.
* symfile-mem.c (_initialize_symfile_mem): Add declaration.
* symfile.c (_initialize_symfile): Add declaration.
* symmisc.c (_initialize_symmisc): Add declaration.
* symtab.c (_initialize_symtab): Add declaration.
* target.c (_initialize_target): Add declaration.
* target-connection.c (_initialize_target_connection): Add
declaration.
* target-dcache.c (_initialize_target_dcache): Add declaration.
* target-descriptions.c (_initialize_target_descriptions): Add declaration.
* thread.c (_initialize_thread): Add declaration.
* tic6x-linux-tdep.c (_initialize_tic6x_linux_tdep): Add declaration.
* tic6x-tdep.c (_initialize_tic6x_tdep): Add declaration.
* tilegx-linux-nat.c (_initialize_tile_linux_nat): Add declaration.
* tilegx-linux-tdep.c (_initialize_tilegx_linux_tdep): Add declaration.
* tilegx-tdep.c (_initialize_tilegx_tdep): Add declaration.
* tracectf.c (_initialize_ctf): Add declaration.
* tracefile-tfile.c (_initialize_tracefile_tfile): Add declaration.
* tracefile.c (_initialize_tracefile): Add declaration.
* tracepoint.c (_initialize_tracepoint): Add declaration.
* tui/tui-hooks.c (_initialize_tui_hooks): Add declaration.
* tui/tui-interp.c (_initialize_tui_interp): Add declaration.
* tui/tui-layout.c (_initialize_tui_layout): Add declaration.
* tui/tui-regs.c (_initialize_tui_regs): Add declaration.
* tui/tui-stack.c (_initialize_tui_stack): Add declaration.
* tui/tui-win.c (_initialize_tui_win): Add declaration.
* tui/tui.c (_initialize_tui): Add declaration.
* typeprint.c (_initialize_typeprint): Add declaration.
* ui-style.c (_initialize_ui_style): Add declaration.
* unittests/array-view-selftests.c (_initialize_array_view_selftests): Add declaration.
* unittests/child-path-selftests.c (_initialize_child_path_selftests): Add declaration.
* unittests/cli-utils-selftests.c (_initialize_cli_utils_selftests): Add declaration.
* unittests/common-utils-selftests.c (_initialize_common_utils_selftests): Add declaration.
* unittests/copy_bitwise-selftests.c (_initialize_copy_bitwise_utils_selftests): Add declaration.
* unittests/environ-selftests.c (_initialize_environ_selftests): Add declaration.
* unittests/filtered_iterator-selftests.c
(_initialize_filtered_iterator_selftests): Add declaration.
* unittests/format_pieces-selftests.c (_initialize_format_pieces_selftests): Add declaration.
* unittests/function-view-selftests.c (_initialize_function_view_selftests): Add declaration.
* unittests/help-doc-selftests.c (_initialize_help_doc_selftests): Add declaration.
* unittests/lookup_name_info-selftests.c (_initialize_lookup_name_info_selftests): Add declaration.
* unittests/main-thread-selftests.c
(_initialize_main_thread_selftests): Add declaration.
* unittests/memory-map-selftests.c (_initialize_memory_map_selftests): Add declaration.
* unittests/memrange-selftests.c (_initialize_memrange_selftests): Add declaration.
* unittests/mkdir-recursive-selftests.c (_initialize_mkdir_recursive_selftests): Add declaration.
* unittests/observable-selftests.c (_initialize_observer_selftest): Add declaration.
* unittests/offset-type-selftests.c (_initialize_offset_type_selftests): Add declaration.
* unittests/optional-selftests.c (_initialize_optional_selftests): Add declaration.
* unittests/parse-connection-spec-selftests.c (_initialize_parse_connection_spec_selftests): Add declaration.
* unittests/rsp-low-selftests.c (_initialize_rsp_low_selftests): Add declaration.
* unittests/scoped_fd-selftests.c (_initialize_scoped_fd_selftests): Add declaration.
* unittests/scoped_mmap-selftests.c (_initialize_scoped_mmap_selftests): Add declaration.
* unittests/scoped_restore-selftests.c (_initialize_scoped_restore_selftests): Add declaration.
* unittests/string_view-selftests.c (_initialize_string_view_selftests): Add declaration.
* unittests/style-selftests.c (_initialize_style_selftest): Add declaration.
* unittests/tracepoint-selftests.c (_initialize_tracepoint_selftests): Add declaration.
* unittests/tui-selftests.c (_initialize_tui_selftest): Add
declaration.
* unittests/unpack-selftests.c (_initialize_unpack_selftests): Add declaration.
* unittests/utils-selftests.c (_initialize_utils_selftests): Add declaration.
* unittests/vec-utils-selftests.c (_initialize_vec_utils_selftests): Add declaration.
* unittests/xml-utils-selftests.c (_initialize_xml_utils): Add declaration.
* user-regs.c (_initialize_user_regs): Add declaration.
* utils.c (_initialize_utils): Add declaration.
* v850-tdep.c (_initialize_v850_tdep): Add declaration.
* valops.c (_initialize_valops): Add declaration.
* valprint.c (_initialize_valprint): Add declaration.
* value.c (_initialize_values): Add declaration.
* varobj.c (_initialize_varobj): Add declaration.
* vax-bsd-nat.c (_initialize_vaxbsd_nat): Add declaration.
* vax-nbsd-tdep.c (_initialize_vaxnbsd_tdep): Add declaration.
* vax-tdep.c (_initialize_vax_tdep): Add declaration.
* windows-nat.c (_initialize_windows_nat): Add declaration.
(_initialize_check_for_gdb_ini): Add declaration.
(_initialize_loadable): Add declaration.
* windows-tdep.c (_initialize_windows_tdep): Add declaration.
* x86-bsd-nat.c (_initialize_x86_bsd_nat): Add declaration.
* x86-linux-nat.c (_initialize_x86_linux_nat): Add declaration.
* xcoffread.c (_initialize_xcoffread): Add declaration.
* xml-support.c (_initialize_xml_support): Add declaration.
* xstormy16-tdep.c (_initialize_xstormy16_tdep): Add declaration.
* xtensa-linux-nat.c (_initialize_xtensa_linux_nat): Add declaration.
* xtensa-linux-tdep.c (_initialize_xtensa_linux_tdep): Add declaration.
* xtensa-tdep.c (_initialize_xtensa_tdep): Add declaration.
Change-Id: I13eec7e0ed2b3c427377a7bdb055cf46da64def9
771 lines
23 KiB
C
771 lines
23 KiB
C
/* Machine-independent support for Solaris /proc (process file system)
|
||
|
||
Copyright (C) 1999-2020 Free Software Foundation, Inc.
|
||
|
||
Written by Michael Snyder at Cygnus Solutions.
|
||
Based on work by Fred Fish, Stu Grossman, Geoff Noer, and others.
|
||
|
||
This program is free software; you can redistribute it and/or modify
|
||
it under the terms of the GNU General Public License as published by
|
||
the Free Software Foundation; either version 3 of the License, or
|
||
(at your option) any later version.
|
||
|
||
This program is distributed in the hope that it will be useful,
|
||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
GNU General Public License for more details.
|
||
|
||
You should have received a copy of the GNU General Public License
|
||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||
|
||
/* Pretty-print "events of interest".
|
||
|
||
This module includes pretty-print routines for:
|
||
* faults (hardware exceptions)
|
||
* signals (software interrupts)
|
||
* syscalls
|
||
|
||
FIXME: At present, the syscall translation table must be
|
||
initialized, which is not true of the other translation tables. */
|
||
|
||
#include "defs.h"
|
||
|
||
#define _STRUCTURED_PROC 1
|
||
|
||
#include <sys/types.h>
|
||
#include <sys/procfs.h>
|
||
#include <sys/syscall.h>
|
||
#include <sys/fault.h>
|
||
|
||
#include "proc-utils.h"
|
||
|
||
/* Much of the information used in the /proc interface, particularly
|
||
for printing status information, is kept as tables of structures of
|
||
the following form. These tables can be used to map numeric values
|
||
to their symbolic names and to a string that describes their
|
||
specific use. */
|
||
|
||
struct trans
|
||
{
|
||
int value; /* The numeric value. */
|
||
const char *name; /* The equivalent symbolic value. */
|
||
const char *desc; /* Short description of value. */
|
||
};
|
||
|
||
|
||
/* Pretty print syscalls. */
|
||
|
||
/* Syscall translation table. */
|
||
|
||
#define MAX_SYSCALLS 262 /* Pretty arbitrary. */
|
||
static const char *syscall_table[MAX_SYSCALLS];
|
||
|
||
static void
|
||
init_syscall_table (void)
|
||
{
|
||
syscall_table[SYS_accept] = "accept";
|
||
#ifdef SYS_access
|
||
syscall_table[SYS_access] = "access";
|
||
#endif
|
||
syscall_table[SYS_acct] = "acct";
|
||
syscall_table[SYS_acctctl] = "acctctl";
|
||
syscall_table[SYS_acl] = "acl";
|
||
#ifdef SYS_adi
|
||
syscall_table[SYS_adi] = "adi";
|
||
#endif
|
||
syscall_table[SYS_adjtime] = "adjtime";
|
||
syscall_table[SYS_alarm] = "alarm";
|
||
syscall_table[SYS_auditsys] = "auditsys";
|
||
syscall_table[SYS_autofssys] = "autofssys";
|
||
syscall_table[SYS_bind] = "bind";
|
||
syscall_table[SYS_brand] = "brand";
|
||
syscall_table[SYS_brk] = "brk";
|
||
syscall_table[SYS_chdir] = "chdir";
|
||
#ifdef SYS_chmod
|
||
syscall_table[SYS_chmod] = "chmod";
|
||
#endif
|
||
#ifdef SYS_chown
|
||
syscall_table[SYS_chown] = "chown";
|
||
#endif
|
||
syscall_table[SYS_chroot] = "chroot";
|
||
syscall_table[SYS_cladm] = "cladm";
|
||
syscall_table[SYS_clock_getres] = "clock_getres";
|
||
syscall_table[SYS_clock_gettime] = "clock_gettime";
|
||
syscall_table[SYS_clock_settime] = "clock_settime";
|
||
syscall_table[SYS_close] = "close";
|
||
syscall_table[SYS_connect] = "connect";
|
||
syscall_table[SYS_context] = "context";
|
||
syscall_table[SYS_corectl] = "corectl";
|
||
syscall_table[SYS_cpc] = "cpc";
|
||
#ifdef SYS_creat
|
||
syscall_table[SYS_creat] = "creat";
|
||
#endif
|
||
#ifdef SYS_creat64
|
||
syscall_table[SYS_creat64] = "creat64";
|
||
#endif
|
||
syscall_table[SYS_door] = "door";
|
||
#ifdef SYS_dup
|
||
syscall_table[SYS_dup] = "dup";
|
||
#endif
|
||
#ifdef SYS_evsys
|
||
syscall_table[SYS_evsys] = "evsys";
|
||
#endif
|
||
#ifdef SYS_evtrapret
|
||
syscall_table[SYS_evtrapret] = "evtrapret";
|
||
#endif
|
||
syscall_table[SYS_exacctsys] = "exacctsys";
|
||
#ifdef SYS_exec
|
||
syscall_table[SYS_exec] = "exec";
|
||
#endif
|
||
syscall_table[SYS_execve] = "execve";
|
||
syscall_table[SYS_exit] = "exit";
|
||
#ifdef SYS_faccessat
|
||
syscall_table[SYS_faccessat] = "faccessat";
|
||
#endif
|
||
syscall_table[SYS_facl] = "facl";
|
||
syscall_table[SYS_fchdir] = "fchdir";
|
||
#ifdef SYS_fchmod
|
||
syscall_table[SYS_fchmod] = "fchmod";
|
||
#endif
|
||
#ifdef SYS_fchmodat
|
||
syscall_table[SYS_fchmodat] = "fchmodat";
|
||
#endif
|
||
#ifdef SYS_fchown
|
||
syscall_table[SYS_fchown] = "fchown";
|
||
#endif
|
||
#ifdef SYS_fchownat
|
||
syscall_table[SYS_fchownat] = "fchownat";
|
||
#endif
|
||
syscall_table[SYS_fchroot] = "fchroot";
|
||
syscall_table[SYS_fcntl] = "fcntl";
|
||
syscall_table[SYS_fdsync] = "fdsync";
|
||
#ifdef SYS_fork1
|
||
syscall_table[SYS_fork1] = "fork1";
|
||
#endif
|
||
#ifdef SYS_forkall
|
||
syscall_table[SYS_forkall] = "forkall";
|
||
#endif
|
||
#ifdef SYS_forksys
|
||
syscall_table[SYS_forksys] = "forksys";
|
||
#endif
|
||
syscall_table[SYS_fpathconf] = "fpathconf";
|
||
#ifdef SYS_frealpathat
|
||
syscall_table[SYS_frealpathat] = "frealpathat";
|
||
#endif
|
||
#ifdef SYS_fsat
|
||
syscall_table[SYS_fsat] = "fsat";
|
||
#endif
|
||
#ifdef SYS_fstat
|
||
syscall_table[SYS_fstat] = "fstat";
|
||
#endif
|
||
#ifdef SYS_fstat64
|
||
syscall_table[SYS_fstat64] = "fstat64";
|
||
#endif
|
||
#ifdef SYS_fstatat
|
||
syscall_table[SYS_fstatat] = "fstatat";
|
||
#endif
|
||
#ifdef SYS_fstatat64
|
||
syscall_table[SYS_fstatat64] = "fstatat64";
|
||
#endif
|
||
syscall_table[SYS_fstatfs] = "fstatfs";
|
||
syscall_table[SYS_fstatvfs] = "fstatvfs";
|
||
syscall_table[SYS_fstatvfs64] = "fstatvfs64";
|
||
#ifdef SYS_fxstat
|
||
syscall_table[SYS_fxstat] = "fxstat";
|
||
#endif
|
||
syscall_table[SYS_getcwd] = "getcwd";
|
||
syscall_table[SYS_getdents] = "getdents";
|
||
syscall_table[SYS_getdents64] = "getdents64";
|
||
syscall_table[SYS_getgid] = "getgid";
|
||
syscall_table[SYS_getgroups] = "getgroups";
|
||
syscall_table[SYS_getitimer] = "getitimer";
|
||
syscall_table[SYS_getloadavg] = "getloadavg";
|
||
syscall_table[SYS_getmsg] = "getmsg";
|
||
syscall_table[SYS_getpagesizes] = "getpagesizes";
|
||
syscall_table[SYS_getpeername] = "getpeername";
|
||
syscall_table[SYS_getpid] = "getpid";
|
||
syscall_table[SYS_getpmsg] = "getpmsg";
|
||
#ifdef SYS_getrandom
|
||
syscall_table[SYS_getrandom] = "getrandom";
|
||
#endif
|
||
syscall_table[SYS_getrlimit] = "getrlimit";
|
||
syscall_table[SYS_getrlimit64] = "getrlimit64";
|
||
syscall_table[SYS_getsockname] = "getsockname";
|
||
syscall_table[SYS_getsockopt] = "getsockopt";
|
||
syscall_table[SYS_gettimeofday] = "gettimeofday";
|
||
syscall_table[SYS_getuid] = "getuid";
|
||
syscall_table[SYS_gtty] = "gtty";
|
||
syscall_table[SYS_hrtsys] = "hrtsys";
|
||
syscall_table[SYS_inst_sync] = "inst_sync";
|
||
syscall_table[SYS_install_utrap] = "install_utrap";
|
||
syscall_table[SYS_ioctl] = "ioctl";
|
||
#ifdef SYS_issetugid
|
||
syscall_table[SYS_issetugid] = "issetugid";
|
||
#endif
|
||
syscall_table[SYS_kaio] = "kaio";
|
||
syscall_table[SYS_kill] = "kill";
|
||
syscall_table[SYS_labelsys] = "labelsys";
|
||
#ifdef SYS_lchown
|
||
syscall_table[SYS_lchown] = "lchown";
|
||
#endif
|
||
syscall_table[SYS_lgrpsys] = "lgrpsys";
|
||
#ifdef SYS_link
|
||
syscall_table[SYS_link] = "link";
|
||
#endif
|
||
#ifdef SYS_linkat
|
||
syscall_table[SYS_linkat] = "linkat";
|
||
#endif
|
||
syscall_table[SYS_listen] = "listen";
|
||
syscall_table[SYS_llseek] = "llseek";
|
||
syscall_table[SYS_lseek] = "lseek";
|
||
#ifdef SYS_lstat
|
||
syscall_table[SYS_lstat] = "lstat";
|
||
#endif
|
||
#ifdef SYS_lstat64
|
||
syscall_table[SYS_lstat64] = "lstat64";
|
||
#endif
|
||
syscall_table[SYS_lwp_cond_broadcast] = "lwp_cond_broadcast";
|
||
syscall_table[SYS_lwp_cond_signal] = "lwp_cond_signal";
|
||
syscall_table[SYS_lwp_cond_wait] = "lwp_cond_wait";
|
||
syscall_table[SYS_lwp_continue] = "lwp_continue";
|
||
syscall_table[SYS_lwp_create] = "lwp_create";
|
||
syscall_table[SYS_lwp_detach] = "lwp_detach";
|
||
syscall_table[SYS_lwp_exit] = "lwp_exit";
|
||
syscall_table[SYS_lwp_info] = "lwp_info";
|
||
#ifdef SYS_lwp_kill
|
||
syscall_table[SYS_lwp_kill] = "lwp_kill";
|
||
#endif
|
||
#ifdef SYS_lwp_mutex_lock
|
||
syscall_table[SYS_lwp_mutex_lock] = "lwp_mutex_lock";
|
||
#endif
|
||
syscall_table[SYS_lwp_mutex_register] = "lwp_mutex_register";
|
||
syscall_table[SYS_lwp_mutex_timedlock] = "lwp_mutex_timedlock";
|
||
syscall_table[SYS_lwp_mutex_trylock] = "lwp_mutex_trylock";
|
||
syscall_table[SYS_lwp_mutex_unlock] = "lwp_mutex_unlock";
|
||
syscall_table[SYS_lwp_mutex_wakeup] = "lwp_mutex_wakeup";
|
||
#ifdef SYS_lwp_name
|
||
syscall_table[SYS_lwp_name] = "lwp_name";
|
||
#endif
|
||
syscall_table[SYS_lwp_park] = "lwp_park";
|
||
syscall_table[SYS_lwp_private] = "lwp_private";
|
||
syscall_table[SYS_lwp_rwlock_sys] = "lwp_rwlock_sys";
|
||
syscall_table[SYS_lwp_self] = "lwp_self";
|
||
syscall_table[SYS_lwp_sema_post] = "lwp_sema_post";
|
||
syscall_table[SYS_lwp_sema_timedwait] = "lwp_sema_timedwait";
|
||
syscall_table[SYS_lwp_sema_trywait] = "lwp_sema_trywait";
|
||
#ifdef SYS_lwp_sema_wait
|
||
syscall_table[SYS_lwp_sema_wait] = "lwp_sema_wait";
|
||
#endif
|
||
syscall_table[SYS_lwp_sigmask] = "lwp_sigmask";
|
||
#ifdef SYS_lwp_sigqueue
|
||
syscall_table[SYS_lwp_sigqueue] = "lwp_sigqueue";
|
||
#endif
|
||
syscall_table[SYS_lwp_suspend] = "lwp_suspend";
|
||
syscall_table[SYS_lwp_wait] = "lwp_wait";
|
||
#ifdef SYS_lxstat
|
||
syscall_table[SYS_lxstat] = "lxstat";
|
||
#endif
|
||
syscall_table[SYS_memcntl] = "memcntl";
|
||
#ifdef SYS_memsys
|
||
syscall_table[SYS_memsys] = "memsys";
|
||
#endif
|
||
syscall_table[SYS_mincore] = "mincore";
|
||
#ifdef SYS_mkdir
|
||
syscall_table[SYS_mkdir] = "mkdir";
|
||
#endif
|
||
#ifdef SYS_mkdirat
|
||
syscall_table[SYS_mkdirat] = "mkdirat";
|
||
#endif
|
||
#ifdef SYS_mknod
|
||
syscall_table[SYS_mknod] = "mknod";
|
||
#endif
|
||
#ifdef SYS_mknodat
|
||
syscall_table[SYS_mknodat] = "mknodat";
|
||
#endif
|
||
syscall_table[SYS_mmap] = "mmap";
|
||
syscall_table[SYS_mmap64] = "mmap64";
|
||
#ifdef SYS_mmapobj
|
||
syscall_table[SYS_mmapobj] = "mmapobj";
|
||
#endif
|
||
syscall_table[SYS_modctl] = "modctl";
|
||
syscall_table[SYS_mount] = "mount";
|
||
syscall_table[SYS_mprotect] = "mprotect";
|
||
syscall_table[SYS_msgsys] = "msgsys";
|
||
syscall_table[SYS_munmap] = "munmap";
|
||
syscall_table[SYS_nanosleep] = "nanosleep";
|
||
syscall_table[SYS_nfssys] = "nfssys";
|
||
syscall_table[SYS_nice] = "nice";
|
||
syscall_table[SYS_ntp_adjtime] = "ntp_adjtime";
|
||
syscall_table[SYS_ntp_gettime] = "ntp_gettime";
|
||
#ifdef SYS_open
|
||
syscall_table[SYS_open] = "open";
|
||
#endif
|
||
#ifdef SYS_open64
|
||
syscall_table[SYS_open64] = "open64";
|
||
#endif
|
||
#ifdef SYS_openat
|
||
syscall_table[SYS_openat] = "openat";
|
||
#endif
|
||
#ifdef SYS_openat64
|
||
syscall_table[SYS_openat64] = "openat64";
|
||
#endif
|
||
syscall_table[SYS_p_online] = "p_online";
|
||
syscall_table[SYS_pathconf] = "pathconf";
|
||
syscall_table[SYS_pause] = "pause";
|
||
syscall_table[SYS_pcsample] = "pcsample";
|
||
syscall_table[SYS_pgrpsys] = "pgrpsys";
|
||
syscall_table[SYS_pipe] = "pipe";
|
||
#ifdef SYS_plock
|
||
syscall_table[SYS_plock] = "plock";
|
||
#endif
|
||
#ifdef SYS_poll
|
||
syscall_table[SYS_poll] = "poll";
|
||
#endif
|
||
syscall_table[SYS_pollsys] = "pollsys";
|
||
syscall_table[SYS_port] = "port";
|
||
syscall_table[SYS_pread] = "pread";
|
||
syscall_table[SYS_pread64] = "pread64";
|
||
syscall_table[SYS_priocntlsys] = "priocntlsys";
|
||
syscall_table[SYS_privsys] = "privsys";
|
||
#ifdef SYS_processor_bind
|
||
syscall_table[SYS_processor_bind] = "processor_bind";
|
||
#endif
|
||
#ifdef SYS_processor_info
|
||
syscall_table[SYS_processor_info] = "processor_info";
|
||
#endif
|
||
#ifdef SYS_processor_sys
|
||
syscall_table[SYS_processor_sys] = "processor_sys";
|
||
#endif
|
||
syscall_table[SYS_profil] = "profil";
|
||
syscall_table[SYS_pset] = "pset";
|
||
syscall_table[SYS_putmsg] = "putmsg";
|
||
syscall_table[SYS_putpmsg] = "putpmsg";
|
||
syscall_table[SYS_pwrite] = "pwrite";
|
||
syscall_table[SYS_pwrite64] = "pwrite64";
|
||
syscall_table[SYS_rctlsys] = "rctlsys";
|
||
syscall_table[SYS_read] = "read";
|
||
#ifdef SYS_readlink
|
||
syscall_table[SYS_readlink] = "readlink";
|
||
#endif
|
||
#ifdef SYS_readlinkat
|
||
syscall_table[SYS_readlinkat] = "readlinkat";
|
||
#endif
|
||
syscall_table[SYS_readv] = "readv";
|
||
syscall_table[SYS_recv] = "recv";
|
||
syscall_table[SYS_recvfrom] = "recvfrom";
|
||
#ifdef SYS_recvmmsg
|
||
syscall_table[SYS_recvmmsg] = "recvmmsg";
|
||
#endif
|
||
syscall_table[SYS_recvmsg] = "recvmsg";
|
||
#ifdef SYS_reflinkat
|
||
syscall_table[SYS_reflinkat] = "reflinkat";
|
||
#endif
|
||
#ifdef SYS_rename
|
||
syscall_table[SYS_rename] = "rename";
|
||
#endif
|
||
#ifdef SYS_renameat
|
||
syscall_table[SYS_renameat] = "renameat";
|
||
#endif
|
||
syscall_table[SYS_resolvepath] = "resolvepath";
|
||
#ifdef SYS_rmdir
|
||
syscall_table[SYS_rmdir] = "rmdir";
|
||
#endif
|
||
syscall_table[SYS_rpcsys] = "rpcsys";
|
||
syscall_table[SYS_rusagesys] = "rusagesys";
|
||
syscall_table[SYS_schedctl] = "schedctl";
|
||
#ifdef SYS_secsys
|
||
syscall_table[SYS_secsys] = "secsys";
|
||
#endif
|
||
syscall_table[SYS_semsys] = "semsys";
|
||
syscall_table[SYS_send] = "send";
|
||
syscall_table[SYS_sendfilev] = "sendfilev";
|
||
#ifdef SYS_sendmmsg
|
||
syscall_table[SYS_sendmmsg] = "sendmmsg";
|
||
#endif
|
||
syscall_table[SYS_sendmsg] = "sendmsg";
|
||
syscall_table[SYS_sendto] = "sendto";
|
||
syscall_table[SYS_setegid] = "setegid";
|
||
syscall_table[SYS_seteuid] = "seteuid";
|
||
syscall_table[SYS_setgid] = "setgid";
|
||
syscall_table[SYS_setgroups] = "setgroups";
|
||
syscall_table[SYS_setitimer] = "setitimer";
|
||
syscall_table[SYS_setregid] = "setregid";
|
||
syscall_table[SYS_setreuid] = "setreuid";
|
||
syscall_table[SYS_setrlimit] = "setrlimit";
|
||
syscall_table[SYS_setrlimit64] = "setrlimit64";
|
||
syscall_table[SYS_setsockopt] = "setsockopt";
|
||
syscall_table[SYS_setuid] = "setuid";
|
||
syscall_table[SYS_sharefs] = "sharefs";
|
||
syscall_table[SYS_shmsys] = "shmsys";
|
||
syscall_table[SYS_shutdown] = "shutdown";
|
||
#ifdef SYS_sidsys
|
||
syscall_table[SYS_sidsys] = "sidsys";
|
||
#endif
|
||
syscall_table[SYS_sigaction] = "sigaction";
|
||
syscall_table[SYS_sigaltstack] = "sigaltstack";
|
||
#ifdef SYS_signal
|
||
syscall_table[SYS_signal] = "signal";
|
||
#endif
|
||
syscall_table[SYS_signotify] = "signotify";
|
||
syscall_table[SYS_sigpending] = "sigpending";
|
||
syscall_table[SYS_sigprocmask] = "sigprocmask";
|
||
syscall_table[SYS_sigqueue] = "sigqueue";
|
||
#ifdef SYS_sigresend
|
||
syscall_table[SYS_sigresend] = "sigresend";
|
||
#endif
|
||
syscall_table[SYS_sigsendsys] = "sigsendsys";
|
||
syscall_table[SYS_sigsuspend] = "sigsuspend";
|
||
syscall_table[SYS_sigtimedwait] = "sigtimedwait";
|
||
syscall_table[SYS_so_socket] = "so_socket";
|
||
syscall_table[SYS_so_socketpair] = "so_socketpair";
|
||
syscall_table[SYS_sockconfig] = "sockconfig";
|
||
#ifdef SYS_sparc_fixalign
|
||
syscall_table[SYS_sparc_fixalign] = "sparc_fixalign";
|
||
#endif
|
||
syscall_table[SYS_sparc_utrap_install] = "sparc_utrap_install";
|
||
#ifdef SYS_spawn
|
||
syscall_table[SYS_spawn] = "spawn";
|
||
#endif
|
||
#ifdef SYS_stat
|
||
syscall_table[SYS_stat] = "stat";
|
||
#endif
|
||
#ifdef SYS_stat64
|
||
syscall_table[SYS_stat64] = "stat64";
|
||
#endif
|
||
syscall_table[SYS_statfs] = "statfs";
|
||
syscall_table[SYS_statvfs] = "statvfs";
|
||
syscall_table[SYS_statvfs64] = "statvfs64";
|
||
syscall_table[SYS_stime] = "stime";
|
||
syscall_table[SYS_stty] = "stty";
|
||
#ifdef SYS_symlink
|
||
syscall_table[SYS_symlink] = "symlink";
|
||
#endif
|
||
#ifdef SYS_symlinkat
|
||
syscall_table[SYS_symlinkat] = "symlinkat";
|
||
#endif
|
||
syscall_table[SYS_sync] = "sync";
|
||
syscall_table[SYS_syscall] = "syscall";
|
||
syscall_table[SYS_sysconfig] = "sysconfig";
|
||
syscall_table[SYS_sysfs] = "sysfs";
|
||
syscall_table[SYS_sysi86] = "sysi86";
|
||
#ifdef SYS_syssun
|
||
syscall_table[SYS_syssun] = "syssun";
|
||
#endif
|
||
#ifdef SYS_system_stats
|
||
syscall_table[SYS_system_stats] = "system_stats";
|
||
#endif
|
||
syscall_table[SYS_systeminfo] = "systeminfo";
|
||
syscall_table[SYS_tasksys] = "tasksys";
|
||
syscall_table[SYS_time] = "time";
|
||
syscall_table[SYS_timer_create] = "timer_create";
|
||
syscall_table[SYS_timer_delete] = "timer_delete";
|
||
syscall_table[SYS_timer_getoverrun] = "timer_getoverrun";
|
||
syscall_table[SYS_timer_gettime] = "timer_gettime";
|
||
syscall_table[SYS_timer_settime] = "timer_settime";
|
||
syscall_table[SYS_times] = "times";
|
||
syscall_table[SYS_uadmin] = "uadmin";
|
||
syscall_table[SYS_ucredsys] = "ucredsys";
|
||
syscall_table[SYS_ulimit] = "ulimit";
|
||
syscall_table[SYS_umask] = "umask";
|
||
#ifdef SYS_umount
|
||
syscall_table[SYS_umount] = "umount";
|
||
#endif
|
||
syscall_table[SYS_umount2] = "umount2";
|
||
syscall_table[SYS_uname] = "uname";
|
||
#ifdef SYS_unlink
|
||
syscall_table[SYS_unlink] = "unlink";
|
||
#endif
|
||
#ifdef SYS_unlinkat
|
||
syscall_table[SYS_unlinkat] = "unlinkat";
|
||
#endif
|
||
#ifdef SYS_utime
|
||
syscall_table[SYS_utime] = "utime";
|
||
#endif
|
||
#ifdef SYS_utimensat
|
||
syscall_table[SYS_utimensat] = "utimensat";
|
||
#endif
|
||
#ifdef SYS_utimes
|
||
syscall_table[SYS_utimes] = "utimes";
|
||
#endif
|
||
#ifdef SYS_utimesys
|
||
syscall_table[SYS_utimesys] = "utimesys";
|
||
#endif
|
||
syscall_table[SYS_utssys] = "utssys";
|
||
syscall_table[SYS_uucopy] = "uucopy";
|
||
syscall_table[SYS_uucopystr] = "uucopystr";
|
||
#ifdef SYS_uuidsys
|
||
syscall_table[SYS_uuidsys] = "uuidsys";
|
||
#endif
|
||
#ifdef SYS_va_mask
|
||
syscall_table[SYS_va_mask] = "va_mask";
|
||
#endif
|
||
syscall_table[SYS_vfork] = "vfork";
|
||
syscall_table[SYS_vhangup] = "vhangup";
|
||
#ifdef SYS_wait
|
||
syscall_table[SYS_wait] = "wait";
|
||
#endif
|
||
#ifdef SYS_waitid
|
||
syscall_table[SYS_waitid] = "waitid";
|
||
#endif
|
||
#ifdef SYS_waitsys
|
||
syscall_table[SYS_waitsys] = "waitsys";
|
||
#endif
|
||
syscall_table[SYS_write] = "write";
|
||
syscall_table[SYS_writev] = "writev";
|
||
#ifdef SYS_xmknod
|
||
syscall_table[SYS_xmknod] = "xmknod";
|
||
#endif
|
||
#ifdef SYS_xstat
|
||
syscall_table[SYS_xstat] = "xstat";
|
||
#endif
|
||
syscall_table[SYS_yield] = "yield";
|
||
syscall_table[SYS_zone] = "zone";
|
||
}
|
||
|
||
/* Prettyprint syscall NUM. */
|
||
|
||
void
|
||
proc_prettyfprint_syscall (FILE *file, int num, int verbose)
|
||
{
|
||
if (syscall_table[num])
|
||
fprintf (file, "SYS_%s ", syscall_table[num]);
|
||
else
|
||
fprintf (file, "<Unknown syscall %d> ", num);
|
||
}
|
||
|
||
void
|
||
proc_prettyprint_syscall (int num, int verbose)
|
||
{
|
||
proc_prettyfprint_syscall (stdout, num, verbose);
|
||
}
|
||
|
||
/* Prettyprint all syscalls in SYSSET. */
|
||
|
||
void
|
||
proc_prettyfprint_syscalls (FILE *file, sysset_t *sysset, int verbose)
|
||
{
|
||
int i;
|
||
|
||
for (i = 0; i < MAX_SYSCALLS; i++)
|
||
if (prismember (sysset, i))
|
||
{
|
||
proc_prettyfprint_syscall (file, i, verbose);
|
||
}
|
||
fprintf (file, "\n");
|
||
}
|
||
|
||
void
|
||
proc_prettyprint_syscalls (sysset_t *sysset, int verbose)
|
||
{
|
||
proc_prettyfprint_syscalls (stdout, sysset, verbose);
|
||
}
|
||
|
||
/* Prettyprint signals. */
|
||
|
||
/* Signal translation table, ordered ANSI-standard signals first,
|
||
other signals second, with signals in each block ordered by their
|
||
numerical values on a typical POSIX platform. */
|
||
|
||
static struct trans signal_table[] =
|
||
{
|
||
{ 0, "<no signal>", "no signal" },
|
||
|
||
/* SIGINT, SIGILL, SIGABRT, SIGFPE, SIGSEGV and SIGTERM
|
||
are ANSI-standard signals and are always available. */
|
||
|
||
{ SIGINT, "SIGINT", "Interrupt (rubout)" },
|
||
{ SIGILL, "SIGILL", "Illegal instruction" }, /* not reset when caught */
|
||
{ SIGABRT, "SIGABRT", "used by abort()" }, /* replaces SIGIOT */
|
||
{ SIGFPE, "SIGFPE", "Floating point exception" },
|
||
{ SIGSEGV, "SIGSEGV", "Segmentation violation" },
|
||
{ SIGTERM, "SIGTERM", "Software termination signal from kill" },
|
||
|
||
/* All other signals need preprocessor conditionals. */
|
||
|
||
{ SIGHUP, "SIGHUP", "Hangup" },
|
||
{ SIGQUIT, "SIGQUIT", "Quit (ASCII FS)" },
|
||
{ SIGTRAP, "SIGTRAP", "Trace trap" }, /* not reset when caught */
|
||
{ SIGIOT, "SIGIOT", "IOT instruction" },
|
||
{ SIGEMT, "SIGEMT", "EMT instruction" },
|
||
{ SIGKILL, "SIGKILL", "Kill" }, /* Solaris: cannot be caught/ignored */
|
||
{ SIGBUS, "SIGBUS", "Bus error" },
|
||
{ SIGSYS, "SIGSYS", "Bad argument to system call" },
|
||
{ SIGPIPE, "SIGPIPE", "Write to pipe with no one to read it" },
|
||
{ SIGALRM, "SIGALRM", "Alarm clock" },
|
||
{ SIGUSR1, "SIGUSR1", "User defined signal 1" },
|
||
{ SIGUSR2, "SIGUSR2", "User defined signal 2" },
|
||
{ SIGCHLD, "SIGCHLD", "Child status changed" }, /* Posix version */
|
||
{ SIGCLD, "SIGCLD", "Child status changed" }, /* Solaris version */
|
||
{ SIGPWR, "SIGPWR", "Power-fail restart" },
|
||
{ SIGWINCH, "SIGWINCH", "Window size change" },
|
||
{ SIGURG, "SIGURG", "Urgent socket condition" },
|
||
{ SIGPOLL, "SIGPOLL", "Pollable event" },
|
||
{ SIGIO, "SIGIO", "Socket I/O possible" }, /* alias for SIGPOLL */
|
||
{ SIGSTOP, "SIGSTOP", "Stop, not from tty" }, /* cannot be caught or
|
||
ignored */
|
||
{ SIGTSTP, "SIGTSTP", "User stop from tty" },
|
||
{ SIGCONT, "SIGCONT", "Stopped process has been continued" },
|
||
{ SIGTTIN, "SIGTTIN", "Background tty read attempted" },
|
||
{ SIGTTOU, "SIGTTOU", "Background tty write attempted" },
|
||
{ SIGVTALRM, "SIGVTALRM", "Virtual timer expired" },
|
||
{ SIGPROF, "SIGPROF", "Profiling timer expired" },
|
||
{ SIGXCPU, "SIGXCPU", "Exceeded CPU limit" },
|
||
{ SIGXFSZ, "SIGXFSZ", "Exceeded file size limit" },
|
||
{ SIGWAITING, "SIGWAITING", "Process's LWPs are blocked" },
|
||
{ SIGLWP, "SIGLWP", "Used by thread library" },
|
||
{ SIGFREEZE, "SIGFREEZE", "Used by CPR" },
|
||
{ SIGTHAW, "SIGTHAW", "Used by CPR" },
|
||
{ SIGCANCEL, "SIGCANCEL", "Used by libthread" },
|
||
{ SIGLOST, "SIGLOST", "Resource lost" },
|
||
|
||
/* FIXME: add real-time signals. */
|
||
};
|
||
|
||
/* Prettyprint signal number SIGNO. */
|
||
|
||
void
|
||
proc_prettyfprint_signal (FILE *file, int signo, int verbose)
|
||
{
|
||
int i;
|
||
|
||
for (i = 0; i < sizeof (signal_table) / sizeof (signal_table[0]); i++)
|
||
if (signo == signal_table[i].value)
|
||
{
|
||
fprintf (file, "%s", signal_table[i].name);
|
||
if (verbose)
|
||
fprintf (file, ": %s\n", signal_table[i].desc);
|
||
else
|
||
fprintf (file, " ");
|
||
return;
|
||
}
|
||
fprintf (file, "Unknown signal %d%c", signo, verbose ? '\n' : ' ');
|
||
}
|
||
|
||
void
|
||
proc_prettyprint_signal (int signo, int verbose)
|
||
{
|
||
proc_prettyfprint_signal (stdout, signo, verbose);
|
||
}
|
||
|
||
/* Prettyprint all signals in SIGSET. */
|
||
|
||
void
|
||
proc_prettyfprint_signalset (FILE *file, sigset_t *sigset, int verbose)
|
||
{
|
||
int i;
|
||
|
||
/* Loop over all signal numbers from 0 to NSIG, using them as the
|
||
index to prismember. The signal table had better not contain
|
||
aliases, for if it does they will both be printed. */
|
||
|
||
for (i = 0; i < NSIG; i++)
|
||
if (prismember (sigset, i))
|
||
proc_prettyfprint_signal (file, i, verbose);
|
||
|
||
if (!verbose)
|
||
fprintf (file, "\n");
|
||
}
|
||
|
||
void
|
||
proc_prettyprint_signalset (sigset_t *sigset, int verbose)
|
||
{
|
||
proc_prettyfprint_signalset (stdout, sigset, verbose);
|
||
}
|
||
|
||
|
||
/* Prettyprint faults. */
|
||
|
||
/* Fault translation table. */
|
||
|
||
static struct trans fault_table[] =
|
||
{
|
||
{ FLTILL, "FLTILL", "Illegal instruction" },
|
||
{ FLTPRIV, "FLTPRIV", "Privileged instruction" },
|
||
{ FLTBPT, "FLTBPT", "Breakpoint trap" },
|
||
{ FLTTRACE, "FLTTRACE", "Trace trap" },
|
||
{ FLTACCESS, "FLTACCESS", "Memory access fault" },
|
||
{ FLTBOUNDS, "FLTBOUNDS", "Memory bounds violation" },
|
||
{ FLTIOVF, "FLTIOVF", "Integer overflow" },
|
||
{ FLTIZDIV, "FLTIZDIV", "Integer zero divide" },
|
||
{ FLTFPE, "FLTFPE", "Floating-point exception" },
|
||
{ FLTSTACK, "FLTSTACK", "Unrecoverable stack fault" },
|
||
{ FLTPAGE, "FLTPAGE", "Recoverable page fault" },
|
||
{ FLTWATCH, "FLTWATCH", "User watchpoint" },
|
||
};
|
||
|
||
/* Work horse. Accepts an index into the fault table, prints it
|
||
pretty. */
|
||
|
||
static void
|
||
prettyfprint_faulttable_entry (FILE *file, int i, int verbose)
|
||
{
|
||
fprintf (file, "%s", fault_table[i].name);
|
||
if (verbose)
|
||
fprintf (file, ": %s\n", fault_table[i].desc);
|
||
else
|
||
fprintf (file, " ");
|
||
}
|
||
|
||
/* Prettyprint hardware fault number FAULTNO. */
|
||
|
||
void
|
||
proc_prettyfprint_fault (FILE *file, int faultno, int verbose)
|
||
{
|
||
int i;
|
||
|
||
for (i = 0; i < ARRAY_SIZE (fault_table); i++)
|
||
if (faultno == fault_table[i].value)
|
||
{
|
||
prettyfprint_faulttable_entry (file, i, verbose);
|
||
return;
|
||
}
|
||
|
||
fprintf (file, "Unknown hardware fault %d%c",
|
||
faultno, verbose ? '\n' : ' ');
|
||
}
|
||
|
||
void
|
||
proc_prettyprint_fault (int faultno, int verbose)
|
||
{
|
||
proc_prettyfprint_fault (stdout, faultno, verbose);
|
||
}
|
||
|
||
/* Prettyprint all faults in FLTSET. */
|
||
|
||
void
|
||
proc_prettyfprint_faultset (FILE *file, fltset_t *fltset, int verbose)
|
||
{
|
||
int i;
|
||
|
||
/* Loop through the fault table, using the value field as the index
|
||
to prismember. The fault table had better not contain aliases,
|
||
for if it does they will both be printed. */
|
||
|
||
for (i = 0; i < ARRAY_SIZE (fault_table); i++)
|
||
if (prismember (fltset, fault_table[i].value))
|
||
prettyfprint_faulttable_entry (file, i, verbose);
|
||
|
||
if (!verbose)
|
||
fprintf (file, "\n");
|
||
}
|
||
|
||
void
|
||
proc_prettyprint_faultset (fltset_t *fltset, int verbose)
|
||
{
|
||
proc_prettyfprint_faultset (stdout, fltset, verbose);
|
||
}
|
||
|
||
/* TODO: actions, holds... */
|
||
|
||
void
|
||
proc_prettyprint_actionset (struct sigaction *actions, int verbose)
|
||
{
|
||
}
|
||
|
||
void _initialize_proc_events ();
|
||
void
|
||
_initialize_proc_events ()
|
||
{
|
||
init_syscall_table ();
|
||
}
|