binutils-gdb/gdb/amd64-linux-tdep.c

2284 lines
66 KiB
C
Raw Permalink Normal View History

/* Target-dependent code for GNU/Linux x86-64.
2002-02-24 23:14:33 +01:00
Copyright (C) 2001-2020 Free Software Foundation, Inc.
Contributed by Jiri Smid, SuSE Labs.
This file is part of GDB.
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/>. */
#include "defs.h"
#include "arch-utils.h"
#include "frame.h"
#include "gdbcore.h"
Sort includes for files gdb/[a-f]*.[chyl]. This patch sorts the include files for the files [a-f]*.[chyl]. The patch was written by a script. Tested by the buildbot. I will follow up with patches to sort the remaining files, by sorting a subset, testing them, and then checking them in. gdb/ChangeLog 2019-04-05 Tom Tromey <tom@tromey.com> * ft32-tdep.c: Sort headers. * frv-tdep.c: Sort headers. * frv-linux-tdep.c: Sort headers. * frame.c: Sort headers. * frame-unwind.c: Sort headers. * frame-base.c: Sort headers. * fork-child.c: Sort headers. * findvar.c: Sort headers. * findcmd.c: Sort headers. * filesystem.c: Sort headers. * filename-seen-cache.h: Sort headers. * filename-seen-cache.c: Sort headers. * fbsd-tdep.c: Sort headers. * fbsd-nat.h: Sort headers. * fbsd-nat.c: Sort headers. * f-valprint.c: Sort headers. * f-typeprint.c: Sort headers. * f-lang.c: Sort headers. * extension.h: Sort headers. * extension.c: Sort headers. * extension-priv.h: Sort headers. * expprint.c: Sort headers. * exec.h: Sort headers. * exec.c: Sort headers. * exceptions.c: Sort headers. * event-top.c: Sort headers. * event-loop.c: Sort headers. * eval.c: Sort headers. * elfread.c: Sort headers. * dwarf2read.h: Sort headers. * dwarf2read.c: Sort headers. * dwarf2loc.c: Sort headers. * dwarf2expr.h: Sort headers. * dwarf2expr.c: Sort headers. * dwarf2-frame.c: Sort headers. * dwarf2-frame-tailcall.c: Sort headers. * dwarf-index-write.h: Sort headers. * dwarf-index-write.c: Sort headers. * dwarf-index-common.c: Sort headers. * dwarf-index-cache.h: Sort headers. * dwarf-index-cache.c: Sort headers. * dummy-frame.c: Sort headers. * dtrace-probe.c: Sort headers. * disasm.h: Sort headers. * disasm.c: Sort headers. * disasm-selftests.c: Sort headers. * dictionary.c: Sort headers. * dicos-tdep.c: Sort headers. * demangle.c: Sort headers. * dcache.h: Sort headers. * dcache.c: Sort headers. * darwin-nat.h: Sort headers. * darwin-nat.c: Sort headers. * darwin-nat-info.c: Sort headers. * d-valprint.c: Sort headers. * d-namespace.c: Sort headers. * d-lang.c: Sort headers. * ctf.c: Sort headers. * csky-tdep.c: Sort headers. * csky-linux-tdep.c: Sort headers. * cris-tdep.c: Sort headers. * cris-linux-tdep.c: Sort headers. * cp-valprint.c: Sort headers. * cp-support.c: Sort headers. * cp-namespace.c: Sort headers. * cp-abi.c: Sort headers. * corelow.c: Sort headers. * corefile.c: Sort headers. * continuations.c: Sort headers. * completer.h: Sort headers. * completer.c: Sort headers. * complaints.c: Sort headers. * coffread.c: Sort headers. * coff-pe-read.c: Sort headers. * cli-out.h: Sort headers. * cli-out.c: Sort headers. * charset.c: Sort headers. * c-varobj.c: Sort headers. * c-valprint.c: Sort headers. * c-typeprint.c: Sort headers. * c-lang.c: Sort headers. * buildsym.c: Sort headers. * buildsym-legacy.c: Sort headers. * build-id.h: Sort headers. * build-id.c: Sort headers. * btrace.c: Sort headers. * bsd-uthread.c: Sort headers. * breakpoint.h: Sort headers. * breakpoint.c: Sort headers. * break-catch-throw.c: Sort headers. * break-catch-syscall.c: Sort headers. * break-catch-sig.c: Sort headers. * blockframe.c: Sort headers. * block.c: Sort headers. * bfin-tdep.c: Sort headers. * bfin-linux-tdep.c: Sort headers. * bfd-target.c: Sort headers. * bcache.c: Sort headers. * ax-general.c: Sort headers. * ax-gdb.h: Sort headers. * ax-gdb.c: Sort headers. * avr-tdep.c: Sort headers. * auxv.c: Sort headers. * auto-load.c: Sort headers. * arm-wince-tdep.c: Sort headers. * arm-tdep.c: Sort headers. * arm-symbian-tdep.c: Sort headers. * arm-pikeos-tdep.c: Sort headers. * arm-obsd-tdep.c: Sort headers. * arm-nbsd-tdep.c: Sort headers. * arm-nbsd-nat.c: Sort headers. * arm-linux-tdep.c: Sort headers. * arm-linux-nat.c: Sort headers. * arm-fbsd-tdep.c: Sort headers. * arm-fbsd-nat.c: Sort headers. * arm-bsd-tdep.c: Sort headers. * arch-utils.c: Sort headers. * arc-tdep.c: Sort headers. * arc-newlib-tdep.c: Sort headers. * annotate.h: Sort headers. * annotate.c: Sort headers. * amd64-windows-tdep.c: Sort headers. * amd64-windows-nat.c: Sort headers. * amd64-tdep.c: Sort headers. * amd64-sol2-tdep.c: Sort headers. * amd64-obsd-tdep.c: Sort headers. * amd64-obsd-nat.c: Sort headers. * amd64-nbsd-tdep.c: Sort headers. * amd64-nbsd-nat.c: Sort headers. * amd64-nat.c: Sort headers. * amd64-linux-tdep.c: Sort headers. * amd64-linux-nat.c: Sort headers. * amd64-fbsd-tdep.c: Sort headers. * amd64-fbsd-nat.c: Sort headers. * amd64-dicos-tdep.c: Sort headers. * amd64-darwin-tdep.c: Sort headers. * amd64-bsd-nat.c: Sort headers. * alpha-tdep.c: Sort headers. * alpha-obsd-tdep.c: Sort headers. * alpha-nbsd-tdep.c: Sort headers. * alpha-mdebug-tdep.c: Sort headers. * alpha-linux-tdep.c: Sort headers. * alpha-linux-nat.c: Sort headers. * alpha-bsd-tdep.c: Sort headers. * alpha-bsd-nat.c: Sort headers. * aix-thread.c: Sort headers. * agent.c: Sort headers. * addrmap.c: Sort headers. * ada-varobj.c: Sort headers. * ada-valprint.c: Sort headers. * ada-typeprint.c: Sort headers. * ada-tasks.c: Sort headers. * ada-lang.c: Sort headers. * aarch64-tdep.c: Sort headers. * aarch64-ravenscar-thread.c: Sort headers. * aarch64-newlib-tdep.c: Sort headers. * aarch64-linux-tdep.c: Sort headers. * aarch64-linux-nat.c: Sort headers. * aarch64-fbsd-tdep.c: Sort headers. * aarch64-fbsd-nat.c: Sort headers. * aarch32-linux-nat.c: Sort headers.
2019-04-03 04:04:24 +02:00
#include "regcache.h"
Revert the header-sorting patch Andreas Schwab and John Baldwin pointed out some bugs in the header sorting patch; and I noticed that the output was not correct when limited to a subset of files (a bug in my script). So, I'm reverting the patch. I may try again after fixing the issues pointed out. gdb/ChangeLog 2019-04-05 Tom Tromey <tom@tromey.com> Revert the header-sorting patch. * ft32-tdep.c: Revert. * frv-tdep.c: Revert. * frv-linux-tdep.c: Revert. * frame.c: Revert. * frame-unwind.c: Revert. * frame-base.c: Revert. * fork-child.c: Revert. * findvar.c: Revert. * findcmd.c: Revert. * filesystem.c: Revert. * filename-seen-cache.h: Revert. * filename-seen-cache.c: Revert. * fbsd-tdep.c: Revert. * fbsd-nat.h: Revert. * fbsd-nat.c: Revert. * f-valprint.c: Revert. * f-typeprint.c: Revert. * f-lang.c: Revert. * extension.h: Revert. * extension.c: Revert. * extension-priv.h: Revert. * expprint.c: Revert. * exec.h: Revert. * exec.c: Revert. * exceptions.c: Revert. * event-top.c: Revert. * event-loop.c: Revert. * eval.c: Revert. * elfread.c: Revert. * dwarf2read.h: Revert. * dwarf2read.c: Revert. * dwarf2loc.c: Revert. * dwarf2expr.h: Revert. * dwarf2expr.c: Revert. * dwarf2-frame.c: Revert. * dwarf2-frame-tailcall.c: Revert. * dwarf-index-write.h: Revert. * dwarf-index-write.c: Revert. * dwarf-index-common.c: Revert. * dwarf-index-cache.h: Revert. * dwarf-index-cache.c: Revert. * dummy-frame.c: Revert. * dtrace-probe.c: Revert. * disasm.h: Revert. * disasm.c: Revert. * disasm-selftests.c: Revert. * dictionary.c: Revert. * dicos-tdep.c: Revert. * demangle.c: Revert. * dcache.h: Revert. * dcache.c: Revert. * darwin-nat.h: Revert. * darwin-nat.c: Revert. * darwin-nat-info.c: Revert. * d-valprint.c: Revert. * d-namespace.c: Revert. * d-lang.c: Revert. * ctf.c: Revert. * csky-tdep.c: Revert. * csky-linux-tdep.c: Revert. * cris-tdep.c: Revert. * cris-linux-tdep.c: Revert. * cp-valprint.c: Revert. * cp-support.c: Revert. * cp-namespace.c: Revert. * cp-abi.c: Revert. * corelow.c: Revert. * corefile.c: Revert. * continuations.c: Revert. * completer.h: Revert. * completer.c: Revert. * complaints.c: Revert. * coffread.c: Revert. * coff-pe-read.c: Revert. * cli-out.h: Revert. * cli-out.c: Revert. * charset.c: Revert. * c-varobj.c: Revert. * c-valprint.c: Revert. * c-typeprint.c: Revert. * c-lang.c: Revert. * buildsym.c: Revert. * buildsym-legacy.c: Revert. * build-id.h: Revert. * build-id.c: Revert. * btrace.c: Revert. * bsd-uthread.c: Revert. * breakpoint.h: Revert. * breakpoint.c: Revert. * break-catch-throw.c: Revert. * break-catch-syscall.c: Revert. * break-catch-sig.c: Revert. * blockframe.c: Revert. * block.c: Revert. * bfin-tdep.c: Revert. * bfin-linux-tdep.c: Revert. * bfd-target.c: Revert. * bcache.c: Revert. * ax-general.c: Revert. * ax-gdb.h: Revert. * ax-gdb.c: Revert. * avr-tdep.c: Revert. * auxv.c: Revert. * auto-load.c: Revert. * arm-wince-tdep.c: Revert. * arm-tdep.c: Revert. * arm-symbian-tdep.c: Revert. * arm-pikeos-tdep.c: Revert. * arm-obsd-tdep.c: Revert. * arm-nbsd-tdep.c: Revert. * arm-nbsd-nat.c: Revert. * arm-linux-tdep.c: Revert. * arm-linux-nat.c: Revert. * arm-fbsd-tdep.c: Revert. * arm-fbsd-nat.c: Revert. * arm-bsd-tdep.c: Revert. * arch-utils.c: Revert. * arc-tdep.c: Revert. * arc-newlib-tdep.c: Revert. * annotate.h: Revert. * annotate.c: Revert. * amd64-windows-tdep.c: Revert. * amd64-windows-nat.c: Revert. * amd64-tdep.c: Revert. * amd64-sol2-tdep.c: Revert. * amd64-obsd-tdep.c: Revert. * amd64-obsd-nat.c: Revert. * amd64-nbsd-tdep.c: Revert. * amd64-nbsd-nat.c: Revert. * amd64-nat.c: Revert. * amd64-linux-tdep.c: Revert. * amd64-linux-nat.c: Revert. * amd64-fbsd-tdep.c: Revert. * amd64-fbsd-nat.c: Revert. * amd64-dicos-tdep.c: Revert. * amd64-darwin-tdep.c: Revert. * amd64-bsd-nat.c: Revert. * alpha-tdep.c: Revert. * alpha-obsd-tdep.c: Revert. * alpha-nbsd-tdep.c: Revert. * alpha-mdebug-tdep.c: Revert. * alpha-linux-tdep.c: Revert. * alpha-linux-nat.c: Revert. * alpha-bsd-tdep.c: Revert. * alpha-bsd-nat.c: Revert. * aix-thread.c: Revert. * agent.c: Revert. * addrmap.c: Revert. * ada-varobj.c: Revert. * ada-valprint.c: Revert. * ada-typeprint.c: Revert. * ada-tasks.c: Revert. * ada-lang.c: Revert. * aarch64-tdep.c: Revert. * aarch64-ravenscar-thread.c: Revert. * aarch64-newlib-tdep.c: Revert. * aarch64-linux-tdep.c: Revert. * aarch64-linux-nat.c: Revert. * aarch64-fbsd-tdep.c: Revert. * aarch64-fbsd-nat.c: Revert. * aarch32-linux-nat.c: Revert.
2019-04-06 21:38:10 +02:00
#include "osabi.h"
#include "symtab.h"
#include "gdbtypes.h"
Sort includes for files gdb/[a-f]*.[chyl]. This patch sorts the include files for the files [a-f]*.[chyl]. The patch was written by a script. Tested by the buildbot. I will follow up with patches to sort the remaining files, by sorting a subset, testing them, and then checking them in. gdb/ChangeLog 2019-04-05 Tom Tromey <tom@tromey.com> * ft32-tdep.c: Sort headers. * frv-tdep.c: Sort headers. * frv-linux-tdep.c: Sort headers. * frame.c: Sort headers. * frame-unwind.c: Sort headers. * frame-base.c: Sort headers. * fork-child.c: Sort headers. * findvar.c: Sort headers. * findcmd.c: Sort headers. * filesystem.c: Sort headers. * filename-seen-cache.h: Sort headers. * filename-seen-cache.c: Sort headers. * fbsd-tdep.c: Sort headers. * fbsd-nat.h: Sort headers. * fbsd-nat.c: Sort headers. * f-valprint.c: Sort headers. * f-typeprint.c: Sort headers. * f-lang.c: Sort headers. * extension.h: Sort headers. * extension.c: Sort headers. * extension-priv.h: Sort headers. * expprint.c: Sort headers. * exec.h: Sort headers. * exec.c: Sort headers. * exceptions.c: Sort headers. * event-top.c: Sort headers. * event-loop.c: Sort headers. * eval.c: Sort headers. * elfread.c: Sort headers. * dwarf2read.h: Sort headers. * dwarf2read.c: Sort headers. * dwarf2loc.c: Sort headers. * dwarf2expr.h: Sort headers. * dwarf2expr.c: Sort headers. * dwarf2-frame.c: Sort headers. * dwarf2-frame-tailcall.c: Sort headers. * dwarf-index-write.h: Sort headers. * dwarf-index-write.c: Sort headers. * dwarf-index-common.c: Sort headers. * dwarf-index-cache.h: Sort headers. * dwarf-index-cache.c: Sort headers. * dummy-frame.c: Sort headers. * dtrace-probe.c: Sort headers. * disasm.h: Sort headers. * disasm.c: Sort headers. * disasm-selftests.c: Sort headers. * dictionary.c: Sort headers. * dicos-tdep.c: Sort headers. * demangle.c: Sort headers. * dcache.h: Sort headers. * dcache.c: Sort headers. * darwin-nat.h: Sort headers. * darwin-nat.c: Sort headers. * darwin-nat-info.c: Sort headers. * d-valprint.c: Sort headers. * d-namespace.c: Sort headers. * d-lang.c: Sort headers. * ctf.c: Sort headers. * csky-tdep.c: Sort headers. * csky-linux-tdep.c: Sort headers. * cris-tdep.c: Sort headers. * cris-linux-tdep.c: Sort headers. * cp-valprint.c: Sort headers. * cp-support.c: Sort headers. * cp-namespace.c: Sort headers. * cp-abi.c: Sort headers. * corelow.c: Sort headers. * corefile.c: Sort headers. * continuations.c: Sort headers. * completer.h: Sort headers. * completer.c: Sort headers. * complaints.c: Sort headers. * coffread.c: Sort headers. * coff-pe-read.c: Sort headers. * cli-out.h: Sort headers. * cli-out.c: Sort headers. * charset.c: Sort headers. * c-varobj.c: Sort headers. * c-valprint.c: Sort headers. * c-typeprint.c: Sort headers. * c-lang.c: Sort headers. * buildsym.c: Sort headers. * buildsym-legacy.c: Sort headers. * build-id.h: Sort headers. * build-id.c: Sort headers. * btrace.c: Sort headers. * bsd-uthread.c: Sort headers. * breakpoint.h: Sort headers. * breakpoint.c: Sort headers. * break-catch-throw.c: Sort headers. * break-catch-syscall.c: Sort headers. * break-catch-sig.c: Sort headers. * blockframe.c: Sort headers. * block.c: Sort headers. * bfin-tdep.c: Sort headers. * bfin-linux-tdep.c: Sort headers. * bfd-target.c: Sort headers. * bcache.c: Sort headers. * ax-general.c: Sort headers. * ax-gdb.h: Sort headers. * ax-gdb.c: Sort headers. * avr-tdep.c: Sort headers. * auxv.c: Sort headers. * auto-load.c: Sort headers. * arm-wince-tdep.c: Sort headers. * arm-tdep.c: Sort headers. * arm-symbian-tdep.c: Sort headers. * arm-pikeos-tdep.c: Sort headers. * arm-obsd-tdep.c: Sort headers. * arm-nbsd-tdep.c: Sort headers. * arm-nbsd-nat.c: Sort headers. * arm-linux-tdep.c: Sort headers. * arm-linux-nat.c: Sort headers. * arm-fbsd-tdep.c: Sort headers. * arm-fbsd-nat.c: Sort headers. * arm-bsd-tdep.c: Sort headers. * arch-utils.c: Sort headers. * arc-tdep.c: Sort headers. * arc-newlib-tdep.c: Sort headers. * annotate.h: Sort headers. * annotate.c: Sort headers. * amd64-windows-tdep.c: Sort headers. * amd64-windows-nat.c: Sort headers. * amd64-tdep.c: Sort headers. * amd64-sol2-tdep.c: Sort headers. * amd64-obsd-tdep.c: Sort headers. * amd64-obsd-nat.c: Sort headers. * amd64-nbsd-tdep.c: Sort headers. * amd64-nbsd-nat.c: Sort headers. * amd64-nat.c: Sort headers. * amd64-linux-tdep.c: Sort headers. * amd64-linux-nat.c: Sort headers. * amd64-fbsd-tdep.c: Sort headers. * amd64-fbsd-nat.c: Sort headers. * amd64-dicos-tdep.c: Sort headers. * amd64-darwin-tdep.c: Sort headers. * amd64-bsd-nat.c: Sort headers. * alpha-tdep.c: Sort headers. * alpha-obsd-tdep.c: Sort headers. * alpha-nbsd-tdep.c: Sort headers. * alpha-mdebug-tdep.c: Sort headers. * alpha-linux-tdep.c: Sort headers. * alpha-linux-nat.c: Sort headers. * alpha-bsd-tdep.c: Sort headers. * alpha-bsd-nat.c: Sort headers. * aix-thread.c: Sort headers. * agent.c: Sort headers. * addrmap.c: Sort headers. * ada-varobj.c: Sort headers. * ada-valprint.c: Sort headers. * ada-typeprint.c: Sort headers. * ada-tasks.c: Sort headers. * ada-lang.c: Sort headers. * aarch64-tdep.c: Sort headers. * aarch64-ravenscar-thread.c: Sort headers. * aarch64-newlib-tdep.c: Sort headers. * aarch64-linux-tdep.c: Sort headers. * aarch64-linux-nat.c: Sort headers. * aarch64-fbsd-tdep.c: Sort headers. * aarch64-fbsd-nat.c: Sort headers. * aarch32-linux-nat.c: Sort headers.
2019-04-03 04:04:24 +02:00
#include "reggroups.h"
#include "regset.h"
Revert the header-sorting patch Andreas Schwab and John Baldwin pointed out some bugs in the header sorting patch; and I noticed that the output was not correct when limited to a subset of files (a bug in my script). So, I'm reverting the patch. I may try again after fixing the issues pointed out. gdb/ChangeLog 2019-04-05 Tom Tromey <tom@tromey.com> Revert the header-sorting patch. * ft32-tdep.c: Revert. * frv-tdep.c: Revert. * frv-linux-tdep.c: Revert. * frame.c: Revert. * frame-unwind.c: Revert. * frame-base.c: Revert. * fork-child.c: Revert. * findvar.c: Revert. * findcmd.c: Revert. * filesystem.c: Revert. * filename-seen-cache.h: Revert. * filename-seen-cache.c: Revert. * fbsd-tdep.c: Revert. * fbsd-nat.h: Revert. * fbsd-nat.c: Revert. * f-valprint.c: Revert. * f-typeprint.c: Revert. * f-lang.c: Revert. * extension.h: Revert. * extension.c: Revert. * extension-priv.h: Revert. * expprint.c: Revert. * exec.h: Revert. * exec.c: Revert. * exceptions.c: Revert. * event-top.c: Revert. * event-loop.c: Revert. * eval.c: Revert. * elfread.c: Revert. * dwarf2read.h: Revert. * dwarf2read.c: Revert. * dwarf2loc.c: Revert. * dwarf2expr.h: Revert. * dwarf2expr.c: Revert. * dwarf2-frame.c: Revert. * dwarf2-frame-tailcall.c: Revert. * dwarf-index-write.h: Revert. * dwarf-index-write.c: Revert. * dwarf-index-common.c: Revert. * dwarf-index-cache.h: Revert. * dwarf-index-cache.c: Revert. * dummy-frame.c: Revert. * dtrace-probe.c: Revert. * disasm.h: Revert. * disasm.c: Revert. * disasm-selftests.c: Revert. * dictionary.c: Revert. * dicos-tdep.c: Revert. * demangle.c: Revert. * dcache.h: Revert. * dcache.c: Revert. * darwin-nat.h: Revert. * darwin-nat.c: Revert. * darwin-nat-info.c: Revert. * d-valprint.c: Revert. * d-namespace.c: Revert. * d-lang.c: Revert. * ctf.c: Revert. * csky-tdep.c: Revert. * csky-linux-tdep.c: Revert. * cris-tdep.c: Revert. * cris-linux-tdep.c: Revert. * cp-valprint.c: Revert. * cp-support.c: Revert. * cp-namespace.c: Revert. * cp-abi.c: Revert. * corelow.c: Revert. * corefile.c: Revert. * continuations.c: Revert. * completer.h: Revert. * completer.c: Revert. * complaints.c: Revert. * coffread.c: Revert. * coff-pe-read.c: Revert. * cli-out.h: Revert. * cli-out.c: Revert. * charset.c: Revert. * c-varobj.c: Revert. * c-valprint.c: Revert. * c-typeprint.c: Revert. * c-lang.c: Revert. * buildsym.c: Revert. * buildsym-legacy.c: Revert. * build-id.h: Revert. * build-id.c: Revert. * btrace.c: Revert. * bsd-uthread.c: Revert. * breakpoint.h: Revert. * breakpoint.c: Revert. * break-catch-throw.c: Revert. * break-catch-syscall.c: Revert. * break-catch-sig.c: Revert. * blockframe.c: Revert. * block.c: Revert. * bfin-tdep.c: Revert. * bfin-linux-tdep.c: Revert. * bfd-target.c: Revert. * bcache.c: Revert. * ax-general.c: Revert. * ax-gdb.h: Revert. * ax-gdb.c: Revert. * avr-tdep.c: Revert. * auxv.c: Revert. * auto-load.c: Revert. * arm-wince-tdep.c: Revert. * arm-tdep.c: Revert. * arm-symbian-tdep.c: Revert. * arm-pikeos-tdep.c: Revert. * arm-obsd-tdep.c: Revert. * arm-nbsd-tdep.c: Revert. * arm-nbsd-nat.c: Revert. * arm-linux-tdep.c: Revert. * arm-linux-nat.c: Revert. * arm-fbsd-tdep.c: Revert. * arm-fbsd-nat.c: Revert. * arm-bsd-tdep.c: Revert. * arch-utils.c: Revert. * arc-tdep.c: Revert. * arc-newlib-tdep.c: Revert. * annotate.h: Revert. * annotate.c: Revert. * amd64-windows-tdep.c: Revert. * amd64-windows-nat.c: Revert. * amd64-tdep.c: Revert. * amd64-sol2-tdep.c: Revert. * amd64-obsd-tdep.c: Revert. * amd64-obsd-nat.c: Revert. * amd64-nbsd-tdep.c: Revert. * amd64-nbsd-nat.c: Revert. * amd64-nat.c: Revert. * amd64-linux-tdep.c: Revert. * amd64-linux-nat.c: Revert. * amd64-fbsd-tdep.c: Revert. * amd64-fbsd-nat.c: Revert. * amd64-dicos-tdep.c: Revert. * amd64-darwin-tdep.c: Revert. * amd64-bsd-nat.c: Revert. * alpha-tdep.c: Revert. * alpha-obsd-tdep.c: Revert. * alpha-nbsd-tdep.c: Revert. * alpha-mdebug-tdep.c: Revert. * alpha-linux-tdep.c: Revert. * alpha-linux-nat.c: Revert. * alpha-bsd-tdep.c: Revert. * alpha-bsd-nat.c: Revert. * aix-thread.c: Revert. * agent.c: Revert. * addrmap.c: Revert. * ada-varobj.c: Revert. * ada-valprint.c: Revert. * ada-typeprint.c: Revert. * ada-tasks.c: Revert. * ada-lang.c: Revert. * aarch64-tdep.c: Revert. * aarch64-ravenscar-thread.c: Revert. * aarch64-newlib-tdep.c: Revert. * aarch64-linux-tdep.c: Revert. * aarch64-linux-nat.c: Revert. * aarch64-fbsd-tdep.c: Revert. * aarch64-fbsd-nat.c: Revert. * aarch32-linux-nat.c: Revert.
2019-04-06 21:38:10 +02:00
#include "parser-defs.h"
Sort includes for files gdb/[a-f]*.[chyl]. This patch sorts the include files for the files [a-f]*.[chyl]. The patch was written by a script. Tested by the buildbot. I will follow up with patches to sort the remaining files, by sorting a subset, testing them, and then checking them in. gdb/ChangeLog 2019-04-05 Tom Tromey <tom@tromey.com> * ft32-tdep.c: Sort headers. * frv-tdep.c: Sort headers. * frv-linux-tdep.c: Sort headers. * frame.c: Sort headers. * frame-unwind.c: Sort headers. * frame-base.c: Sort headers. * fork-child.c: Sort headers. * findvar.c: Sort headers. * findcmd.c: Sort headers. * filesystem.c: Sort headers. * filename-seen-cache.h: Sort headers. * filename-seen-cache.c: Sort headers. * fbsd-tdep.c: Sort headers. * fbsd-nat.h: Sort headers. * fbsd-nat.c: Sort headers. * f-valprint.c: Sort headers. * f-typeprint.c: Sort headers. * f-lang.c: Sort headers. * extension.h: Sort headers. * extension.c: Sort headers. * extension-priv.h: Sort headers. * expprint.c: Sort headers. * exec.h: Sort headers. * exec.c: Sort headers. * exceptions.c: Sort headers. * event-top.c: Sort headers. * event-loop.c: Sort headers. * eval.c: Sort headers. * elfread.c: Sort headers. * dwarf2read.h: Sort headers. * dwarf2read.c: Sort headers. * dwarf2loc.c: Sort headers. * dwarf2expr.h: Sort headers. * dwarf2expr.c: Sort headers. * dwarf2-frame.c: Sort headers. * dwarf2-frame-tailcall.c: Sort headers. * dwarf-index-write.h: Sort headers. * dwarf-index-write.c: Sort headers. * dwarf-index-common.c: Sort headers. * dwarf-index-cache.h: Sort headers. * dwarf-index-cache.c: Sort headers. * dummy-frame.c: Sort headers. * dtrace-probe.c: Sort headers. * disasm.h: Sort headers. * disasm.c: Sort headers. * disasm-selftests.c: Sort headers. * dictionary.c: Sort headers. * dicos-tdep.c: Sort headers. * demangle.c: Sort headers. * dcache.h: Sort headers. * dcache.c: Sort headers. * darwin-nat.h: Sort headers. * darwin-nat.c: Sort headers. * darwin-nat-info.c: Sort headers. * d-valprint.c: Sort headers. * d-namespace.c: Sort headers. * d-lang.c: Sort headers. * ctf.c: Sort headers. * csky-tdep.c: Sort headers. * csky-linux-tdep.c: Sort headers. * cris-tdep.c: Sort headers. * cris-linux-tdep.c: Sort headers. * cp-valprint.c: Sort headers. * cp-support.c: Sort headers. * cp-namespace.c: Sort headers. * cp-abi.c: Sort headers. * corelow.c: Sort headers. * corefile.c: Sort headers. * continuations.c: Sort headers. * completer.h: Sort headers. * completer.c: Sort headers. * complaints.c: Sort headers. * coffread.c: Sort headers. * coff-pe-read.c: Sort headers. * cli-out.h: Sort headers. * cli-out.c: Sort headers. * charset.c: Sort headers. * c-varobj.c: Sort headers. * c-valprint.c: Sort headers. * c-typeprint.c: Sort headers. * c-lang.c: Sort headers. * buildsym.c: Sort headers. * buildsym-legacy.c: Sort headers. * build-id.h: Sort headers. * build-id.c: Sort headers. * btrace.c: Sort headers. * bsd-uthread.c: Sort headers. * breakpoint.h: Sort headers. * breakpoint.c: Sort headers. * break-catch-throw.c: Sort headers. * break-catch-syscall.c: Sort headers. * break-catch-sig.c: Sort headers. * blockframe.c: Sort headers. * block.c: Sort headers. * bfin-tdep.c: Sort headers. * bfin-linux-tdep.c: Sort headers. * bfd-target.c: Sort headers. * bcache.c: Sort headers. * ax-general.c: Sort headers. * ax-gdb.h: Sort headers. * ax-gdb.c: Sort headers. * avr-tdep.c: Sort headers. * auxv.c: Sort headers. * auto-load.c: Sort headers. * arm-wince-tdep.c: Sort headers. * arm-tdep.c: Sort headers. * arm-symbian-tdep.c: Sort headers. * arm-pikeos-tdep.c: Sort headers. * arm-obsd-tdep.c: Sort headers. * arm-nbsd-tdep.c: Sort headers. * arm-nbsd-nat.c: Sort headers. * arm-linux-tdep.c: Sort headers. * arm-linux-nat.c: Sort headers. * arm-fbsd-tdep.c: Sort headers. * arm-fbsd-nat.c: Sort headers. * arm-bsd-tdep.c: Sort headers. * arch-utils.c: Sort headers. * arc-tdep.c: Sort headers. * arc-newlib-tdep.c: Sort headers. * annotate.h: Sort headers. * annotate.c: Sort headers. * amd64-windows-tdep.c: Sort headers. * amd64-windows-nat.c: Sort headers. * amd64-tdep.c: Sort headers. * amd64-sol2-tdep.c: Sort headers. * amd64-obsd-tdep.c: Sort headers. * amd64-obsd-nat.c: Sort headers. * amd64-nbsd-tdep.c: Sort headers. * amd64-nbsd-nat.c: Sort headers. * amd64-nat.c: Sort headers. * amd64-linux-tdep.c: Sort headers. * amd64-linux-nat.c: Sort headers. * amd64-fbsd-tdep.c: Sort headers. * amd64-fbsd-nat.c: Sort headers. * amd64-dicos-tdep.c: Sort headers. * amd64-darwin-tdep.c: Sort headers. * amd64-bsd-nat.c: Sort headers. * alpha-tdep.c: Sort headers. * alpha-obsd-tdep.c: Sort headers. * alpha-nbsd-tdep.c: Sort headers. * alpha-mdebug-tdep.c: Sort headers. * alpha-linux-tdep.c: Sort headers. * alpha-linux-nat.c: Sort headers. * alpha-bsd-tdep.c: Sort headers. * alpha-bsd-nat.c: Sort headers. * aix-thread.c: Sort headers. * agent.c: Sort headers. * addrmap.c: Sort headers. * ada-varobj.c: Sort headers. * ada-valprint.c: Sort headers. * ada-typeprint.c: Sort headers. * ada-tasks.c: Sort headers. * ada-lang.c: Sort headers. * aarch64-tdep.c: Sort headers. * aarch64-ravenscar-thread.c: Sort headers. * aarch64-newlib-tdep.c: Sort headers. * aarch64-linux-tdep.c: Sort headers. * aarch64-linux-nat.c: Sort headers. * aarch64-fbsd-tdep.c: Sort headers. * aarch64-fbsd-nat.c: Sort headers. * aarch32-linux-nat.c: Sort headers.
2019-04-03 04:04:24 +02:00
#include "user-regs.h"
Revert the header-sorting patch Andreas Schwab and John Baldwin pointed out some bugs in the header sorting patch; and I noticed that the output was not correct when limited to a subset of files (a bug in my script). So, I'm reverting the patch. I may try again after fixing the issues pointed out. gdb/ChangeLog 2019-04-05 Tom Tromey <tom@tromey.com> Revert the header-sorting patch. * ft32-tdep.c: Revert. * frv-tdep.c: Revert. * frv-linux-tdep.c: Revert. * frame.c: Revert. * frame-unwind.c: Revert. * frame-base.c: Revert. * fork-child.c: Revert. * findvar.c: Revert. * findcmd.c: Revert. * filesystem.c: Revert. * filename-seen-cache.h: Revert. * filename-seen-cache.c: Revert. * fbsd-tdep.c: Revert. * fbsd-nat.h: Revert. * fbsd-nat.c: Revert. * f-valprint.c: Revert. * f-typeprint.c: Revert. * f-lang.c: Revert. * extension.h: Revert. * extension.c: Revert. * extension-priv.h: Revert. * expprint.c: Revert. * exec.h: Revert. * exec.c: Revert. * exceptions.c: Revert. * event-top.c: Revert. * event-loop.c: Revert. * eval.c: Revert. * elfread.c: Revert. * dwarf2read.h: Revert. * dwarf2read.c: Revert. * dwarf2loc.c: Revert. * dwarf2expr.h: Revert. * dwarf2expr.c: Revert. * dwarf2-frame.c: Revert. * dwarf2-frame-tailcall.c: Revert. * dwarf-index-write.h: Revert. * dwarf-index-write.c: Revert. * dwarf-index-common.c: Revert. * dwarf-index-cache.h: Revert. * dwarf-index-cache.c: Revert. * dummy-frame.c: Revert. * dtrace-probe.c: Revert. * disasm.h: Revert. * disasm.c: Revert. * disasm-selftests.c: Revert. * dictionary.c: Revert. * dicos-tdep.c: Revert. * demangle.c: Revert. * dcache.h: Revert. * dcache.c: Revert. * darwin-nat.h: Revert. * darwin-nat.c: Revert. * darwin-nat-info.c: Revert. * d-valprint.c: Revert. * d-namespace.c: Revert. * d-lang.c: Revert. * ctf.c: Revert. * csky-tdep.c: Revert. * csky-linux-tdep.c: Revert. * cris-tdep.c: Revert. * cris-linux-tdep.c: Revert. * cp-valprint.c: Revert. * cp-support.c: Revert. * cp-namespace.c: Revert. * cp-abi.c: Revert. * corelow.c: Revert. * corefile.c: Revert. * continuations.c: Revert. * completer.h: Revert. * completer.c: Revert. * complaints.c: Revert. * coffread.c: Revert. * coff-pe-read.c: Revert. * cli-out.h: Revert. * cli-out.c: Revert. * charset.c: Revert. * c-varobj.c: Revert. * c-valprint.c: Revert. * c-typeprint.c: Revert. * c-lang.c: Revert. * buildsym.c: Revert. * buildsym-legacy.c: Revert. * build-id.h: Revert. * build-id.c: Revert. * btrace.c: Revert. * bsd-uthread.c: Revert. * breakpoint.h: Revert. * breakpoint.c: Revert. * break-catch-throw.c: Revert. * break-catch-syscall.c: Revert. * break-catch-sig.c: Revert. * blockframe.c: Revert. * block.c: Revert. * bfin-tdep.c: Revert. * bfin-linux-tdep.c: Revert. * bfd-target.c: Revert. * bcache.c: Revert. * ax-general.c: Revert. * ax-gdb.h: Revert. * ax-gdb.c: Revert. * avr-tdep.c: Revert. * auxv.c: Revert. * auto-load.c: Revert. * arm-wince-tdep.c: Revert. * arm-tdep.c: Revert. * arm-symbian-tdep.c: Revert. * arm-pikeos-tdep.c: Revert. * arm-obsd-tdep.c: Revert. * arm-nbsd-tdep.c: Revert. * arm-nbsd-nat.c: Revert. * arm-linux-tdep.c: Revert. * arm-linux-nat.c: Revert. * arm-fbsd-tdep.c: Revert. * arm-fbsd-nat.c: Revert. * arm-bsd-tdep.c: Revert. * arch-utils.c: Revert. * arc-tdep.c: Revert. * arc-newlib-tdep.c: Revert. * annotate.h: Revert. * annotate.c: Revert. * amd64-windows-tdep.c: Revert. * amd64-windows-nat.c: Revert. * amd64-tdep.c: Revert. * amd64-sol2-tdep.c: Revert. * amd64-obsd-tdep.c: Revert. * amd64-obsd-nat.c: Revert. * amd64-nbsd-tdep.c: Revert. * amd64-nbsd-nat.c: Revert. * amd64-nat.c: Revert. * amd64-linux-tdep.c: Revert. * amd64-linux-nat.c: Revert. * amd64-fbsd-tdep.c: Revert. * amd64-fbsd-nat.c: Revert. * amd64-dicos-tdep.c: Revert. * amd64-darwin-tdep.c: Revert. * amd64-bsd-nat.c: Revert. * alpha-tdep.c: Revert. * alpha-obsd-tdep.c: Revert. * alpha-nbsd-tdep.c: Revert. * alpha-mdebug-tdep.c: Revert. * alpha-linux-tdep.c: Revert. * alpha-linux-nat.c: Revert. * alpha-bsd-tdep.c: Revert. * alpha-bsd-nat.c: Revert. * aix-thread.c: Revert. * agent.c: Revert. * addrmap.c: Revert. * ada-varobj.c: Revert. * ada-valprint.c: Revert. * ada-typeprint.c: Revert. * ada-tasks.c: Revert. * ada-lang.c: Revert. * aarch64-tdep.c: Revert. * aarch64-ravenscar-thread.c: Revert. * aarch64-newlib-tdep.c: Revert. * aarch64-linux-tdep.c: Revert. * aarch64-linux-nat.c: Revert. * aarch64-fbsd-tdep.c: Revert. * aarch64-fbsd-nat.c: Revert. * aarch32-linux-nat.c: Revert.
2019-04-06 21:38:10 +02:00
#include "amd64-linux-tdep.h"
#include "i386-linux-tdep.h"
#include "linux-tdep.h"
Rename common to gdbsupport This is the next patch in the ongoing series to move gdbsever to the top level. This patch just renames the "common" directory. The idea is to do this move in two parts: first rename the directory (this patch), then move the directory to the top. This approach makes the patches a bit more tractable. I chose the name "gdbsupport" for the directory. However, as this patch was largely written by sed, we could pick a new name without too much difficulty. Tested by the buildbot. gdb/ChangeLog 2019-07-09 Tom Tromey <tom@tromey.com> * contrib/ari/gdb_ari.sh: Change common to gdbsupport. * configure: Rebuild. * configure.ac: Change common to gdbsupport. * gdbsupport: Rename from common. * acinclude.m4: Change common to gdbsupport. * Makefile.in (CONFIG_SRC_SUBDIR, COMMON_SFILES) (HFILES_NO_SRCDIR, stamp-version, ALLDEPFILES): Change common to gdbsupport. * aarch64-tdep.c, ada-lang.c, ada-lang.h, agent.c, alloc.c, amd64-darwin-tdep.c, amd64-dicos-tdep.c, amd64-fbsd-nat.c, amd64-fbsd-tdep.c, amd64-linux-nat.c, amd64-linux-tdep.c, amd64-nbsd-tdep.c, amd64-obsd-tdep.c, amd64-sol2-tdep.c, amd64-tdep.c, amd64-windows-tdep.c, arch-utils.c, arch/aarch64-insn.c, arch/aarch64.c, arch/aarch64.h, arch/amd64.c, arch/amd64.h, arch/arm-get-next-pcs.c, arch/arm-linux.c, arch/arm.c, arch/i386.c, arch/i386.h, arch/ppc-linux-common.c, arch/riscv.c, arch/riscv.h, arch/tic6x.c, arm-tdep.c, auto-load.c, auxv.c, ax-gdb.c, ax-general.c, ax.h, breakpoint.c, breakpoint.h, btrace.c, btrace.h, build-id.c, build-id.h, c-lang.h, charset.c, charset.h, cli/cli-cmds.c, cli/cli-cmds.h, cli/cli-decode.c, cli/cli-dump.c, cli/cli-option.h, cli/cli-script.c, coff-pe-read.c, command.h, compile/compile-c-support.c, compile/compile-c.h, compile/compile-cplus-symbols.c, compile/compile-cplus-types.c, compile/compile-cplus.h, compile/compile-loc2c.c, compile/compile.c, completer.c, completer.h, contrib/ari/gdb_ari.sh, corefile.c, corelow.c, cp-support.c, cp-support.h, cp-valprint.c, csky-tdep.c, ctf.c, darwin-nat.c, debug.c, defs.h, disasm-selftests.c, disasm.c, disasm.h, dtrace-probe.c, dwarf-index-cache.c, dwarf-index-cache.h, dwarf-index-write.c, dwarf2-frame.c, dwarf2expr.c, dwarf2loc.c, dwarf2read.c, event-loop.c, event-top.c, exceptions.c, exec.c, extension.h, fbsd-nat.c, features/aarch64-core.c, features/aarch64-fpu.c, features/aarch64-pauth.c, features/aarch64-sve.c, features/i386/32bit-avx.c, features/i386/32bit-avx512.c, features/i386/32bit-core.c, features/i386/32bit-linux.c, features/i386/32bit-mpx.c, features/i386/32bit-pkeys.c, features/i386/32bit-segments.c, features/i386/32bit-sse.c, features/i386/64bit-avx.c, features/i386/64bit-avx512.c, features/i386/64bit-core.c, features/i386/64bit-linux.c, features/i386/64bit-mpx.c, features/i386/64bit-pkeys.c, features/i386/64bit-segments.c, features/i386/64bit-sse.c, features/i386/x32-core.c, features/riscv/32bit-cpu.c, features/riscv/32bit-csr.c, features/riscv/32bit-fpu.c, features/riscv/64bit-cpu.c, features/riscv/64bit-csr.c, features/riscv/64bit-fpu.c, features/tic6x-c6xp.c, features/tic6x-core.c, features/tic6x-gp.c, filename-seen-cache.h, findcmd.c, findvar.c, fork-child.c, gcore.c, gdb_bfd.c, gdb_bfd.h, gdb_proc_service.h, gdb_regex.c, gdb_select.h, gdb_usleep.c, gdbarch-selftests.c, gdbthread.h, gdbtypes.h, gnu-nat.c, go32-nat.c, guile/guile.c, guile/scm-ports.c, guile/scm-safe-call.c, guile/scm-type.c, i386-fbsd-nat.c, i386-fbsd-tdep.c, i386-go32-tdep.c, i386-linux-nat.c, i386-linux-tdep.c, i386-tdep.c, i387-tdep.c, ia64-libunwind-tdep.c, ia64-linux-nat.c, inf-child.c, inf-ptrace.c, infcall.c, infcall.h, infcmd.c, inferior-iter.h, inferior.c, inferior.h, inflow.c, inflow.h, infrun.c, infrun.h, inline-frame.c, language.h, linespec.c, linux-fork.c, linux-nat.c, linux-tdep.c, linux-thread-db.c, location.c, machoread.c, macrotab.h, main.c, maint.c, maint.h, memattr.c, memrange.h, mi/mi-cmd-break.h, mi/mi-cmd-env.c, mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-interp.c, mi/mi-main.c, mi/mi-parse.h, minsyms.c, mips-linux-tdep.c, namespace.h, nat/aarch64-linux-hw-point.c, nat/aarch64-linux-hw-point.h, nat/aarch64-linux.c, nat/aarch64-sve-linux-ptrace.c, nat/amd64-linux-siginfo.c, nat/fork-inferior.c, nat/linux-btrace.c, nat/linux-btrace.h, nat/linux-namespaces.c, nat/linux-nat.h, nat/linux-osdata.c, nat/linux-personality.c, nat/linux-procfs.c, nat/linux-ptrace.c, nat/linux-ptrace.h, nat/linux-waitpid.c, nat/mips-linux-watch.c, nat/mips-linux-watch.h, nat/ppc-linux.c, nat/x86-dregs.c, nat/x86-dregs.h, nat/x86-linux-dregs.c, nat/x86-linux.c, nto-procfs.c, nto-tdep.c, objfile-flags.h, objfiles.c, objfiles.h, obsd-nat.c, observable.h, osdata.c, p-valprint.c, parse.c, parser-defs.h, ppc-linux-nat.c, printcmd.c, probe.c, proc-api.c, procfs.c, producer.c, progspace.h, psymtab.h, python/py-framefilter.c, python/py-inferior.c, python/py-ref.h, python/py-type.c, python/python.c, record-btrace.c, record-full.c, record.c, record.h, regcache-dump.c, regcache.c, regcache.h, remote-fileio.c, remote-fileio.h, remote-sim.c, remote.c, riscv-tdep.c, rs6000-aix-tdep.c, rust-exp.y, s12z-tdep.c, selftest-arch.c, ser-base.c, ser-event.c, ser-pipe.c, ser-tcp.c, ser-unix.c, skip.c, solib-aix.c, solib-target.c, solib.c, source-cache.c, source.c, source.h, sparc-nat.c, spu-linux-nat.c, stack.c, stap-probe.c, symfile-add-flags.h, symfile.c, symfile.h, symtab.c, symtab.h, target-descriptions.c, target-descriptions.h, target-memory.c, target.c, target.h, target/waitstatus.c, target/waitstatus.h, thread-iter.h, thread.c, tilegx-tdep.c, top.c, top.h, tracefile-tfile.c, tracefile.c, tracepoint.c, tracepoint.h, tui/tui-io.c, ui-file.c, ui-out.h, unittests/array-view-selftests.c, unittests/child-path-selftests.c, unittests/cli-utils-selftests.c, unittests/common-utils-selftests.c, unittests/copy_bitwise-selftests.c, unittests/environ-selftests.c, unittests/format_pieces-selftests.c, unittests/function-view-selftests.c, unittests/lookup_name_info-selftests.c, unittests/memory-map-selftests.c, unittests/memrange-selftests.c, unittests/mkdir-recursive-selftests.c, unittests/observable-selftests.c, unittests/offset-type-selftests.c, unittests/optional-selftests.c, unittests/parse-connection-spec-selftests.c, unittests/ptid-selftests.c, unittests/rsp-low-selftests.c, unittests/scoped_fd-selftests.c, unittests/scoped_mmap-selftests.c, unittests/scoped_restore-selftests.c, unittests/string_view-selftests.c, unittests/style-selftests.c, unittests/tracepoint-selftests.c, unittests/unpack-selftests.c, unittests/utils-selftests.c, unittests/xml-utils-selftests.c, utils.c, utils.h, valarith.c, valops.c, valprint.c, value.c, value.h, varobj.c, varobj.h, windows-nat.c, x86-linux-nat.c, xml-support.c, xml-support.h, xml-tdesc.h, xstormy16-tdep.c, xtensa-linux-nat.c, dwarf2read.h: Change common to gdbsupport. gdb/gdbserver/ChangeLog 2019-07-09 Tom Tromey <tom@tromey.com> * configure: Rebuild. * configure.ac: Change common to gdbsupport. * acinclude.m4: Change common to gdbsupport. * Makefile.in (SFILES, OBS, GDBREPLAY_OBS, IPA_OBJS) (version-generated.c, gdbsupport/%-ipa.o, gdbsupport/%.o): Change common to gdbsupport. * ax.c, event-loop.c, fork-child.c, gdb_proc_service.h, gdbreplay.c, gdbthread.h, hostio-errno.c, hostio.c, i387-fp.c, inferiors.c, inferiors.h, linux-aarch64-tdesc-selftest.c, linux-amd64-ipa.c, linux-i386-ipa.c, linux-low.c, linux-tic6x-low.c, linux-x86-low.c, linux-x86-tdesc-selftest.c, linux-x86-tdesc.c, lynx-i386-low.c, lynx-low.c, mem-break.h, nto-x86-low.c, regcache.c, regcache.h, remote-utils.c, server.c, server.h, spu-low.c, symbol.c, target.h, tdesc.c, tdesc.h, thread-db.c, tracepoint.c, win32-i386-low.c, win32-low.c: Change common to gdbsupport.
2019-05-06 04:29:24 +02:00
#include "gdbsupport/x86-xstate.h"
Revert the header-sorting patch Andreas Schwab and John Baldwin pointed out some bugs in the header sorting patch; and I noticed that the output was not correct when limited to a subset of files (a bug in my script). So, I'm reverting the patch. I may try again after fixing the issues pointed out. gdb/ChangeLog 2019-04-05 Tom Tromey <tom@tromey.com> Revert the header-sorting patch. * ft32-tdep.c: Revert. * frv-tdep.c: Revert. * frv-linux-tdep.c: Revert. * frame.c: Revert. * frame-unwind.c: Revert. * frame-base.c: Revert. * fork-child.c: Revert. * findvar.c: Revert. * findcmd.c: Revert. * filesystem.c: Revert. * filename-seen-cache.h: Revert. * filename-seen-cache.c: Revert. * fbsd-tdep.c: Revert. * fbsd-nat.h: Revert. * fbsd-nat.c: Revert. * f-valprint.c: Revert. * f-typeprint.c: Revert. * f-lang.c: Revert. * extension.h: Revert. * extension.c: Revert. * extension-priv.h: Revert. * expprint.c: Revert. * exec.h: Revert. * exec.c: Revert. * exceptions.c: Revert. * event-top.c: Revert. * event-loop.c: Revert. * eval.c: Revert. * elfread.c: Revert. * dwarf2read.h: Revert. * dwarf2read.c: Revert. * dwarf2loc.c: Revert. * dwarf2expr.h: Revert. * dwarf2expr.c: Revert. * dwarf2-frame.c: Revert. * dwarf2-frame-tailcall.c: Revert. * dwarf-index-write.h: Revert. * dwarf-index-write.c: Revert. * dwarf-index-common.c: Revert. * dwarf-index-cache.h: Revert. * dwarf-index-cache.c: Revert. * dummy-frame.c: Revert. * dtrace-probe.c: Revert. * disasm.h: Revert. * disasm.c: Revert. * disasm-selftests.c: Revert. * dictionary.c: Revert. * dicos-tdep.c: Revert. * demangle.c: Revert. * dcache.h: Revert. * dcache.c: Revert. * darwin-nat.h: Revert. * darwin-nat.c: Revert. * darwin-nat-info.c: Revert. * d-valprint.c: Revert. * d-namespace.c: Revert. * d-lang.c: Revert. * ctf.c: Revert. * csky-tdep.c: Revert. * csky-linux-tdep.c: Revert. * cris-tdep.c: Revert. * cris-linux-tdep.c: Revert. * cp-valprint.c: Revert. * cp-support.c: Revert. * cp-namespace.c: Revert. * cp-abi.c: Revert. * corelow.c: Revert. * corefile.c: Revert. * continuations.c: Revert. * completer.h: Revert. * completer.c: Revert. * complaints.c: Revert. * coffread.c: Revert. * coff-pe-read.c: Revert. * cli-out.h: Revert. * cli-out.c: Revert. * charset.c: Revert. * c-varobj.c: Revert. * c-valprint.c: Revert. * c-typeprint.c: Revert. * c-lang.c: Revert. * buildsym.c: Revert. * buildsym-legacy.c: Revert. * build-id.h: Revert. * build-id.c: Revert. * btrace.c: Revert. * bsd-uthread.c: Revert. * breakpoint.h: Revert. * breakpoint.c: Revert. * break-catch-throw.c: Revert. * break-catch-syscall.c: Revert. * break-catch-sig.c: Revert. * blockframe.c: Revert. * block.c: Revert. * bfin-tdep.c: Revert. * bfin-linux-tdep.c: Revert. * bfd-target.c: Revert. * bcache.c: Revert. * ax-general.c: Revert. * ax-gdb.h: Revert. * ax-gdb.c: Revert. * avr-tdep.c: Revert. * auxv.c: Revert. * auto-load.c: Revert. * arm-wince-tdep.c: Revert. * arm-tdep.c: Revert. * arm-symbian-tdep.c: Revert. * arm-pikeos-tdep.c: Revert. * arm-obsd-tdep.c: Revert. * arm-nbsd-tdep.c: Revert. * arm-nbsd-nat.c: Revert. * arm-linux-tdep.c: Revert. * arm-linux-nat.c: Revert. * arm-fbsd-tdep.c: Revert. * arm-fbsd-nat.c: Revert. * arm-bsd-tdep.c: Revert. * arch-utils.c: Revert. * arc-tdep.c: Revert. * arc-newlib-tdep.c: Revert. * annotate.h: Revert. * annotate.c: Revert. * amd64-windows-tdep.c: Revert. * amd64-windows-nat.c: Revert. * amd64-tdep.c: Revert. * amd64-sol2-tdep.c: Revert. * amd64-obsd-tdep.c: Revert. * amd64-obsd-nat.c: Revert. * amd64-nbsd-tdep.c: Revert. * amd64-nbsd-nat.c: Revert. * amd64-nat.c: Revert. * amd64-linux-tdep.c: Revert. * amd64-linux-nat.c: Revert. * amd64-fbsd-tdep.c: Revert. * amd64-fbsd-nat.c: Revert. * amd64-dicos-tdep.c: Revert. * amd64-darwin-tdep.c: Revert. * amd64-bsd-nat.c: Revert. * alpha-tdep.c: Revert. * alpha-obsd-tdep.c: Revert. * alpha-nbsd-tdep.c: Revert. * alpha-mdebug-tdep.c: Revert. * alpha-linux-tdep.c: Revert. * alpha-linux-nat.c: Revert. * alpha-bsd-tdep.c: Revert. * alpha-bsd-nat.c: Revert. * aix-thread.c: Revert. * agent.c: Revert. * addrmap.c: Revert. * ada-varobj.c: Revert. * ada-valprint.c: Revert. * ada-typeprint.c: Revert. * ada-tasks.c: Revert. * ada-lang.c: Revert. * aarch64-tdep.c: Revert. * aarch64-ravenscar-thread.c: Revert. * aarch64-newlib-tdep.c: Revert. * aarch64-linux-tdep.c: Revert. * aarch64-linux-nat.c: Revert. * aarch64-fbsd-tdep.c: Revert. * aarch64-fbsd-nat.c: Revert. * aarch32-linux-nat.c: Revert.
2019-04-06 21:38:10 +02:00
#include "amd64-tdep.h"
#include "solib-svr4.h"
Sort includes for files gdb/[a-f]*.[chyl]. This patch sorts the include files for the files [a-f]*.[chyl]. The patch was written by a script. Tested by the buildbot. I will follow up with patches to sort the remaining files, by sorting a subset, testing them, and then checking them in. gdb/ChangeLog 2019-04-05 Tom Tromey <tom@tromey.com> * ft32-tdep.c: Sort headers. * frv-tdep.c: Sort headers. * frv-linux-tdep.c: Sort headers. * frame.c: Sort headers. * frame-unwind.c: Sort headers. * frame-base.c: Sort headers. * fork-child.c: Sort headers. * findvar.c: Sort headers. * findcmd.c: Sort headers. * filesystem.c: Sort headers. * filename-seen-cache.h: Sort headers. * filename-seen-cache.c: Sort headers. * fbsd-tdep.c: Sort headers. * fbsd-nat.h: Sort headers. * fbsd-nat.c: Sort headers. * f-valprint.c: Sort headers. * f-typeprint.c: Sort headers. * f-lang.c: Sort headers. * extension.h: Sort headers. * extension.c: Sort headers. * extension-priv.h: Sort headers. * expprint.c: Sort headers. * exec.h: Sort headers. * exec.c: Sort headers. * exceptions.c: Sort headers. * event-top.c: Sort headers. * event-loop.c: Sort headers. * eval.c: Sort headers. * elfread.c: Sort headers. * dwarf2read.h: Sort headers. * dwarf2read.c: Sort headers. * dwarf2loc.c: Sort headers. * dwarf2expr.h: Sort headers. * dwarf2expr.c: Sort headers. * dwarf2-frame.c: Sort headers. * dwarf2-frame-tailcall.c: Sort headers. * dwarf-index-write.h: Sort headers. * dwarf-index-write.c: Sort headers. * dwarf-index-common.c: Sort headers. * dwarf-index-cache.h: Sort headers. * dwarf-index-cache.c: Sort headers. * dummy-frame.c: Sort headers. * dtrace-probe.c: Sort headers. * disasm.h: Sort headers. * disasm.c: Sort headers. * disasm-selftests.c: Sort headers. * dictionary.c: Sort headers. * dicos-tdep.c: Sort headers. * demangle.c: Sort headers. * dcache.h: Sort headers. * dcache.c: Sort headers. * darwin-nat.h: Sort headers. * darwin-nat.c: Sort headers. * darwin-nat-info.c: Sort headers. * d-valprint.c: Sort headers. * d-namespace.c: Sort headers. * d-lang.c: Sort headers. * ctf.c: Sort headers. * csky-tdep.c: Sort headers. * csky-linux-tdep.c: Sort headers. * cris-tdep.c: Sort headers. * cris-linux-tdep.c: Sort headers. * cp-valprint.c: Sort headers. * cp-support.c: Sort headers. * cp-namespace.c: Sort headers. * cp-abi.c: Sort headers. * corelow.c: Sort headers. * corefile.c: Sort headers. * continuations.c: Sort headers. * completer.h: Sort headers. * completer.c: Sort headers. * complaints.c: Sort headers. * coffread.c: Sort headers. * coff-pe-read.c: Sort headers. * cli-out.h: Sort headers. * cli-out.c: Sort headers. * charset.c: Sort headers. * c-varobj.c: Sort headers. * c-valprint.c: Sort headers. * c-typeprint.c: Sort headers. * c-lang.c: Sort headers. * buildsym.c: Sort headers. * buildsym-legacy.c: Sort headers. * build-id.h: Sort headers. * build-id.c: Sort headers. * btrace.c: Sort headers. * bsd-uthread.c: Sort headers. * breakpoint.h: Sort headers. * breakpoint.c: Sort headers. * break-catch-throw.c: Sort headers. * break-catch-syscall.c: Sort headers. * break-catch-sig.c: Sort headers. * blockframe.c: Sort headers. * block.c: Sort headers. * bfin-tdep.c: Sort headers. * bfin-linux-tdep.c: Sort headers. * bfd-target.c: Sort headers. * bcache.c: Sort headers. * ax-general.c: Sort headers. * ax-gdb.h: Sort headers. * ax-gdb.c: Sort headers. * avr-tdep.c: Sort headers. * auxv.c: Sort headers. * auto-load.c: Sort headers. * arm-wince-tdep.c: Sort headers. * arm-tdep.c: Sort headers. * arm-symbian-tdep.c: Sort headers. * arm-pikeos-tdep.c: Sort headers. * arm-obsd-tdep.c: Sort headers. * arm-nbsd-tdep.c: Sort headers. * arm-nbsd-nat.c: Sort headers. * arm-linux-tdep.c: Sort headers. * arm-linux-nat.c: Sort headers. * arm-fbsd-tdep.c: Sort headers. * arm-fbsd-nat.c: Sort headers. * arm-bsd-tdep.c: Sort headers. * arch-utils.c: Sort headers. * arc-tdep.c: Sort headers. * arc-newlib-tdep.c: Sort headers. * annotate.h: Sort headers. * annotate.c: Sort headers. * amd64-windows-tdep.c: Sort headers. * amd64-windows-nat.c: Sort headers. * amd64-tdep.c: Sort headers. * amd64-sol2-tdep.c: Sort headers. * amd64-obsd-tdep.c: Sort headers. * amd64-obsd-nat.c: Sort headers. * amd64-nbsd-tdep.c: Sort headers. * amd64-nbsd-nat.c: Sort headers. * amd64-nat.c: Sort headers. * amd64-linux-tdep.c: Sort headers. * amd64-linux-nat.c: Sort headers. * amd64-fbsd-tdep.c: Sort headers. * amd64-fbsd-nat.c: Sort headers. * amd64-dicos-tdep.c: Sort headers. * amd64-darwin-tdep.c: Sort headers. * amd64-bsd-nat.c: Sort headers. * alpha-tdep.c: Sort headers. * alpha-obsd-tdep.c: Sort headers. * alpha-nbsd-tdep.c: Sort headers. * alpha-mdebug-tdep.c: Sort headers. * alpha-linux-tdep.c: Sort headers. * alpha-linux-nat.c: Sort headers. * alpha-bsd-tdep.c: Sort headers. * alpha-bsd-nat.c: Sort headers. * aix-thread.c: Sort headers. * agent.c: Sort headers. * addrmap.c: Sort headers. * ada-varobj.c: Sort headers. * ada-valprint.c: Sort headers. * ada-typeprint.c: Sort headers. * ada-tasks.c: Sort headers. * ada-lang.c: Sort headers. * aarch64-tdep.c: Sort headers. * aarch64-ravenscar-thread.c: Sort headers. * aarch64-newlib-tdep.c: Sort headers. * aarch64-linux-tdep.c: Sort headers. * aarch64-linux-nat.c: Sort headers. * aarch64-fbsd-tdep.c: Sort headers. * aarch64-fbsd-nat.c: Sort headers. * aarch32-linux-nat.c: Sort headers.
2019-04-03 04:04:24 +02:00
#include "xml-syscall.h"
Revert the header-sorting patch Andreas Schwab and John Baldwin pointed out some bugs in the header sorting patch; and I noticed that the output was not correct when limited to a subset of files (a bug in my script). So, I'm reverting the patch. I may try again after fixing the issues pointed out. gdb/ChangeLog 2019-04-05 Tom Tromey <tom@tromey.com> Revert the header-sorting patch. * ft32-tdep.c: Revert. * frv-tdep.c: Revert. * frv-linux-tdep.c: Revert. * frame.c: Revert. * frame-unwind.c: Revert. * frame-base.c: Revert. * fork-child.c: Revert. * findvar.c: Revert. * findcmd.c: Revert. * filesystem.c: Revert. * filename-seen-cache.h: Revert. * filename-seen-cache.c: Revert. * fbsd-tdep.c: Revert. * fbsd-nat.h: Revert. * fbsd-nat.c: Revert. * f-valprint.c: Revert. * f-typeprint.c: Revert. * f-lang.c: Revert. * extension.h: Revert. * extension.c: Revert. * extension-priv.h: Revert. * expprint.c: Revert. * exec.h: Revert. * exec.c: Revert. * exceptions.c: Revert. * event-top.c: Revert. * event-loop.c: Revert. * eval.c: Revert. * elfread.c: Revert. * dwarf2read.h: Revert. * dwarf2read.c: Revert. * dwarf2loc.c: Revert. * dwarf2expr.h: Revert. * dwarf2expr.c: Revert. * dwarf2-frame.c: Revert. * dwarf2-frame-tailcall.c: Revert. * dwarf-index-write.h: Revert. * dwarf-index-write.c: Revert. * dwarf-index-common.c: Revert. * dwarf-index-cache.h: Revert. * dwarf-index-cache.c: Revert. * dummy-frame.c: Revert. * dtrace-probe.c: Revert. * disasm.h: Revert. * disasm.c: Revert. * disasm-selftests.c: Revert. * dictionary.c: Revert. * dicos-tdep.c: Revert. * demangle.c: Revert. * dcache.h: Revert. * dcache.c: Revert. * darwin-nat.h: Revert. * darwin-nat.c: Revert. * darwin-nat-info.c: Revert. * d-valprint.c: Revert. * d-namespace.c: Revert. * d-lang.c: Revert. * ctf.c: Revert. * csky-tdep.c: Revert. * csky-linux-tdep.c: Revert. * cris-tdep.c: Revert. * cris-linux-tdep.c: Revert. * cp-valprint.c: Revert. * cp-support.c: Revert. * cp-namespace.c: Revert. * cp-abi.c: Revert. * corelow.c: Revert. * corefile.c: Revert. * continuations.c: Revert. * completer.h: Revert. * completer.c: Revert. * complaints.c: Revert. * coffread.c: Revert. * coff-pe-read.c: Revert. * cli-out.h: Revert. * cli-out.c: Revert. * charset.c: Revert. * c-varobj.c: Revert. * c-valprint.c: Revert. * c-typeprint.c: Revert. * c-lang.c: Revert. * buildsym.c: Revert. * buildsym-legacy.c: Revert. * build-id.h: Revert. * build-id.c: Revert. * btrace.c: Revert. * bsd-uthread.c: Revert. * breakpoint.h: Revert. * breakpoint.c: Revert. * break-catch-throw.c: Revert. * break-catch-syscall.c: Revert. * break-catch-sig.c: Revert. * blockframe.c: Revert. * block.c: Revert. * bfin-tdep.c: Revert. * bfin-linux-tdep.c: Revert. * bfd-target.c: Revert. * bcache.c: Revert. * ax-general.c: Revert. * ax-gdb.h: Revert. * ax-gdb.c: Revert. * avr-tdep.c: Revert. * auxv.c: Revert. * auto-load.c: Revert. * arm-wince-tdep.c: Revert. * arm-tdep.c: Revert. * arm-symbian-tdep.c: Revert. * arm-pikeos-tdep.c: Revert. * arm-obsd-tdep.c: Revert. * arm-nbsd-tdep.c: Revert. * arm-nbsd-nat.c: Revert. * arm-linux-tdep.c: Revert. * arm-linux-nat.c: Revert. * arm-fbsd-tdep.c: Revert. * arm-fbsd-nat.c: Revert. * arm-bsd-tdep.c: Revert. * arch-utils.c: Revert. * arc-tdep.c: Revert. * arc-newlib-tdep.c: Revert. * annotate.h: Revert. * annotate.c: Revert. * amd64-windows-tdep.c: Revert. * amd64-windows-nat.c: Revert. * amd64-tdep.c: Revert. * amd64-sol2-tdep.c: Revert. * amd64-obsd-tdep.c: Revert. * amd64-obsd-nat.c: Revert. * amd64-nbsd-tdep.c: Revert. * amd64-nbsd-nat.c: Revert. * amd64-nat.c: Revert. * amd64-linux-tdep.c: Revert. * amd64-linux-nat.c: Revert. * amd64-fbsd-tdep.c: Revert. * amd64-fbsd-nat.c: Revert. * amd64-dicos-tdep.c: Revert. * amd64-darwin-tdep.c: Revert. * amd64-bsd-nat.c: Revert. * alpha-tdep.c: Revert. * alpha-obsd-tdep.c: Revert. * alpha-nbsd-tdep.c: Revert. * alpha-mdebug-tdep.c: Revert. * alpha-linux-tdep.c: Revert. * alpha-linux-nat.c: Revert. * alpha-bsd-tdep.c: Revert. * alpha-bsd-nat.c: Revert. * aix-thread.c: Revert. * agent.c: Revert. * addrmap.c: Revert. * ada-varobj.c: Revert. * ada-valprint.c: Revert. * ada-typeprint.c: Revert. * ada-tasks.c: Revert. * ada-lang.c: Revert. * aarch64-tdep.c: Revert. * aarch64-ravenscar-thread.c: Revert. * aarch64-newlib-tdep.c: Revert. * aarch64-linux-tdep.c: Revert. * aarch64-linux-nat.c: Revert. * aarch64-fbsd-tdep.c: Revert. * aarch64-fbsd-nat.c: Revert. * aarch32-linux-nat.c: Revert.
2019-04-06 21:38:10 +02:00
#include "glibc-tdep.h"
#include "arch/amd64.h"
#include "target-descriptions.h"
Implementing catch syscall. * amd64-linux-tdep.c: Include xml-syscall.h header, define the XML syscall name for the architecture. (amd64_linux_get_syscall_number): New function. (amd64_linux_init_abi): Register the correct functions for syscall catchpoint; set the correct syscall file name. * breakpoint.c: New include: xml-syscall.h. (set_raw_breakpoint_without_location): Setting the parameters for the catch syscall feature. (insert_catch_syscall): New. (remove_catch_syscall): New. (breakpoint_hit_catch_syscall): New. (print_it_catch_syscall): New. (print_one_catch_syscall): New. (print_mention_catch_syscall): New. (catch_syscall_breakpoint_ops): New. (syscall_catchpoint_p): New. (create_catchpoint_without_mention): New. (create_catchpoint): Modified in order to use create_catchpoint_without_mention. (create_syscall_event_catchpoint): New. (clean_up_filters): New. (catch_syscall_split_args): New. (catch_syscall_command_1): New. (delete_breakpoint): Add cleanup for catch syscall. (is_syscall_catchpoint_enabled): New. (catch_syscall_enabled): New. (catching_syscall_number): New. (catch_syscall_completer): New completer function. (add_catch_command): Add the completer function for catchpoints. * breakpoint.h (syscalls_to_be_caught): New vector. (catch_syscall_enabled): New. (catching_syscall_number): New. * gdbarch.c: Regenerated. * gdbarch.h: Regenerated. * gdbarch.sh: Add syscall catchpoint functions and structures. (get_syscall_number): New. (UNKNOWN_SYSCALL): New definition. * i386-linux-nat.c (i386_linux_resume): Select the proper request to be made for ptrace() considering if we are catching syscalls or not. * i386-linux-tdep.c: Include xml-syscall.h header, define the XML syscall name for the architecture. (i386_linux_get_syscall_number): New. (i386_linux_init_abi): Register the correct functions for syscall catchpoint; set the correct syscall file name. * inf-child.c (inf_child_set_syscall_catchpoint): New. (inf_child_target): Assign default values to target_ops. * inf-ptrace.c (inf_ptrace_resume): Select the proper request to be made for ptrace() considering if we are catching syscalls or not. * inferior.h (struct inferior): Included new variables any_syscall_count, syscalls_counts and total_syscalls_count, used to keep track of requested syscall catchpoints. * infrun.c (resume): Add syscall catchpoint. (deal_with_syscall_event): New. (handle_inferior_event): Add syscall entry/return events. (inferior_has_called_syscall): New. * linux-nat.c: Define some helpful variables to track wether we have support for the needed ptrace option. (linux_test_for_tracesysgood): New. (linux_supports_tracesysgood): New. (linux_enable_tracesysgood): New. (linux_enable_event_reporting): Save the current used ptrace options. (linux_child_post_attach): Calling linux_enable_tracesysgood. (linux_child_post_startup_inferior): Likewise. (linux_child_set_syscall_catchpoint): New function. (linux_handle_extended_wait): Handle the case which the inferior stops because it has called or returned from a syscall. (linux_target_install_ops): Install the necessary functions to handle syscall catchpoints. * linux-nat.h (struct lwp_info): Include syscall_state into the structure, which indicates if we are in a syscall entry or return. * ppc-linux-tdep.c: Include xml-syscall.h header, define the XML syscall filename for the arch. (ppc_linux_get_syscall_number): New. (ppc_linux_init_abi): Register the correct functions for syscall catchpoint; setting the correct name for the XML syscall file. * target.c (update_current_target): Update/copy functions related to syscall catchpoint. (target_waitstatus_to_string): Add syscall catchpoint entry/return events. * target.h (struct target_waitstatus): Add syscall number. (struct syscall): New struct to hold information about syscalls in the system. (struct target_ops): Add ops for syscall catchpoint. (inferior_has_called_syscall): New. (target_set_syscall_catchpoint): New. * xml-support.c (xml_fetch_content_from_file): New function, transferred from xml-tdesc.c. * xml-support.h (xml_fetch_content_from_file): New. * xml-tdesc.c (fetch_xml_from_file): Function removed; transferred to xml-support.c. (file_read_description_xml): Updated to use the new xml_fetch_content_from_file function. * syscalls/gdb-syscalls.dtd: New definition file for syscall's XML support. * syscalls/amd64-linux.xml: New file containing information about syscalls for GNU/Linux systems that use amd64 architecture. * syscalls/i386-linux.xml: New file containing information about syscalls for GNU/Linux systems that use i386 architecture. * syscalls/ppc-linux.xml: New file containing information about syscalls for GNU/Linux systems that use PPC architecture. * syscalls/ppc64-linux.xml: New file containing information about syscalls for GNU/Linux systems that use PPC64 architecture. * xml-syscall.c: New file containing functions for manipulating syscall's XML files. * xml-syscall.h: New file, exporting the functions above mentioned. * Makefile.in: Support for relocatable GDB datadir and XML syscall. * NEWS: Added information about the catch syscall feature. * doc/gdb.texinfo (Set Catchpoints): Documentation about the new feature. * testsuite/Makefile.in: Inclusion of catch-syscall object. * testsuite/gdb.base/catch-syscall.c: New file. * testsuite/gdb.base/catch-syscall.exp: New file.
2009-09-15 05:30:08 +02:00
/* The syscall's XML filename for i386. */
#define XML_SYSCALL_FILENAME_AMD64 "syscalls/amd64-linux.xml"
Split record.h into record.h and record-full.h. Split record.c into record.c and record-full.c. The split leaves the command part in record.c and moves the target part into record-full.c. gdb/ * record.h: Split into this and ... * record-full.h: ... this. * record.c: Split into this and ... * record-full.c: ... this. * target.h (target_ops): Add new fields to_info_record, to_save_record, to_delete_record, to_record_is_replaying, to_goto_record_begin, to_goto_record_end, to_goto_record. (target_info_record): New. (target_save_record): New. (target_supports_delete_record): New. (target_delete_record): New. (target_record_is_replaying): New. (target_goto_record_begin): New. (target_goto_record_end): New. (target_goto_record): New. * target.c (target_info_record): New. (target_save_record): New. (target_supports_delete_record): New. (target_delete_record): New. (target_record_is_replaying): New. (target_goto_record_begin): New. (target_goto_record_end): New. (target_goto_record): New. * record.h: Declare struct cmd_list_element. (record_cmdlist): New declaration. (set_record_cmdlist): New declaration. (show_record_cmdlist): New declaration. (info_record_cmdlist): New declaration. (cmd_record_goto): New declaration. * record.c: Remove unnecessary includes. Include inferior.h. (cmd_record_goto): Remove declaration. (record_cmdlist): Now extern. Initialize. (set_record_cmdlist): Now extern. Initialize. (show_record_cmdlist): Now extern. Initialize. (info_record_cmdlist): Now extern. Initialize. (find_record_target): New. (require_record_target): New. (cmd_record_start): Update. (cmd_record_delete): Remove target-specific code. Call target_delete_record. (cmd_record_stop): Unpush any record target. (set_record_insn_max_num): Move to record-full.c (set_record_command): Add comment. (show_record_command): Add comment. (info_record_command): Update comment. Remove target-specific code. Call the record target's to_info_record. (cmd_record_start): New. (cmd_record_goto): Now extern. Remove target-specific code. Call target_goto_begin, target_goto_end, or target_goto. (_initialize_record): Move record target ops initialization to record-full.c. Change "record" command help text. Move "record restore", "record set", and "record show" commands to record-full.c. * Makefile.in (SFILES): Add record-full.c. (HFILES_NO_SRCDIR): Add record-full.h. (COMMON_OBS): Add record-full.o. * amd64-linux-tdep.c: Include record-full.h instead of record.h. * arm-tdep.c: Include record-full.h. * i386-linux-tdep.c: Include record-full.h instead of record.h. * i386-tdep.c: Include record-full.h. * infrun.c: Include record-full.h. * linux-record.c: Include record-full.h. * moxie-tdep.c: Include record-full.h. * record-full.c: Include record-full.h. Change module comment. (set_record_full_cmdlist): New. (show_record_full_cmdlist): New. (record_full_cmdlist): New. (record_goto_insn): New declaration. (record_save): New declaration. (record_check_insn_num): Change query string. (record_info): New. (record_delete): New. (record_is_replaying): New. (record_goto_entry): New. (record_goto_begin): New. (record_goto_end): New. (record_goto): New. (init_record_ops): Update. (init_record_core_ops): Update. (cmd_record_save): Rename to record_save. Remove target and arg checks. (cmd_record_start): New. (set_record_insn_max_num): Moved from record.c (set_record_full_command): New. (show_record_full_command): New. (_initialize_record_full): New.
2013-03-11 09:42:55 +01:00
#include "record-full.h"
#include "linux-record.h"
/* Mapping between the general-purpose registers in `struct user'
format and GDB's register cache layout. */
/* From <sys/reg.h>. */
int amd64_linux_gregset_reg_offset[] =
{
10 * 8, /* %rax */
5 * 8, /* %rbx */
11 * 8, /* %rcx */
12 * 8, /* %rdx */
13 * 8, /* %rsi */
14 * 8, /* %rdi */
4 * 8, /* %rbp */
19 * 8, /* %rsp */
2011-01-07 Michael Snyder <msnyder@vmware.com> * ada-lang.c: Comment cleanup, mostly periods and spaces. * ada-lang.h: Ditto. * ada-tasks.c: Ditto. * ada-valprint.c: Ditto. * aix-threads.c: Ditto. * alpha-linux-nat.c: Ditto. * alpha-linux-tdep.c: Ditto. * alpha-mdebug-tdep.c: Ditto. * alpha-nat.c: Ditto. * alpha-osf1-tdep.c: Ditto. * alpha-tdep.c: Ditto. * alphabsd-nat.c: Ditto. * alphabsd-tdep.c: Ditto. * amd64-darwin-tdep.c: Ditto. * amd64-linux-nat.c: Ditto. * amd64-linux-tdep.c: Ditto. * amd64-sol2-tdep.c: Ditto. * amd64-tdep.c: Ditto. * amd64-fbsd-tdep.c: Ditto. * amd64-nbsd-tdep.c: Ditto. * amd64-obsd-tdep.c: Ditto. * amd64-linux-nat.c: Ditto. * amd64-linux-tdep.c: Ditto. * arm-tdep.c: Ditto. * arm-tdep.h: Ditto. * armnbsd-nat.c: Ditto. * avr-tdep.c: Ditto. * bfin-tdep.c: Ditto. * bsd-kvm.c: Ditto. * c-typeprintc: Ditto. * c-valprint.c: Ditto. * coff-pe-read.h: Ditto. * coffreead.c: Ditto. * cris-tdep.c: Ditto. * d-lang.c: Ditto. * darwin-nat-info.c: Ditto. * darwin-nat.c: Ditto. * dbug-rom.c: Ditto. * dbxread.c: Ditto. * dcache.c: Ditto. * dcache.h: Ditto. * dec-thread.c: Ditto. * defs.h: Ditto. * demangle.c: Ditto. * dicos-tdep.c: Ditto. * dictionary.c: Ditto. * dictionary.h: Ditto. * dink32-rom.c: Ditto. * disasm.c: Ditto. * doublest.c: Ditto. * dsrec.c: Ditto. * dummy-frame.c: Ditto. * dwarf2-frame.c: Ditto. * dwarf2expr.c: Ditto. * dwarf2loc.c: Ditto. * dwarf2read.c: Ditto. * elfread.c: Ditto. * environ.c: Ditto. * eval.c: Ditto. * event-top.h: Ditto. * exceptions.c: Ditto. * exceptions.h: Ditto. * exec.c: Ditto. * expprint.c: Ditto. * expression.h: Ditto. * f-exp.y: Ditto. * f-lang.c: Ditto. * f-lang.h: Ditto. * f-typeprint.c: Ditto. * f-valprint.c: Ditto. * fbsd-nat.c: Ditto. * findvar.c: Ditto. * fork-child.c: Ditto. * frame.c: Ditto. * frame.h: Ditto. * frv-linux-tdep.c: Ditto. * frv-tdep.c: Ditto. * gcore.c: Ditto. * gdb-stabs.h: Ditto. * gdb_assert.h: Ditto. * gdb_string.h: Ditto. * gdb_thread_db.h: Ditto. * gdb_wait.h: Ditto. * gdbarch.sh: Ditto. * gdbcore.h: Ditto. * gdbthread.h: Ditto. * gdbtypes.c: Ditto. * gdbtypes.h: Ditto. * gnu-nat.c: Ditto. * gnu-nat.h: Ditto. * gnu-v2-abi.c: Ditto. * gnu-v3-abi.c: Ditto. * go32-nat.c: Ditto. * gdbarch.c: Regenerate. * gdbarch.h: Regenerate.
2011-01-07 20:36:19 +01:00
9 * 8, /* %r8 ... */
8 * 8,
7 * 8,
6 * 8,
3 * 8,
2 * 8,
1 * 8,
0 * 8, /* ... %r15 */
16 * 8, /* %rip */
18 * 8, /* %eflags */
17 * 8, /* %cs */
20 * 8, /* %ss */
23 * 8, /* %ds */
24 * 8, /* %es */
25 * 8, /* %fs */
26 * 8, /* %gs */
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, /* MPX registers BND0 ... BND3. */
-1, -1, /* MPX registers BNDCFGU and BNDSTATUS. */
Add AVX512 registers support to GDB and GDBserver. This patch adds support for the Intel(R) Advanced Vector Extensions 512 (Intel(R) AVX-512) registers. Native and remote debugging are covered by this patch. Intel(R) AVX-512 is an extension to AVX to support 512-bit wide SIMD registers in 64-bit mode (XMM0-XMM31, YMM0-YMM31, ZMM0-ZMM31). The number of available registers in 32-bit mode is still 8 (XMM0-7, YMM0-7, ZMM0-7). The lower 256-bits of the ZMM registers are aliased to the respective 256-bit YMM registers. The lower 128-bits are aliased to the respective 128-bit XMM registers. There are also 8 new, dedicated mask registers (K0-K7) in both 32-bit mode and 64-bit mode. For more information please see Intel(R) Developer Zone: Intel(R) AVX http://software.intel.com/en-us/intel-isa-extensions#pid-16007-1495 Intel(R) Architecture Instruction Set Extensions Programming Reference: http://software.intel.com/en-us/file/319433-017pdf 2014-04-24 Michael Sturm <michael.sturm@mintel.com> Walfred Tedeschi <walfred.tedeschi@intel.com> * amd64-linux-nat.c (amd64_linux_gregset32_reg_offset): Add AVX512 registers. (amd64_linux_read_description): Add code to handle AVX512 xstate mask and return respective tdesc. * amd64-linux-tdep.c: Include features/i386/amd64-avx512-linux.c and features/i386/x32-avx512-linux.c. (amd64_linux_gregset_reg_offset): Add AVX512 registers. (amd64_linux_core_read_description): Add code to handle AVX512 xstate mask and return respective tdesc. (_initialize_amd64_linux_tdep): Initialize AVX512 tdesc. * amd64-linux-tdep.h (AMD64_LINUX_ORIG_RAX_REGNUM): Adjust regnum calculation. (AMD64_LINUX_NUM_REGS): Adjust to new number of registers. (tdesc_amd64_avx512_linux): New prototype. (tdesc_x32_avx512_linux): Likewise. * amd64-tdep.c: Include features/i386/amd64-avx512.c and features/i386/x32-avx512.c. (amd64_ymm_avx512_names): New register names for pseudo registers YMM16-31. (amd64_ymmh_avx512_names): New register names for raw registers YMMH16-31. (amd64_k_names): New register names for K registers. (amd64_zmmh_names): New register names for ZMM raw registers. (amd64_zmm_names): New registers names for ZMM pseudo registers. (amd64_xmm_avx512_names): New register names for XMM16-31 registers. (amd64_pseudo_register_name): Add code to return AVX512 pseudo registers. (amd64_init_abi): Add code to intitialize AVX512 tdep variables if feature is present. (_initialize_amd64_tdep): Call AVX512 tdesc initializers. * amd64-tdep.h (enum amd64_regnum): Add AVX512 registers. (AMD64_NUM_REGS): Adjust to new number of registers. * i386-linux-nat.c (GETXSTATEREGS_SUPPLIES): Extend range of registers supplied via XSTATE by AVX512 registers. (i386_linux_read_description): Add case for AVX512. * i386-linux-tdep.c: Include i386-avx512-linux.c. (i386_linux_gregset_reg_offset): Add AVX512 registers. (i386_linux_core_read_description): Add case for AVX512. (i386_linux_init_abi): Install supported register note section for AVX512. (_initialize_i386_linux_tdep): Add call to tdesc init function for AVX512. * i386-linux-tdep.h (I386_LINUX_NUM_REGS): Set number of registers to be number of zmm7h + 1. (tdesc_i386_avx512_linux): Add tdesc for AVX512 registers. * i386-tdep.c: Include features/i386/i386-avx512.c. (i386_zmm_names): Add ZMM pseudo register names array. (i386_zmmh_names): Add ZMM raw register names array. (i386_k_names): Add K raw register names array. (num_lower_zmm_regs): Add constant for the number of lower ZMM registers. AVX512 has 16 more ZMM registers than there are YMM registers. (i386_zmmh_regnum_p): Add function to look up register number of ZMM raw registers. (i386_zmm_regnum_p): Likewise for ZMM pseudo registers. (i386_k_regnum_p): Likewise for K raw registers. (i386_ymmh_avx512_regnum_p): Likewise for additional YMM raw registers added by AVX512. (i386_ymm_avx512_regnum_p): Likewise for additional YMM pseudo registers added by AVX512. (i386_xmm_avx512_regnum_p): Likewise for additional XMM registers added by AVX512. (i386_register_name): Add code to hide YMMH16-31 and ZMMH0-31. (i386_pseudo_register_name): Add ZMM pseudo registers. (i386_zmm_type): Construct and return vector registers type for ZMM registers. (i386_pseudo_register_type): Return appropriate type for YMM16-31, ZMM0-31 pseudo registers and K registers. (i386_pseudo_register_read_into_value): Add code to read K, ZMM and YMM16-31 registers from register cache. (i386_pseudo_register_write): Add code to write K, ZMM and YMM16-31 registers. (i386_register_reggroup_p): Add code to include/exclude AVX512 registers in/from respective register groups. (i386_validate_tdesc_p): Handle AVX512 feature, add AVX512 registers if feature is present in xcr0. (i386_gdbarch_init): Add code to initialize AVX512 feature variables in tdep structure, wire in pseudo registers and call initialize_tdesc_i386_avx512. * i386-tdep.h (struct gdbarch_tdep): Add AVX512 related variables. (i386_regnum): Add AVX512 registers. (I386_SSE_NUM_REGS): New define for number of SSE registers. (I386_AVX_NUM_REGS): Likewise for AVX registers. (I386_AVX512_NUM_REGS): Likewise for AVX512 registers. (I386_MAX_REGISTER_SIZE): Change to 64 bytes, ZMM registers are 512 bits wide. (i386_xmm_avx512_regnum_p): New prototype for register look up. (i386_ymm_avx512_regnum_p): Likewise. (i386_k_regnum_p): Likewise. (i386_zmm_regnum_p): Likewise. (i386_zmmh_regnum_p): Likewise. * i387-tdep.c : Update year in copyright notice. (xsave_ymm_avx512_offset): New table for YMM16-31 offsets in XSAVE buffer. (XSAVE_YMM_AVX512_ADDR): New macro. (xsave_xmm_avx512_offset): New table for XMM16-31 offsets in XSAVE buffer. (XSAVE_XMM_AVX512_ADDR): New macro. (xsave_avx512_k_offset): New table for K register offsets in XSAVE buffer. (XSAVE_AVX512_K_ADDR): New macro. (xsave_avx512_zmm_h_offset): New table for ZMM register offsets in XSAVE buffer. (XSAVE_AVX512_ZMM_H_ADDR): New macro. (i387_supply_xsave): Add code to supply AVX512 registers to XSAVE buffer. (i387_collect_xsave): Add code to collect AVX512 registers from XSAVE buffer. * i387-tdep.h (I387_NUM_XMM_AVX512_REGS): New define for number of XMM16-31 registers. (I387_NUM_K_REGS): New define for number of K registers. (I387_K0_REGNUM): New define for K0 register number. (I387_NUM_ZMMH_REGS): New define for number of ZMMH registers. (I387_ZMM0H_REGNUM): New define for ZMM0H register number. (I387_NUM_YMM_AVX512_REGS): New define for number of YMM16-31 registers. (I387_YMM16H_REGNUM): New define for YMM16H register number. (I387_XMM16_REGNUM): New define for XMM16 register number. (I387_YMM0_REGNUM): New define for YMM0 register number. (I387_KEND_REGNUM): New define for last K register number. (I387_ZMMENDH_REGNUM): New define for last ZMMH register number. (I387_YMMH_AVX512_END_REGNUM): New define for YMM31 register number. (I387_XMM_AVX512_END_REGNUM): New define for XMM31 register number. * common/i386-xstate.h: Add AVX 3.1 feature bits, mask and XSTATE size. * features/Makefile: Add AVX512 related files. * features/i386/32bit-avx512.xml: New file. * features/i386/64bit-avx512.xml: Likewise. * features/i386/amd64-avx512-linux.c: Likewise. * features/i386/amd64-avx512-linux.xml: Likewise. * features/i386/amd64-avx512.c: Likewise. * features/i386/amd64-avx512.xml: Likewise. * features/i386/i386-avx512-linux.c: Likewise. * features/i386/i386-avx512-linux.xml: Likewise. * features/i386/i386-avx512.c: Likewise. * features/i386/i386-avx512.xml: Likewise. * features/i386/x32-avx512-linux.c: Likewise. * features/i386/x32-avx512-linux.xml: Likewise. * features/i386/x32-avx512.c: Likewise. * features/i386/x32-avx512.xml: Likewise. * regformats/i386/amd64-avx512-linux.dat: New file. * regformats/i386/amd64-avx512.dat: Likewise. * regformats/i386/i386-avx512-linux.dat: Likewise. * regformats/i386/i386-avx512.dat: Likewise. * regformats/i386/x32-avx512-linux.dat: Likewise. * regformats/i386/x32-avx512.dat: Likewise. * NEWS: Add note about new support for AVX512. testsuite/ * Makefile.in (EXECUTABLES): Added i386-avx512. * gdb.arch/i386-avx512.c: New file. * gdb.arch/i386-avx512.exp: Likewise. gdbserver/ * Makefile.in: Added rules to handle new files i386-avx512.c i386-avx512-linux.c amd64-avx512.c amd64-avx512-linux.c x32-avx512.c x32-avx512-linux.c. * configure.srv (srv_i386_regobj): Add i386-avx512.o. (srv_i386_linux_regobj): Add i386-avx512-linux.o. (srv_amd64_regobj): Add amd64-avx512.o and x32-avx512.o. (srv_amd64_linux_regobj): Add amd64-avx512-linux.o and x32-avx512-linux.o. (srv_i386_32bit_xmlfiles): Add i386/32bit-avx512.xml. (srv_i386_64bit_xmlfiles): Add i386/64bit-avx512.xml. (srv_amd64_xmlfiles): Add i386/amd64-avx512.xml and i386/x32-avx512.xml. (srv_i386_linux_xmlfiles): Add i386/i386-avx512-linux.xml. (srv_amd64_linux_xmlfiles): Add i386/amd64-avx512-linux.xml and i386/x32-avx512-linux.xml. * i387-fp.c (num_avx512_k_registers): New constant for number of K registers. (num_avx512_zmmh_low_registers): New constant for number of lower ZMM registers (0-15). (num_avx512_zmmh_high_registers): New constant for number of higher ZMM registers (16-31). (num_avx512_ymmh_registers): New contant for number of higher YMM registers (ymm16-31 added by avx521 on x86_64). (num_avx512_xmm_registers): New constant for number of higher XMM registers (xmm16-31 added by AVX512 on x86_64). (struct i387_xsave): Add space for AVX512 registers. (i387_cache_to_xsave): Change raw buffer size to 64 characters. Add code to handle AVX512 registers. (i387_xsave_to_cache): Add code to handle AVX512 registers. * linux-x86-low.c (init_registers_amd64_avx512_linux): New prototypei from generated file. (tdesc_amd64_avx512_linux): Likewise. (init_registers_x32_avx512_linux): Likewise. (tdesc_x32_avx512_linux): Likewise. (init_registers_i386_avx512_linux): Likewise. (tdesc_i386_avx512_linux): Likewise. (x86_64_regmap): Add AVX512 registers. (x86_linux_read_description): Add code to handle AVX512 XSTATE mask. (initialize_low_arch): Add code to initialize AVX512 registers. doc/ * gdb.texinfo (i386 Features): Add description of AVX512 registers. Change-Id: Ifc4c08c76b85dbec18d02efdbe6182e851584438 Signed-off-by: Michael Sturm <michael.sturm@intel.com>
2013-12-16 16:43:05 +01:00
-1, -1, -1, -1, -1, -1, -1, -1, /* xmm16 ... xmm31 (AVX512) */
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, /* ymm16 ... ymm31 (AVX512) */
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, /* k0 ... k7 (AVX512) */
-1, -1, -1, -1, -1, -1, -1, -1, /* zmm0 ... zmm31 (AVX512) */
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
Add support for Intel PKRU register to GDB and GDBserver. This patch adds support for the registers added by the Memory Protection Keys for Userspace (PKU aka PKEYs) feature. Native and remote debugging are covered by this patch. The XSAVE area is extended with a new state containing the 32-bit wide PKRU register. The new register is added to amd64-avx-mpx_avx512-* tdesc, thus it is renamed accordingly. Also, respective xstate mask X86_XSTATE_AVX_MPX_AVX512_MASK is renamed to X86_XSTATE_AVX_MPX_AVX512_PKU_MASK to reflect the new feature set it supports. For more information, please refer to the Intel(R) 64 and IA-32 Architectures Software Developer's Manual - Septemper 2015 http://www.intel.com/content/dam/www/public/us/en/documents/ manuals/64-ia-32-architectures-software-developer-manual-325462.pdf gdb/Changelog: 2015-12-08 Michael Sturm <michael.sturm@intel.com> * NEWS: Mention addition of PKU feature. * amd64-linux-nat.c (amd64_linux_gregset32_reg_offset): Add PKRU register. * amd64-linux-tdep.c (features/i386/amd64-avx-mpx-avx512-linux.c): Rename to... (features/i386/amd64-avx-mpx-avx512-pku-linux.c): ...this. (amd64_linux_gregset_reg_offset): Add PKRU register. (amd64_linux_core_read_description): Rename X86_XSTATE_AVX_MPX_AVX512_MASK, rename tdesc_amd64_avx_mpx_avx512_pku_linux. (_initialize_amd64_linux_tdep): Rename initialize_tdesc_amd64_avx_mpx_avx512_linux. * amd64-linux-tdep.h (AMD64_LINUX_ORIG_RAX_REGNUM): Adjust regnum calculation. (tdesc_amd64_avx_mpx_avx512_linux): Rename to... (tdesc_amd64_avx_mpx_avx512_pku_linux): ...this. * amd64-tdep.c (features/i386/amd64-avx-mpx-avx512-pku.c): Rename to... (features/i386/amd64-avx-mpx-avx512-pku.c): ...this. (amd64_pkeys_names): New register name for raw register PKRU. (amd64_init_abi): Add code to initialize PKRU tdep variables if feature is present. (amd64_target_description): Rename X86_XSTATE_AVX_MPX_AVX512_MASK, rename tdesc_amd64_avx_mpx_avx512. (_initialize_amd64_tdep): Rename initialize_tdesc_amd64_avx_mpx_avx512. * amd64-tdep.h (enum amd64_regnum): Add PKRU register. (AMD64_NUM_REGS): Adjust regnum calculation. * i386-linux.nat.c (GETXSTATEREGS_SUPPLIES): Extend range of registers supplied via XSTATE by PKRU register. * common/x86-xstate.h (X86_XSTATE_PKRU): New macro. (X86_XSTATE_AVX_MPX_AVX512_MASK): Add PKRU and renamed mask. (X86_XSTATE_ALL_MASK): Rename X86_XSTATE_AVX_MPX_AVX512_MASK. (X86_XSTATE_PKRU_SIZE): New macro. (X86_XSTATE_MAX_SIZE): Adjust size. (HAS_PKRU(XCR0)): New macro. (X86_XSTATE_SIZE): Add checkfor PKRU. * features/Makefile (WHICH): Rename i386/i386-avx-mpx-avx512, i386/i386-avx-mpx-avx512-linux, i386/amd64-avx-mpx-avx512, i386/amd64-avx-mpx-avx512-linux. (i386/i386-avx-mpx-avx512-expedite): Rename expedite. (i386/i386-avx-mpx-avx512-linux-expedite): Likewise. (i386/amd64-avx-mpx-avx512-expedite): Likewise. (i386/amd64-avx-mpx-avx512-linux-expedite): Likewise. (XMLTOC): Rename i386/amd64-avx-mpx-avx512-linux.xml, i386/amd64-avx-mpx-avx512.xml, i386/i386-avx-mpx-avx512-linux.xml, i386/i386-avx-mpx-avx512.xml. ((outdir)/i386/i386-avx-mpx-avx512.dat): Rename rule, add i386/32bit-pkeys.xml. ((outdir)/i386/i386-avx-mpx-avx512-pku-linux.dat): Likewise. ((outdir)/i386/amd64-avx-mpx-avx512.dat): Rename rule, add i386/64bit-pkeys.xml. ((outdir)/i386/amd64-avx-mpx-avx512-linux.dat): Likewise. * features/i386/32bit-pkeys.xml: New file. * features/i386/64bit-pkeys.xml: Likewise. * features/i386/amd64-avx-mpx-avx512-linux-pku.c: Regenerate from renamed XML file. * features/i386/amd64-avx-mpx-avx512-linux.xml: Rename to amd64-avx-mpx-avx512-pku-linux.xml, add 64bit-pkeys.xml * features/i386/amd64-avx-mpx-avx512.c: Regenerate from renamed XML file. * features/i386/amd64-avx-mpx-avx512.xml: Rename to amd64-avx-mpx-avx512-pku.xml, add 64bit-pkeys.xml. * features/i386/i386-avx-mpx-avx512-linux.c: Regenerate from renamed XML file. * features/i386/i386-avx-mpx-avx512-linux.xml: Rename to i386-avx-mpx-avx512-pku-linux.xml, add 32bit-pkeys.xml. * features/i386/i386-avx-mpx-avx512.c: Regenerate from renamed XML file. * features/i386/i386-avx-mpx-avx512.xml: Rename to i386-avx-mpx-avx512-pku.xml, add 32bit-pkeys.xml. * i386-linux-nat.c (GETXSTATEREGS_SUPPLIES): Change to use I386_PKEYS_NUM_REGS. * i386-linux-tdep.c (features/i386/i386-avx-mpx-avx512-linux.c): Rename include. (i386_linux_gregset_reg_offset): Add PKRU register. (i386_linux_core_read_description): Rename xstate mask and returned tdesc for X86_XSTATE_AVX_MPX_AVX512_PKU_MASK. (_initialize_i386_linux_tdep): Rename initialize_tdesc_i386_avx_mpx_avx512_linux. * i386-linux-tdep.h (I386_LINUX_ORIG_EAX_REGNUM): Adjuste regnum calculation. (tdesc_i386_avx_mpx_avx512_linux): Rename prototype. (/* Format of XSAVE...): Add pkru register. * i386-tdep.c (i386-avx-mpx-avx512.c): Rename include. (i386_pkeys_names): New register name for raw register PKRU. (i386_pkru_regnum_p): Add function to look up register number of PKRU raw register. (i386_register_reggroup_p): Add code to exclude PKRU from general register group. (i386_validate_tdesc_p): Add code to handle PKRU feature, add PKRU registers if feature is present in xcr0. (i386_gdbarch_init): Adjust number of registers in architecture. Add code to initialize PKRU feature variables in tdep structure. (i386_target_description): Rename xstate mask and returned tdesc for X86_XSTATE_AVX_MPX_AVX512_PKU_MASK. (_initialize_i386_tdep): Rename initialize_tdesc_i386_avx_mpx_avx512. * i386-tdep.h (struct gdbarch_tdep): Add feature variables to tdep structure. (enum i386_regnum): Add PKRU register. (I386_PKEYS_NUM_REGS): New define for number of registers in PKRU feature. (i386_pkru_regnum_p): New prototype. * i387-tdep.c (xsave_pkeys_offset): New table for PKRU offsets in XSAVE buffer. (XSAVE_PKEYS_ADDR): New macro. (i387_supply_xsave): Add code to handle PKRU register. (i387_collect_xsave): Likewise. * i387-tdep.h (I387_NUM_PKEYS_REGS): New define for number of registers in PKRU feature. (I387_PKRU_REGNUM): New macro. (I387_PKEYSEND_REGNUM): Likewise. * regformats/i386/amd64_avx_mpx_avx512_pku_linux.dat: Regenerate from renamed XML file. * regformats/i386/amd64_avx_mpx_avx512_pku.dat: Likewise. * regformats/i386/i386/amd64-avx-mpx-avx512-pku.dat: Likewise. * regformats/i386/i386_avx_mpx_avx512_pku_linux.dat: Likewise. testsuite/Changelog: 2016-04-18 Michael Sturm <michael.sturm@intel.com> * gdb.arch/i386-pkru.c: New file. * gdb.arch/i386-pkru.exp: Likewise. gdbserver/Changelog: 2016-04-18 Michael Sturm <michael.sturm@intel.com> * Makefile.in (clean): Rename i386-avx-mpx-avx512.c, i386-avx-mpx-avx512-linux.c, amd64-avx-mpx-avx512.c, amd64-avx-mpx-avx512-linux.c. (i386-avx-mpx-avx512-linux-ipa.o:): Rename rule and source file. (amd64-avx-mpx-avx512-linux-ipa.o:): Likewise. (i386-avx-mpx-avx512.c :): Rename rule, source files and dat files. (i386-avx-mpx-avx512-linux.c :): Likewise. (amd64-avx-mpx-avx512.c :): Likewise. (amd64-avx-mpx-avx512-linux.c :): Likewise. * configure.srv (srv_i386_regobj): Rename i386-avx-mpx-avx512.o. (srv_i386_linux_regobj): Rename i386-avx-mpx-avx512-linux.o. (srv_amd64_regobj): Rename amd64-avx-mpx-avx512.o. (srv_amd64_linux_regobj): Rename amd64-avx-mpx-avx512-linux.o. (ipa_i386_linux_regobj): Rename i386-avx-mpx-avx512-linux-ipa.o. (ipa_amd64_linux_regobj): Rename amd64-avx-mpx-avx512-pku-linux-ipa.o. (srv_i386_32bit_xmlfiles): Add 32bit-pkeys.xml. (srv_i386_64bit_xmlfiles): Add 64bit-pkeys.xml. (srv_i386_xmlfiles): Rename i386/i386-avx-mpx-avx512.xml. (srv_amd64_xmlfiles): Rename i386/amd64-avx-mpx-avx512.xml. (srv_i386_linux_xmlfiles): Rename i386/i386-avx-mpx-avx512-linux.xml. (srv_amd64_linux_xmlfiles): Rename di386/amd64-avx-mpx-avx512-linux.xml. * i387-fp.c (num_pkeys_registers): New variable. (struct i387_xsave): Add space for pkru values. (i387_cache_to_fsave): Add code to handle PKRU register. (i387_xsave_to_cache): Likewise. * linux-amd64-ipa.c (get_ipa_tdesc): Rename tdesc_amd64_avx_mpx_avx512_linux. (initialize_low_tracepoint): Rename init_registers_amd64_avx_mpx_avx512_linux. * linux-i386-ipa.c (get_ipa_desc): Rename tdesc_i386_avx_mpx_avx512_linux. (initialize_low_tracepoint): Rename init_registers_i386_avx_mpx_avx512_linux. * linux-x86-low.c (x86_64_regmap[]): Add PKRU register. (x86_linux_read_description): Rename X86_XSTATE_AVX_MPX_AVX512_MASK, rename tdesc_amd64_avx_mpx_avx512_linux, rename tdesc_i386_avx_mpx_avx512_linux. (x86_get_ipa_tdesc_idx): Rename tdesc_amd64_avx_mpx_avx512_linux, rename tdesc_i386_avx_mpx_avx512_linux. (initialize_low_arch): Rename init_registers_amd64_avx_mpx_avx512_linux, rename init_registers_i386_avx_mpx_avx512_linux. * linux-x86-tdesc.h (init_registers_amd64_avx_mpx_avx512_linux): Renamed prototype. (tdesc_amd64_avx_mpx_avx512_linux): Likewise. (init_registers_i386_avx_mpx_avx512_linux): Likewise. (tdesc_i386_avx_mpx_avx512_linux): Likewise. doc/Changelog: 2016-04-18 Michael Sturm <michael.sturm@intel.com> * gdb.texinfo (i386 Features): Add description of PKRU register. Change-Id: If75ce5aba7dfd33fdbe3d8b47f04ef3f550c52be Signed-off-by: Michael Sturm <michael.sturm@intel.com>
2017-02-01 12:22:27 +01:00
-1, /* PKEYS register pkru */
amd64-linux: expose system register FS_BASE and GS_BASE for Linux. This patch allows examination of the registers FS_BASE and GS_BASE for Linux Systems running on 64bit. Tests for simple read and write of the new registers is also added with this patch. 2017-01-27 Walfred Tedeschi <walfred.tedeschi@intel.com> Richard Henderson <rth@redhat.com> gdb/ChangeLog: * amd64-linux-nat.c (PTRACE_ARCH_PRCTL): New define. (amd64_linux_fetch_inferior_registers): Add case to fetch FS_BASE GS_BASE for older kernels. (amd64_linux_store_inferior_registers): Add case to store FS_BASE GS_BASE for older kernels. * amd64-linux-tdep.c (amd64_linux_gregset_reg_offset): Add FS_BASE and GS_BASE to the offset table. (amd64_linux_register_reggroup_p): Add FS_BASE and GS_BASE to the system register group. * amd64-nat.c (amd64_native_gregset_reg_offset): Implements case for older kernels. * amd64-tdep.c (amd64_init_abi): Add segment registers for the amd64 ABI. * amd64-tdep.h (amd64_regnum): Add AMD64_FSBASE_REGNUM and AMD64_GSBASE_REGNUM. (AMD64_NUM_REGS): Set to AMD64_GSBASE_REGNUM + 1. * features/Makefile (amd64-linux.dat, amd64-avx-linux.dat) (amd64-mpx-linux.dat, amd64-avx512-linux.dat, x32-linux.dat) (x32-avx-linux.dat, x32-avx512-linux.dat): Add i386/64bit-segments.xml in those rules. * features/i386/64bit-segments.xml: New file. * features/i386/amd64-avx-mpx-linux.xml: Add 64bit-segments.xml. * features/i386/amd64-avx-linux.xml: Add 64bit-segments.xml. * features/i386/amd64-avx512-linux.xml: Add 64bit-segments.xml. * features/i386/amd64-mpx-linux.xml: Add 64bit-segments.xml. * features/i386/x32-avx512-linux.xml: Add 64bit-segments.xml. * features/i386/x32-avx-linux.xml: Add 64bit-segments.xml. * features/i386/amd64-linux.xml: Add 64bit-segments.xml. * features/i386/amd64-avx-linux.c: Regenerated. * features/i386/amd64-avx-mpx-linux.c: Regenerated. * features/i386/amd64-avx-mpx.c: Regenerated. * features/i386/amd64-avx512-linux.c: Regenerated. * features/i386/amd64-linux.c: Regenerated. * features/i386/amd64-mpx-linux.c: Regenerated. * features/i386/i386-avx-mpx-linux.c: Regenerated. * features/i386/i386-avx-mpx.c: Regenerated. * features/i386/x32-avx-linux.c: Regenerated. * features/i386/x32-avx512-linux.c: Regenerated. * regformats/i386/amd64-avx-linux.dat: Regenerated. * regformats/i386/amd64-avx-mpx-linux.dat: Regenerated. * regformats/i386/amd64-avx512-linux.dat: Regenerated. * regformats/i386/amd64-linux.dat: Regenerated. * regformats/i386/amd64-mpx-linux.dat: Regenerated. * regformats/i386/x32-avx-linux.dat: Regenerated. * regformats/i386/x32-avx512-linux.dat: Regenerated. * regformats/i386/x32-linux.dat: Regenerated. gdb/doc/ChangeLog: * gdb.texinfo (i386 Features): Add system segment registers as feature. gdb/gdbserver/ChangeLog: * linux-x86-low.c (x86_64_regmap): Add fs_base and gs_base to the register table. (x86_fill_gregset): Add support for old kernels for the fs_base and gs_base system registers. (x86_store_gregset): Likewise. * configure.srv (srv_i386_64bit_xmlfiles): Add 64bit-segments.xml. gdb/testsuite/ChangeLog: * gdb.arch/amd64-gs_base.c: New file. * gdb.arch/amd64-gs_base.exp: New file. Change-Id: I2e0eeb93058a2320d4d3b045082643cfe4aff963 Signed-off-by: Walfred Tedeschi <walfred.tedeschi@intel.com>
2017-01-27 15:19:14 +01:00
/* End of hardware registers */
21 * 8, 22 * 8, /* fs_base and gs_base. */
Add AVX512 registers support to GDB and GDBserver. This patch adds support for the Intel(R) Advanced Vector Extensions 512 (Intel(R) AVX-512) registers. Native and remote debugging are covered by this patch. Intel(R) AVX-512 is an extension to AVX to support 512-bit wide SIMD registers in 64-bit mode (XMM0-XMM31, YMM0-YMM31, ZMM0-ZMM31). The number of available registers in 32-bit mode is still 8 (XMM0-7, YMM0-7, ZMM0-7). The lower 256-bits of the ZMM registers are aliased to the respective 256-bit YMM registers. The lower 128-bits are aliased to the respective 128-bit XMM registers. There are also 8 new, dedicated mask registers (K0-K7) in both 32-bit mode and 64-bit mode. For more information please see Intel(R) Developer Zone: Intel(R) AVX http://software.intel.com/en-us/intel-isa-extensions#pid-16007-1495 Intel(R) Architecture Instruction Set Extensions Programming Reference: http://software.intel.com/en-us/file/319433-017pdf 2014-04-24 Michael Sturm <michael.sturm@mintel.com> Walfred Tedeschi <walfred.tedeschi@intel.com> * amd64-linux-nat.c (amd64_linux_gregset32_reg_offset): Add AVX512 registers. (amd64_linux_read_description): Add code to handle AVX512 xstate mask and return respective tdesc. * amd64-linux-tdep.c: Include features/i386/amd64-avx512-linux.c and features/i386/x32-avx512-linux.c. (amd64_linux_gregset_reg_offset): Add AVX512 registers. (amd64_linux_core_read_description): Add code to handle AVX512 xstate mask and return respective tdesc. (_initialize_amd64_linux_tdep): Initialize AVX512 tdesc. * amd64-linux-tdep.h (AMD64_LINUX_ORIG_RAX_REGNUM): Adjust regnum calculation. (AMD64_LINUX_NUM_REGS): Adjust to new number of registers. (tdesc_amd64_avx512_linux): New prototype. (tdesc_x32_avx512_linux): Likewise. * amd64-tdep.c: Include features/i386/amd64-avx512.c and features/i386/x32-avx512.c. (amd64_ymm_avx512_names): New register names for pseudo registers YMM16-31. (amd64_ymmh_avx512_names): New register names for raw registers YMMH16-31. (amd64_k_names): New register names for K registers. (amd64_zmmh_names): New register names for ZMM raw registers. (amd64_zmm_names): New registers names for ZMM pseudo registers. (amd64_xmm_avx512_names): New register names for XMM16-31 registers. (amd64_pseudo_register_name): Add code to return AVX512 pseudo registers. (amd64_init_abi): Add code to intitialize AVX512 tdep variables if feature is present. (_initialize_amd64_tdep): Call AVX512 tdesc initializers. * amd64-tdep.h (enum amd64_regnum): Add AVX512 registers. (AMD64_NUM_REGS): Adjust to new number of registers. * i386-linux-nat.c (GETXSTATEREGS_SUPPLIES): Extend range of registers supplied via XSTATE by AVX512 registers. (i386_linux_read_description): Add case for AVX512. * i386-linux-tdep.c: Include i386-avx512-linux.c. (i386_linux_gregset_reg_offset): Add AVX512 registers. (i386_linux_core_read_description): Add case for AVX512. (i386_linux_init_abi): Install supported register note section for AVX512. (_initialize_i386_linux_tdep): Add call to tdesc init function for AVX512. * i386-linux-tdep.h (I386_LINUX_NUM_REGS): Set number of registers to be number of zmm7h + 1. (tdesc_i386_avx512_linux): Add tdesc for AVX512 registers. * i386-tdep.c: Include features/i386/i386-avx512.c. (i386_zmm_names): Add ZMM pseudo register names array. (i386_zmmh_names): Add ZMM raw register names array. (i386_k_names): Add K raw register names array. (num_lower_zmm_regs): Add constant for the number of lower ZMM registers. AVX512 has 16 more ZMM registers than there are YMM registers. (i386_zmmh_regnum_p): Add function to look up register number of ZMM raw registers. (i386_zmm_regnum_p): Likewise for ZMM pseudo registers. (i386_k_regnum_p): Likewise for K raw registers. (i386_ymmh_avx512_regnum_p): Likewise for additional YMM raw registers added by AVX512. (i386_ymm_avx512_regnum_p): Likewise for additional YMM pseudo registers added by AVX512. (i386_xmm_avx512_regnum_p): Likewise for additional XMM registers added by AVX512. (i386_register_name): Add code to hide YMMH16-31 and ZMMH0-31. (i386_pseudo_register_name): Add ZMM pseudo registers. (i386_zmm_type): Construct and return vector registers type for ZMM registers. (i386_pseudo_register_type): Return appropriate type for YMM16-31, ZMM0-31 pseudo registers and K registers. (i386_pseudo_register_read_into_value): Add code to read K, ZMM and YMM16-31 registers from register cache. (i386_pseudo_register_write): Add code to write K, ZMM and YMM16-31 registers. (i386_register_reggroup_p): Add code to include/exclude AVX512 registers in/from respective register groups. (i386_validate_tdesc_p): Handle AVX512 feature, add AVX512 registers if feature is present in xcr0. (i386_gdbarch_init): Add code to initialize AVX512 feature variables in tdep structure, wire in pseudo registers and call initialize_tdesc_i386_avx512. * i386-tdep.h (struct gdbarch_tdep): Add AVX512 related variables. (i386_regnum): Add AVX512 registers. (I386_SSE_NUM_REGS): New define for number of SSE registers. (I386_AVX_NUM_REGS): Likewise for AVX registers. (I386_AVX512_NUM_REGS): Likewise for AVX512 registers. (I386_MAX_REGISTER_SIZE): Change to 64 bytes, ZMM registers are 512 bits wide. (i386_xmm_avx512_regnum_p): New prototype for register look up. (i386_ymm_avx512_regnum_p): Likewise. (i386_k_regnum_p): Likewise. (i386_zmm_regnum_p): Likewise. (i386_zmmh_regnum_p): Likewise. * i387-tdep.c : Update year in copyright notice. (xsave_ymm_avx512_offset): New table for YMM16-31 offsets in XSAVE buffer. (XSAVE_YMM_AVX512_ADDR): New macro. (xsave_xmm_avx512_offset): New table for XMM16-31 offsets in XSAVE buffer. (XSAVE_XMM_AVX512_ADDR): New macro. (xsave_avx512_k_offset): New table for K register offsets in XSAVE buffer. (XSAVE_AVX512_K_ADDR): New macro. (xsave_avx512_zmm_h_offset): New table for ZMM register offsets in XSAVE buffer. (XSAVE_AVX512_ZMM_H_ADDR): New macro. (i387_supply_xsave): Add code to supply AVX512 registers to XSAVE buffer. (i387_collect_xsave): Add code to collect AVX512 registers from XSAVE buffer. * i387-tdep.h (I387_NUM_XMM_AVX512_REGS): New define for number of XMM16-31 registers. (I387_NUM_K_REGS): New define for number of K registers. (I387_K0_REGNUM): New define for K0 register number. (I387_NUM_ZMMH_REGS): New define for number of ZMMH registers. (I387_ZMM0H_REGNUM): New define for ZMM0H register number. (I387_NUM_YMM_AVX512_REGS): New define for number of YMM16-31 registers. (I387_YMM16H_REGNUM): New define for YMM16H register number. (I387_XMM16_REGNUM): New define for XMM16 register number. (I387_YMM0_REGNUM): New define for YMM0 register number. (I387_KEND_REGNUM): New define for last K register number. (I387_ZMMENDH_REGNUM): New define for last ZMMH register number. (I387_YMMH_AVX512_END_REGNUM): New define for YMM31 register number. (I387_XMM_AVX512_END_REGNUM): New define for XMM31 register number. * common/i386-xstate.h: Add AVX 3.1 feature bits, mask and XSTATE size. * features/Makefile: Add AVX512 related files. * features/i386/32bit-avx512.xml: New file. * features/i386/64bit-avx512.xml: Likewise. * features/i386/amd64-avx512-linux.c: Likewise. * features/i386/amd64-avx512-linux.xml: Likewise. * features/i386/amd64-avx512.c: Likewise. * features/i386/amd64-avx512.xml: Likewise. * features/i386/i386-avx512-linux.c: Likewise. * features/i386/i386-avx512-linux.xml: Likewise. * features/i386/i386-avx512.c: Likewise. * features/i386/i386-avx512.xml: Likewise. * features/i386/x32-avx512-linux.c: Likewise. * features/i386/x32-avx512-linux.xml: Likewise. * features/i386/x32-avx512.c: Likewise. * features/i386/x32-avx512.xml: Likewise. * regformats/i386/amd64-avx512-linux.dat: New file. * regformats/i386/amd64-avx512.dat: Likewise. * regformats/i386/i386-avx512-linux.dat: Likewise. * regformats/i386/i386-avx512.dat: Likewise. * regformats/i386/x32-avx512-linux.dat: Likewise. * regformats/i386/x32-avx512.dat: Likewise. * NEWS: Add note about new support for AVX512. testsuite/ * Makefile.in (EXECUTABLES): Added i386-avx512. * gdb.arch/i386-avx512.c: New file. * gdb.arch/i386-avx512.exp: Likewise. gdbserver/ * Makefile.in: Added rules to handle new files i386-avx512.c i386-avx512-linux.c amd64-avx512.c amd64-avx512-linux.c x32-avx512.c x32-avx512-linux.c. * configure.srv (srv_i386_regobj): Add i386-avx512.o. (srv_i386_linux_regobj): Add i386-avx512-linux.o. (srv_amd64_regobj): Add amd64-avx512.o and x32-avx512.o. (srv_amd64_linux_regobj): Add amd64-avx512-linux.o and x32-avx512-linux.o. (srv_i386_32bit_xmlfiles): Add i386/32bit-avx512.xml. (srv_i386_64bit_xmlfiles): Add i386/64bit-avx512.xml. (srv_amd64_xmlfiles): Add i386/amd64-avx512.xml and i386/x32-avx512.xml. (srv_i386_linux_xmlfiles): Add i386/i386-avx512-linux.xml. (srv_amd64_linux_xmlfiles): Add i386/amd64-avx512-linux.xml and i386/x32-avx512-linux.xml. * i387-fp.c (num_avx512_k_registers): New constant for number of K registers. (num_avx512_zmmh_low_registers): New constant for number of lower ZMM registers (0-15). (num_avx512_zmmh_high_registers): New constant for number of higher ZMM registers (16-31). (num_avx512_ymmh_registers): New contant for number of higher YMM registers (ymm16-31 added by avx521 on x86_64). (num_avx512_xmm_registers): New constant for number of higher XMM registers (xmm16-31 added by AVX512 on x86_64). (struct i387_xsave): Add space for AVX512 registers. (i387_cache_to_xsave): Change raw buffer size to 64 characters. Add code to handle AVX512 registers. (i387_xsave_to_cache): Add code to handle AVX512 registers. * linux-x86-low.c (init_registers_amd64_avx512_linux): New prototypei from generated file. (tdesc_amd64_avx512_linux): Likewise. (init_registers_x32_avx512_linux): Likewise. (tdesc_x32_avx512_linux): Likewise. (init_registers_i386_avx512_linux): Likewise. (tdesc_i386_avx512_linux): Likewise. (x86_64_regmap): Add AVX512 registers. (x86_linux_read_description): Add code to handle AVX512 XSTATE mask. (initialize_low_arch): Add code to initialize AVX512 registers. doc/ * gdb.texinfo (i386 Features): Add description of AVX512 registers. Change-Id: Ifc4c08c76b85dbec18d02efdbe6182e851584438 Signed-off-by: Michael Sturm <michael.sturm@intel.com>
2013-12-16 16:43:05 +01:00
15 * 8 /* "orig_rax" */
};
/* Support for signal handlers. */
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
#define LINUX_SIGTRAMP_INSN0 0x48 /* mov $NNNNNNNN, %rax */
#define LINUX_SIGTRAMP_OFFSET0 0
#define LINUX_SIGTRAMP_INSN1 0x0f /* syscall */
#define LINUX_SIGTRAMP_OFFSET1 7
static const gdb_byte amd64_linux_sigtramp_code[] =
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
{
/* mov $__NR_rt_sigreturn, %rax */
LINUX_SIGTRAMP_INSN0, 0xc7, 0xc0, 0x0f, 0x00, 0x00, 0x00,
/* syscall */
LINUX_SIGTRAMP_INSN1, 0x05
};
static const gdb_byte amd64_x32_linux_sigtramp_code[] =
{
/* mov $__NR_rt_sigreturn, %rax. */
LINUX_SIGTRAMP_INSN0, 0xc7, 0xc0, 0x01, 0x02, 0x00, 0x40,
/* syscall */
LINUX_SIGTRAMP_INSN1, 0x05
};
#define LINUX_SIGTRAMP_LEN (sizeof amd64_linux_sigtramp_code)
/* If PC is in a sigtramp routine, return the address of the start of
the routine. Otherwise, return 0. */
static CORE_ADDR
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
amd64_linux_sigtramp_start (struct frame_info *this_frame)
{
struct gdbarch *gdbarch;
const gdb_byte *sigtramp_code;
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
CORE_ADDR pc = get_frame_pc (this_frame);
gdb_byte buf[LINUX_SIGTRAMP_LEN];
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
/* We only recognize a signal trampoline if PC is at the start of
one of the two instructions. We optimize for finding the PC at
the start, as will be the case when the trampoline is not the
first frame on the stack. We assume that in the case where the
PC is not at the start of the instruction sequence, there will be
a few trailing readable bytes on the stack. */
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
if (!safe_frame_unwind_memory (this_frame, pc, buf, sizeof buf))
return 0;
if (buf[0] != LINUX_SIGTRAMP_INSN0)
{
if (buf[0] != LINUX_SIGTRAMP_INSN1)
return 0;
pc -= LINUX_SIGTRAMP_OFFSET1;
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
if (!safe_frame_unwind_memory (this_frame, pc, buf, sizeof buf))
return 0;
}
gdbarch = get_frame_arch (this_frame);
if (gdbarch_ptr_bit (gdbarch) == 32)
sigtramp_code = amd64_x32_linux_sigtramp_code;
else
sigtramp_code = amd64_linux_sigtramp_code;
if (memcmp (buf, sigtramp_code, LINUX_SIGTRAMP_LEN) != 0)
return 0;
return pc;
}
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
/* Return whether THIS_FRAME corresponds to a GNU/Linux sigtramp
routine. */
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
static int
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
amd64_linux_sigtramp_p (struct frame_info *this_frame)
{
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
CORE_ADDR pc = get_frame_pc (this_frame);
* blockframe.c (find_pc_partial_function_gnu_ifunc): Change type of "name" parameter to const char ** from char **. All callers updated. (find_pc_partial_function): Ditto. (cache_pc_function_name): Change type to const char * from char *. * symtab.h ((find_pc_partial_function_gnu_ifunc): Update. (find_pc_partial_function): Update. * alpha-tdep.h (struct gdbarch_tdep, member pc_in_sigtramp): Change type of "name" parameter to const char * from char *. All uses updated. * arch-utils.c (generic_in_solib_return_trampoline): Change type of "name" parameter to const char * from char *. * arch-utils.h (generic_in_solib_return_trampoline): Update. * frv-linux-tdep.c (frv_linux_pc_in_sigtramp): Change type of "name" parameter to const char * from char *. * gdbarch.sh (in_solib_return_trampoline): Ditto. * gdbarch.c: Regenerate. * gdbarch.h: Regenerate. * hppa-hpux-tdep.c (hppa_hpux_in_solib_return_trampoline): Update. * rs6000-tdep.c (rs6000_in_solib_return_trampoline): Update. * m32r-linux-tdep.c (m32r_linux_pc_in_sigtramp): Change type of "name" parameter to const char * from char *. * skip.c (skip_function_pc): Ditto. * sparc-sol2-tdep.c (sparc_sol2_pc_in_sigtramp): Ditto. * sparc-tdep.h (sparc_sol2_pc_in_sigtramp): Update. * sparc64fbsd-tdep.c (sparc64fbsd_pc_in_sigtramp): Ditto. * sparc64nbsd-tdep.c (sparc64nbsd_pc_in_sigtramp): Ditto. * sparc64obsd-tdep.c (sparc64obsd_pc_in_sigtramp): Ditto. * sparcnbsd-tdep.c (sparc32nbsd_pc_in_sigtramp): Ditto. * sparcobsd-tdep.c (sparc32obsd_pc_in_sigtramp): Ditto. * nbsd-tdep.c (nbsd_pc_in_sigtramp): Similary for "func_name". * nbsd-tdep.h (nbsd_pc_in_sigtramp): Update.
2012-02-02 21:19:17 +01:00
const char *name;
* amd64-tdep.c (amd64_sigtramp_frame_sniffer): Rewrite to use new sigtramp_p member of `struct gdbarch_tdep'. Also check whether the program counter is in the range specified by `struct gdbarch_tdep'. * amd64-linux-tdep.c: Include "symtab.h". (amd64_linux_pc_in_sigtramp): Remove function. (amd64_linux_sigtramp_p): New function. (amd64_linux_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * amd64nbsd-tdep.c: Include "symtab.h". (amd64nbsd_sigtramp_p): New function. (amd64nbsd_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * amd64obsd-tdep.c: Include "symtab.h" and "objfiles.h". Add a few comments. (amd64obsd_pc_in_sigtramp): Remove function. (amd64obsd_sigtramp_p): New function. (amd64obsd_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * i386-tdep.h (struct gdbarch_tdep): Add sigtramp_p member. (i386bsd_pc_ins_sigtramp): Remove prototype. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Remove prototypes. * i386-tdep.c (i386_sigtramp_frame_sniffer): Rewrite to use new sigtramp_p member of `struct gdbarch_tdep'. Also check whether the program counter is in the range specified by `struct gdbarch_tdep'. (i386_pc_in_sigtramp, i386_svr4_pc_in_sigtramp): Remove functions. (i386_sigtramp_p, i386_svr4_sigtramp_p): New functions. (i386_go32_pc_in_sigtramp): Remove function. (i386_svr4_init_abi): Don't set deprecated_pc_in_sigtramp. Initialize TDEP->sigtramp_p. (i386_go32_init_abi): Initialize TDEP->sigtramp_p to NULL. (i386_gdbarch_init): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * i386-linux-tdep.c: Adjust comments. (i386_linux_pc_in_sigtramp): Remove function. (i386_linux_sigtramp_p): New function. (i386_linux_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * i386-nto-tdep.c: Update copyright year. (i386nto_pc_in_sigtramp): Remove function. (i386nto_sigtramp_p): New function. (i386nto_sigcontext_addr): Use I386_ESP_REGNUM instead of SP_REGNUM. (i386nto_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * i386-sol2-tdep.c: Update copyright year. (i386_sol2_pc_in_sigtramp): Remove function. (i386_sol2_sigtramp_p): New function. (i386_sol2_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * i386bsd-tdep.c (i386bsd_pc_in_sigtramp): Remove function. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Remove functions. (i386bsd_init_abi): Don't set deprecated_pc_in_sigtramp, deprecated_sigtramp_start and deprecated_sigtramp_end. * i386nbsd-tdep.c: Include "frame.h" and "symtab.h". (i386nbsd_pc_in_sigtramp): Remove function. (i386nbsd_sigtramp_p): New function. (i386nbsd_init_abi): Don't set deprecated_pc_in_sigtramp, deprecated_sigtramp_start, deprecated_sigtramp_end. Initialize TDEP->sigtramp_start, TDEP->sigtramp_end and TDEP->sigtramp_p. * i386obsd-tdep.c: Include "frame.h", "symtab.h" and "objfiles.h". (i386obsd_pc_in_sigtramp): Remove function. (i386obsd_sigtramp_p): New function. (i386obsd_sigtramp_start, i386obsd_sigtramp_end): Remove functions. (i386bsd_init_abi): Don't set deprecated_pc_in_sigtramp, deprecated_sigtramp_start, deprecated_sigtramp_end. Initialize TDEP->sigtramp_p. * Makefile.in (amd64-linux-tdep.o, amd64nbsd-tdep.o, amd64obsd-tdep.o, i386nbsd-tdep.o, i386obsd-tdep.o): Update dependencies.
2004-04-09 18:28:50 +02:00
find_pc_partial_function (pc, &name, NULL, NULL);
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
/* If we have NAME, we can optimize the search. The trampoline is
named __restore_rt. However, it isn't dynamically exported from
the shared C library, so the trampoline may appear to be part of
the preceding function. This should always be sigaction,
__sigaction, or __libc_sigaction (all aliases to the same
function). */
if (name == NULL || strstr (name, "sigaction") != NULL)
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
return (amd64_linux_sigtramp_start (this_frame) != 0);
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
return (strcmp ("__restore_rt", name) == 0);
}
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
/* Offset to struct sigcontext in ucontext, from <asm/ucontext.h>. */
#define AMD64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET 40
2002-10-24 03:37:40 +02:00
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
/* Assuming THIS_FRAME is a GNU/Linux sigtramp routine, return the
address of the associated sigcontext structure. */
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
static CORE_ADDR
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
amd64_linux_sigcontext_addr (struct frame_info *this_frame)
{
* defs.h (extract_signed_integer, extract_unsigned_integer, extract_long_unsigned_integer, store_signed_integer, store_unsigned_integer): Add BYTE_ORDER parameter. * findvar.c (extract_signed_integer, extract_unsigned_integer, extract_long_unsigned_integer, store_signed_integer, store_unsigned_integer): Add BYTE_ORDER parameter. Use it instead of current_gdbarch. * gdbcore.h (read_memory_integer, safe_read_memory_integer, read_memory_unsigned_integer, write_memory_signed_integer, write_memory_unsigned_integer): Add BYTE_ORDER parameter. * corefile.c (struct captured_read_memory_integer_arguments): Add BYTE_ORDER member. (safe_read_memory_integer): Add BYTE_ORDER parameter. Store it into struct captured_read_memory_integer_arguments. (do_captured_read_memory_integer): Pass it to read_memory_integer. (read_memory_integer): Add BYTE_ORDER parameter. Pass it to extract_signed_integer. (read_memory_unsigned_integer): Add BYTE_ORDER parameter. Pass it to extract_unsigned_integer. (write_memory_signed_integer): Add BYTE_ORDER parameter. Pass it to store_signed_integer. (write_memory_unsigned_integer): Add BYTE_ORDER parameter. Pass it to store_unsigned_integer. * target.h (get_target_memory_unsigned): Add BYTE_ORDER parameter. * target.c (get_target_memory_unsigned): Add BYTE_ORDER parameter. Pass it to extract_unsigned_integer. Update calls to extract_signed_integer, extract_unsigned_integer, extract_long_unsigned_integer, store_signed_integer, store_unsigned_integer, read_memory_integer, read_memory_unsigned_integer, safe_read_memory_integer, write_memory_signed_integer, write_memory_unsigned_integer, and get_target_memory_unsigned to pass byte order: * ada-lang.c (ada_value_binop): Update. * ada-valprint.c (char_at): Update. * alpha-osf1-tdep.c (alpha_osf1_sigcontext_addr): Update. * alpha-tdep.c (alpha_lds, alpha_sts, alpha_push_dummy_call, alpha_extract_return_value, alpha_read_insn, alpha_get_longjmp_target): Update. * amd64-linux-tdep.c (amd64_linux_sigcontext_addr): Update. * amd64obsd-tdep.c (amd64obsd_supply_uthread, amd64obsd_collect_uthread, amd64obsd_trapframe_cache): Update. * amd64-tdep.c (amd64_push_dummy_call, amd64_analyze_prologue, amd64_frame_cache, amd64_sigtramp_frame_cache, fixup_riprel, amd64_displaced_step_fixup): Update. * arm-linux-tdep.c (arm_linux_sigreturn_init, arm_linux_rt_sigreturn_init, arm_linux_supply_gregset): Update. * arm-tdep.c (thumb_analyze_prologue, arm_skip_prologue, arm_scan_prologue, arm_push_dummy_call, thumb_get_next_pc, arm_get_next_pc, arm_extract_return_value, arm_store_return_value, arm_return_value): Update. * arm-wince-tdep.c (arm_pe_skip_trampoline_code): Update. * auxv.c (default_auxv_parse): Update. * avr-tdep.c (avr_address_to_pointer, avr_pointer_to_address, avr_scan_prologue, avr_extract_return_value, avr_frame_prev_register, avr_push_dummy_call): Update. * bsd-uthread.c (bsd_uthread_check_magic, bsd_uthread_lookup_offset, bsd_uthread_wait, bsd_uthread_thread_alive, bsd_uthread_extra_thread_info): Update. * c-lang.c (c_printstr, print_wchar): Update. * cp-valprint.c (cp_print_class_member): Update. * cris-tdep.c (cris_sigcontext_addr, cris_sigtramp_frame_unwind_cache, cris_push_dummy_call, cris_scan_prologue, cris_store_return_value, cris_extract_return_value, find_step_target, dip_prefix, sixteen_bit_offset_branch_op, none_reg_mode_jump_op, move_mem_to_reg_movem_op, get_data_from_address): Update. * dwarf2expr.c (dwarf2_read_address, execute_stack_op): Update. * dwarf2-frame.c (execute_cfa_program): Update. * dwarf2loc.c (find_location_expression): Update. * dwarf2read.c (dwarf2_const_value): Update. * expprint.c (print_subexp_standard): Update. * findvar.c (unsigned_pointer_to_address, signed_pointer_to_address, unsigned_address_to_pointer, address_to_signed_pointer, read_var_value): Update. * frame.c (frame_unwind_register_signed, frame_unwind_register_unsigned, get_frame_memory_signed, get_frame_memory_unsigned): Update. * frame-unwind.c (frame_unwind_got_constant): Update. * frv-linux-tdep.c (frv_linux_pc_in_sigtramp, frv_linux_sigcontext_reg_addr, frv_linux_sigtramp_frame_cache): Update. * frv-tdep.c (frv_analyze_prologue, frv_skip_main_prologue, frv_extract_return_value, find_func_descr, frv_convert_from_func_ptr_addr, frv_push_dummy_call): Update. * f-valprint.c (f_val_print): Update. * gnu-v3-abi.c (gnuv3_decode_method_ptr, gnuv3_make_method_ptr): Update. * h8300-tdep.c (h8300_is_argument_spill, h8300_analyze_prologue, h8300_push_dummy_call, h8300_extract_return_value, h8300h_extract_return_value, h8300_store_return_value, h8300h_store_return_value): Update. * hppabsd-tdep.c (hppabsd_find_global_pointer): Update. * hppa-hpux-nat.c (hppa_hpux_fetch_register, hppa_hpux_store_register): Update. * hppa-hpux-tdep.c (hppa32_hpux_in_solib_call_trampoline, hppa64_hpux_in_solib_call_trampoline, hppa_hpux_in_solib_return_trampoline, hppa_hpux_skip_trampoline_code, hppa_hpux_sigtramp_frame_unwind_cache, hppa_hpux_sigtramp_unwind_sniffer, hppa32_hpux_find_global_pointer, hppa64_hpux_find_global_pointer, hppa_hpux_search_pattern, hppa32_hpux_search_dummy_call_sequence, hppa64_hpux_search_dummy_call_sequence, hppa_hpux_supply_save_state, hppa_hpux_unwind_adjust_stub): Update. * hppa-linux-tdep.c (insns_match_pattern, hppa_linux_find_global_pointer): Update. * hppa-tdep.c (hppa_in_function_epilogue_p, hppa32_push_dummy_call, hppa64_convert_code_addr_to_fptr, hppa64_push_dummy_call, skip_prologue_hard_way, hppa_frame_cache, hppa_fallback_frame_cache, hppa_pseudo_register_read, hppa_frame_prev_register_helper, hppa_match_insns): Update. * hpux-thread.c (hpux_thread_fetch_registers): Update. * i386-tdep.c (i386bsd_sigcontext_addr): Update. * i386-cygwin-tdep.c (core_process_module_section): Update. * i386-darwin-nat.c (i386_darwin_sstep_at_sigreturn, amd64_darwin_sstep_at_sigreturn): Update. * i386-darwin-tdep.c (i386_darwin_sigcontext_addr, amd64_darwin_sigcontext_addr): Likewise. * i386-linux-nat.c (i386_linux_sigcontext_addr): Update. * i386nbsd-tdep.c (i386nbsd_sigtramp_cache_init): Update. * i386-nto-tdep.c (i386nto_sigcontext_addr): Update. * i386obsd-nat.c (i386obsd_supply_pcb): Update. * i386obsd-tdep.c (i386obsd_supply_uthread, i386obsd_collect_uthread, i386obsd_trapframe_cache): Update. * i386-tdep.c (i386_displaced_step_fixup, i386_follow_jump, i386_analyze_frame_setup, i386_analyze_prologue, i386_skip_main_prologue, i386_frame_cache, i386_sigtramp_frame_cache, i386_get_longjmp_target, i386_push_dummy_call, i386_pe_skip_trampoline_code, i386_svr4_sigcontext_addr, i386_fetch_pointer_argument): Update. * i387-tdep.c (i387_supply_fsave): Update. * ia64-linux-tdep.c (ia64_linux_sigcontext_register_address): Update. * ia64-tdep.c (ia64_pseudo_register_read, ia64_pseudo_register_write, examine_prologue, ia64_frame_cache, ia64_frame_prev_register, ia64_sigtramp_frame_cache, ia64_sigtramp_frame_prev_register, ia64_access_reg, ia64_access_rse_reg, ia64_libunwind_frame_this_id, ia64_libunwind_frame_prev_register, ia64_libunwind_sigtramp_frame_this_id, ia64_libunwind_sigtramp_frame_prev_register, ia64_find_global_pointer, find_extant_func_descr, find_func_descr, ia64_convert_from_func_ptr_addr, ia64_push_dummy_call, ia64_dummy_id, ia64_unwind_pc): Update. * iq2000-tdep.c (iq2000_pointer_to_address, iq2000_address_to_pointer, iq2000_scan_prologue, iq2000_extract_return_value, iq2000_push_dummy_call): Update. * irix5nat.c (fill_gregset): Update. * jv-lang.c (evaluate_subexp_java): Update. * jv-valprint.c (java_value_print): Update. * lm32-tdep.c (lm32_analyze_prologue, lm32_push_dummy_call, lm32_extract_return_value, lm32_store_return_value): Update. * m32c-tdep.c (m32c_push_dummy_call, m32c_return_value, m32c_skip_trampoline_code, m32c_m16c_address_to_pointer, m32c_m16c_pointer_to_address): Update. * m32r-tdep.c (m32r_store_return_value, decode_prologue, m32r_skip_prologue, m32r_push_dummy_call, m32r_extract_return_value): Update. * m68hc11-tdep.c (m68hc11_pseudo_register_read, m68hc11_pseudo_register_write, m68hc11_analyze_instruction, m68hc11_push_dummy_call): Update. * m68linux-tdep.c (m68k_linux_pc_in_sigtramp, m68k_linux_get_sigtramp_info, m68k_linux_sigtramp_frame_cache): Update. * m68k-tdep.c (m68k_push_dummy_call, m68k_analyze_frame_setup, m68k_analyze_register_saves, m68k_analyze_prologue, m68k_frame_cache, m68k_get_longjmp_target): Update. * m88k-tdep.c (m88k_fetch_instruction): Update. * mep-tdep.c (mep_pseudo_cr32_read, mep_pseudo_csr_write, mep_pseudo_cr32_write, mep_get_insn, mep_push_dummy_call): Update. * mi/mi-main.c (mi_cmd_data_write_memory): Update. * mips-linux-tdep.c (mips_linux_get_longjmp_target, supply_32bit_reg, mips64_linux_get_longjmp_target, mips64_fill_gregset, mips64_fill_fpregset, mips_linux_in_dynsym_stub): Update. * mipsnbdsd-tdep.c (mipsnbsd_get_longjmp_target): Update. * mips-tdep.c (mips_fetch_instruction, fetch_mips_16, mips_eabi_push_dummy_call, mips_n32n64_push_dummy_call, mips_o32_push_dummy_call, mips_o64_push_dummy_call, mips_single_step_through_delay, mips_skip_pic_trampoline_code, mips_integer_to_address): Update. * mn10300-tdep.c (mn10300_analyze_prologue, mn10300_push_dummy_call): Update. * monitor.c (monitor_supply_register, monitor_write_memory, monitor_read_memory_single): Update. * moxie-tdep.c (moxie_store_return_value, moxie_extract_return_value, moxie_analyze_prologue): Update. * mt-tdep.c (mt_return_value, mt_skip_prologue, mt_select_coprocessor, mt_pseudo_register_read, mt_pseudo_register_write, mt_registers_info, mt_push_dummy_call): Update. * objc-lang.c (read_objc_method, read_objc_methlist_nmethods, read_objc_methlist_method, read_objc_object, read_objc_super, read_objc_class, find_implementation_from_class): Update. * ppc64-linux-tdep.c (ppc64_desc_entry_point, ppc64_linux_convert_from_func_ptr_addr, ppc_linux_sigtramp_cache): Update. * ppcobsd-tdep.c (ppcobsd_sigtramp_frame_sniffer, ppcobsd_sigtramp_frame_cache): Update. * ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call, do_ppc_sysv_return_value, ppc64_sysv_abi_push_dummy_call, ppc64_sysv_abi_return_value): Update. * ppc-linux-nat.c (ppc_linux_auxv_parse): Update. * procfs.c (procfs_auxv_parse): Update. * p-valprint.c (pascal_val_print): Update. * regcache.c (regcache_raw_read_signed, regcache_raw_read_unsigned, regcache_raw_write_signed, regcache_raw_write_unsigned, regcache_cooked_read_signed, regcache_cooked_read_unsigned, regcache_cooked_write_signed, regcache_cooked_write_unsigned): Update. * remote-m32r-sdi.c (m32r_fetch_register): Update. * remote-mips.c (mips_wait, mips_fetch_registers, mips_xfer_memory): Update. * rs6000-aix-tdep.c (rs6000_push_dummy_call, rs6000_return_value, rs6000_convert_from_func_ptr_addr, branch_dest, rs6000_software_single_step): Update. * rs6000-tdep.c (rs6000_in_function_epilogue_p, ppc_displaced_step_fixup, ppc_deal_with_atomic_sequence, bl_to_blrl_insn_p, rs6000_fetch_instruction, skip_prologue, rs6000_skip_main_prologue, rs6000_skip_trampoline_code, rs6000_frame_cache): Update. * s390-tdep.c (s390_pseudo_register_read, s390_pseudo_register_write, s390x_pseudo_register_read, s390x_pseudo_register_write, s390_load, s390_backchain_frame_unwind_cache, s390_sigtramp_frame_unwind_cache, extend_simple_arg, s390_push_dummy_call, s390_return_value): Update. * scm-exp.c (scm_lreadr): Update. * scm-lang.c (scm_get_field, scm_unpack): Update. * scm-valprint.c (scm_val_print): Update. * score-tdep.c (score_breakpoint_from_pc, score_push_dummy_call, score_fetch_inst): Update. * sh64-tdep.c (look_for_args_moves, sh64_skip_prologue_hard_way, sh64_analyze_prologue, sh64_push_dummy_call, sh64_extract_return_value, sh64_pseudo_register_read, sh64_pseudo_register_write, sh64_frame_prev_register): Update: * sh-tdep.c (sh_analyze_prologue, sh_push_dummy_call_fpu, sh_push_dummy_call_nofpu, sh_extract_return_value_nofpu, sh_store_return_value_nofpu, sh_in_function_epilogue_p): Update. * solib-darwin.c (darwin_load_image_infos): Update. * solib-frv.c (fetch_loadmap, lm_base, frv_current_sos, enable_break2, find_canonical_descriptor_in_load_object): Update. * solib-irix.c (extract_mips_address, fetch_lm_info, irix_current_sos, irix_open_symbol_file_object): Update. * solib-som.c (som_solib_create_inferior_hook, link_map_start, som_current_sos, som_open_symbol_file_object): Update. * solib-sunos.c (SOLIB_EXTRACT_ADDRESS, LM_ADDR, LM_NEXT, LM_NAME): Update. * solib-svr4.c (read_program_header, scan_dyntag_auxv, solib_svr4_r_ldsomap): Update. * sparc64-linux-tdep.c (sparc64_linux_step_trap): Update. * sparc64obsd-tdep.c (sparc64obsd_supply_uthread, sparc64obsd_collect_uthread): Update. * sparc64-tdep.c (sparc64_pseudo_register_read, sparc64_pseudo_register_write, sparc64_supply_gregset, sparc64_collect_gregset): Update. * sparc-linux-tdep.c (sparc32_linux_step_trap): Update. * sparcobsd-tdep.c (sparc32obsd_supply_uthread, sparc32obsd_collect_uthread): Update. * sparc-tdep.c (sparc_fetch_wcookie, sparc32_push_dummy_code, sparc32_store_arguments, sparc32_return_value, sparc_supply_rwindow, sparc_collect_rwindow): Update. * spu-linux-nat.c (parse_spufs_run): Update. * spu-tdep.c (spu_pseudo_register_read_spu, spu_pseudo_register_write_spu, spu_pointer_to_address, spu_analyze_prologue, spu_in_function_epilogue_p, spu_frame_unwind_cache, spu_push_dummy_call, spu_software_single_step, spu_get_longjmp_target, spu_get_overlay_table, spu_overlay_update_osect, info_spu_signal_command, info_spu_mailbox_list, info_spu_dma_cmdlist, info_spu_dma_command, info_spu_proxydma_command): Update. * stack.c (print_frame_nameless_args, frame_info): Update. * symfile.c (read_target_long_array, simple_read_overlay_table, simple_read_overlay_region_table): Update. * target.c (debug_print_register): Update. * tramp-frame.c (tramp_frame_start): Update. * v850-tdep.c (v850_analyze_prologue, v850_push_dummy_call, v850_extract_return_value, v850_store_return_value, * valarith.c (value_binop, value_bit_index): Update. * valops.c (value_cast): Update. * valprint.c (val_print_type_code_int, val_print_string, read_string): Update. * value.c (unpack_long, unpack_double, unpack_field_as_long, modify_field, pack_long): Update. * vax-tdep.c (vax_store_arguments, vax_push_dummy_call, vax_skip_prologue): Update. * xstormy16-tdep.c (xstormy16_push_dummy_call, xstormy16_analyze_prologue, xstormy16_in_function_epilogue_p, xstormy16_resolve_jmp_table_entry, xstormy16_find_jmp_table_entry, xstormy16_pointer_to_address, xstormy16_address_to_pointer): Update. * xtensa-tdep.c (extract_call_winsize, xtensa_pseudo_register_read, xtensa_pseudo_register_write, xtensa_frame_cache, xtensa_push_dummy_call, call0_track_op, call0_frame_cache): Update. * dfp.h (decimal_to_string, decimal_from_string, decimal_from_integral, decimal_from_floating, decimal_to_doublest, decimal_is_zero): Add BYTE_ORDER parameter. (decimal_binop): Add BYTE_ORDER_X, BYTE_ORDER_Y, and BYTE_ORDER_RESULT parameters. (decimal_compare): Add BYTE_ORDER_X and BYTE_ORDER_Y parameters. (decimal_convert): Add BYTE_ORDER_FROM and BYTE_ORDER_TO parameters. * dfp.c (match_endianness): Add BYTE_ORDER parameter. Use it instead of current_gdbarch. (decimal_to_string, decimal_from_integral, decimal_from_floating, decimal_to_doublest, decimal_is_zero): Add BYTE_ORDER parameter. Pass it to match_endianness. (decimal_binop): Add BYTE_ORDER_X, BYTE_ORDER_Y, and BYTE_ORDER_RESULT parameters. Pass them to match_endianness. (decimal_compare): Add BYTE_ORDER_X and BYTE_ORDER_Y parameters. Pass them to match_endianness. (decimal_convert): Add BYTE_ORDER_FROM and BYTE_ORDER_TO parameters. Pass them to match_endianness. * valarith.c (value_args_as_decimal): Add BYTE_ORDER_X and BYTE_ORDER_Y output parameters. (value_binop): Update call to value_args_as_decimal. Update calls to decimal_to_string, decimal_from_string, decimal_from_integral, decimal_from_floating, decimal_to_doublest, decimal_is_zero, decimal_binop, decimal_compare and decimal_convert to pass/receive byte order: * c-exp.y (parse_number): Update. * printcmd.c (printf_command): Update. * valarith.c (value_args_as_decimal, value_binop, value_logical_not, value_equal, value_less): Update. * valops.c (value_cast, value_one): Update. * valprint.c (print_decimal_floating): Update. * value.c (unpack_long, unpack_double): Update. * python/python-value.c (valpy_nonzero): Update. * ada-valprint.c (char_at): Add BYTE_ORDER parameter. (printstr): Update calls to char_at. (ada_val_print_array): Likewise. * valprint.c (read_string): Add BYTE_ORDER parameter. (val_print_string): Update call to read_string. * c-lang.c (c_get_string): Likewise. * charset.h (target_wide_charset): Add BYTE_ORDER parameter. * charset.c (target_wide_charset): Add BYTE_ORDER parameter. Use it instead of current_gdbarch. * printcmd.c (printf_command): Update calls to target_wide_charset. * c-lang.c (charset_for_string_type): Add BYTE_ORDER parameter. Pass to target_wide_charset. Use it instead of current_gdbarch. (classify_type): Add BYTE_ORDER parameter. Pass to charset_for_string_type. Allow NULL encoding pointer. (print_wchar): Add BYTE_ORDER parameter. (c_emit_char): Update calls to classify_type and print_wchar. (c_printchar, c_printstr): Likewise. * gdbarch.sh (in_solib_return_trampoline): Convert to type "m". * gdbarch.c, gdbarch.h: Regenerate. * arch-utils.h (generic_in_solib_return_trampoline): Add GDBARCH parameter. * arch-utils.c (generic_in_solib_return_trampoline): Likewise. * hppa-hpux-tdep.c (hppa_hpux_in_solib_return_trampoline): Likewise. * rs6000-tdep.c (rs6000_in_solib_return_trampoline): Likewise. (rs6000_skip_trampoline_code): Update call. * alpha-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to dynamic_sigtramp_offset and pc_in_sigtramp callbacks. (alpha_read_insn): Add GDBARCH parameter. * alpha-tdep.c (alpha_lds, alpha_sts): Add GDBARCH parameter. (alpha_register_to_value): Pass architecture to alpha_sts. (alpha_extract_return_value): Likewise. (alpha_value_to_register): Pass architecture to alpha_lds. (alpha_store_return_value): Likewise. (alpha_read_insn): Add GDBARCH parameter. (alpha_skip_prologue): Pass architecture to alpha_read_insn. (alpha_heuristic_proc_start): Likewise. (alpha_heuristic_frame_unwind_cache): Likewise. (alpha_next_pc): Likewise. (alpha_sigtramp_frame_this_id): Pass architecture to tdep->dynamic_sigtramp_offset callback. (alpha_sigtramp_frame_sniffer): Pass architecture to tdep->pc_in_sigtramp callback. * alphafbsd-tdep.c (alphafbsd_pc_in_sigtramp): Add GDBARCH parameter. (alphafbsd_sigtramp_offset): Likewise. * alpha-linux-tdep.c (alpha_linux_sigtramp_offset_1): Add GDBARCH parameter. Pass to alpha_read_insn. (alpha_linux_sigtramp_offset): Add GDBARCH parameter. Pass to alpha_linux_sigtramp_offset_1. (alpha_linux_pc_in_sigtramp): Add GDBARCH parameter. Pass to alpha_linux_sigtramp_offset. (alpha_linux_sigcontext_addr): Pass architecture to alpha_read_insn and alpha_linux_sigtramp_offset. * alphanbsd-tdep.c (alphanbsd_sigtramp_offset): Add GDBARCH parameter. (alphanbsd_pc_in_sigtramp): Add GDBARCH parameter. Pass to alphanbsd_sigtramp_offset. * alphaobsd-tdep.c (alphaobsd_sigtramp_offset): Add GDBARCH parameter. (alphaobsd_pc_in_sigtramp): Add GDBARCH parameter. Pass to alpha_read_insn. (alphaobsd_sigcontext_addr): Pass architecture to alphaobsd_sigtramp_offset. * alpha-osf1-tdep.c (alpha_osf1_pc_in_sigtramp): Add GDBARCH parameter. * amd64-tdep.c (amd64_analyze_prologue): Add GDBARCH parameter. (amd64_skip_prologue): Pass architecture to amd64_analyze_prologue. (amd64_frame_cache): Likewise. * arm-tdep.c (SWAP_SHORT, SWAP_INT): Remove. (thumb_analyze_prologue, arm_skip_prologue, arm_scan_prologue, thumb_get_next_pc, arm_get_next_pc): Do not use SWAP_ macros. * arm-wince-tdep.c: Include "frame.h". * avr-tdep.c (EXTRACT_INSN): Remove. (avr_scan_prologue): Add GDBARCH argument, inline EXTRACT_INSN. (avr_skip_prologue): Pass architecture to avr_scan_prologue. (avr_frame_unwind_cache): Likewise. * cris-tdep.c (struct instruction_environment): Add BYTE_ORDER member. (find_step_target): Initialize it. (get_data_from_address): Add BYTE_ORDER parameter. (bdap_prefix): Pass byte order to get_data_from_address. (handle_prefix_assign_mode_for_aritm_op): Likewise. (three_operand_add_sub_cmp_and_or_op): Likewise. (handle_inc_and_index_mode_for_aritm_op): Likewise. * frv-linux-tdep.c (frv_linux_pc_in_sigtramp): Add GDBARCH parameter. (frv_linux_sigcontext_reg_addr): Pass architecture to frv_linux_pc_in_sigtramp. (frv_linux_sigtramp_frame_sniffer): Likewise. * h8300-tdep.c (h8300_is_argument_spill): Add GDBARCH parameter. (h8300_analyze_prologue): Add GDBARCH parameter. Pass to h8300_is_argument_spill. (h8300_frame_cache, h8300_skip_prologue): Pass architecture to h8300_analyze_prologue. * hppa-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to in_solib_call_trampoline callback. (hppa_in_solib_call_trampoline): Add GDBARCH parameter. * hppa-tdep.c (hppa64_convert_code_addr_to_fptr): Add GDBARCH parameter. (hppa64_push_dummy_call): Pass architecture to hppa64_convert_code_addr_to_fptr. (hppa_match_insns): Add GDBARCH parameter. (hppa_match_insns_relaxed): Add GDBARCH parameter. Pass to hppa_match_insns. (hppa_skip_trampoline_code): Pass architecture to hppa_match_insns. (hppa_in_solib_call_trampoline): Add GDBARCH parameter. Pass to hppa_match_insns_relaxed. (hppa_stub_unwind_sniffer): Pass architecture to tdep->in_solib_call_trampoline callback. * hppa-hpux-tdep.c (hppa_hpux_search_pattern): Add GDBARCH parameter. (hppa32_hpux_search_dummy_call_sequence): Pass architecture to hppa_hpux_search_pattern. * hppa-linux-tdep.c (insns_match_pattern): Add GDBARCH parameter. (hppa_linux_sigtramp_find_sigcontext): Add GDBARCH parameter. Pass to insns_match_pattern. (hppa_linux_sigtramp_frame_unwind_cache): Pass architecture to hppa_linux_sigtramp_find_sigcontext. (hppa_linux_sigtramp_frame_sniffer): Likewise. (hppa32_hpux_in_solib_call_trampoline): Add GDBARCH parameter. (hppa64_hpux_in_solib_call_trampoline): Likewise. * i386-tdep.c (i386_follow_jump): Add GDBARCH parameter. (i386_analyze_frame_setup): Add GDBARCH parameter. (i386_analyze_prologue): Add GDBARCH parameter. Pass to i386_follow_jump and i386_analyze_frame_setup. (i386_skip_prologue): Pass architecture to i386_analyze_prologue and i386_follow_jump. (i386_frame_cache): Pass architecture to i386_analyze_prologue. (i386_pe_skip_trampoline_code): Add FRAME parameter. * i386-tdep.h (i386_pe_skip_trampoline_code): Add FRAME parameter. * i386-cygwin-tdep.c (i386_cygwin_skip_trampoline_code): Pass frame to i386_pe_skip_trampoline_code. * ia64-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to sigcontext_register_address callback. * ia64-tdep.c (ia64_find_global_pointer): Add GDBARCH parameter. (ia64_find_unwind_table): Pass architecture to ia64_find_global_pointer. (find_extant_func_descr): Add GDBARCH parameter. (find_func_descr): Pass architecture to find_extant_func_descr and ia64_find_global_pointer. (ia64_sigtramp_frame_init_saved_regs): Pass architecture to tdep->sigcontext_register_address callback. * ia64-linux-tdep.c (ia64_linux_sigcontext_register_address): Add GDBARCH parameter. * iq2000-tdep.c (iq2000_scan_prologue): Add GDBARCH parameter. (iq2000_frame_cache): Pass architecture to iq2000_scan_prologue. * lm32-tdep.c (lm32_analyze_prologue): Add GDBARCH parameter. (lm32_skip_prologue, lm32_frame_cache): Pass architecture to lm32_analyze_prologue. * m32r-tdep.c (decode_prologue): Add GDBARCH parameter. (m32r_skip_prologue): Pass architecture to decode_prologue. * m68hc11-tdep.c (m68hc11_analyze_instruction): Add GDBARCH parameter. (m68hc11_scan_prologue): Pass architecture to m68hc11_analyze_instruction. * m68k-tdep.c (m68k_analyze_frame_setup): Add GDBARCH parameter. (m68k_analyze_prologue): Pass architecture to m68k_analyze_frame_setup. * m88k-tdep.c (m88k_fetch_instruction): Add BYTE_ORDER parameter. (m88k_analyze_prologue): Add GDBARCH parameter. Pass byte order to m88k_fetch_instruction. (m88k_skip_prologue): Pass architecture to m88k_analyze_prologue. (m88k_frame_cache): Likewise. * mep-tdep.c (mep_get_insn): Add GDBARCH parameter. (mep_analyze_prologue): Pass architecture to mep_get_insn. * mips-tdep.c (mips_fetch_instruction): Add GDBARCH parameter. (mips32_next_pc): Pass architecture to mips_fetch_instruction. (deal_with_atomic_sequence): Likewise. (unpack_mips16): Add GDBARCH parameter, pass to mips_fetch_instruction. (mips16_scan_prologue): Likewise. (mips32_scan_prologue): Likewise. (mips16_in_function_epilogue_p): Likewise. (mips32_in_function_epilogue_p): Likewise. (mips_about_to_return): Likewise. (mips_insn16_frame_cache): Pass architecture to mips16_scan_prologue. (mips_insn32_frame_cache): Pass architecture to mips32_scan_prologue. (mips_skip_prologue): Pass architecture to mips16_scan_prologue and mips32_scan_prologue. (mips_in_function_epilogue_p): Pass architecture to mips16_in_function_epilogue_p and mips32_in_function_epilogue_p. (heuristic_proc_start): Pass architecture to mips_fetch_instruction and mips_about_to_return. (mips_skip_mips16_trampoline_code): Pass architecture to mips_fetch_instruction. (fetch_mips_16): Add GDBARCH parameter. (mips16_next_pc): Pass architecture to fetch_mips_16. (extended_mips16_next_pc): Pass architecture to unpack_mips16 and fetch_mips_16. * objc-lang.c (read_objc_method, read_objc_methlist_nmethods, read_objc_methlist_method, read_objc_object, read_objc_super, read_objc_class): Add GDBARCH parameter. (find_implementation_from_class): Add GDBARCH parameter, pass to read_objc_class, read_objc_methlist_nmethods, and read_objc_methlist_method. (find_implementation): Add GDBARCH parameter, pass to read_objc_object and find_implementation_from_class. (resolve_msgsend, resolve_msgsend_stret): Pass architecture to find_implementation. (resolve_msgsend_super, resolve_msgsend_super_stret): Pass architecture to read_objc_super and find_implementation_from_class. * ppc64-linux-tdep.c (ppc64_desc_entry_point): Add GDBARCH parameter. (ppc64_standard_linkage1_target, ppc64_standard_linkage2_target, ppc64_standard_linkage3_target): Pass architecture to ppc64_desc_entry_point. * rs6000-tdep.c (bl_to_blrl_insn_p): Add BYTE_ORDER parameter. (skip_prologue): Pass byte order to bl_to_blrl_insn_p. (rs6000_fetch_instruction): Add GDBARCH parameter. (rs6000_skip_stack_check): Add GDBARCH parameter, pass to rs6000_fetch_instruction. (skip_prologue): Pass architecture to rs6000_fetch_instruction. * remote-mips.c (mips_store_word): Return old_contents as host integer value instead of target bytes. * s390-tdep.c (struct s390_prologue_data): Add BYTE_ORDER member. (s390_analyze_prologue): Initialize it. (extend_simple_arg): Add GDBARCH parameter. (s390_push_dummy_call): Pass architecture to extend_simple_arg. * scm-lang.c (scm_get_field): Add BYTE_ORDER parameter. * scm-lang.h (scm_get_field): Add BYTE_ORDER parameter. (SCM_CAR, SCM_CDR): Pass SCM_BYTE_ORDER to scm_get_field. * scm-valprint.c (scm_scmval_print): Likewise. (scm_scmlist_print, scm_ipruk, scm_scmval_print): Define SCM_BYTE_ORDER. * sh64-tdep.c (look_for_args_moves): Add GDBARCH parameter. (sh64_skip_prologue_hard_way): Add GDBARCH parameter, pass to look_for_args_moves. (sh64_skip_prologue): Pass architecture to sh64_skip_prologue_hard_way. * sh-tdep.c (sh_analyze_prologue): Add GDBARCH parameter. (sh_skip_prologue): Pass architecture to sh_analyze_prologue. (sh_frame_cache): Likewise. * solib-irix.c (extract_mips_address): Add GDBARCH parameter. (fetch_lm_info, irix_current_sos, irix_open_symbol_file_object): Pass architecture to extract_mips_address. * sparc-tdep.h (sparc_fetch_wcookie): Add GDBARCH parameter. * sparc-tdep.c (sparc_fetch_wcookie): Add GDBARCH parameter. (sparc_supply_rwindow, sparc_collect_rwindow): Pass architecture to sparc_fetch_wcookie. (sparc32_frame_prev_register): Likewise. * sparc64-tdep.c (sparc64_frame_prev_register): Likewise. * sparc32nbsd-tdep.c (sparc32nbsd_sigcontext_saved_regs): Likewise. * sparc64nbsd-tdep.c (sparc64nbsd_sigcontext_saved_regs): Likewise. * spu-tdep.c (spu_analyze_prologue): Add GDBARCH parameter. (spu_skip_prologue): Pass architecture to spu_analyze_prologue. (spu_virtual_frame_pointer): Likewise. (spu_frame_unwind_cache): Likewise. (info_spu_mailbox_list): Add BYTE_ORER parameter. (info_spu_mailbox_command): Pass byte order to info_spu_mailbox_list. (info_spu_dma_cmdlist): Add BYTE_ORER parameter. (info_spu_dma_command, info_spu_proxydma_command): Pass byte order to info_spu_dma_cmdlist. * symfile.c (read_target_long_array): Add GDBARCH parameter. (simple_read_overlay_table, simple_read_overlay_region_table, simple_overlay_update_1): Pass architecture to read_target_long_array. * v850-tdep.c (v850_analyze_prologue): Add GDBARCH parameter. (v850_frame_cache): Pass architecture to v850_analyze_prologue. * xstormy16-tdep.c (xstormy16_analyze_prologue): Add GDBARCH parameter. (xstormy16_skip_prologue, xstormy16_frame_cache): Pass architecture to xstormy16_analyze_prologue. (xstormy16_resolve_jmp_table_entry): Add GDBARCH parameter. (xstormy16_find_jmp_table_entry): Likewise. (xstormy16_skip_trampoline_code): Pass architecture to xstormy16_resolve_jmp_table_entry. (xstormy16_pointer_to_address): Likewise. (xstormy16_address_to_pointer): Pass architecture to xstormy16_find_jmp_table_entry. * xtensa-tdep.c (call0_track_op): Add GDBARCH parameter. (call0_analyze_prologue): Add GDBARCH parameter, pass to call0_track_op. (call0_frame_cache): Pass architecture to call0_analyze_prologue. (xtensa_skip_prologue): Likewise.
2009-07-02 19:25:59 +02:00
struct gdbarch *gdbarch = get_frame_arch (this_frame);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
CORE_ADDR sp;
gdb_byte buf[8];
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
Update i386 and amd64 ports for unwinder changes. * amd64-tdep.c (amd64_frame_cache): Expect this_frame. (amd64_frame_this_id, amd64_frame_prev_register): Update signature. (amd64_frame_unwind): Use default_frame_sniffer. (amd64_frame_sniffer): Delete. (amd64_sigtramp_frame_cache): Expect this_frame. (amd64_sigtramp_frame_this_id, amd64_sigtramp_frame_prev_register) (amd64_sigtramp_frame_sniffer): Update signature. (amd64_sigtramp_frame_unwind): Add amd64_sigtramp_frame_sniffer. (amd64_frame_base_address): Expect this_frame. (amd64_dummy_id): Renamed from amd64_unwind_dummy_id. Expect this_frame. (amd64_init_abi): Use set_gdbarch_dummy_id and frame_unwind_append_unwinder. * i386-tdep.c (i386_frame_cache): Expect this_frame. (i386_frame_this_id, i386_frame_prev_register): Update signature. (i386_frame_unwind): Use default_frame_sniffer. (i386_frame_sniffer): Delete. (i386_sigtramp_frame_cache): Expect this_frame. (i386_sigtramp_frame_this_id, i386_sigtramp_frame_prev_register) (i386_sigtramp_frame_sniffer): Update signature. (i386_sigtramp_frame_unwind): Use i386_sigtramp_frame_sniffer. (i386_frame_base_address): Update signature. (i386_dummy_id): Rename from i386_unwind_dummy_id. Expect this_frame. (i386_push_dummy_call): Update comment. (i386_sigtramp_p, i386_svr4_sigtramp_p, i386_svr4_sigcontext_addr): Expect this_frame. (i386_gdbarch_init): Use set_gdbarch_dummy_id, dwarf2_append_unwinders, and frame_unwind_append_unwinder. * amd64-linux-tdep.c, amd64-sol2-tdep.c, amd64fbsd-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, i386-linux-tdep.c, i386-nto-tdep.c, i386bsd-tdep.c, i386-sol2-tdep.c, i386obsd-tdep.c, i386nbsd-tdep.c: Update for unwinder changes.
2008-04-30 23:19:45 +02:00
get_frame_register (this_frame, AMD64_RSP_REGNUM, buf);
* defs.h (extract_signed_integer, extract_unsigned_integer, extract_long_unsigned_integer, store_signed_integer, store_unsigned_integer): Add BYTE_ORDER parameter. * findvar.c (extract_signed_integer, extract_unsigned_integer, extract_long_unsigned_integer, store_signed_integer, store_unsigned_integer): Add BYTE_ORDER parameter. Use it instead of current_gdbarch. * gdbcore.h (read_memory_integer, safe_read_memory_integer, read_memory_unsigned_integer, write_memory_signed_integer, write_memory_unsigned_integer): Add BYTE_ORDER parameter. * corefile.c (struct captured_read_memory_integer_arguments): Add BYTE_ORDER member. (safe_read_memory_integer): Add BYTE_ORDER parameter. Store it into struct captured_read_memory_integer_arguments. (do_captured_read_memory_integer): Pass it to read_memory_integer. (read_memory_integer): Add BYTE_ORDER parameter. Pass it to extract_signed_integer. (read_memory_unsigned_integer): Add BYTE_ORDER parameter. Pass it to extract_unsigned_integer. (write_memory_signed_integer): Add BYTE_ORDER parameter. Pass it to store_signed_integer. (write_memory_unsigned_integer): Add BYTE_ORDER parameter. Pass it to store_unsigned_integer. * target.h (get_target_memory_unsigned): Add BYTE_ORDER parameter. * target.c (get_target_memory_unsigned): Add BYTE_ORDER parameter. Pass it to extract_unsigned_integer. Update calls to extract_signed_integer, extract_unsigned_integer, extract_long_unsigned_integer, store_signed_integer, store_unsigned_integer, read_memory_integer, read_memory_unsigned_integer, safe_read_memory_integer, write_memory_signed_integer, write_memory_unsigned_integer, and get_target_memory_unsigned to pass byte order: * ada-lang.c (ada_value_binop): Update. * ada-valprint.c (char_at): Update. * alpha-osf1-tdep.c (alpha_osf1_sigcontext_addr): Update. * alpha-tdep.c (alpha_lds, alpha_sts, alpha_push_dummy_call, alpha_extract_return_value, alpha_read_insn, alpha_get_longjmp_target): Update. * amd64-linux-tdep.c (amd64_linux_sigcontext_addr): Update. * amd64obsd-tdep.c (amd64obsd_supply_uthread, amd64obsd_collect_uthread, amd64obsd_trapframe_cache): Update. * amd64-tdep.c (amd64_push_dummy_call, amd64_analyze_prologue, amd64_frame_cache, amd64_sigtramp_frame_cache, fixup_riprel, amd64_displaced_step_fixup): Update. * arm-linux-tdep.c (arm_linux_sigreturn_init, arm_linux_rt_sigreturn_init, arm_linux_supply_gregset): Update. * arm-tdep.c (thumb_analyze_prologue, arm_skip_prologue, arm_scan_prologue, arm_push_dummy_call, thumb_get_next_pc, arm_get_next_pc, arm_extract_return_value, arm_store_return_value, arm_return_value): Update. * arm-wince-tdep.c (arm_pe_skip_trampoline_code): Update. * auxv.c (default_auxv_parse): Update. * avr-tdep.c (avr_address_to_pointer, avr_pointer_to_address, avr_scan_prologue, avr_extract_return_value, avr_frame_prev_register, avr_push_dummy_call): Update. * bsd-uthread.c (bsd_uthread_check_magic, bsd_uthread_lookup_offset, bsd_uthread_wait, bsd_uthread_thread_alive, bsd_uthread_extra_thread_info): Update. * c-lang.c (c_printstr, print_wchar): Update. * cp-valprint.c (cp_print_class_member): Update. * cris-tdep.c (cris_sigcontext_addr, cris_sigtramp_frame_unwind_cache, cris_push_dummy_call, cris_scan_prologue, cris_store_return_value, cris_extract_return_value, find_step_target, dip_prefix, sixteen_bit_offset_branch_op, none_reg_mode_jump_op, move_mem_to_reg_movem_op, get_data_from_address): Update. * dwarf2expr.c (dwarf2_read_address, execute_stack_op): Update. * dwarf2-frame.c (execute_cfa_program): Update. * dwarf2loc.c (find_location_expression): Update. * dwarf2read.c (dwarf2_const_value): Update. * expprint.c (print_subexp_standard): Update. * findvar.c (unsigned_pointer_to_address, signed_pointer_to_address, unsigned_address_to_pointer, address_to_signed_pointer, read_var_value): Update. * frame.c (frame_unwind_register_signed, frame_unwind_register_unsigned, get_frame_memory_signed, get_frame_memory_unsigned): Update. * frame-unwind.c (frame_unwind_got_constant): Update. * frv-linux-tdep.c (frv_linux_pc_in_sigtramp, frv_linux_sigcontext_reg_addr, frv_linux_sigtramp_frame_cache): Update. * frv-tdep.c (frv_analyze_prologue, frv_skip_main_prologue, frv_extract_return_value, find_func_descr, frv_convert_from_func_ptr_addr, frv_push_dummy_call): Update. * f-valprint.c (f_val_print): Update. * gnu-v3-abi.c (gnuv3_decode_method_ptr, gnuv3_make_method_ptr): Update. * h8300-tdep.c (h8300_is_argument_spill, h8300_analyze_prologue, h8300_push_dummy_call, h8300_extract_return_value, h8300h_extract_return_value, h8300_store_return_value, h8300h_store_return_value): Update. * hppabsd-tdep.c (hppabsd_find_global_pointer): Update. * hppa-hpux-nat.c (hppa_hpux_fetch_register, hppa_hpux_store_register): Update. * hppa-hpux-tdep.c (hppa32_hpux_in_solib_call_trampoline, hppa64_hpux_in_solib_call_trampoline, hppa_hpux_in_solib_return_trampoline, hppa_hpux_skip_trampoline_code, hppa_hpux_sigtramp_frame_unwind_cache, hppa_hpux_sigtramp_unwind_sniffer, hppa32_hpux_find_global_pointer, hppa64_hpux_find_global_pointer, hppa_hpux_search_pattern, hppa32_hpux_search_dummy_call_sequence, hppa64_hpux_search_dummy_call_sequence, hppa_hpux_supply_save_state, hppa_hpux_unwind_adjust_stub): Update. * hppa-linux-tdep.c (insns_match_pattern, hppa_linux_find_global_pointer): Update. * hppa-tdep.c (hppa_in_function_epilogue_p, hppa32_push_dummy_call, hppa64_convert_code_addr_to_fptr, hppa64_push_dummy_call, skip_prologue_hard_way, hppa_frame_cache, hppa_fallback_frame_cache, hppa_pseudo_register_read, hppa_frame_prev_register_helper, hppa_match_insns): Update. * hpux-thread.c (hpux_thread_fetch_registers): Update. * i386-tdep.c (i386bsd_sigcontext_addr): Update. * i386-cygwin-tdep.c (core_process_module_section): Update. * i386-darwin-nat.c (i386_darwin_sstep_at_sigreturn, amd64_darwin_sstep_at_sigreturn): Update. * i386-darwin-tdep.c (i386_darwin_sigcontext_addr, amd64_darwin_sigcontext_addr): Likewise. * i386-linux-nat.c (i386_linux_sigcontext_addr): Update. * i386nbsd-tdep.c (i386nbsd_sigtramp_cache_init): Update. * i386-nto-tdep.c (i386nto_sigcontext_addr): Update. * i386obsd-nat.c (i386obsd_supply_pcb): Update. * i386obsd-tdep.c (i386obsd_supply_uthread, i386obsd_collect_uthread, i386obsd_trapframe_cache): Update. * i386-tdep.c (i386_displaced_step_fixup, i386_follow_jump, i386_analyze_frame_setup, i386_analyze_prologue, i386_skip_main_prologue, i386_frame_cache, i386_sigtramp_frame_cache, i386_get_longjmp_target, i386_push_dummy_call, i386_pe_skip_trampoline_code, i386_svr4_sigcontext_addr, i386_fetch_pointer_argument): Update. * i387-tdep.c (i387_supply_fsave): Update. * ia64-linux-tdep.c (ia64_linux_sigcontext_register_address): Update. * ia64-tdep.c (ia64_pseudo_register_read, ia64_pseudo_register_write, examine_prologue, ia64_frame_cache, ia64_frame_prev_register, ia64_sigtramp_frame_cache, ia64_sigtramp_frame_prev_register, ia64_access_reg, ia64_access_rse_reg, ia64_libunwind_frame_this_id, ia64_libunwind_frame_prev_register, ia64_libunwind_sigtramp_frame_this_id, ia64_libunwind_sigtramp_frame_prev_register, ia64_find_global_pointer, find_extant_func_descr, find_func_descr, ia64_convert_from_func_ptr_addr, ia64_push_dummy_call, ia64_dummy_id, ia64_unwind_pc): Update. * iq2000-tdep.c (iq2000_pointer_to_address, iq2000_address_to_pointer, iq2000_scan_prologue, iq2000_extract_return_value, iq2000_push_dummy_call): Update. * irix5nat.c (fill_gregset): Update. * jv-lang.c (evaluate_subexp_java): Update. * jv-valprint.c (java_value_print): Update. * lm32-tdep.c (lm32_analyze_prologue, lm32_push_dummy_call, lm32_extract_return_value, lm32_store_return_value): Update. * m32c-tdep.c (m32c_push_dummy_call, m32c_return_value, m32c_skip_trampoline_code, m32c_m16c_address_to_pointer, m32c_m16c_pointer_to_address): Update. * m32r-tdep.c (m32r_store_return_value, decode_prologue, m32r_skip_prologue, m32r_push_dummy_call, m32r_extract_return_value): Update. * m68hc11-tdep.c (m68hc11_pseudo_register_read, m68hc11_pseudo_register_write, m68hc11_analyze_instruction, m68hc11_push_dummy_call): Update. * m68linux-tdep.c (m68k_linux_pc_in_sigtramp, m68k_linux_get_sigtramp_info, m68k_linux_sigtramp_frame_cache): Update. * m68k-tdep.c (m68k_push_dummy_call, m68k_analyze_frame_setup, m68k_analyze_register_saves, m68k_analyze_prologue, m68k_frame_cache, m68k_get_longjmp_target): Update. * m88k-tdep.c (m88k_fetch_instruction): Update. * mep-tdep.c (mep_pseudo_cr32_read, mep_pseudo_csr_write, mep_pseudo_cr32_write, mep_get_insn, mep_push_dummy_call): Update. * mi/mi-main.c (mi_cmd_data_write_memory): Update. * mips-linux-tdep.c (mips_linux_get_longjmp_target, supply_32bit_reg, mips64_linux_get_longjmp_target, mips64_fill_gregset, mips64_fill_fpregset, mips_linux_in_dynsym_stub): Update. * mipsnbdsd-tdep.c (mipsnbsd_get_longjmp_target): Update. * mips-tdep.c (mips_fetch_instruction, fetch_mips_16, mips_eabi_push_dummy_call, mips_n32n64_push_dummy_call, mips_o32_push_dummy_call, mips_o64_push_dummy_call, mips_single_step_through_delay, mips_skip_pic_trampoline_code, mips_integer_to_address): Update. * mn10300-tdep.c (mn10300_analyze_prologue, mn10300_push_dummy_call): Update. * monitor.c (monitor_supply_register, monitor_write_memory, monitor_read_memory_single): Update. * moxie-tdep.c (moxie_store_return_value, moxie_extract_return_value, moxie_analyze_prologue): Update. * mt-tdep.c (mt_return_value, mt_skip_prologue, mt_select_coprocessor, mt_pseudo_register_read, mt_pseudo_register_write, mt_registers_info, mt_push_dummy_call): Update. * objc-lang.c (read_objc_method, read_objc_methlist_nmethods, read_objc_methlist_method, read_objc_object, read_objc_super, read_objc_class, find_implementation_from_class): Update. * ppc64-linux-tdep.c (ppc64_desc_entry_point, ppc64_linux_convert_from_func_ptr_addr, ppc_linux_sigtramp_cache): Update. * ppcobsd-tdep.c (ppcobsd_sigtramp_frame_sniffer, ppcobsd_sigtramp_frame_cache): Update. * ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call, do_ppc_sysv_return_value, ppc64_sysv_abi_push_dummy_call, ppc64_sysv_abi_return_value): Update. * ppc-linux-nat.c (ppc_linux_auxv_parse): Update. * procfs.c (procfs_auxv_parse): Update. * p-valprint.c (pascal_val_print): Update. * regcache.c (regcache_raw_read_signed, regcache_raw_read_unsigned, regcache_raw_write_signed, regcache_raw_write_unsigned, regcache_cooked_read_signed, regcache_cooked_read_unsigned, regcache_cooked_write_signed, regcache_cooked_write_unsigned): Update. * remote-m32r-sdi.c (m32r_fetch_register): Update. * remote-mips.c (mips_wait, mips_fetch_registers, mips_xfer_memory): Update. * rs6000-aix-tdep.c (rs6000_push_dummy_call, rs6000_return_value, rs6000_convert_from_func_ptr_addr, branch_dest, rs6000_software_single_step): Update. * rs6000-tdep.c (rs6000_in_function_epilogue_p, ppc_displaced_step_fixup, ppc_deal_with_atomic_sequence, bl_to_blrl_insn_p, rs6000_fetch_instruction, skip_prologue, rs6000_skip_main_prologue, rs6000_skip_trampoline_code, rs6000_frame_cache): Update. * s390-tdep.c (s390_pseudo_register_read, s390_pseudo_register_write, s390x_pseudo_register_read, s390x_pseudo_register_write, s390_load, s390_backchain_frame_unwind_cache, s390_sigtramp_frame_unwind_cache, extend_simple_arg, s390_push_dummy_call, s390_return_value): Update. * scm-exp.c (scm_lreadr): Update. * scm-lang.c (scm_get_field, scm_unpack): Update. * scm-valprint.c (scm_val_print): Update. * score-tdep.c (score_breakpoint_from_pc, score_push_dummy_call, score_fetch_inst): Update. * sh64-tdep.c (look_for_args_moves, sh64_skip_prologue_hard_way, sh64_analyze_prologue, sh64_push_dummy_call, sh64_extract_return_value, sh64_pseudo_register_read, sh64_pseudo_register_write, sh64_frame_prev_register): Update: * sh-tdep.c (sh_analyze_prologue, sh_push_dummy_call_fpu, sh_push_dummy_call_nofpu, sh_extract_return_value_nofpu, sh_store_return_value_nofpu, sh_in_function_epilogue_p): Update. * solib-darwin.c (darwin_load_image_infos): Update. * solib-frv.c (fetch_loadmap, lm_base, frv_current_sos, enable_break2, find_canonical_descriptor_in_load_object): Update. * solib-irix.c (extract_mips_address, fetch_lm_info, irix_current_sos, irix_open_symbol_file_object): Update. * solib-som.c (som_solib_create_inferior_hook, link_map_start, som_current_sos, som_open_symbol_file_object): Update. * solib-sunos.c (SOLIB_EXTRACT_ADDRESS, LM_ADDR, LM_NEXT, LM_NAME): Update. * solib-svr4.c (read_program_header, scan_dyntag_auxv, solib_svr4_r_ldsomap): Update. * sparc64-linux-tdep.c (sparc64_linux_step_trap): Update. * sparc64obsd-tdep.c (sparc64obsd_supply_uthread, sparc64obsd_collect_uthread): Update. * sparc64-tdep.c (sparc64_pseudo_register_read, sparc64_pseudo_register_write, sparc64_supply_gregset, sparc64_collect_gregset): Update. * sparc-linux-tdep.c (sparc32_linux_step_trap): Update. * sparcobsd-tdep.c (sparc32obsd_supply_uthread, sparc32obsd_collect_uthread): Update. * sparc-tdep.c (sparc_fetch_wcookie, sparc32_push_dummy_code, sparc32_store_arguments, sparc32_return_value, sparc_supply_rwindow, sparc_collect_rwindow): Update. * spu-linux-nat.c (parse_spufs_run): Update. * spu-tdep.c (spu_pseudo_register_read_spu, spu_pseudo_register_write_spu, spu_pointer_to_address, spu_analyze_prologue, spu_in_function_epilogue_p, spu_frame_unwind_cache, spu_push_dummy_call, spu_software_single_step, spu_get_longjmp_target, spu_get_overlay_table, spu_overlay_update_osect, info_spu_signal_command, info_spu_mailbox_list, info_spu_dma_cmdlist, info_spu_dma_command, info_spu_proxydma_command): Update. * stack.c (print_frame_nameless_args, frame_info): Update. * symfile.c (read_target_long_array, simple_read_overlay_table, simple_read_overlay_region_table): Update. * target.c (debug_print_register): Update. * tramp-frame.c (tramp_frame_start): Update. * v850-tdep.c (v850_analyze_prologue, v850_push_dummy_call, v850_extract_return_value, v850_store_return_value, * valarith.c (value_binop, value_bit_index): Update. * valops.c (value_cast): Update. * valprint.c (val_print_type_code_int, val_print_string, read_string): Update. * value.c (unpack_long, unpack_double, unpack_field_as_long, modify_field, pack_long): Update. * vax-tdep.c (vax_store_arguments, vax_push_dummy_call, vax_skip_prologue): Update. * xstormy16-tdep.c (xstormy16_push_dummy_call, xstormy16_analyze_prologue, xstormy16_in_function_epilogue_p, xstormy16_resolve_jmp_table_entry, xstormy16_find_jmp_table_entry, xstormy16_pointer_to_address, xstormy16_address_to_pointer): Update. * xtensa-tdep.c (extract_call_winsize, xtensa_pseudo_register_read, xtensa_pseudo_register_write, xtensa_frame_cache, xtensa_push_dummy_call, call0_track_op, call0_frame_cache): Update. * dfp.h (decimal_to_string, decimal_from_string, decimal_from_integral, decimal_from_floating, decimal_to_doublest, decimal_is_zero): Add BYTE_ORDER parameter. (decimal_binop): Add BYTE_ORDER_X, BYTE_ORDER_Y, and BYTE_ORDER_RESULT parameters. (decimal_compare): Add BYTE_ORDER_X and BYTE_ORDER_Y parameters. (decimal_convert): Add BYTE_ORDER_FROM and BYTE_ORDER_TO parameters. * dfp.c (match_endianness): Add BYTE_ORDER parameter. Use it instead of current_gdbarch. (decimal_to_string, decimal_from_integral, decimal_from_floating, decimal_to_doublest, decimal_is_zero): Add BYTE_ORDER parameter. Pass it to match_endianness. (decimal_binop): Add BYTE_ORDER_X, BYTE_ORDER_Y, and BYTE_ORDER_RESULT parameters. Pass them to match_endianness. (decimal_compare): Add BYTE_ORDER_X and BYTE_ORDER_Y parameters. Pass them to match_endianness. (decimal_convert): Add BYTE_ORDER_FROM and BYTE_ORDER_TO parameters. Pass them to match_endianness. * valarith.c (value_args_as_decimal): Add BYTE_ORDER_X and BYTE_ORDER_Y output parameters. (value_binop): Update call to value_args_as_decimal. Update calls to decimal_to_string, decimal_from_string, decimal_from_integral, decimal_from_floating, decimal_to_doublest, decimal_is_zero, decimal_binop, decimal_compare and decimal_convert to pass/receive byte order: * c-exp.y (parse_number): Update. * printcmd.c (printf_command): Update. * valarith.c (value_args_as_decimal, value_binop, value_logical_not, value_equal, value_less): Update. * valops.c (value_cast, value_one): Update. * valprint.c (print_decimal_floating): Update. * value.c (unpack_long, unpack_double): Update. * python/python-value.c (valpy_nonzero): Update. * ada-valprint.c (char_at): Add BYTE_ORDER parameter. (printstr): Update calls to char_at. (ada_val_print_array): Likewise. * valprint.c (read_string): Add BYTE_ORDER parameter. (val_print_string): Update call to read_string. * c-lang.c (c_get_string): Likewise. * charset.h (target_wide_charset): Add BYTE_ORDER parameter. * charset.c (target_wide_charset): Add BYTE_ORDER parameter. Use it instead of current_gdbarch. * printcmd.c (printf_command): Update calls to target_wide_charset. * c-lang.c (charset_for_string_type): Add BYTE_ORDER parameter. Pass to target_wide_charset. Use it instead of current_gdbarch. (classify_type): Add BYTE_ORDER parameter. Pass to charset_for_string_type. Allow NULL encoding pointer. (print_wchar): Add BYTE_ORDER parameter. (c_emit_char): Update calls to classify_type and print_wchar. (c_printchar, c_printstr): Likewise. * gdbarch.sh (in_solib_return_trampoline): Convert to type "m". * gdbarch.c, gdbarch.h: Regenerate. * arch-utils.h (generic_in_solib_return_trampoline): Add GDBARCH parameter. * arch-utils.c (generic_in_solib_return_trampoline): Likewise. * hppa-hpux-tdep.c (hppa_hpux_in_solib_return_trampoline): Likewise. * rs6000-tdep.c (rs6000_in_solib_return_trampoline): Likewise. (rs6000_skip_trampoline_code): Update call. * alpha-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to dynamic_sigtramp_offset and pc_in_sigtramp callbacks. (alpha_read_insn): Add GDBARCH parameter. * alpha-tdep.c (alpha_lds, alpha_sts): Add GDBARCH parameter. (alpha_register_to_value): Pass architecture to alpha_sts. (alpha_extract_return_value): Likewise. (alpha_value_to_register): Pass architecture to alpha_lds. (alpha_store_return_value): Likewise. (alpha_read_insn): Add GDBARCH parameter. (alpha_skip_prologue): Pass architecture to alpha_read_insn. (alpha_heuristic_proc_start): Likewise. (alpha_heuristic_frame_unwind_cache): Likewise. (alpha_next_pc): Likewise. (alpha_sigtramp_frame_this_id): Pass architecture to tdep->dynamic_sigtramp_offset callback. (alpha_sigtramp_frame_sniffer): Pass architecture to tdep->pc_in_sigtramp callback. * alphafbsd-tdep.c (alphafbsd_pc_in_sigtramp): Add GDBARCH parameter. (alphafbsd_sigtramp_offset): Likewise. * alpha-linux-tdep.c (alpha_linux_sigtramp_offset_1): Add GDBARCH parameter. Pass to alpha_read_insn. (alpha_linux_sigtramp_offset): Add GDBARCH parameter. Pass to alpha_linux_sigtramp_offset_1. (alpha_linux_pc_in_sigtramp): Add GDBARCH parameter. Pass to alpha_linux_sigtramp_offset. (alpha_linux_sigcontext_addr): Pass architecture to alpha_read_insn and alpha_linux_sigtramp_offset. * alphanbsd-tdep.c (alphanbsd_sigtramp_offset): Add GDBARCH parameter. (alphanbsd_pc_in_sigtramp): Add GDBARCH parameter. Pass to alphanbsd_sigtramp_offset. * alphaobsd-tdep.c (alphaobsd_sigtramp_offset): Add GDBARCH parameter. (alphaobsd_pc_in_sigtramp): Add GDBARCH parameter. Pass to alpha_read_insn. (alphaobsd_sigcontext_addr): Pass architecture to alphaobsd_sigtramp_offset. * alpha-osf1-tdep.c (alpha_osf1_pc_in_sigtramp): Add GDBARCH parameter. * amd64-tdep.c (amd64_analyze_prologue): Add GDBARCH parameter. (amd64_skip_prologue): Pass architecture to amd64_analyze_prologue. (amd64_frame_cache): Likewise. * arm-tdep.c (SWAP_SHORT, SWAP_INT): Remove. (thumb_analyze_prologue, arm_skip_prologue, arm_scan_prologue, thumb_get_next_pc, arm_get_next_pc): Do not use SWAP_ macros. * arm-wince-tdep.c: Include "frame.h". * avr-tdep.c (EXTRACT_INSN): Remove. (avr_scan_prologue): Add GDBARCH argument, inline EXTRACT_INSN. (avr_skip_prologue): Pass architecture to avr_scan_prologue. (avr_frame_unwind_cache): Likewise. * cris-tdep.c (struct instruction_environment): Add BYTE_ORDER member. (find_step_target): Initialize it. (get_data_from_address): Add BYTE_ORDER parameter. (bdap_prefix): Pass byte order to get_data_from_address. (handle_prefix_assign_mode_for_aritm_op): Likewise. (three_operand_add_sub_cmp_and_or_op): Likewise. (handle_inc_and_index_mode_for_aritm_op): Likewise. * frv-linux-tdep.c (frv_linux_pc_in_sigtramp): Add GDBARCH parameter. (frv_linux_sigcontext_reg_addr): Pass architecture to frv_linux_pc_in_sigtramp. (frv_linux_sigtramp_frame_sniffer): Likewise. * h8300-tdep.c (h8300_is_argument_spill): Add GDBARCH parameter. (h8300_analyze_prologue): Add GDBARCH parameter. Pass to h8300_is_argument_spill. (h8300_frame_cache, h8300_skip_prologue): Pass architecture to h8300_analyze_prologue. * hppa-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to in_solib_call_trampoline callback. (hppa_in_solib_call_trampoline): Add GDBARCH parameter. * hppa-tdep.c (hppa64_convert_code_addr_to_fptr): Add GDBARCH parameter. (hppa64_push_dummy_call): Pass architecture to hppa64_convert_code_addr_to_fptr. (hppa_match_insns): Add GDBARCH parameter. (hppa_match_insns_relaxed): Add GDBARCH parameter. Pass to hppa_match_insns. (hppa_skip_trampoline_code): Pass architecture to hppa_match_insns. (hppa_in_solib_call_trampoline): Add GDBARCH parameter. Pass to hppa_match_insns_relaxed. (hppa_stub_unwind_sniffer): Pass architecture to tdep->in_solib_call_trampoline callback. * hppa-hpux-tdep.c (hppa_hpux_search_pattern): Add GDBARCH parameter. (hppa32_hpux_search_dummy_call_sequence): Pass architecture to hppa_hpux_search_pattern. * hppa-linux-tdep.c (insns_match_pattern): Add GDBARCH parameter. (hppa_linux_sigtramp_find_sigcontext): Add GDBARCH parameter. Pass to insns_match_pattern. (hppa_linux_sigtramp_frame_unwind_cache): Pass architecture to hppa_linux_sigtramp_find_sigcontext. (hppa_linux_sigtramp_frame_sniffer): Likewise. (hppa32_hpux_in_solib_call_trampoline): Add GDBARCH parameter. (hppa64_hpux_in_solib_call_trampoline): Likewise. * i386-tdep.c (i386_follow_jump): Add GDBARCH parameter. (i386_analyze_frame_setup): Add GDBARCH parameter. (i386_analyze_prologue): Add GDBARCH parameter. Pass to i386_follow_jump and i386_analyze_frame_setup. (i386_skip_prologue): Pass architecture to i386_analyze_prologue and i386_follow_jump. (i386_frame_cache): Pass architecture to i386_analyze_prologue. (i386_pe_skip_trampoline_code): Add FRAME parameter. * i386-tdep.h (i386_pe_skip_trampoline_code): Add FRAME parameter. * i386-cygwin-tdep.c (i386_cygwin_skip_trampoline_code): Pass frame to i386_pe_skip_trampoline_code. * ia64-tdep.h (struct gdbarch_tdep): Add GDBARCH parameter to sigcontext_register_address callback. * ia64-tdep.c (ia64_find_global_pointer): Add GDBARCH parameter. (ia64_find_unwind_table): Pass architecture to ia64_find_global_pointer. (find_extant_func_descr): Add GDBARCH parameter. (find_func_descr): Pass architecture to find_extant_func_descr and ia64_find_global_pointer. (ia64_sigtramp_frame_init_saved_regs): Pass architecture to tdep->sigcontext_register_address callback. * ia64-linux-tdep.c (ia64_linux_sigcontext_register_address): Add GDBARCH parameter. * iq2000-tdep.c (iq2000_scan_prologue): Add GDBARCH parameter. (iq2000_frame_cache): Pass architecture to iq2000_scan_prologue. * lm32-tdep.c (lm32_analyze_prologue): Add GDBARCH parameter. (lm32_skip_prologue, lm32_frame_cache): Pass architecture to lm32_analyze_prologue. * m32r-tdep.c (decode_prologue): Add GDBARCH parameter. (m32r_skip_prologue): Pass architecture to decode_prologue. * m68hc11-tdep.c (m68hc11_analyze_instruction): Add GDBARCH parameter. (m68hc11_scan_prologue): Pass architecture to m68hc11_analyze_instruction. * m68k-tdep.c (m68k_analyze_frame_setup): Add GDBARCH parameter. (m68k_analyze_prologue): Pass architecture to m68k_analyze_frame_setup. * m88k-tdep.c (m88k_fetch_instruction): Add BYTE_ORDER parameter. (m88k_analyze_prologue): Add GDBARCH parameter. Pass byte order to m88k_fetch_instruction. (m88k_skip_prologue): Pass architecture to m88k_analyze_prologue. (m88k_frame_cache): Likewise. * mep-tdep.c (mep_get_insn): Add GDBARCH parameter. (mep_analyze_prologue): Pass architecture to mep_get_insn. * mips-tdep.c (mips_fetch_instruction): Add GDBARCH parameter. (mips32_next_pc): Pass architecture to mips_fetch_instruction. (deal_with_atomic_sequence): Likewise. (unpack_mips16): Add GDBARCH parameter, pass to mips_fetch_instruction. (mips16_scan_prologue): Likewise. (mips32_scan_prologue): Likewise. (mips16_in_function_epilogue_p): Likewise. (mips32_in_function_epilogue_p): Likewise. (mips_about_to_return): Likewise. (mips_insn16_frame_cache): Pass architecture to mips16_scan_prologue. (mips_insn32_frame_cache): Pass architecture to mips32_scan_prologue. (mips_skip_prologue): Pass architecture to mips16_scan_prologue and mips32_scan_prologue. (mips_in_function_epilogue_p): Pass architecture to mips16_in_function_epilogue_p and mips32_in_function_epilogue_p. (heuristic_proc_start): Pass architecture to mips_fetch_instruction and mips_about_to_return. (mips_skip_mips16_trampoline_code): Pass architecture to mips_fetch_instruction. (fetch_mips_16): Add GDBARCH parameter. (mips16_next_pc): Pass architecture to fetch_mips_16. (extended_mips16_next_pc): Pass architecture to unpack_mips16 and fetch_mips_16. * objc-lang.c (read_objc_method, read_objc_methlist_nmethods, read_objc_methlist_method, read_objc_object, read_objc_super, read_objc_class): Add GDBARCH parameter. (find_implementation_from_class): Add GDBARCH parameter, pass to read_objc_class, read_objc_methlist_nmethods, and read_objc_methlist_method. (find_implementation): Add GDBARCH parameter, pass to read_objc_object and find_implementation_from_class. (resolve_msgsend, resolve_msgsend_stret): Pass architecture to find_implementation. (resolve_msgsend_super, resolve_msgsend_super_stret): Pass architecture to read_objc_super and find_implementation_from_class. * ppc64-linux-tdep.c (ppc64_desc_entry_point): Add GDBARCH parameter. (ppc64_standard_linkage1_target, ppc64_standard_linkage2_target, ppc64_standard_linkage3_target): Pass architecture to ppc64_desc_entry_point. * rs6000-tdep.c (bl_to_blrl_insn_p): Add BYTE_ORDER parameter. (skip_prologue): Pass byte order to bl_to_blrl_insn_p. (rs6000_fetch_instruction): Add GDBARCH parameter. (rs6000_skip_stack_check): Add GDBARCH parameter, pass to rs6000_fetch_instruction. (skip_prologue): Pass architecture to rs6000_fetch_instruction. * remote-mips.c (mips_store_word): Return old_contents as host integer value instead of target bytes. * s390-tdep.c (struct s390_prologue_data): Add BYTE_ORDER member. (s390_analyze_prologue): Initialize it. (extend_simple_arg): Add GDBARCH parameter. (s390_push_dummy_call): Pass architecture to extend_simple_arg. * scm-lang.c (scm_get_field): Add BYTE_ORDER parameter. * scm-lang.h (scm_get_field): Add BYTE_ORDER parameter. (SCM_CAR, SCM_CDR): Pass SCM_BYTE_ORDER to scm_get_field. * scm-valprint.c (scm_scmval_print): Likewise. (scm_scmlist_print, scm_ipruk, scm_scmval_print): Define SCM_BYTE_ORDER. * sh64-tdep.c (look_for_args_moves): Add GDBARCH parameter. (sh64_skip_prologue_hard_way): Add GDBARCH parameter, pass to look_for_args_moves. (sh64_skip_prologue): Pass architecture to sh64_skip_prologue_hard_way. * sh-tdep.c (sh_analyze_prologue): Add GDBARCH parameter. (sh_skip_prologue): Pass architecture to sh_analyze_prologue. (sh_frame_cache): Likewise. * solib-irix.c (extract_mips_address): Add GDBARCH parameter. (fetch_lm_info, irix_current_sos, irix_open_symbol_file_object): Pass architecture to extract_mips_address. * sparc-tdep.h (sparc_fetch_wcookie): Add GDBARCH parameter. * sparc-tdep.c (sparc_fetch_wcookie): Add GDBARCH parameter. (sparc_supply_rwindow, sparc_collect_rwindow): Pass architecture to sparc_fetch_wcookie. (sparc32_frame_prev_register): Likewise. * sparc64-tdep.c (sparc64_frame_prev_register): Likewise. * sparc32nbsd-tdep.c (sparc32nbsd_sigcontext_saved_regs): Likewise. * sparc64nbsd-tdep.c (sparc64nbsd_sigcontext_saved_regs): Likewise. * spu-tdep.c (spu_analyze_prologue): Add GDBARCH parameter. (spu_skip_prologue): Pass architecture to spu_analyze_prologue. (spu_virtual_frame_pointer): Likewise. (spu_frame_unwind_cache): Likewise. (info_spu_mailbox_list): Add BYTE_ORER parameter. (info_spu_mailbox_command): Pass byte order to info_spu_mailbox_list. (info_spu_dma_cmdlist): Add BYTE_ORER parameter. (info_spu_dma_command, info_spu_proxydma_command): Pass byte order to info_spu_dma_cmdlist. * symfile.c (read_target_long_array): Add GDBARCH parameter. (simple_read_overlay_table, simple_read_overlay_region_table, simple_overlay_update_1): Pass architecture to read_target_long_array. * v850-tdep.c (v850_analyze_prologue): Add GDBARCH parameter. (v850_frame_cache): Pass architecture to v850_analyze_prologue. * xstormy16-tdep.c (xstormy16_analyze_prologue): Add GDBARCH parameter. (xstormy16_skip_prologue, xstormy16_frame_cache): Pass architecture to xstormy16_analyze_prologue. (xstormy16_resolve_jmp_table_entry): Add GDBARCH parameter. (xstormy16_find_jmp_table_entry): Likewise. (xstormy16_skip_trampoline_code): Pass architecture to xstormy16_resolve_jmp_table_entry. (xstormy16_pointer_to_address): Likewise. (xstormy16_address_to_pointer): Pass architecture to xstormy16_find_jmp_table_entry. * xtensa-tdep.c (call0_track_op): Add GDBARCH parameter. (call0_analyze_prologue): Add GDBARCH parameter, pass to call0_track_op. (call0_frame_cache): Pass architecture to call0_analyze_prologue. (xtensa_skip_prologue): Likewise.
2009-07-02 19:25:59 +02:00
sp = extract_unsigned_integer (buf, 8, byte_order);
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
/* The sigcontext structure is part of the user context. A pointer
to the user context is passed as the third argument to the signal
handler, i.e. in %rdx. Unfortunately %rdx isn't preserved across
function calls so we can't use it. Fortunately the user context
is part of the signal frame and the unwound %rsp directly points
at it. */
return sp + AMD64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET;
}
Implementing catch syscall. * amd64-linux-tdep.c: Include xml-syscall.h header, define the XML syscall name for the architecture. (amd64_linux_get_syscall_number): New function. (amd64_linux_init_abi): Register the correct functions for syscall catchpoint; set the correct syscall file name. * breakpoint.c: New include: xml-syscall.h. (set_raw_breakpoint_without_location): Setting the parameters for the catch syscall feature. (insert_catch_syscall): New. (remove_catch_syscall): New. (breakpoint_hit_catch_syscall): New. (print_it_catch_syscall): New. (print_one_catch_syscall): New. (print_mention_catch_syscall): New. (catch_syscall_breakpoint_ops): New. (syscall_catchpoint_p): New. (create_catchpoint_without_mention): New. (create_catchpoint): Modified in order to use create_catchpoint_without_mention. (create_syscall_event_catchpoint): New. (clean_up_filters): New. (catch_syscall_split_args): New. (catch_syscall_command_1): New. (delete_breakpoint): Add cleanup for catch syscall. (is_syscall_catchpoint_enabled): New. (catch_syscall_enabled): New. (catching_syscall_number): New. (catch_syscall_completer): New completer function. (add_catch_command): Add the completer function for catchpoints. * breakpoint.h (syscalls_to_be_caught): New vector. (catch_syscall_enabled): New. (catching_syscall_number): New. * gdbarch.c: Regenerated. * gdbarch.h: Regenerated. * gdbarch.sh: Add syscall catchpoint functions and structures. (get_syscall_number): New. (UNKNOWN_SYSCALL): New definition. * i386-linux-nat.c (i386_linux_resume): Select the proper request to be made for ptrace() considering if we are catching syscalls or not. * i386-linux-tdep.c: Include xml-syscall.h header, define the XML syscall name for the architecture. (i386_linux_get_syscall_number): New. (i386_linux_init_abi): Register the correct functions for syscall catchpoint; set the correct syscall file name. * inf-child.c (inf_child_set_syscall_catchpoint): New. (inf_child_target): Assign default values to target_ops. * inf-ptrace.c (inf_ptrace_resume): Select the proper request to be made for ptrace() considering if we are catching syscalls or not. * inferior.h (struct inferior): Included new variables any_syscall_count, syscalls_counts and total_syscalls_count, used to keep track of requested syscall catchpoints. * infrun.c (resume): Add syscall catchpoint. (deal_with_syscall_event): New. (handle_inferior_event): Add syscall entry/return events. (inferior_has_called_syscall): New. * linux-nat.c: Define some helpful variables to track wether we have support for the needed ptrace option. (linux_test_for_tracesysgood): New. (linux_supports_tracesysgood): New. (linux_enable_tracesysgood): New. (linux_enable_event_reporting): Save the current used ptrace options. (linux_child_post_attach): Calling linux_enable_tracesysgood. (linux_child_post_startup_inferior): Likewise. (linux_child_set_syscall_catchpoint): New function. (linux_handle_extended_wait): Handle the case which the inferior stops because it has called or returned from a syscall. (linux_target_install_ops): Install the necessary functions to handle syscall catchpoints. * linux-nat.h (struct lwp_info): Include syscall_state into the structure, which indicates if we are in a syscall entry or return. * ppc-linux-tdep.c: Include xml-syscall.h header, define the XML syscall filename for the arch. (ppc_linux_get_syscall_number): New. (ppc_linux_init_abi): Register the correct functions for syscall catchpoint; setting the correct name for the XML syscall file. * target.c (update_current_target): Update/copy functions related to syscall catchpoint. (target_waitstatus_to_string): Add syscall catchpoint entry/return events. * target.h (struct target_waitstatus): Add syscall number. (struct syscall): New struct to hold information about syscalls in the system. (struct target_ops): Add ops for syscall catchpoint. (inferior_has_called_syscall): New. (target_set_syscall_catchpoint): New. * xml-support.c (xml_fetch_content_from_file): New function, transferred from xml-tdesc.c. * xml-support.h (xml_fetch_content_from_file): New. * xml-tdesc.c (fetch_xml_from_file): Function removed; transferred to xml-support.c. (file_read_description_xml): Updated to use the new xml_fetch_content_from_file function. * syscalls/gdb-syscalls.dtd: New definition file for syscall's XML support. * syscalls/amd64-linux.xml: New file containing information about syscalls for GNU/Linux systems that use amd64 architecture. * syscalls/i386-linux.xml: New file containing information about syscalls for GNU/Linux systems that use i386 architecture. * syscalls/ppc-linux.xml: New file containing information about syscalls for GNU/Linux systems that use PPC architecture. * syscalls/ppc64-linux.xml: New file containing information about syscalls for GNU/Linux systems that use PPC64 architecture. * xml-syscall.c: New file containing functions for manipulating syscall's XML files. * xml-syscall.h: New file, exporting the functions above mentioned. * Makefile.in: Support for relocatable GDB datadir and XML syscall. * NEWS: Added information about the catch syscall feature. * doc/gdb.texinfo (Set Catchpoints): Documentation about the new feature. * testsuite/Makefile.in: Inclusion of catch-syscall object. * testsuite/gdb.base/catch-syscall.c: New file. * testsuite/gdb.base/catch-syscall.exp: New file.
2009-09-15 05:30:08 +02:00
static LONGEST
amd64_linux_get_syscall_number (struct gdbarch *gdbarch,
Use thread_info and inferior pointers more throughout This is more preparation bits for multi-target support. In a multi-target scenario, we need to address the case of different processes/threads running on different targets that happen to have the same PID/PTID. E.g., we can have both process 123 in target 1, and process 123 in target 2, while they're in reality different processes running on different machines. Or maybe we've loaded multiple instances of the same core file. Etc. To address this, in my WIP multi-target branch, threads and processes are uniquely identified by the (process_stratum target_ops *, ptid_t) and (process_stratum target_ops *, pid) tuples respectively. I.e., each process_stratum instance has its own thread/process number space. As you can imagine, that requires passing around target_ops * pointers in a number of functions where we're currently passing only a ptid_t or an int. E.g., when we look up a thread_info object by ptid_t in find_thread_ptid, the ptid_t alone isn't sufficient. In many cases though, we already have the thread_info or inferior pointer handy, but we "lose" it somewhere along the call stack, only to look it up again by ptid_t/pid. Since thread_info or inferior objects know their parent target, if we pass around thread_info or inferior pointers when possible, we avoid having to add extra target_ops parameters to many functions, and also, we eliminate a number of by ptid_t/int lookups. So that's what this patch does. In a bit more detail: - Changes a number of functions and methods to take a thread_info or inferior pointer instead of a ptid_t or int parameter. - Changes a number of structure fields from ptid_t/int to inferior or thread_info pointers. - Uses the inferior_thread() function whenever possible instead of inferior_ptid. - Uses thread_info pointers directly when possible instead of the is_running/is_stopped etc. routines that require a lookup. - A number of functions are eliminated along the way, such as: int valid_gdb_inferior_id (int num); int pid_to_gdb_inferior_id (int pid); int gdb_inferior_id_to_pid (int num); int in_inferior_list (int pid); - A few structures and places hold a thread_info pointer across inferior execution, so now they take a strong reference to the (refcounted) thread_info object to avoid the thread_info pointer getting stale. This is done in enable_thread_stack_temporaries and in the infcall.c code. - Related, there's a spot in infcall.c where using a RAII object to handle the refcount would be handy, so a gdb::ref_ptr specialization for thread_info is added (thread_info_ref, in gdbthread.h), along with a gdb_ref_ptr policy that works for all refcounted_object types (in common/refcounted-object.h). gdb/ChangeLog: 2018-06-21 Pedro Alves <palves@redhat.com> * ada-lang.h (ada_get_task_number): Take a thread_info pointer instead of a ptid_t. All callers adjusted. * ada-tasks.c (ada_get_task_number): Likewise. All callers adjusted. (print_ada_task_info, display_current_task_id, task_command_1): Adjust. * breakpoint.c (watchpoint_in_thread_scope): Adjust to use inferior_thread. (breakpoint_kind): Adjust. (remove_breakpoints_pid): Rename to ... (remove_breakpoints_inf): ... this. Adjust to take an inferior pointer. All callers adjusted. (bpstat_clear_actions): Use inferior_thread. (get_bpstat_thread): New. (bpstat_do_actions): Use it. (bpstat_check_breakpoint_conditions, bpstat_stop_status): Adjust to take a thread_info pointer. All callers adjusted. (set_longjmp_breakpoint_for_call_dummy, set_momentary_breakpoint) (breakpoint_re_set_thread): Use inferior_thread. * breakpoint.h (struct inferior): Forward declare. (bpstat_stop_status): Update. (remove_breakpoints_pid): Delete. (remove_breakpoints_inf): New. * bsd-uthread.c (bsd_uthread_target::wait) (bsd_uthread_target::update_thread_list): Use find_thread_ptid. * btrace.c (btrace_add_pc, btrace_enable, btrace_fetch) (maint_btrace_packet_history_cmd) (maint_btrace_clear_packet_history_cmd): Adjust. (maint_btrace_clear_cmd, maint_info_btrace_cmd): Adjust to use inferior_thread. * cli/cli-interp.c: Include "inferior.h". * common/refcounted-object.h (struct refcounted_object_ref_policy): New. * compile/compile-object-load.c: Include gdbthread.h. (store_regs): Use inferior_thread. * corelow.c (core_target::close): Use current_inferior. (core_target_open): Adjust to use first_thread_of_inferior and use the current inferior. * ctf.c (ctf_target::close): Adjust to use current_inferior. * dummy-frame.c (dummy_frame_id) <ptid>: Delete, replaced by ... <thread>: ... this new field. All references adjusted. (dummy_frame_pop, dummy_frame_discard, register_dummy_frame_dtor): Take a thread_info pointer instead of a ptid_t. * dummy-frame.h (dummy_frame_push, dummy_frame_pop) (dummy_frame_discard, register_dummy_frame_dtor): Take a thread_info pointer instead of a ptid_t. * elfread.c: Include "inferior.h". (elf_gnu_ifunc_resolver_stop, elf_gnu_ifunc_resolver_return_stop): Use inferior_thread. * eval.c (evaluate_subexp): Likewise. * frame.c (frame_pop, has_stack_frames, find_frame_sal): Use inferior_thread. * gdb_proc_service.h (struct thread_info): Forward declare. (struct ps_prochandle) <ptid>: Delete, replaced by ... <thread>: ... this new field. All references adjusted. * gdbarch.h, gdbarch.c: Regenerate. * gdbarch.sh (get_syscall_number): Replace 'ptid' parameter with a 'thread' parameter. All implementations and callers adjusted. * gdbthread.h (thread_info) <set_running>: New method. (delete_thread, delete_thread_silent): Take a thread_info pointer instead of a ptid. (global_thread_id_to_ptid, ptid_to_global_thread_id): Delete. (first_thread_of_process): Delete, replaced by ... (first_thread_of_inferior): ... this new function. All callers adjusted. (any_live_thread_of_process): Delete, replaced by ... (any_live_thread_of_inferior): ... this new function. All callers adjusted. (switch_to_thread, switch_to_no_thread): Declare. (is_executing): Delete. (enable_thread_stack_temporaries): Update comment. <enable_thread_stack_temporaries>: Take a thread_info pointer instead of a ptid_t. Incref the thread. <~enable_thread_stack_temporaries>: Decref the thread. <m_ptid>: Delete <m_thr>: New. (thread_stack_temporaries_enabled_p, push_thread_stack_temporary) (get_last_thread_stack_temporary) (value_in_thread_stack_temporaries, can_access_registers_thread): Take a thread_info pointer instead of a ptid_t. All callers adjusted. * infcall.c (get_call_return_value): Use inferior_thread. (run_inferior_call): Work with thread pointers instead of ptid_t. (call_function_by_hand_dummy): Work with thread pointers instead of ptid_t. Use thread_info_ref. * infcmd.c (proceed_thread_callback): Access thread's state directly. (ensure_valid_thread, ensure_not_running): Use inferior_thread, access thread's state directly. (continue_command): Use inferior_thread. (info_program_command): Use find_thread_ptid and access thread state directly. (proceed_after_attach_callback): Use thread state directly. (notice_new_inferior): Take a thread_info pointer instead of a ptid_t. All callers adjusted. (exit_inferior): Take an inferior pointer instead of a pid. All callers adjusted. (exit_inferior_silent): New. (detach_inferior): Delete. (valid_gdb_inferior_id, pid_to_gdb_inferior_id) (gdb_inferior_id_to_pid, in_inferior_list): Delete. (detach_inferior_command, kill_inferior_command): Use find_inferior_id instead of valid_gdb_inferior_id and gdb_inferior_id_to_pid. (inferior_command): Use inferior and thread pointers. * inferior.h (struct thread_info): Forward declare. (notice_new_inferior): Take a thread_info pointer instead of a ptid_t. All callers adjusted. (detach_inferior): Delete declaration. (exit_inferior, exit_inferior_silent): Take an inferior pointer instead of a pid. All callers adjusted. (gdb_inferior_id_to_pid, pid_to_gdb_inferior_id, in_inferior_list) (valid_gdb_inferior_id): Delete. * infrun.c (follow_fork_inferior, proceed_after_vfork_done) (handle_vfork_child_exec_or_exit, follow_exec): Adjust. (struct displaced_step_inferior_state) <pid>: Delete, replaced by ... <inf>: ... this new field. <step_ptid>: Delete, replaced by ... <step_thread>: ... this new field. (get_displaced_stepping_state): Take an inferior pointer instead of a pid. All callers adjusted. (displaced_step_in_progress_any_inferior): Adjust. (displaced_step_in_progress_thread): Take a thread pointer instead of a ptid_t. All callers adjusted. (displaced_step_in_progress, add_displaced_stepping_state): Take an inferior pointer instead of a pid. All callers adjusted. (get_displaced_step_closure_by_addr): Adjust. (remove_displaced_stepping_state): Take an inferior pointer instead of a pid. All callers adjusted. (displaced_step_prepare_throw, displaced_step_prepare) (displaced_step_fixup): Take a thread pointer instead of a ptid_t. All callers adjusted. (start_step_over): Adjust. (infrun_thread_ptid_changed): Remove bit updating ptids in the displaced step queue. (do_target_resume): Adjust. (fetch_inferior_event): Use inferior_thread. (context_switch, get_inferior_stop_soon): Take an execution_control_state pointer instead of a ptid_t. All callers adjusted. (switch_to_thread_cleanup): Delete. (stop_all_threads): Use scoped_restore_current_thread. * inline-frame.c: Include "gdbthread.h". (inline_state) <inline_state>: Take a thread pointer instead of a ptid_t. All callers adjusted. <ptid>: Delete, replaced by ... <thread>: ... this new field. (find_inline_frame_state): Take a thread pointer instead of a ptid_t. All callers adjusted. (skip_inline_frames, step_into_inline_frame) (inline_skipped_frames, inline_skipped_symbol): Take a thread pointer instead of a ptid_t. All callers adjusted. * inline-frame.h (skip_inline_frames, step_into_inline_frame) (inline_skipped_frames, inline_skipped_symbol): Likewise. * linux-fork.c (delete_checkpoint_command): Adjust to use thread pointers directly. * linux-nat.c (get_detach_signal): Likewise. * linux-thread-db.c (thread_from_lwp): New 'stopped' parameter. (thread_db_notice_clone): Adjust. (thread_db_find_new_threads_silently) (thread_db_find_new_threads_2, thread_db_find_new_threads_1): Take a thread pointer instead of a ptid_t. All callers adjusted. * mi/mi-cmd-var.c: Include "inferior.h". (mi_cmd_var_update_iter): Update to use thread pointers. * mi/mi-interp.c (mi_new_thread): Update to use the thread's inferior directly. (mi_output_running_pid, mi_inferior_count): Delete, bits factored out to ... (mi_output_running): ... this new function. (mi_on_resume_1): Adjust to use it. (mi_user_selected_context_changed): Adjust to use inferior_thread. * mi/mi-main.c (proceed_thread): Adjust to use thread pointers directly. (interrupt_thread_callback): : Adjust to use thread and inferior pointers. * proc-service.c: Include "gdbthread.h". (ps_pglobal_lookup): Adjust to use the thread's inferior directly. * progspace-and-thread.c: Include "inferior.h". * progspace.c: Include "inferior.h". * python/py-exitedevent.c (create_exited_event_object): Adjust to hold a reference to an inferior_object. * python/py-finishbreakpoint.c (bpfinishpy_init): Adjust to use inferior_thread. * python/py-inferior.c (struct inferior_object): Give the type a tag name instead of a typedef. (python_on_normal_stop): No need to check if the current thread is listed. (inferior_to_inferior_object): Change return type to inferior_object. All callers adjusted. (find_thread_object): Delete, bits factored out to ... (thread_to_thread_object): ... this new function. * python/py-infthread.c (create_thread_object): Use inferior_to_inferior_object. (thpy_is_stopped): Use thread pointer directly. (gdbpy_selected_thread): Use inferior_thread. * python/py-record-btrace.c (btpy_list_object) <ptid>: Delete field, replaced with ... <thread>: ... this new field. All users adjusted. (btpy_insn_or_gap_new): Drop const. (btpy_list_new): Take a thread pointer instead of a ptid_t. All callers adjusted. * python/py-record.c: Include "gdbthread.h". (recpy_insn_new, recpy_func_new): Take a thread pointer instead of a ptid_t. All callers adjusted. (gdbpy_current_recording): Use inferior_thread. * python/py-record.h (recpy_record_object) <ptid>: Delete field, replaced with ... <thread>: ... this new field. All users adjusted. (recpy_element_object) <ptid>: Delete field, replaced with ... <thread>: ... this new field. All users adjusted. (recpy_insn_new, recpy_func_new): Take a thread pointer instead of a ptid_t. All callers adjusted. * python/py-threadevent.c: Include "gdbthread.h". (get_event_thread): Use thread_to_thread_object. * python/python-internal.h (struct inferior_object): Forward declare. (find_thread_object, find_inferior_object): Delete declarations. (thread_to_thread_object, inferior_to_inferior_object): New declarations. * record-btrace.c: Include "inferior.h". (require_btrace_thread): Use inferior_thread. (record_btrace_frame_sniffer) (record_btrace_tailcall_frame_sniffer): Use inferior_thread. (get_thread_current_frame): Use scoped_restore_current_thread and switch_to_thread. (get_thread_current_frame): Use thread pointer directly. (record_btrace_replay_at_breakpoint): Use thread's inferior pointer directly. * record-full.c: Include "inferior.h". * regcache.c: Include "gdbthread.h". (get_thread_arch_regcache): Use the inferior's address space directly. (get_thread_regcache, registers_changed_thread): New. * regcache.h (get_thread_regcache(thread_info *thread)): New overload. (registers_changed_thread): New. (remote_target) <remote_detach_1>: Swap order of parameters. (remote_add_thread): <remote_add_thread>: Return the new thread. (get_remote_thread_info(ptid_t)): New overload. (remote_target::remote_notice_new_inferior): Use thread pointers directly. (remote_target::process_initial_stop_replies): Use thread_info::set_running. (remote_target::remote_detach_1, remote_target::detach) (extended_remote_target::detach): Adjust. * stack.c (frame_show_address): Use inferior_thread. * target-debug.h (target_debug_print_thread_info_pp): New. * target-delegates.c: Regenerate. * target.c (default_thread_address_space): Delete. (memory_xfer_partial_1): Use current_inferior. (target_detach): Use current_inferior. (target_thread_address_space): Delete. (generic_mourn_inferior): Use current_inferior. * target.h (struct target_ops) <thread_address_space>: Delete. (target_thread_address_space): Delete. * thread.c (init_thread_list): Use ALL_THREADS_SAFE. Use thread pointers directly. (delete_thread_1, delete_thread, delete_thread_silent): Take a thread pointer instead of a ptid_t. Adjust all callers. (ptid_to_global_thread_id, global_thread_id_to_ptid): Delete. (first_thread_of_process): Delete, replaced by ... (first_thread_of_inferior): ... this new function. All callers adjusted. (any_thread_of_process): Rename to ... (any_thread_of_inferior): ... this, and take an inferior pointer. (any_live_thread_of_process): Rename to ... (any_live_thread_of_inferior): ... this, and take an inferior pointer. (thread_stack_temporaries_enabled_p, push_thread_stack_temporary) (value_in_thread_stack_temporaries) (get_last_thread_stack_temporary): Take a thread pointer instead of a ptid_t. Adjust all callers. (thread_info::set_running): New. (validate_registers_access): Use inferior_thread. (can_access_registers_ptid): Rename to ... (can_access_registers_thread): ... this, and take a thread pointer. (print_thread_info_1): Adjust to compare thread pointers instead of ptids. (switch_to_no_thread, switch_to_thread): Make extern. (scoped_restore_current_thread::~scoped_restore_current_thread): Use m_thread pointer directly. (scoped_restore_current_thread::scoped_restore_current_thread): Use inferior_thread. (thread_command): Use thread pointer directly. (thread_num_make_value_helper): Use inferior_thread. * top.c (execute_command): Use inferior_thread. * tui/tui-interp.c: Include "inferior.h". * varobj.c (varobj_create): Use inferior_thread. (value_of_root_1): Use find_thread_global_id instead of global_thread_id_to_ptid.
2018-06-21 18:09:31 +02:00
thread_info *thread)
Implementing catch syscall. * amd64-linux-tdep.c: Include xml-syscall.h header, define the XML syscall name for the architecture. (amd64_linux_get_syscall_number): New function. (amd64_linux_init_abi): Register the correct functions for syscall catchpoint; set the correct syscall file name. * breakpoint.c: New include: xml-syscall.h. (set_raw_breakpoint_without_location): Setting the parameters for the catch syscall feature. (insert_catch_syscall): New. (remove_catch_syscall): New. (breakpoint_hit_catch_syscall): New. (print_it_catch_syscall): New. (print_one_catch_syscall): New. (print_mention_catch_syscall): New. (catch_syscall_breakpoint_ops): New. (syscall_catchpoint_p): New. (create_catchpoint_without_mention): New. (create_catchpoint): Modified in order to use create_catchpoint_without_mention. (create_syscall_event_catchpoint): New. (clean_up_filters): New. (catch_syscall_split_args): New. (catch_syscall_command_1): New. (delete_breakpoint): Add cleanup for catch syscall. (is_syscall_catchpoint_enabled): New. (catch_syscall_enabled): New. (catching_syscall_number): New. (catch_syscall_completer): New completer function. (add_catch_command): Add the completer function for catchpoints. * breakpoint.h (syscalls_to_be_caught): New vector. (catch_syscall_enabled): New. (catching_syscall_number): New. * gdbarch.c: Regenerated. * gdbarch.h: Regenerated. * gdbarch.sh: Add syscall catchpoint functions and structures. (get_syscall_number): New. (UNKNOWN_SYSCALL): New definition. * i386-linux-nat.c (i386_linux_resume): Select the proper request to be made for ptrace() considering if we are catching syscalls or not. * i386-linux-tdep.c: Include xml-syscall.h header, define the XML syscall name for the architecture. (i386_linux_get_syscall_number): New. (i386_linux_init_abi): Register the correct functions for syscall catchpoint; set the correct syscall file name. * inf-child.c (inf_child_set_syscall_catchpoint): New. (inf_child_target): Assign default values to target_ops. * inf-ptrace.c (inf_ptrace_resume): Select the proper request to be made for ptrace() considering if we are catching syscalls or not. * inferior.h (struct inferior): Included new variables any_syscall_count, syscalls_counts and total_syscalls_count, used to keep track of requested syscall catchpoints. * infrun.c (resume): Add syscall catchpoint. (deal_with_syscall_event): New. (handle_inferior_event): Add syscall entry/return events. (inferior_has_called_syscall): New. * linux-nat.c: Define some helpful variables to track wether we have support for the needed ptrace option. (linux_test_for_tracesysgood): New. (linux_supports_tracesysgood): New. (linux_enable_tracesysgood): New. (linux_enable_event_reporting): Save the current used ptrace options. (linux_child_post_attach): Calling linux_enable_tracesysgood. (linux_child_post_startup_inferior): Likewise. (linux_child_set_syscall_catchpoint): New function. (linux_handle_extended_wait): Handle the case which the inferior stops because it has called or returned from a syscall. (linux_target_install_ops): Install the necessary functions to handle syscall catchpoints. * linux-nat.h (struct lwp_info): Include syscall_state into the structure, which indicates if we are in a syscall entry or return. * ppc-linux-tdep.c: Include xml-syscall.h header, define the XML syscall filename for the arch. (ppc_linux_get_syscall_number): New. (ppc_linux_init_abi): Register the correct functions for syscall catchpoint; setting the correct name for the XML syscall file. * target.c (update_current_target): Update/copy functions related to syscall catchpoint. (target_waitstatus_to_string): Add syscall catchpoint entry/return events. * target.h (struct target_waitstatus): Add syscall number. (struct syscall): New struct to hold information about syscalls in the system. (struct target_ops): Add ops for syscall catchpoint. (inferior_has_called_syscall): New. (target_set_syscall_catchpoint): New. * xml-support.c (xml_fetch_content_from_file): New function, transferred from xml-tdesc.c. * xml-support.h (xml_fetch_content_from_file): New. * xml-tdesc.c (fetch_xml_from_file): Function removed; transferred to xml-support.c. (file_read_description_xml): Updated to use the new xml_fetch_content_from_file function. * syscalls/gdb-syscalls.dtd: New definition file for syscall's XML support. * syscalls/amd64-linux.xml: New file containing information about syscalls for GNU/Linux systems that use amd64 architecture. * syscalls/i386-linux.xml: New file containing information about syscalls for GNU/Linux systems that use i386 architecture. * syscalls/ppc-linux.xml: New file containing information about syscalls for GNU/Linux systems that use PPC architecture. * syscalls/ppc64-linux.xml: New file containing information about syscalls for GNU/Linux systems that use PPC64 architecture. * xml-syscall.c: New file containing functions for manipulating syscall's XML files. * xml-syscall.h: New file, exporting the functions above mentioned. * Makefile.in: Support for relocatable GDB datadir and XML syscall. * NEWS: Added information about the catch syscall feature. * doc/gdb.texinfo (Set Catchpoints): Documentation about the new feature. * testsuite/Makefile.in: Inclusion of catch-syscall object. * testsuite/gdb.base/catch-syscall.c: New file. * testsuite/gdb.base/catch-syscall.exp: New file.
2009-09-15 05:30:08 +02:00
{
Use thread_info and inferior pointers more throughout This is more preparation bits for multi-target support. In a multi-target scenario, we need to address the case of different processes/threads running on different targets that happen to have the same PID/PTID. E.g., we can have both process 123 in target 1, and process 123 in target 2, while they're in reality different processes running on different machines. Or maybe we've loaded multiple instances of the same core file. Etc. To address this, in my WIP multi-target branch, threads and processes are uniquely identified by the (process_stratum target_ops *, ptid_t) and (process_stratum target_ops *, pid) tuples respectively. I.e., each process_stratum instance has its own thread/process number space. As you can imagine, that requires passing around target_ops * pointers in a number of functions where we're currently passing only a ptid_t or an int. E.g., when we look up a thread_info object by ptid_t in find_thread_ptid, the ptid_t alone isn't sufficient. In many cases though, we already have the thread_info or inferior pointer handy, but we "lose" it somewhere along the call stack, only to look it up again by ptid_t/pid. Since thread_info or inferior objects know their parent target, if we pass around thread_info or inferior pointers when possible, we avoid having to add extra target_ops parameters to many functions, and also, we eliminate a number of by ptid_t/int lookups. So that's what this patch does. In a bit more detail: - Changes a number of functions and methods to take a thread_info or inferior pointer instead of a ptid_t or int parameter. - Changes a number of structure fields from ptid_t/int to inferior or thread_info pointers. - Uses the inferior_thread() function whenever possible instead of inferior_ptid. - Uses thread_info pointers directly when possible instead of the is_running/is_stopped etc. routines that require a lookup. - A number of functions are eliminated along the way, such as: int valid_gdb_inferior_id (int num); int pid_to_gdb_inferior_id (int pid); int gdb_inferior_id_to_pid (int num); int in_inferior_list (int pid); - A few structures and places hold a thread_info pointer across inferior execution, so now they take a strong reference to the (refcounted) thread_info object to avoid the thread_info pointer getting stale. This is done in enable_thread_stack_temporaries and in the infcall.c code. - Related, there's a spot in infcall.c where using a RAII object to handle the refcount would be handy, so a gdb::ref_ptr specialization for thread_info is added (thread_info_ref, in gdbthread.h), along with a gdb_ref_ptr policy that works for all refcounted_object types (in common/refcounted-object.h). gdb/ChangeLog: 2018-06-21 Pedro Alves <palves@redhat.com> * ada-lang.h (ada_get_task_number): Take a thread_info pointer instead of a ptid_t. All callers adjusted. * ada-tasks.c (ada_get_task_number): Likewise. All callers adjusted. (print_ada_task_info, display_current_task_id, task_command_1): Adjust. * breakpoint.c (watchpoint_in_thread_scope): Adjust to use inferior_thread. (breakpoint_kind): Adjust. (remove_breakpoints_pid): Rename to ... (remove_breakpoints_inf): ... this. Adjust to take an inferior pointer. All callers adjusted. (bpstat_clear_actions): Use inferior_thread. (get_bpstat_thread): New. (bpstat_do_actions): Use it. (bpstat_check_breakpoint_conditions, bpstat_stop_status): Adjust to take a thread_info pointer. All callers adjusted. (set_longjmp_breakpoint_for_call_dummy, set_momentary_breakpoint) (breakpoint_re_set_thread): Use inferior_thread. * breakpoint.h (struct inferior): Forward declare. (bpstat_stop_status): Update. (remove_breakpoints_pid): Delete. (remove_breakpoints_inf): New. * bsd-uthread.c (bsd_uthread_target::wait) (bsd_uthread_target::update_thread_list): Use find_thread_ptid. * btrace.c (btrace_add_pc, btrace_enable, btrace_fetch) (maint_btrace_packet_history_cmd) (maint_btrace_clear_packet_history_cmd): Adjust. (maint_btrace_clear_cmd, maint_info_btrace_cmd): Adjust to use inferior_thread. * cli/cli-interp.c: Include "inferior.h". * common/refcounted-object.h (struct refcounted_object_ref_policy): New. * compile/compile-object-load.c: Include gdbthread.h. (store_regs): Use inferior_thread. * corelow.c (core_target::close): Use current_inferior. (core_target_open): Adjust to use first_thread_of_inferior and use the current inferior. * ctf.c (ctf_target::close): Adjust to use current_inferior. * dummy-frame.c (dummy_frame_id) <ptid>: Delete, replaced by ... <thread>: ... this new field. All references adjusted. (dummy_frame_pop, dummy_frame_discard, register_dummy_frame_dtor): Take a thread_info pointer instead of a ptid_t. * dummy-frame.h (dummy_frame_push, dummy_frame_pop) (dummy_frame_discard, register_dummy_frame_dtor): Take a thread_info pointer instead of a ptid_t. * elfread.c: Include "inferior.h". (elf_gnu_ifunc_resolver_stop, elf_gnu_ifunc_resolver_return_stop): Use inferior_thread. * eval.c (evaluate_subexp): Likewise. * frame.c (frame_pop, has_stack_frames, find_frame_sal): Use inferior_thread. * gdb_proc_service.h (struct thread_info): Forward declare. (struct ps_prochandle) <ptid>: Delete, replaced by ... <thread>: ... this new field. All references adjusted. * gdbarch.h, gdbarch.c: Regenerate. * gdbarch.sh (get_syscall_number): Replace 'ptid' parameter with a 'thread' parameter. All implementations and callers adjusted. * gdbthread.h (thread_info) <set_running>: New method. (delete_thread, delete_thread_silent): Take a thread_info pointer instead of a ptid. (global_thread_id_to_ptid, ptid_to_global_thread_id): Delete. (first_thread_of_process): Delete, replaced by ... (first_thread_of_inferior): ... this new function. All callers adjusted. (any_live_thread_of_process): Delete, replaced by ... (any_live_thread_of_inferior): ... this new function. All callers adjusted. (switch_to_thread, switch_to_no_thread): Declare. (is_executing): Delete. (enable_thread_stack_temporaries): Update comment. <enable_thread_stack_temporaries>: Take a thread_info pointer instead of a ptid_t. Incref the thread. <~enable_thread_stack_temporaries>: Decref the thread. <m_ptid>: Delete <m_thr>: New. (thread_stack_temporaries_enabled_p, push_thread_stack_temporary) (get_last_thread_stack_temporary) (value_in_thread_stack_temporaries, can_access_registers_thread): Take a thread_info pointer instead of a ptid_t. All callers adjusted. * infcall.c (get_call_return_value): Use inferior_thread. (run_inferior_call): Work with thread pointers instead of ptid_t. (call_function_by_hand_dummy): Work with thread pointers instead of ptid_t. Use thread_info_ref. * infcmd.c (proceed_thread_callback): Access thread's state directly. (ensure_valid_thread, ensure_not_running): Use inferior_thread, access thread's state directly. (continue_command): Use inferior_thread. (info_program_command): Use find_thread_ptid and access thread state directly. (proceed_after_attach_callback): Use thread state directly. (notice_new_inferior): Take a thread_info pointer instead of a ptid_t. All callers adjusted. (exit_inferior): Take an inferior pointer instead of a pid. All callers adjusted. (exit_inferior_silent): New. (detach_inferior): Delete. (valid_gdb_inferior_id, pid_to_gdb_inferior_id) (gdb_inferior_id_to_pid, in_inferior_list): Delete. (detach_inferior_command, kill_inferior_command): Use find_inferior_id instead of valid_gdb_inferior_id and gdb_inferior_id_to_pid. (inferior_command): Use inferior and thread pointers. * inferior.h (struct thread_info): Forward declare. (notice_new_inferior): Take a thread_info pointer instead of a ptid_t. All callers adjusted. (detach_inferior): Delete declaration. (exit_inferior, exit_inferior_silent): Take an inferior pointer instead of a pid. All callers adjusted. (gdb_inferior_id_to_pid, pid_to_gdb_inferior_id, in_inferior_list) (valid_gdb_inferior_id): Delete. * infrun.c (follow_fork_inferior, proceed_after_vfork_done) (handle_vfork_child_exec_or_exit, follow_exec): Adjust. (struct displaced_step_inferior_state) <pid>: Delete, replaced by ... <inf>: ... this new field. <step_ptid>: Delete, replaced by ... <step_thread>: ... this new field. (get_displaced_stepping_state): Take an inferior pointer instead of a pid. All callers adjusted. (displaced_step_in_progress_any_inferior): Adjust. (displaced_step_in_progress_thread): Take a thread pointer instead of a ptid_t. All callers adjusted. (displaced_step_in_progress, add_displaced_stepping_state): Take an inferior pointer instead of a pid. All callers adjusted. (get_displaced_step_closure_by_addr): Adjust. (remove_displaced_stepping_state): Take an inferior pointer instead of a pid. All callers adjusted. (displaced_step_prepare_throw, displaced_step_prepare) (displaced_step_fixup): Take a thread pointer instead of a ptid_t. All callers adjusted. (start_step_over): Adjust. (infrun_thread_ptid_changed): Remove bit updating ptids in the displaced step queue. (do_target_resume): Adjust. (fetch_inferior_event): Use inferior_thread. (context_switch, get_inferior_stop_soon): Take an execution_control_state pointer instead of a ptid_t. All callers adjusted. (switch_to_thread_cleanup): Delete. (stop_all_threads): Use scoped_restore_current_thread. * inline-frame.c: Include "gdbthread.h". (inline_state) <inline_state>: Take a thread pointer instead of a ptid_t. All callers adjusted. <ptid>: Delete, replaced by ... <thread>: ... this new field. (find_inline_frame_state): Take a thread pointer instead of a ptid_t. All callers adjusted. (skip_inline_frames, step_into_inline_frame) (inline_skipped_frames, inline_skipped_symbol): Take a thread pointer instead of a ptid_t. All callers adjusted. * inline-frame.h (skip_inline_frames, step_into_inline_frame) (inline_skipped_frames, inline_skipped_symbol): Likewise. * linux-fork.c (delete_checkpoint_command): Adjust to use thread pointers directly. * linux-nat.c (get_detach_signal): Likewise. * linux-thread-db.c (thread_from_lwp): New 'stopped' parameter. (thread_db_notice_clone): Adjust. (thread_db_find_new_threads_silently) (thread_db_find_new_threads_2, thread_db_find_new_threads_1): Take a thread pointer instead of a ptid_t. All callers adjusted. * mi/mi-cmd-var.c: Include "inferior.h". (mi_cmd_var_update_iter): Update to use thread pointers. * mi/mi-interp.c (mi_new_thread): Update to use the thread's inferior directly. (mi_output_running_pid, mi_inferior_count): Delete, bits factored out to ... (mi_output_running): ... this new function. (mi_on_resume_1): Adjust to use it. (mi_user_selected_context_changed): Adjust to use inferior_thread. * mi/mi-main.c (proceed_thread): Adjust to use thread pointers directly. (interrupt_thread_callback): : Adjust to use thread and inferior pointers. * proc-service.c: Include "gdbthread.h". (ps_pglobal_lookup): Adjust to use the thread's inferior directly. * progspace-and-thread.c: Include "inferior.h". * progspace.c: Include "inferior.h". * python/py-exitedevent.c (create_exited_event_object): Adjust to hold a reference to an inferior_object. * python/py-finishbreakpoint.c (bpfinishpy_init): Adjust to use inferior_thread. * python/py-inferior.c (struct inferior_object): Give the type a tag name instead of a typedef. (python_on_normal_stop): No need to check if the current thread is listed. (inferior_to_inferior_object): Change return type to inferior_object. All callers adjusted. (find_thread_object): Delete, bits factored out to ... (thread_to_thread_object): ... this new function. * python/py-infthread.c (create_thread_object): Use inferior_to_inferior_object. (thpy_is_stopped): Use thread pointer directly. (gdbpy_selected_thread): Use inferior_thread. * python/py-record-btrace.c (btpy_list_object) <ptid>: Delete field, replaced with ... <thread>: ... this new field. All users adjusted. (btpy_insn_or_gap_new): Drop const. (btpy_list_new): Take a thread pointer instead of a ptid_t. All callers adjusted. * python/py-record.c: Include "gdbthread.h". (recpy_insn_new, recpy_func_new): Take a thread pointer instead of a ptid_t. All callers adjusted. (gdbpy_current_recording): Use inferior_thread. * python/py-record.h (recpy_record_object) <ptid>: Delete field, replaced with ... <thread>: ... this new field. All users adjusted. (recpy_element_object) <ptid>: Delete field, replaced with ... <thread>: ... this new field. All users adjusted. (recpy_insn_new, recpy_func_new): Take a thread pointer instead of a ptid_t. All callers adjusted. * python/py-threadevent.c: Include "gdbthread.h". (get_event_thread): Use thread_to_thread_object. * python/python-internal.h (struct inferior_object): Forward declare. (find_thread_object, find_inferior_object): Delete declarations. (thread_to_thread_object, inferior_to_inferior_object): New declarations. * record-btrace.c: Include "inferior.h". (require_btrace_thread): Use inferior_thread. (record_btrace_frame_sniffer) (record_btrace_tailcall_frame_sniffer): Use inferior_thread. (get_thread_current_frame): Use scoped_restore_current_thread and switch_to_thread. (get_thread_current_frame): Use thread pointer directly. (record_btrace_replay_at_breakpoint): Use thread's inferior pointer directly. * record-full.c: Include "inferior.h". * regcache.c: Include "gdbthread.h". (get_thread_arch_regcache): Use the inferior's address space directly. (get_thread_regcache, registers_changed_thread): New. * regcache.h (get_thread_regcache(thread_info *thread)): New overload. (registers_changed_thread): New. (remote_target) <remote_detach_1>: Swap order of parameters. (remote_add_thread): <remote_add_thread>: Return the new thread. (get_remote_thread_info(ptid_t)): New overload. (remote_target::remote_notice_new_inferior): Use thread pointers directly. (remote_target::process_initial_stop_replies): Use thread_info::set_running. (remote_target::remote_detach_1, remote_target::detach) (extended_remote_target::detach): Adjust. * stack.c (frame_show_address): Use inferior_thread. * target-debug.h (target_debug_print_thread_info_pp): New. * target-delegates.c: Regenerate. * target.c (default_thread_address_space): Delete. (memory_xfer_partial_1): Use current_inferior. (target_detach): Use current_inferior. (target_thread_address_space): Delete. (generic_mourn_inferior): Use current_inferior. * target.h (struct target_ops) <thread_address_space>: Delete. (target_thread_address_space): Delete. * thread.c (init_thread_list): Use ALL_THREADS_SAFE. Use thread pointers directly. (delete_thread_1, delete_thread, delete_thread_silent): Take a thread pointer instead of a ptid_t. Adjust all callers. (ptid_to_global_thread_id, global_thread_id_to_ptid): Delete. (first_thread_of_process): Delete, replaced by ... (first_thread_of_inferior): ... this new function. All callers adjusted. (any_thread_of_process): Rename to ... (any_thread_of_inferior): ... this, and take an inferior pointer. (any_live_thread_of_process): Rename to ... (any_live_thread_of_inferior): ... this, and take an inferior pointer. (thread_stack_temporaries_enabled_p, push_thread_stack_temporary) (value_in_thread_stack_temporaries) (get_last_thread_stack_temporary): Take a thread pointer instead of a ptid_t. Adjust all callers. (thread_info::set_running): New. (validate_registers_access): Use inferior_thread. (can_access_registers_ptid): Rename to ... (can_access_registers_thread): ... this, and take a thread pointer. (print_thread_info_1): Adjust to compare thread pointers instead of ptids. (switch_to_no_thread, switch_to_thread): Make extern. (scoped_restore_current_thread::~scoped_restore_current_thread): Use m_thread pointer directly. (scoped_restore_current_thread::scoped_restore_current_thread): Use inferior_thread. (thread_command): Use thread pointer directly. (thread_num_make_value_helper): Use inferior_thread. * top.c (execute_command): Use inferior_thread. * tui/tui-interp.c: Include "inferior.h". * varobj.c (varobj_create): Use inferior_thread. (value_of_root_1): Use find_thread_global_id instead of global_thread_id_to_ptid.
2018-06-21 18:09:31 +02:00
struct regcache *regcache = get_thread_regcache (thread);
Implementing catch syscall. * amd64-linux-tdep.c: Include xml-syscall.h header, define the XML syscall name for the architecture. (amd64_linux_get_syscall_number): New function. (amd64_linux_init_abi): Register the correct functions for syscall catchpoint; set the correct syscall file name. * breakpoint.c: New include: xml-syscall.h. (set_raw_breakpoint_without_location): Setting the parameters for the catch syscall feature. (insert_catch_syscall): New. (remove_catch_syscall): New. (breakpoint_hit_catch_syscall): New. (print_it_catch_syscall): New. (print_one_catch_syscall): New. (print_mention_catch_syscall): New. (catch_syscall_breakpoint_ops): New. (syscall_catchpoint_p): New. (create_catchpoint_without_mention): New. (create_catchpoint): Modified in order to use create_catchpoint_without_mention. (create_syscall_event_catchpoint): New. (clean_up_filters): New. (catch_syscall_split_args): New. (catch_syscall_command_1): New. (delete_breakpoint): Add cleanup for catch syscall. (is_syscall_catchpoint_enabled): New. (catch_syscall_enabled): New. (catching_syscall_number): New. (catch_syscall_completer): New completer function. (add_catch_command): Add the completer function for catchpoints. * breakpoint.h (syscalls_to_be_caught): New vector. (catch_syscall_enabled): New. (catching_syscall_number): New. * gdbarch.c: Regenerated. * gdbarch.h: Regenerated. * gdbarch.sh: Add syscall catchpoint functions and structures. (get_syscall_number): New. (UNKNOWN_SYSCALL): New definition. * i386-linux-nat.c (i386_linux_resume): Select the proper request to be made for ptrace() considering if we are catching syscalls or not. * i386-linux-tdep.c: Include xml-syscall.h header, define the XML syscall name for the architecture. (i386_linux_get_syscall_number): New. (i386_linux_init_abi): Register the correct functions for syscall catchpoint; set the correct syscall file name. * inf-child.c (inf_child_set_syscall_catchpoint): New. (inf_child_target): Assign default values to target_ops. * inf-ptrace.c (inf_ptrace_resume): Select the proper request to be made for ptrace() considering if we are catching syscalls or not. * inferior.h (struct inferior): Included new variables any_syscall_count, syscalls_counts and total_syscalls_count, used to keep track of requested syscall catchpoints. * infrun.c (resume): Add syscall catchpoint. (deal_with_syscall_event): New. (handle_inferior_event): Add syscall entry/return events. (inferior_has_called_syscall): New. * linux-nat.c: Define some helpful variables to track wether we have support for the needed ptrace option. (linux_test_for_tracesysgood): New. (linux_supports_tracesysgood): New. (linux_enable_tracesysgood): New. (linux_enable_event_reporting): Save the current used ptrace options. (linux_child_post_attach): Calling linux_enable_tracesysgood. (linux_child_post_startup_inferior): Likewise. (linux_child_set_syscall_catchpoint): New function. (linux_handle_extended_wait): Handle the case which the inferior stops because it has called or returned from a syscall. (linux_target_install_ops): Install the necessary functions to handle syscall catchpoints. * linux-nat.h (struct lwp_info): Include syscall_state into the structure, which indicates if we are in a syscall entry or return. * ppc-linux-tdep.c: Include xml-syscall.h header, define the XML syscall filename for the arch. (ppc_linux_get_syscall_number): New. (ppc_linux_init_abi): Register the correct functions for syscall catchpoint; setting the correct name for the XML syscall file. * target.c (update_current_target): Update/copy functions related to syscall catchpoint. (target_waitstatus_to_string): Add syscall catchpoint entry/return events. * target.h (struct target_waitstatus): Add syscall number. (struct syscall): New struct to hold information about syscalls in the system. (struct target_ops): Add ops for syscall catchpoint. (inferior_has_called_syscall): New. (target_set_syscall_catchpoint): New. * xml-support.c (xml_fetch_content_from_file): New function, transferred from xml-tdesc.c. * xml-support.h (xml_fetch_content_from_file): New. * xml-tdesc.c (fetch_xml_from_file): Function removed; transferred to xml-support.c. (file_read_description_xml): Updated to use the new xml_fetch_content_from_file function. * syscalls/gdb-syscalls.dtd: New definition file for syscall's XML support. * syscalls/amd64-linux.xml: New file containing information about syscalls for GNU/Linux systems that use amd64 architecture. * syscalls/i386-linux.xml: New file containing information about syscalls for GNU/Linux systems that use i386 architecture. * syscalls/ppc-linux.xml: New file containing information about syscalls for GNU/Linux systems that use PPC architecture. * syscalls/ppc64-linux.xml: New file containing information about syscalls for GNU/Linux systems that use PPC64 architecture. * xml-syscall.c: New file containing functions for manipulating syscall's XML files. * xml-syscall.h: New file, exporting the functions above mentioned. * Makefile.in: Support for relocatable GDB datadir and XML syscall. * NEWS: Added information about the catch syscall feature. * doc/gdb.texinfo (Set Catchpoints): Documentation about the new feature. * testsuite/Makefile.in: Inclusion of catch-syscall object. * testsuite/gdb.base/catch-syscall.c: New file. * testsuite/gdb.base/catch-syscall.exp: New file.
2009-09-15 05:30:08 +02:00
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
/* The content of a register. */
gdb_byte buf[8];
/* The result. */
LONGEST ret;
/* Getting the system call number from the register.
When dealing with x86_64 architecture, this information
is stored at %rax register. */
regcache->cooked_read (AMD64_LINUX_ORIG_RAX_REGNUM, buf);
Implementing catch syscall. * amd64-linux-tdep.c: Include xml-syscall.h header, define the XML syscall name for the architecture. (amd64_linux_get_syscall_number): New function. (amd64_linux_init_abi): Register the correct functions for syscall catchpoint; set the correct syscall file name. * breakpoint.c: New include: xml-syscall.h. (set_raw_breakpoint_without_location): Setting the parameters for the catch syscall feature. (insert_catch_syscall): New. (remove_catch_syscall): New. (breakpoint_hit_catch_syscall): New. (print_it_catch_syscall): New. (print_one_catch_syscall): New. (print_mention_catch_syscall): New. (catch_syscall_breakpoint_ops): New. (syscall_catchpoint_p): New. (create_catchpoint_without_mention): New. (create_catchpoint): Modified in order to use create_catchpoint_without_mention. (create_syscall_event_catchpoint): New. (clean_up_filters): New. (catch_syscall_split_args): New. (catch_syscall_command_1): New. (delete_breakpoint): Add cleanup for catch syscall. (is_syscall_catchpoint_enabled): New. (catch_syscall_enabled): New. (catching_syscall_number): New. (catch_syscall_completer): New completer function. (add_catch_command): Add the completer function for catchpoints. * breakpoint.h (syscalls_to_be_caught): New vector. (catch_syscall_enabled): New. (catching_syscall_number): New. * gdbarch.c: Regenerated. * gdbarch.h: Regenerated. * gdbarch.sh: Add syscall catchpoint functions and structures. (get_syscall_number): New. (UNKNOWN_SYSCALL): New definition. * i386-linux-nat.c (i386_linux_resume): Select the proper request to be made for ptrace() considering if we are catching syscalls or not. * i386-linux-tdep.c: Include xml-syscall.h header, define the XML syscall name for the architecture. (i386_linux_get_syscall_number): New. (i386_linux_init_abi): Register the correct functions for syscall catchpoint; set the correct syscall file name. * inf-child.c (inf_child_set_syscall_catchpoint): New. (inf_child_target): Assign default values to target_ops. * inf-ptrace.c (inf_ptrace_resume): Select the proper request to be made for ptrace() considering if we are catching syscalls or not. * inferior.h (struct inferior): Included new variables any_syscall_count, syscalls_counts and total_syscalls_count, used to keep track of requested syscall catchpoints. * infrun.c (resume): Add syscall catchpoint. (deal_with_syscall_event): New. (handle_inferior_event): Add syscall entry/return events. (inferior_has_called_syscall): New. * linux-nat.c: Define some helpful variables to track wether we have support for the needed ptrace option. (linux_test_for_tracesysgood): New. (linux_supports_tracesysgood): New. (linux_enable_tracesysgood): New. (linux_enable_event_reporting): Save the current used ptrace options. (linux_child_post_attach): Calling linux_enable_tracesysgood. (linux_child_post_startup_inferior): Likewise. (linux_child_set_syscall_catchpoint): New function. (linux_handle_extended_wait): Handle the case which the inferior stops because it has called or returned from a syscall. (linux_target_install_ops): Install the necessary functions to handle syscall catchpoints. * linux-nat.h (struct lwp_info): Include syscall_state into the structure, which indicates if we are in a syscall entry or return. * ppc-linux-tdep.c: Include xml-syscall.h header, define the XML syscall filename for the arch. (ppc_linux_get_syscall_number): New. (ppc_linux_init_abi): Register the correct functions for syscall catchpoint; setting the correct name for the XML syscall file. * target.c (update_current_target): Update/copy functions related to syscall catchpoint. (target_waitstatus_to_string): Add syscall catchpoint entry/return events. * target.h (struct target_waitstatus): Add syscall number. (struct syscall): New struct to hold information about syscalls in the system. (struct target_ops): Add ops for syscall catchpoint. (inferior_has_called_syscall): New. (target_set_syscall_catchpoint): New. * xml-support.c (xml_fetch_content_from_file): New function, transferred from xml-tdesc.c. * xml-support.h (xml_fetch_content_from_file): New. * xml-tdesc.c (fetch_xml_from_file): Function removed; transferred to xml-support.c. (file_read_description_xml): Updated to use the new xml_fetch_content_from_file function. * syscalls/gdb-syscalls.dtd: New definition file for syscall's XML support. * syscalls/amd64-linux.xml: New file containing information about syscalls for GNU/Linux systems that use amd64 architecture. * syscalls/i386-linux.xml: New file containing information about syscalls for GNU/Linux systems that use i386 architecture. * syscalls/ppc-linux.xml: New file containing information about syscalls for GNU/Linux systems that use PPC architecture. * syscalls/ppc64-linux.xml: New file containing information about syscalls for GNU/Linux systems that use PPC64 architecture. * xml-syscall.c: New file containing functions for manipulating syscall's XML files. * xml-syscall.h: New file, exporting the functions above mentioned. * Makefile.in: Support for relocatable GDB datadir and XML syscall. * NEWS: Added information about the catch syscall feature. * doc/gdb.texinfo (Set Catchpoints): Documentation about the new feature. * testsuite/Makefile.in: Inclusion of catch-syscall object. * testsuite/gdb.base/catch-syscall.c: New file. * testsuite/gdb.base/catch-syscall.exp: New file.
2009-09-15 05:30:08 +02:00
ret = extract_signed_integer (buf, 8, byte_order);
return ret;
}
/* From <asm/sigcontext.h>. */
static int amd64_linux_sc_reg_offset[] =
{
13 * 8, /* %rax */
11 * 8, /* %rbx */
14 * 8, /* %rcx */
12 * 8, /* %rdx */
9 * 8, /* %rsi */
8 * 8, /* %rdi */
10 * 8, /* %rbp */
15 * 8, /* %rsp */
0 * 8, /* %r8 */
1 * 8, /* %r9 */
2 * 8, /* %r10 */
3 * 8, /* %r11 */
4 * 8, /* %r12 */
5 * 8, /* %r13 */
6 * 8, /* %r14 */
7 * 8, /* %r15 */
16 * 8, /* %rip */
17 * 8, /* %eflags */
/* FIXME: kettenis/2002030531: The registers %cs, %fs and %gs are
available in `struct sigcontext'. However, they only occupy two
bytes instead of four, which makes using them here rather
difficult. Leave them out for now. */
-1, /* %cs */
-1, /* %ss */
-1, /* %ds */
-1, /* %es */
-1, /* %fs */
-1 /* %gs */
};
static int
amd64_linux_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
struct reggroup *group)
{
amd64-linux: expose system register FS_BASE and GS_BASE for Linux. This patch allows examination of the registers FS_BASE and GS_BASE for Linux Systems running on 64bit. Tests for simple read and write of the new registers is also added with this patch. 2017-01-27 Walfred Tedeschi <walfred.tedeschi@intel.com> Richard Henderson <rth@redhat.com> gdb/ChangeLog: * amd64-linux-nat.c (PTRACE_ARCH_PRCTL): New define. (amd64_linux_fetch_inferior_registers): Add case to fetch FS_BASE GS_BASE for older kernels. (amd64_linux_store_inferior_registers): Add case to store FS_BASE GS_BASE for older kernels. * amd64-linux-tdep.c (amd64_linux_gregset_reg_offset): Add FS_BASE and GS_BASE to the offset table. (amd64_linux_register_reggroup_p): Add FS_BASE and GS_BASE to the system register group. * amd64-nat.c (amd64_native_gregset_reg_offset): Implements case for older kernels. * amd64-tdep.c (amd64_init_abi): Add segment registers for the amd64 ABI. * amd64-tdep.h (amd64_regnum): Add AMD64_FSBASE_REGNUM and AMD64_GSBASE_REGNUM. (AMD64_NUM_REGS): Set to AMD64_GSBASE_REGNUM + 1. * features/Makefile (amd64-linux.dat, amd64-avx-linux.dat) (amd64-mpx-linux.dat, amd64-avx512-linux.dat, x32-linux.dat) (x32-avx-linux.dat, x32-avx512-linux.dat): Add i386/64bit-segments.xml in those rules. * features/i386/64bit-segments.xml: New file. * features/i386/amd64-avx-mpx-linux.xml: Add 64bit-segments.xml. * features/i386/amd64-avx-linux.xml: Add 64bit-segments.xml. * features/i386/amd64-avx512-linux.xml: Add 64bit-segments.xml. * features/i386/amd64-mpx-linux.xml: Add 64bit-segments.xml. * features/i386/x32-avx512-linux.xml: Add 64bit-segments.xml. * features/i386/x32-avx-linux.xml: Add 64bit-segments.xml. * features/i386/amd64-linux.xml: Add 64bit-segments.xml. * features/i386/amd64-avx-linux.c: Regenerated. * features/i386/amd64-avx-mpx-linux.c: Regenerated. * features/i386/amd64-avx-mpx.c: Regenerated. * features/i386/amd64-avx512-linux.c: Regenerated. * features/i386/amd64-linux.c: Regenerated. * features/i386/amd64-mpx-linux.c: Regenerated. * features/i386/i386-avx-mpx-linux.c: Regenerated. * features/i386/i386-avx-mpx.c: Regenerated. * features/i386/x32-avx-linux.c: Regenerated. * features/i386/x32-avx512-linux.c: Regenerated. * regformats/i386/amd64-avx-linux.dat: Regenerated. * regformats/i386/amd64-avx-mpx-linux.dat: Regenerated. * regformats/i386/amd64-avx512-linux.dat: Regenerated. * regformats/i386/amd64-linux.dat: Regenerated. * regformats/i386/amd64-mpx-linux.dat: Regenerated. * regformats/i386/x32-avx-linux.dat: Regenerated. * regformats/i386/x32-avx512-linux.dat: Regenerated. * regformats/i386/x32-linux.dat: Regenerated. gdb/doc/ChangeLog: * gdb.texinfo (i386 Features): Add system segment registers as feature. gdb/gdbserver/ChangeLog: * linux-x86-low.c (x86_64_regmap): Add fs_base and gs_base to the register table. (x86_fill_gregset): Add support for old kernels for the fs_base and gs_base system registers. (x86_store_gregset): Likewise. * configure.srv (srv_i386_64bit_xmlfiles): Add 64bit-segments.xml. gdb/testsuite/ChangeLog: * gdb.arch/amd64-gs_base.c: New file. * gdb.arch/amd64-gs_base.exp: New file. Change-Id: I2e0eeb93058a2320d4d3b045082643cfe4aff963 Signed-off-by: Walfred Tedeschi <walfred.tedeschi@intel.com>
2017-01-27 15:19:14 +01:00
if (regnum == AMD64_LINUX_ORIG_RAX_REGNUM
|| regnum == AMD64_FSBASE_REGNUM
|| regnum == AMD64_GSBASE_REGNUM)
return (group == system_reggroup
|| group == save_reggroup
|| group == restore_reggroup);
return i386_register_reggroup_p (gdbarch, regnum, group);
}
/* Set the program counter for process PTID to PC. */
static void
* gdbarch.sh (read_pc): Add REGCACHE argument. Remove PTID argument. (write_pc): Likewise. Remove default implementation, add predicate. * gdbarch.c, gdbarch.h: Regenerate. * regcache.c (read_pc_pid): Use current regcache instead of calling read_register_pid. (write_pc_pid): Check gdbarch_write_pc predicate, implement default case inline. (generic_target_write_pc): Remove. * inferior.h (generic_target_write_pc): Remove. * frv-tdep.c (frv_gdbarch_init): Do not install it. * m68hc11-tdep.c (m68hc11_gdbarch_init): Likewise. * rs6000-tdep.c (rs6000_gdbarch_init): Likewise. * sh64-tdep.c (sh64_gdbarch_init): Likewise. * sh-tdep.c (sh_gdbarch_init): Likewise. * xstormy16-tdep.c (xstormy16_gdbarch_init): Likewise. * avr-tdep.c (avr_read_pc): Add REGCACHE argument. Remove PTID argument. Use REGCACHE instead of calling read_register_pid. * hppa-hpux-tdep.c (hppa_hpux_read_pc): Likewise. * hppa-tdep.c (hppa_read_pc): Likewise. * hppa-tdep.h (hppa_read_pc): Likewise. * ia64-tdep.c (ia64_read_pc): Likewise. * m32r-tdep.c (m32r_read_pc): Likewise. * mep-tdep.c (mep_read_pc): Likewise. * mn10300-tdep.c (mn10300_read_pc): Likewise. * spu-tdep.c (spu_read_pc): Likewise. * arm-tdep.c (arm_write_pc): Add REGCACHE argument. Remove PTID argument. Use REGCACHE instead of calling write_register_pid. * avr-tdep.c (avr_write_pc): Likewise. * hppa-hpux-tdep.c (hppa_hpux_write_pc): Likewise. * hppa-tdep.c (hppa_write_pc): Likewise. * hppa-tdep.h (hppa_write_pc): Likewise. * i386-linux-tdep.c (i386_linux_write_pc): Likewise. * amd64-linux-tdep.c (amd64_linux_write_pc): Likewise. * ia64-linux-tdep.c (ia64_linux_write_pc): Likewise. * ia64-tdep.c (ia64_write_pc): Likewise. * ia64-tdep.h (ia64_write_pc): Likewise. * m32r-tdep.c (m32r_write_pc): Likewise. * m88k-tdep.c (m88k_write_pc): Likewise. * mep-tdep.c (mep_write_pc): Likewise. * mips-tdep.c (mips_write_pc): Likewise. * mips-linux-tdep.c (mips_linux_write_pc): Likewise. * mn10300-tdep.c (mn10300_write_pc): Likewise. * sparc-tdep.c (sparc_write_pc): Likewise. * spu-tdep.c (spu_write_pc): Likewise. * mips-tdep.c (read_signed_register): Remove. (read_signed_register_pid): Likewise. (mips_read_pc): Add REGCACHE argument. Remove PTID argument. Use REGCACHE instead of calling read_signed_register_pid.
2007-06-16 00:44:56 +02:00
amd64_linux_write_pc (struct regcache *regcache, CORE_ADDR pc)
{
* gdbarch.sh (read_pc): Add REGCACHE argument. Remove PTID argument. (write_pc): Likewise. Remove default implementation, add predicate. * gdbarch.c, gdbarch.h: Regenerate. * regcache.c (read_pc_pid): Use current regcache instead of calling read_register_pid. (write_pc_pid): Check gdbarch_write_pc predicate, implement default case inline. (generic_target_write_pc): Remove. * inferior.h (generic_target_write_pc): Remove. * frv-tdep.c (frv_gdbarch_init): Do not install it. * m68hc11-tdep.c (m68hc11_gdbarch_init): Likewise. * rs6000-tdep.c (rs6000_gdbarch_init): Likewise. * sh64-tdep.c (sh64_gdbarch_init): Likewise. * sh-tdep.c (sh_gdbarch_init): Likewise. * xstormy16-tdep.c (xstormy16_gdbarch_init): Likewise. * avr-tdep.c (avr_read_pc): Add REGCACHE argument. Remove PTID argument. Use REGCACHE instead of calling read_register_pid. * hppa-hpux-tdep.c (hppa_hpux_read_pc): Likewise. * hppa-tdep.c (hppa_read_pc): Likewise. * hppa-tdep.h (hppa_read_pc): Likewise. * ia64-tdep.c (ia64_read_pc): Likewise. * m32r-tdep.c (m32r_read_pc): Likewise. * mep-tdep.c (mep_read_pc): Likewise. * mn10300-tdep.c (mn10300_read_pc): Likewise. * spu-tdep.c (spu_read_pc): Likewise. * arm-tdep.c (arm_write_pc): Add REGCACHE argument. Remove PTID argument. Use REGCACHE instead of calling write_register_pid. * avr-tdep.c (avr_write_pc): Likewise. * hppa-hpux-tdep.c (hppa_hpux_write_pc): Likewise. * hppa-tdep.c (hppa_write_pc): Likewise. * hppa-tdep.h (hppa_write_pc): Likewise. * i386-linux-tdep.c (i386_linux_write_pc): Likewise. * amd64-linux-tdep.c (amd64_linux_write_pc): Likewise. * ia64-linux-tdep.c (ia64_linux_write_pc): Likewise. * ia64-tdep.c (ia64_write_pc): Likewise. * ia64-tdep.h (ia64_write_pc): Likewise. * m32r-tdep.c (m32r_write_pc): Likewise. * m88k-tdep.c (m88k_write_pc): Likewise. * mep-tdep.c (mep_write_pc): Likewise. * mips-tdep.c (mips_write_pc): Likewise. * mips-linux-tdep.c (mips_linux_write_pc): Likewise. * mn10300-tdep.c (mn10300_write_pc): Likewise. * sparc-tdep.c (sparc_write_pc): Likewise. * spu-tdep.c (spu_write_pc): Likewise. * mips-tdep.c (read_signed_register): Remove. (read_signed_register_pid): Likewise. (mips_read_pc): Add REGCACHE argument. Remove PTID argument. Use REGCACHE instead of calling read_signed_register_pid.
2007-06-16 00:44:56 +02:00
regcache_cooked_write_unsigned (regcache, AMD64_RIP_REGNUM, pc);
/* We must be careful with modifying the program counter. If we
just interrupted a system call, the kernel might try to restart
it when we resume the inferior. On restarting the system call,
the kernel will try backing up the program counter even though it
no longer points at the system call. This typically results in a
SIGSEGV or SIGILL. We can prevent this by writing `-1' in the
"orig_rax" pseudo-register.
Note that "orig_rax" is saved when setting up a dummy call frame.
This means that it is properly restored when that frame is
popped, and that the interrupted system call will be restarted
when we resume the inferior on return from a function call from
within GDB. In all other cases the system call will not be
restarted. */
* gdbarch.sh (read_pc): Add REGCACHE argument. Remove PTID argument. (write_pc): Likewise. Remove default implementation, add predicate. * gdbarch.c, gdbarch.h: Regenerate. * regcache.c (read_pc_pid): Use current regcache instead of calling read_register_pid. (write_pc_pid): Check gdbarch_write_pc predicate, implement default case inline. (generic_target_write_pc): Remove. * inferior.h (generic_target_write_pc): Remove. * frv-tdep.c (frv_gdbarch_init): Do not install it. * m68hc11-tdep.c (m68hc11_gdbarch_init): Likewise. * rs6000-tdep.c (rs6000_gdbarch_init): Likewise. * sh64-tdep.c (sh64_gdbarch_init): Likewise. * sh-tdep.c (sh_gdbarch_init): Likewise. * xstormy16-tdep.c (xstormy16_gdbarch_init): Likewise. * avr-tdep.c (avr_read_pc): Add REGCACHE argument. Remove PTID argument. Use REGCACHE instead of calling read_register_pid. * hppa-hpux-tdep.c (hppa_hpux_read_pc): Likewise. * hppa-tdep.c (hppa_read_pc): Likewise. * hppa-tdep.h (hppa_read_pc): Likewise. * ia64-tdep.c (ia64_read_pc): Likewise. * m32r-tdep.c (m32r_read_pc): Likewise. * mep-tdep.c (mep_read_pc): Likewise. * mn10300-tdep.c (mn10300_read_pc): Likewise. * spu-tdep.c (spu_read_pc): Likewise. * arm-tdep.c (arm_write_pc): Add REGCACHE argument. Remove PTID argument. Use REGCACHE instead of calling write_register_pid. * avr-tdep.c (avr_write_pc): Likewise. * hppa-hpux-tdep.c (hppa_hpux_write_pc): Likewise. * hppa-tdep.c (hppa_write_pc): Likewise. * hppa-tdep.h (hppa_write_pc): Likewise. * i386-linux-tdep.c (i386_linux_write_pc): Likewise. * amd64-linux-tdep.c (amd64_linux_write_pc): Likewise. * ia64-linux-tdep.c (ia64_linux_write_pc): Likewise. * ia64-tdep.c (ia64_write_pc): Likewise. * ia64-tdep.h (ia64_write_pc): Likewise. * m32r-tdep.c (m32r_write_pc): Likewise. * m88k-tdep.c (m88k_write_pc): Likewise. * mep-tdep.c (mep_write_pc): Likewise. * mips-tdep.c (mips_write_pc): Likewise. * mips-linux-tdep.c (mips_linux_write_pc): Likewise. * mn10300-tdep.c (mn10300_write_pc): Likewise. * sparc-tdep.c (sparc_write_pc): Likewise. * spu-tdep.c (spu_write_pc): Likewise. * mips-tdep.c (read_signed_register): Remove. (read_signed_register_pid): Likewise. (mips_read_pc): Add REGCACHE argument. Remove PTID argument. Use REGCACHE instead of calling read_signed_register_pid.
2007-06-16 00:44:56 +02:00
regcache_cooked_write_unsigned (regcache, AMD64_LINUX_ORIG_RAX_REGNUM, -1);
}
/* Record all registers but IP register for process-record. */
static int
amd64_all_but_ip_registers_record (struct regcache *regcache)
{
if (record_full_arch_list_add_reg (regcache, AMD64_RAX_REGNUM))
return -1;
if (record_full_arch_list_add_reg (regcache, AMD64_RCX_REGNUM))
return -1;
if (record_full_arch_list_add_reg (regcache, AMD64_RDX_REGNUM))
return -1;
if (record_full_arch_list_add_reg (regcache, AMD64_RBX_REGNUM))
return -1;
if (record_full_arch_list_add_reg (regcache, AMD64_RSP_REGNUM))
return -1;
if (record_full_arch_list_add_reg (regcache, AMD64_RBP_REGNUM))
return -1;
if (record_full_arch_list_add_reg (regcache, AMD64_RSI_REGNUM))
return -1;
if (record_full_arch_list_add_reg (regcache, AMD64_RDI_REGNUM))
return -1;
if (record_full_arch_list_add_reg (regcache, AMD64_R8_REGNUM))
return -1;
if (record_full_arch_list_add_reg (regcache, AMD64_R9_REGNUM))
return -1;
if (record_full_arch_list_add_reg (regcache, AMD64_R10_REGNUM))
return -1;
if (record_full_arch_list_add_reg (regcache, AMD64_R11_REGNUM))
return -1;
if (record_full_arch_list_add_reg (regcache, AMD64_R12_REGNUM))
return -1;
if (record_full_arch_list_add_reg (regcache, AMD64_R13_REGNUM))
return -1;
if (record_full_arch_list_add_reg (regcache, AMD64_R14_REGNUM))
return -1;
if (record_full_arch_list_add_reg (regcache, AMD64_R15_REGNUM))
return -1;
if (record_full_arch_list_add_reg (regcache, AMD64_EFLAGS_REGNUM))
return -1;
return 0;
}
/* amd64_canonicalize_syscall maps from the native amd64 Linux set
of syscall ids into a canonical set of syscall ids used by
process record. */
static enum gdb_syscall
amd64_canonicalize_syscall (enum amd64_syscall syscall_number)
{
DIAGNOSTIC_PUSH
DIAGNOSTIC_IGNORE_SWITCH_DIFFERENT_ENUM_TYPES
switch (syscall_number) {
case amd64_sys_read:
case amd64_x32_sys_read:
return gdb_sys_read;
case amd64_sys_write:
case amd64_x32_sys_write:
return gdb_sys_write;
case amd64_sys_open:
case amd64_x32_sys_open:
return gdb_sys_open;
case amd64_sys_close:
case amd64_x32_sys_close:
return gdb_sys_close;
case amd64_sys_newstat:
case amd64_x32_sys_newstat:
return gdb_sys_newstat;
case amd64_sys_newfstat:
case amd64_x32_sys_newfstat:
return gdb_sys_newfstat;
case amd64_sys_newlstat:
case amd64_x32_sys_newlstat:
return gdb_sys_newlstat;
case amd64_sys_poll:
case amd64_x32_sys_poll:
return gdb_sys_poll;
case amd64_sys_lseek:
case amd64_x32_sys_lseek:
return gdb_sys_lseek;
case amd64_sys_mmap:
case amd64_x32_sys_mmap:
return gdb_sys_mmap2;
case amd64_sys_mprotect:
case amd64_x32_sys_mprotect:
return gdb_sys_mprotect;
case amd64_sys_munmap:
case amd64_x32_sys_munmap:
return gdb_sys_munmap;
case amd64_sys_brk:
case amd64_x32_sys_brk:
return gdb_sys_brk;
case amd64_sys_rt_sigaction:
case amd64_x32_sys_rt_sigaction:
return gdb_sys_rt_sigaction;
case amd64_sys_rt_sigprocmask:
case amd64_x32_sys_rt_sigprocmask:
return gdb_sys_rt_sigprocmask;
case amd64_sys_rt_sigreturn:
case amd64_x32_sys_rt_sigreturn:
return gdb_sys_rt_sigreturn;
case amd64_sys_ioctl:
case amd64_x32_sys_ioctl:
return gdb_sys_ioctl;
case amd64_sys_pread64:
case amd64_x32_sys_pread64:
return gdb_sys_pread64;
case amd64_sys_pwrite64:
case amd64_x32_sys_pwrite64:
return gdb_sys_pwrite64;
case amd64_sys_readv:
case amd64_x32_sys_readv:
return gdb_sys_readv;
case amd64_sys_writev:
case amd64_x32_sys_writev:
return gdb_sys_writev;
case amd64_sys_access:
case amd64_x32_sys_access:
return gdb_sys_access;
case amd64_sys_pipe:
case amd64_x32_sys_pipe:
return gdb_sys_pipe;
case amd64_sys_select:
case amd64_x32_sys_select:
return gdb_sys_select;
case amd64_sys_sched_yield:
case amd64_x32_sys_sched_yield:
return gdb_sys_sched_yield;
case amd64_sys_mremap:
case amd64_x32_sys_mremap:
return gdb_sys_mremap;
case amd64_sys_msync:
case amd64_x32_sys_msync:
return gdb_sys_msync;
case amd64_sys_mincore:
case amd64_x32_sys_mincore:
return gdb_sys_mincore;
case amd64_sys_madvise:
case amd64_x32_sys_madvise:
return gdb_sys_madvise;
case amd64_sys_shmget:
case amd64_x32_sys_shmget:
return gdb_sys_shmget;
case amd64_sys_shmat:
case amd64_x32_sys_shmat:
return gdb_sys_shmat;
case amd64_sys_shmctl:
case amd64_x32_sys_shmctl:
return gdb_sys_shmctl;
case amd64_sys_dup:
case amd64_x32_sys_dup:
return gdb_sys_dup;
case amd64_sys_dup2:
case amd64_x32_sys_dup2:
return gdb_sys_dup2;
case amd64_sys_pause:
case amd64_x32_sys_pause:
return gdb_sys_pause;
case amd64_sys_nanosleep:
case amd64_x32_sys_nanosleep:
return gdb_sys_nanosleep;
case amd64_sys_getitimer:
case amd64_x32_sys_getitimer:
return gdb_sys_getitimer;
case amd64_sys_alarm:
case amd64_x32_sys_alarm:
return gdb_sys_alarm;
case amd64_sys_setitimer:
case amd64_x32_sys_setitimer:
return gdb_sys_setitimer;
case amd64_sys_getpid:
case amd64_x32_sys_getpid:
return gdb_sys_getpid;
case amd64_sys_sendfile64:
case amd64_x32_sys_sendfile64:
return gdb_sys_sendfile64;
case amd64_sys_socket:
case amd64_x32_sys_socket:
return gdb_sys_socket;
case amd64_sys_connect:
case amd64_x32_sys_connect:
return gdb_sys_connect;
case amd64_sys_accept:
case amd64_x32_sys_accept:
return gdb_sys_accept;
case amd64_sys_sendto:
case amd64_x32_sys_sendto:
return gdb_sys_sendto;
case amd64_sys_recvfrom:
case amd64_x32_sys_recvfrom:
return gdb_sys_recvfrom;
case amd64_sys_sendmsg:
case amd64_x32_sys_sendmsg:
return gdb_sys_sendmsg;
case amd64_sys_recvmsg:
case amd64_x32_sys_recvmsg:
return gdb_sys_recvmsg;
case amd64_sys_shutdown:
case amd64_x32_sys_shutdown:
return gdb_sys_shutdown;
case amd64_sys_bind:
case amd64_x32_sys_bind:
return gdb_sys_bind;
case amd64_sys_listen:
case amd64_x32_sys_listen:
return gdb_sys_listen;
case amd64_sys_getsockname:
case amd64_x32_sys_getsockname:
return gdb_sys_getsockname;
case amd64_sys_getpeername:
case amd64_x32_sys_getpeername:
return gdb_sys_getpeername;
case amd64_sys_socketpair:
case amd64_x32_sys_socketpair:
return gdb_sys_socketpair;
case amd64_sys_setsockopt:
case amd64_x32_sys_setsockopt:
return gdb_sys_setsockopt;
case amd64_sys_getsockopt:
case amd64_x32_sys_getsockopt:
return gdb_sys_getsockopt;
case amd64_sys_clone:
case amd64_x32_sys_clone:
return gdb_sys_clone;
case amd64_sys_fork:
case amd64_x32_sys_fork:
return gdb_sys_fork;
case amd64_sys_vfork:
case amd64_x32_sys_vfork:
return gdb_sys_vfork;
case amd64_sys_execve:
case amd64_x32_sys_execve:
return gdb_sys_execve;
case amd64_sys_exit:
case amd64_x32_sys_exit:
return gdb_sys_exit;
case amd64_sys_wait4:
case amd64_x32_sys_wait4:
return gdb_sys_wait4;
case amd64_sys_kill:
case amd64_x32_sys_kill:
return gdb_sys_kill;
case amd64_sys_uname:
case amd64_x32_sys_uname:
return gdb_sys_uname;
case amd64_sys_semget:
case amd64_x32_sys_semget:
return gdb_sys_semget;
case amd64_sys_semop:
case amd64_x32_sys_semop:
return gdb_sys_semop;
case amd64_sys_semctl:
case amd64_x32_sys_semctl:
return gdb_sys_semctl;
case amd64_sys_shmdt:
case amd64_x32_sys_shmdt:
return gdb_sys_shmdt;
case amd64_sys_msgget:
case amd64_x32_sys_msgget:
return gdb_sys_msgget;
case amd64_sys_msgsnd:
case amd64_x32_sys_msgsnd:
return gdb_sys_msgsnd;
case amd64_sys_msgrcv:
case amd64_x32_sys_msgrcv:
return gdb_sys_msgrcv;
case amd64_sys_msgctl:
case amd64_x32_sys_msgctl:
return gdb_sys_msgctl;
case amd64_sys_fcntl:
case amd64_x32_sys_fcntl:
return gdb_sys_fcntl;
case amd64_sys_flock:
case amd64_x32_sys_flock:
return gdb_sys_flock;
case amd64_sys_fsync:
case amd64_x32_sys_fsync:
return gdb_sys_fsync;
case amd64_sys_fdatasync:
case amd64_x32_sys_fdatasync:
return gdb_sys_fdatasync;
case amd64_sys_truncate:
case amd64_x32_sys_truncate:
return gdb_sys_truncate;
case amd64_sys_ftruncate:
case amd64_x32_sys_ftruncate:
return gdb_sys_ftruncate;
case amd64_sys_getdents:
case amd64_x32_sys_getdents:
return gdb_sys_getdents;
case amd64_sys_getcwd:
case amd64_x32_sys_getcwd:
return gdb_sys_getcwd;
case amd64_sys_chdir:
case amd64_x32_sys_chdir:
return gdb_sys_chdir;
case amd64_sys_fchdir:
case amd64_x32_sys_fchdir:
return gdb_sys_fchdir;
case amd64_sys_rename:
case amd64_x32_sys_rename:
return gdb_sys_rename;
case amd64_sys_mkdir:
case amd64_x32_sys_mkdir:
return gdb_sys_mkdir;
case amd64_sys_rmdir:
case amd64_x32_sys_rmdir:
return gdb_sys_rmdir;
case amd64_sys_creat:
case amd64_x32_sys_creat:
return gdb_sys_creat;
case amd64_sys_link:
case amd64_x32_sys_link:
return gdb_sys_link;
case amd64_sys_unlink:
case amd64_x32_sys_unlink:
return gdb_sys_unlink;
case amd64_sys_symlink:
case amd64_x32_sys_symlink:
return gdb_sys_symlink;
case amd64_sys_readlink:
case amd64_x32_sys_readlink:
return gdb_sys_readlink;
case amd64_sys_chmod:
case amd64_x32_sys_chmod:
return gdb_sys_chmod;
case amd64_sys_fchmod:
case amd64_x32_sys_fchmod:
return gdb_sys_fchmod;
case amd64_sys_chown:
case amd64_x32_sys_chown:
return gdb_sys_chown;
case amd64_sys_fchown:
case amd64_x32_sys_fchown:
return gdb_sys_fchown;
case amd64_sys_lchown:
case amd64_x32_sys_lchown:
return gdb_sys_lchown;
case amd64_sys_umask:
case amd64_x32_sys_umask:
return gdb_sys_umask;
case amd64_sys_gettimeofday:
case amd64_x32_sys_gettimeofday:
return gdb_sys_gettimeofday;
case amd64_sys_getrlimit:
case amd64_x32_sys_getrlimit:
return gdb_sys_getrlimit;
case amd64_sys_getrusage:
case amd64_x32_sys_getrusage:
return gdb_sys_getrusage;
case amd64_sys_sysinfo:
case amd64_x32_sys_sysinfo:
return gdb_sys_sysinfo;
case amd64_sys_times:
case amd64_x32_sys_times:
return gdb_sys_times;
case amd64_sys_ptrace:
case amd64_x32_sys_ptrace:
return gdb_sys_ptrace;
case amd64_sys_getuid:
case amd64_x32_sys_getuid:
return gdb_sys_getuid;
case amd64_sys_syslog:
case amd64_x32_sys_syslog:
return gdb_sys_syslog;
case amd64_sys_getgid:
case amd64_x32_sys_getgid:
return gdb_sys_getgid;
case amd64_sys_setuid:
case amd64_x32_sys_setuid:
return gdb_sys_setuid;
case amd64_sys_setgid:
case amd64_x32_sys_setgid:
return gdb_sys_setgid;
case amd64_sys_geteuid:
case amd64_x32_sys_geteuid:
return gdb_sys_geteuid;
case amd64_sys_getegid:
case amd64_x32_sys_getegid:
return gdb_sys_getegid;
case amd64_sys_setpgid:
case amd64_x32_sys_setpgid:
return gdb_sys_setpgid;
case amd64_sys_getppid:
case amd64_x32_sys_getppid:
return gdb_sys_getppid;
case amd64_sys_getpgrp:
case amd64_x32_sys_getpgrp:
return gdb_sys_getpgrp;
case amd64_sys_setsid:
case amd64_x32_sys_setsid:
return gdb_sys_setsid;
case amd64_sys_setreuid:
case amd64_x32_sys_setreuid:
return gdb_sys_setreuid;
case amd64_sys_setregid:
case amd64_x32_sys_setregid:
return gdb_sys_setregid;
case amd64_sys_getgroups:
case amd64_x32_sys_getgroups:
return gdb_sys_getgroups;
case amd64_sys_setgroups:
case amd64_x32_sys_setgroups:
return gdb_sys_setgroups;
case amd64_sys_setresuid:
case amd64_x32_sys_setresuid:
return gdb_sys_setresuid;
case amd64_sys_getresuid:
case amd64_x32_sys_getresuid:
return gdb_sys_getresuid;
case amd64_sys_setresgid:
case amd64_x32_sys_setresgid:
return gdb_sys_setresgid;
case amd64_sys_getresgid:
case amd64_x32_sys_getresgid:
return gdb_sys_getresgid;
case amd64_sys_getpgid:
case amd64_x32_sys_getpgid:
return gdb_sys_getpgid;
case amd64_sys_setfsuid:
case amd64_x32_sys_setfsuid:
return gdb_sys_setfsuid;
case amd64_sys_setfsgid:
case amd64_x32_sys_setfsgid:
return gdb_sys_setfsgid;
case amd64_sys_getsid:
case amd64_x32_sys_getsid:
return gdb_sys_getsid;
case amd64_sys_capget:
case amd64_x32_sys_capget:
return gdb_sys_capget;
case amd64_sys_capset:
case amd64_x32_sys_capset:
return gdb_sys_capset;
case amd64_sys_rt_sigpending:
case amd64_x32_sys_rt_sigpending:
return gdb_sys_rt_sigpending;
case amd64_sys_rt_sigtimedwait:
case amd64_x32_sys_rt_sigtimedwait:
return gdb_sys_rt_sigtimedwait;
case amd64_sys_rt_sigqueueinfo:
case amd64_x32_sys_rt_sigqueueinfo:
return gdb_sys_rt_sigqueueinfo;
case amd64_sys_rt_sigsuspend:
case amd64_x32_sys_rt_sigsuspend:
return gdb_sys_rt_sigsuspend;
case amd64_sys_sigaltstack:
case amd64_x32_sys_sigaltstack:
return gdb_sys_sigaltstack;
case amd64_sys_utime:
case amd64_x32_sys_utime:
return gdb_sys_utime;
case amd64_sys_mknod:
case amd64_x32_sys_mknod:
return gdb_sys_mknod;
case amd64_sys_personality:
case amd64_x32_sys_personality:
return gdb_sys_personality;
case amd64_sys_ustat:
case amd64_x32_sys_ustat:
return gdb_sys_ustat;
case amd64_sys_statfs:
case amd64_x32_sys_statfs:
return gdb_sys_statfs;
case amd64_sys_fstatfs:
case amd64_x32_sys_fstatfs:
return gdb_sys_fstatfs;
case amd64_sys_sysfs:
case amd64_x32_sys_sysfs:
return gdb_sys_sysfs;
case amd64_sys_getpriority:
case amd64_x32_sys_getpriority:
return gdb_sys_getpriority;
case amd64_sys_setpriority:
case amd64_x32_sys_setpriority:
return gdb_sys_setpriority;
case amd64_sys_sched_setparam:
case amd64_x32_sys_sched_setparam:
return gdb_sys_sched_setparam;
case amd64_sys_sched_getparam:
case amd64_x32_sys_sched_getparam:
return gdb_sys_sched_getparam;
case amd64_sys_sched_setscheduler:
case amd64_x32_sys_sched_setscheduler:
return gdb_sys_sched_setscheduler;
case amd64_sys_sched_getscheduler:
case amd64_x32_sys_sched_getscheduler:
return gdb_sys_sched_getscheduler;
case amd64_sys_sched_get_priority_max:
case amd64_x32_sys_sched_get_priority_max:
return gdb_sys_sched_get_priority_max;
case amd64_sys_sched_get_priority_min:
case amd64_x32_sys_sched_get_priority_min:
return gdb_sys_sched_get_priority_min;
case amd64_sys_sched_rr_get_interval:
case amd64_x32_sys_sched_rr_get_interval:
return gdb_sys_sched_rr_get_interval;
case amd64_sys_mlock:
case amd64_x32_sys_mlock:
return gdb_sys_mlock;
case amd64_sys_munlock:
case amd64_x32_sys_munlock:
return gdb_sys_munlock;
case amd64_sys_mlockall:
case amd64_x32_sys_mlockall:
return gdb_sys_mlockall;
case amd64_sys_munlockall:
case amd64_x32_sys_munlockall:
return gdb_sys_munlockall;
case amd64_sys_vhangup:
case amd64_x32_sys_vhangup:
return gdb_sys_vhangup;
case amd64_sys_modify_ldt:
case amd64_x32_sys_modify_ldt:
return gdb_sys_modify_ldt;
case amd64_sys_pivot_root:
case amd64_x32_sys_pivot_root:
return gdb_sys_pivot_root;
case amd64_sys_sysctl:
case amd64_x32_sys_sysctl:
return gdb_sys_sysctl;
case amd64_sys_prctl:
case amd64_x32_sys_prctl:
return gdb_sys_prctl;
case amd64_sys_arch_prctl:
case amd64_x32_sys_arch_prctl:
Mostly trivial enum fixes This is a patch I extracted from Pedro's C++ branch. It contains the most trivial enum fixes, where an integer type/value was used instead of the appropriate enum type/value. It fixes many C++ errors, since in C++ you can't mix integers and enums implicitely. Regardless of the C++ conversion, I think this is a good cleanup to make use of the appropriate enum types. Regression-tested on native x86_64. gdb/ChangeLog: * aarch64-linux-nat.c (aarch64_linux_can_use_hw_breakpoint): Use enum type or value instead of integer. (aarch64_linux_insert_watchpoint): Likewise. (aarch64_linux_remove_watchpoint): Likewise. * ada-lang.c (ada_op_print_tab): Likewise. * amd64-linux-tdep.c (amd64_canonicalize_syscall): Likewise. (amd64_linux_syscall_record_common): Likewise. * arch-utils.c (target_byte_order_user): Likewise. (default_byte_order): Likewise. * arm-linux-nat.c (arm_linux_can_use_hw_breakpoint): Likewise. (arm_linux_get_hwbp_type): Likewise. (arm_linux_hw_watchpoint_initialize): Likewise. (arm_linux_insert_watchpoint): Likewise. * arm-linux-tdep.c (arm_canonicalize_syscall): Likewise. (arm_linux_syscall_record): Likewise. * breakpoint.c (update_watchpoint): Likewise. (breakpoint_here_p): Likewise. (bpstat_print): Likewise. (enable_breakpoint_disp): Likewise. * c-lang.c (c_op_print_tab): Likewise. * cli/cli-decode.c (add_info_alias): Likewise. * d-lang.c (d_op_print_tab): Likewise. * eval.c (evaluate_subexp_standard): Likewise. * f-exp.y (dot_ops): Likewise. (f77_keywords): Likewise. * f-lang.c (f_op_print_tab): Likewise. * go-lang.c (go_op_print_tab): Likewise. * guile/scm-breakpoint.c (gdbscm_make_breakpoint): Likewise. * guile/scm-cmd.c (gdbscm_make_command): Likewise. * guile/scm-param.c (gdbscm_make_parameter): Likewise. * guile/scm-pretty-print.c (gdbscm_apply_val_pretty_printer): Likewise. * guile/scm-string.c (struct scm_to_stringn_data): Likewise. (struct scm_from_stringn_data): Likewise. * i386-linux-tdep.c (i386_canonicalize_syscall): Likewise. * ia64-linux-nat.c (ia64_linux_insert_watchpoint): Likewise. (ia64_linux_remove_watchpoint): Likewise. (ia64_linux_can_use_hw_breakpoint): Likewise. * infrun.c (print_stop_event): Likewise. * jv-lang.c (java_op_print_tab): Likewise. * linux-nat.c (linux_proc_xfer_partial): Likewise. * linux-nat.h (struct lwp_info): Likewise. * linux-thread-db.c (enable_thread_event): Likewise. * m2-lang.c (m2_op_print_tab): Likewise. * mi/mi-cmd-stack.c (mi_cmd_stack_list_locals): Likewise. (mi_cmd_stack_list_variables): Likewise. * mi/mi-main.c (mi_cmd_trace_frame_collected): Likewise. * mi/mi-out.c (mi_table_begin): Likewise. (mi_table_header): Likewise. * mips-linux-nat.c (mips_linux_can_use_hw_breakpoint): Likewise. (mips_linux_insert_watchpoint): Likewise. (mips_linux_remove_watchpoint): Likewise. * nat/mips-linux-watch.c (mips_linux_watch_type_to_irw): Likewise. * nat/mips-linux-watch.h (struct mips_watchpoint): Likewise. (mips_linux_watch_type_to_irw): Likewise. * nto-procfs.c (procfs_can_use_hw_breakpoint): Likewise. (procfs_insert_hw_watchpoint): Likewise. (procfs_remove_hw_watchpoint): Likewise. (procfs_hw_watchpoint): Likewise. (procfs_can_use_hw_breakpoint): Likewise. (procfs_remove_hw_watchpoint): Likewise. (procfs_insert_hw_watchpoint): Likewise. * p-lang.c (pascal_op_print_tab): Likewise. * ppc-linux-nat.c (ppc_linux_can_use_hw_breakpoint): Likewise. * ppc-linux-tdep.c (ppu2spu_unwind_register): Likewise. * ppc-sysv-tdep.c (get_decimal_float_return_value): Likewise. * procfs.c (procfs_can_use_hw_breakpoint): Likewise. (procfs_insert_watchpoint): Likewise. (procfs_remove_watchpoint): Likewise. * psymtab.c (recursively_search_psymtabs): Likewise. * remote-m32r-sdi.c (m32r_can_use_hw_watchpoint): Likewise. (m32r_insert_watchpoint): Likewise. * remote-mips.c (mips_can_use_watchpoint): Likewise. (mips_insert_watchpoint): Likewise. (mips_remove_watchpoint): Likewise. * remote.c (watchpoint_to_Z_packet): Likewise. (remote_insert_watchpoint): Likewise. (remote_remove_watchpoint): Likewise. (remote_check_watch_resources): Likewise. * s390-linux-nat.c (s390_insert_watchpoint): Likewise. (s390_remove_watchpoint): Likewise. (s390_can_use_hw_breakpoint): Likewise. * s390-linux-tdep.c (s390_gdbarch_init): Likewise. * spu-linux-nat.c (spu_can_use_hw_breakpoint): Likewise. * target.h (struct target_ops): Likewise. * tilegx-tdep.c (tilegx_analyze_prologue): Likewise. * ui-out.c (struct ui_out_hdr): Likewise. (append_header_to_list): Likewise. (get_next_header): Likewise. (verify_field): Likewise. (ui_out_begin): Likewise. (ui_out_field_int): Likewise. (ui_out_field_fmt_int): Likewise. (ui_out_field_skip): Likewise. (ui_out_field_string): Likewise. (ui_out_field_fmt): Likewise. * varobj.c (new_variable): Likewise. * x86-nat.c (x86_insert_watchpoint): Likewise. (x86_remove_watchpoint): Likewise. (x86_can_use_hw_breakpoint): Likewise. * xtensa-tdep.h (struct gdbarch_tdep): Likewise. * inflow.c (enum gdb_has_a_terminal_flag_enum): Add name to previously anonymous enumeration type.. * linux-record.h (enum gdb_syscall): Add gdb_sys_no_syscall value. * target-debug.h (target_debug_print_enum_target_hw_bp_type): New. (target_debug_print_enum_bptype): New. * target-delegates.c: Regenerate.
2015-07-31 19:19:53 +02:00
return gdb_sys_no_syscall; /* Note */
case amd64_sys_adjtimex:
case amd64_x32_sys_adjtimex:
return gdb_sys_adjtimex;
case amd64_sys_setrlimit:
case amd64_x32_sys_setrlimit:
return gdb_sys_setrlimit;
case amd64_sys_chroot:
case amd64_x32_sys_chroot:
return gdb_sys_chroot;
case amd64_sys_sync:
case amd64_x32_sys_sync:
return gdb_sys_sync;
case amd64_sys_acct:
case amd64_x32_sys_acct:
return gdb_sys_acct;
case amd64_sys_settimeofday:
case amd64_x32_sys_settimeofday:
return gdb_sys_settimeofday;
case amd64_sys_mount:
case amd64_x32_sys_mount:
return gdb_sys_mount;
case amd64_sys_umount:
case amd64_x32_sys_umount:
return gdb_sys_umount;
case amd64_sys_swapon:
case amd64_x32_sys_swapon:
return gdb_sys_swapon;
case amd64_sys_swapoff:
case amd64_x32_sys_swapoff:
return gdb_sys_swapoff;
case amd64_sys_reboot:
case amd64_x32_sys_reboot:
return gdb_sys_reboot;
case amd64_sys_sethostname:
case amd64_x32_sys_sethostname:
return gdb_sys_sethostname;
case amd64_sys_setdomainname:
case amd64_x32_sys_setdomainname:
return gdb_sys_setdomainname;
case amd64_sys_iopl:
case amd64_x32_sys_iopl:
return gdb_sys_iopl;
case amd64_sys_ioperm:
case amd64_x32_sys_ioperm:
return gdb_sys_ioperm;
case amd64_sys_init_module:
case amd64_x32_sys_init_module:
return gdb_sys_init_module;
case amd64_sys_delete_module:
case amd64_x32_sys_delete_module:
return gdb_sys_delete_module;
case amd64_sys_quotactl:
case amd64_x32_sys_quotactl:
return gdb_sys_quotactl;
case amd64_sys_nfsservctl:
return gdb_sys_nfsservctl;
case amd64_sys_gettid:
case amd64_x32_sys_gettid:
return gdb_sys_gettid;
case amd64_sys_readahead:
case amd64_x32_sys_readahead:
return gdb_sys_readahead;
case amd64_sys_setxattr:
case amd64_x32_sys_setxattr:
return gdb_sys_setxattr;
case amd64_sys_lsetxattr:
case amd64_x32_sys_lsetxattr:
return gdb_sys_lsetxattr;
case amd64_sys_fsetxattr:
case amd64_x32_sys_fsetxattr:
return gdb_sys_fsetxattr;
case amd64_sys_getxattr:
case amd64_x32_sys_getxattr:
return gdb_sys_getxattr;
case amd64_sys_lgetxattr:
case amd64_x32_sys_lgetxattr:
return gdb_sys_lgetxattr;
case amd64_sys_fgetxattr:
case amd64_x32_sys_fgetxattr:
return gdb_sys_fgetxattr;
case amd64_sys_listxattr:
case amd64_x32_sys_listxattr:
return gdb_sys_listxattr;
case amd64_sys_llistxattr:
case amd64_x32_sys_llistxattr:
return gdb_sys_llistxattr;
case amd64_sys_flistxattr:
case amd64_x32_sys_flistxattr:
return gdb_sys_flistxattr;
case amd64_sys_removexattr:
case amd64_x32_sys_removexattr:
return gdb_sys_removexattr;
case amd64_sys_lremovexattr:
case amd64_x32_sys_lremovexattr:
return gdb_sys_lremovexattr;
case amd64_sys_fremovexattr:
case amd64_x32_sys_fremovexattr:
return gdb_sys_fremovexattr;
case amd64_sys_tkill:
case amd64_x32_sys_tkill:
return gdb_sys_tkill;
case amd64_sys_time:
case amd64_x32_sys_time:
return gdb_sys_time;
case amd64_sys_futex:
case amd64_x32_sys_futex:
return gdb_sys_futex;
case amd64_sys_sched_setaffinity:
case amd64_x32_sys_sched_setaffinity:
return gdb_sys_sched_setaffinity;
case amd64_sys_sched_getaffinity:
case amd64_x32_sys_sched_getaffinity:
return gdb_sys_sched_getaffinity;
case amd64_sys_io_setup:
case amd64_x32_sys_io_setup:
return gdb_sys_io_setup;
case amd64_sys_io_destroy:
case amd64_x32_sys_io_destroy:
return gdb_sys_io_destroy;
case amd64_sys_io_getevents:
case amd64_x32_sys_io_getevents:
return gdb_sys_io_getevents;
case amd64_sys_io_submit:
case amd64_x32_sys_io_submit:
return gdb_sys_io_submit;
case amd64_sys_io_cancel:
case amd64_x32_sys_io_cancel:
return gdb_sys_io_cancel;
case amd64_sys_lookup_dcookie:
case amd64_x32_sys_lookup_dcookie:
return gdb_sys_lookup_dcookie;
case amd64_sys_epoll_create:
case amd64_x32_sys_epoll_create:
return gdb_sys_epoll_create;
case amd64_sys_remap_file_pages:
case amd64_x32_sys_remap_file_pages:
return gdb_sys_remap_file_pages;
case amd64_sys_getdents64:
case amd64_x32_sys_getdents64:
return gdb_sys_getdents64;
case amd64_sys_set_tid_address:
case amd64_x32_sys_set_tid_address:
return gdb_sys_set_tid_address;
case amd64_sys_restart_syscall:
case amd64_x32_sys_restart_syscall:
return gdb_sys_restart_syscall;
case amd64_sys_semtimedop:
case amd64_x32_sys_semtimedop:
return gdb_sys_semtimedop;
case amd64_sys_fadvise64:
case amd64_x32_sys_fadvise64:
return gdb_sys_fadvise64;
case amd64_sys_timer_create:
case amd64_x32_sys_timer_create:
return gdb_sys_timer_create;
case amd64_sys_timer_settime:
case amd64_x32_sys_timer_settime:
return gdb_sys_timer_settime;
case amd64_sys_timer_gettime:
case amd64_x32_sys_timer_gettime:
return gdb_sys_timer_gettime;
case amd64_sys_timer_getoverrun:
case amd64_x32_sys_timer_getoverrun:
return gdb_sys_timer_getoverrun;
case amd64_sys_timer_delete:
case amd64_x32_sys_timer_delete:
return gdb_sys_timer_delete;
case amd64_sys_clock_settime:
case amd64_x32_sys_clock_settime:
return gdb_sys_clock_settime;
case amd64_sys_clock_gettime:
case amd64_x32_sys_clock_gettime:
return gdb_sys_clock_gettime;
case amd64_sys_clock_getres:
case amd64_x32_sys_clock_getres:
return gdb_sys_clock_getres;
case amd64_sys_clock_nanosleep:
case amd64_x32_sys_clock_nanosleep:
return gdb_sys_clock_nanosleep;
case amd64_sys_exit_group:
case amd64_x32_sys_exit_group:
return gdb_sys_exit_group;
case amd64_sys_epoll_wait:
case amd64_x32_sys_epoll_wait:
return gdb_sys_epoll_wait;
case amd64_sys_epoll_ctl:
case amd64_x32_sys_epoll_ctl:
return gdb_sys_epoll_ctl;
case amd64_sys_tgkill:
case amd64_x32_sys_tgkill:
return gdb_sys_tgkill;
case amd64_sys_utimes:
case amd64_x32_sys_utimes:
return gdb_sys_utimes;
case amd64_sys_mbind:
case amd64_x32_sys_mbind:
return gdb_sys_mbind;
case amd64_sys_set_mempolicy:
case amd64_x32_sys_set_mempolicy:
return gdb_sys_set_mempolicy;
case amd64_sys_get_mempolicy:
case amd64_x32_sys_get_mempolicy:
return gdb_sys_get_mempolicy;
case amd64_sys_mq_open:
case amd64_x32_sys_mq_open:
return gdb_sys_mq_open;
case amd64_sys_mq_unlink:
case amd64_x32_sys_mq_unlink:
return gdb_sys_mq_unlink;
case amd64_sys_mq_timedsend:
case amd64_x32_sys_mq_timedsend:
return gdb_sys_mq_timedsend;
case amd64_sys_mq_timedreceive:
case amd64_x32_sys_mq_timedreceive:
return gdb_sys_mq_timedreceive;
case amd64_sys_mq_notify:
case amd64_x32_sys_mq_notify:
return gdb_sys_mq_notify;
case amd64_sys_mq_getsetattr:
case amd64_x32_sys_mq_getsetattr:
return gdb_sys_mq_getsetattr;
case amd64_sys_kexec_load:
case amd64_x32_sys_kexec_load:
return gdb_sys_kexec_load;
case amd64_sys_waitid:
case amd64_x32_sys_waitid:
return gdb_sys_waitid;
case amd64_sys_add_key:
case amd64_x32_sys_add_key:
return gdb_sys_add_key;
case amd64_sys_request_key:
case amd64_x32_sys_request_key:
return gdb_sys_request_key;
case amd64_sys_keyctl:
case amd64_x32_sys_keyctl:
return gdb_sys_keyctl;
case amd64_sys_ioprio_set:
case amd64_x32_sys_ioprio_set:
return gdb_sys_ioprio_set;
case amd64_sys_ioprio_get:
case amd64_x32_sys_ioprio_get:
return gdb_sys_ioprio_get;
case amd64_sys_inotify_init:
case amd64_x32_sys_inotify_init:
return gdb_sys_inotify_init;
case amd64_sys_inotify_add_watch:
case amd64_x32_sys_inotify_add_watch:
return gdb_sys_inotify_add_watch;
case amd64_sys_inotify_rm_watch:
case amd64_x32_sys_inotify_rm_watch:
return gdb_sys_inotify_rm_watch;
case amd64_sys_migrate_pages:
case amd64_x32_sys_migrate_pages:
return gdb_sys_migrate_pages;
case amd64_sys_openat:
case amd64_x32_sys_openat:
return gdb_sys_openat;
case amd64_sys_mkdirat:
case amd64_x32_sys_mkdirat:
return gdb_sys_mkdirat;
case amd64_sys_mknodat:
case amd64_x32_sys_mknodat:
return gdb_sys_mknodat;
case amd64_sys_fchownat:
case amd64_x32_sys_fchownat:
return gdb_sys_fchownat;
case amd64_sys_futimesat:
case amd64_x32_sys_futimesat:
return gdb_sys_futimesat;
case amd64_sys_newfstatat:
case amd64_x32_sys_newfstatat:
return gdb_sys_newfstatat;
case amd64_sys_unlinkat:
case amd64_x32_sys_unlinkat:
return gdb_sys_unlinkat;
case amd64_sys_renameat:
case amd64_x32_sys_renameat:
return gdb_sys_renameat;
case amd64_sys_linkat:
case amd64_x32_sys_linkat:
return gdb_sys_linkat;
case amd64_sys_symlinkat:
case amd64_x32_sys_symlinkat:
return gdb_sys_symlinkat;
case amd64_sys_readlinkat:
case amd64_x32_sys_readlinkat:
return gdb_sys_readlinkat;
case amd64_sys_fchmodat:
case amd64_x32_sys_fchmodat:
return gdb_sys_fchmodat;
case amd64_sys_faccessat:
case amd64_x32_sys_faccessat:
return gdb_sys_faccessat;
case amd64_sys_pselect6:
case amd64_x32_sys_pselect6:
return gdb_sys_pselect6;
case amd64_sys_ppoll:
case amd64_x32_sys_ppoll:
return gdb_sys_ppoll;
case amd64_sys_unshare:
case amd64_x32_sys_unshare:
return gdb_sys_unshare;
case amd64_sys_set_robust_list:
case amd64_x32_sys_set_robust_list:
return gdb_sys_set_robust_list;
case amd64_sys_get_robust_list:
case amd64_x32_sys_get_robust_list:
return gdb_sys_get_robust_list;
case amd64_sys_splice:
case amd64_x32_sys_splice:
return gdb_sys_splice;
case amd64_sys_tee:
case amd64_x32_sys_tee:
return gdb_sys_tee;
case amd64_sys_sync_file_range:
case amd64_x32_sys_sync_file_range:
return gdb_sys_sync_file_range;
case amd64_sys_vmsplice:
case amd64_x32_sys_vmsplice:
return gdb_sys_vmsplice;
case amd64_sys_move_pages:
case amd64_x32_sys_move_pages:
return gdb_sys_move_pages;
default:
Mostly trivial enum fixes This is a patch I extracted from Pedro's C++ branch. It contains the most trivial enum fixes, where an integer type/value was used instead of the appropriate enum type/value. It fixes many C++ errors, since in C++ you can't mix integers and enums implicitely. Regardless of the C++ conversion, I think this is a good cleanup to make use of the appropriate enum types. Regression-tested on native x86_64. gdb/ChangeLog: * aarch64-linux-nat.c (aarch64_linux_can_use_hw_breakpoint): Use enum type or value instead of integer. (aarch64_linux_insert_watchpoint): Likewise. (aarch64_linux_remove_watchpoint): Likewise. * ada-lang.c (ada_op_print_tab): Likewise. * amd64-linux-tdep.c (amd64_canonicalize_syscall): Likewise. (amd64_linux_syscall_record_common): Likewise. * arch-utils.c (target_byte_order_user): Likewise. (default_byte_order): Likewise. * arm-linux-nat.c (arm_linux_can_use_hw_breakpoint): Likewise. (arm_linux_get_hwbp_type): Likewise. (arm_linux_hw_watchpoint_initialize): Likewise. (arm_linux_insert_watchpoint): Likewise. * arm-linux-tdep.c (arm_canonicalize_syscall): Likewise. (arm_linux_syscall_record): Likewise. * breakpoint.c (update_watchpoint): Likewise. (breakpoint_here_p): Likewise. (bpstat_print): Likewise. (enable_breakpoint_disp): Likewise. * c-lang.c (c_op_print_tab): Likewise. * cli/cli-decode.c (add_info_alias): Likewise. * d-lang.c (d_op_print_tab): Likewise. * eval.c (evaluate_subexp_standard): Likewise. * f-exp.y (dot_ops): Likewise. (f77_keywords): Likewise. * f-lang.c (f_op_print_tab): Likewise. * go-lang.c (go_op_print_tab): Likewise. * guile/scm-breakpoint.c (gdbscm_make_breakpoint): Likewise. * guile/scm-cmd.c (gdbscm_make_command): Likewise. * guile/scm-param.c (gdbscm_make_parameter): Likewise. * guile/scm-pretty-print.c (gdbscm_apply_val_pretty_printer): Likewise. * guile/scm-string.c (struct scm_to_stringn_data): Likewise. (struct scm_from_stringn_data): Likewise. * i386-linux-tdep.c (i386_canonicalize_syscall): Likewise. * ia64-linux-nat.c (ia64_linux_insert_watchpoint): Likewise. (ia64_linux_remove_watchpoint): Likewise. (ia64_linux_can_use_hw_breakpoint): Likewise. * infrun.c (print_stop_event): Likewise. * jv-lang.c (java_op_print_tab): Likewise. * linux-nat.c (linux_proc_xfer_partial): Likewise. * linux-nat.h (struct lwp_info): Likewise. * linux-thread-db.c (enable_thread_event): Likewise. * m2-lang.c (m2_op_print_tab): Likewise. * mi/mi-cmd-stack.c (mi_cmd_stack_list_locals): Likewise. (mi_cmd_stack_list_variables): Likewise. * mi/mi-main.c (mi_cmd_trace_frame_collected): Likewise. * mi/mi-out.c (mi_table_begin): Likewise. (mi_table_header): Likewise. * mips-linux-nat.c (mips_linux_can_use_hw_breakpoint): Likewise. (mips_linux_insert_watchpoint): Likewise. (mips_linux_remove_watchpoint): Likewise. * nat/mips-linux-watch.c (mips_linux_watch_type_to_irw): Likewise. * nat/mips-linux-watch.h (struct mips_watchpoint): Likewise. (mips_linux_watch_type_to_irw): Likewise. * nto-procfs.c (procfs_can_use_hw_breakpoint): Likewise. (procfs_insert_hw_watchpoint): Likewise. (procfs_remove_hw_watchpoint): Likewise. (procfs_hw_watchpoint): Likewise. (procfs_can_use_hw_breakpoint): Likewise. (procfs_remove_hw_watchpoint): Likewise. (procfs_insert_hw_watchpoint): Likewise. * p-lang.c (pascal_op_print_tab): Likewise. * ppc-linux-nat.c (ppc_linux_can_use_hw_breakpoint): Likewise. * ppc-linux-tdep.c (ppu2spu_unwind_register): Likewise. * ppc-sysv-tdep.c (get_decimal_float_return_value): Likewise. * procfs.c (procfs_can_use_hw_breakpoint): Likewise. (procfs_insert_watchpoint): Likewise. (procfs_remove_watchpoint): Likewise. * psymtab.c (recursively_search_psymtabs): Likewise. * remote-m32r-sdi.c (m32r_can_use_hw_watchpoint): Likewise. (m32r_insert_watchpoint): Likewise. * remote-mips.c (mips_can_use_watchpoint): Likewise. (mips_insert_watchpoint): Likewise. (mips_remove_watchpoint): Likewise. * remote.c (watchpoint_to_Z_packet): Likewise. (remote_insert_watchpoint): Likewise. (remote_remove_watchpoint): Likewise. (remote_check_watch_resources): Likewise. * s390-linux-nat.c (s390_insert_watchpoint): Likewise. (s390_remove_watchpoint): Likewise. (s390_can_use_hw_breakpoint): Likewise. * s390-linux-tdep.c (s390_gdbarch_init): Likewise. * spu-linux-nat.c (spu_can_use_hw_breakpoint): Likewise. * target.h (struct target_ops): Likewise. * tilegx-tdep.c (tilegx_analyze_prologue): Likewise. * ui-out.c (struct ui_out_hdr): Likewise. (append_header_to_list): Likewise. (get_next_header): Likewise. (verify_field): Likewise. (ui_out_begin): Likewise. (ui_out_field_int): Likewise. (ui_out_field_fmt_int): Likewise. (ui_out_field_skip): Likewise. (ui_out_field_string): Likewise. (ui_out_field_fmt): Likewise. * varobj.c (new_variable): Likewise. * x86-nat.c (x86_insert_watchpoint): Likewise. (x86_remove_watchpoint): Likewise. (x86_can_use_hw_breakpoint): Likewise. * xtensa-tdep.h (struct gdbarch_tdep): Likewise. * inflow.c (enum gdb_has_a_terminal_flag_enum): Add name to previously anonymous enumeration type.. * linux-record.h (enum gdb_syscall): Add gdb_sys_no_syscall value. * target-debug.h (target_debug_print_enum_target_hw_bp_type): New. (target_debug_print_enum_bptype): New. * target-delegates.c: Regenerate.
2015-07-31 19:19:53 +02:00
return gdb_sys_no_syscall;
}
DIAGNOSTIC_POP
}
/* Parse the arguments of current system call instruction and record
the values of the registers and memory that will be changed into
"record_full_arch_list". This instruction is "syscall".
Return -1 if something wrong. */
static struct linux_record_tdep amd64_linux_record_tdep;
static struct linux_record_tdep amd64_x32_linux_record_tdep;
#define RECORD_ARCH_GET_FS 0x1003
#define RECORD_ARCH_GET_GS 0x1004
static int
amd64_linux_syscall_record_common (struct regcache *regcache,
struct linux_record_tdep *linux_record_tdep_p)
{
int ret;
ULONGEST syscall_native;
Mostly trivial enum fixes This is a patch I extracted from Pedro's C++ branch. It contains the most trivial enum fixes, where an integer type/value was used instead of the appropriate enum type/value. It fixes many C++ errors, since in C++ you can't mix integers and enums implicitely. Regardless of the C++ conversion, I think this is a good cleanup to make use of the appropriate enum types. Regression-tested on native x86_64. gdb/ChangeLog: * aarch64-linux-nat.c (aarch64_linux_can_use_hw_breakpoint): Use enum type or value instead of integer. (aarch64_linux_insert_watchpoint): Likewise. (aarch64_linux_remove_watchpoint): Likewise. * ada-lang.c (ada_op_print_tab): Likewise. * amd64-linux-tdep.c (amd64_canonicalize_syscall): Likewise. (amd64_linux_syscall_record_common): Likewise. * arch-utils.c (target_byte_order_user): Likewise. (default_byte_order): Likewise. * arm-linux-nat.c (arm_linux_can_use_hw_breakpoint): Likewise. (arm_linux_get_hwbp_type): Likewise. (arm_linux_hw_watchpoint_initialize): Likewise. (arm_linux_insert_watchpoint): Likewise. * arm-linux-tdep.c (arm_canonicalize_syscall): Likewise. (arm_linux_syscall_record): Likewise. * breakpoint.c (update_watchpoint): Likewise. (breakpoint_here_p): Likewise. (bpstat_print): Likewise. (enable_breakpoint_disp): Likewise. * c-lang.c (c_op_print_tab): Likewise. * cli/cli-decode.c (add_info_alias): Likewise. * d-lang.c (d_op_print_tab): Likewise. * eval.c (evaluate_subexp_standard): Likewise. * f-exp.y (dot_ops): Likewise. (f77_keywords): Likewise. * f-lang.c (f_op_print_tab): Likewise. * go-lang.c (go_op_print_tab): Likewise. * guile/scm-breakpoint.c (gdbscm_make_breakpoint): Likewise. * guile/scm-cmd.c (gdbscm_make_command): Likewise. * guile/scm-param.c (gdbscm_make_parameter): Likewise. * guile/scm-pretty-print.c (gdbscm_apply_val_pretty_printer): Likewise. * guile/scm-string.c (struct scm_to_stringn_data): Likewise. (struct scm_from_stringn_data): Likewise. * i386-linux-tdep.c (i386_canonicalize_syscall): Likewise. * ia64-linux-nat.c (ia64_linux_insert_watchpoint): Likewise. (ia64_linux_remove_watchpoint): Likewise. (ia64_linux_can_use_hw_breakpoint): Likewise. * infrun.c (print_stop_event): Likewise. * jv-lang.c (java_op_print_tab): Likewise. * linux-nat.c (linux_proc_xfer_partial): Likewise. * linux-nat.h (struct lwp_info): Likewise. * linux-thread-db.c (enable_thread_event): Likewise. * m2-lang.c (m2_op_print_tab): Likewise. * mi/mi-cmd-stack.c (mi_cmd_stack_list_locals): Likewise. (mi_cmd_stack_list_variables): Likewise. * mi/mi-main.c (mi_cmd_trace_frame_collected): Likewise. * mi/mi-out.c (mi_table_begin): Likewise. (mi_table_header): Likewise. * mips-linux-nat.c (mips_linux_can_use_hw_breakpoint): Likewise. (mips_linux_insert_watchpoint): Likewise. (mips_linux_remove_watchpoint): Likewise. * nat/mips-linux-watch.c (mips_linux_watch_type_to_irw): Likewise. * nat/mips-linux-watch.h (struct mips_watchpoint): Likewise. (mips_linux_watch_type_to_irw): Likewise. * nto-procfs.c (procfs_can_use_hw_breakpoint): Likewise. (procfs_insert_hw_watchpoint): Likewise. (procfs_remove_hw_watchpoint): Likewise. (procfs_hw_watchpoint): Likewise. (procfs_can_use_hw_breakpoint): Likewise. (procfs_remove_hw_watchpoint): Likewise. (procfs_insert_hw_watchpoint): Likewise. * p-lang.c (pascal_op_print_tab): Likewise. * ppc-linux-nat.c (ppc_linux_can_use_hw_breakpoint): Likewise. * ppc-linux-tdep.c (ppu2spu_unwind_register): Likewise. * ppc-sysv-tdep.c (get_decimal_float_return_value): Likewise. * procfs.c (procfs_can_use_hw_breakpoint): Likewise. (procfs_insert_watchpoint): Likewise. (procfs_remove_watchpoint): Likewise. * psymtab.c (recursively_search_psymtabs): Likewise. * remote-m32r-sdi.c (m32r_can_use_hw_watchpoint): Likewise. (m32r_insert_watchpoint): Likewise. * remote-mips.c (mips_can_use_watchpoint): Likewise. (mips_insert_watchpoint): Likewise. (mips_remove_watchpoint): Likewise. * remote.c (watchpoint_to_Z_packet): Likewise. (remote_insert_watchpoint): Likewise. (remote_remove_watchpoint): Likewise. (remote_check_watch_resources): Likewise. * s390-linux-nat.c (s390_insert_watchpoint): Likewise. (s390_remove_watchpoint): Likewise. (s390_can_use_hw_breakpoint): Likewise. * s390-linux-tdep.c (s390_gdbarch_init): Likewise. * spu-linux-nat.c (spu_can_use_hw_breakpoint): Likewise. * target.h (struct target_ops): Likewise. * tilegx-tdep.c (tilegx_analyze_prologue): Likewise. * ui-out.c (struct ui_out_hdr): Likewise. (append_header_to_list): Likewise. (get_next_header): Likewise. (verify_field): Likewise. (ui_out_begin): Likewise. (ui_out_field_int): Likewise. (ui_out_field_fmt_int): Likewise. (ui_out_field_skip): Likewise. (ui_out_field_string): Likewise. (ui_out_field_fmt): Likewise. * varobj.c (new_variable): Likewise. * x86-nat.c (x86_insert_watchpoint): Likewise. (x86_remove_watchpoint): Likewise. (x86_can_use_hw_breakpoint): Likewise. * xtensa-tdep.h (struct gdbarch_tdep): Likewise. * inflow.c (enum gdb_has_a_terminal_flag_enum): Add name to previously anonymous enumeration type.. * linux-record.h (enum gdb_syscall): Add gdb_sys_no_syscall value. * target-debug.h (target_debug_print_enum_target_hw_bp_type): New. (target_debug_print_enum_bptype): New. * target-delegates.c: Regenerate.
2015-07-31 19:19:53 +02:00
enum gdb_syscall syscall_gdb = gdb_sys_no_syscall;
regcache_raw_read_unsigned (regcache, AMD64_RAX_REGNUM, &syscall_native);
switch (syscall_native)
{
case amd64_sys_rt_sigreturn:
case amd64_x32_sys_rt_sigreturn:
if (amd64_all_but_ip_registers_record (regcache))
return -1;
return 0;
break;
case amd64_sys_arch_prctl:
case amd64_x32_sys_arch_prctl:
{
ULONGEST arg3;
regcache_raw_read_unsigned (regcache, linux_record_tdep_p->arg3,
&arg3);
if (arg3 == RECORD_ARCH_GET_FS || arg3 == RECORD_ARCH_GET_GS)
{
CORE_ADDR addr;
regcache_raw_read_unsigned (regcache,
linux_record_tdep_p->arg2,
&addr);
if (record_full_arch_list_add_mem
(addr, linux_record_tdep_p->size_ulong))
return -1;
}
goto record_regs;
}
break;
}
Mostly trivial enum fixes This is a patch I extracted from Pedro's C++ branch. It contains the most trivial enum fixes, where an integer type/value was used instead of the appropriate enum type/value. It fixes many C++ errors, since in C++ you can't mix integers and enums implicitely. Regardless of the C++ conversion, I think this is a good cleanup to make use of the appropriate enum types. Regression-tested on native x86_64. gdb/ChangeLog: * aarch64-linux-nat.c (aarch64_linux_can_use_hw_breakpoint): Use enum type or value instead of integer. (aarch64_linux_insert_watchpoint): Likewise. (aarch64_linux_remove_watchpoint): Likewise. * ada-lang.c (ada_op_print_tab): Likewise. * amd64-linux-tdep.c (amd64_canonicalize_syscall): Likewise. (amd64_linux_syscall_record_common): Likewise. * arch-utils.c (target_byte_order_user): Likewise. (default_byte_order): Likewise. * arm-linux-nat.c (arm_linux_can_use_hw_breakpoint): Likewise. (arm_linux_get_hwbp_type): Likewise. (arm_linux_hw_watchpoint_initialize): Likewise. (arm_linux_insert_watchpoint): Likewise. * arm-linux-tdep.c (arm_canonicalize_syscall): Likewise. (arm_linux_syscall_record): Likewise. * breakpoint.c (update_watchpoint): Likewise. (breakpoint_here_p): Likewise. (bpstat_print): Likewise. (enable_breakpoint_disp): Likewise. * c-lang.c (c_op_print_tab): Likewise. * cli/cli-decode.c (add_info_alias): Likewise. * d-lang.c (d_op_print_tab): Likewise. * eval.c (evaluate_subexp_standard): Likewise. * f-exp.y (dot_ops): Likewise. (f77_keywords): Likewise. * f-lang.c (f_op_print_tab): Likewise. * go-lang.c (go_op_print_tab): Likewise. * guile/scm-breakpoint.c (gdbscm_make_breakpoint): Likewise. * guile/scm-cmd.c (gdbscm_make_command): Likewise. * guile/scm-param.c (gdbscm_make_parameter): Likewise. * guile/scm-pretty-print.c (gdbscm_apply_val_pretty_printer): Likewise. * guile/scm-string.c (struct scm_to_stringn_data): Likewise. (struct scm_from_stringn_data): Likewise. * i386-linux-tdep.c (i386_canonicalize_syscall): Likewise. * ia64-linux-nat.c (ia64_linux_insert_watchpoint): Likewise. (ia64_linux_remove_watchpoint): Likewise. (ia64_linux_can_use_hw_breakpoint): Likewise. * infrun.c (print_stop_event): Likewise. * jv-lang.c (java_op_print_tab): Likewise. * linux-nat.c (linux_proc_xfer_partial): Likewise. * linux-nat.h (struct lwp_info): Likewise. * linux-thread-db.c (enable_thread_event): Likewise. * m2-lang.c (m2_op_print_tab): Likewise. * mi/mi-cmd-stack.c (mi_cmd_stack_list_locals): Likewise. (mi_cmd_stack_list_variables): Likewise. * mi/mi-main.c (mi_cmd_trace_frame_collected): Likewise. * mi/mi-out.c (mi_table_begin): Likewise. (mi_table_header): Likewise. * mips-linux-nat.c (mips_linux_can_use_hw_breakpoint): Likewise. (mips_linux_insert_watchpoint): Likewise. (mips_linux_remove_watchpoint): Likewise. * nat/mips-linux-watch.c (mips_linux_watch_type_to_irw): Likewise. * nat/mips-linux-watch.h (struct mips_watchpoint): Likewise. (mips_linux_watch_type_to_irw): Likewise. * nto-procfs.c (procfs_can_use_hw_breakpoint): Likewise. (procfs_insert_hw_watchpoint): Likewise. (procfs_remove_hw_watchpoint): Likewise. (procfs_hw_watchpoint): Likewise. (procfs_can_use_hw_breakpoint): Likewise. (procfs_remove_hw_watchpoint): Likewise. (procfs_insert_hw_watchpoint): Likewise. * p-lang.c (pascal_op_print_tab): Likewise. * ppc-linux-nat.c (ppc_linux_can_use_hw_breakpoint): Likewise. * ppc-linux-tdep.c (ppu2spu_unwind_register): Likewise. * ppc-sysv-tdep.c (get_decimal_float_return_value): Likewise. * procfs.c (procfs_can_use_hw_breakpoint): Likewise. (procfs_insert_watchpoint): Likewise. (procfs_remove_watchpoint): Likewise. * psymtab.c (recursively_search_psymtabs): Likewise. * remote-m32r-sdi.c (m32r_can_use_hw_watchpoint): Likewise. (m32r_insert_watchpoint): Likewise. * remote-mips.c (mips_can_use_watchpoint): Likewise. (mips_insert_watchpoint): Likewise. (mips_remove_watchpoint): Likewise. * remote.c (watchpoint_to_Z_packet): Likewise. (remote_insert_watchpoint): Likewise. (remote_remove_watchpoint): Likewise. (remote_check_watch_resources): Likewise. * s390-linux-nat.c (s390_insert_watchpoint): Likewise. (s390_remove_watchpoint): Likewise. (s390_can_use_hw_breakpoint): Likewise. * s390-linux-tdep.c (s390_gdbarch_init): Likewise. * spu-linux-nat.c (spu_can_use_hw_breakpoint): Likewise. * target.h (struct target_ops): Likewise. * tilegx-tdep.c (tilegx_analyze_prologue): Likewise. * ui-out.c (struct ui_out_hdr): Likewise. (append_header_to_list): Likewise. (get_next_header): Likewise. (verify_field): Likewise. (ui_out_begin): Likewise. (ui_out_field_int): Likewise. (ui_out_field_fmt_int): Likewise. (ui_out_field_skip): Likewise. (ui_out_field_string): Likewise. (ui_out_field_fmt): Likewise. * varobj.c (new_variable): Likewise. * x86-nat.c (x86_insert_watchpoint): Likewise. (x86_remove_watchpoint): Likewise. (x86_can_use_hw_breakpoint): Likewise. * xtensa-tdep.h (struct gdbarch_tdep): Likewise. * inflow.c (enum gdb_has_a_terminal_flag_enum): Add name to previously anonymous enumeration type.. * linux-record.h (enum gdb_syscall): Add gdb_sys_no_syscall value. * target-debug.h (target_debug_print_enum_target_hw_bp_type): New. (target_debug_print_enum_bptype): New. * target-delegates.c: Regenerate.
2015-07-31 19:19:53 +02:00
syscall_gdb
= amd64_canonicalize_syscall ((enum amd64_syscall) syscall_native);
Mostly trivial enum fixes This is a patch I extracted from Pedro's C++ branch. It contains the most trivial enum fixes, where an integer type/value was used instead of the appropriate enum type/value. It fixes many C++ errors, since in C++ you can't mix integers and enums implicitely. Regardless of the C++ conversion, I think this is a good cleanup to make use of the appropriate enum types. Regression-tested on native x86_64. gdb/ChangeLog: * aarch64-linux-nat.c (aarch64_linux_can_use_hw_breakpoint): Use enum type or value instead of integer. (aarch64_linux_insert_watchpoint): Likewise. (aarch64_linux_remove_watchpoint): Likewise. * ada-lang.c (ada_op_print_tab): Likewise. * amd64-linux-tdep.c (amd64_canonicalize_syscall): Likewise. (amd64_linux_syscall_record_common): Likewise. * arch-utils.c (target_byte_order_user): Likewise. (default_byte_order): Likewise. * arm-linux-nat.c (arm_linux_can_use_hw_breakpoint): Likewise. (arm_linux_get_hwbp_type): Likewise. (arm_linux_hw_watchpoint_initialize): Likewise. (arm_linux_insert_watchpoint): Likewise. * arm-linux-tdep.c (arm_canonicalize_syscall): Likewise. (arm_linux_syscall_record): Likewise. * breakpoint.c (update_watchpoint): Likewise. (breakpoint_here_p): Likewise. (bpstat_print): Likewise. (enable_breakpoint_disp): Likewise. * c-lang.c (c_op_print_tab): Likewise. * cli/cli-decode.c (add_info_alias): Likewise. * d-lang.c (d_op_print_tab): Likewise. * eval.c (evaluate_subexp_standard): Likewise. * f-exp.y (dot_ops): Likewise. (f77_keywords): Likewise. * f-lang.c (f_op_print_tab): Likewise. * go-lang.c (go_op_print_tab): Likewise. * guile/scm-breakpoint.c (gdbscm_make_breakpoint): Likewise. * guile/scm-cmd.c (gdbscm_make_command): Likewise. * guile/scm-param.c (gdbscm_make_parameter): Likewise. * guile/scm-pretty-print.c (gdbscm_apply_val_pretty_printer): Likewise. * guile/scm-string.c (struct scm_to_stringn_data): Likewise. (struct scm_from_stringn_data): Likewise. * i386-linux-tdep.c (i386_canonicalize_syscall): Likewise. * ia64-linux-nat.c (ia64_linux_insert_watchpoint): Likewise. (ia64_linux_remove_watchpoint): Likewise. (ia64_linux_can_use_hw_breakpoint): Likewise. * infrun.c (print_stop_event): Likewise. * jv-lang.c (java_op_print_tab): Likewise. * linux-nat.c (linux_proc_xfer_partial): Likewise. * linux-nat.h (struct lwp_info): Likewise. * linux-thread-db.c (enable_thread_event): Likewise. * m2-lang.c (m2_op_print_tab): Likewise. * mi/mi-cmd-stack.c (mi_cmd_stack_list_locals): Likewise. (mi_cmd_stack_list_variables): Likewise. * mi/mi-main.c (mi_cmd_trace_frame_collected): Likewise. * mi/mi-out.c (mi_table_begin): Likewise. (mi_table_header): Likewise. * mips-linux-nat.c (mips_linux_can_use_hw_breakpoint): Likewise. (mips_linux_insert_watchpoint): Likewise. (mips_linux_remove_watchpoint): Likewise. * nat/mips-linux-watch.c (mips_linux_watch_type_to_irw): Likewise. * nat/mips-linux-watch.h (struct mips_watchpoint): Likewise. (mips_linux_watch_type_to_irw): Likewise. * nto-procfs.c (procfs_can_use_hw_breakpoint): Likewise. (procfs_insert_hw_watchpoint): Likewise. (procfs_remove_hw_watchpoint): Likewise. (procfs_hw_watchpoint): Likewise. (procfs_can_use_hw_breakpoint): Likewise. (procfs_remove_hw_watchpoint): Likewise. (procfs_insert_hw_watchpoint): Likewise. * p-lang.c (pascal_op_print_tab): Likewise. * ppc-linux-nat.c (ppc_linux_can_use_hw_breakpoint): Likewise. * ppc-linux-tdep.c (ppu2spu_unwind_register): Likewise. * ppc-sysv-tdep.c (get_decimal_float_return_value): Likewise. * procfs.c (procfs_can_use_hw_breakpoint): Likewise. (procfs_insert_watchpoint): Likewise. (procfs_remove_watchpoint): Likewise. * psymtab.c (recursively_search_psymtabs): Likewise. * remote-m32r-sdi.c (m32r_can_use_hw_watchpoint): Likewise. (m32r_insert_watchpoint): Likewise. * remote-mips.c (mips_can_use_watchpoint): Likewise. (mips_insert_watchpoint): Likewise. (mips_remove_watchpoint): Likewise. * remote.c (watchpoint_to_Z_packet): Likewise. (remote_insert_watchpoint): Likewise. (remote_remove_watchpoint): Likewise. (remote_check_watch_resources): Likewise. * s390-linux-nat.c (s390_insert_watchpoint): Likewise. (s390_remove_watchpoint): Likewise. (s390_can_use_hw_breakpoint): Likewise. * s390-linux-tdep.c (s390_gdbarch_init): Likewise. * spu-linux-nat.c (spu_can_use_hw_breakpoint): Likewise. * target.h (struct target_ops): Likewise. * tilegx-tdep.c (tilegx_analyze_prologue): Likewise. * ui-out.c (struct ui_out_hdr): Likewise. (append_header_to_list): Likewise. (get_next_header): Likewise. (verify_field): Likewise. (ui_out_begin): Likewise. (ui_out_field_int): Likewise. (ui_out_field_fmt_int): Likewise. (ui_out_field_skip): Likewise. (ui_out_field_string): Likewise. (ui_out_field_fmt): Likewise. * varobj.c (new_variable): Likewise. * x86-nat.c (x86_insert_watchpoint): Likewise. (x86_remove_watchpoint): Likewise. (x86_can_use_hw_breakpoint): Likewise. * xtensa-tdep.h (struct gdbarch_tdep): Likewise. * inflow.c (enum gdb_has_a_terminal_flag_enum): Add name to previously anonymous enumeration type.. * linux-record.h (enum gdb_syscall): Add gdb_sys_no_syscall value. * target-debug.h (target_debug_print_enum_target_hw_bp_type): New. (target_debug_print_enum_bptype): New. * target-delegates.c: Regenerate.
2015-07-31 19:19:53 +02:00
if (syscall_gdb == gdb_sys_no_syscall)
{
printf_unfiltered (_("Process record and replay target doesn't "
"support syscall number %s\n"),
pulongest (syscall_native));
return -1;
}
else
{
ret = record_linux_system_call (syscall_gdb, regcache,
linux_record_tdep_p);
if (ret)
return ret;
}
record_regs:
/* Record the return value of the system call. */
if (record_full_arch_list_add_reg (regcache, AMD64_RCX_REGNUM))
return -1;
if (record_full_arch_list_add_reg (regcache, AMD64_R11_REGNUM))
return -1;
return 0;
}
static int
amd64_linux_syscall_record (struct regcache *regcache)
{
return amd64_linux_syscall_record_common (regcache,
&amd64_linux_record_tdep);
}
static int
amd64_x32_linux_syscall_record (struct regcache *regcache)
{
return amd64_linux_syscall_record_common (regcache,
&amd64_x32_linux_record_tdep);
}
#define AMD64_LINUX_redzone 128
#define AMD64_LINUX_xstate 512
#define AMD64_LINUX_frame_size 560
2012-03-01 Pedro Alves <palves@redhat.com> * amd64-linux-tdep.c (amd64_linux_record_signal): Make static. * breakpoint.c (create_exception_master_breakpoint, trace_command) (ftrace_command, strace_command): Make static. * d-lang.c (_initialize_d_language): Declare. * dwarf2expr.c (_initialize_dwarf2expr): Declare. * dwarf2loc.c (_initialize_dwarf2loc): * dwarf2read.c (process_psymtab_comp_unit): Make static. * exec.c (exec_get_section_table): Make static. * i386-linux-tdep.c (i386_linux_record_signal): Make static. * infcmd.c (ensure_valid_thread, ensure_not_tfind_mode): Make static. * inferior.c (remove_inferior_command, add_inferior_command) (clone_inferior_command): Make static. * linux-nat.c (linux_nat_thread_address_space) (linux_nat_core_of_thread): Make static. * linux-tdep.c (_initialize_linux_tdep): Declare. * objc-lang.c (_initialize_objc_lang): Declare. * opencl-lang.c (builtin_opencl_type, opencl_language_arch_info): Make static. (_initialize_opencl_language): Declare. * record.c (_initialize_record): Declare. * remote.c (demand_private_info, remote_get_tib_address) (remote_supports_cond_tracepoints) (remote_supports_fast_tracepoints, remote_get_tracepoint_status): Make static. * skip.c (_initialize_step_skip): Declare. * symtab.c (skip_prologue_using_lineinfo): Make static. * tracepoint.c (delete_trace_state_variable) (trace_variable_command, delete_trace_variable_command) (get_uploaded_tsv, find_matching_tracepoint_location) (find_matching_tsv, create_tsv_from_upload, get_traceframe_info): Make static. * value.c (pack_unsigned_long): Make static. * varobj.c (varobj_ensure_python_env): Make static. * windows-tdep.c (_initialize_windows_tdep): Declare. * xml-syscall.c (make_cleanup_free_syscalls_info): Make static.
2012-03-01 22:14:00 +01:00
static int
amd64_linux_record_signal (struct gdbarch *gdbarch,
struct regcache *regcache,
enum gdb_signal signal)
{
ULONGEST rsp;
if (amd64_all_but_ip_registers_record (regcache))
return -1;
if (record_full_arch_list_add_reg (regcache, AMD64_RIP_REGNUM))
return -1;
/* Record the change in the stack. */
regcache_raw_read_unsigned (regcache, AMD64_RSP_REGNUM, &rsp);
/* redzone
sp -= 128; */
rsp -= AMD64_LINUX_redzone;
/* This is for xstate.
sp -= sizeof (struct _fpstate); */
rsp -= AMD64_LINUX_xstate;
/* This is for frame_size.
sp -= sizeof (struct rt_sigframe); */
rsp -= AMD64_LINUX_frame_size;
if (record_full_arch_list_add_mem (rsp, AMD64_LINUX_redzone
+ AMD64_LINUX_xstate
+ AMD64_LINUX_frame_size))
return -1;
if (record_full_arch_list_add_end ())
return -1;
return 0;
}
const target_desc *
amd64_linux_read_description (uint64_t xcr0_features_bit, bool is_x32)
Enable XML target descriptions for x86. gdb/ 2010-03-01 H.J. Lu <hongjiu.lu@intel.com> * amd64-linux-nat.c (AMD64_LINUX_USER64_CS): New. (amd64_linux_read_description): Likewise. (_initialize_amd64_linux_nat): Set to_read_description to amd64_linux_read_description. * amd64-linux-tdep.c: Include "features/i386/amd64-linux.c". (amd64_linux_register_name): Removed. (amd64_linux_register_type): Likewise. (amd64_linux_core_read_description): New. (amd64_linux_init_abi): Set target description to tdesc_amd64_linux if needed. Support orig_rax in target description. Don't call set_gdbarch_register_name nor set_gdbarch_register_type. Call set_gdbarch_core_read_description. (_initialize_amd64_linux_tdep): Call initialize_tdesc_amd64_linux. * amd64-linux-tdep.h (tdesc_amd64_linux): New. * amd64-tdep.c: Include "features/i386/amd64.c". (amd64_register_names): Removed. (amd64_register_name): Likewise. (amd64_register_type): Likewise. (amd64_init_abi): Set num_core_regs and register_names. Set target description to tdesc_amd64 if needed. Don't call set_gdbarch_register_name nor set_gdbarch_register_type. (_initialize_amd64_tdep): New. * i386-linux-nat.c (i386_linux_read_description): New. (_initialize_i386_linux_nat): Set to_read_description to i386_linux_read_description. * i386-linux-tdep.c: Include "features/i386/i386-linux.c". (i386_linux_register_name): Removed. (i386_linux_core_read_description): New. (i386_linux_read_description): Likewise. (i386_linux_init_abi): Don't call set_gdbarch_register_name. Set target description to tdesc_i386_linux if needed. Support orig_eax. Set register_reggroup_p. Call set_gdbarch_core_read_description. (_initialize_i386_linux_tdep): Call initialize_tdesc_i386_linux. * i386-linux-tdep.h (tdesc_i386_linux): New. * i386-nto-tdep.c (i386nto_regset_id): Replace I386_NUM_FREGS with I387_NUM_REGS. * i386-tdep.c: Include "features/i386/i386.c". (i386_register_names): Make it const. (i386_mmx_names): Likewise. (i386_num_register_names): Removed. (i386_register_name): Likewise. (i386_eflags_type): Likewise. (i386_mxcsr_type): Likewise. (i386_sse_type): Likewise. (i386_register_type): Likewise. (i387_ext_type): Call tdesc_find_type instead of arch_float_type. (i386_pseudo_register_name): New. (i386_pseudo_register_type): Likewise. (i386_mmx_type): Make it static. (i386_gdbarch_init): Check arch. Replace I386_NUM_FREGS with I387_NUM_REGS. Set num_core_regs and register_names. Don't call set_gdbarch_register_name nor set_gdbarch_register_type. Set register_reggroup_p. Set target description to tdesc_i386 if needed. Call set_tdesc_pseudo_register_type, set_tdesc_pseudo_register_name and tdesc_use_registers. (_initialize_i386_tdep): Call initialize_tdesc_i386. initialize_tdesc_x86_64. * i386-tdep.h (gdbarch_tdep): Remove i386_eflags_type, i386_mxcsr_type and i386_sse_type. Add num_core_regs, register_names, tdesc and register_reggroup_p. (I386_NUM_FREGS): Removed. (i386_eflags_type): Likewise. (i386_mxcsr_type): Likewise. (i386_mmx_type): Likewise. (i386_sse_type): Likewise. (i386_register_name): Likewise. (i386_regnum): Add I386_MXCSR_REGNUM. (I386_SSE_NUM_REGS): Defined with I386_MXCSR_REGNUM. * i387-tdep.h (I387_NUM_REGS): New. * regformats/i386/i386-linux.dat: Generated. * regformats/i386/i386.dat: Likewise. * regformats/i386/amd64-linux.dat: Likewise. * regformats/i386/amd64.dat: Likewise. * regformats/reg-i386-linux.dat: Removed. * regformats/reg-i386.dat: Likewise. * regformats/reg-x86-64-linux.dat: Likewise. * regformats/reg-x86-64.dat: Likewise. gdb/gdbserver/ 2010-03-01 H.J. Lu <hongjiu.lu@intel.com> * Makefile.in (clean): Replace reg-i386.c, reg-x86-64.c, reg-i386-linux.c and reg-x86-64-linux.c with i386.c, amd64.c, i386-linux.c and amd64-linux.c. (reg-i386.o): Removed. (reg-i386.c): Likewise. (reg-i386-linux.o): Likewise. (reg-i386-linux.c): Likewise. (reg-x86-64.o): Likewise. (reg-x86-64.c): Likewise. (reg-x86-64-linux.o): Likewise. (reg-x86-64-linux.c): Likewise. (i386.o): New. (i386.c): Likewise. (i386-linux.o): Likewise. (i386-linux.c): Likewise. (amd64.o): Likewise. (amd64.c): Likewise. (amd64-linux.o): Likewise. (amd64-linux.c): Likewise. * configure.srv (srv_i386_regobj): New. (srv_i386_linux_regobj): Likewise. (srv_amd64_regobj): Likewise. (srv_amd64_linux_regobj): Likewise. (srv_i386_32bit_xmlfiles): Likewise. (srv_i386_64bit_xmlfiles): Likewise. (srv_i386_xmlfiles): Likewise. (srv_amd64_xmlfiles): Likewise. (srv_i386_linux_xmlfiles): Likewise. (srv_amd64_linux_xmlfiles): Likewise. (i[34567]86-*-cygwin*): Set srv_regobj to $srv_i386_regobj. Set srv_xmlfiles to $srv_i386_xmlfiles. (i[34567]86-*-mingw32ce*): Likewise. (i[34567]86-*-mingw*): Likewise. (i[34567]86-*-nto*): Likewise. (i[34567]86-*-linux*): Set srv_regobj to $srv_i386_linux_regobj and $srv_amd64_linux_regobj. Set srv_xmlfiles to $srv_i386_linux_xmlfiles and $srv_amd64_linux_xmlfiles. (x86_64-*-linux*): Likewise. * linux-x86-low.c (init_registers_x86_64_linux): Removed. (init_registers_amd64_linux): New. (x86_arch_setup): Replace init_registers_x86_64_linux with init_registers_amd64_linux. gdb/testsuite/ 2010-03-01 H.J. Lu <hongjiu.lu@intel.com> * gdb.xml/tdesc-regs.exp (architecture): New. Set it for x86. (load_description): Set architecture if defined.
2010-03-01 16:33:32 +01:00
{
static target_desc *amd64_linux_tdescs \
[2/*AVX*/][2/*MPX*/][2/*AVX512*/][2/*PKRU*/] = {};
static target_desc *x32_linux_tdescs[2/*AVX*/][2/*AVX512*/] = {};
target_desc **tdesc;
if (is_x32)
{
tdesc = &x32_linux_tdescs[(xcr0_features_bit & X86_XSTATE_AVX) ? 1 : 0 ]
[(xcr0_features_bit & X86_XSTATE_AVX512) ? 1 : 0];
}
else
{
tdesc = &amd64_linux_tdescs[(xcr0_features_bit & X86_XSTATE_AVX) ? 1 : 0]
[(xcr0_features_bit & X86_XSTATE_MPX) ? 1 : 0]
[(xcr0_features_bit & X86_XSTATE_AVX512) ? 1 : 0]
[(xcr0_features_bit & X86_XSTATE_PKRU) ? 1 : 0];
}
if (*tdesc == NULL)
x86_64-windows GDB crash due to fs_base/gs_base registers GDB is currently crashing anytime we try to access the fs_base/gs_base registers, either to read them, or to write them. This can be observed under various scenarios: - Explicit reference to those registers (eg: print $fs_base) -- probably relatively rare; - Calling a function in the inferior, with the crash happening because we are trying to read those registers in order to save their value ahead of making the function call; - Just a plain "info registers"; The crash was introduced by the following commit: | commit 48aeef91c248291dd03583798904612426b1f40a | Date: Mon Jun 26 18:14:43 2017 -0700 | Subject: Include the fs_base and gs_base registers in amd64 target descriptions. The Windows-nat implementation was unfortunately not prepared to deal with those new registers. In particular, the way it fetches registers is done by using a table where the index is the register number, and the value at that index is the offset in the area in the thread's CONTEXT data where the corresponding register value is stored. For instance, in amd64-windows-nat.c, we can find the mappings static array containing the following 57 elements in it: #define context_offset(x) (offsetof (CONTEXT, x)) static const int mappings[] = { context_offset (Rax), [...] context_offset (FloatSave.MxCsr) }; That array is then used by windows_fetch_one_register via: char *context_offset = ((char *) &th->context) + mappings[r]; The problem is that fs_base's register number is 172, which is well past the end of the mappings array (57 elements in total). We end up getting an undefined offset, which happens to be so large that it then causes the address where we try to read the register value (a little bit later) to be invalid, thus crashing GDB with a SEGV. This patch side-steps the issue entirely by removing support for those registers in GDB on x86_64-windows, because a look at the CONTEXT structure indicates no support for getting those registers. A more comprehensive fix would patch the potential buffer overflow of the mappings array, but this can be done as a separate commit. gdb/ChangeLog: * gdb/amd64-tdep.h (amd64_create_target_description): Add "segments" parameter. * gdb/amd64-tdep.c (amd64_none_init_abi, amd64_x32_none_init_abi) (_initialize_amd64_tdep): Update call to amd64_create_target_description. (amd64_target_description): Add "segments" parameter. Adjust the implementation to use it. * gdb/amd64-linux-tdep.c (amd64_linux_read_description): Update call to amd64_create_target_description. * gdb/amd64-windows-tdep.c (amd64_windows_init_abi): Likewise. * gdb/arch/amd64.h (amd64_create_target_description): Add "segments" register. * gdb/arch/amd64.c (amd64_create_target_description): Add "segments" parameter. Call create_feature_i386_64bit_segments only if SEGMENTS is true. * gdb/gdbserver/win32-i386-low.c (i386_arch_setup): Update call to amd64_create_target_description. Tested on x86_64-windows using AdaCore's testsuite (by Joel Brobecker <brobecker at adacore dot com>).
2018-06-26 17:33:27 +02:00
*tdesc = amd64_create_target_description (xcr0_features_bit, is_x32,
true, true);
return *tdesc;
Enable XML target descriptions for x86. gdb/ 2010-03-01 H.J. Lu <hongjiu.lu@intel.com> * amd64-linux-nat.c (AMD64_LINUX_USER64_CS): New. (amd64_linux_read_description): Likewise. (_initialize_amd64_linux_nat): Set to_read_description to amd64_linux_read_description. * amd64-linux-tdep.c: Include "features/i386/amd64-linux.c". (amd64_linux_register_name): Removed. (amd64_linux_register_type): Likewise. (amd64_linux_core_read_description): New. (amd64_linux_init_abi): Set target description to tdesc_amd64_linux if needed. Support orig_rax in target description. Don't call set_gdbarch_register_name nor set_gdbarch_register_type. Call set_gdbarch_core_read_description. (_initialize_amd64_linux_tdep): Call initialize_tdesc_amd64_linux. * amd64-linux-tdep.h (tdesc_amd64_linux): New. * amd64-tdep.c: Include "features/i386/amd64.c". (amd64_register_names): Removed. (amd64_register_name): Likewise. (amd64_register_type): Likewise. (amd64_init_abi): Set num_core_regs and register_names. Set target description to tdesc_amd64 if needed. Don't call set_gdbarch_register_name nor set_gdbarch_register_type. (_initialize_amd64_tdep): New. * i386-linux-nat.c (i386_linux_read_description): New. (_initialize_i386_linux_nat): Set to_read_description to i386_linux_read_description. * i386-linux-tdep.c: Include "features/i386/i386-linux.c". (i386_linux_register_name): Removed. (i386_linux_core_read_description): New. (i386_linux_read_description): Likewise. (i386_linux_init_abi): Don't call set_gdbarch_register_name. Set target description to tdesc_i386_linux if needed. Support orig_eax. Set register_reggroup_p. Call set_gdbarch_core_read_description. (_initialize_i386_linux_tdep): Call initialize_tdesc_i386_linux. * i386-linux-tdep.h (tdesc_i386_linux): New. * i386-nto-tdep.c (i386nto_regset_id): Replace I386_NUM_FREGS with I387_NUM_REGS. * i386-tdep.c: Include "features/i386/i386.c". (i386_register_names): Make it const. (i386_mmx_names): Likewise. (i386_num_register_names): Removed. (i386_register_name): Likewise. (i386_eflags_type): Likewise. (i386_mxcsr_type): Likewise. (i386_sse_type): Likewise. (i386_register_type): Likewise. (i387_ext_type): Call tdesc_find_type instead of arch_float_type. (i386_pseudo_register_name): New. (i386_pseudo_register_type): Likewise. (i386_mmx_type): Make it static. (i386_gdbarch_init): Check arch. Replace I386_NUM_FREGS with I387_NUM_REGS. Set num_core_regs and register_names. Don't call set_gdbarch_register_name nor set_gdbarch_register_type. Set register_reggroup_p. Set target description to tdesc_i386 if needed. Call set_tdesc_pseudo_register_type, set_tdesc_pseudo_register_name and tdesc_use_registers. (_initialize_i386_tdep): Call initialize_tdesc_i386. initialize_tdesc_x86_64. * i386-tdep.h (gdbarch_tdep): Remove i386_eflags_type, i386_mxcsr_type and i386_sse_type. Add num_core_regs, register_names, tdesc and register_reggroup_p. (I386_NUM_FREGS): Removed. (i386_eflags_type): Likewise. (i386_mxcsr_type): Likewise. (i386_mmx_type): Likewise. (i386_sse_type): Likewise. (i386_register_name): Likewise. (i386_regnum): Add I386_MXCSR_REGNUM. (I386_SSE_NUM_REGS): Defined with I386_MXCSR_REGNUM. * i387-tdep.h (I387_NUM_REGS): New. * regformats/i386/i386-linux.dat: Generated. * regformats/i386/i386.dat: Likewise. * regformats/i386/amd64-linux.dat: Likewise. * regformats/i386/amd64.dat: Likewise. * regformats/reg-i386-linux.dat: Removed. * regformats/reg-i386.dat: Likewise. * regformats/reg-x86-64-linux.dat: Likewise. * regformats/reg-x86-64.dat: Likewise. gdb/gdbserver/ 2010-03-01 H.J. Lu <hongjiu.lu@intel.com> * Makefile.in (clean): Replace reg-i386.c, reg-x86-64.c, reg-i386-linux.c and reg-x86-64-linux.c with i386.c, amd64.c, i386-linux.c and amd64-linux.c. (reg-i386.o): Removed. (reg-i386.c): Likewise. (reg-i386-linux.o): Likewise. (reg-i386-linux.c): Likewise. (reg-x86-64.o): Likewise. (reg-x86-64.c): Likewise. (reg-x86-64-linux.o): Likewise. (reg-x86-64-linux.c): Likewise. (i386.o): New. (i386.c): Likewise. (i386-linux.o): Likewise. (i386-linux.c): Likewise. (amd64.o): Likewise. (amd64.c): Likewise. (amd64-linux.o): Likewise. (amd64-linux.c): Likewise. * configure.srv (srv_i386_regobj): New. (srv_i386_linux_regobj): Likewise. (srv_amd64_regobj): Likewise. (srv_amd64_linux_regobj): Likewise. (srv_i386_32bit_xmlfiles): Likewise. (srv_i386_64bit_xmlfiles): Likewise. (srv_i386_xmlfiles): Likewise. (srv_amd64_xmlfiles): Likewise. (srv_i386_linux_xmlfiles): Likewise. (srv_amd64_linux_xmlfiles): Likewise. (i[34567]86-*-cygwin*): Set srv_regobj to $srv_i386_regobj. Set srv_xmlfiles to $srv_i386_xmlfiles. (i[34567]86-*-mingw32ce*): Likewise. (i[34567]86-*-mingw*): Likewise. (i[34567]86-*-nto*): Likewise. (i[34567]86-*-linux*): Set srv_regobj to $srv_i386_linux_regobj and $srv_amd64_linux_regobj. Set srv_xmlfiles to $srv_i386_linux_xmlfiles and $srv_amd64_linux_xmlfiles. (x86_64-*-linux*): Likewise. * linux-x86-low.c (init_registers_x86_64_linux): Removed. (init_registers_amd64_linux): New. (x86_arch_setup): Replace init_registers_x86_64_linux with init_registers_amd64_linux. gdb/testsuite/ 2010-03-01 H.J. Lu <hongjiu.lu@intel.com> * gdb.xml/tdesc-regs.exp (architecture): New. Set it for x86. (load_description): Set architecture if defined.
2010-03-01 16:33:32 +01:00
}
/* Get Linux/x86 target description from core dump. */
static const struct target_desc *
amd64_linux_core_read_description (struct gdbarch *gdbarch,
struct target_ops *target,
bfd *abfd)
{
/* Linux/x86-64. */
uint64_t xcr0 = i386_linux_core_read_xcr0 (abfd);
return amd64_linux_read_description (xcr0 & X86_XSTATE_ALL_MASK,
gdbarch_ptr_bit (gdbarch) == 32);
}
Add 'regset' parameter to 'iterate_over_regset_sections_cb' This adds the 'regset' parameter to the iterator callback. Consequently the 'regset_from_core_section' method is dropped for all targets that provide the iterator method. This change prepares for replacing regset_from_core_section everywhere, thereby eliminating one gdbarch interface. Since the iterator is usually no more complex than regset_from_core_section alone, targets that previously didn't define core_regset_sections will then gain multi-arch capable core file generation support without increased complexity. gdb/ChangeLog: * gdbarch.sh (iterate_over_regset_sections_cb): Add regset parameter. * gdbarch.h: Regenerate. * corelow.c (sniff_core_bfd): Don't sniff if gdbarch has a regset iterator. (get_core_register_section): Add parameter 'regset' and use it, if set. Add parameter 'min_size' and verify the bfd section size against it. (get_core_registers_cb): Add parameter 'regset' and pass it to get_core_register section. For the "standard" register sections ".reg" and ".reg2", set an appropriate default for human_name. (get_core_registers): Don't abort when the gdbarch has an iterator but no regset_from_core_section. Add NULL/0 for parameters 'regset'/'min_size' in calls to get_core_register_section. * linux-tdep.c (linux_collect_regset_section_cb): Add parameter 'regset' and use it instead of calling the regset_from_core_section gdbarch method. * i386-tdep.h (struct gdbarch_tdep): Add field 'fpregset'. * i386-tdep.c (i386_supply_xstateregset) (i386_collect_xstateregset, i386_xstateregset): Moved to i386-linux-tdep.c. (i386_regset_from_core_section): Drop handling for .reg-xfp and .reg-xstate. (i386_gdbarch_init): Set tdep field 'fpregset'. Enable generic core file support only if the regset iterator hasn't been set. * i386-linux-tdep.c (i386_linux_supply_xstateregset) (i386_linux_collect_xstateregset, i386_linux_xstateregset): New. Moved from i386-tdep.c and renamed to *_linux*. (i386_linux_iterate_over_regset_sections): Add regset parameter to each callback invocation. Allow any .reg-xstate size when reading from a core file. * amd64-tdep.c (amd64_supply_xstateregset) (amd64_collect_xstateregset, amd64_xstateregset): Moved to amd64-linux-tdep.c. (amd64_regset_from_core_section): Remove. (amd64_init_abi): Set new tdep field 'fpregset'. No longer install an amd64-specific regset_from_core_section gdbarch method. * amd64-linux-tdep.c (amd64_linux_supply_xstateregset) (amd64_linux_collect_xstateregset, amd64_linux_xstateregset): New. Moved from amd64-tdep.c and renamed to *_linux*. (amd64_linux_iterate_over_regset_sections): Add regset parameter to each callback invocation. Allow any .reg-xstate size when reading from a core file. * arm-linux-tdep.c (arm_linux_regset_from_core_section): Remove. (arm_linux_iterate_over_regset_sections): Add regset parameter to each callback invocation. (arm_linux_init_abi): No longer set the regset_from_core_section gdbarch method. * ppc-linux-tdep.c (ppc_linux_regset_from_core_section): Remove. (ppc_linux_iterate_over_regset_sections): Add regset parameter to each callback invocation. (ppc_linux_init_abi): No longer set the regset_from_core_section gdbarch method. * s390-linux-tdep.c (struct gdbarch_tdep): Remove the fields gregset, sizeof_gregset, fpregset, and sizeof_fpregset. (s390_regset_from_core_section): Remove. (s390_iterate_over_regset_sections): Add regset parameter to each callback invocation. (s390_gdbarch_init): No longer set the regset_from_core_section gdbarch method. Drop initialization of deleted tdep fields.
2014-09-12 10:42:48 +02:00
/* Similar to amd64_supply_fpregset, but use XSAVE extended state. */
static void
amd64_linux_supply_xstateregset (const struct regset *regset,
struct regcache *regcache, int regnum,
const void *xstateregs, size_t len)
{
amd64_supply_xsave (regcache, regnum, xstateregs);
}
/* Similar to amd64_collect_fpregset, but use XSAVE extended state. */
static void
amd64_linux_collect_xstateregset (const struct regset *regset,
const struct regcache *regcache,
int regnum, void *xstateregs, size_t len)
{
amd64_collect_xsave (regcache, regnum, xstateregs, 1);
}
static const struct regset amd64_linux_xstateregset =
{
NULL,
amd64_linux_supply_xstateregset,
amd64_linux_collect_xstateregset
};
Replace 'core_regset_sections' by iterator method The core_regset_sections list in gdbarch (needed for multi-arch capable core file generation support) is replaced by an iterator method. Overall, this reduces the code a bit, and it allows for more flexibility. gdb/ChangeLog: * amd64-linux-tdep.c (amd64_linux_regset_sections): Remove. (amd64_linux_iterate_over_regset_sections): New. (amd64_linux_init_abi_common): Don't install the regset section list, but the new iterator in gdbarch. * arm-linux-tdep.c (arm_linux_fpa_regset_sections) (arm_linux_vfp_regset_sections): Remove. Move combined logic... (arm_linux_iterate_over_regset_sections): ...here. New function. (arm_linux_init_abi): Set iterator instead of section list. * corelow.c (get_core_registers_cb): New function, logic moved from... (get_core_registers): ...loop body here. Use new iterator method instead of walking through the regset section list. * gdbarch.sh: Remove 'core_regset_sections'. New method 'iterate_over_regset_sections'. New typedef 'iterate_over_regset_sections_cb'. * gdbarch.c: Regenerate. * gdbarch.h: Likewise. * i386-linux-tdep.c (i386_linux_regset_sections) (i386_linux_sse_regset_sections, i386_linux_avx_regset_sections): Remove. (i386_linux_iterate_over_regset_sections): New. (i386_linux_init_abi): Don't choose a regset section list, but install new iterator in gdbarch. * linux-tdep.c (struct linux_collect_regset_section_cb_data): New. (linux_collect_regset_section_cb): New function, logic moved from... (linux_collect_thread_registers): ...loop body here. Use iterator method instead of walking through list. (linux_make_corefile_notes_1): Check for presence of iterator method instead of regset section list. * ppc-linux-tdep.c (ppc_linux_vsx_regset_sections) (ppc_linux_vmx_regset_sections, ppc_linux_fp_regset_sections) (ppc64_linux_vsx_regset_sections, ppc64_linux_vmx_regset_sections) (ppc64_linux_fp_regset_sections): Remove. Move combined logic... (ppc_linux_iterate_over_regset_sections): ...here. New function. (ppc_linux_init_abi): Don't choose from above regset section lists, but install new iterator in gdbarch. * regset.h (struct core_regset_section): Remove. * s390-linux-tdep.c (struct gdbarch_tdep): Add new fields have_linux_v1, have_linux_v2, and have_tdb. (s390_linux32_regset_sections, s390_linux32v1_regset_sections) (s390_linux32v2_regset_sections, s390_linux64_regset_sections) (s390_linux64v1_regset_sections, s390_linux64v2_regset_sections) (s390x_linux64_regset_sections, s390x_linux64v1_regset_sections) (s390x_linux64v2_regset_sections): Remove. Move combined logic... (s390_iterate_over_regset_sections): ...here. New function. Use new tdep fields. (s390_gdbarch_init): Set new tdep fields. Don't choose from above regset section lists, but install new iterator.
2014-09-04 17:26:43 +02:00
/* Iterate over core file register note sections. */
static void
amd64_linux_iterate_over_regset_sections (struct gdbarch *gdbarch,
iterate_over_regset_sections_cb *cb,
void *cb_data,
const struct regcache *regcache)
{
Add 'regset' parameter to 'iterate_over_regset_sections_cb' This adds the 'regset' parameter to the iterator callback. Consequently the 'regset_from_core_section' method is dropped for all targets that provide the iterator method. This change prepares for replacing regset_from_core_section everywhere, thereby eliminating one gdbarch interface. Since the iterator is usually no more complex than regset_from_core_section alone, targets that previously didn't define core_regset_sections will then gain multi-arch capable core file generation support without increased complexity. gdb/ChangeLog: * gdbarch.sh (iterate_over_regset_sections_cb): Add regset parameter. * gdbarch.h: Regenerate. * corelow.c (sniff_core_bfd): Don't sniff if gdbarch has a regset iterator. (get_core_register_section): Add parameter 'regset' and use it, if set. Add parameter 'min_size' and verify the bfd section size against it. (get_core_registers_cb): Add parameter 'regset' and pass it to get_core_register section. For the "standard" register sections ".reg" and ".reg2", set an appropriate default for human_name. (get_core_registers): Don't abort when the gdbarch has an iterator but no regset_from_core_section. Add NULL/0 for parameters 'regset'/'min_size' in calls to get_core_register_section. * linux-tdep.c (linux_collect_regset_section_cb): Add parameter 'regset' and use it instead of calling the regset_from_core_section gdbarch method. * i386-tdep.h (struct gdbarch_tdep): Add field 'fpregset'. * i386-tdep.c (i386_supply_xstateregset) (i386_collect_xstateregset, i386_xstateregset): Moved to i386-linux-tdep.c. (i386_regset_from_core_section): Drop handling for .reg-xfp and .reg-xstate. (i386_gdbarch_init): Set tdep field 'fpregset'. Enable generic core file support only if the regset iterator hasn't been set. * i386-linux-tdep.c (i386_linux_supply_xstateregset) (i386_linux_collect_xstateregset, i386_linux_xstateregset): New. Moved from i386-tdep.c and renamed to *_linux*. (i386_linux_iterate_over_regset_sections): Add regset parameter to each callback invocation. Allow any .reg-xstate size when reading from a core file. * amd64-tdep.c (amd64_supply_xstateregset) (amd64_collect_xstateregset, amd64_xstateregset): Moved to amd64-linux-tdep.c. (amd64_regset_from_core_section): Remove. (amd64_init_abi): Set new tdep field 'fpregset'. No longer install an amd64-specific regset_from_core_section gdbarch method. * amd64-linux-tdep.c (amd64_linux_supply_xstateregset) (amd64_linux_collect_xstateregset, amd64_linux_xstateregset): New. Moved from amd64-tdep.c and renamed to *_linux*. (amd64_linux_iterate_over_regset_sections): Add regset parameter to each callback invocation. Allow any .reg-xstate size when reading from a core file. * arm-linux-tdep.c (arm_linux_regset_from_core_section): Remove. (arm_linux_iterate_over_regset_sections): Add regset parameter to each callback invocation. (arm_linux_init_abi): No longer set the regset_from_core_section gdbarch method. * ppc-linux-tdep.c (ppc_linux_regset_from_core_section): Remove. (ppc_linux_iterate_over_regset_sections): Add regset parameter to each callback invocation. (ppc_linux_init_abi): No longer set the regset_from_core_section gdbarch method. * s390-linux-tdep.c (struct gdbarch_tdep): Remove the fields gregset, sizeof_gregset, fpregset, and sizeof_fpregset. (s390_regset_from_core_section): Remove. (s390_iterate_over_regset_sections): Add regset parameter to each callback invocation. (s390_gdbarch_init): No longer set the regset_from_core_section gdbarch method. Drop initialization of deleted tdep fields.
2014-09-12 10:42:48 +02:00
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
Split size in regset section iterators In the existing code, when using the regset section iteration functions, the size parameter is used in different ways. With collect, size is used to create the buffer in which to write the regset. (see linux-tdep.c::linux_collect_regset_section_cb). With supply, size is used to confirm the existing regset is the correct size. If REGSET_VARIABLE_SIZE is set then the regset can be bigger than size. Effectively, size is the minimum possible size of the regset. (see corelow.c::get_core_register_section). There are currently no targets with both REGSET_VARIABLE_SIZE and a collect function. In SVE, a corefile can contain one of two formats after the header, both of which are different sizes. However, when writing a core file, we always want to write out the full bigger size. To allow support of collects for REGSET_VARIABLE_SIZE we need two sizes. This is done by adding supply_size and collect_size. gdb/ * aarch64-fbsd-tdep.c (aarch64_fbsd_iterate_over_regset_sections): Add supply_size and collect_size. * aarch64-linux-tdep.c (aarch64_linux_iterate_over_regset_sections): Likewise. * alpha-linux-tdep.c (alpha_linux_iterate_over_regset_sections): * alpha-nbsd-tdep.c (alphanbsd_iterate_over_regset_sections): Likewise. * amd64-fbsd-tdep.c (amd64fbsd_iterate_over_regset_sections): Likewise. * amd64-linux-tdep.c (amd64_linux_iterate_over_regset_sections): Likewise. * arm-bsd-tdep.c (armbsd_iterate_over_regset_sections): Likewise. * arm-fbsd-tdep.c (arm_fbsd_iterate_over_regset_sections): Likewise. * arm-linux-tdep.c (arm_linux_iterate_over_regset_sections): Likewise. * corelow.c (get_core_registers_cb): Likewise. (core_target::fetch_registers): Likewise. * fbsd-tdep.c (fbsd_collect_regset_section_cb): Likewise. * frv-linux-tdep.c (frv_linux_iterate_over_regset_sections): Likewise. * gdbarch.h (void): Regenerate. * gdbarch.sh: Add supply_size and collect_size. * hppa-linux-tdep.c (hppa_linux_iterate_over_regset_sections): Likewise. * hppa-nbsd-tdep.c (hppanbsd_iterate_over_regset_sections): Likewise. * hppa-obsd-tdep.c (hppaobsd_iterate_over_regset_sections): Likewise. * i386-fbsd-tdep.c (i386fbsd_iterate_over_regset_sections): Likewise. * i386-linux-tdep.c (i386_linux_iterate_over_regset_sections): Likewise. * i386-tdep.c (i386_iterate_over_regset_sections): Likewise. * ia64-linux-tdep.c (ia64_linux_iterate_over_regset_sections): Likewise. * linux-tdep.c (linux_collect_regset_section_cb): Likewise. * m32r-linux-tdep.c (m32r_linux_iterate_over_regset_sections): Likewise. * m68k-bsd-tdep.c (m68kbsd_iterate_over_regset_sections): Likewise. * m68k-linux-tdep.c (m68k_linux_iterate_over_regset_sections): Likewise. * mips-fbsd-tdep.c (mips_fbsd_iterate_over_regset_sections): Likewise. * mips-linux-tdep.c (mips_linux_iterate_over_regset_sections): Likewise. * mips-nbsd-tdep.c (mipsnbsd_iterate_over_regset_sections): Likewise. * mips64-obsd-tdep.c (mips64obsd_iterate_over_regset_sections): Likewise. * mn10300-linux-tdep.c (am33_iterate_over_regset_sections): Likewise. * nios2-linux-tdep.c (nios2_iterate_over_regset_sections): Likewise. * ppc-fbsd-tdep.c (ppcfbsd_iterate_over_regset_sections): Likewise. * ppc-linux-tdep.c (ppc_linux_iterate_over_regset_sections): Likewise. * ppc-nbsd-tdep.c (ppcnbsd_iterate_over_regset_sections): Likewise. * ppc-obsd-tdep.c (ppcobsd_iterate_over_regset_sections): Likewise. * riscv-linux-tdep.c (riscv_linux_iterate_over_regset_sections): Likewise. * rs6000-aix-tdep.c (rs6000_aix_iterate_over_regset_sections): Likewise. * s390-linux-tdep.c (s390_iterate_over_regset_sections): Likewise. * score-tdep.c (score7_linux_iterate_over_regset_sections): Likewise. * sh-tdep.c (sh_iterate_over_regset_sections): Likewise. * sparc-tdep.c (sparc_iterate_over_regset_sections): Likewise. * tilegx-linux-tdep.c (tilegx_iterate_over_regset_sections): Likewise. * vax-tdep.c (vax_iterate_over_regset_sections): Likewise. * xtensa-tdep.c (xtensa_iterate_over_regset_sections): Likewise.
2018-08-13 11:04:11 +02:00
cb (".reg", 27 * 8, 27 * 8, &i386_gregset, NULL, cb_data);
cb (".reg2", 512, 512, &amd64_fpregset, NULL, cb_data);
cb (".reg-xstate", X86_XSTATE_SIZE (tdep->xcr0), X86_XSTATE_SIZE (tdep->xcr0),
Add 'regset' parameter to 'iterate_over_regset_sections_cb' This adds the 'regset' parameter to the iterator callback. Consequently the 'regset_from_core_section' method is dropped for all targets that provide the iterator method. This change prepares for replacing regset_from_core_section everywhere, thereby eliminating one gdbarch interface. Since the iterator is usually no more complex than regset_from_core_section alone, targets that previously didn't define core_regset_sections will then gain multi-arch capable core file generation support without increased complexity. gdb/ChangeLog: * gdbarch.sh (iterate_over_regset_sections_cb): Add regset parameter. * gdbarch.h: Regenerate. * corelow.c (sniff_core_bfd): Don't sniff if gdbarch has a regset iterator. (get_core_register_section): Add parameter 'regset' and use it, if set. Add parameter 'min_size' and verify the bfd section size against it. (get_core_registers_cb): Add parameter 'regset' and pass it to get_core_register section. For the "standard" register sections ".reg" and ".reg2", set an appropriate default for human_name. (get_core_registers): Don't abort when the gdbarch has an iterator but no regset_from_core_section. Add NULL/0 for parameters 'regset'/'min_size' in calls to get_core_register_section. * linux-tdep.c (linux_collect_regset_section_cb): Add parameter 'regset' and use it instead of calling the regset_from_core_section gdbarch method. * i386-tdep.h (struct gdbarch_tdep): Add field 'fpregset'. * i386-tdep.c (i386_supply_xstateregset) (i386_collect_xstateregset, i386_xstateregset): Moved to i386-linux-tdep.c. (i386_regset_from_core_section): Drop handling for .reg-xfp and .reg-xstate. (i386_gdbarch_init): Set tdep field 'fpregset'. Enable generic core file support only if the regset iterator hasn't been set. * i386-linux-tdep.c (i386_linux_supply_xstateregset) (i386_linux_collect_xstateregset, i386_linux_xstateregset): New. Moved from i386-tdep.c and renamed to *_linux*. (i386_linux_iterate_over_regset_sections): Add regset parameter to each callback invocation. Allow any .reg-xstate size when reading from a core file. * amd64-tdep.c (amd64_supply_xstateregset) (amd64_collect_xstateregset, amd64_xstateregset): Moved to amd64-linux-tdep.c. (amd64_regset_from_core_section): Remove. (amd64_init_abi): Set new tdep field 'fpregset'. No longer install an amd64-specific regset_from_core_section gdbarch method. * amd64-linux-tdep.c (amd64_linux_supply_xstateregset) (amd64_linux_collect_xstateregset, amd64_linux_xstateregset): New. Moved from amd64-tdep.c and renamed to *_linux*. (amd64_linux_iterate_over_regset_sections): Add regset parameter to each callback invocation. Allow any .reg-xstate size when reading from a core file. * arm-linux-tdep.c (arm_linux_regset_from_core_section): Remove. (arm_linux_iterate_over_regset_sections): Add regset parameter to each callback invocation. (arm_linux_init_abi): No longer set the regset_from_core_section gdbarch method. * ppc-linux-tdep.c (ppc_linux_regset_from_core_section): Remove. (ppc_linux_iterate_over_regset_sections): Add regset parameter to each callback invocation. (ppc_linux_init_abi): No longer set the regset_from_core_section gdbarch method. * s390-linux-tdep.c (struct gdbarch_tdep): Remove the fields gregset, sizeof_gregset, fpregset, and sizeof_fpregset. (s390_regset_from_core_section): Remove. (s390_iterate_over_regset_sections): Add regset parameter to each callback invocation. (s390_gdbarch_init): No longer set the regset_from_core_section gdbarch method. Drop initialization of deleted tdep fields.
2014-09-12 10:42:48 +02:00
&amd64_linux_xstateregset, "XSAVE extended state", cb_data);
Replace 'core_regset_sections' by iterator method The core_regset_sections list in gdbarch (needed for multi-arch capable core file generation support) is replaced by an iterator method. Overall, this reduces the code a bit, and it allows for more flexibility. gdb/ChangeLog: * amd64-linux-tdep.c (amd64_linux_regset_sections): Remove. (amd64_linux_iterate_over_regset_sections): New. (amd64_linux_init_abi_common): Don't install the regset section list, but the new iterator in gdbarch. * arm-linux-tdep.c (arm_linux_fpa_regset_sections) (arm_linux_vfp_regset_sections): Remove. Move combined logic... (arm_linux_iterate_over_regset_sections): ...here. New function. (arm_linux_init_abi): Set iterator instead of section list. * corelow.c (get_core_registers_cb): New function, logic moved from... (get_core_registers): ...loop body here. Use new iterator method instead of walking through the regset section list. * gdbarch.sh: Remove 'core_regset_sections'. New method 'iterate_over_regset_sections'. New typedef 'iterate_over_regset_sections_cb'. * gdbarch.c: Regenerate. * gdbarch.h: Likewise. * i386-linux-tdep.c (i386_linux_regset_sections) (i386_linux_sse_regset_sections, i386_linux_avx_regset_sections): Remove. (i386_linux_iterate_over_regset_sections): New. (i386_linux_init_abi): Don't choose a regset section list, but install new iterator in gdbarch. * linux-tdep.c (struct linux_collect_regset_section_cb_data): New. (linux_collect_regset_section_cb): New function, logic moved from... (linux_collect_thread_registers): ...loop body here. Use iterator method instead of walking through list. (linux_make_corefile_notes_1): Check for presence of iterator method instead of regset section list. * ppc-linux-tdep.c (ppc_linux_vsx_regset_sections) (ppc_linux_vmx_regset_sections, ppc_linux_fp_regset_sections) (ppc64_linux_vsx_regset_sections, ppc64_linux_vmx_regset_sections) (ppc64_linux_fp_regset_sections): Remove. Move combined logic... (ppc_linux_iterate_over_regset_sections): ...here. New function. (ppc_linux_init_abi): Don't choose from above regset section lists, but install new iterator in gdbarch. * regset.h (struct core_regset_section): Remove. * s390-linux-tdep.c (struct gdbarch_tdep): Add new fields have_linux_v1, have_linux_v2, and have_tdb. (s390_linux32_regset_sections, s390_linux32v1_regset_sections) (s390_linux32v2_regset_sections, s390_linux64_regset_sections) (s390_linux64v1_regset_sections, s390_linux64v2_regset_sections) (s390x_linux64_regset_sections, s390x_linux64v1_regset_sections) (s390x_linux64v2_regset_sections): Remove. Move combined logic... (s390_iterate_over_regset_sections): ...here. New function. Use new tdep fields. (s390_gdbarch_init): Set new tdep fields. Don't choose from above regset section lists, but install new iterator.
2014-09-04 17:26:43 +02:00
}
/* The instruction sequences used in x86_64 machines for a
disabled is-enabled probe. */
const gdb_byte amd64_dtrace_disabled_probe_sequence_1[] = {
/* xor %rax, %rax */ 0x48, 0x33, 0xc0,
/* nop */ 0x90,
/* nop */ 0x90
};
const gdb_byte amd64_dtrace_disabled_probe_sequence_2[] = {
/* xor %rax, %rax */ 0x48, 0x33, 0xc0,
/* ret */ 0xc3,
/* nop */ 0x90
};
/* The instruction sequence used in x86_64 machines for enabling a
DTrace is-enabled probe. */
const gdb_byte amd64_dtrace_enable_probe_sequence[] = {
/* mov $0x1, %eax */ 0xb8, 0x01, 0x00, 0x00, 0x00
};
/* The instruction sequence used in x86_64 machines for disabling a
DTrace is-enabled probe. */
const gdb_byte amd64_dtrace_disable_probe_sequence[] = {
/* xor %rax, %rax; nop; nop */ 0x48, 0x33, 0xC0, 0x90, 0x90
};
/* Implementation of `gdbarch_dtrace_probe_is_enabled', as defined in
gdbarch.h. */
static int
amd64_dtrace_probe_is_enabled (struct gdbarch *gdbarch, CORE_ADDR addr)
{
gdb_byte buf[5];
/* This function returns 1 if the instructions at ADDR do _not_
follow any of the amd64_dtrace_disabled_probe_sequence_*
patterns.
Note that ADDR is offset 3 bytes from the beginning of these
sequences. */
read_code (addr - 3, buf, 5);
return (memcmp (buf, amd64_dtrace_disabled_probe_sequence_1, 5) != 0
&& memcmp (buf, amd64_dtrace_disabled_probe_sequence_2, 5) != 0);
}
/* Implementation of `gdbarch_dtrace_enable_probe', as defined in
gdbarch.h. */
static void
amd64_dtrace_enable_probe (struct gdbarch *gdbarch, CORE_ADDR addr)
{
/* Note also that ADDR is offset 3 bytes from the beginning of
amd64_dtrace_enable_probe_sequence. */
write_memory (addr - 3, amd64_dtrace_enable_probe_sequence, 5);
}
/* Implementation of `gdbarch_dtrace_disable_probe', as defined in
gdbarch.h. */
static void
amd64_dtrace_disable_probe (struct gdbarch *gdbarch, CORE_ADDR addr)
{
/* Note also that ADDR is offset 3 bytes from the beginning of
amd64_dtrace_disable_probe_sequence. */
write_memory (addr - 3, amd64_dtrace_disable_probe_sequence, 5);
}
/* Implementation of `gdbarch_dtrace_parse_probe_argument', as defined
in gdbarch.h. */
static void
amd64_dtrace_parse_probe_argument (struct gdbarch *gdbarch,
struct expr_builder *builder,
int narg)
{
struct stoken str;
/* DTrace probe arguments can be found on the ABI-defined places for
regular arguments at the current PC. The probe abstraction
currently supports up to 12 arguments for probes. */
if (narg < 6)
{
static const int arg_reg_map[6] =
{
AMD64_RDI_REGNUM, /* Arg 1. */
AMD64_RSI_REGNUM, /* Arg 2. */
AMD64_RDX_REGNUM, /* Arg 3. */
AMD64_RCX_REGNUM, /* Arg 4. */
AMD64_R8_REGNUM, /* Arg 5. */
AMD64_R9_REGNUM /* Arg 6. */
};
int regno = arg_reg_map[narg];
const char *regname = user_reg_map_regnum_to_name (gdbarch, regno);
write_exp_elt_opcode (builder, OP_REGISTER);
str.ptr = regname;
str.length = strlen (regname);
write_exp_string (builder, str);
write_exp_elt_opcode (builder, OP_REGISTER);
}
else
{
/* Additional arguments are passed on the stack. */
const char *regname = user_reg_map_regnum_to_name (gdbarch, AMD64_RSP_REGNUM);
/* Displacement. */
write_exp_elt_opcode (builder, OP_LONG);
write_exp_elt_type (builder, builtin_type (gdbarch)->builtin_long);
write_exp_elt_longcst (builder, narg - 6);
write_exp_elt_opcode (builder, OP_LONG);
/* Register: SP. */
write_exp_elt_opcode (builder, OP_REGISTER);
str.ptr = regname;
str.length = strlen (regname);
write_exp_string (builder, str);
write_exp_elt_opcode (builder, OP_REGISTER);
write_exp_elt_opcode (builder, BINOP_ADD);
/* Cast to long. */
write_exp_elt_opcode (builder, UNOP_CAST);
write_exp_elt_type (builder,
lookup_pointer_type (builtin_type (gdbarch)->builtin_long));
write_exp_elt_opcode (builder, UNOP_CAST);
write_exp_elt_opcode (builder, UNOP_IND);
}
}
static void
amd64_linux_init_abi_common(struct gdbarch_info info, struct gdbarch *gdbarch)
{
* x86-64-tdep.h (x86_64_num_regs, x86_64_num_gregs): Remove variable declarations. (x86_64_register_number, x86_64_register_name): Remove prototypes. (x86_64_linux_frame_saved_pc, x86_64_linux+saved_pc_after_call, x86_64_linux_in_sigtramp, x86_64_linux_frame_chain, x86_64_init_frame_pc, x86_64_init_frame_pc, x86_64_function_has_prologue): Remove prototypes. (X86_64_NUM_GREGS): New define. (x86_64_supply_fxsave, x86_64_fill_fxsave): New prototypes. * x86-64-tdep.c: Don't include "dwarf2cfi.h". Include "dummy_frame.h", "frame.h", "frame-base.h", "frame-unwind.h". (RAX_REGNUM, RDX_REGNUM, RDI_REGNUM, EFLAGS_REGNUM, ST0_REGNUM, XMM1_REGNUM): Remove defines. (X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, X86_64_RDI_REGNUM, X86_64_RBP_REGNUM, X86_64_RSP_REGNUM, X86_64_RIP_REGNUM, X86_64_EFLAGS_REGNUM, X86_64_ST0_REGNUM, X86_64_XMM0_REGNUM, X86_64_XMM1_REGNUM): New defines. (struct x86_64_register_info): Renamed from `struct register_info'. Remove `size' member. (x86_64_register_info_table): Remove variable. (x86_64_register_info): New variable. (X86_64_NUM_REGS): New define. (X86_64_NUM_GREGS): Remove define. (x86_64_num_regs, x86_64_num_gregs): Remove variables. (x86_64_dwarf2gdb_regno_map, x86_64_dwarf2gdb_regno_map_length): Remove variables. (x86_54_dwarf2_reg_to_regnum): Remove function. (x86_64_dwarf_regmap, x86_64_dwarf_regmap_len): New variables. (x86_64_dwarf_reg_to_regnum): New function. (x86_64_register_name): Rewrite. (x86_64_register_raw_size): Remove function. (x86_64_register_byte_table): Remove variable. (x86_64_register_byte): Remove function. (x86_64_register_virtual_type): Remove function. (x86_64_register_type): New function. (x86_64_register_convertible, x86_64_register_convert_to_virtual, x86_64_register_convert_to_raw): Remove functions. (x86_64_push_return_address, x86_64_pop_frame): Remove functon. (x86_64_use_struct_convention): Make static. Adjust for renamed defines. (x86_64_frame_init_saved_regs): Remove function. (x86_64_push_arguments): Make static. Change to accept a regcache as argument. (x86_64_store_return_value, x86_64_extract_return_value): Make static. Rewrite based on i386 counterparts. (x86_64_push_dummy_call): New function. (X86_64_NUM_SAVED_REGS): New define. (x86_64_register_number): Remove function. (x86_64_store_struct_return): Remove function. (x86_64_frameless_function_invocation, x86_64_function_has_prologue): Remove functions. (PROLOG_BUFSIZE): Remove define. (struct x86_64_frame_cache): New structure. (x86_64_alloc_frame_cache, x86_64_analyze_prologue, x86_64_frame_cache, x86_64_frame_this_id, x86_64_frame_prev_register, x86_64_frame_p, x86_64_sigtramp_frame_cache, x86_64_sigtramp_frame_this_id, x86_64_sigtramp_frame_prev_register, x86_sigtramp_frame_p): New functions. (x86_64_frame_unwind, x86_64_sigtramp_frame_unwind): New variables. (x86_64_skip_prologue): Rewrite in terms of x86_64_analyze_prologue. (x86_64_frame_base_address): New function. (x86_64_frame_base): New variable. (x86_64_save_dummy_frame_tos, x86_64_unwind_dummy_id): Rewrite. (x86_64_init_abi): Set register_type and push_dummy_call. Don't set deprecated_fp_regnum, deprecated_register_size, deprecated_register_bytes, register_raw_size, register_byte, register_virtual_type, register_convertiable, register_convert_to_virtual, convert_to_raw, deprecated_get_saved_register, deprecated_target_read_fp, deprecated_push_arguments, deprecated_push_return_address, deprecated_pop_frame, deprecated_store_struct_return, deprecated_frame_init_saved_regs, deprecated_frame_chain, frameless_function_invocation, deprecated_frame_saved_pc, deprecated_saved_pc_after_call, frame_num_args, pc_in_sigtramp, dwarf2_build_frame_info, deprecated_init_extra_frame_info, deprecated_init_frame_pc and virtual_frame_pointer. Call frame_unwind_append_predicate to register x86_64_sigtramp_frame_p and x86_64_frame_p. Call frame_base_set_default to register x86_64_frame_base. (I387_FISEG_REGNUM, I387_FOSEG_REGNUM): New defines. (x86_64_supply_fxsave, x86_64_fill_fxsave): New functions. (_initialize_x86_64_tdep): Remove function. * x86-64-linux-tdep.c: Don't include "dwarf2cfi.h". (LINUX_SIGINFO_SIZE, LINUX_UCONTEXT_SIGCONTEXT_OFFSET, LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONTEXT_FP_OFFSET): Don't define. (X86_64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Define. (x86_64_linux_sigcontext_addr): Rewrite. (x86_64_linux_sigtramp_saved_pc, x86_64_linux_saved_pc_after_call, x86_64_linux_frame_saved_pc): Remove functions. (x86_64_linux_pc_in_sigtramp): Renamed from x86_64_linux_in_sigtramp. Try harder to recognize a signal trampoline. (x86_64_linux_frame_chain, x86_64_init_frame_pc): Remove_functions. (x86_64_linux_init_abi): Set pc_in_sigtramp. Initialize TDEP->sigcontext_addr, TDEP->sc_pc_offset and TDEP->sc_sp_offset. * x86-64-linux-nat.c: Sync with i386-linux-tdep.c. (x86_64_regmap): Rename to regmap. (GETREGS_SUPPLIES): Use X86_64_NUM_GREGS instead of x86_64_num_gregs. (supply_gregset, fill_gregset): Likewise. Use regmap instead of x86_64_regmap. (x86_64_fxsave_offset): Remove function. (supply_fpregset): Simply call x86_64_supply_fxsave. (fill_fpregset): Simply call x86_64_fill_fxsave. (fetch_inferior_registers, store_inferior_registers): Avoid asignment in if-statement. (LINUX_SYSCALL_LEN, LINUX_SYSCALL_REGNUM, SYS_Sigreturn, SYS_rt_sigreturn, LINUX_SIGCONTEXT_EFLAGS_OFFSET, LINUX_UCONTEXT_SIGCONTEXT_OFFSET): Remove defines. (fetch_core_registers): Remove function. (linux_elf_core_fns): Remove. (offsetoff): Don't define. (_initialize_x86_64_linux_nat, kernel_u_size): Remove functions. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-linux-tdep.o. * config/i386/x86-64linux.mh (NATDEPFILES): Remove core-aout.o, add core-regset.o. * config/i386/nm-x86-64linux.h: Use NM_X86_64_LINUX_H for protection against multiple includes instead of NM_X86_64_h. Add various comments. Include "config/nm-linux.h". Don't include <signal.h>. (REGISTER_U_ADDR, KERNEL_U_SIZE, U_REGS_OFFSET, KERN_U_ADDR, GET_THREAD_SIGNALS): Remove defines. (x86_64_register_u_addr, kernel_u_size, lin_thread_get_thread_signals): Remove prototypes. (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Define to `long'. [HAVE_LINK_H]: Don't include "solib.h". [HAVE_LINK_H] (SVR4_SHARED_LIBS): Remove define. * config/i386/tm-x86-64linux.h: Fix comments. * Makefile.in (x86-64-linux-nat.o, x86_64-linux-tdep.o, x86-64-tdep.o): Update dependencies.
2003-05-31 10:15:38 +02:00
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
* corelow.c (core_pid_to_str): Default to using normal_pid_to_str instead of printing "Thread" here. * linux-tdep.c: Include inferior.h. (linux_core_pid_to_str): New. (linux_init_abi): New. * linux-tdep.h (linux_init_abi): Declare. * alpha-linux-tdep.c: Include linux-tdep.h. (alpha_linux_init_abi): Call linux_init_abi. * amd64-linux-tdep.c (amd64_linux_init_abi): Call linux_init_abi. * arm-linux-tdep.c (arm_linux_init_abi): Call linux_init_abi. * frv-linux-tdep.c: Include linux-tdep.h (frv_linux_init_abi): Call linux_init_abi. * hppa-linux-tdep.c: Include linux-tdep.h (hppa_linux_init_abi): Call linux_init_abi. * i386-linux-tdep.c (i386_linux_init_abi): Call linux_init_abi. * ia64-linux-tdep.c: Include linux-tdep.h. (ia64_linux_init_abi): Call linux_init_abi. * m32r-linux-tdep.c: Include linux-tdep.h. (m32r_linux_init_abi): Call linux_init_abi. * m68klinux-tdep.c: Include linux-tdep.h. (m68k_linux_init_abi): Call linux_init_abi. * microblaze-linux-tdep.c: Include linux-tdep.h. (microblaze_linux_init_abi): Call linux_init_abi. * mips-linux-tdep.c: Include linux-tdep.h. (mips_linux_init_abi): Call linux_init_abi. * mn10300-linux-tdep.c: Include linux-tdep.h. (am33_linux_init_osabi): Call linux_init_abi. Rename the 'gdbinfo' parameter to 'info'. * ppc-linux-tdep.c: Include linux-tdep.h. (ppc_linux_init_abi): Call linux_init_abi. * sh-linux-tdep.c: Include linux-tdep.h. (sh_linux_init_abi): Call linux_init_abi. * sparc-linux-tdep.c: Include linux-tdep.h. (sparc32_linux_init_abi): Call linux_init_abi. * sparc64-linux-tdep.c: Include linux-tdep.h. (sparc64_linux_init_abi): Call linux_init_abi. * xtensa-linux-tdep.c: Include linux-tdep.h. (xtensa_linux_init_abi): Call linux_init_abi. * i386-cygwin-tdep.c (i386_windows_core_pid_to_str): New. (i386_cygwin_init_abi): Install it as gdbarch_core_pid_to_str callback.
2010-08-04 17:27:57 +02:00
linux_init_abi (info, gdbarch);
* amd64-tdep.c (amd64_sigtramp_frame_sniffer): Rewrite to use new sigtramp_p member of `struct gdbarch_tdep'. Also check whether the program counter is in the range specified by `struct gdbarch_tdep'. * amd64-linux-tdep.c: Include "symtab.h". (amd64_linux_pc_in_sigtramp): Remove function. (amd64_linux_sigtramp_p): New function. (amd64_linux_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * amd64nbsd-tdep.c: Include "symtab.h". (amd64nbsd_sigtramp_p): New function. (amd64nbsd_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * amd64obsd-tdep.c: Include "symtab.h" and "objfiles.h". Add a few comments. (amd64obsd_pc_in_sigtramp): Remove function. (amd64obsd_sigtramp_p): New function. (amd64obsd_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * i386-tdep.h (struct gdbarch_tdep): Add sigtramp_p member. (i386bsd_pc_ins_sigtramp): Remove prototype. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Remove prototypes. * i386-tdep.c (i386_sigtramp_frame_sniffer): Rewrite to use new sigtramp_p member of `struct gdbarch_tdep'. Also check whether the program counter is in the range specified by `struct gdbarch_tdep'. (i386_pc_in_sigtramp, i386_svr4_pc_in_sigtramp): Remove functions. (i386_sigtramp_p, i386_svr4_sigtramp_p): New functions. (i386_go32_pc_in_sigtramp): Remove function. (i386_svr4_init_abi): Don't set deprecated_pc_in_sigtramp. Initialize TDEP->sigtramp_p. (i386_go32_init_abi): Initialize TDEP->sigtramp_p to NULL. (i386_gdbarch_init): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * i386-linux-tdep.c: Adjust comments. (i386_linux_pc_in_sigtramp): Remove function. (i386_linux_sigtramp_p): New function. (i386_linux_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * i386-nto-tdep.c: Update copyright year. (i386nto_pc_in_sigtramp): Remove function. (i386nto_sigtramp_p): New function. (i386nto_sigcontext_addr): Use I386_ESP_REGNUM instead of SP_REGNUM. (i386nto_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * i386-sol2-tdep.c: Update copyright year. (i386_sol2_pc_in_sigtramp): Remove function. (i386_sol2_sigtramp_p): New function. (i386_sol2_init_abi): Initialize TDEP->sigtramp_p. Don't set deprecated_pc_in_sigtramp. * i386bsd-tdep.c (i386bsd_pc_in_sigtramp): Remove function. (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Remove functions. (i386bsd_init_abi): Don't set deprecated_pc_in_sigtramp, deprecated_sigtramp_start and deprecated_sigtramp_end. * i386nbsd-tdep.c: Include "frame.h" and "symtab.h". (i386nbsd_pc_in_sigtramp): Remove function. (i386nbsd_sigtramp_p): New function. (i386nbsd_init_abi): Don't set deprecated_pc_in_sigtramp, deprecated_sigtramp_start, deprecated_sigtramp_end. Initialize TDEP->sigtramp_start, TDEP->sigtramp_end and TDEP->sigtramp_p. * i386obsd-tdep.c: Include "frame.h", "symtab.h" and "objfiles.h". (i386obsd_pc_in_sigtramp): Remove function. (i386obsd_sigtramp_p): New function. (i386obsd_sigtramp_start, i386obsd_sigtramp_end): Remove functions. (i386bsd_init_abi): Don't set deprecated_pc_in_sigtramp, deprecated_sigtramp_start, deprecated_sigtramp_end. Initialize TDEP->sigtramp_p. * Makefile.in (amd64-linux-tdep.o, amd64nbsd-tdep.o, amd64obsd-tdep.o, i386nbsd-tdep.o, i386obsd-tdep.o): Update dependencies.
2004-04-09 18:28:50 +02:00
tdep->sigtramp_p = amd64_linux_sigtramp_p;
tdep->sigcontext_addr = amd64_linux_sigcontext_addr;
tdep->sc_reg_offset = amd64_linux_sc_reg_offset;
tdep->sc_num_regs = ARRAY_SIZE (amd64_linux_sc_reg_offset);
Support amd64 AVX. gdb/ 2010-04-07 H.J. Lu <hongjiu.lu@intel.com> * amd64-linux-nat.c: Include "regset.h", "elf/common.h", <sys/uio.h> and "i386-xstate.h". (PTRACE_GETREGSET): New. (PTRACE_SETREGSET): Likewise. (have_ptrace_getregset): Likewise. (amd64_linux_gregset64_reg_offset): Include 16 upper YMM registers. (amd64_linux_gregset32_reg_offset): Include 8 upper YMM registers. (amd64_linux_fetch_inferior_registers): Support PTRACE_GETFPREGS. (amd64_linux_store_inferior_registers): Likewise. (amd64_linux_read_description): Check and enable AVX target descriptions. * amd64-linux-tdep.c: Include "regset.h", "i386-linux-tdep.h" and "features/i386/amd64-avx-linux.c". (amd64_linux_regset_sections): New. (amd64_linux_core_read_description): Check and enable AVX target description. (amd64_linux_init_abi): Set xsave_xcr0_offset. Call set_gdbarch_core_regset_sections. (_initialize_amd64_linux_tdep): Call initialize_tdesc_amd64_avx_linux. * amd64-linux-tdep.h (AMD64_LINUX_ORIG_RAX_REGNUM): Replace AMD64_MXCSR_REGNUM with AMD64_YMM15H_REGNUM. (tdesc_amd64_avx_linux): New. (amd64_linux_update_xstateregset): Likewise. * amd64-tdep.c: Include "features/i386/amd64-avx.c". (amd64_ymm_names): New. (amd64_ymmh_names): Likewise. (amd64_register_name): Likewise. (amd64_supply_xstateregset): Likewise. (amd64_collect_xstateregset): Likewise. (amd64_supply_xsave): Likewise. (amd64_collect_xsave): Likewise. (AMD64_NUM_REGS): Removed. (amd64_dwarf_reg_to_regnum): Return %ymmN register number for %xmmN if AVX is available. (amd64_pseudo_register_name): Support pseudo YMM registers. (amd64_regset_from_core_section): Support .reg-xstate section. (amd64_init_abi): Set ymmh_register_names, num_ymm_regs and ymm0h_regnum. Call set_gdbarch_register_name. (amd64_init_abi): Call initialize_tdesc_amd64_avx. * amd64-tdep.h (amd64_regnum): Add AMD64_YMM0H_REGNUM and AMD64_YMM15H_REGNUM. (AMD64_NUM_REGS): New. (amd64_supply_xsave): Likewise. (amd64_collect_xsave): Likewise. (amd64_register_name): Removed. (amd64_register_type): Likewise. gdb/testsuite/ 2010-04-07 H.J. Lu <hongjiu.lu@intel.com> * gdb.arch/i386-avx.c: New. * gdb.arch/i386-avx.exp: Likewise. * gdb.arch/i386-cpuid.h: Updated from gcc 4.4.
2010-04-07 20:46:50 +02:00
tdep->xsave_xcr0_offset = I386_LINUX_XSAVE_XCR0_OFFSET;
/* Add the %orig_rax register used for syscall restarting. */
set_gdbarch_write_pc (gdbarch, amd64_linux_write_pc);
Enable XML target descriptions for x86. gdb/ 2010-03-01 H.J. Lu <hongjiu.lu@intel.com> * amd64-linux-nat.c (AMD64_LINUX_USER64_CS): New. (amd64_linux_read_description): Likewise. (_initialize_amd64_linux_nat): Set to_read_description to amd64_linux_read_description. * amd64-linux-tdep.c: Include "features/i386/amd64-linux.c". (amd64_linux_register_name): Removed. (amd64_linux_register_type): Likewise. (amd64_linux_core_read_description): New. (amd64_linux_init_abi): Set target description to tdesc_amd64_linux if needed. Support orig_rax in target description. Don't call set_gdbarch_register_name nor set_gdbarch_register_type. Call set_gdbarch_core_read_description. (_initialize_amd64_linux_tdep): Call initialize_tdesc_amd64_linux. * amd64-linux-tdep.h (tdesc_amd64_linux): New. * amd64-tdep.c: Include "features/i386/amd64.c". (amd64_register_names): Removed. (amd64_register_name): Likewise. (amd64_register_type): Likewise. (amd64_init_abi): Set num_core_regs and register_names. Set target description to tdesc_amd64 if needed. Don't call set_gdbarch_register_name nor set_gdbarch_register_type. (_initialize_amd64_tdep): New. * i386-linux-nat.c (i386_linux_read_description): New. (_initialize_i386_linux_nat): Set to_read_description to i386_linux_read_description. * i386-linux-tdep.c: Include "features/i386/i386-linux.c". (i386_linux_register_name): Removed. (i386_linux_core_read_description): New. (i386_linux_read_description): Likewise. (i386_linux_init_abi): Don't call set_gdbarch_register_name. Set target description to tdesc_i386_linux if needed. Support orig_eax. Set register_reggroup_p. Call set_gdbarch_core_read_description. (_initialize_i386_linux_tdep): Call initialize_tdesc_i386_linux. * i386-linux-tdep.h (tdesc_i386_linux): New. * i386-nto-tdep.c (i386nto_regset_id): Replace I386_NUM_FREGS with I387_NUM_REGS. * i386-tdep.c: Include "features/i386/i386.c". (i386_register_names): Make it const. (i386_mmx_names): Likewise. (i386_num_register_names): Removed. (i386_register_name): Likewise. (i386_eflags_type): Likewise. (i386_mxcsr_type): Likewise. (i386_sse_type): Likewise. (i386_register_type): Likewise. (i387_ext_type): Call tdesc_find_type instead of arch_float_type. (i386_pseudo_register_name): New. (i386_pseudo_register_type): Likewise. (i386_mmx_type): Make it static. (i386_gdbarch_init): Check arch. Replace I386_NUM_FREGS with I387_NUM_REGS. Set num_core_regs and register_names. Don't call set_gdbarch_register_name nor set_gdbarch_register_type. Set register_reggroup_p. Set target description to tdesc_i386 if needed. Call set_tdesc_pseudo_register_type, set_tdesc_pseudo_register_name and tdesc_use_registers. (_initialize_i386_tdep): Call initialize_tdesc_i386. initialize_tdesc_x86_64. * i386-tdep.h (gdbarch_tdep): Remove i386_eflags_type, i386_mxcsr_type and i386_sse_type. Add num_core_regs, register_names, tdesc and register_reggroup_p. (I386_NUM_FREGS): Removed. (i386_eflags_type): Likewise. (i386_mxcsr_type): Likewise. (i386_mmx_type): Likewise. (i386_sse_type): Likewise. (i386_register_name): Likewise. (i386_regnum): Add I386_MXCSR_REGNUM. (I386_SSE_NUM_REGS): Defined with I386_MXCSR_REGNUM. * i387-tdep.h (I387_NUM_REGS): New. * regformats/i386/i386-linux.dat: Generated. * regformats/i386/i386.dat: Likewise. * regformats/i386/amd64-linux.dat: Likewise. * regformats/i386/amd64.dat: Likewise. * regformats/reg-i386-linux.dat: Removed. * regformats/reg-i386.dat: Likewise. * regformats/reg-x86-64-linux.dat: Likewise. * regformats/reg-x86-64.dat: Likewise. gdb/gdbserver/ 2010-03-01 H.J. Lu <hongjiu.lu@intel.com> * Makefile.in (clean): Replace reg-i386.c, reg-x86-64.c, reg-i386-linux.c and reg-x86-64-linux.c with i386.c, amd64.c, i386-linux.c and amd64-linux.c. (reg-i386.o): Removed. (reg-i386.c): Likewise. (reg-i386-linux.o): Likewise. (reg-i386-linux.c): Likewise. (reg-x86-64.o): Likewise. (reg-x86-64.c): Likewise. (reg-x86-64-linux.o): Likewise. (reg-x86-64-linux.c): Likewise. (i386.o): New. (i386.c): Likewise. (i386-linux.o): Likewise. (i386-linux.c): Likewise. (amd64.o): Likewise. (amd64.c): Likewise. (amd64-linux.o): Likewise. (amd64-linux.c): Likewise. * configure.srv (srv_i386_regobj): New. (srv_i386_linux_regobj): Likewise. (srv_amd64_regobj): Likewise. (srv_amd64_linux_regobj): Likewise. (srv_i386_32bit_xmlfiles): Likewise. (srv_i386_64bit_xmlfiles): Likewise. (srv_i386_xmlfiles): Likewise. (srv_amd64_xmlfiles): Likewise. (srv_i386_linux_xmlfiles): Likewise. (srv_amd64_linux_xmlfiles): Likewise. (i[34567]86-*-cygwin*): Set srv_regobj to $srv_i386_regobj. Set srv_xmlfiles to $srv_i386_xmlfiles. (i[34567]86-*-mingw32ce*): Likewise. (i[34567]86-*-mingw*): Likewise. (i[34567]86-*-nto*): Likewise. (i[34567]86-*-linux*): Set srv_regobj to $srv_i386_linux_regobj and $srv_amd64_linux_regobj. Set srv_xmlfiles to $srv_i386_linux_xmlfiles and $srv_amd64_linux_xmlfiles. (x86_64-*-linux*): Likewise. * linux-x86-low.c (init_registers_x86_64_linux): Removed. (init_registers_amd64_linux): New. (x86_arch_setup): Replace init_registers_x86_64_linux with init_registers_amd64_linux. gdb/testsuite/ 2010-03-01 H.J. Lu <hongjiu.lu@intel.com> * gdb.xml/tdesc-regs.exp (architecture): New. Set it for x86. (load_description): Set architecture if defined.
2010-03-01 16:33:32 +01:00
tdep->register_reggroup_p = amd64_linux_register_reggroup_p;
Implementing catch syscall. * amd64-linux-tdep.c: Include xml-syscall.h header, define the XML syscall name for the architecture. (amd64_linux_get_syscall_number): New function. (amd64_linux_init_abi): Register the correct functions for syscall catchpoint; set the correct syscall file name. * breakpoint.c: New include: xml-syscall.h. (set_raw_breakpoint_without_location): Setting the parameters for the catch syscall feature. (insert_catch_syscall): New. (remove_catch_syscall): New. (breakpoint_hit_catch_syscall): New. (print_it_catch_syscall): New. (print_one_catch_syscall): New. (print_mention_catch_syscall): New. (catch_syscall_breakpoint_ops): New. (syscall_catchpoint_p): New. (create_catchpoint_without_mention): New. (create_catchpoint): Modified in order to use create_catchpoint_without_mention. (create_syscall_event_catchpoint): New. (clean_up_filters): New. (catch_syscall_split_args): New. (catch_syscall_command_1): New. (delete_breakpoint): Add cleanup for catch syscall. (is_syscall_catchpoint_enabled): New. (catch_syscall_enabled): New. (catching_syscall_number): New. (catch_syscall_completer): New completer function. (add_catch_command): Add the completer function for catchpoints. * breakpoint.h (syscalls_to_be_caught): New vector. (catch_syscall_enabled): New. (catching_syscall_number): New. * gdbarch.c: Regenerated. * gdbarch.h: Regenerated. * gdbarch.sh: Add syscall catchpoint functions and structures. (get_syscall_number): New. (UNKNOWN_SYSCALL): New definition. * i386-linux-nat.c (i386_linux_resume): Select the proper request to be made for ptrace() considering if we are catching syscalls or not. * i386-linux-tdep.c: Include xml-syscall.h header, define the XML syscall name for the architecture. (i386_linux_get_syscall_number): New. (i386_linux_init_abi): Register the correct functions for syscall catchpoint; set the correct syscall file name. * inf-child.c (inf_child_set_syscall_catchpoint): New. (inf_child_target): Assign default values to target_ops. * inf-ptrace.c (inf_ptrace_resume): Select the proper request to be made for ptrace() considering if we are catching syscalls or not. * inferior.h (struct inferior): Included new variables any_syscall_count, syscalls_counts and total_syscalls_count, used to keep track of requested syscall catchpoints. * infrun.c (resume): Add syscall catchpoint. (deal_with_syscall_event): New. (handle_inferior_event): Add syscall entry/return events. (inferior_has_called_syscall): New. * linux-nat.c: Define some helpful variables to track wether we have support for the needed ptrace option. (linux_test_for_tracesysgood): New. (linux_supports_tracesysgood): New. (linux_enable_tracesysgood): New. (linux_enable_event_reporting): Save the current used ptrace options. (linux_child_post_attach): Calling linux_enable_tracesysgood. (linux_child_post_startup_inferior): Likewise. (linux_child_set_syscall_catchpoint): New function. (linux_handle_extended_wait): Handle the case which the inferior stops because it has called or returned from a syscall. (linux_target_install_ops): Install the necessary functions to handle syscall catchpoints. * linux-nat.h (struct lwp_info): Include syscall_state into the structure, which indicates if we are in a syscall entry or return. * ppc-linux-tdep.c: Include xml-syscall.h header, define the XML syscall filename for the arch. (ppc_linux_get_syscall_number): New. (ppc_linux_init_abi): Register the correct functions for syscall catchpoint; setting the correct name for the XML syscall file. * target.c (update_current_target): Update/copy functions related to syscall catchpoint. (target_waitstatus_to_string): Add syscall catchpoint entry/return events. * target.h (struct target_waitstatus): Add syscall number. (struct syscall): New struct to hold information about syscalls in the system. (struct target_ops): Add ops for syscall catchpoint. (inferior_has_called_syscall): New. (target_set_syscall_catchpoint): New. * xml-support.c (xml_fetch_content_from_file): New function, transferred from xml-tdesc.c. * xml-support.h (xml_fetch_content_from_file): New. * xml-tdesc.c (fetch_xml_from_file): Function removed; transferred to xml-support.c. (file_read_description_xml): Updated to use the new xml_fetch_content_from_file function. * syscalls/gdb-syscalls.dtd: New definition file for syscall's XML support. * syscalls/amd64-linux.xml: New file containing information about syscalls for GNU/Linux systems that use amd64 architecture. * syscalls/i386-linux.xml: New file containing information about syscalls for GNU/Linux systems that use i386 architecture. * syscalls/ppc-linux.xml: New file containing information about syscalls for GNU/Linux systems that use PPC architecture. * syscalls/ppc64-linux.xml: New file containing information about syscalls for GNU/Linux systems that use PPC64 architecture. * xml-syscall.c: New file containing functions for manipulating syscall's XML files. * xml-syscall.h: New file, exporting the functions above mentioned. * Makefile.in: Support for relocatable GDB datadir and XML syscall. * NEWS: Added information about the catch syscall feature. * doc/gdb.texinfo (Set Catchpoints): Documentation about the new feature. * testsuite/Makefile.in: Inclusion of catch-syscall object. * testsuite/gdb.base/catch-syscall.c: New file. * testsuite/gdb.base/catch-syscall.exp: New file.
2009-09-15 05:30:08 +02:00
/* Functions for 'catch syscall'. */
Partial fix for PR breakpoints/10737: Make syscall info be per-arch instead of global This patch intends to partially fix PR breakpoints/10737, which is about making the syscall information (for the "catch syscall" command) be per-arch, instead of global. This is not a full fix because of the other issues pointed by Pedro here: <https://sourceware.org/bugzilla/show_bug.cgi?id=10737#c5> However, I consider it a good step towards the real fix. It will also help me fix <https://sourceware.org/bugzilla/show_bug.cgi?id=17402>. What this patch does, basically, is move the "syscalls_info" struct to gdbarch. Currently, the syscall information is stored in a global variable inside gdb/xml-syscall.c, which means that there is no easy way to correlate this info with the current target or architecture being used, for example. This causes strange behaviors, because the syscall info is not re-read when the arch changes. For example, if you put a syscall catchpoint in syscall 5 on i386 (syscall open), and then load a x86_64 program on GDB and put the same syscall 5 there (fstat on x86_64), you will still see that GDB tells you that it is catching "open", even though it is not. With this patch, GDB correctly says that it will be catching fstat syscalls. (gdb) set architecture i386 The target architecture is assumed to be i386 (gdb) catch syscall 5 Catchpoint 1 (syscall 'open' [5]) (gdb) set architecture i386:x86-64 The target architecture is assumed to be i386:x86-64 (gdb) catch syscall 5 Catchpoint 2 (syscall 'open' [5]) But with the patch: (gdb) set architecture i386 The target architecture is assumed to be i386 (gdb) catch syscall 5 Catchpoint 1 (syscall 'open' [5]) (gdb) set architecture i386:x86-64 The target architecture is assumed to be i386:x86-64 (gdb) catch syscall 5 Catchpoint 2 (syscall 'fstat' [5]) As I said, there are still some problems on the "catch syscall" mechanism, because (for example) the user should be able to "catch syscall open" on i386, and then expect "open" to be caught also on x86_64. Currently, it doesn't work. I intend to work on this later. gdb/ 2014-11-20 Sergio Durigan Junior <sergiodj@redhat.com> PR breakpoints/10737 * amd64-linux-tdep.c (amd64_linux_init_abi_common): Adjust call to set_xml_syscall_file_name to provide gdbarch. * arm-linux-tdep.c (arm_linux_init_abi): Likewise. * bfin-linux-tdep.c (bfin_linux_init_abi): Likewise. * breakpoint.c (print_it_catch_syscall): Adjust call to get_syscall_by_number to provide gdbarch. (print_one_catch_syscall): Likewise. (print_mention_catch_syscall): Likewise. (print_recreate_catch_syscall): Likewise. (catch_syscall_split_args): Adjust calls to get_syscall_by_number and get_syscall_by_name to provide gdbarch. (catch_syscall_completer): Adjust call to get_syscall_names to provide gdbarch. * gdbarch.c: Regenerate. * gdbarch.h: Likewise. * gdbarch.sh: Forward declare "struct syscalls_info". (xml_syscall_file): New variable. (syscalls_info): Likewise. * i386-linux-tdep.c (i386_linux_init_abi): Adjust call to set_xml_syscall_file_name to provide gdbarch. * mips-linux-tdep.c (mips_linux_init_abi): Likewise. * ppc-linux-tdep.c (ppc_linux_init_abi): Likewise. * s390-linux-tdep.c (s390_gdbarch_init): Likewise. * sparc-linux-tdep.c (sparc32_linux_init_abi): Likewise. * sparc64-linux-tdep.c (sparc64_linux_init_abi): Likewise. * xml-syscall.c: Include gdbarch.h. (set_xml_syscall_file_name): Accept gdbarch parameter. (get_syscall_by_number): Likewise. (get_syscall_by_name): Likewise. (get_syscall_names): Likewise. (my_gdb_datadir): Delete global variable. (struct syscalls_info) <my_gdb_datadir>: New variable. (struct syscalls_info) <sysinfo>: Rename variable to "syscalls_info". (sysinfo): Delete global variable. (have_initialized_sysinfo): Likewise. (xml_syscall_file): Likewise. (sysinfo_free_syscalls_desc): Rename to... (syscalls_info_free_syscalls_desc): ... this. (free_syscalls_info): Rename "sysinfo" to "syscalls_info". Adjust code to the new layout of "struct syscalls_info". (make_cleanup_free_syscalls_info): Rename parameter "sysinfo" to "syscalls_info". (syscall_create_syscall_desc): Likewise. (syscall_start_syscall): Likewise. (syscall_parse_xml): Likewise. (xml_init_syscalls_info): Likewise. Drop "const" from return value. (init_sysinfo): Rename to... (init_syscalls_info): ...this. Add gdbarch as a parameter. Adjust function to deal with gdbarch. (xml_get_syscall_number): Delete parameter sysinfo. Accept gdbarch as a parameter. Adjust code. (xml_get_syscall_name): Likewise. (xml_list_of_syscalls): Likewise. (set_xml_syscall_file_name): Accept gdbarch as parameter. (get_syscall_by_number): Likewise. (get_syscall_by_name): Likewise. (get_syscall_names): Likewise. * xml-syscall.h (set_xml_syscall_file_name): Likewise. (get_syscall_by_number): Likewise. (get_syscall_by_name): Likewise. (get_syscall_names): Likewise. gdb/testsuite/ 2014-11-20 Sergio Durigan Junior <sergiodj@redhat.com> PR breakpoints/10737 * gdb.base/catch-syscall.exp (do_syscall_tests): Call test_catch_syscall_multi_arch. (test_catch_syscall_multi_arch): New function.
2014-11-20 18:28:18 +01:00
set_xml_syscall_file_name (gdbarch, XML_SYSCALL_FILENAME_AMD64);
Implementing catch syscall. * amd64-linux-tdep.c: Include xml-syscall.h header, define the XML syscall name for the architecture. (amd64_linux_get_syscall_number): New function. (amd64_linux_init_abi): Register the correct functions for syscall catchpoint; set the correct syscall file name. * breakpoint.c: New include: xml-syscall.h. (set_raw_breakpoint_without_location): Setting the parameters for the catch syscall feature. (insert_catch_syscall): New. (remove_catch_syscall): New. (breakpoint_hit_catch_syscall): New. (print_it_catch_syscall): New. (print_one_catch_syscall): New. (print_mention_catch_syscall): New. (catch_syscall_breakpoint_ops): New. (syscall_catchpoint_p): New. (create_catchpoint_without_mention): New. (create_catchpoint): Modified in order to use create_catchpoint_without_mention. (create_syscall_event_catchpoint): New. (clean_up_filters): New. (catch_syscall_split_args): New. (catch_syscall_command_1): New. (delete_breakpoint): Add cleanup for catch syscall. (is_syscall_catchpoint_enabled): New. (catch_syscall_enabled): New. (catching_syscall_number): New. (catch_syscall_completer): New completer function. (add_catch_command): Add the completer function for catchpoints. * breakpoint.h (syscalls_to_be_caught): New vector. (catch_syscall_enabled): New. (catching_syscall_number): New. * gdbarch.c: Regenerated. * gdbarch.h: Regenerated. * gdbarch.sh: Add syscall catchpoint functions and structures. (get_syscall_number): New. (UNKNOWN_SYSCALL): New definition. * i386-linux-nat.c (i386_linux_resume): Select the proper request to be made for ptrace() considering if we are catching syscalls or not. * i386-linux-tdep.c: Include xml-syscall.h header, define the XML syscall name for the architecture. (i386_linux_get_syscall_number): New. (i386_linux_init_abi): Register the correct functions for syscall catchpoint; set the correct syscall file name. * inf-child.c (inf_child_set_syscall_catchpoint): New. (inf_child_target): Assign default values to target_ops. * inf-ptrace.c (inf_ptrace_resume): Select the proper request to be made for ptrace() considering if we are catching syscalls or not. * inferior.h (struct inferior): Included new variables any_syscall_count, syscalls_counts and total_syscalls_count, used to keep track of requested syscall catchpoints. * infrun.c (resume): Add syscall catchpoint. (deal_with_syscall_event): New. (handle_inferior_event): Add syscall entry/return events. (inferior_has_called_syscall): New. * linux-nat.c: Define some helpful variables to track wether we have support for the needed ptrace option. (linux_test_for_tracesysgood): New. (linux_supports_tracesysgood): New. (linux_enable_tracesysgood): New. (linux_enable_event_reporting): Save the current used ptrace options. (linux_child_post_attach): Calling linux_enable_tracesysgood. (linux_child_post_startup_inferior): Likewise. (linux_child_set_syscall_catchpoint): New function. (linux_handle_extended_wait): Handle the case which the inferior stops because it has called or returned from a syscall. (linux_target_install_ops): Install the necessary functions to handle syscall catchpoints. * linux-nat.h (struct lwp_info): Include syscall_state into the structure, which indicates if we are in a syscall entry or return. * ppc-linux-tdep.c: Include xml-syscall.h header, define the XML syscall filename for the arch. (ppc_linux_get_syscall_number): New. (ppc_linux_init_abi): Register the correct functions for syscall catchpoint; setting the correct name for the XML syscall file. * target.c (update_current_target): Update/copy functions related to syscall catchpoint. (target_waitstatus_to_string): Add syscall catchpoint entry/return events. * target.h (struct target_waitstatus): Add syscall number. (struct syscall): New struct to hold information about syscalls in the system. (struct target_ops): Add ops for syscall catchpoint. (inferior_has_called_syscall): New. (target_set_syscall_catchpoint): New. * xml-support.c (xml_fetch_content_from_file): New function, transferred from xml-tdesc.c. * xml-support.h (xml_fetch_content_from_file): New. * xml-tdesc.c (fetch_xml_from_file): Function removed; transferred to xml-support.c. (file_read_description_xml): Updated to use the new xml_fetch_content_from_file function. * syscalls/gdb-syscalls.dtd: New definition file for syscall's XML support. * syscalls/amd64-linux.xml: New file containing information about syscalls for GNU/Linux systems that use amd64 architecture. * syscalls/i386-linux.xml: New file containing information about syscalls for GNU/Linux systems that use i386 architecture. * syscalls/ppc-linux.xml: New file containing information about syscalls for GNU/Linux systems that use PPC architecture. * syscalls/ppc64-linux.xml: New file containing information about syscalls for GNU/Linux systems that use PPC64 architecture. * xml-syscall.c: New file containing functions for manipulating syscall's XML files. * xml-syscall.h: New file, exporting the functions above mentioned. * Makefile.in: Support for relocatable GDB datadir and XML syscall. * NEWS: Added information about the catch syscall feature. * doc/gdb.texinfo (Set Catchpoints): Documentation about the new feature. * testsuite/Makefile.in: Inclusion of catch-syscall object. * testsuite/gdb.base/catch-syscall.c: New file. * testsuite/gdb.base/catch-syscall.exp: New file.
2009-09-15 05:30:08 +02:00
set_gdbarch_get_syscall_number (gdbarch,
amd64_linux_get_syscall_number);
/* Enable TLS support. */
set_gdbarch_fetch_tls_load_module_address (gdbarch,
svr4_fetch_objfile_link_map);
/* GNU/Linux uses SVR4-style shared libraries. */
set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target);
/* GNU/Linux uses the dynamic linker included in the GNU C Library. */
set_gdbarch_skip_solib_resolver (gdbarch, glibc_skip_solib_resolver);
Replace 'core_regset_sections' by iterator method The core_regset_sections list in gdbarch (needed for multi-arch capable core file generation support) is replaced by an iterator method. Overall, this reduces the code a bit, and it allows for more flexibility. gdb/ChangeLog: * amd64-linux-tdep.c (amd64_linux_regset_sections): Remove. (amd64_linux_iterate_over_regset_sections): New. (amd64_linux_init_abi_common): Don't install the regset section list, but the new iterator in gdbarch. * arm-linux-tdep.c (arm_linux_fpa_regset_sections) (arm_linux_vfp_regset_sections): Remove. Move combined logic... (arm_linux_iterate_over_regset_sections): ...here. New function. (arm_linux_init_abi): Set iterator instead of section list. * corelow.c (get_core_registers_cb): New function, logic moved from... (get_core_registers): ...loop body here. Use new iterator method instead of walking through the regset section list. * gdbarch.sh: Remove 'core_regset_sections'. New method 'iterate_over_regset_sections'. New typedef 'iterate_over_regset_sections_cb'. * gdbarch.c: Regenerate. * gdbarch.h: Likewise. * i386-linux-tdep.c (i386_linux_regset_sections) (i386_linux_sse_regset_sections, i386_linux_avx_regset_sections): Remove. (i386_linux_iterate_over_regset_sections): New. (i386_linux_init_abi): Don't choose a regset section list, but install new iterator in gdbarch. * linux-tdep.c (struct linux_collect_regset_section_cb_data): New. (linux_collect_regset_section_cb): New function, logic moved from... (linux_collect_thread_registers): ...loop body here. Use iterator method instead of walking through list. (linux_make_corefile_notes_1): Check for presence of iterator method instead of regset section list. * ppc-linux-tdep.c (ppc_linux_vsx_regset_sections) (ppc_linux_vmx_regset_sections, ppc_linux_fp_regset_sections) (ppc64_linux_vsx_regset_sections, ppc64_linux_vmx_regset_sections) (ppc64_linux_fp_regset_sections): Remove. Move combined logic... (ppc_linux_iterate_over_regset_sections): ...here. New function. (ppc_linux_init_abi): Don't choose from above regset section lists, but install new iterator in gdbarch. * regset.h (struct core_regset_section): Remove. * s390-linux-tdep.c (struct gdbarch_tdep): Add new fields have_linux_v1, have_linux_v2, and have_tdb. (s390_linux32_regset_sections, s390_linux32v1_regset_sections) (s390_linux32v2_regset_sections, s390_linux64_regset_sections) (s390_linux64v1_regset_sections, s390_linux64v2_regset_sections) (s390x_linux64_regset_sections, s390x_linux64v1_regset_sections) (s390x_linux64v2_regset_sections): Remove. Move combined logic... (s390_iterate_over_regset_sections): ...here. New function. Use new tdep fields. (s390_gdbarch_init): Set new tdep fields. Don't choose from above regset section lists, but install new iterator.
2014-09-04 17:26:43 +02:00
/* Iterate over core file register note sections. */
set_gdbarch_iterate_over_regset_sections
(gdbarch, amd64_linux_iterate_over_regset_sections);
Support amd64 AVX. gdb/ 2010-04-07 H.J. Lu <hongjiu.lu@intel.com> * amd64-linux-nat.c: Include "regset.h", "elf/common.h", <sys/uio.h> and "i386-xstate.h". (PTRACE_GETREGSET): New. (PTRACE_SETREGSET): Likewise. (have_ptrace_getregset): Likewise. (amd64_linux_gregset64_reg_offset): Include 16 upper YMM registers. (amd64_linux_gregset32_reg_offset): Include 8 upper YMM registers. (amd64_linux_fetch_inferior_registers): Support PTRACE_GETFPREGS. (amd64_linux_store_inferior_registers): Likewise. (amd64_linux_read_description): Check and enable AVX target descriptions. * amd64-linux-tdep.c: Include "regset.h", "i386-linux-tdep.h" and "features/i386/amd64-avx-linux.c". (amd64_linux_regset_sections): New. (amd64_linux_core_read_description): Check and enable AVX target description. (amd64_linux_init_abi): Set xsave_xcr0_offset. Call set_gdbarch_core_regset_sections. (_initialize_amd64_linux_tdep): Call initialize_tdesc_amd64_avx_linux. * amd64-linux-tdep.h (AMD64_LINUX_ORIG_RAX_REGNUM): Replace AMD64_MXCSR_REGNUM with AMD64_YMM15H_REGNUM. (tdesc_amd64_avx_linux): New. (amd64_linux_update_xstateregset): Likewise. * amd64-tdep.c: Include "features/i386/amd64-avx.c". (amd64_ymm_names): New. (amd64_ymmh_names): Likewise. (amd64_register_name): Likewise. (amd64_supply_xstateregset): Likewise. (amd64_collect_xstateregset): Likewise. (amd64_supply_xsave): Likewise. (amd64_collect_xsave): Likewise. (AMD64_NUM_REGS): Removed. (amd64_dwarf_reg_to_regnum): Return %ymmN register number for %xmmN if AVX is available. (amd64_pseudo_register_name): Support pseudo YMM registers. (amd64_regset_from_core_section): Support .reg-xstate section. (amd64_init_abi): Set ymmh_register_names, num_ymm_regs and ymm0h_regnum. Call set_gdbarch_register_name. (amd64_init_abi): Call initialize_tdesc_amd64_avx. * amd64-tdep.h (amd64_regnum): Add AMD64_YMM0H_REGNUM and AMD64_YMM15H_REGNUM. (AMD64_NUM_REGS): New. (amd64_supply_xsave): Likewise. (amd64_collect_xsave): Likewise. (amd64_register_name): Removed. (amd64_register_type): Likewise. gdb/testsuite/ 2010-04-07 H.J. Lu <hongjiu.lu@intel.com> * gdb.arch/i386-avx.c: New. * gdb.arch/i386-avx.exp: Likewise. * gdb.arch/i386-cpuid.h: Updated from gcc 4.4.
2010-04-07 20:46:50 +02:00
Enable XML target descriptions for x86. gdb/ 2010-03-01 H.J. Lu <hongjiu.lu@intel.com> * amd64-linux-nat.c (AMD64_LINUX_USER64_CS): New. (amd64_linux_read_description): Likewise. (_initialize_amd64_linux_nat): Set to_read_description to amd64_linux_read_description. * amd64-linux-tdep.c: Include "features/i386/amd64-linux.c". (amd64_linux_register_name): Removed. (amd64_linux_register_type): Likewise. (amd64_linux_core_read_description): New. (amd64_linux_init_abi): Set target description to tdesc_amd64_linux if needed. Support orig_rax in target description. Don't call set_gdbarch_register_name nor set_gdbarch_register_type. Call set_gdbarch_core_read_description. (_initialize_amd64_linux_tdep): Call initialize_tdesc_amd64_linux. * amd64-linux-tdep.h (tdesc_amd64_linux): New. * amd64-tdep.c: Include "features/i386/amd64.c". (amd64_register_names): Removed. (amd64_register_name): Likewise. (amd64_register_type): Likewise. (amd64_init_abi): Set num_core_regs and register_names. Set target description to tdesc_amd64 if needed. Don't call set_gdbarch_register_name nor set_gdbarch_register_type. (_initialize_amd64_tdep): New. * i386-linux-nat.c (i386_linux_read_description): New. (_initialize_i386_linux_nat): Set to_read_description to i386_linux_read_description. * i386-linux-tdep.c: Include "features/i386/i386-linux.c". (i386_linux_register_name): Removed. (i386_linux_core_read_description): New. (i386_linux_read_description): Likewise. (i386_linux_init_abi): Don't call set_gdbarch_register_name. Set target description to tdesc_i386_linux if needed. Support orig_eax. Set register_reggroup_p. Call set_gdbarch_core_read_description. (_initialize_i386_linux_tdep): Call initialize_tdesc_i386_linux. * i386-linux-tdep.h (tdesc_i386_linux): New. * i386-nto-tdep.c (i386nto_regset_id): Replace I386_NUM_FREGS with I387_NUM_REGS. * i386-tdep.c: Include "features/i386/i386.c". (i386_register_names): Make it const. (i386_mmx_names): Likewise. (i386_num_register_names): Removed. (i386_register_name): Likewise. (i386_eflags_type): Likewise. (i386_mxcsr_type): Likewise. (i386_sse_type): Likewise. (i386_register_type): Likewise. (i387_ext_type): Call tdesc_find_type instead of arch_float_type. (i386_pseudo_register_name): New. (i386_pseudo_register_type): Likewise. (i386_mmx_type): Make it static. (i386_gdbarch_init): Check arch. Replace I386_NUM_FREGS with I387_NUM_REGS. Set num_core_regs and register_names. Don't call set_gdbarch_register_name nor set_gdbarch_register_type. Set register_reggroup_p. Set target description to tdesc_i386 if needed. Call set_tdesc_pseudo_register_type, set_tdesc_pseudo_register_name and tdesc_use_registers. (_initialize_i386_tdep): Call initialize_tdesc_i386. initialize_tdesc_x86_64. * i386-tdep.h (gdbarch_tdep): Remove i386_eflags_type, i386_mxcsr_type and i386_sse_type. Add num_core_regs, register_names, tdesc and register_reggroup_p. (I386_NUM_FREGS): Removed. (i386_eflags_type): Likewise. (i386_mxcsr_type): Likewise. (i386_mmx_type): Likewise. (i386_sse_type): Likewise. (i386_register_name): Likewise. (i386_regnum): Add I386_MXCSR_REGNUM. (I386_SSE_NUM_REGS): Defined with I386_MXCSR_REGNUM. * i387-tdep.h (I387_NUM_REGS): New. * regformats/i386/i386-linux.dat: Generated. * regformats/i386/i386.dat: Likewise. * regformats/i386/amd64-linux.dat: Likewise. * regformats/i386/amd64.dat: Likewise. * regformats/reg-i386-linux.dat: Removed. * regformats/reg-i386.dat: Likewise. * regformats/reg-x86-64-linux.dat: Likewise. * regformats/reg-x86-64.dat: Likewise. gdb/gdbserver/ 2010-03-01 H.J. Lu <hongjiu.lu@intel.com> * Makefile.in (clean): Replace reg-i386.c, reg-x86-64.c, reg-i386-linux.c and reg-x86-64-linux.c with i386.c, amd64.c, i386-linux.c and amd64-linux.c. (reg-i386.o): Removed. (reg-i386.c): Likewise. (reg-i386-linux.o): Likewise. (reg-i386-linux.c): Likewise. (reg-x86-64.o): Likewise. (reg-x86-64.c): Likewise. (reg-x86-64-linux.o): Likewise. (reg-x86-64-linux.c): Likewise. (i386.o): New. (i386.c): Likewise. (i386-linux.o): Likewise. (i386-linux.c): Likewise. (amd64.o): Likewise. (amd64.c): Likewise. (amd64-linux.o): Likewise. (amd64-linux.c): Likewise. * configure.srv (srv_i386_regobj): New. (srv_i386_linux_regobj): Likewise. (srv_amd64_regobj): Likewise. (srv_amd64_linux_regobj): Likewise. (srv_i386_32bit_xmlfiles): Likewise. (srv_i386_64bit_xmlfiles): Likewise. (srv_i386_xmlfiles): Likewise. (srv_amd64_xmlfiles): Likewise. (srv_i386_linux_xmlfiles): Likewise. (srv_amd64_linux_xmlfiles): Likewise. (i[34567]86-*-cygwin*): Set srv_regobj to $srv_i386_regobj. Set srv_xmlfiles to $srv_i386_xmlfiles. (i[34567]86-*-mingw32ce*): Likewise. (i[34567]86-*-mingw*): Likewise. (i[34567]86-*-nto*): Likewise. (i[34567]86-*-linux*): Set srv_regobj to $srv_i386_linux_regobj and $srv_amd64_linux_regobj. Set srv_xmlfiles to $srv_i386_linux_xmlfiles and $srv_amd64_linux_xmlfiles. (x86_64-*-linux*): Likewise. * linux-x86-low.c (init_registers_x86_64_linux): Removed. (init_registers_amd64_linux): New. (x86_arch_setup): Replace init_registers_x86_64_linux with init_registers_amd64_linux. gdb/testsuite/ 2010-03-01 H.J. Lu <hongjiu.lu@intel.com> * gdb.xml/tdesc-regs.exp (architecture): New. Set it for x86. (load_description): Set architecture if defined.
2010-03-01 16:33:32 +01:00
set_gdbarch_core_read_description (gdbarch,
amd64_linux_core_read_description);
/* Displaced stepping. */
set_gdbarch_displaced_step_copy_insn (gdbarch,
amd64_displaced_step_copy_insn);
set_gdbarch_displaced_step_fixup (gdbarch, amd64_displaced_step_fixup);
set_gdbarch_displaced_step_location (gdbarch,
PR13858 - Can't do displaced stepping with no symbols Running break-interp.exp with the target always in non-stop mode trips on PR13858, as enabling non-stop also enables displaced stepping. The problem is that when GDB doesn't know where the entry point is, it doesn't know where to put the displaced stepping scratch pad. The test added by this commit exercises this. Without the fix, we get: (gdb) PASS: gdb.base/step-over-no-symbols.exp: displaced=on: break *$pc set displaced-stepping on (gdb) PASS: gdb.base/step-over-no-symbols.exp: displaced=on: set displaced-stepping on stepi 0x00000000004005be in ?? () Entry point address is not known. (gdb) PASS: gdb.base/step-over-no-symbols.exp: displaced=on: stepi p /x $pc $2 = 0x4005be (gdb) PASS: gdb.base/step-over-no-symbols.exp: displaced=on: get after PC FAIL: gdb.base/step-over-no-symbols.exp: displaced=on: advanced The fix switches all GNU/Linux ports to get the entry point from AT_ENTRY in the target auxiliary vector instead of from symbols. This is currently only done by PPC when Cell debugging is enabled, but I think all archs should be able to do the same. Note that ppc_linux_displaced_step_location cached the result, I'm guessing to avoid constantly re-fetching the auxv out of remote targets, but that's no longer necessary nowadays, as the auxv blob is itself cached in the inferior object. The ppc_linux_entry_point_addr global is obviously bad for multi-process too nowadays. Tested on x86-64 (-m64/-m32), PPC64 (-m64/-m32) and S/390 GNU/Linux. Yao tested the new test on ARM as well. gdb/ChangeLog: 2015-04-10 Pedro Alves <palves@redhat.com> PR gdb/13858 * amd64-linux-tdep.c (amd64_linux_init_abi_common): Install linux_displaced_step_location as gdbarch_displaced_step_location hook. * arm-linux-tdep.c (arm_linux_init_abi): Likewise. * i386-linux-tdep.c (i386_linux_init_abi): Likewise. * linux-tdep.c (linux_displaced_step_location): New function, based on ppc_linux_displaced_step_location. * linux-tdep.h (linux_displaced_step_location): New declaration. * ppc-linux-tdep.c (ppc_linux_entry_point_addr): Delete. (ppc_linux_inferior_created, ppc_linux_displaced_step_location): Delete. (ppc_linux_init_abi): Install linux_displaced_step_location as gdbarch_displaced_step_location hook, even without Cell/B.E.. (_initialize_ppc_linux_tdep): Don't install ppc_linux_inferior_created as inferior_created observer. * s390-linux-tdep.c (s390_gdbarch_init): Install linux_displaced_step_location as gdbarch_displaced_step_location hook. gdb/testsuite/ 2015-04-10 Pedro Alves <palves@redhat.com> PR gdb/13858 * gdb.base/step-over-no-symbols.exp: New file.
2015-04-10 11:07:02 +02:00
linux_displaced_step_location);
2009-02-06 Pedro Alves <pedro@codesourcery.com> gdb/ * target.h (enum target_object): Add new TARGET_OBJECT_SIGNAL_INFO. * infrun.c (siginfo_value_read, siginfo_value_write): New. (siginfo_value_funcs): New. (siginfo_make_value): New. (_initialize_infrun): Create the $_siginfo convenience variable. * gdbtypes.h (append_composite_type_field_aligned): Declare. * gdbtypes.c (append_composite_type_field): Rename to... (append_composite_type_field_aligned): ... this. Add ALIGNMENT argument. Handle it. (append_composite_type_field): Rewrite on top of append_composite_type_field_aligned. * value.h (internalvar_make_value): New typedef. (struct internalvar) <make_value>: New field. (create_internalvar_type_lazy): Declare. * value.c (create_internalvar): Clear make_value. (create_internalvar_type_lazy): New. (value_of_internalvar): If make_value is set use it. (preserve_values): Skip internal variables that don't have a value. * gdbarch.sh (get_siginfo_type): New. * gdbarch.h, gdbarch.c: Regenerate. * linux-tdep.h, linux-tdep.c: New. * amd64-linux-tdep.c: Include "linux-tdep.h". (amd64_linux_init_abi): Register linux_get_siginfo_type and linux_get_siginfo_mapper. * i386-linux-tdep.c: Include "linux-tdep.h". (i386_linux_init_abi): Register linux_get_siginfo_type and linux_get_siginfo_mapper. * arm-linux-tdep.c: Include "linux-tdep.h". (i386_linux_init_abi): Register linux_get_siginfo_type and linux_get_siginfo_mapper. * linux-nat.c (linux_xfer_siginfo): New. (linux_nat_xfer_partial): Handle TARGET_OBJECT_SIGNAL_INFO. * remote.c (PACKET_qXfer_siginfo_read) (PACKET_qXfer_siginfo_write): New. (feature remote_protocol_features): Add "qXfer:siginfo:read" and "qXfer:siginfo:write" features. (remote_xfer_partial): Handle TARGET_OBJECT_SIGNAL_INFO. (_initialize_remote): Add "set/show remote read-siginfo-object" and "set/show remote write-siginfo-object" commands. * Makefile.in (ALL_TARGET_OBS): Add linux-tdep.o. (HFILES_NO_SRCDIR): Add linux-tdep.h. (ALLDEPFILES): Add linux-tdep.c. * configure.tgt (arm*-*-linux* | arm*-*-uclinux*) (i[34567]86-*-linux*, x86_64-*-linux*): Add linux-tdep.o to gdb_target_obs. 2009-02-06 Pedro Alves <pedro@codesourcery.com> gdb/gdbserver/ * server.c (handle_query): Report qXfer:siginfo:read and qXfer:siginfo:write as supported and handle them. * target.h (struct target_ops) <qxfer_siginfo>: New field. * linux-low.c (linux_xfer_siginfo): New. (linux_target_ops): Set it. 2009-02-06 Pedro Alves <pedro@codesourcery.com> gdb/doc/ * gdb.texinfo (Signals): Document $_siginfo. (Convenience Variables): Mention $_siginfo. (Remote Configuration): Document qXfer:siginfo:read, qXfer:siginfo:write packets, and the read-siginfo-object, write-siginfo-object commands. 2009-02-06 Pedro Alves <pedro@codesourcery.com> gdb/testsuite/ * gdb.base/siginfo-obj.c, gdb.base/siginfo-obj.exp: New.
2009-02-06 23:59:01 +01:00
set_gdbarch_process_record (gdbarch, i386_process_record);
set_gdbarch_process_record_signal (gdbarch, amd64_linux_record_signal);
set_gdbarch_get_siginfo_type (gdbarch, x86_linux_get_siginfo_type);
Intel MPX bound violation handling With Intel Memory Protection Extensions it was introduced the concept of boundary violation. A boundary violations is presented to the inferior as a segmentation fault having SIGCODE 3. This patch adds a handler for a boundary violation extending the information displayed when a bound violation is presented to the inferior. In the stop mode case the debugger will also display the kind of violation: "upper" or "lower", bounds and the address accessed. On no stop mode the information will still remain unchanged. Additional information about bound violations are not meaningful in that case user does not know the line in which violation occurred as well. When the segmentation fault handler is stop mode the out puts will be changed as exemplified below. The usual output of a segfault is: Program received signal SIGSEGV, Segmentation fault 0x0000000000400d7c in upper (p=0x603010, a=0x603030, b=0x603050, c=0x603070, d=0x603090, len=7) at i386-mpx-sigsegv.c:68 68 value = *(p + len); In case it is a bound violation it will be presented as: Program received signal SIGSEGV, Segmentation fault Upper bound violation while accessing address 0x7fffffffc3b3 Bounds: [lower = 0x7fffffffc390, upper = 0x7fffffffc3a3] 0x0000000000400d7c in upper (p=0x603010, a=0x603030, b=0x603050, c=0x603070, d=0x603090, len=7) at i386-mpx-sigsegv.c:68 68 value = *(p + len); In mi mode the output of a segfault is: *stopped,reason="signal-received",signal-name="SIGSEGV", signal-meaning="Segmentation fault", frame={addr="0x0000000000400d7c", func="upper",args=[{name="p", value="0x603010"},{name="a",value="0x603030"} ,{name="b",value="0x603050"}, {name="c",value="0x603070"}, {name="d",value="0x603090"},{name="len",value="7"}], file="i386-mpx-sigsegv.c",fullname="i386-mpx-sigsegv.c",line="68"}, thread-id="1",stopped-threads="all",core="6" in the case of a bound violation: *stopped,reason="signal-received",signal-name="SIGSEGV", signal-meaning="Segmentation fault", sigcode-meaning="Upper bound violation", lower-bound="0x603010",upper-bound="0x603023",bound-access="0x60302f", frame={addr="0x0000000000400d7c",func="upper",args=[{name="p", value="0x603010"},{name="a",value="0x603030"},{name="b",value="0x603050"}, {name="c",value="0x603070"},{name="d",value="0x603090"}, {name="len",value="7"}],file="i386-mpx-sigsegv.c", fullname="i386-mpx-sigsegv.c",line="68"},thread-id="1", stopped-threads="all",core="6" 2016-02-18 Walfred Tedeschi <walfred.tedeschi@intel.com> gdb/ChangeLog: * NEWS: Add entry for bound violation. * amd64-linux-tdep.c (amd64_linux_init_abi_common): Add handler for segmentation fault. * gdbarch.sh (handle_segmentation_fault): New. * gdbarch.c: Regenerate. * gdbarch.h: Regenerate. * i386-linux-tdep.c (i386_linux_handle_segmentation_fault): New. (SIG_CODE_BONDARY_FAULT): New define. (i386_linux_init_abi): Use i386_mpx_bound_violation_handler. * i386-linux-tdep.h (i386_linux_handle_segmentation_fault) New. * i386-tdep.c (i386_mpx_enabled): Add as external. * i386-tdep.c (i386_mpx_enabled): Add as external. * infrun.c (handle_segmentation_fault): New function. (print_signal_received_reason): Use handle_segmentation_fault. gdb/testsuite/ChangeLog: * gdb.arch/i386-mpx-sigsegv.c: New file. * gdb.arch/i386-mpx-sigsegv.exp: New file. * gdb.arch/i386-mpx-simple_segv.c: New file. * gdb.arch/i386-mpx-simple_segv.exp: New file. gdb/doc/ChangeLog: * gdb.texinfo (Signals): Add bound violation display hints for a SIGSEGV.
2016-02-18 17:24:59 +01:00
set_gdbarch_handle_segmentation_fault (gdbarch,
i386_linux_handle_segmentation_fault);
}
static void
amd64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
2017-08-07 16:53:54 +02:00
struct tdesc_arch_data *tdesc_data = info.tdesc_data;
const struct tdesc_feature *feature;
int valid_p;
gdb_assert (tdesc_data);
tdep->gregset_reg_offset = amd64_linux_gregset_reg_offset;
tdep->gregset_num_regs = ARRAY_SIZE (amd64_linux_gregset_reg_offset);
tdep->sizeof_gregset = 27 * 8;
amd64_init_abi (info, gdbarch,
amd64_linux_read_description (X86_XSTATE_SSE_MASK, false));
Fix x86-64 GNU/Linux crashes Ref: https://sourceware.org/ml/gdb-patches/2017-07/msg00162.html Debugging x86-64 GNU/Linux programs currently crashes GDB in tdesc_use_registers during gdbarch initialization: Program received signal SIGSEGV, Segmentation fault. 0x0000000001093eaf in htab_remove_elt_with_hash (htab=0x2ef9fa0, element=0x26af960, hash=557151073) at src/libiberty/hashtab.c:728 728 if (*slot == HTAB_EMPTY_ENTRY) (top-gdb) p slot $1 = (void **) 0x0 (top-gdb) bt #0 0x0000000001093eaf in htab_remove_elt_with_hash (htab=0x2ef9fa0, element=0x26af960, hash=557151073) at src/libiberty/hashtab.c:728 #1 0x0000000001093e79 in htab_remove_elt (htab=0x2ef9fa0, element=0x26af960) at src/libiberty/hashtab.c:714 #2 0x00000000009121b0 in tdesc_use_registers (gdbarch=0x3001240, target_desc=0x2659cb0, early_data=0x2881cb0) at src/gdb/target-descriptions.c:1328 #3 0x000000000047c93e in i386_gdbarch_init (info=..., arches=0x0) at src/gdb/i386-tdep.c:8634 #4 0x0000000000818d5f in gdbarch_find_by_info (info=...) at src/gdb/gdbarch.c:5394 #5 0x00000000007198a8 in set_gdbarch_from_file (abfd=0x2f48250) at src/gdb/arch-utils.c:618 #6 0x00000000007f21cb in exec_file_attach (filename=0x7fffffffddb0 "/home/pedro/gdb/tests/threads", from_tty=1) at src/gdb/exec.c:380 #7 0x0000000000865c18 in catch_command_errors_const (command=0x7f1d83 <exec_file_attach(char const*, int)>, arg=0x7fffffffddb0 "/home/pedro/gdb/tests/threads", from_tty=1) at src/gdb/main.c:403 #8 0x00000000008669cf in captured_main_1 (context=0x7fffffffd860) at src/gdb/main.c:1035 #9 0x0000000000866de2 in captured_main (data=0x7fffffffd860) at src/gdb/main.c:1142 #10 0x0000000000866e24 in gdb_main (args=0x7fffffffd860) at src/gdb/main.c:1160 #11 0x000000000041312d in main (argc=3, argv=0x7fffffffd968) at src/gdb/gdb.c:32 The direct cause of the crash is that we tried to remove an element from the hash which supposedly exists, but does not. (htab_remove_elt shouldn't really crash in this case, but that's secondary.) The real problem is that early_data passed to tdesc_use_registers includes regs from a target description that is not the target_desc, which violates its assumptions. The registers in question are the fs_base/gs_base registers, added by amd64_init_abi: tdesc_numbered_register (feature, tdesc_data_segments, AMD64_FSBASE_REGNUM, "fs_base"); tdesc_numbered_register (feature, tdesc_data_segments, AMD64_GSBASE_REGNUM, "gs_base"); and that happens because amd64_linux_init_abi uses amd64_init_abi as helper, but they don't coordinate on which fallback tdesc to use. amd64_init_abi does: if (! tdesc_has_registers (tdesc)) tdesc = tdesc_amd64; and then adds the fs_base/gs_base registers of the "tdesc_amd64" tdesc to the tdesc_arch_data. After amd64_init_abi returns, amd64_linux_init_abi does: if (! tdesc_has_registers (tdesc)) tdesc = tdesc_amd64_linux; tdep->tdesc = tdesc; and we end up tdesc_amd64_linux installed in tdep->tdesc. The fix is to make sure that amd64_linux_init_abi and amd64_init_abi agree on default tdesc, by adding a "default tdesc" parameter to amd64_init_abi, instead of having amd64_init_abi hardcode a default. With this, amd64_init_abi creates the fs_base/gs_base registers using the tdesc_amd64_linux tdesc. Tested on x86-64 GNU/Linux, -m64. I don't have an x32 setup handy. Thanks to John Baldwin, Yao Qi and Simon Marchi for the investigation. gdb/ChangeLog: 2017-07-13 Pedro Alves <palves@redhat.com> * amd64-darwin-tdep.c (x86_darwin_init_abi_64): Pass tdesc_amd64 as default tdesc. * amd64-dicos-tdep.c (amd64_dicos_init_abi): * amd64-fbsd-tdep.c (amd64fbsd_init_abi): * amd64-linux-tdep.c (amd64_linux_init_abi): Pass tdesc_amd64_linux as default tdesc. Get final tdesc from the tdep. (amd64_x32_linux_init_abi): Pass tdesc_x32_linux as default tdesc. Get final tdesc from the tdep. * amd64-nbsd-tdep.c (amd64nbsd_init_abi): Pass tdesc_amd64 as default tdesc. * amd64-obsd-tdep.c (amd64obsd_init_abi): Likewise. * amd64-sol2-tdep.c (amd64_sol2_init_abi): Likewise. * amd64-tdep.c (amd64_init_abi): Add 'default_tdesc' parameter. Use it as default tdesc. (amd64_x32_init_abi): Add 'default_tdesc' parameter, and pass it down to amd_init_abi. No longer handle fallback tdesc here. * amd64-tdep.h (tdesc_x32): Declare. (amd64_init_abi, amd64_x32_init_abi): Add 'default_tdesc' parameter. * amd64-windows-tdep.c (amd64_windows_init_abi): Pass tdesc_amd64 as default tdesc.
2017-07-13 21:56:42 +02:00
const target_desc *tdesc = tdep->tdesc;
/* Reserve a number for orig_rax. */
set_gdbarch_num_regs (gdbarch, AMD64_LINUX_NUM_REGS);
feature = tdesc_find_feature (tdesc, "org.gnu.gdb.i386.linux");
if (feature == NULL)
return;
valid_p = tdesc_numbered_register (feature, tdesc_data,
AMD64_LINUX_ORIG_RAX_REGNUM,
"orig_rax");
if (!valid_p)
return;
amd64_linux_init_abi_common (info, gdbarch);
/* Initialize the amd64_linux_record_tdep. */
/* These values are the size of the type that will be used in a system
call. They are obtained from Linux Kernel source. */
amd64_linux_record_tdep.size_pointer
= gdbarch_ptr_bit (gdbarch) / TARGET_CHAR_BIT;
amd64_linux_record_tdep.size__old_kernel_stat = 32;
amd64_linux_record_tdep.size_tms = 32;
amd64_linux_record_tdep.size_loff_t = 8;
amd64_linux_record_tdep.size_flock = 32;
amd64_linux_record_tdep.size_oldold_utsname = 45;
amd64_linux_record_tdep.size_ustat = 32;
/* ADM64 doesn't need this size because it doesn't have sys_sigaction
but sys_rt_sigaction. */
amd64_linux_record_tdep.size_old_sigaction = 32;
/* ADM64 doesn't need this size because it doesn't have sys_sigpending
but sys_rt_sigpending. */
amd64_linux_record_tdep.size_old_sigset_t = 8;
amd64_linux_record_tdep.size_rlimit = 16;
amd64_linux_record_tdep.size_rusage = 144;
amd64_linux_record_tdep.size_timeval = 16;
amd64_linux_record_tdep.size_timezone = 8;
/* ADM64 doesn't need this size because it doesn't have sys_getgroups16
but sys_getgroups. */
amd64_linux_record_tdep.size_old_gid_t = 2;
/* ADM64 doesn't need this size because it doesn't have sys_getresuid16
but sys_getresuid. */
amd64_linux_record_tdep.size_old_uid_t = 2;
amd64_linux_record_tdep.size_fd_set = 128;
/* ADM64 doesn't need this size because it doesn't have sys_readdir. */
amd64_linux_record_tdep.size_old_dirent = 280;
amd64_linux_record_tdep.size_statfs = 120;
amd64_linux_record_tdep.size_statfs64 = 120;
amd64_linux_record_tdep.size_sockaddr = 16;
amd64_linux_record_tdep.size_int
= gdbarch_int_bit (gdbarch) / TARGET_CHAR_BIT;
amd64_linux_record_tdep.size_long
= gdbarch_long_bit (gdbarch) / TARGET_CHAR_BIT;
amd64_linux_record_tdep.size_ulong
= gdbarch_long_bit (gdbarch) / TARGET_CHAR_BIT;
amd64_linux_record_tdep.size_msghdr = 56;
amd64_linux_record_tdep.size_itimerval = 32;
amd64_linux_record_tdep.size_stat = 144;
amd64_linux_record_tdep.size_old_utsname = 325;
amd64_linux_record_tdep.size_sysinfo = 112;
amd64_linux_record_tdep.size_msqid_ds = 120;
amd64_linux_record_tdep.size_shmid_ds = 112;
amd64_linux_record_tdep.size_new_utsname = 390;
amd64_linux_record_tdep.size_timex = 208;
amd64_linux_record_tdep.size_mem_dqinfo = 24;
amd64_linux_record_tdep.size_if_dqblk = 72;
amd64_linux_record_tdep.size_fs_quota_stat = 80;
amd64_linux_record_tdep.size_timespec = 16;
amd64_linux_record_tdep.size_pollfd = 8;
amd64_linux_record_tdep.size_NFS_FHSIZE = 32;
amd64_linux_record_tdep.size_knfsd_fh = 132;
amd64_linux_record_tdep.size_TASK_COMM_LEN = 16;
amd64_linux_record_tdep.size_sigaction = 32;
amd64_linux_record_tdep.size_sigset_t = 8;
amd64_linux_record_tdep.size_siginfo_t = 128;
amd64_linux_record_tdep.size_cap_user_data_t = 8;
amd64_linux_record_tdep.size_stack_t = 24;
amd64_linux_record_tdep.size_off_t = 8;
amd64_linux_record_tdep.size_stat64 = 144;
amd64_linux_record_tdep.size_gid_t = 4;
amd64_linux_record_tdep.size_uid_t = 4;
amd64_linux_record_tdep.size_PAGE_SIZE = 4096;
amd64_linux_record_tdep.size_flock64 = 32;
amd64_linux_record_tdep.size_user_desc = 16;
amd64_linux_record_tdep.size_io_event = 32;
amd64_linux_record_tdep.size_iocb = 64;
amd64_linux_record_tdep.size_epoll_event = 12;
amd64_linux_record_tdep.size_itimerspec = 32;
amd64_linux_record_tdep.size_mq_attr = 64;
amd64_linux_record_tdep.size_termios = 36;
amd64_linux_record_tdep.size_termios2 = 44;
amd64_linux_record_tdep.size_pid_t = 4;
amd64_linux_record_tdep.size_winsize = 8;
amd64_linux_record_tdep.size_serial_struct = 72;
amd64_linux_record_tdep.size_serial_icounter_struct = 80;
amd64_linux_record_tdep.size_hayes_esp_config = 12;
amd64_linux_record_tdep.size_size_t = 8;
amd64_linux_record_tdep.size_iovec = 16;
amd64_linux_record_tdep.size_time_t = 8;
/* These values are the second argument of system call "sys_fcntl"
and "sys_fcntl64". They are obtained from Linux Kernel source. */
amd64_linux_record_tdep.fcntl_F_GETLK = 5;
amd64_linux_record_tdep.fcntl_F_GETLK64 = 12;
amd64_linux_record_tdep.fcntl_F_SETLK64 = 13;
amd64_linux_record_tdep.fcntl_F_SETLKW64 = 14;
amd64_linux_record_tdep.arg1 = AMD64_RDI_REGNUM;
amd64_linux_record_tdep.arg2 = AMD64_RSI_REGNUM;
amd64_linux_record_tdep.arg3 = AMD64_RDX_REGNUM;
amd64_linux_record_tdep.arg4 = AMD64_R10_REGNUM;
amd64_linux_record_tdep.arg5 = AMD64_R8_REGNUM;
amd64_linux_record_tdep.arg6 = AMD64_R9_REGNUM;
/* These values are the second argument of system call "sys_ioctl".
They are obtained from Linux Kernel source. */
amd64_linux_record_tdep.ioctl_TCGETS = 0x5401;
amd64_linux_record_tdep.ioctl_TCSETS = 0x5402;
amd64_linux_record_tdep.ioctl_TCSETSW = 0x5403;
amd64_linux_record_tdep.ioctl_TCSETSF = 0x5404;
amd64_linux_record_tdep.ioctl_TCGETA = 0x5405;
amd64_linux_record_tdep.ioctl_TCSETA = 0x5406;
amd64_linux_record_tdep.ioctl_TCSETAW = 0x5407;
amd64_linux_record_tdep.ioctl_TCSETAF = 0x5408;
amd64_linux_record_tdep.ioctl_TCSBRK = 0x5409;
amd64_linux_record_tdep.ioctl_TCXONC = 0x540A;
amd64_linux_record_tdep.ioctl_TCFLSH = 0x540B;
amd64_linux_record_tdep.ioctl_TIOCEXCL = 0x540C;
amd64_linux_record_tdep.ioctl_TIOCNXCL = 0x540D;
amd64_linux_record_tdep.ioctl_TIOCSCTTY = 0x540E;
amd64_linux_record_tdep.ioctl_TIOCGPGRP = 0x540F;
amd64_linux_record_tdep.ioctl_TIOCSPGRP = 0x5410;
amd64_linux_record_tdep.ioctl_TIOCOUTQ = 0x5411;
amd64_linux_record_tdep.ioctl_TIOCSTI = 0x5412;
amd64_linux_record_tdep.ioctl_TIOCGWINSZ = 0x5413;
amd64_linux_record_tdep.ioctl_TIOCSWINSZ = 0x5414;
amd64_linux_record_tdep.ioctl_TIOCMGET = 0x5415;
amd64_linux_record_tdep.ioctl_TIOCMBIS = 0x5416;
amd64_linux_record_tdep.ioctl_TIOCMBIC = 0x5417;
amd64_linux_record_tdep.ioctl_TIOCMSET = 0x5418;
amd64_linux_record_tdep.ioctl_TIOCGSOFTCAR = 0x5419;
amd64_linux_record_tdep.ioctl_TIOCSSOFTCAR = 0x541A;
amd64_linux_record_tdep.ioctl_FIONREAD = 0x541B;
amd64_linux_record_tdep.ioctl_TIOCINQ
= amd64_linux_record_tdep.ioctl_FIONREAD;
amd64_linux_record_tdep.ioctl_TIOCLINUX = 0x541C;
amd64_linux_record_tdep.ioctl_TIOCCONS = 0x541D;
amd64_linux_record_tdep.ioctl_TIOCGSERIAL = 0x541E;
amd64_linux_record_tdep.ioctl_TIOCSSERIAL = 0x541F;
amd64_linux_record_tdep.ioctl_TIOCPKT = 0x5420;
amd64_linux_record_tdep.ioctl_FIONBIO = 0x5421;
amd64_linux_record_tdep.ioctl_TIOCNOTTY = 0x5422;
amd64_linux_record_tdep.ioctl_TIOCSETD = 0x5423;
amd64_linux_record_tdep.ioctl_TIOCGETD = 0x5424;
amd64_linux_record_tdep.ioctl_TCSBRKP = 0x5425;
amd64_linux_record_tdep.ioctl_TIOCTTYGSTRUCT = 0x5426;
amd64_linux_record_tdep.ioctl_TIOCSBRK = 0x5427;
amd64_linux_record_tdep.ioctl_TIOCCBRK = 0x5428;
amd64_linux_record_tdep.ioctl_TIOCGSID = 0x5429;
amd64_linux_record_tdep.ioctl_TCGETS2 = 0x802c542a;
amd64_linux_record_tdep.ioctl_TCSETS2 = 0x402c542b;
amd64_linux_record_tdep.ioctl_TCSETSW2 = 0x402c542c;
amd64_linux_record_tdep.ioctl_TCSETSF2 = 0x402c542d;
amd64_linux_record_tdep.ioctl_TIOCGPTN = 0x80045430;
amd64_linux_record_tdep.ioctl_TIOCSPTLCK = 0x40045431;
amd64_linux_record_tdep.ioctl_FIONCLEX = 0x5450;
amd64_linux_record_tdep.ioctl_FIOCLEX = 0x5451;
amd64_linux_record_tdep.ioctl_FIOASYNC = 0x5452;
amd64_linux_record_tdep.ioctl_TIOCSERCONFIG = 0x5453;
amd64_linux_record_tdep.ioctl_TIOCSERGWILD = 0x5454;
amd64_linux_record_tdep.ioctl_TIOCSERSWILD = 0x5455;
amd64_linux_record_tdep.ioctl_TIOCGLCKTRMIOS = 0x5456;
amd64_linux_record_tdep.ioctl_TIOCSLCKTRMIOS = 0x5457;
amd64_linux_record_tdep.ioctl_TIOCSERGSTRUCT = 0x5458;
amd64_linux_record_tdep.ioctl_TIOCSERGETLSR = 0x5459;
amd64_linux_record_tdep.ioctl_TIOCSERGETMULTI = 0x545A;
amd64_linux_record_tdep.ioctl_TIOCSERSETMULTI = 0x545B;
amd64_linux_record_tdep.ioctl_TIOCMIWAIT = 0x545C;
amd64_linux_record_tdep.ioctl_TIOCGICOUNT = 0x545D;
amd64_linux_record_tdep.ioctl_TIOCGHAYESESP = 0x545E;
amd64_linux_record_tdep.ioctl_TIOCSHAYESESP = 0x545F;
amd64_linux_record_tdep.ioctl_FIOQSIZE = 0x5460;
tdep->i386_syscall_record = amd64_linux_syscall_record;
/* GNU/Linux uses SVR4-style shared libraries. */
set_solib_svr4_fetch_link_map_offsets
(gdbarch, svr4_lp64_fetch_link_map_offsets);
/* Register DTrace handlers. */
set_gdbarch_dtrace_parse_probe_argument (gdbarch, amd64_dtrace_parse_probe_argument);
set_gdbarch_dtrace_probe_is_enabled (gdbarch, amd64_dtrace_probe_is_enabled);
set_gdbarch_dtrace_enable_probe (gdbarch, amd64_dtrace_enable_probe);
set_gdbarch_dtrace_disable_probe (gdbarch, amd64_dtrace_disable_probe);
}
static void
Add some more casts (1/2) Note: I needed to split this patch in two, otherwise it's too big for the mailing list. This patch adds explicit casts to situations where a void pointer is assigned to a pointer to the "real" type. Building in C++ mode requires those assignments to use an explicit cast. This includes, for example: - callback arguments (cleanups, comparison functions, ...) - data attached to some object (objfile, program space, etc) in the form of a void pointer - "user data" passed to some function This patch comes from the commit "(mostly) auto-generated patch to insert casts needed for C++", taken from Pedro's C++ branch. Only files built on x86 with --enable-targets=all are modified, so the native files for other arches will need to be dealt with separately. I built-tested this with --enable-targets=all and reg-tested. To my surprise, a test case (selftest.exp) had to be adjusted. Here's the ChangeLog entry. Again, this was relatively quick to make despite the length, thanks to David Malcom's script, although I don't believe it's very useful information in that particular case... gdb/ChangeLog: * aarch64-tdep.c (aarch64_make_prologue_cache): Add cast(s). (aarch64_make_stub_cache): Likewise. (value_of_aarch64_user_reg): Likewise. * ada-lang.c (ada_inferior_data_cleanup): Likewise. (get_ada_inferior_data): Likewise. (get_ada_pspace_data): Likewise. (ada_pspace_data_cleanup): Likewise. (ada_complete_symbol_matcher): Likewise. (ada_exc_search_name_matches): Likewise. * ada-tasks.c (get_ada_tasks_pspace_data): Likewise. (get_ada_tasks_inferior_data): Likewise. * addrmap.c (addrmap_mutable_foreach_worker): Likewise. (splay_obstack_alloc): Likewise. (splay_obstack_free): Likewise. * alpha-linux-tdep.c (alpha_linux_supply_gregset): Likewise. (alpha_linux_collect_gregset): Likewise. (alpha_linux_supply_fpregset): Likewise. (alpha_linux_collect_fpregset): Likewise. * alpha-mdebug-tdep.c (alpha_mdebug_frame_unwind_cache): Likewise. * alpha-tdep.c (alpha_lds): Likewise. (alpha_sts): Likewise. (alpha_sigtramp_frame_unwind_cache): Likewise. (alpha_heuristic_frame_unwind_cache): Likewise. (alpha_supply_int_regs): Likewise. (alpha_fill_int_regs): Likewise. (alpha_supply_fp_regs): Likewise. (alpha_fill_fp_regs): Likewise. * alphanbsd-tdep.c (alphanbsd_supply_fpregset): Likewise. (alphanbsd_aout_supply_gregset): Likewise. (alphanbsd_supply_gregset): Likewise. * amd64-linux-tdep.c (amd64_linux_init_abi): Likewise. (amd64_x32_linux_init_abi): Likewise. * amd64-nat.c (amd64_supply_native_gregset): Likewise. (amd64_collect_native_gregset): Likewise. * amd64-tdep.c (amd64_frame_cache): Likewise. (amd64_sigtramp_frame_cache): Likewise. (amd64_epilogue_frame_cache): Likewise. (amd64_supply_fxsave): Likewise. (amd64_supply_xsave): Likewise. (amd64_collect_fxsave): Likewise. (amd64_collect_xsave): Likewise. * amd64-windows-tdep.c (amd64_windows_frame_cache): Likewise. * amd64obsd-tdep.c (amd64obsd_trapframe_cache): Likewise. * arm-linux-tdep.c (arm_linux_supply_gregset): Likewise. (arm_linux_collect_gregset): Likewise. (arm_linux_supply_nwfpe): Likewise. (arm_linux_collect_nwfpe): Likewise. (arm_linux_supply_vfp): Likewise. (arm_linux_collect_vfp): Likewise. * arm-tdep.c (arm_find_mapping_symbol): Likewise. (arm_prologue_unwind_stop_reason): Likewise. (arm_prologue_this_id): Likewise. (arm_prologue_prev_register): Likewise. (arm_exidx_data_free): Likewise. (arm_find_exidx_entry): Likewise. (arm_stub_this_id): Likewise. (arm_m_exception_this_id): Likewise. (arm_m_exception_prev_register): Likewise. (arm_normal_frame_base): Likewise. (gdb_print_insn_arm): Likewise. (arm_objfile_data_free): Likewise. (arm_record_special_symbol): Likewise. (value_of_arm_user_reg): Likewise. * armbsd-tdep.c (armbsd_supply_fpregset): Likewise. (armbsd_supply_gregset): Likewise. * auto-load.c (auto_load_pspace_data_cleanup): Likewise. (get_auto_load_pspace_data): Likewise. (hash_loaded_script_entry): Likewise. (eq_loaded_script_entry): Likewise. (clear_section_scripts): Likewise. (collect_matching_scripts): Likewise. * auxv.c (auxv_inferior_data_cleanup): Likewise. (get_auxv_inferior_data): Likewise. * avr-tdep.c (avr_frame_unwind_cache): Likewise. * ax-general.c (do_free_agent_expr_cleanup): Likewise. * bfd-target.c (target_bfd_xfer_partial): Likewise. (target_bfd_xclose): Likewise. (target_bfd_get_section_table): Likewise. * bfin-tdep.c (bfin_frame_cache): Likewise. * block.c (find_block_in_blockvector): Likewise. (call_site_for_pc): Likewise. (block_find_non_opaque_type_preferred): Likewise. * break-catch-sig.c (signal_catchpoint_insert_location): Likewise. (signal_catchpoint_remove_location): Likewise. (signal_catchpoint_breakpoint_hit): Likewise. (signal_catchpoint_print_one): Likewise. (signal_catchpoint_print_mention): Likewise. (signal_catchpoint_print_recreate): Likewise. * break-catch-syscall.c (get_catch_syscall_inferior_data): Likewise. * breakpoint.c (do_cleanup_counted_command_line): Likewise. (bp_location_compare_addrs): Likewise. (get_first_locp_gte_addr): Likewise. (check_tracepoint_command): Likewise. (do_map_commands_command): Likewise. (get_breakpoint_objfile_data): Likewise. (free_breakpoint_probes): Likewise. (do_captured_breakpoint_query): Likewise. (compare_breakpoints): Likewise. (bp_location_compare): Likewise. (bpstat_remove_breakpoint_callback): Likewise. (do_delete_breakpoint_cleanup): Likewise. * bsd-uthread.c (bsd_uthread_set_supply_uthread): Likewise. (bsd_uthread_set_collect_uthread): Likewise. (bsd_uthread_activate): Likewise. (bsd_uthread_fetch_registers): Likewise. (bsd_uthread_store_registers): Likewise. * btrace.c (check_xml_btrace_version): Likewise. (parse_xml_btrace_block): Likewise. (parse_xml_btrace_pt_config_cpu): Likewise. (parse_xml_btrace_pt_raw): Likewise. (parse_xml_btrace_pt): Likewise. (parse_xml_btrace_conf_bts): Likewise. (parse_xml_btrace_conf_pt): Likewise. (do_btrace_data_cleanup): Likewise. * c-typeprint.c (find_typedef_for_canonicalize): Likewise. * charset.c (cleanup_iconv): Likewise. (do_cleanup_iterator): Likewise. * cli-out.c (cli_uiout_dtor): Likewise. (cli_table_begin): Likewise. (cli_table_body): Likewise. (cli_table_end): Likewise. (cli_table_header): Likewise. (cli_begin): Likewise. (cli_end): Likewise. (cli_field_int): Likewise. (cli_field_skip): Likewise. (cli_field_string): Likewise. (cli_field_fmt): Likewise. (cli_spaces): Likewise. (cli_text): Likewise. (cli_message): Likewise. (cli_wrap_hint): Likewise. (cli_flush): Likewise. (cli_redirect): Likewise. (out_field_fmt): Likewise. (field_separator): Likewise. (cli_out_set_stream): Likewise. * cli/cli-cmds.c (compare_symtabs): Likewise. * cli/cli-dump.c (call_dump_func): Likewise. (restore_section_callback): Likewise. * cli/cli-script.c (clear_hook_in_cleanup): Likewise. (do_restore_user_call_depth): Likewise. (do_free_command_lines_cleanup): Likewise. * coff-pe-read.c (get_section_vmas): Likewise. (pe_as16): Likewise. (pe_as32): Likewise. * coffread.c (coff_symfile_read): Likewise. * common/agent.c (agent_look_up_symbols): Likewise. * common/filestuff.c (do_close_cleanup): Likewise. * common/format.c (free_format_pieces_cleanup): Likewise. * common/vec.c (vec_o_reserve): Likewise. * compile/compile-c-support.c (print_one_macro): Likewise. * compile/compile-c-symbols.c (hash_symbol_error): Likewise. (eq_symbol_error): Likewise. (del_symbol_error): Likewise. (error_symbol_once): Likewise. (gcc_convert_symbol): Likewise. (gcc_symbol_address): Likewise. (hash_symname): Likewise. (eq_symname): Likewise. * compile/compile-c-types.c (hash_type_map_instance): Likewise. (eq_type_map_instance): Likewise. (insert_type): Likewise. (convert_type): Likewise. * compile/compile-object-load.c (munmap_listp_free_cleanup): Likewise. (setup_sections): Likewise. (link_hash_table_free): Likewise. (copy_sections): Likewise. * compile/compile-object-run.c (do_module_cleanup): Likewise. * compile/compile.c (compile_print_value): Likewise. (do_rmdir): Likewise. (cleanup_compile_instance): Likewise. (cleanup_unlink_file): Likewise. * completer.c (free_completion_tracker): Likewise. * corelow.c (add_to_spuid_list): Likewise. * cp-namespace.c (reset_directive_searched): Likewise. * cp-support.c (reset_directive_searched): Likewise. * cris-tdep.c (cris_sigtramp_frame_unwind_cache): Likewise. (cris_frame_unwind_cache): Likewise. * d-lang.c (builtin_d_type): Likewise. * d-namespace.c (reset_directive_searched): Likewise. * dbxread.c (dbx_free_symfile_info): Likewise. (do_free_bincl_list_cleanup): Likewise. * disasm.c (hash_dis_line_entry): Likewise. (eq_dis_line_entry): Likewise. (dis_asm_print_address): Likewise. (fprintf_disasm): Likewise. (do_ui_file_delete): Likewise. * doublest.c (convert_floatformat_to_doublest): Likewise. * dummy-frame.c (pop_dummy_frame_bpt): Likewise. (dummy_frame_prev_register): Likewise. (dummy_frame_this_id): Likewise. * dwarf2-frame-tailcall.c (cache_hash): Likewise. (cache_eq): Likewise. (cache_find): Likewise. (tailcall_frame_this_id): Likewise. (dwarf2_tailcall_prev_register_first): Likewise. (tailcall_frame_prev_register): Likewise. (tailcall_frame_dealloc_cache): Likewise. (tailcall_frame_prev_arch): Likewise. * dwarf2-frame.c (dwarf2_frame_state_free): Likewise. (dwarf2_frame_set_init_reg): Likewise. (dwarf2_frame_init_reg): Likewise. (dwarf2_frame_set_signal_frame_p): Likewise. (dwarf2_frame_signal_frame_p): Likewise. (dwarf2_frame_set_adjust_regnum): Likewise. (dwarf2_frame_adjust_regnum): Likewise. (clear_pointer_cleanup): Likewise. (dwarf2_frame_cache): Likewise. (find_cie): Likewise. (dwarf2_frame_find_fde): Likewise. * dwarf2expr.c (dwarf_expr_address_type): Likewise. (free_dwarf_expr_context_cleanup): Likewise. * dwarf2loc.c (locexpr_find_frame_base_location): Likewise. (locexpr_get_frame_base): Likewise. (loclist_find_frame_base_location): Likewise. (loclist_get_frame_base): Likewise. (dwarf_expr_dwarf_call): Likewise. (dwarf_expr_get_base_type): Likewise. (dwarf_expr_push_dwarf_reg_entry_value): Likewise. (dwarf_expr_get_obj_addr): Likewise. (entry_data_value_coerce_ref): Likewise. (entry_data_value_copy_closure): Likewise. (entry_data_value_free_closure): Likewise. (get_frame_address_in_block_wrapper): Likewise. (dwarf2_evaluate_property): Likewise. (dwarf2_compile_property_to_c): Likewise. (needs_frame_read_addr_from_reg): Likewise. (needs_frame_get_reg_value): Likewise. (needs_frame_frame_base): Likewise. (needs_frame_frame_cfa): Likewise. (needs_frame_tls_address): Likewise. (needs_frame_dwarf_call): Likewise. (needs_dwarf_reg_entry_value): Likewise. (get_ax_pc): Likewise. (locexpr_read_variable): Likewise. (locexpr_read_variable_at_entry): Likewise. (locexpr_read_needs_frame): Likewise. (locexpr_describe_location): Likewise. (locexpr_tracepoint_var_ref): Likewise. (locexpr_generate_c_location): Likewise. (loclist_read_variable): Likewise. (loclist_read_variable_at_entry): Likewise. (loclist_describe_location): Likewise. (loclist_tracepoint_var_ref): Likewise. (loclist_generate_c_location): Likewise. * dwarf2read.c (line_header_hash_voidp): Likewise. (line_header_eq_voidp): Likewise. (dwarf2_has_info): Likewise. (dwarf2_get_section_info): Likewise. (locate_dwz_sections): Likewise. (hash_file_name_entry): Likewise. (eq_file_name_entry): Likewise. (delete_file_name_entry): Likewise. (dw2_setup): Likewise. (dw2_get_file_names_reader): Likewise. (dw2_find_pc_sect_compunit_symtab): Likewise. (hash_signatured_type): Likewise. (eq_signatured_type): Likewise. (add_signatured_type_cu_to_table): Likewise. (create_debug_types_hash_table): Likewise. (lookup_dwo_signatured_type): Likewise. (lookup_dwp_signatured_type): Likewise. (lookup_signatured_type): Likewise. (hash_type_unit_group): Likewise. (eq_type_unit_group): Likewise. (get_type_unit_group): Likewise. (process_psymtab_comp_unit_reader): Likewise. (sort_tu_by_abbrev_offset): Likewise. (process_skeletonless_type_unit): Likewise. (psymtabs_addrmap_cleanup): Likewise. (dwarf2_read_symtab): Likewise. (psymtab_to_symtab_1): Likewise. (die_hash): Likewise. (die_eq): Likewise. (load_full_comp_unit_reader): Likewise. (reset_die_in_process): Likewise. (free_cu_line_header): Likewise. (handle_DW_AT_stmt_list): Likewise. (hash_dwo_file): Likewise. (eq_dwo_file): Likewise. (hash_dwo_unit): Likewise. (eq_dwo_unit): Likewise. (create_dwo_cu_reader): Likewise. (create_dwo_unit_in_dwp_v1): Likewise. (create_dwo_unit_in_dwp_v2): Likewise. (lookup_dwo_unit_in_dwp): Likewise. (dwarf2_locate_dwo_sections): Likewise. (dwarf2_locate_common_dwp_sections): Likewise. (dwarf2_locate_v2_dwp_sections): Likewise. (hash_dwp_loaded_cutus): Likewise. (eq_dwp_loaded_cutus): Likewise. (lookup_dwo_cutu): Likewise. (abbrev_table_free_cleanup): Likewise. (dwarf2_free_abbrev_table): Likewise. (find_partial_die_in_comp_unit): Likewise. (free_line_header_voidp): Likewise. (follow_die_offset): Likewise. (follow_die_sig_1): Likewise. (free_heap_comp_unit): Likewise. (free_stack_comp_unit): Likewise. (dwarf2_free_objfile): Likewise. (per_cu_offset_and_type_hash): Likewise. (per_cu_offset_and_type_eq): Likewise. (get_die_type_at_offset): Likewise. (partial_die_hash): Likewise. (partial_die_eq): Likewise. (dwarf2_per_objfile_free): Likewise. (hash_strtab_entry): Likewise. (eq_strtab_entry): Likewise. (add_string): Likewise. (hash_symtab_entry): Likewise. (eq_symtab_entry): Likewise. (delete_symtab_entry): Likewise. (cleanup_mapped_symtab): Likewise. (add_indices_to_cpool): Likewise. (hash_psymtab_cu_index): Likewise. (eq_psymtab_cu_index): Likewise. (add_address_entry_worker): Likewise. (unlink_if_set): Likewise. (write_one_signatured_type): Likewise. (save_gdb_index_command): Likewise. * elfread.c (elf_symtab_read): Likewise. (elf_gnu_ifunc_cache_hash): Likewise. (elf_gnu_ifunc_cache_eq): Likewise. (elf_gnu_ifunc_record_cache): Likewise. (elf_gnu_ifunc_resolve_by_cache): Likewise. (elf_get_probes): Likewise. (probe_key_free): Likewise. * f-lang.c (builtin_f_type): Likewise. * frame-base.c (frame_base_append_sniffer): Likewise. (frame_base_set_default): Likewise. (frame_base_find_by_frame): Likewise. * frame-unwind.c (frame_unwind_prepend_unwinder): Likewise. (frame_unwind_append_unwinder): Likewise. (frame_unwind_find_by_frame): Likewise. * frame.c (frame_addr_hash): Likewise. (frame_addr_hash_eq): Likewise. (frame_stash_find): Likewise. (do_frame_register_read): Likewise. (unwind_to_current_frame): Likewise. (frame_cleanup_after_sniffer): Likewise. * frv-linux-tdep.c (frv_linux_sigtramp_frame_cache): Likewise. * frv-tdep.c (frv_frame_unwind_cache): Likewise. * ft32-tdep.c (ft32_frame_cache): Likewise. * gcore.c (do_bfd_delete_cleanup): Likewise. (gcore_create_callback): Likewise. * gdb_bfd.c (hash_bfd): Likewise. (eq_bfd): Likewise. (gdb_bfd_open): Likewise. (free_one_bfd_section): Likewise. (gdb_bfd_ref): Likewise. (gdb_bfd_unref): Likewise. (get_section_descriptor): Likewise. (gdb_bfd_map_section): Likewise. (gdb_bfd_crc): Likewise. (gdb_bfd_mark_parent): Likewise. (gdb_bfd_record_inclusion): Likewise. (gdb_bfd_requires_relocations): Likewise. (print_one_bfd): Likewise. * gdbtypes.c (type_pair_hash): Likewise. (type_pair_eq): Likewise. (builtin_type): Likewise. (objfile_type): Likewise. * gnu-v3-abi.c (vtable_ptrdiff_type): Likewise. (vtable_address_point_offset): Likewise. (gnuv3_get_vtable): Likewise. (hash_value_and_voffset): Likewise. (eq_value_and_voffset): Likewise. (compare_value_and_voffset): Likewise. (compute_vtable_size): Likewise. (gnuv3_get_typeid_type): Likewise. * go-lang.c (builtin_go_type): Likewise. * guile/scm-block.c (bkscm_hash_block_smob): Likewise. (bkscm_eq_block_smob): Likewise. (bkscm_objfile_block_map): Likewise. (bkscm_del_objfile_blocks): Likewise. * guile/scm-breakpoint.c (bpscm_build_bp_list): Likewise. * guile/scm-disasm.c (gdbscm_disasm_read_memory_worker): Likewise. (gdbscm_disasm_print_address): Likewise. * guile/scm-frame.c (frscm_hash_frame_smob): Likewise. (frscm_eq_frame_smob): Likewise. (frscm_inferior_frame_map): Likewise. (frscm_del_inferior_frames): Likewise. * guile/scm-gsmob.c (gdbscm_add_objfile_ref): Likewise. * guile/scm-objfile.c (ofscm_handle_objfile_deleted): Likewise. (ofscm_objfile_smob_from_objfile): Likewise. * guile/scm-ports.c (ioscm_write): Likewise. (ioscm_file_port_delete): Likewise. (ioscm_file_port_rewind): Likewise. (ioscm_file_port_put): Likewise. (ioscm_file_port_write): Likewise. * guile/scm-progspace.c (psscm_handle_pspace_deleted): Likewise. (psscm_pspace_smob_from_pspace): Likewise. * guile/scm-safe-call.c (scscm_recording_pre_unwind_handler): Likewise. (scscm_recording_unwind_handler): Likewise. (gdbscm_with_catch): Likewise. (scscm_call_0_body): Likewise. (scscm_call_1_body): Likewise. (scscm_call_2_body): Likewise. (scscm_call_3_body): Likewise. (scscm_call_4_body): Likewise. (scscm_apply_1_body): Likewise. (scscm_eval_scheme_string): Likewise. (gdbscm_safe_eval_string): Likewise. (scscm_source_scheme_script): Likewise. (gdbscm_safe_source_script): Likewise. * guile/scm-string.c (gdbscm_call_scm_to_stringn): Likewise. (gdbscm_call_scm_from_stringn): Likewise. * guile/scm-symbol.c (syscm_hash_symbol_smob): Likewise. (syscm_eq_symbol_smob): Likewise. (syscm_get_symbol_map): Likewise. (syscm_del_objfile_symbols): Likewise. * guile/scm-symtab.c (stscm_hash_symtab_smob): Likewise. (stscm_eq_symtab_smob): Likewise. (stscm_objfile_symtab_map): Likewise. (stscm_del_objfile_symtabs): Likewise. * guile/scm-type.c (tyscm_hash_type_smob): Likewise. (tyscm_eq_type_smob): Likewise. (tyscm_type_map): Likewise. (tyscm_copy_type_recursive): Likewise. (save_objfile_types): Likewise. * guile/scm-utils.c (extract_arg): Likewise. * h8300-tdep.c (h8300_frame_cache): Likewise. * hppa-linux-tdep.c (hppa_linux_sigtramp_frame_unwind_cache): Likewise. * hppa-tdep.c (compare_unwind_entries): Likewise. (find_unwind_entry): Likewise. (hppa_frame_cache): Likewise. (hppa_stub_frame_unwind_cache): Likewise. * hppanbsd-tdep.c (hppanbsd_supply_gregset): Likewise. * hppaobsd-tdep.c (hppaobsd_supply_gregset): Likewise. (hppaobsd_supply_fpregset): Likewise. * i386-cygwin-tdep.c (core_process_module_section): Likewise. * i386-linux-tdep.c (i386_linux_init_abi): Likewise. * i386-tdep.c (i386_frame_cache): Likewise. (i386_epilogue_frame_cache): Likewise. (i386_sigtramp_frame_cache): Likewise. (i386_supply_gregset): Likewise. (i386_collect_gregset): Likewise. (i386_gdbarch_init): Likewise. * i386obsd-tdep.c (i386obsd_aout_supply_regset): Likewise. (i386obsd_trapframe_cache): Likewise. * i387-tdep.c (i387_supply_fsave): Likewise. (i387_collect_fsave): Likewise. (i387_supply_fxsave): Likewise. (i387_collect_fxsave): Likewise. (i387_supply_xsave): Likewise. (i387_collect_xsave): Likewise. * ia64-tdep.c (ia64_frame_cache): Likewise. (ia64_sigtramp_frame_cache): Likewise. * infcmd.c (attach_command_continuation): Likewise. (attach_command_continuation_free_args): Likewise. * inferior.c (restore_inferior): Likewise. (delete_thread_of_inferior): Likewise. * inflow.c (inflow_inferior_data_cleanup): Likewise. (get_inflow_inferior_data): Likewise. (inflow_inferior_exit): Likewise. * infrun.c (displaced_step_clear_cleanup): Likewise. (restore_current_uiout_cleanup): Likewise. (release_stop_context_cleanup): Likewise. (do_restore_infcall_suspend_state_cleanup): Likewise. (do_restore_infcall_control_state_cleanup): Likewise. (restore_inferior_ptid): Likewise. * inline-frame.c (block_starting_point_at): Likewise. * iq2000-tdep.c (iq2000_frame_cache): Likewise. * jit.c (get_jit_objfile_data): Likewise. (get_jit_program_space_data): Likewise. (jit_object_close_impl): Likewise. (jit_find_objf_with_entry_addr): Likewise. (jit_breakpoint_deleted): Likewise. (jit_unwind_reg_set_impl): Likewise. (jit_unwind_reg_get_impl): Likewise. (jit_dealloc_cache): Likewise. (jit_frame_sniffer): Likewise. (jit_frame_prev_register): Likewise. (jit_prepend_unwinder): Likewise. (jit_inferior_exit_hook): Likewise. (free_objfile_data): Likewise. * jv-lang.c (jv_per_objfile_free): Likewise. (get_dynamics_objfile): Likewise. (get_java_class_symtab): Likewise. (builtin_java_type): Likewise. * language.c (language_string_char_type): Likewise. (language_bool_type): Likewise. (language_lookup_primitive_type): Likewise. (language_lookup_primitive_type_as_symbol): Likewise. * linespec.c (hash_address_entry): Likewise. (eq_address_entry): Likewise. (iterate_inline_only): Likewise. (iterate_name_matcher): Likewise. (decode_line_2_compare_items): Likewise. (collect_one_symbol): Likewise. (compare_symbols): Likewise. (compare_msymbols): Likewise. (add_symtabs_to_list): Likewise. (collect_symbols): Likewise. (compare_msyms): Likewise. (add_minsym): Likewise. (cleanup_linespec_result): Likewise. * linux-fork.c (inferior_call_waitpid_cleanup): Likewise. * linux-nat.c (delete_lwp_cleanup): Likewise. (count_events_callback): Likewise. (select_event_lwp_callback): Likewise. (resume_stopped_resumed_lwps): Likewise. * linux-tdep.c (get_linux_gdbarch_data): Likewise. (invalidate_linux_cache_inf): Likewise. (get_linux_inferior_data): Likewise. (linux_find_memory_regions_thunk): Likewise. (linux_make_mappings_callback): Likewise. (linux_corefile_thread_callback): Likewise. (find_mapping_size): Likewise. * linux-thread-db.c (find_new_threads_callback): Likewise. * lm32-tdep.c (lm32_frame_cache): Likewise. * m2-lang.c (builtin_m2_type): Likewise. * m32c-tdep.c (m32c_analyze_frame_prologue): Likewise. * m32r-linux-tdep.c (m32r_linux_sigtramp_frame_cache): Likewise. (m32r_linux_supply_gregset): Likewise. (m32r_linux_collect_gregset): Likewise. * m32r-tdep.c (m32r_frame_unwind_cache): Likewise. * m68hc11-tdep.c (m68hc11_frame_unwind_cache): Likewise. * m68k-tdep.c (m68k_frame_cache): Likewise. * m68kbsd-tdep.c (m68kbsd_supply_fpregset): Likewise. (m68kbsd_supply_gregset): Likewise. * m68klinux-tdep.c (m68k_linux_sigtramp_frame_cache): Likewise. * m88k-tdep.c (m88k_frame_cache): Likewise. (m88k_supply_gregset): Likewise. gdb/gdbserver/ChangeLog: * dll.c (match_dll): Add cast(s). (unloaded_dll): Likewise. * linux-low.c (second_thread_of_pid_p): Likewise. (delete_lwp_callback): Likewise. (count_events_callback): Likewise. (select_event_lwp_callback): Likewise. (linux_set_resume_request): Likewise. * server.c (accumulate_file_name_length): Likewise. (emit_dll_description): Likewise. (handle_qxfer_threads_worker): Likewise. (visit_actioned_threads): Likewise. * thread-db.c (any_thread_of): Likewise. * tracepoint.c (same_process_p): Likewise. (match_blocktype): Likewise. (build_traceframe_info_xml): Likewise. gdb/testsuite/ChangeLog: * gdb.gdb/selftest.exp (do_steps_and_nexts): Adjust expected source line.
2015-09-25 20:08:07 +02:00
amd64_x32_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
2017-08-07 16:53:54 +02:00
struct tdesc_arch_data *tdesc_data = info.tdesc_data;
const struct tdesc_feature *feature;
int valid_p;
gdb_assert (tdesc_data);
tdep->gregset_reg_offset = amd64_linux_gregset_reg_offset;
tdep->gregset_num_regs = ARRAY_SIZE (amd64_linux_gregset_reg_offset);
tdep->sizeof_gregset = 27 * 8;
amd64_x32_init_abi (info, gdbarch,
amd64_linux_read_description (X86_XSTATE_SSE_MASK,
true));
/* Reserve a number for orig_rax. */
set_gdbarch_num_regs (gdbarch, AMD64_LINUX_NUM_REGS);
Fix x86-64 GNU/Linux crashes Ref: https://sourceware.org/ml/gdb-patches/2017-07/msg00162.html Debugging x86-64 GNU/Linux programs currently crashes GDB in tdesc_use_registers during gdbarch initialization: Program received signal SIGSEGV, Segmentation fault. 0x0000000001093eaf in htab_remove_elt_with_hash (htab=0x2ef9fa0, element=0x26af960, hash=557151073) at src/libiberty/hashtab.c:728 728 if (*slot == HTAB_EMPTY_ENTRY) (top-gdb) p slot $1 = (void **) 0x0 (top-gdb) bt #0 0x0000000001093eaf in htab_remove_elt_with_hash (htab=0x2ef9fa0, element=0x26af960, hash=557151073) at src/libiberty/hashtab.c:728 #1 0x0000000001093e79 in htab_remove_elt (htab=0x2ef9fa0, element=0x26af960) at src/libiberty/hashtab.c:714 #2 0x00000000009121b0 in tdesc_use_registers (gdbarch=0x3001240, target_desc=0x2659cb0, early_data=0x2881cb0) at src/gdb/target-descriptions.c:1328 #3 0x000000000047c93e in i386_gdbarch_init (info=..., arches=0x0) at src/gdb/i386-tdep.c:8634 #4 0x0000000000818d5f in gdbarch_find_by_info (info=...) at src/gdb/gdbarch.c:5394 #5 0x00000000007198a8 in set_gdbarch_from_file (abfd=0x2f48250) at src/gdb/arch-utils.c:618 #6 0x00000000007f21cb in exec_file_attach (filename=0x7fffffffddb0 "/home/pedro/gdb/tests/threads", from_tty=1) at src/gdb/exec.c:380 #7 0x0000000000865c18 in catch_command_errors_const (command=0x7f1d83 <exec_file_attach(char const*, int)>, arg=0x7fffffffddb0 "/home/pedro/gdb/tests/threads", from_tty=1) at src/gdb/main.c:403 #8 0x00000000008669cf in captured_main_1 (context=0x7fffffffd860) at src/gdb/main.c:1035 #9 0x0000000000866de2 in captured_main (data=0x7fffffffd860) at src/gdb/main.c:1142 #10 0x0000000000866e24 in gdb_main (args=0x7fffffffd860) at src/gdb/main.c:1160 #11 0x000000000041312d in main (argc=3, argv=0x7fffffffd968) at src/gdb/gdb.c:32 The direct cause of the crash is that we tried to remove an element from the hash which supposedly exists, but does not. (htab_remove_elt shouldn't really crash in this case, but that's secondary.) The real problem is that early_data passed to tdesc_use_registers includes regs from a target description that is not the target_desc, which violates its assumptions. The registers in question are the fs_base/gs_base registers, added by amd64_init_abi: tdesc_numbered_register (feature, tdesc_data_segments, AMD64_FSBASE_REGNUM, "fs_base"); tdesc_numbered_register (feature, tdesc_data_segments, AMD64_GSBASE_REGNUM, "gs_base"); and that happens because amd64_linux_init_abi uses amd64_init_abi as helper, but they don't coordinate on which fallback tdesc to use. amd64_init_abi does: if (! tdesc_has_registers (tdesc)) tdesc = tdesc_amd64; and then adds the fs_base/gs_base registers of the "tdesc_amd64" tdesc to the tdesc_arch_data. After amd64_init_abi returns, amd64_linux_init_abi does: if (! tdesc_has_registers (tdesc)) tdesc = tdesc_amd64_linux; tdep->tdesc = tdesc; and we end up tdesc_amd64_linux installed in tdep->tdesc. The fix is to make sure that amd64_linux_init_abi and amd64_init_abi agree on default tdesc, by adding a "default tdesc" parameter to amd64_init_abi, instead of having amd64_init_abi hardcode a default. With this, amd64_init_abi creates the fs_base/gs_base registers using the tdesc_amd64_linux tdesc. Tested on x86-64 GNU/Linux, -m64. I don't have an x32 setup handy. Thanks to John Baldwin, Yao Qi and Simon Marchi for the investigation. gdb/ChangeLog: 2017-07-13 Pedro Alves <palves@redhat.com> * amd64-darwin-tdep.c (x86_darwin_init_abi_64): Pass tdesc_amd64 as default tdesc. * amd64-dicos-tdep.c (amd64_dicos_init_abi): * amd64-fbsd-tdep.c (amd64fbsd_init_abi): * amd64-linux-tdep.c (amd64_linux_init_abi): Pass tdesc_amd64_linux as default tdesc. Get final tdesc from the tdep. (amd64_x32_linux_init_abi): Pass tdesc_x32_linux as default tdesc. Get final tdesc from the tdep. * amd64-nbsd-tdep.c (amd64nbsd_init_abi): Pass tdesc_amd64 as default tdesc. * amd64-obsd-tdep.c (amd64obsd_init_abi): Likewise. * amd64-sol2-tdep.c (amd64_sol2_init_abi): Likewise. * amd64-tdep.c (amd64_init_abi): Add 'default_tdesc' parameter. Use it as default tdesc. (amd64_x32_init_abi): Add 'default_tdesc' parameter, and pass it down to amd_init_abi. No longer handle fallback tdesc here. * amd64-tdep.h (tdesc_x32): Declare. (amd64_init_abi, amd64_x32_init_abi): Add 'default_tdesc' parameter. * amd64-windows-tdep.c (amd64_windows_init_abi): Pass tdesc_amd64 as default tdesc.
2017-07-13 21:56:42 +02:00
const target_desc *tdesc = tdep->tdesc;
feature = tdesc_find_feature (tdesc, "org.gnu.gdb.i386.linux");
if (feature == NULL)
return;
valid_p = tdesc_numbered_register (feature, tdesc_data,
AMD64_LINUX_ORIG_RAX_REGNUM,
"orig_rax");
if (!valid_p)
return;
amd64_linux_init_abi_common (info, gdbarch);
/* Initialize the amd64_x32_linux_record_tdep. */
/* These values are the size of the type that will be used in a system
call. They are obtained from Linux Kernel source. */
amd64_x32_linux_record_tdep.size_pointer
= gdbarch_ptr_bit (gdbarch) / TARGET_CHAR_BIT;
amd64_x32_linux_record_tdep.size__old_kernel_stat = 32;
amd64_x32_linux_record_tdep.size_tms = 32;
amd64_x32_linux_record_tdep.size_loff_t = 8;
amd64_x32_linux_record_tdep.size_flock = 32;
amd64_x32_linux_record_tdep.size_oldold_utsname = 45;
amd64_x32_linux_record_tdep.size_ustat = 32;
/* ADM64 doesn't need this size because it doesn't have sys_sigaction
but sys_rt_sigaction. */
amd64_x32_linux_record_tdep.size_old_sigaction = 16;
/* ADM64 doesn't need this size because it doesn't have sys_sigpending
but sys_rt_sigpending. */
amd64_x32_linux_record_tdep.size_old_sigset_t = 4;
amd64_x32_linux_record_tdep.size_rlimit = 16;
amd64_x32_linux_record_tdep.size_rusage = 144;
amd64_x32_linux_record_tdep.size_timeval = 16;
amd64_x32_linux_record_tdep.size_timezone = 8;
/* ADM64 doesn't need this size because it doesn't have sys_getgroups16
but sys_getgroups. */
amd64_x32_linux_record_tdep.size_old_gid_t = 2;
/* ADM64 doesn't need this size because it doesn't have sys_getresuid16
but sys_getresuid. */
amd64_x32_linux_record_tdep.size_old_uid_t = 2;
amd64_x32_linux_record_tdep.size_fd_set = 128;
/* ADM64 doesn't need this size because it doesn't have sys_readdir. */
amd64_x32_linux_record_tdep.size_old_dirent = 268;
amd64_x32_linux_record_tdep.size_statfs = 120;
amd64_x32_linux_record_tdep.size_statfs64 = 120;
amd64_x32_linux_record_tdep.size_sockaddr = 16;
amd64_x32_linux_record_tdep.size_int
= gdbarch_int_bit (gdbarch) / TARGET_CHAR_BIT;
amd64_x32_linux_record_tdep.size_long
= gdbarch_long_bit (gdbarch) / TARGET_CHAR_BIT;
amd64_x32_linux_record_tdep.size_ulong
= gdbarch_long_bit (gdbarch) / TARGET_CHAR_BIT;
amd64_x32_linux_record_tdep.size_msghdr = 28;
amd64_x32_linux_record_tdep.size_itimerval = 32;
amd64_x32_linux_record_tdep.size_stat = 144;
amd64_x32_linux_record_tdep.size_old_utsname = 325;
amd64_x32_linux_record_tdep.size_sysinfo = 112;
amd64_x32_linux_record_tdep.size_msqid_ds = 120;
amd64_x32_linux_record_tdep.size_shmid_ds = 112;
amd64_x32_linux_record_tdep.size_new_utsname = 390;
amd64_x32_linux_record_tdep.size_timex = 208;
amd64_x32_linux_record_tdep.size_mem_dqinfo = 24;
amd64_x32_linux_record_tdep.size_if_dqblk = 72;
amd64_x32_linux_record_tdep.size_fs_quota_stat = 80;
amd64_x32_linux_record_tdep.size_timespec = 16;
amd64_x32_linux_record_tdep.size_pollfd = 8;
amd64_x32_linux_record_tdep.size_NFS_FHSIZE = 32;
amd64_x32_linux_record_tdep.size_knfsd_fh = 132;
amd64_x32_linux_record_tdep.size_TASK_COMM_LEN = 16;
amd64_x32_linux_record_tdep.size_sigaction = 20;
amd64_x32_linux_record_tdep.size_sigset_t = 8;
amd64_x32_linux_record_tdep.size_siginfo_t = 128;
amd64_x32_linux_record_tdep.size_cap_user_data_t = 8;
amd64_x32_linux_record_tdep.size_stack_t = 12;
amd64_x32_linux_record_tdep.size_off_t = 8;
amd64_x32_linux_record_tdep.size_stat64 = 144;
amd64_x32_linux_record_tdep.size_gid_t = 4;
amd64_x32_linux_record_tdep.size_uid_t = 4;
amd64_x32_linux_record_tdep.size_PAGE_SIZE = 4096;
amd64_x32_linux_record_tdep.size_flock64 = 32;
amd64_x32_linux_record_tdep.size_user_desc = 16;
amd64_x32_linux_record_tdep.size_io_event = 32;
amd64_x32_linux_record_tdep.size_iocb = 64;
amd64_x32_linux_record_tdep.size_epoll_event = 12;
amd64_x32_linux_record_tdep.size_itimerspec = 32;
amd64_x32_linux_record_tdep.size_mq_attr = 64;
amd64_x32_linux_record_tdep.size_termios = 36;
amd64_x32_linux_record_tdep.size_termios2 = 44;
amd64_x32_linux_record_tdep.size_pid_t = 4;
amd64_x32_linux_record_tdep.size_winsize = 8;
amd64_x32_linux_record_tdep.size_serial_struct = 72;
amd64_x32_linux_record_tdep.size_serial_icounter_struct = 80;
amd64_x32_linux_record_tdep.size_hayes_esp_config = 12;
amd64_x32_linux_record_tdep.size_size_t = 4;
amd64_x32_linux_record_tdep.size_iovec = 8;
amd64_x32_linux_record_tdep.size_time_t = 8;
/* These values are the second argument of system call "sys_fcntl"
and "sys_fcntl64". They are obtained from Linux Kernel source. */
amd64_x32_linux_record_tdep.fcntl_F_GETLK = 5;
amd64_x32_linux_record_tdep.fcntl_F_GETLK64 = 12;
amd64_x32_linux_record_tdep.fcntl_F_SETLK64 = 13;
amd64_x32_linux_record_tdep.fcntl_F_SETLKW64 = 14;
amd64_x32_linux_record_tdep.arg1 = AMD64_RDI_REGNUM;
amd64_x32_linux_record_tdep.arg2 = AMD64_RSI_REGNUM;
amd64_x32_linux_record_tdep.arg3 = AMD64_RDX_REGNUM;
amd64_x32_linux_record_tdep.arg4 = AMD64_R10_REGNUM;
amd64_x32_linux_record_tdep.arg5 = AMD64_R8_REGNUM;
amd64_x32_linux_record_tdep.arg6 = AMD64_R9_REGNUM;
/* These values are the second argument of system call "sys_ioctl".
They are obtained from Linux Kernel source. */
amd64_x32_linux_record_tdep.ioctl_TCGETS = 0x5401;
amd64_x32_linux_record_tdep.ioctl_TCSETS = 0x5402;
amd64_x32_linux_record_tdep.ioctl_TCSETSW = 0x5403;
amd64_x32_linux_record_tdep.ioctl_TCSETSF = 0x5404;
amd64_x32_linux_record_tdep.ioctl_TCGETA = 0x5405;
amd64_x32_linux_record_tdep.ioctl_TCSETA = 0x5406;
amd64_x32_linux_record_tdep.ioctl_TCSETAW = 0x5407;
amd64_x32_linux_record_tdep.ioctl_TCSETAF = 0x5408;
amd64_x32_linux_record_tdep.ioctl_TCSBRK = 0x5409;
amd64_x32_linux_record_tdep.ioctl_TCXONC = 0x540A;
amd64_x32_linux_record_tdep.ioctl_TCFLSH = 0x540B;
amd64_x32_linux_record_tdep.ioctl_TIOCEXCL = 0x540C;
amd64_x32_linux_record_tdep.ioctl_TIOCNXCL = 0x540D;
amd64_x32_linux_record_tdep.ioctl_TIOCSCTTY = 0x540E;
amd64_x32_linux_record_tdep.ioctl_TIOCGPGRP = 0x540F;
amd64_x32_linux_record_tdep.ioctl_TIOCSPGRP = 0x5410;
amd64_x32_linux_record_tdep.ioctl_TIOCOUTQ = 0x5411;
amd64_x32_linux_record_tdep.ioctl_TIOCSTI = 0x5412;
amd64_x32_linux_record_tdep.ioctl_TIOCGWINSZ = 0x5413;
amd64_x32_linux_record_tdep.ioctl_TIOCSWINSZ = 0x5414;
amd64_x32_linux_record_tdep.ioctl_TIOCMGET = 0x5415;
amd64_x32_linux_record_tdep.ioctl_TIOCMBIS = 0x5416;
amd64_x32_linux_record_tdep.ioctl_TIOCMBIC = 0x5417;
amd64_x32_linux_record_tdep.ioctl_TIOCMSET = 0x5418;
amd64_x32_linux_record_tdep.ioctl_TIOCGSOFTCAR = 0x5419;
amd64_x32_linux_record_tdep.ioctl_TIOCSSOFTCAR = 0x541A;
amd64_x32_linux_record_tdep.ioctl_FIONREAD = 0x541B;
amd64_x32_linux_record_tdep.ioctl_TIOCINQ = amd64_x32_linux_record_tdep.ioctl_FIONREAD;
amd64_x32_linux_record_tdep.ioctl_TIOCLINUX = 0x541C;
amd64_x32_linux_record_tdep.ioctl_TIOCCONS = 0x541D;
amd64_x32_linux_record_tdep.ioctl_TIOCGSERIAL = 0x541E;
amd64_x32_linux_record_tdep.ioctl_TIOCSSERIAL = 0x541F;
amd64_x32_linux_record_tdep.ioctl_TIOCPKT = 0x5420;
amd64_x32_linux_record_tdep.ioctl_FIONBIO = 0x5421;
amd64_x32_linux_record_tdep.ioctl_TIOCNOTTY = 0x5422;
amd64_x32_linux_record_tdep.ioctl_TIOCSETD = 0x5423;
amd64_x32_linux_record_tdep.ioctl_TIOCGETD = 0x5424;
amd64_x32_linux_record_tdep.ioctl_TCSBRKP = 0x5425;
amd64_x32_linux_record_tdep.ioctl_TIOCTTYGSTRUCT = 0x5426;
amd64_x32_linux_record_tdep.ioctl_TIOCSBRK = 0x5427;
amd64_x32_linux_record_tdep.ioctl_TIOCCBRK = 0x5428;
amd64_x32_linux_record_tdep.ioctl_TIOCGSID = 0x5429;
amd64_x32_linux_record_tdep.ioctl_TCGETS2 = 0x802c542a;
amd64_x32_linux_record_tdep.ioctl_TCSETS2 = 0x402c542b;
amd64_x32_linux_record_tdep.ioctl_TCSETSW2 = 0x402c542c;
amd64_x32_linux_record_tdep.ioctl_TCSETSF2 = 0x402c542d;
amd64_x32_linux_record_tdep.ioctl_TIOCGPTN = 0x80045430;
amd64_x32_linux_record_tdep.ioctl_TIOCSPTLCK = 0x40045431;
amd64_x32_linux_record_tdep.ioctl_FIONCLEX = 0x5450;
amd64_x32_linux_record_tdep.ioctl_FIOCLEX = 0x5451;
amd64_x32_linux_record_tdep.ioctl_FIOASYNC = 0x5452;
amd64_x32_linux_record_tdep.ioctl_TIOCSERCONFIG = 0x5453;
amd64_x32_linux_record_tdep.ioctl_TIOCSERGWILD = 0x5454;
amd64_x32_linux_record_tdep.ioctl_TIOCSERSWILD = 0x5455;
amd64_x32_linux_record_tdep.ioctl_TIOCGLCKTRMIOS = 0x5456;
amd64_x32_linux_record_tdep.ioctl_TIOCSLCKTRMIOS = 0x5457;
amd64_x32_linux_record_tdep.ioctl_TIOCSERGSTRUCT = 0x5458;
amd64_x32_linux_record_tdep.ioctl_TIOCSERGETLSR = 0x5459;
amd64_x32_linux_record_tdep.ioctl_TIOCSERGETMULTI = 0x545A;
amd64_x32_linux_record_tdep.ioctl_TIOCSERSETMULTI = 0x545B;
amd64_x32_linux_record_tdep.ioctl_TIOCMIWAIT = 0x545C;
amd64_x32_linux_record_tdep.ioctl_TIOCGICOUNT = 0x545D;
amd64_x32_linux_record_tdep.ioctl_TIOCGHAYESESP = 0x545E;
amd64_x32_linux_record_tdep.ioctl_TIOCSHAYESESP = 0x545F;
amd64_x32_linux_record_tdep.ioctl_FIOQSIZE = 0x5460;
tdep->i386_syscall_record = amd64_x32_linux_syscall_record;
/* GNU/Linux uses SVR4-style shared libraries. */
set_solib_svr4_fetch_link_map_offsets
(gdbarch, svr4_ilp32_fetch_link_map_offsets);
}
gdb: add back declarations for _initialize functions 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 481695ed5f6e0a8a9c9c50bfac1cdd2b3151e6c9 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
2020-01-13 20:01:38 +01:00
void _initialize_amd64_linux_tdep ();
void
gdb: add back declarations for _initialize functions 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 481695ed5f6e0a8a9c9c50bfac1cdd2b3151e6c9 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
2020-01-13 20:01:38 +01:00
_initialize_amd64_linux_tdep ()
{
gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64,
GDB_OSABI_LINUX, amd64_linux_init_abi);
gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x64_32,
GDB_OSABI_LINUX, amd64_x32_linux_init_abi);
}