Index: dist/gdb/i386-nbsd-nat.c =================================================================== RCS file: /cvsroot/src/external/gpl3/gdb/dist/gdb/i386-nbsd-nat.c,v retrieving revision 1.5 diff -u -r1.5 i386-nbsd-nat.c --- dist/gdb/i386-nbsd-nat.c 26 May 2019 21:40:01 -0000 1.5 +++ dist/gdb/i386-nbsd-nat.c 22 Jun 2019 13:21:39 -0000 @@ -29,9 +29,56 @@ /* Support for debugging kernel virtual memory images. */ #include +#if defined(__x86_64__) +#include + +#include + +struct segment_descriptor { + unsigned sd_lolimit:16; /* segment extent (lsb) */ + unsigned sd_lobase:24; /* segment base address (lsb) */ + unsigned sd_type:5; /* segment type */ + unsigned sd_dpl:2; /* segment descriptor priority level */ + unsigned sd_p:1; /* segment descriptor present */ + unsigned sd_hilimit:4; /* segment extent (msb) */ + unsigned sd_xx:2; /* unused */ + unsigned sd_def32:1; /* default 32 vs 16 bit size */ + unsigned sd_gran:1; /* limit granularity (byte/page) */ + unsigned sd_hibase:8; /* segment base address (msb) */ +} __packed; + +struct pcb { + int pcb_esp0; /* ring0 esp */ + int pcb_esp; /* kernel esp */ + int pcb_ebp; /* kernel ebp */ + int pcb_cr0; /* saved image of CR0 */ + int pcb_cr2; /* page fault address (CR2) */ + int pcb_cr3; /* page directory pointer */ + int pcb_iopl; /* i/o privilege level */ + struct segment_descriptor pcb_fsd; /* %fs descriptor */ + struct segment_descriptor pcb_gsd; /* %gs descriptor */ + void *pcb_onfault; /* copyin/out fault recovery */ + char *pcb_iomap; /* I/O permission bitmap */ + struct dbreg *pcb_dbregs; /* CPU Debug Registers */ + uint16_t pcb_fpu_dflt_cw; +#define PCB_DBREGS 0x01 + int pcb_flags; + + int not_used[15]; + + /* floating point state */ + struct cpu_info *pcb_fpcpu; /* cpu holding our fp state. */ + union savefpu pcb_savefpu __aligned(64); + /* **** DO NOT ADD ANYTHING HERE **** */ + +}; + + +#else #include #include #include +#endif #include "nbsd-nat.h" #include "bsd-kvm.h" Index: lib/libgdb/arch/x86_64/defs.mk =================================================================== RCS file: /cvsroot/src/external/gpl3/gdb/lib/libgdb/arch/x86_64/defs.mk,v retrieving revision 1.16 diff -u -r1.16 defs.mk --- lib/libgdb/arch/x86_64/defs.mk 29 May 2019 22:10:59 -0000 1.16 +++ lib/libgdb/arch/x86_64/defs.mk 22 Jun 2019 13:21:59 -0000 @@ -3,5 +3,5 @@ # Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_INTERNAL_CFLAGS= -I. -I${GNUHOSTDIST}/gdb -I${GNUHOSTDIST}/gdb/config -DLOCALEDIR=\"/usr/share/locale\" -DHAVE_CONFIG_H -I${GNUHOSTDIST}/gdb/../include/opcode -I${GNUHOSTDIST}/gdb/../readline/.. -I${GNUHOSTDIST}/gdb/../zlib -I../bfd -I${GNUHOSTDIST}/gdb/../bfd -I${GNUHOSTDIST}/gdb/../include -I../libdecnumber -I${GNUHOSTDIST}/gdb/../libdecnumber -I./../intl -I${GNUHOSTDIST}/gdb/gnulib/import -Ibuild-gnulib/import -DTUI=1 -Wall -Wpointer-arith -Wno-unused -Wunused-value -Wunused-variable -Wunused-function -Wno-switch -Wno-char-subscripts -Wempty-body -Wunused-but-set-parameter -Wunused-but-set-variable -Wno-sign-compare -Wno-error=maybe-uninitialized -Wsuggest-override -Wimplicit-fallthrough=3 -Wduplicated-cond -Wshadow=local -Wformat -Wformat-nonliteral -G_LIBGDB_OBS=ada-exp.o ada-lang.o ada-tasks.o ada-typeprint.o ada-valprint.o ada-varobj.o addrmap.o agent.o amd64-bsd-nat.o amd64-nat.o amd64-nbsd-nat.o amd64-nbsd-tdep.o amd64-tdep.o annotate.o arch-utils.o amd64.o i386.o auto-load.o auxv.o ax-gdb.o ax-general.o bcache.o bfd-target.o block.o blockframe.o break-catch-sig.o break-catch-syscall.o break-catch-throw.o breakpoint.o bsd-kvm.o btrace.o build-id.o buildsym-legacy.o buildsym.o c-exp.o c-lang.o c-typeprint.o c-valprint.o c-varobj.o charset.o cli-out.o cli-cmds.o cli-decode.o cli-dump.o cli-interp.o cli-logging.o cli-script.o cli-setshow.o cli-style.o cli-utils.o coff-pe-read.o coffread.o common-agent.o btrace-common.o buffer.o cleanups.o common-debug.o common-exceptions.o common-regcache.o common-utils.o environ.o errors.o fileio.o filestuff.o format.o gdb_tilde_expand.o gdb_vecs.o job-control.o netstuff.o new-op.o pathstuff.o posix-strerror.o print-utils.o ptid.o rsp-low.o run-time-clock.o scoped_mmap.o signals-state-save-restore.o signals.o tdesc.o vec.o xml-utils.o compile-c-support.o compile-c-symbols.o compile-c-types.o compile-cplus-symbols.o compile-cplus-types.o compile-loc2c.o compile-object-load.o compile-object-run.o compile.o complaints.o completer.o continuations.o copying.o corefile.o corelow.o cp-abi.o cp-name-parser.o cp-namespace.o cp-support.o cp-valprint.o ctf.o d-exp.o d-lang.o d-namespace.o d-valprint.o dbxread.o dcache.o debug.o demangle.o dictionary.o disasm-selftests.o disasm.o dtrace-probe.o dummy-frame.o dwarf-index-cache.o dwarf-index-common.o dwarf-index-write.o dwarf2-frame-tailcall.o dwarf2-frame.o dwarf2expr.o dwarf2loc.o dwarf2read.o elfread.o eval.o event-loop.o event-top.o exceptions.o exec.o expprint.o extension.o f-exp.o f-lang.o f-typeprint.o f-valprint.o filename-seen-cache.o filesystem.o findcmd.o findvar.o fork-child.o frame-base.o frame-unwind.o frame.o gcore.o gdb-dlfcn.o gdb_bfd.o gdb_obstack.o gdb_regex.o gdb_usleep.o gdbarch-selftests.o gdbarch.o gdbtypes.o gnu-v2-abi.o gnu-v3-abi.o go-exp.o go-lang.o go-typeprint.o go-valprint.o guile.o i386-tdep.o i387-tdep.o inf-child.o inf-loop.o inf-ptrace.o infcall.o infcmd.o inferior.o inflow.o infrun.o inline-frame.o interps.o jit.o language.o linespec.o location.o m2-exp.o m2-lang.o m2-typeprint.o m2-valprint.o macrocmd.o macroexp.o macroscope.o macrotab.o main.o maint.o mdebugread.o mem-break.o memattr.o memory-map.o memrange.o mi-cmd-break.o mi-cmd-catch.o mi-cmd-disas.o mi-cmd-env.o mi-cmd-file.o mi-cmd-info.o mi-cmd-stack.o mi-cmd-target.o mi-cmd-var.o mi-cmds.o mi-common.o mi-console.o mi-getopt.o mi-interp.o mi-main.o mi-out.o mi-parse.o mi-symbol-cmds.o minidebug.o minsyms.o mipsread.o namespace.o fork-inferior.o x86-dregs.o nbsd-nat.o nbsd-tdep.o objc-lang.o objfiles.o observable.o opencl-lang.o osabi.o osdata.o p-exp.o p-lang.o p-typeprint.o p-valprint.o parse.o posix-hdep.o printcmd.o probe.o process-stratum-target.o producer.o progspace-and-thread.o progspace.o prologue-value.o psymtab.o python.o record-btrace.o record-full.o record.o regcache-dump.o regcache.o reggroups.o registry.o remote-fileio.o remote-notif.o remote.o reverse.o rust-exp.o rust-lang.o sentinel-frame.o ser-base.o ser-event.o ser-pipe.o ser-tcp.o ser-uds.o ser-unix.o serial.o skip.o solib-svr4.o solib-target.o solib.o source-cache.o source.o stabsread.o stack.o stap-probe.o std-regs.o symfile-debug.o symfile.o symmisc.o symtab.o target-dcache.o target-descriptions.o target-float.o target-memory.o target.o waitstatus.o test-target.o thread-iter.o thread.o tid-parse.o top.o tracefile-tfile.o tracefile.o tracepoint.o trad-frame.o tramp-frame.o tui-command.o tui-data.o tui-disasm.o tui-file.o tui-hooks.o tui-interp.o tui-io.o tui-layout.o tui-out.o tui-regs.o tui-source.o tui-stack.o tui-win.o tui-windata.o tui-wingeneral.o tui-winsource.o tui.o typeprint.o ui-file.o ui-out.o ui-style.o user-regs.o utils.o valarith.o valops.o valprint.o value.o varobj.o version.o x86-bsd-nat.o x86-nat.o x86-tdep.o xml-builtin.o xml-support.o xml-syscall.o xml-tdesc.o init.o +G_LIBGDB_OBS=ada-exp.o ada-lang.o ada-tasks.o ada-typeprint.o ada-valprint.o ada-varobj.o addrmap.o agent.o amd64-bsd-nat.o amd64-nat.o amd64-nbsd-nat.o amd64-nbsd-tdep.o amd64-tdep.o i386-bsd-tdep.o i386-nbsd-tdep.o i386-nbsd-nat.o annotate.o arch-utils.o amd64.o i386.o auto-load.o auxv.o ax-gdb.o ax-general.o bcache.o bfd-target.o block.o blockframe.o break-catch-sig.o break-catch-syscall.o break-catch-throw.o breakpoint.o bsd-kvm.o btrace.o build-id.o buildsym-legacy.o buildsym.o c-exp.o c-lang.o c-typeprint.o c-valprint.o c-varobj.o charset.o cli-out.o cli-cmds.o cli-decode.o cli-dump.o cli-interp.o cli-logging.o cli-script.o cli-setshow.o cli-style.o cli-utils.o coff-pe-read.o coffread.o common-agent.o btrace-common.o buffer.o cleanups.o common-debug.o common-exceptions.o common-regcache.o common-utils.o environ.o errors.o fileio.o filestuff.o format.o gdb_tilde_expand.o gdb_vecs.o job-control.o netstuff.o new-op.o pathstuff.o posix-strerror.o print-utils.o ptid.o rsp-low.o run-time-clock.o scoped_mmap.o signals-state-save-restore.o signals.o tdesc.o vec.o xml-utils.o compile-c-support.o compile-c-symbols.o compile-c-types.o compile-cplus-symbols.o compile-cplus-types.o compile-loc2c.o compile-object-load.o compile-object-run.o compile.o complaints.o completer.o continuations.o copying.o corefile.o corelow.o cp-abi.o cp-name-parser.o cp-namespace.o cp-support.o cp-valprint.o ctf.o d-exp.o d-lang.o d-namespace.o d-valprint.o dbxread.o dcache.o debug.o demangle.o dictionary.o disasm-selftests.o disasm.o dtrace-probe.o dummy-frame.o dwarf-index-cache.o dwarf-index-common.o dwarf-index-write.o dwarf2-frame-tailcall.o dwarf2-frame.o dwarf2expr.o dwarf2loc.o dwarf2read.o elfread.o eval.o event-loop.o event-top.o exceptions.o exec.o expprint.o extension.o f-exp.o f-lang.o f-typeprint.o f-valprint.o filename-seen-cache.o filesystem.o findcmd.o findvar.o fork-child.o frame-base.o frame-unwind.o frame.o gcore.o gdb-dlfcn.o gdb_bfd.o gdb_obstack.o gdb_regex.o gdb_usleep.o gdbarch-selftests.o gdbarch.o gdbtypes.o gnu-v2-abi.o gnu-v3-abi.o go-exp.o go-lang.o go-typeprint.o go-valprint.o guile.o i386-tdep.o i387-tdep.o inf-child.o inf-loop.o inf-ptrace.o infcall.o infcmd.o inferior.o inflow.o infrun.o inline-frame.o interps.o jit.o language.o linespec.o location.o m2-exp.o m2-lang.o m2-typeprint.o m2-valprint.o macrocmd.o macroexp.o macroscope.o macrotab.o main.o maint.o mdebugread.o mem-break.o memattr.o memory-map.o memrange.o mi-cmd-break.o mi-cmd-catch.o mi-cmd-disas.o mi-cmd-env.o mi-cmd-file.o mi-cmd-info.o mi-cmd-stack.o mi-cmd-target.o mi-cmd-var.o mi-cmds.o mi-common.o mi-console.o mi-getopt.o mi-interp.o mi-main.o mi-out.o mi-parse.o mi-symbol-cmds.o minidebug.o minsyms.o mipsread.o namespace.o fork-inferior.o x86-dregs.o nbsd-nat.o nbsd-tdep.o objc-lang.o objfiles.o observable.o opencl-lang.o osabi.o osdata.o p-exp.o p-lang.o p-typeprint.o p-valprint.o parse.o posix-hdep.o printcmd.o probe.o process-stratum-target.o producer.o progspace-and-thread.o progspace.o prologue-value.o psymtab.o python.o record-btrace.o record-full.o record.o regcache-dump.o regcache.o reggroups.o registry.o remote-fileio.o remote-notif.o remote.o reverse.o rust-exp.o rust-lang.o sentinel-frame.o ser-base.o ser-event.o ser-pipe.o ser-tcp.o ser-uds.o ser-unix.o serial.o skip.o solib-svr4.o solib-target.o solib.o source-cache.o source.o stabsread.o stack.o stap-probe.o std-regs.o symfile-debug.o symfile.o symmisc.o symtab.o target-dcache.o target-descriptions.o target-float.o target-memory.o target.o waitstatus.o test-target.o thread-iter.o thread.o tid-parse.o top.o tracefile-tfile.o tracefile.o tracepoint.o trad-frame.o tramp-frame.o tui-command.o tui-data.o tui-disasm.o tui-file.o tui-hooks.o tui-interp.o tui-io.o tui-layout.o tui-out.o tui-regs.o tui-source.o tui-stack.o tui-win.o tui-windata.o tui-wingeneral.o tui-winsource.o tui.o typeprint.o ui-file.o ui-out.o ui-style.o user-regs.o utils.o valarith.o valops.o valprint.o value.o varobj.o version.o x86-bsd-nat.o x86-nat.o x86-tdep.o xml-builtin.o xml-support.o xml-syscall.o xml-tdesc.o init.o G_SIM_OBS= Index: lib/libgdb/arch/x86_64/init.c =================================================================== RCS file: /cvsroot/src/external/gpl3/gdb/lib/libgdb/arch/x86_64/init.c,v retrieving revision 1.16 diff -u -r1.16 init.c --- lib/libgdb/arch/x86_64/init.c 29 May 2019 22:10:59 -0000 1.16 +++ lib/libgdb/arch/x86_64/init.c 22 Jun 2019 13:21:59 -0000 @@ -10,6 +10,7 @@ extern initialize_file_ftype _initialize_amd64_tdep; extern initialize_file_ftype _initialize_svr4_solib; extern initialize_file_ftype _initialize_amd64nbsd_tdep; +extern initialize_file_ftype _initialize_i386nbsd_tdep; extern initialize_file_ftype _initialize_ser_hardwire; extern initialize_file_ftype _initialize_ser_pipe; extern initialize_file_ftype _initialize_ser_tcp; @@ -174,6 +175,7 @@ _initialize_amd64_tdep (); _initialize_svr4_solib (); _initialize_amd64nbsd_tdep (); + _initialize_i386nbsd_tdep (); _initialize_ser_hardwire (); _initialize_ser_pipe (); _initialize_ser_tcp ();