From c583a2520616c2736cffc389c89a48b159366e6c Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Wed, 8 Feb 2023 15:36:23 -0500 Subject: Run clang-format.sh Change-Id: Ia948cc26d534b0dd02702244d52434b1a2093968 --- gdb/aarch32-linux-nat.c | 8 +- gdb/aarch64-fbsd-nat.c | 48 +- gdb/aarch64-fbsd-tdep.c | 135 +- gdb/aarch64-fbsd-tdep.h | 4 +- gdb/aarch64-linux-nat.c | 114 +- gdb/aarch64-linux-tdep.c | 475 +- gdb/aarch64-linux-tdep.h | 2 +- gdb/aarch64-nat.c | 45 +- gdb/aarch64-nat.h | 36 +- gdb/aarch64-newlib-tdep.c | 1 + gdb/aarch64-ravenscar-thread.c | 98 +- gdb/aarch64-tdep.c | 789 ++-- gdb/aarch64-tdep.h | 59 +- gdb/ada-casefold.h | 1765 ++------ gdb/ada-exp.h | 300 +- gdb/ada-lang.c | 2812 +++++------- gdb/ada-lang.h | 127 +- gdb/ada-tasks.c | 458 +- gdb/ada-typeprint.c | 143 +- gdb/ada-valprint.c | 140 +- gdb/ada-varobj.c | 257 +- gdb/addrmap.c | 126 +- gdb/addrmap.h | 25 +- gdb/agent.c | 30 +- gdb/aix-thread.c | 512 +-- gdb/alloc.c | 8 +- gdb/alpha-bsd-nat.c | 39 +- gdb/alpha-bsd-tdep.c | 4 +- gdb/alpha-bsd-tdep.h | 8 +- gdb/alpha-linux-nat.c | 26 +- gdb/alpha-linux-tdep.c | 99 +- gdb/alpha-mdebug-tdep.c | 45 +- gdb/alpha-netbsd-tdep.c | 82 +- gdb/alpha-obsd-tdep.c | 17 +- gdb/alpha-tdep.c | 355 +- gdb/alpha-tdep.h | 60 +- gdb/amd-dbgapi-target.c | 505 +-- gdb/amd-dbgapi-target.h | 10 +- gdb/amd64-bsd-nat.c | 13 +- gdb/amd64-bsd-nat.h | 9 +- gdb/amd64-darwin-tdep.c | 54 +- gdb/amd64-dicos-tdep.c | 4 +- gdb/amd64-fbsd-nat.c | 83 +- gdb/amd64-fbsd-tdep.c | 245 +- gdb/amd64-linux-nat.c | 154 +- gdb/amd64-linux-tdep.c | 1941 ++++---- gdb/amd64-linux-tdep.h | 6 +- gdb/amd64-nat.c | 9 +- gdb/amd64-netbsd-nat.c | 36 +- gdb/amd64-netbsd-tdep.c | 56 +- gdb/amd64-obsd-nat.c | 37 +- gdb/amd64-obsd-tdep.c | 204 +- gdb/amd64-ravenscar-thread.c | 3 +- gdb/amd64-sol2-tdep.c | 52 +- gdb/amd64-tdep.c | 825 ++-- gdb/amd64-tdep.h | 83 +- gdb/amd64-windows-nat.c | 97 +- gdb/amd64-windows-tdep.c | 312 +- gdb/amdgpu-tdep.c | 434 +- gdb/amdgpu-tdep.h | 8 +- gdb/annotate.c | 17 +- gdb/annotate.h | 1 + gdb/arc-linux-nat.c | 35 +- gdb/arc-linux-tdep.c | 141 +- gdb/arc-linux-tdep.h | 8 +- gdb/arc-newlib-tdep.c | 1 + gdb/arc-tdep.c | 549 ++- gdb/arc-tdep.h | 120 +- gdb/arch-utils.c | 316 +- gdb/arch-utils.h | 82 +- gdb/arch/aarch64-insn.c | 36 +- gdb/arch/aarch64-insn.h | 146 +- gdb/arch/aarch64-mte-linux.h | 6 +- gdb/arch/aarch64.h | 94 +- gdb/arch/arc.c | 26 +- gdb/arch/arc.h | 19 +- gdb/arch/arm-get-next-pcs.c | 162 +- gdb/arch/arm-get-next-pcs.h | 6 +- gdb/arch/arm-linux.c | 11 +- gdb/arch/arm-linux.h | 9 +- gdb/arch/arm.c | 48 +- gdb/arch/arm.h | 172 +- gdb/arch/loongarch.c | 12 +- gdb/arch/loongarch.h | 32 +- gdb/arch/ppc-linux-common.c | 38 +- gdb/arch/ppc-linux-common.h | 28 +- gdb/arch/riscv.c | 8 +- gdb/arch/riscv.h | 25 +- gdb/arch/xtensa.h | 8 +- gdb/arm-bsd-tdep.c | 25 +- gdb/arm-fbsd-nat.c | 1 + gdb/arm-fbsd-tdep.c | 133 +- gdb/arm-fbsd-tdep.h | 23 +- gdb/arm-linux-nat.c | 185 +- gdb/arm-linux-tdep.c | 1437 +++--- gdb/arm-linux-tdep.h | 32 +- gdb/arm-netbsd-nat.c | 55 +- gdb/arm-netbsd-tdep.c | 43 +- gdb/arm-netbsd-tdep.h | 6 +- gdb/arm-none-tdep.c | 56 +- gdb/arm-obsd-tdep.c | 42 +- gdb/arm-pikeos-tdep.c | 8 +- gdb/arm-tdep.c | 2867 ++++++------ gdb/arm-tdep.h | 162 +- gdb/arm-wince-tdep.c | 11 +- gdb/async-event.c | 22 +- gdb/async-event.h | 14 +- gdb/auto-load.c | 365 +- gdb/auto-load.h | 12 +- gdb/auxv.c | 206 +- gdb/auxv.h | 17 +- gdb/avr-tdep.c | 277 +- gdb/ax-gdb.c | 492 +- gdb/ax-gdb.h | 57 +- gdb/ax-general.c | 111 +- gdb/ax.h | 124 +- gdb/bcache.c | 83 +- gdb/bcache.h | 18 +- gdb/bfd-target.c | 35 +- gdb/bfin-linux-tdep.c | 130 +- gdb/bfin-tdep.c | 274 +- gdb/bfin-tdep.h | 8 +- gdb/block.c | 51 +- gdb/block.h | 119 +- gdb/blockframe.c | 22 +- gdb/bpf-tdep.c | 84 +- gdb/break-catch-exec.c | 19 +- gdb/break-catch-fork.c | 52 +- gdb/break-catch-load.c | 53 +- gdb/break-catch-sig.c | 36 +- gdb/break-catch-syscall.c | 57 +- gdb/break-catch-throw.c | 110 +- gdb/breakpoint.c | 2857 ++++++------ gdb/breakpoint.h | 491 +- gdb/bsd-kvm.c | 64 +- gdb/bsd-kvm.h | 4 +- gdb/bsd-uthread.c | 102 +- gdb/bsd-uthread.h | 13 +- gdb/bt-utils.c | 24 +- gdb/bt-utils.h | 25 +- gdb/btrace.c | 534 ++- gdb/btrace.h | 31 +- gdb/build-id.c | 30 +- gdb/build-id.h | 9 +- gdb/buildsym-legacy.c | 6 +- gdb/buildsym-legacy.h | 3 +- gdb/buildsym.c | 217 +- gdb/buildsym.h | 142 +- gdb/c-exp.h | 129 +- gdb/c-lang.c | 280 +- gdb/c-lang.h | 57 +- gdb/c-typeprint.c | 378 +- gdb/c-valprint.c | 91 +- gdb/c-varobj.c | 150 +- gdb/charset-list.h | 1380 +----- gdb/charset.c | 217 +- gdb/charset.h | 42 +- gdb/cli-out.c | 39 +- gdb/cli-out.h | 29 +- gdb/cli/cli-cmds.c | 694 ++- gdb/cli/cli-cmds.h | 8 +- gdb/cli/cli-decode.c | 750 ++- gdb/cli/cli-decode.h | 30 +- gdb/cli/cli-dump.c | 209 +- gdb/cli/cli-interp.c | 144 +- gdb/cli/cli-interp.h | 2 + gdb/cli/cli-logging.c | 130 +- gdb/cli/cli-option.c | 169 +- gdb/cli/cli-option.h | 148 +- gdb/cli/cli-script.c | 235 +- gdb/cli/cli-script.h | 60 +- gdb/cli/cli-setshow.c | 96 +- gdb/cli/cli-setshow.h | 6 +- gdb/cli/cli-style.c | 202 +- gdb/cli/cli-utils.c | 66 +- gdb/cli/cli-utils.h | 21 +- gdb/coff-pe-read.c | 176 +- gdb/coff-pe-read.h | 2 +- gdb/coffread.c | 445 +- gdb/command.h | 674 ++- gdb/compile/compile-c-support.c | 240 +- gdb/compile/compile-c-symbols.c | 137 +- gdb/compile/compile-c-types.c | 107 +- gdb/compile/compile-c.h | 14 +- gdb/compile/compile-cplus-symbols.c | 98 +- gdb/compile/compile-cplus-types.c | 467 +- gdb/compile/compile-cplus.h | 18 +- gdb/compile/compile-internal.h | 14 +- gdb/compile/compile-loc2c.c | 219 +- gdb/compile/compile-object-load.c | 288 +- gdb/compile/compile-object-load.h | 6 +- gdb/compile/compile-object-run.c | 22 +- gdb/compile/compile.c | 182 +- gdb/compile/compile.h | 59 +- gdb/compile/gcc-c-plugin.h | 5 +- gdb/complaints.c | 68 +- gdb/complaints.h | 23 +- gdb/completer.c | 478 +- gdb/completer.h | 136 +- gdb/config/nm-linux.h | 2 +- gdb/copying.c | 1289 ++++-- gdb/corefile.c | 107 +- gdb/corelow.c | 409 +- gdb/cp-abi.c | 86 +- gdb/cp-abi.h | 63 +- gdb/cp-namespace.c | 266 +- gdb/cp-support.c | 429 +- gdb/cp-support.h | 76 +- gdb/cp-valprint.c | 162 +- gdb/cris-linux-tdep.c | 2 +- gdb/cris-tdep.c | 747 ++- gdb/csky-linux-tdep.c | 172 +- gdb/csky-tdep.c | 1454 +++--- gdb/csky-tdep.h | 36 +- gdb/ctfread.c | 565 ++- gdb/d-lang.c | 115 +- gdb/d-lang.h | 13 +- gdb/d-namespace.c | 103 +- gdb/d-valprint.c | 32 +- gdb/darwin-nat-info.c | 320 +- gdb/darwin-nat.c | 611 ++- gdb/darwin-nat.h | 22 +- gdb/dbxread.c | 1177 +++-- gdb/dcache.c | 133 +- gdb/dcache.h | 16 +- gdb/debuginfod-support.c | 170 +- gdb/debuginfod-support.h | 15 +- gdb/defs.h | 247 +- gdb/dicos-tdep.c | 13 +- gdb/dictionary.c | 238 +- gdb/dictionary.h | 29 +- gdb/disasm-flags.h | 22 +- gdb/disasm-selftests.c | 31 +- gdb/disasm.c | 320 +- gdb/disasm.h | 78 +- gdb/displaced-stepping.c | 67 +- gdb/displaced-stepping.h | 33 +- gdb/dtrace-probe.c | 215 +- gdb/dummy-frame.c | 44 +- gdb/dummy-frame.h | 8 +- gdb/dwarf2/abbrev-cache.c | 10 +- gdb/dwarf2/abbrev-cache.h | 1 + gdb/dwarf2/abbrev.c | 15 +- gdb/dwarf2/abbrev.h | 7 +- gdb/dwarf2/attribute.c | 80 +- gdb/dwarf2/attribute.h | 40 +- gdb/dwarf2/call-site.h | 52 +- gdb/dwarf2/comp-unit-head.c | 63 +- gdb/dwarf2/comp-unit-head.h | 43 +- gdb/dwarf2/cooked-index.c | 240 +- gdb/dwarf2/cooked-index.h | 48 +- gdb/dwarf2/cu.c | 11 +- gdb/dwarf2/cu.h | 12 +- gdb/dwarf2/die.h | 16 +- gdb/dwarf2/dwz.c | 29 +- gdb/dwarf2/dwz.h | 34 +- gdb/dwarf2/expr.c | 418 +- gdb/dwarf2/expr.h | 26 +- gdb/dwarf2/file-and-dir.h | 10 +- gdb/dwarf2/frame-tailcall.c | 52 +- gdb/dwarf2/frame-tailcall.h | 10 +- gdb/dwarf2/frame.c | 360 +- gdb/dwarf2/frame.h | 75 +- gdb/dwarf2/index-cache.c | 100 +- gdb/dwarf2/index-cache.h | 12 +- gdb/dwarf2/index-write.c | 364 +- gdb/dwarf2/index-write.h | 7 +- gdb/dwarf2/leb.c | 4 +- gdb/dwarf2/line-header.c | 74 +- gdb/dwarf2/line-header.h | 36 +- gdb/dwarf2/loc.c | 879 ++-- gdb/dwarf2/loc.h | 58 +- gdb/dwarf2/macro.c | 217 +- gdb/dwarf2/macro.h | 3 +- gdb/dwarf2/mapped-index.h | 18 +- gdb/dwarf2/read.c | 5528 +++++++++++------------ gdb/dwarf2/read.h | 90 +- gdb/dwarf2/sect-names.h | 6 +- gdb/dwarf2/section.c | 25 +- gdb/dwarf2/section.h | 1 + gdb/elf-none-tdep.c | 8 +- gdb/elfread.c | 381 +- gdb/eval.c | 633 ++- gdb/event-top.c | 162 +- gdb/event-top.h | 6 +- gdb/exceptions.c | 4 +- gdb/exceptions.h | 4 +- gdb/exec.c | 289 +- gdb/exec.h | 23 +- gdb/expop.h | 982 ++-- gdb/expprint.c | 61 +- gdb/expression.h | 83 +- gdb/extension-priv.h | 46 +- gdb/extension.c | 152 +- gdb/extension.h | 212 +- gdb/f-array-walker.h | 64 +- gdb/f-exp.h | 175 +- gdb/f-lang.c | 430 +- gdb/f-lang.h | 86 +- gdb/f-typeprint.c | 72 +- gdb/f-valprint.c | 138 +- gdb/fbsd-nat.c | 256 +- gdb/fbsd-nat.h | 47 +- gdb/fbsd-tdep.c | 1038 +++-- gdb/fbsd-tdep.h | 15 +- gdb/features/microblaze-with-stack-protect.c | 7 +- gdb/features/microblaze.c | 4 +- gdb/features/mips-dsp-linux.c | 1 + gdb/features/mips-linux.c | 1 + gdb/features/mips64-dsp-linux.c | 1 + gdb/features/mips64-linux.c | 1 + gdb/features/nds32.c | 1 + gdb/features/nios2.c | 1 + gdb/features/or1k-linux.c | 1 + gdb/features/or1k.c | 1 + gdb/features/rx.c | 1 + gdb/features/s390-gs-linux64.c | 1 + gdb/features/s390-linux32.c | 1 + gdb/features/s390-linux32v1.c | 1 + gdb/features/s390-linux32v2.c | 1 + gdb/features/s390-linux64.c | 1 + gdb/features/s390-linux64v1.c | 1 + gdb/features/s390-linux64v2.c | 1 + gdb/features/s390-te-linux64.c | 1 + gdb/features/s390-tevx-linux64.c | 1 + gdb/features/s390-vx-linux64.c | 1 + gdb/features/s390x-gs-linux64.c | 1 + gdb/features/s390x-linux64.c | 1 + gdb/features/s390x-linux64v1.c | 1 + gdb/features/s390x-linux64v2.c | 1 + gdb/features/s390x-te-linux64.c | 1 + gdb/features/s390x-tevx-linux64.c | 1 + gdb/features/s390x-vx-linux64.c | 1 + gdb/features/z80.c | 1 + gdb/filename-seen-cache.c | 7 +- gdb/filename-seen-cache.h | 15 +- gdb/filesystem.c | 37 +- gdb/filesystem.h | 13 +- gdb/findcmd.c | 39 +- gdb/findvar.c | 163 +- gdb/fork-child.c | 31 +- gdb/frame-base.c | 10 +- gdb/frame-base.h | 8 +- gdb/frame-id.h | 7 +- gdb/frame-unwind.c | 30 +- gdb/frame-unwind.h | 24 +- gdb/frame.c | 368 +- gdb/frame.h | 129 +- gdb/frv-linux-tdep.c | 166 +- gdb/frv-tdep.c | 235 +- gdb/frv-tdep.h | 12 +- gdb/ft32-tdep.c | 122 +- gdb/gcore-elf.c | 80 +- gdb/gcore-elf.h | 13 +- gdb/gcore.c | 112 +- gdb/gcore.h | 2 +- gdb/gdb-demangle.c | 85 +- gdb/gdb-stabs.h | 71 +- gdb/gdb_bfd.c | 161 +- gdb/gdb_bfd.h | 40 +- gdb/gdb_curses.h | 14 +- gdb/gdb_expat.h | 4 +- gdb/gdb_wchar.h | 17 +- gdb/gdbarch-gen.h | 1755 ++++--- gdb/gdbarch-selftests.c | 65 +- gdb/gdbarch.c | 2075 ++++----- gdb/gdbarch.h | 66 +- gdb/gdbcmd.h | 20 +- gdb/gdbcore.h | 22 +- gdb/gdbthread.h | 131 +- gdb/gdbtypes.c | 1288 +++--- gdb/gdbtypes.h | 627 ++- gdb/glibc-tdep.c | 8 +- gdb/gmp-utils.c | 28 +- gdb/gmp-utils.h | 18 +- gdb/gnu-nat.c | 1005 ++-- gdb/gnu-nat.h | 95 +- gdb/gnu-v2-abi.c | 74 +- gdb/gnu-v3-abi.c | 206 +- gdb/go-lang.c | 58 +- gdb/go-lang.h | 27 +- gdb/go-valprint.c | 78 +- gdb/go32-nat.c | 915 ++-- gdb/guile/guile-internal.h | 175 +- gdb/guile/guile.c | 210 +- gdb/guile/scm-arch.c | 120 +- gdb/guile/scm-auto-load.c | 14 +- gdb/guile/scm-block.c | 120 +- gdb/guile/scm-breakpoint.c | 294 +- gdb/guile/scm-cmd.c | 157 +- gdb/guile/scm-disasm.c | 72 +- gdb/guile/scm-exception.c | 136 +- gdb/guile/scm-frame.c | 184 +- gdb/guile/scm-gsmob.c | 41 +- gdb/guile/scm-iterator.c | 38 +- gdb/guile/scm-lazy-string.c | 80 +- gdb/guile/scm-math.c | 320 +- gdb/guile/scm-objfile.c | 62 +- gdb/guile/scm-param.c | 388 +- gdb/guile/scm-ports.c | 213 +- gdb/guile/scm-pretty-print.c | 190 +- gdb/guile/scm-progspace.c | 64 +- gdb/guile/scm-safe-call.c | 19 +- gdb/guile/scm-string.c | 33 +- gdb/guile/scm-symbol.c | 146 +- gdb/guile/scm-symtab.c | 77 +- gdb/guile/scm-type.c | 201 +- gdb/guile/scm-utils.c | 102 +- gdb/guile/scm-value.c | 490 +- gdb/h8300-tdep.c | 287 +- gdb/hppa-bsd-tdep.c | 9 +- gdb/hppa-linux-nat.c | 345 +- gdb/hppa-linux-offsets.h | 168 +- gdb/hppa-linux-tdep.c | 128 +- gdb/hppa-netbsd-nat.c | 29 +- gdb/hppa-netbsd-tdep.c | 163 +- gdb/hppa-obsd-nat.c | 27 +- gdb/hppa-obsd-tdep.c | 36 +- gdb/hppa-tdep.c | 666 ++- gdb/hppa-tdep.h | 194 +- gdb/i386-bsd-nat.c | 86 +- gdb/i386-bsd-nat.h | 9 +- gdb/i386-bsd-tdep.c | 38 +- gdb/i386-darwin-nat.c | 102 +- gdb/i386-darwin-tdep.c | 59 +- gdb/i386-dicos-tdep.c | 1 + gdb/i386-fbsd-nat.c | 50 +- gdb/i386-fbsd-tdep.c | 286 +- gdb/i386-gnu-nat.c | 61 +- gdb/i386-gnu-tdep.c | 112 +- gdb/i386-go32-tdep.c | 3 +- gdb/i386-linux-nat.c | 146 +- gdb/i386-linux-tdep.c | 271 +- gdb/i386-linux-tdep.h | 2 +- gdb/i386-netbsd-nat.c | 3 +- gdb/i386-netbsd-tdep.c | 545 ++- gdb/i386-nto-tdep.c | 55 +- gdb/i386-obsd-nat.c | 7 +- gdb/i386-obsd-tdep.c | 226 +- gdb/i386-sol2-nat.c | 120 +- gdb/i386-sol2-tdep.c | 41 +- gdb/i386-tdep.c | 2392 +++++----- gdb/i386-tdep.h | 144 +- gdb/i386-windows-nat.c | 82 +- gdb/i386-windows-tdep.c | 27 +- gdb/i387-tdep.c | 536 +-- gdb/i387-tdep.h | 22 +- gdb/ia64-libunwind-tdep.c | 110 +- gdb/ia64-libunwind-tdep.h | 13 +- gdb/ia64-linux-nat.c | 939 ++-- gdb/ia64-linux-tdep.c | 128 +- gdb/ia64-tdep.c | 1271 +++--- gdb/ia64-tdep.h | 284 +- gdb/ia64-vms-tdep.c | 24 +- gdb/inf-child.c | 26 +- gdb/inf-child.h | 27 +- gdb/inf-loop.c | 2 +- gdb/inf-loop.h | 2 +- gdb/inf-ptrace.c | 71 +- gdb/inf-ptrace.h | 30 +- gdb/infcall.c | 403 +- gdb/infcall.h | 11 +- gdb/infcmd.c | 602 ++- gdb/inferior-iter.h | 20 +- gdb/inferior.c | 163 +- gdb/inferior.h | 114 +- gdb/inflow.c | 38 +- gdb/infrun.c | 1317 +++--- gdb/infrun.h | 26 +- gdb/inline-frame.c | 75 +- gdb/inline-frame.h | 2 +- gdb/interps.c | 56 +- gdb/interps.h | 42 +- gdb/iq2000-tdep.c | 255 +- gdb/jit.c | 278 +- gdb/jit.h | 3 +- gdb/language.c | 306 +- gdb/language.h | 245 +- gdb/linespec.c | 775 ++-- gdb/linespec.h | 36 +- gdb/linux-fork.c | 106 +- gdb/linux-nat-trad.c | 24 +- gdb/linux-nat-trad.h | 8 +- gdb/linux-nat.c | 562 ++- gdb/linux-nat.h | 69 +- gdb/linux-record.c | 295 +- gdb/linux-record.h | 5 +- gdb/linux-tdep.c | 756 ++-- gdb/linux-tdep.h | 22 +- gdb/linux-thread-db.c | 387 +- gdb/lm32-tdep.c | 102 +- gdb/location.c | 115 +- gdb/location.h | 55 +- gdb/loongarch-linux-nat.c | 87 +- gdb/loongarch-linux-tdep.c | 171 +- gdb/loongarch-tdep.c | 417 +- gdb/m2-exp.h | 30 +- gdb/m2-lang.c | 59 +- gdb/m2-lang.h | 32 +- gdb/m2-typeprint.c | 141 +- gdb/m2-valprint.c | 149 +- gdb/m32c-tdep.c | 766 ++-- gdb/m32r-linux-nat.c | 40 +- gdb/m32r-linux-tdep.c | 183 +- gdb/m32r-tdep.c | 150 +- gdb/m68hc11-tdep.c | 372 +- gdb/m68k-bsd-nat.c | 22 +- gdb/m68k-bsd-tdep.c | 39 +- gdb/m68k-linux-nat.c | 115 +- gdb/m68k-linux-tdep.c | 308 +- gdb/m68k-tdep.c | 186 +- gdb/m68k-tdep.h | 43 +- gdb/machoread.c | 197 +- gdb/macrocmd.c | 128 +- gdb/macroexp.c | 313 +- gdb/macroexp.h | 2 - gdb/macroscope.c | 18 +- gdb/macroscope.h | 10 +- gdb/macrotab.c | 194 +- gdb/macrotab.h | 42 +- gdb/main.c | 368 +- gdb/maint-test-options.c | 140 +- gdb/maint-test-settings.c | 129 +- gdb/maint.c | 456 +- gdb/maint.h | 4 +- gdb/mdebugread.c | 1051 ++--- gdb/mdebugread.h | 9 +- gdb/mem-break.c | 6 +- gdb/memattr.c | 119 +- gdb/memattr.h | 47 +- gdb/memory-map.c | 83 +- gdb/memory-map.h | 1 - gdb/memrange.c | 10 +- gdb/memrange.h | 15 +- gdb/memtag.c | 11 +- gdb/mep-tdep.c | 726 ++- gdb/mi/mi-cmd-break.c | 183 +- gdb/mi/mi-cmd-catch.c | 149 +- gdb/mi/mi-cmd-disas.c | 86 +- gdb/mi/mi-cmd-env.c | 45 +- gdb/mi/mi-cmd-file.c | 35 +- gdb/mi/mi-cmd-info.c | 9 +- gdb/mi/mi-cmd-stack.c | 256 +- gdb/mi/mi-cmd-target.c | 22 +- gdb/mi/mi-cmd-var.c | 125 +- gdb/mi/mi-cmds.c | 42 +- gdb/mi/mi-cmds.h | 18 +- gdb/mi/mi-common.c | 44 +- gdb/mi/mi-console.c | 3 +- gdb/mi/mi-console.h | 2 + gdb/mi/mi-getopt.c | 22 +- gdb/mi/mi-getopt.h | 16 +- gdb/mi/mi-interp.c | 758 ++-- gdb/mi/mi-interp.h | 4 +- gdb/mi/mi-main.c | 511 +-- gdb/mi/mi-main.h | 3 +- gdb/mi/mi-out.c | 26 +- gdb/mi/mi-out.h | 39 +- gdb/mi/mi-parse.c | 109 +- gdb/mi/mi-parse.h | 53 +- gdb/mi/mi-symbol-cmds.c | 115 +- gdb/microblaze-linux-tdep.c | 41 +- gdb/microblaze-tdep.c | 281 +- gdb/microblaze-tdep.h | 21 +- gdb/mingw-hdep.c | 51 +- gdb/minidebug.c | 40 +- gdb/minsyms.c | 351 +- gdb/minsyms.h | 47 +- gdb/mips-fbsd-nat.c | 16 +- gdb/mips-fbsd-tdep.c | 222 +- gdb/mips-linux-nat.c | 167 +- gdb/mips-linux-tdep.c | 582 ++- gdb/mips-linux-tdep.h | 104 +- gdb/mips-netbsd-nat.c | 23 +- gdb/mips-netbsd-tdep.c | 92 +- gdb/mips-sde-tdep.c | 65 +- gdb/mips-tdep.c | 2322 +++++----- gdb/mips-tdep.h | 100 +- gdb/mips64-obsd-nat.c | 16 +- gdb/mips64-obsd-tdep.c | 62 +- gdb/mipsread.c | 103 +- gdb/mn10300-linux-tdep.c | 735 ++- gdb/mn10300-tdep.c | 226 +- gdb/mn10300-tdep.h | 23 +- gdb/moxie-tdep.c | 218 +- gdb/msp430-tdep.c | 131 +- gdb/namespace.c | 16 +- gdb/namespace.h | 9 +- gdb/nat/aarch64-hw-point.c | 81 +- gdb/nat/aarch64-hw-point.h | 8 +- gdb/nat/aarch64-linux-hw-point.c | 51 +- gdb/nat/aarch64-linux-hw-point.h | 44 +- gdb/nat/aarch64-linux.c | 7 +- gdb/nat/aarch64-linux.h | 9 +- gdb/nat/aarch64-mte-linux-ptrace.c | 30 +- gdb/nat/aarch64-mte-linux-ptrace.h | 4 +- gdb/nat/aarch64-sve-linux-ptrace.c | 24 +- gdb/nat/aarch64-sve-linux-ptrace.h | 5 +- gdb/nat/aarch64-sve-linux-sigcontext.h | 151 +- gdb/nat/amd64-linux-siginfo.c | 17 +- gdb/nat/amd64-linux-siginfo.h | 7 +- gdb/nat/fork-inferior.c | 106 +- gdb/nat/fork-inferior.h | 27 +- gdb/nat/gdb_ptrace.h | 80 +- gdb/nat/gdb_thread_db.h | 13 +- gdb/nat/glibc_thread_db.h | 184 +- gdb/nat/linux-btrace.c | 82 +- gdb/nat/linux-btrace.h | 6 +- gdb/nat/linux-namespaces.c | 187 +- gdb/nat/linux-namespaces.h | 32 +- gdb/nat/linux-nat.h | 6 +- gdb/nat/linux-osdata.c | 473 +- gdb/nat/linux-personality.c | 19 +- gdb/nat/linux-procfs.c | 15 +- gdb/nat/linux-ptrace.c | 106 +- gdb/nat/linux-ptrace.h | 71 +- gdb/nat/linux-waitpid.c | 3 +- gdb/nat/mips-linux-watch.c | 21 +- gdb/nat/mips-linux-watch.h | 12 +- gdb/nat/netbsd-nat.c | 86 +- gdb/nat/netbsd-nat.h | 2 +- gdb/nat/ppc-linux.h | 2 +- gdb/nat/riscv-linux-tdesc.c | 10 +- gdb/nat/windows-nat.c | 224 +- gdb/nat/windows-nat.h | 94 +- gdb/nat/x86-cpuid.h | 10 +- gdb/nat/x86-dregs.c | 376 +- gdb/nat/x86-dregs.h | 43 +- gdb/nat/x86-gcc-cpuid.h | 236 +- gdb/nat/x86-linux-dregs.c | 22 +- gdb/nat/x86-linux.h | 3 +- gdb/nds32-tdep.c | 496 +- gdb/nds32-tdep.h | 12 +- gdb/netbsd-nat.c | 156 +- gdb/netbsd-nat.h | 10 +- gdb/netbsd-tdep.c | 140 +- gdb/netbsd-tdep.h | 4 +- gdb/nios2-linux-tdep.c | 78 +- gdb/nios2-tdep.c | 327 +- gdb/nios2-tdep.h | 22 +- gdb/nto-procfs.c | 218 +- gdb/nto-tdep.c | 89 +- gdb/nto-tdep.h | 26 +- gdb/objc-lang.c | 559 ++- gdb/objc-lang.h | 11 +- gdb/objfile-flags.h | 38 +- gdb/objfiles.c | 139 +- gdb/objfiles.h | 151 +- gdb/obsd-nat.c | 22 +- gdb/obsd-nat.h | 4 +- gdb/obsd-tdep.c | 79 +- gdb/observable.c | 18 +- gdb/observable.h | 80 +- gdb/opencl-lang.c | 300 +- gdb/or1k-linux-nat.c | 31 +- gdb/or1k-linux-tdep.c | 71 +- gdb/or1k-tdep.c | 186 +- gdb/or1k-tdep.h | 43 +- gdb/osabi.c | 178 +- gdb/osabi.h | 12 +- gdb/osdata.c | 120 +- gdb/osdata.h | 11 +- gdb/p-lang.c | 37 +- gdb/p-lang.h | 60 +- gdb/p-typeprint.c | 148 +- gdb/p-valprint.c | 204 +- gdb/pager.h | 6 +- gdb/parse.c | 150 +- gdb/parser-defs.h | 127 +- gdb/posix-hdep.c | 2 +- gdb/ppc-fbsd-nat.c | 30 +- gdb/ppc-fbsd-tdep.c | 157 +- gdb/ppc-linux-nat.c | 630 ++- gdb/ppc-linux-tdep.c | 890 ++-- gdb/ppc-linux-tdep.h | 7 +- gdb/ppc-netbsd-nat.c | 43 +- gdb/ppc-netbsd-tdep.c | 94 +- gdb/ppc-obsd-nat.c | 45 +- gdb/ppc-obsd-tdep.c | 80 +- gdb/ppc-obsd-tdep.h | 1 - gdb/ppc-ravenscar-thread.c | 70 +- gdb/ppc-sysv-tdep.c | 386 +- gdb/ppc-tdep.h | 301 +- gdb/ppc64-tdep.c | 602 ++- gdb/printcmd.c | 731 ++- gdb/probe.c | 183 +- gdb/probe.h | 100 +- gdb/proc-api.c | 370 +- gdb/proc-events.c | 38 +- gdb/proc-flags.c | 12 +- gdb/proc-service.c | 24 +- gdb/proc-utils.h | 36 +- gdb/proc-why.c | 60 +- gdb/process-stratum-target.c | 54 +- gdb/process-stratum-target.h | 12 +- gdb/procfs.c | 1025 +++-- gdb/producer.c | 48 +- gdb/progspace-and-thread.h | 1 - gdb/progspace.c | 36 +- gdb/progspace.h | 71 +- gdb/prologue-value.c | 98 +- gdb/prologue-value.h | 38 +- gdb/psympriv.h | 153 +- gdb/psymtab.c | 404 +- gdb/psymtab.h | 7 +- gdb/python/py-arch.c | 161 +- gdb/python/py-auto-load.c | 25 +- gdb/python/py-block.c | 234 +- gdb/python/py-bpevent.c | 11 +- gdb/python/py-breakpoint.c | 509 +-- gdb/python/py-cmd.c | 228 +- gdb/python/py-connection.c | 268 +- gdb/python/py-dap.c | 26 +- gdb/python/py-disasm.c | 362 +- gdb/python/py-event.c | 98 +- gdb/python/py-event.h | 22 +- gdb/python/py-events.h | 6 +- gdb/python/py-evtregistry.c | 86 +- gdb/python/py-evts.c | 22 +- gdb/python/py-exitedevent.c | 10 +- gdb/python/py-finishbreakpoint.c | 160 +- gdb/python/py-frame.c | 190 +- gdb/python/py-framefilter.c | 190 +- gdb/python/py-function.c | 95 +- gdb/python/py-gdb-readline.c | 1 - gdb/python/py-inferior.c | 211 +- gdb/python/py-infevents.c | 6 +- gdb/python/py-infthread.c | 180 +- gdb/python/py-instruction.c | 23 +- gdb/python/py-lazy-string.c | 94 +- gdb/python/py-linetable.c | 306 +- gdb/python/py-membuf.c | 99 +- gdb/python/py-micmd.c | 167 +- gdb/python/py-newobjfileevent.c | 18 +- gdb/python/py-objfile.c | 354 +- gdb/python/py-param.c | 410 +- gdb/python/py-prettyprint.c | 173 +- gdb/python/py-progspace.c | 194 +- gdb/python/py-record-btrace.c | 177 +- gdb/python/py-record-btrace.h | 3 +- gdb/python/py-record.c | 231 +- gdb/python/py-record.h | 16 +- gdb/python/py-ref.h | 16 +- gdb/python/py-registers.c | 349 +- gdb/python/py-signalevent.c | 6 +- gdb/python/py-stopevent.c | 13 +- gdb/python/py-stopevent.h | 3 +- gdb/python/py-symbol.c | 248 +- gdb/python/py-symtab.c | 249 +- gdb/python/py-threadevent.c | 8 +- gdb/python/py-tui.c | 186 +- gdb/python/py-type.c | 529 +-- gdb/python/py-unwind.c | 291 +- gdb/python/py-utils.c | 61 +- gdb/python/py-value.c | 417 +- gdb/python/py-varobj.c | 22 +- gdb/python/py-xmethods.c | 72 +- gdb/python/python-internal.h | 355 +- gdb/python/python.c | 619 ++- gdb/quick-symbol.h | 75 +- gdb/ravenscar-thread.c | 92 +- gdb/ravenscar-thread.h | 16 +- gdb/record-btrace.c | 408 +- gdb/record-full.c | 642 ++- gdb/record.c | 142 +- gdb/record.h | 11 +- gdb/regcache-dump.c | 75 +- gdb/regcache.c | 262 +- gdb/regcache.h | 111 +- gdb/regformats/regdef.h | 17 +- gdb/reggroups.c | 34 +- gdb/reggroups.h | 15 +- gdb/registry.h | 36 +- gdb/regset.h | 9 +- gdb/remote-fileio.c | 263 +- gdb/remote-fileio.h | 13 +- gdb/remote-notif.c | 41 +- gdb/remote-notif.h | 14 +- gdb/remote-sim.c | 194 +- gdb/remote.c | 2542 +++++------ gdb/remote.h | 11 +- gdb/reverse.c | 61 +- gdb/riscv-fbsd-nat.c | 7 +- gdb/riscv-fbsd-tdep.c | 115 +- gdb/riscv-fbsd-tdep.h | 2 +- gdb/riscv-linux-nat.c | 91 +- gdb/riscv-linux-tdep.c | 81 +- gdb/riscv-none-tdep.c | 60 +- gdb/riscv-tdep.c | 905 ++-- gdb/riscv-tdep.h | 38 +- gdb/rl78-tdep.c | 690 ++- gdb/rs6000-aix-nat.c | 167 +- gdb/rs6000-aix-tdep.c | 273 +- gdb/rs6000-aix-tdep.h | 6 +- gdb/rs6000-lynx178-tdep.c | 32 +- gdb/rs6000-tdep.c | 4397 +++++++++--------- gdb/run-on-main-thread.c | 1 + gdb/rust-exp.h | 90 +- gdb/rust-lang.c | 364 +- gdb/rust-lang.h | 55 +- gdb/rust-parse.c | 350 +- gdb/rx-tdep.c | 177 +- gdb/s12z-tdep.c | 220 +- gdb/s390-linux-nat.c | 308 +- gdb/s390-linux-tdep.c | 389 +- gdb/s390-linux-tdep.h | 10 +- gdb/s390-tdep.c | 2446 +++++----- gdb/s390-tdep.h | 175 +- gdb/scoped-mock-context.h | 11 +- gdb/selftest-arch.c | 30 +- gdb/selftest-arch.h | 6 +- gdb/sentinel-frame.c | 16 +- gdb/sentinel-frame.h | 2 +- gdb/ser-base.c | 38 +- gdb/ser-base.h | 2 +- gdb/ser-event.c | 17 +- gdb/ser-go32.c | 415 +- gdb/ser-mingw.c | 293 +- gdb/ser-pipe.c | 58 +- gdb/ser-tcp.c | 129 +- gdb/ser-uds.c | 58 +- gdb/ser-unix.c | 195 +- gdb/ser-unix.h | 2 +- gdb/serial.c | 98 +- gdb/serial.h | 137 +- gdb/sh-linux-tdep.c | 143 +- gdb/sh-netbsd-nat.c | 31 +- gdb/sh-netbsd-tdep.c | 54 +- gdb/sh-tdep.c | 650 ++- gdb/sh-tdep.h | 124 +- gdb/sim-regno.h | 3 +- gdb/skip.c | 188 +- gdb/skip.h | 2 +- gdb/sol-thread.c | 353 +- gdb/sol2-tdep.c | 9 +- gdb/solib-aix.c | 155 +- gdb/solib-darwin.c | 65 +- gdb/solib-dsbt.c | 182 +- gdb/solib-frv.c | 160 +- gdb/solib-rocm.c | 92 +- gdb/solib-svr4.c | 543 ++- gdb/solib-svr4.h | 52 +- gdb/solib-target.c | 124 +- gdb/solib.c | 369 +- gdb/solib.h | 19 +- gdb/solist.h | 17 +- gdb/source-cache.c | 60 +- gdb/source-cache.h | 11 +- gdb/source.c | 357 +- gdb/source.h | 43 +- gdb/sparc-linux-nat.c | 14 +- gdb/sparc-linux-tdep.c | 145 +- gdb/sparc-nat.c | 54 +- gdb/sparc-nat.h | 46 +- gdb/sparc-netbsd-nat.c | 1 + gdb/sparc-netbsd-tdep.c | 82 +- gdb/sparc-obsd-tdep.c | 47 +- gdb/sparc-ravenscar-thread.c | 14 +- gdb/sparc-sol2-nat.c | 4 +- gdb/sparc-sol2-tdep.c | 107 +- gdb/sparc-tdep.c | 321 +- gdb/sparc-tdep.h | 91 +- gdb/sparc64-fbsd-nat.c | 2 +- gdb/sparc64-fbsd-tdep.c | 101 +- gdb/sparc64-linux-nat.c | 40 +- gdb/sparc64-linux-tdep.c | 132 +- gdb/sparc64-nat.c | 7 +- gdb/sparc64-netbsd-nat.c | 28 +- gdb/sparc64-netbsd-tdep.c | 84 +- gdb/sparc64-obsd-nat.c | 12 +- gdb/sparc64-obsd-tdep.c | 160 +- gdb/sparc64-sol2-tdep.c | 105 +- gdb/sparc64-tdep.c | 360 +- gdb/sparc64-tdep.h | 74 +- gdb/split-name.c | 7 +- gdb/stabsread.c | 639 ++- gdb/stabsread.h | 71 +- gdb/stack.c | 842 ++-- gdb/stack.h | 8 +- gdb/stap-probe.c | 229 +- gdb/stap-probe.h | 5 +- gdb/std-regs.c | 16 +- gdb/stub-termcap.c | 26 +- gdb/stubs/i386-stub.c | 472 +- gdb/stubs/ia64vms-stub.c | 663 ++- gdb/stubs/m32r-stub.c | 426 +- gdb/stubs/m68k-stub.c | 248 +- gdb/stubs/sh-stub.c | 1088 ++--- gdb/stubs/sparc-stub.c | 333 +- gdb/stubs/z80-stub.c | 578 +-- gdb/symfile-add-flags.h | 30 +- gdb/symfile-debug.c | 249 +- gdb/symfile-mem.c | 50 +- gdb/symfile.c | 742 ++- gdb/symfile.h | 67 +- gdb/symmisc.c | 248 +- gdb/symtab.c | 1676 ++++--- gdb/symtab.h | 637 +-- gdb/target-connection.c | 8 +- gdb/target-dcache.c | 40 +- gdb/target-debug.h | 122 +- gdb/target-delegates.c | 1532 ++++--- gdb/target-descriptions.c | 404 +- gdb/target-descriptions.h | 50 +- gdb/target-float.c | 861 ++-- gdb/target-float.h | 21 +- gdb/target-memory.c | 45 +- gdb/target.c | 763 ++-- gdb/target.h | 1263 +++--- gdb/target/target.c | 34 +- gdb/target/target.h | 20 +- gdb/target/waitstatus.c | 12 +- gdb/target/waitstatus.h | 57 +- gdb/terminal.h | 2 +- gdb/test-target.c | 7 +- gdb/test-target.h | 27 +- gdb/thread-fsm.h | 24 +- gdb/thread-iter.c | 7 +- gdb/thread-iter.h | 82 +- gdb/thread.c | 307 +- gdb/tic6x-linux-tdep.c | 64 +- gdb/tic6x-tdep.c | 214 +- gdb/tic6x-tdep.h | 8 +- gdb/tid-parse.c | 38 +- gdb/tid-parse.h | 23 +- gdb/tilegx-linux-nat.c | 41 +- gdb/tilegx-linux-tdep.c | 49 +- gdb/tilegx-tdep.c | 280 +- gdb/tilegx-tdep.h | 149 +- gdb/top.c | 563 ++- gdb/top.h | 19 +- gdb/tracectf.c | 432 +- gdb/tracefile-tfile.c | 215 +- gdb/tracefile.c | 122 +- gdb/tracefile.h | 28 +- gdb/tracepoint.c | 991 ++-- gdb/tracepoint.h | 95 +- gdb/trad-frame.c | 16 +- gdb/trad-frame.h | 37 +- gdb/tramp-frame.c | 24 +- gdb/tramp-frame.h | 13 +- gdb/tui/tui-command.h | 27 +- gdb/tui/tui-data.c | 10 - gdb/tui/tui-data.h | 76 +- gdb/tui/tui-disasm.c | 31 +- gdb/tui/tui-disasm.h | 8 +- gdb/tui/tui-file.h | 4 +- gdb/tui/tui-hooks.c | 22 +- gdb/tui/tui-interp.c | 8 +- gdb/tui/tui-io.c | 51 +- gdb/tui/tui-layout.c | 171 +- gdb/tui/tui-layout.h | 35 +- gdb/tui/tui-location.c | 5 +- gdb/tui/tui-location.h | 20 +- gdb/tui/tui-out.h | 14 +- gdb/tui/tui-regs.c | 48 +- gdb/tui/tui-regs.h | 18 +- gdb/tui/tui-source.c | 17 +- gdb/tui/tui-source.h | 12 +- gdb/tui/tui-stack.c | 55 +- gdb/tui/tui-stack.h | 41 +- gdb/tui/tui-win.c | 397 +- gdb/tui/tui-wingeneral.c | 27 +- gdb/tui/tui-winsource.c | 62 +- gdb/tui/tui-winsource.h | 47 +- gdb/tui/tui.c | 74 +- gdb/tui/tui.h | 7 +- gdb/type-stack.c | 29 +- gdb/type-stack.h | 45 +- gdb/typeprint.c | 196 +- gdb/typeprint.h | 10 +- gdb/ui-file.c | 51 +- gdb/ui-file.h | 109 +- gdb/ui-out.c | 178 +- gdb/ui-out.h | 117 +- gdb/ui-style.c | 34 +- gdb/ui-style.h | 55 +- gdb/unittests/array-view-selftests.c | 176 +- gdb/unittests/child-path-selftests.c | 15 +- gdb/unittests/cli-utils-selftests.c | 14 +- gdb/unittests/command-def-selftests.c | 64 +- gdb/unittests/common-utils-selftests.c | 17 +- gdb/unittests/copy_bitwise-selftests.c | 32 +- gdb/unittests/enum-flags-selftests.c | 204 +- gdb/unittests/environ-selftests.c | 11 +- gdb/unittests/filtered_iterator-selftests.c | 34 +- gdb/unittests/format_pieces-selftests.c | 99 +- gdb/unittests/frame_info_ptr-selftests.c | 8 +- gdb/unittests/function-view-selftests.c | 49 +- gdb/unittests/gdb_tilde_expand-selftests.c | 21 +- gdb/unittests/gmp-utils-selftests.c | 55 +- gdb/unittests/intrusive_list-selftests.c | 152 +- gdb/unittests/lookup_name_info-selftests.c | 42 +- gdb/unittests/main-thread-selftests.c | 24 +- gdb/unittests/memory-map-selftests.c | 13 +- gdb/unittests/memrange-selftests.c | 13 +- gdb/unittests/mkdir-recursive-selftests.c | 22 +- gdb/unittests/observable-selftests.c | 91 +- gdb/unittests/offset-type-selftests.c | 65 +- gdb/unittests/optional-selftests.c | 7 +- gdb/unittests/packed-selftests.c | 9 +- gdb/unittests/parallel-for-selftests.c | 96 +- gdb/unittests/parse-connection-spec-selftests.c | 195 +- gdb/unittests/path-join-selftests.c | 16 +- gdb/unittests/ptid-selftests.c | 10 +- gdb/unittests/rsp-low-selftests.c | 16 +- gdb/unittests/scoped_fd-selftests.c | 12 +- gdb/unittests/scoped_ignore_signal-selftests.c | 28 +- gdb/unittests/scoped_mmap-selftests.c | 23 +- gdb/unittests/scoped_restore-selftests.c | 16 +- gdb/unittests/search-memory-selftests.c | 44 +- gdb/unittests/string_view-selftests.c | 7 +- gdb/unittests/style-selftests.c | 10 +- gdb/unittests/tracepoint-selftests.c | 13 +- gdb/unittests/tui-selftests.c | 7 +- gdb/unittests/ui-file-selftests.c | 22 +- gdb/unittests/unique_xmalloc_ptr_char.c | 11 +- gdb/unittests/unpack-selftests.c | 19 +- gdb/unittests/utils-selftests.c | 24 +- gdb/unittests/vec-utils-selftests.c | 23 +- gdb/unittests/xml-utils-selftests.c | 20 +- gdb/user-regs.c | 6 +- gdb/user-regs.h | 5 +- gdb/utils.c | 653 ++- gdb/utils.h | 56 +- gdb/v850-tdep.c | 1234 +++-- gdb/valarith.c | 323 +- gdb/valops.c | 1151 +++-- gdb/valprint.c | 929 ++-- gdb/valprint.h | 80 +- gdb/value.c | 537 +-- gdb/value.h | 212 +- gdb/varobj.c | 224 +- gdb/varobj.h | 86 +- gdb/vax-bsd-nat.c | 17 +- gdb/vax-netbsd-tdep.c | 5 +- gdb/vax-tdep.c | 82 +- gdb/vax-tdep.h | 10 +- gdb/windows-nat.c | 684 ++- gdb/windows-nat.h | 1 - gdb/windows-tdep.c | 346 +- gdb/windows-tdep.h | 2 +- gdb/x86-bsd-nat.c | 12 +- gdb/x86-bsd-nat.h | 4 +- gdb/x86-fbsd-nat.h | 3 +- gdb/x86-linux-nat.c | 38 +- gdb/x86-linux-nat.h | 43 +- gdb/x86-nat.c | 37 +- gdb/x86-nat.h | 57 +- gdb/x86-tdep.c | 7 +- gdb/x86-tdep.h | 2 +- gdb/xcoffread.c | 656 ++- gdb/xml-support.c | 206 +- gdb/xml-support.h | 54 +- gdb/xml-syscall.c | 123 +- gdb/xml-syscall.h | 7 +- gdb/xml-tdesc.c | 382 +- gdb/xml-tdesc.h | 1 - gdb/xstormy16-tdep.c | 175 +- gdb/xtensa-config.c | 866 +++- gdb/xtensa-linux-nat.c | 143 +- gdb/xtensa-linux-tdep.c | 22 +- gdb/xtensa-tdep.c | 970 ++-- gdb/xtensa-tdep.h | 231 +- gdb/xtensa-xtregs.c | 6 +- gdb/yy-remap.h | 100 +- gdb/z80-tdep.c | 620 ++- gdb/z80-tdep.h | 14 +- gdbserver/ax.cc | 1591 ++++--- gdbserver/ax.h | 29 +- gdbserver/debug.cc | 16 +- gdbserver/debug.h | 8 +- gdbserver/dll.cc | 25 +- gdbserver/dll.h | 10 +- gdbserver/fork-child.cc | 7 +- gdbserver/gdbreplay.cc | 198 +- gdbserver/gdbthread.h | 42 +- gdbserver/hostio.cc | 119 +- gdbserver/i387-fp.cc | 647 +-- gdbserver/inferiors.cc | 26 +- gdbserver/inferiors.h | 10 +- gdbserver/linux-aarch32-low.cc | 92 +- gdbserver/linux-aarch32-low.h | 4 +- gdbserver/linux-aarch32-tdesc.h | 2 +- gdbserver/linux-aarch64-ipa.cc | 128 +- gdbserver/linux-aarch64-low.cc | 671 ++- gdbserver/linux-aarch64-tdesc.cc | 12 +- gdbserver/linux-aarch64-tdesc.h | 2 +- gdbserver/linux-amd64-ipa.cc | 114 +- gdbserver/linux-arc-low.cc | 58 +- gdbserver/linux-arm-low.cc | 348 +- gdbserver/linux-arm-tdesc.cc | 2 +- gdbserver/linux-arm-tdesc.h | 2 +- gdbserver/linux-csky-low.cc | 95 +- gdbserver/linux-i386-ipa.cc | 155 +- gdbserver/linux-ia64-low.cc | 741 +-- gdbserver/linux-loongarch-low.cc | 68 +- gdbserver/linux-low.cc | 3611 ++++++++------- gdbserver/linux-low.h | 127 +- gdbserver/linux-m68k-low.cc | 82 +- gdbserver/linux-mips-low.cc | 369 +- gdbserver/linux-nios2-low.cc | 66 +- gdbserver/linux-or1k-low.cc | 58 +- gdbserver/linux-ppc-ipa.cc | 74 +- gdbserver/linux-ppc-low.cc | 1615 ++++--- gdbserver/linux-ppc-tdesc-init.h | 5 +- gdbserver/linux-riscv-low.cc | 94 +- gdbserver/linux-s390-ipa.cc | 691 ++- gdbserver/linux-s390-low.cc | 1730 ++++--- gdbserver/linux-s390-tdesc.h | 3 +- gdbserver/linux-sh-low.cc | 95 +- gdbserver/linux-sparc-low.cc | 132 +- gdbserver/linux-tic6x-low.cc | 157 +- gdbserver/linux-x86-low.cc | 1607 +++---- gdbserver/linux-x86-tdesc.cc | 33 +- gdbserver/linux-x86-tdesc.h | 5 +- gdbserver/linux-xtensa-low.cc | 162 +- gdbserver/mem-break.cc | 744 ++- gdbserver/mem-break.h | 46 +- gdbserver/netbsd-aarch64-low.cc | 30 +- gdbserver/netbsd-amd64-low.cc | 89 +- gdbserver/netbsd-i386-low.cc | 61 +- gdbserver/netbsd-low.cc | 509 ++- gdbserver/netbsd-low.h | 28 +- gdbserver/notif.cc | 16 +- gdbserver/notif.h | 7 +- gdbserver/proc-service.cc | 17 +- gdbserver/regcache.cc | 84 +- gdbserver/regcache.h | 18 +- gdbserver/remote-utils.cc | 711 ++- gdbserver/remote-utils.h | 31 +- gdbserver/server.cc | 2920 ++++++------ gdbserver/server.h | 18 +- gdbserver/symbol.cc | 2 +- gdbserver/target.cc | 147 +- gdbserver/target.h | 221 +- gdbserver/tdesc.cc | 45 +- gdbserver/tdesc.h | 11 +- gdbserver/thread-db.cc | 186 +- gdbserver/tracepoint.cc | 3213 +++++++------ gdbserver/tracepoint.h | 70 +- gdbserver/utils.cc | 22 +- gdbserver/win32-i386-low.cc | 364 +- gdbserver/win32-low.cc | 532 +-- gdbserver/win32-low.h | 50 +- gdbserver/x86-low.cc | 10 +- gdbserver/x86-tdesc.h | 4 +- gdbserver/xtensa-xtregs.cc | 32 +- gdbsupport/agent.cc | 79 +- gdbsupport/agent.h | 10 +- gdbsupport/alt-stack.h | 3 +- gdbsupport/array-view.h | 107 +- gdbsupport/block-signals.h | 3 +- gdbsupport/break-common.h | 12 +- gdbsupport/btrace-common.cc | 118 +- gdbsupport/btrace-common.h | 20 +- gdbsupport/buffer.cc | 169 +- gdbsupport/buffer.h | 8 +- gdbsupport/buildargv.h | 70 +- gdbsupport/byte-vector.h | 3 +- gdbsupport/cleanups.cc | 11 +- gdbsupport/common-debug.cc | 4 +- gdbsupport/common-debug.h | 128 +- gdbsupport/common-defs.h | 28 +- gdbsupport/common-exceptions.cc | 113 +- gdbsupport/common-exceptions.h | 101 +- gdbsupport/common-gdbthread.h | 2 +- gdbsupport/common-inferior.cc | 108 +- gdbsupport/common-inferior.h | 3 +- gdbsupport/common-regcache.cc | 4 +- gdbsupport/common-regcache.h | 21 +- gdbsupport/common-types.h | 7 +- gdbsupport/common-utils.cc | 116 +- gdbsupport/common-utils.h | 28 +- gdbsupport/def-vector.h | 7 +- gdbsupport/default-init-alloc.h | 9 +- gdbsupport/eintr.h | 2 +- gdbsupport/enum-flags.h | 420 +- gdbsupport/environ.cc | 8 +- gdbsupport/environ.h | 5 +- gdbsupport/errors.cc | 34 +- gdbsupport/errors.h | 41 +- gdbsupport/event-loop.cc | 491 +- gdbsupport/event-loop.h | 29 +- gdbsupport/event-pipe.h | 11 +- gdbsupport/fileio.cc | 175 +- gdbsupport/fileio.h | 143 +- gdbsupport/filestuff.cc | 156 +- gdbsupport/filestuff.h | 14 +- gdbsupport/filtered-iterator.h | 16 +- gdbsupport/format.cc | 639 +-- gdbsupport/format.h | 43 +- gdbsupport/forward-scope-exit.h | 23 +- gdbsupport/function-view.h | 114 +- gdbsupport/gdb-checked-static-cast.h | 6 +- gdbsupport/gdb-dlfcn.cc | 18 +- gdbsupport/gdb-dlfcn.h | 2 +- gdbsupport/gdb-hashtab.h | 5 +- gdbsupport/gdb-sigmask.h | 1 - gdbsupport/gdb-xfree.h | 6 +- gdbsupport/gdb_assert.h | 17 +- gdbsupport/gdb_binary_search.h | 12 +- gdbsupport/gdb_file.h | 5 +- gdbsupport/gdb_locale.h | 20 +- gdbsupport/gdb_obstack.cc | 2 +- gdbsupport/gdb_obstack.h | 42 +- gdbsupport/gdb_optional.h | 104 +- gdbsupport/gdb_proc_service.h | 74 +- gdbsupport/gdb_ref_ptr.h | 81 +- gdbsupport/gdb_regex.cc | 11 +- gdbsupport/gdb_regex.h | 14 +- gdbsupport/gdb_select.h | 9 +- gdbsupport/gdb_setjmp.h | 12 +- gdbsupport/gdb_splay_tree.h | 10 +- gdbsupport/gdb_string_view.h | 1014 +++-- gdbsupport/gdb_sys_time.h | 4 +- gdbsupport/gdb_tilde_expand.cc | 34 +- gdbsupport/gdb_unique_ptr.h | 10 +- gdbsupport/gdb_unlinker.h | 16 +- gdbsupport/gdb_vecs.cc | 24 +- gdbsupport/gdb_vecs.h | 14 +- gdbsupport/gdb_wait.cc | 48 +- gdbsupport/gdb_wait.h | 80 +- gdbsupport/hash_enum.h | 3 +- gdbsupport/host-defs.h | 14 +- gdbsupport/intrusive_list.h | 157 +- gdbsupport/iterator-range.h | 27 +- gdbsupport/job-control.cc | 4 +- gdbsupport/netstuff.cc | 93 +- gdbsupport/netstuff.h | 11 +- gdbsupport/new-op.cc | 30 +- gdbsupport/next-iterator.h | 18 +- gdbsupport/observable.h | 74 +- gdbsupport/offset-type.h | 71 +- gdbsupport/packed.h | 86 +- gdbsupport/parallel-for.h | 223 +- gdbsupport/pathstuff.cc | 22 +- gdbsupport/pathstuff.h | 9 +- gdbsupport/poison.h | 39 +- gdbsupport/preprocessor.h | 2 +- gdbsupport/print-utils.cc | 92 +- gdbsupport/print-utils.h | 4 +- gdbsupport/ptid.h | 54 +- gdbsupport/range-chain.h | 46 +- gdbsupport/refcounted-object.h | 10 +- gdbsupport/reference-to-pointer-iterator.h | 29 +- gdbsupport/rsp-low.cc | 91 +- gdbsupport/rsp-low.h | 6 +- gdbsupport/run-time-clock.cc | 2 +- gdbsupport/run-time-clock.h | 2 +- gdbsupport/safe-iterator.h | 26 +- gdbsupport/scope-exit.h | 55 +- gdbsupport/scoped_fd.h | 16 +- gdbsupport/scoped_ignore_signal.h | 44 +- gdbsupport/scoped_ignore_sigttou.h | 10 +- gdbsupport/scoped_mmap.cc | 5 +- gdbsupport/scoped_mmap.h | 10 +- gdbsupport/scoped_restore.h | 23 +- gdbsupport/search.cc | 78 +- gdbsupport/search.h | 12 +- gdbsupport/selftest.cc | 42 +- gdbsupport/selftest.h | 27 +- gdbsupport/signals-state-save-restore.cc | 47 +- gdbsupport/signals.cc | 278 +- gdbsupport/symbol.h | 2 +- gdbsupport/tdesc.cc | 187 +- gdbsupport/tdesc.h | 165 +- gdbsupport/thread-pool.cc | 57 +- gdbsupport/thread-pool.h | 17 +- gdbsupport/traits.h | 77 +- gdbsupport/valid-expr.h | 81 +- gdbsupport/x86-xstate.h | 82 +- gdbsupport/xml-utils.cc | 188 +- 1273 files changed, 107714 insertions(+), 118738 deletions(-) diff --git a/gdb/aarch32-linux-nat.c b/gdb/aarch32-linux-nat.c index bddc3bb..f92f8f0 100644 --- a/gdb/aarch32-linux-nat.c +++ b/gdb/aarch32-linux-nat.c @@ -45,8 +45,8 @@ aarch32_gp_regcache_supply (struct regcache *regcache, uint32_t *regs, else regcache->raw_supply (ARM_PS_REGNUM, ®s[ARM_PC_REGNUM]); - regs[ARM_PC_REGNUM] = gdbarch_addr_bits_remove - (regcache->arch (), regs[ARM_PC_REGNUM]); + regs[ARM_PC_REGNUM] + = gdbarch_addr_bits_remove (regcache->arch (), regs[ARM_PC_REGNUM]); regcache->raw_supply (ARM_PC_REGNUM, ®s[ARM_PC_REGNUM]); } @@ -72,8 +72,8 @@ aarch32_gp_regcache_collect (const struct regcache *regcache, uint32_t *regs, regcache->raw_collect (ARM_PS_REGNUM, ®s[ARM_CPSR_GREGNUM]); /* Keep reserved bits bit 20 to bit 23. */ - regs[ARM_CPSR_GREGNUM] = ((regs[ARM_CPSR_GREGNUM] & 0xff0fffff) - | (cpsr & 0x00f00000)); + regs[ARM_CPSR_GREGNUM] + = ((regs[ARM_CPSR_GREGNUM] & 0xff0fffff) | (cpsr & 0x00f00000)); } } diff --git a/gdb/aarch64-fbsd-nat.c b/gdb/aarch64-fbsd-nat.c index 9dbbaf9..f39656a 100644 --- a/gdb/aarch64-fbsd-nat.c +++ b/gdb/aarch64-fbsd-nat.c @@ -38,7 +38,7 @@ #include "inf-ptrace.h" #if __FreeBSD_version >= 1400005 -#define HAVE_DBREG +#define HAVE_DBREG #include #endif @@ -70,6 +70,7 @@ struct aarch64_fbsd_nat_target final : public fbsd_nat_target void low_prepare_to_resume (thread_info *) override; private: + void probe_debug_regs (int pid); static bool debug_regs_probed; #endif @@ -121,7 +122,7 @@ const struct target_desc * aarch64_fbsd_nat_target::read_description () { aarch64_features features; - features.tls = have_regset (inferior_ptid, NT_ARM_TLS)? 1 : 0; + features.tls = have_regset (inferior_ptid, NT_ARM_TLS) ? 1 : 0; return aarch64_read_description (features); } @@ -144,8 +145,7 @@ aarch64_fbsd_nat_target::stopped_data_address (CORE_ADDR *addr_p) return false; /* This must be a hardware breakpoint. */ - if (siginfo.si_signo != SIGTRAP - || siginfo.si_code != TRAP_TRACE + if (siginfo.si_signo != SIGTRAP || siginfo.si_code != TRAP_TRACE || siginfo.si_trapno != EXCP_WATCHPT_EL0) return false; @@ -178,12 +178,11 @@ aarch64_fbsd_nat_target::stopped_by_hw_breakpoint () return false; /* This must be a hardware breakpoint. */ - if (siginfo.si_signo != SIGTRAP - || siginfo.si_code != TRAP_TRACE + if (siginfo.si_signo != SIGTRAP || siginfo.si_code != TRAP_TRACE || siginfo.si_trapno != EXCP_WATCHPT_EL0) return false; - return !stopped_by_watchpoint(); + return !stopped_by_watchpoint (); } /* Implement the "supports_stopped_by_hw_breakpoint" target_ops method. */ @@ -207,7 +206,7 @@ aarch64_fbsd_nat_target::probe_debug_regs (int pid) aarch64_num_bp_regs = 0; aarch64_num_wp_regs = 0; - if (ptrace(PT_GETDBREGS, pid, (PTRACE_TYPE_ARG3) ®, 0) == 0) + if (ptrace (PT_GETDBREGS, pid, (PTRACE_TYPE_ARG3) ®, 0) == 0) { switch (reg.db_debug_ver) { @@ -223,16 +222,16 @@ aarch64_fbsd_nat_target::probe_debug_regs (int pid) aarch64_num_bp_regs = reg.db_nbkpts; if (aarch64_num_bp_regs > AARCH64_HBP_MAX_NUM) { - warning (_("Unexpected number of hardware breakpoint registers" - " reported by ptrace, got %d, expected %d."), + warning (_ ("Unexpected number of hardware breakpoint registers" + " reported by ptrace, got %d, expected %d."), aarch64_num_bp_regs, AARCH64_HBP_MAX_NUM); aarch64_num_bp_regs = AARCH64_HBP_MAX_NUM; } aarch64_num_wp_regs = reg.db_nwtpts; if (aarch64_num_wp_regs > AARCH64_HWP_MAX_NUM) { - warning (_("Unexpected number of hardware watchpoint registers" - " reported by ptrace, got %d, expected %d."), + warning (_ ("Unexpected number of hardware watchpoint registers" + " reported by ptrace, got %d, expected %d."), aarch64_num_wp_regs, AARCH64_HWP_MAX_NUM); aarch64_num_wp_regs = AARCH64_HWP_MAX_NUM; } @@ -288,8 +287,8 @@ aarch64_fbsd_nat_target::low_new_fork (ptid_t parent, pid_t child) current inferior. */ void -aarch64_notify_debug_reg_change (ptid_t ptid, - int is_watchpoint, unsigned int idx) +aarch64_notify_debug_reg_change (ptid_t ptid, int is_watchpoint, + unsigned int idx) { for (thread_info *tp : current_inferior ()->non_exited_threads ()) { @@ -303,7 +302,7 @@ aarch64_notify_debug_reg_change (ptid_t ptid, void aarch64_fbsd_nat_target::low_delete_thread (thread_info *tp) { - gdb_assert(tp->ptid.lwp_p ()); + gdb_assert (tp->ptid.lwp_p ()); aarch64_debug_pending_threads.erase (tp->ptid.lwp ()); } @@ -312,17 +311,17 @@ aarch64_fbsd_nat_target::low_delete_thread (thread_info *tp) void aarch64_fbsd_nat_target::low_prepare_to_resume (thread_info *tp) { - gdb_assert(tp->ptid.lwp_p ()); + gdb_assert (tp->ptid.lwp_p ()); if (aarch64_debug_pending_threads.erase (tp->ptid.lwp ()) == 0) return; - struct aarch64_debug_reg_state *state = - aarch64_lookup_debug_reg_state (tp->ptid.pid ()); - gdb_assert(state != nullptr); + struct aarch64_debug_reg_state *state + = aarch64_lookup_debug_reg_state (tp->ptid.pid ()); + gdb_assert (state != nullptr); struct dbreg reg; - memset (®, 0, sizeof(reg)); + memset (®, 0, sizeof (reg)); for (int i = 0; i < aarch64_num_bp_regs; i++) { reg.db_breakregs[i].dbr_addr = state->dr_addr_bp[i]; @@ -333,20 +332,21 @@ aarch64_fbsd_nat_target::low_prepare_to_resume (thread_info *tp) reg.db_watchregs[i].dbw_addr = state->dr_addr_wp[i]; reg.db_watchregs[i].dbw_ctrl = state->dr_ctrl_wp[i]; } - if (ptrace(PT_SETDBREGS, tp->ptid.lwp (), (PTRACE_TYPE_ARG3) ®, 0) != 0) - error (_("Failed to set hardware debug registers")); + if (ptrace (PT_SETDBREGS, tp->ptid.lwp (), (PTRACE_TYPE_ARG3) ®, 0) != 0) + error (_ ("Failed to set hardware debug registers")); } #else /* A stub that should never be called. */ void -aarch64_notify_debug_reg_change (ptid_t ptid, - int is_watchpoint, unsigned int idx) +aarch64_notify_debug_reg_change (ptid_t ptid, int is_watchpoint, + unsigned int idx) { gdb_assert (true); } #endif void _initialize_aarch64_fbsd_nat (); + void _initialize_aarch64_fbsd_nat () { diff --git a/gdb/aarch64-fbsd-tdep.c b/gdb/aarch64-fbsd-tdep.c index 1102eb0..311c456 100644 --- a/gdb/aarch64-fbsd-tdep.c +++ b/gdb/aarch64-fbsd-tdep.c @@ -32,31 +32,25 @@ /* Register maps. */ -static const struct regcache_map_entry aarch64_fbsd_gregmap[] = - { - { 30, AARCH64_X0_REGNUM, 8 }, /* x0 ... x29 */ - { 1, AARCH64_LR_REGNUM, 8 }, - { 1, AARCH64_SP_REGNUM, 8 }, - { 1, AARCH64_PC_REGNUM, 8 }, - { 1, AARCH64_CPSR_REGNUM, 4 }, - { 0 } - }; - -static const struct regcache_map_entry aarch64_fbsd_fpregmap[] = - { - { 32, AARCH64_V0_REGNUM, 16 }, /* v0 ... v31 */ - { 1, AARCH64_FPSR_REGNUM, 4 }, - { 1, AARCH64_FPCR_REGNUM, 4 }, - { 0 } - }; +static const struct regcache_map_entry aarch64_fbsd_gregmap[] + = { { 30, AARCH64_X0_REGNUM, 8 }, /* x0 ... x29 */ + { 1, AARCH64_LR_REGNUM, 8 }, + { 1, AARCH64_SP_REGNUM, 8 }, + { 1, AARCH64_PC_REGNUM, 8 }, + { 1, AARCH64_CPSR_REGNUM, 4 }, + { 0 } }; + +static const struct regcache_map_entry aarch64_fbsd_fpregmap[] + = { { 32, AARCH64_V0_REGNUM, 16 }, /* v0 ... v31 */ + { 1, AARCH64_FPSR_REGNUM, 4 }, + { 1, AARCH64_FPCR_REGNUM, 4 }, + { 0 } }; /* Register numbers are relative to tdep->tls_regnum_base. */ -static const struct regcache_map_entry aarch64_fbsd_tls_regmap[] = - { - { 1, 0, 8 }, /* tpidr */ - { 0 } - }; +static const struct regcache_map_entry aarch64_fbsd_tls_regmap[] + = { { 1, 0, 8 }, /* tpidr */ + { 0 } }; /* In a signal frame, sp points to a 'struct sigframe' which is defined as: @@ -78,75 +72,65 @@ static const struct regcache_map_entry aarch64_fbsd_tls_regmap[] = by the floating point register set. The floating point register set is only valid if the _MC_FP_VALID flag is set in mc_flags. */ -#define AARCH64_SIGFRAME_UCONTEXT_OFFSET 80 -#define AARCH64_UCONTEXT_MCONTEXT_OFFSET 16 -#define AARCH64_MCONTEXT_FPREGS_OFFSET 272 -#define AARCH64_MCONTEXT_FLAGS_OFFSET 800 -#define AARCH64_MCONTEXT_FLAG_FP_VALID 0x1 +#define AARCH64_SIGFRAME_UCONTEXT_OFFSET 80 +#define AARCH64_UCONTEXT_MCONTEXT_OFFSET 16 +#define AARCH64_MCONTEXT_FPREGS_OFFSET 272 +#define AARCH64_MCONTEXT_FLAGS_OFFSET 800 +#define AARCH64_MCONTEXT_FLAG_FP_VALID 0x1 /* Implement the "init" method of struct tramp_frame. */ static void aarch64_fbsd_sigframe_init (const struct tramp_frame *self, - frame_info_ptr this_frame, - struct trad_frame_cache *this_cache, - CORE_ADDR func) + frame_info_ptr this_frame, + struct trad_frame_cache *this_cache, + CORE_ADDR func) { struct gdbarch *gdbarch = get_frame_arch (this_frame); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); CORE_ADDR sp = get_frame_register_unsigned (this_frame, AARCH64_SP_REGNUM); - CORE_ADDR mcontext_addr - = (sp - + AARCH64_SIGFRAME_UCONTEXT_OFFSET - + AARCH64_UCONTEXT_MCONTEXT_OFFSET); + CORE_ADDR mcontext_addr = (sp + AARCH64_SIGFRAME_UCONTEXT_OFFSET + + AARCH64_UCONTEXT_MCONTEXT_OFFSET); gdb_byte buf[4]; trad_frame_set_reg_regmap (this_cache, aarch64_fbsd_gregmap, mcontext_addr, regcache_map_entry_size (aarch64_fbsd_gregmap)); if (target_read_memory (mcontext_addr + AARCH64_MCONTEXT_FLAGS_OFFSET, buf, - 4) == 0 + 4) + == 0 && (extract_unsigned_integer (buf, 4, byte_order) & AARCH64_MCONTEXT_FLAG_FP_VALID)) - trad_frame_set_reg_regmap (this_cache, aarch64_fbsd_fpregmap, - mcontext_addr + AARCH64_MCONTEXT_FPREGS_OFFSET, - regcache_map_entry_size (aarch64_fbsd_fpregmap)); + trad_frame_set_reg_regmap ( + this_cache, aarch64_fbsd_fpregmap, + mcontext_addr + AARCH64_MCONTEXT_FPREGS_OFFSET, + regcache_map_entry_size (aarch64_fbsd_fpregmap)); trad_frame_set_id (this_cache, frame_id_build (sp, func)); } -static const struct tramp_frame aarch64_fbsd_sigframe = -{ - SIGTRAMP_FRAME, - 4, - { - {0x910003e0, ULONGEST_MAX}, /* mov x0, sp */ - {0x91014000, ULONGEST_MAX}, /* add x0, x0, #SF_UC */ - {0xd2803428, ULONGEST_MAX}, /* mov x8, #SYS_sigreturn */ - {0xd4000001, ULONGEST_MAX}, /* svc 0x0 */ - {TRAMP_SENTINEL_INSN, ULONGEST_MAX} - }, - aarch64_fbsd_sigframe_init -}; +static const struct tramp_frame aarch64_fbsd_sigframe + = { SIGTRAMP_FRAME, + 4, + { { 0x910003e0, ULONGEST_MAX }, /* mov x0, sp */ + { 0x91014000, ULONGEST_MAX }, /* add x0, x0, #SF_UC */ + { 0xd2803428, ULONGEST_MAX }, /* mov x8, #SYS_sigreturn */ + { 0xd4000001, ULONGEST_MAX }, /* svc 0x0 */ + { TRAMP_SENTINEL_INSN, ULONGEST_MAX } }, + aarch64_fbsd_sigframe_init }; /* Register set definitions. */ -const struct regset aarch64_fbsd_gregset = - { - aarch64_fbsd_gregmap, - regcache_supply_regset, regcache_collect_regset - }; +const struct regset aarch64_fbsd_gregset + = { aarch64_fbsd_gregmap, regcache_supply_regset, regcache_collect_regset }; -const struct regset aarch64_fbsd_fpregset = - { - aarch64_fbsd_fpregmap, - regcache_supply_regset, regcache_collect_regset - }; +const struct regset aarch64_fbsd_fpregset + = { aarch64_fbsd_fpregmap, regcache_supply_regset, regcache_collect_regset }; static void aarch64_fbsd_supply_tls_regset (const struct regset *regset, - struct regcache *regcache, - int regnum, const void *buf, size_t size) + struct regcache *regcache, int regnum, + const void *buf, size_t size) { struct gdbarch *gdbarch = regcache->arch (); aarch64_gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); @@ -156,8 +140,8 @@ aarch64_fbsd_supply_tls_regset (const struct regset *regset, static void aarch64_fbsd_collect_tls_regset (const struct regset *regset, - const struct regcache *regcache, - int regnum, void *buf, size_t size) + const struct regcache *regcache, int regnum, + void *buf, size_t size) { struct gdbarch *gdbarch = regcache->arch (); aarch64_gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); @@ -165,11 +149,9 @@ aarch64_fbsd_collect_tls_regset (const struct regset *regset, regcache->collect_regset (regset, tdep->tls_regnum_base, regnum, buf, size); } -const struct regset aarch64_fbsd_tls_regset = - { - aarch64_fbsd_tls_regmap, - aarch64_fbsd_supply_tls_regset, aarch64_fbsd_collect_tls_regset - }; +const struct regset aarch64_fbsd_tls_regset + = { aarch64_fbsd_tls_regmap, aarch64_fbsd_supply_tls_regset, + aarch64_fbsd_collect_tls_regset }; /* Implement the "iterate_over_regset_sections" gdbarch method. */ @@ -201,7 +183,7 @@ aarch64_fbsd_core_read_description (struct gdbarch *gdbarch, asection *tls = bfd_get_section_by_name (abfd, ".reg-aarch-tls"); aarch64_features features; - features.tls = tls != nullptr? 1 : 0; + features.tls = tls != nullptr ? 1 : 0; return aarch64_read_description (features); } @@ -222,7 +204,7 @@ aarch64_fbsd_get_thread_local_address (struct gdbarch *gdbarch, ptid_t ptid, ULONGEST tpidr; if (regcache->cooked_read (tdep->tls_regnum_base, &tpidr) != REG_VALID) - error (_("Unable to fetch %%tpidr")); + error (_ ("Unable to fetch %%tpidr")); /* %tpidr points to the TCB whose first member is the dtv pointer. */ @@ -248,8 +230,8 @@ aarch64_fbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) /* Enable longjmp. */ tdep->jb_pc = 13; - set_gdbarch_iterate_over_regset_sections - (gdbarch, aarch64_fbsd_iterate_over_regset_sections); + set_gdbarch_iterate_over_regset_sections ( + gdbarch, aarch64_fbsd_iterate_over_regset_sections); set_gdbarch_core_read_description (gdbarch, aarch64_fbsd_core_read_description); @@ -257,12 +239,13 @@ aarch64_fbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { set_gdbarch_fetch_tls_load_module_address (gdbarch, svr4_fetch_objfile_link_map); - set_gdbarch_get_thread_local_address - (gdbarch, aarch64_fbsd_get_thread_local_address); + set_gdbarch_get_thread_local_address ( + gdbarch, aarch64_fbsd_get_thread_local_address); } } void _initialize_aarch64_fbsd_tdep (); + void _initialize_aarch64_fbsd_tdep () { diff --git a/gdb/aarch64-fbsd-tdep.h b/gdb/aarch64-fbsd-tdep.h index 46c27cb..54b77fd 100644 --- a/gdb/aarch64-fbsd-tdep.h +++ b/gdb/aarch64-fbsd-tdep.h @@ -25,7 +25,7 @@ /* The general-purpose regset consists of 30 X registers, plus LR, SP, ELR, and SPSR registers. SPSR is 32 bits but the structure is padded to 64 bit alignment. */ -#define AARCH64_FBSD_SIZEOF_GREGSET (34 * X_REGISTER_SIZE) +#define AARCH64_FBSD_SIZEOF_GREGSET (34 * X_REGISTER_SIZE) /* The fp regset consists of 32 V registers, plus FPSR and FPCR which are 4 bytes wide each, and the whole structure is padded to 128 bit @@ -33,7 +33,7 @@ #define AARCH64_FBSD_SIZEOF_FPREGSET (33 * V_REGISTER_SIZE) /* The TLS regset consists of a single register. */ -#define AARCH64_FBSD_SIZEOF_TLSREGSET (X_REGISTER_SIZE) +#define AARCH64_FBSD_SIZEOF_TLSREGSET (X_REGISTER_SIZE) extern const struct regset aarch64_fbsd_gregset; extern const struct regset aarch64_fbsd_fpregset; diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c index e415823..3279af5 100644 --- a/gdb/aarch64-linux-nat.c +++ b/gdb/aarch64-linux-nat.c @@ -64,6 +64,7 @@ class aarch64_linux_nat_target final : public aarch64_nat_target { public: + /* Add our register access methods. */ void fetch_registers (struct regcache *, int) override; void store_registers (struct regcache *, int) override; @@ -84,26 +85,34 @@ public: /* These three defer to common nat/ code. */ void low_new_thread (struct lwp_info *lp) override - { aarch64_linux_new_thread (lp); } + { + aarch64_linux_new_thread (lp); + } + void low_delete_thread (struct arch_lwp_info *lp) override - { aarch64_linux_delete_thread (lp); } + { + aarch64_linux_delete_thread (lp); + } + void low_prepare_to_resume (struct lwp_info *lp) override - { aarch64_linux_prepare_to_resume (lp); } + { + aarch64_linux_prepare_to_resume (lp); + } void low_new_fork (struct lwp_info *parent, pid_t child_pid) override; void low_forget_process (pid_t pid) override; /* Add our siginfo layout converter. */ - bool low_siginfo_fixup (siginfo_t *ptrace, gdb_byte *inf, int direction) - override; + bool low_siginfo_fixup (siginfo_t *ptrace, gdb_byte *inf, + int direction) override; struct gdbarch *thread_architecture (ptid_t) override; bool supports_memory_tagging () override; /* Read memory allocation tags from memory via PTRACE. */ - bool fetch_memtags (CORE_ADDR address, size_t len, - gdb::byte_vector &tags, int type) override; + bool fetch_memtags (CORE_ADDR address, size_t len, gdb::byte_vector &tags, + int type) override; /* Write allocation tags to memory via PTRACE. */ bool store_memtags (CORE_ADDR address, size_t len, @@ -146,7 +155,7 @@ fetch_gregs_from_thread (struct regcache *regcache) ret = ptrace (PTRACE_GETREGSET, tid, NT_PRSTATUS, &iovec); if (ret < 0) - perror_with_name (_("Unable to fetch general registers")); + perror_with_name (_ ("Unable to fetch general registers")); if (gdbarch_bfd_arch_info (gdbarch)->bits_per_word == 32) aarch32_gp_regcache_supply (regcache, (uint32_t *) regs, 1); @@ -183,7 +192,7 @@ store_gregs_to_thread (const struct regcache *regcache) ret = ptrace (PTRACE_GETREGSET, tid, NT_PRSTATUS, &iovec); if (ret < 0) - perror_with_name (_("Unable to fetch general registers")); + perror_with_name (_ ("Unable to fetch general registers")); if (gdbarch_bfd_arch_info (gdbarch)->bits_per_word == 32) aarch32_gp_regcache_collect (regcache, (uint32_t *) regs, 1); @@ -198,7 +207,7 @@ store_gregs_to_thread (const struct regcache *regcache) ret = ptrace (PTRACE_SETREGSET, tid, NT_PRSTATUS, &iovec); if (ret < 0) - perror_with_name (_("Unable to store general registers")); + perror_with_name (_ ("Unable to store general registers")); } /* Fill GDB's register array with the fp/simd register values @@ -226,7 +235,7 @@ fetch_fpregs_from_thread (struct regcache *regcache) ret = ptrace (PTRACE_GETREGSET, tid, NT_ARM_VFP, &iovec); if (ret < 0) - perror_with_name (_("Unable to fetch VFP registers")); + perror_with_name (_ ("Unable to fetch VFP registers")); aarch32_vfp_regcache_supply (regcache, (gdb_byte *) ®s, 32); } @@ -238,7 +247,7 @@ fetch_fpregs_from_thread (struct regcache *regcache) ret = ptrace (PTRACE_GETREGSET, tid, NT_FPREGSET, &iovec); if (ret < 0) - perror_with_name (_("Unable to fetch vFP/SIMD registers")); + perror_with_name (_ ("Unable to fetch vFP/SIMD registers")); for (regno = AARCH64_V0_REGNUM; regno <= AARCH64_V31_REGNUM; regno++) regcache->raw_supply (regno, ®s.vregs[regno - AARCH64_V0_REGNUM]); @@ -272,7 +281,7 @@ store_fpregs_to_thread (const struct regcache *regcache) ret = ptrace (PTRACE_GETREGSET, tid, NT_ARM_VFP, &iovec); if (ret < 0) - perror_with_name (_("Unable to fetch VFP registers")); + perror_with_name (_ ("Unable to fetch VFP registers")); aarch32_vfp_regcache_collect (regcache, (gdb_byte *) ®s, 32); } @@ -284,12 +293,12 @@ store_fpregs_to_thread (const struct regcache *regcache) ret = ptrace (PTRACE_GETREGSET, tid, NT_FPREGSET, &iovec); if (ret < 0) - perror_with_name (_("Unable to fetch FP/SIMD registers")); + perror_with_name (_ ("Unable to fetch FP/SIMD registers")); for (regno = AARCH64_V0_REGNUM; regno <= AARCH64_V31_REGNUM; regno++) if (REG_VALID == regcache->get_register_status (regno)) - regcache->raw_collect - (regno, (char *) ®s.vregs[regno - AARCH64_V0_REGNUM]); + regcache->raw_collect ( + regno, (char *) ®s.vregs[regno - AARCH64_V0_REGNUM]); if (REG_VALID == regcache->get_register_status (AARCH64_FPSR_REGNUM)) regcache->raw_collect (AARCH64_FPSR_REGNUM, (char *) ®s.fpsr); @@ -301,13 +310,13 @@ store_fpregs_to_thread (const struct regcache *regcache) { ret = ptrace (PTRACE_SETREGSET, tid, NT_ARM_VFP, &iovec); if (ret < 0) - perror_with_name (_("Unable to store VFP registers")); + perror_with_name (_ ("Unable to store VFP registers")); } else { ret = ptrace (PTRACE_SETREGSET, tid, NT_FPREGSET, &iovec); if (ret < 0) - perror_with_name (_("Unable to store FP/SIMD registers")); + perror_with_name (_ ("Unable to store FP/SIMD registers")); } } @@ -335,7 +344,7 @@ store_sveregs_to_thread (struct regcache *regcache) /* First store vector length to the thread. This is done first to ensure the ptrace buffers read from the kernel are the correct size. */ if (!aarch64_sve_set_vq (tid, regcache)) - perror_with_name (_("Unable to set VG register")); + perror_with_name (_ ("Unable to set VG register")); /* Obtain a dump of SVE registers from ptrace. */ std::unique_ptr base = aarch64_sve_get_sveregs (tid); @@ -349,7 +358,7 @@ store_sveregs_to_thread (struct regcache *regcache) ret = ptrace (PTRACE_SETREGSET, tid, NT_ARM_SVE, &iovec); if (ret < 0) - perror_with_name (_("Unable to store sve registers")); + perror_with_name (_ ("Unable to store sve registers")); } /* Fill GDB's register array with the pointer authentication mask values from @@ -362,7 +371,7 @@ fetch_pauth_masks_from_thread (struct regcache *regcache) = gdbarch_tdep (regcache->arch ()); int ret; struct iovec iovec; - uint64_t pauth_regset[2] = {0, 0}; + uint64_t pauth_regset[2] = { 0, 0 }; int tid = regcache->ptid ().lwp (); iovec.iov_base = &pauth_regset; @@ -370,7 +379,7 @@ fetch_pauth_masks_from_thread (struct regcache *regcache) ret = ptrace (PTRACE_GETREGSET, tid, NT_ARM_PAC_MASK, &iovec); if (ret != 0) - perror_with_name (_("unable to fetch pauth registers")); + perror_with_name (_ ("unable to fetch pauth registers")); regcache->raw_supply (AARCH64_PAUTH_DMASK_REGNUM (tdep->pauth_reg_base), &pauth_regset[0]); @@ -398,7 +407,7 @@ fetch_mteregs_from_thread (struct regcache *regcache) int tid = get_ptrace_pid (regcache->ptid ()); if (ptrace (PTRACE_GETREGSET, tid, NT_ARM_TAGGED_ADDR_CTRL, &iovec) != 0) - perror_with_name (_("unable to fetch MTE registers")); + perror_with_name (_ ("unable to fetch MTE registers")); regcache->raw_supply (regno, &tag_ctl); } @@ -429,7 +438,7 @@ store_mteregs_to_thread (struct regcache *regcache) int tid = get_ptrace_pid (regcache->ptid ()); if (ptrace (PTRACE_SETREGSET, tid, NT_ARM_TAGGED_ADDR_CTRL, &iovec) != 0) - perror_with_name (_("unable to store MTE registers")); + perror_with_name (_ ("unable to store MTE registers")); } /* Fill GDB's register array with the TLS register values from @@ -452,7 +461,7 @@ fetch_tlsregs_from_thread (struct regcache *regcache) int tid = get_ptrace_pid (regcache->ptid ()); if (ptrace (PTRACE_GETREGSET, tid, NT_ARM_TLS, &iovec) != 0) - perror_with_name (_("unable to fetch TLS registers")); + perror_with_name (_ ("unable to fetch TLS registers")); for (int i = 0; i < tdep->tls_register_count; i++) regcache->raw_supply (regno + i, &tpidrs[i]); @@ -487,7 +496,7 @@ store_tlsregs_to_thread (struct regcache *regcache) int tid = get_ptrace_pid (regcache->ptid ()); if (ptrace (PTRACE_SETREGSET, tid, NT_ARM_TLS, &iovec) != 0) - perror_with_name (_("unable to store TLS register")); + perror_with_name (_ ("unable to store TLS register")); } /* The AArch64 version of the "fetch_registers" target_ops method. Fetch @@ -531,12 +540,10 @@ aarch64_fetch_registers (struct regcache *regcache, int regno) } /* Fetch individual MTE registers. */ - if (tdep->has_mte () - && (regno == tdep->mte_reg_base)) + if (tdep->has_mte () && (regno == tdep->mte_reg_base)) fetch_mteregs_from_thread (regcache); - if (tdep->has_tls () - && regno >= tdep->tls_regnum_base + if (tdep->has_tls () && regno >= tdep->tls_regnum_base && regno < tdep->tls_regnum_base + tdep->tls_register_count) fetch_tlsregs_from_thread (regcache); } @@ -548,8 +555,7 @@ aarch64_fetch_registers (struct regcache *regcache, int regno) static void aarch32_fetch_registers (struct regcache *regcache, int regno) { - arm_gdbarch_tdep *tdep - = gdbarch_tdep (regcache->arch ()); + arm_gdbarch_tdep *tdep = gdbarch_tdep (regcache->arch ()); if (regno == -1) { @@ -559,8 +565,7 @@ aarch32_fetch_registers (struct regcache *regcache, int regno) } else if (regno < ARM_F0_REGNUM || regno == ARM_PS_REGNUM) fetch_gregs_from_thread (regcache); - else if (tdep->vfp_register_count > 0 - && regno >= ARM_D0_REGNUM + else if (tdep->vfp_register_count > 0 && regno >= ARM_D0_REGNUM && (regno < ARM_D0_REGNUM + tdep->vfp_register_count || regno == ARM_FPSCR_REGNUM)) fetch_fpregs_from_thread (regcache); @@ -609,12 +614,10 @@ aarch64_store_registers (struct regcache *regcache, int regno) store_fpregs_to_thread (regcache); /* Store MTE registers. */ - if (tdep->has_mte () - && (regno == tdep->mte_reg_base)) + if (tdep->has_mte () && (regno == tdep->mte_reg_base)) store_mteregs_to_thread (regcache); - if (tdep->has_tls () - && regno >= tdep->tls_regnum_base + if (tdep->has_tls () && regno >= tdep->tls_regnum_base && regno < tdep->tls_regnum_base + tdep->tls_register_count) store_tlsregs_to_thread (regcache); } @@ -626,8 +629,7 @@ aarch64_store_registers (struct regcache *regcache, int regno) static void aarch32_store_registers (struct regcache *regcache, int regno) { - arm_gdbarch_tdep *tdep - = gdbarch_tdep (regcache->arch ()); + arm_gdbarch_tdep *tdep = gdbarch_tdep (regcache->arch ()); if (regno == -1) { @@ -637,8 +639,7 @@ aarch32_store_registers (struct regcache *regcache, int regno) } else if (regno < ARM_F0_REGNUM || regno == ARM_PS_REGNUM) store_gregs_to_thread (regcache); - else if (tdep->vfp_register_count > 0 - && regno >= ARM_D0_REGNUM + else if (tdep->vfp_register_count > 0 && regno >= ARM_D0_REGNUM && (regno < ARM_D0_REGNUM + tdep->vfp_register_count || regno == ARM_FPSCR_REGNUM)) store_fpregs_to_thread (regcache); @@ -661,11 +662,11 @@ aarch64_linux_nat_target::store_registers (struct regcache *regcache, do this for all registers. */ void -fill_gregset (const struct regcache *regcache, - gdb_gregset_t *gregsetp, int regno) +fill_gregset (const struct regcache *regcache, gdb_gregset_t *gregsetp, + int regno) { - regcache_collect_regset (&aarch64_linux_gregset, regcache, - regno, (gdb_byte *) gregsetp, + regcache_collect_regset (&aarch64_linux_gregset, regcache, regno, + (gdb_byte *) gregsetp, AARCH64_LINUX_SIZEOF_GREGSET); } @@ -685,11 +686,11 @@ supply_gregset (struct regcache *regcache, const gdb_gregset_t *gregsetp) do this for all registers. */ void -fill_fpregset (const struct regcache *regcache, - gdb_fpregset_t *fpregsetp, int regno) +fill_fpregset (const struct regcache *regcache, gdb_fpregset_t *fpregsetp, + int regno) { - regcache_collect_regset (&aarch64_linux_fpregset, regcache, - regno, (gdb_byte *) fpregsetp, + regcache_collect_regset (&aarch64_linux_fpregset, regcache, regno, + (gdb_byte *) fpregsetp, AARCH64_LINUX_SIZEOF_FPREGSET); } @@ -730,21 +731,19 @@ aarch64_linux_nat_target::low_new_fork (struct lwp_info *parent, child_state = aarch64_get_debug_reg_state (child_pid); *child_state = *parent_state; } - /* Called by libthread_db. Returns a pointer to the thread local storage (or its descriptor). */ ps_err_e -ps_get_thread_area (struct ps_prochandle *ph, - lwpid_t lwpid, int idx, void **base) +ps_get_thread_area (struct ps_prochandle *ph, lwpid_t lwpid, int idx, + void **base) { int is_64bit_p = (gdbarch_bfd_arch_info (target_gdbarch ())->bits_per_word == 64); return aarch64_ps_get_thread_area (ph, lwpid, idx, base, is_64bit_p); } - /* Implement the virtual inf_ptrace_target::post_startup_inferior method. */ @@ -842,8 +841,7 @@ aarch64_linux_nat_target::stopped_data_address (CORE_ADDR *addr_p) return false; /* This must be a hardware breakpoint. */ - if (siginfo.si_signo != SIGTRAP - || (siginfo.si_code & 0xffff) != TRAP_HWBKPT) + if (siginfo.si_signo != SIGTRAP || (siginfo.si_code & 0xffff) != TRAP_HWBKPT) return false; /* Make sure to ignore the top byte, otherwise we may not recognize a @@ -948,7 +946,8 @@ aarch64_linux_nat_target::fetch_memtags (CORE_ADDR address, size_t len, bool aarch64_linux_nat_target::store_memtags (CORE_ADDR address, size_t len, - const gdb::byte_vector &tags, int type) + const gdb::byte_vector &tags, + int type) { int tid = get_ptrace_pid (inferior_ptid); @@ -960,6 +959,7 @@ aarch64_linux_nat_target::store_memtags (CORE_ADDR address, size_t len, } void _initialize_aarch64_linux_nat (); + void _initialize_aarch64_linux_nat () { diff --git a/gdb/aarch64-linux-tdep.c b/gdb/aarch64-linux-tdep.c index 20a041c..b1d8089 100644 --- a/gdb/aarch64-linux-tdep.c +++ b/gdb/aarch64-linux-tdep.c @@ -140,38 +140,37 @@ /* These magic numbers need to reflect the layout of the kernel defined struct rt_sigframe and ucontext. */ -#define AARCH64_SIGCONTEXT_REG_SIZE 8 -#define AARCH64_RT_SIGFRAME_UCONTEXT_OFFSET 128 -#define AARCH64_UCONTEXT_SIGCONTEXT_OFFSET 176 -#define AARCH64_SIGCONTEXT_XO_OFFSET 8 -#define AARCH64_SIGCONTEXT_RESERVED_OFFSET 288 +#define AARCH64_SIGCONTEXT_REG_SIZE 8 +#define AARCH64_RT_SIGFRAME_UCONTEXT_OFFSET 128 +#define AARCH64_UCONTEXT_SIGCONTEXT_OFFSET 176 +#define AARCH64_SIGCONTEXT_XO_OFFSET 8 +#define AARCH64_SIGCONTEXT_RESERVED_OFFSET 288 -#define AARCH64_SIGCONTEXT_RESERVED_SIZE 4096 +#define AARCH64_SIGCONTEXT_RESERVED_SIZE 4096 /* Unique identifiers that may be used for aarch64_ctx.magic. */ -#define AARCH64_EXTRA_MAGIC 0x45585401 -#define AARCH64_FPSIMD_MAGIC 0x46508001 -#define AARCH64_SVE_MAGIC 0x53564501 +#define AARCH64_EXTRA_MAGIC 0x45585401 +#define AARCH64_FPSIMD_MAGIC 0x46508001 +#define AARCH64_SVE_MAGIC 0x53564501 /* Defines for the extra_context that follows an AARCH64_EXTRA_MAGIC. */ -#define AARCH64_EXTRA_DATAP_OFFSET 8 +#define AARCH64_EXTRA_DATAP_OFFSET 8 /* Defines for the fpsimd that follows an AARCH64_FPSIMD_MAGIC. */ -#define AARCH64_FPSIMD_FPSR_OFFSET 8 -#define AARCH64_FPSIMD_FPCR_OFFSET 12 -#define AARCH64_FPSIMD_V0_OFFSET 16 -#define AARCH64_FPSIMD_VREG_SIZE 16 +#define AARCH64_FPSIMD_FPSR_OFFSET 8 +#define AARCH64_FPSIMD_FPCR_OFFSET 12 +#define AARCH64_FPSIMD_V0_OFFSET 16 +#define AARCH64_FPSIMD_VREG_SIZE 16 /* Defines for the sve structure that follows an AARCH64_SVE_MAGIC. */ -#define AARCH64_SVE_CONTEXT_VL_OFFSET 8 -#define AARCH64_SVE_CONTEXT_REGS_OFFSET 16 +#define AARCH64_SVE_CONTEXT_VL_OFFSET 8 +#define AARCH64_SVE_CONTEXT_REGS_OFFSET 16 #define AARCH64_SVE_CONTEXT_P_REGS_OFFSET(vq) (32 * vq * 16) #define AARCH64_SVE_CONTEXT_FFR_OFFSET(vq) \ (AARCH64_SVE_CONTEXT_P_REGS_OFFSET (vq) + (16 * vq * 2)) #define AARCH64_SVE_CONTEXT_SIZE(vq) \ (AARCH64_SVE_CONTEXT_FFR_OFFSET (vq) + (vq * 2)) - /* Read an aarch64_ctx, returning the magic value, and setting *SIZE to the size, or return 0 on error. */ @@ -221,41 +220,46 @@ aarch64_linux_restore_vreg (struct trad_frame_cache *cache, int num_regs, if (target_read_memory (offset, buf, V_REGISTER_SIZE) != 0) { - size_t size = V_REGISTER_SIZE/2; + size_t size = V_REGISTER_SIZE / 2; /* Read the two halves of the V register in reverse byte order. */ - CORE_ADDR u64 = extract_unsigned_integer (buf, size, - byte_order); - CORE_ADDR l64 = extract_unsigned_integer (buf + size, size, - byte_order); + CORE_ADDR u64 = extract_unsigned_integer (buf, size, byte_order); + CORE_ADDR l64 + = extract_unsigned_integer (buf + size, size, byte_order); /* Copy the reversed bytes to the buffer. */ store_unsigned_integer (buf, size, BFD_ENDIAN_LITTLE, l64); - store_unsigned_integer (buf + size , size, BFD_ENDIAN_LITTLE, u64); + store_unsigned_integer (buf + size, size, BFD_ENDIAN_LITTLE, u64); /* Now we can store the correct bytes for the V register. */ trad_frame_set_reg_value_bytes (cache, AARCH64_V0_REGNUM + vreg_num, - {buf, V_REGISTER_SIZE}); + { buf, V_REGISTER_SIZE }); trad_frame_set_reg_value_bytes (cache, num_regs + AARCH64_Q0_REGNUM - + vreg_num, {buf, Q_REGISTER_SIZE}); + + vreg_num, + { buf, Q_REGISTER_SIZE }); trad_frame_set_reg_value_bytes (cache, num_regs + AARCH64_D0_REGNUM - + vreg_num, {buf, D_REGISTER_SIZE}); + + vreg_num, + { buf, D_REGISTER_SIZE }); trad_frame_set_reg_value_bytes (cache, num_regs + AARCH64_S0_REGNUM - + vreg_num, {buf, S_REGISTER_SIZE}); + + vreg_num, + { buf, S_REGISTER_SIZE }); trad_frame_set_reg_value_bytes (cache, num_regs + AARCH64_H0_REGNUM - + vreg_num, {buf, H_REGISTER_SIZE}); + + vreg_num, + { buf, H_REGISTER_SIZE }); trad_frame_set_reg_value_bytes (cache, num_regs + AARCH64_B0_REGNUM - + vreg_num, {buf, B_REGISTER_SIZE}); + + vreg_num, + { buf, B_REGISTER_SIZE }); if (has_sve) trad_frame_set_reg_value_bytes (cache, num_regs + AARCH64_SVE_V0_REGNUM - + vreg_num, {buf, V_REGISTER_SIZE}); + + vreg_num, + { buf, V_REGISTER_SIZE }); } return; } @@ -275,9 +279,9 @@ aarch64_linux_restore_vreg (struct trad_frame_cache *cache, int num_regs, offset); if (has_sve) - trad_frame_set_reg_addr (cache, num_regs + AARCH64_SVE_V0_REGNUM - + vreg_num, offset); - + trad_frame_set_reg_addr (cache, + num_regs + AARCH64_SVE_V0_REGNUM + vreg_num, + offset); } /* Implement the "init" method of struct tramp_frame. */ @@ -293,7 +297,7 @@ aarch64_linux_sigframe_init (const struct tramp_frame *self, aarch64_gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); CORE_ADDR sp = get_frame_register_unsigned (this_frame, AARCH64_SP_REGNUM); CORE_ADDR sigcontext_addr = (sp + AARCH64_RT_SIGFRAME_UCONTEXT_OFFSET - + AARCH64_UCONTEXT_SIGCONTEXT_OFFSET ); + + AARCH64_UCONTEXT_SIGCONTEXT_OFFSET); CORE_ADDR section = sigcontext_addr + AARCH64_SIGCONTEXT_RESERVED_OFFSET; CORE_ADDR section_end = section + AARCH64_SIGCONTEXT_RESERVED_SIZE; CORE_ADDR fpsimd = 0; @@ -306,8 +310,7 @@ aarch64_linux_sigframe_init (const struct tramp_frame *self, for (int i = 0; i < 31; i++) { - trad_frame_set_reg_addr (this_cache, - AARCH64_X0_REGNUM + i, + trad_frame_set_reg_addr (this_cache, AARCH64_X0_REGNUM + i, sigcontext_addr + AARCH64_SIGCONTEXT_XO_OFFSET + i * AARCH64_SIGCONTEXT_REG_SIZE); } @@ -340,15 +343,17 @@ aarch64_linux_sigframe_init (const struct tramp_frame *self, break; if (target_read_memory (section + AARCH64_SVE_CONTEXT_VL_OFFSET, - buf, 2) != 0) + buf, 2) + != 0) { section += size; break; } - vq = sve_vq_from_vl (extract_unsigned_integer (buf, 2, byte_order)); + vq + = sve_vq_from_vl (extract_unsigned_integer (buf, 2, byte_order)); if (vq != tdep->vq) - error (_("Invalid vector length in signal frame %d vs %s."), vq, + error (_ ("Invalid vector length in signal frame %d vs %s."), vq, pulongest (tdep->vq)); if (size >= AARCH64_SVE_CONTEXT_SIZE (vq)) @@ -366,8 +371,9 @@ aarch64_linux_sigframe_init (const struct tramp_frame *self, structures. */ gdb_byte buf[8]; - if (target_read_memory (section + AARCH64_EXTRA_DATAP_OFFSET, - buf, 8) != 0) + if (target_read_memory (section + AARCH64_EXTRA_DATAP_OFFSET, buf, + 8) + != 0) { section += size; break; @@ -402,16 +408,16 @@ aarch64_linux_sigframe_init (const struct tramp_frame *self, trad_frame_set_reg_addr (this_cache, num_regs + AARCH64_SVE_V0_REGNUM + i, offset); - trad_frame_set_reg_addr (this_cache, num_regs + AARCH64_Q0_REGNUM + i, - offset); - trad_frame_set_reg_addr (this_cache, num_regs + AARCH64_D0_REGNUM + i, - offset); - trad_frame_set_reg_addr (this_cache, num_regs + AARCH64_S0_REGNUM + i, - offset); - trad_frame_set_reg_addr (this_cache, num_regs + AARCH64_H0_REGNUM + i, - offset); - trad_frame_set_reg_addr (this_cache, num_regs + AARCH64_B0_REGNUM + i, - offset); + trad_frame_set_reg_addr (this_cache, + num_regs + AARCH64_Q0_REGNUM + i, offset); + trad_frame_set_reg_addr (this_cache, + num_regs + AARCH64_D0_REGNUM + i, offset); + trad_frame_set_reg_addr (this_cache, + num_regs + AARCH64_S0_REGNUM + i, offset); + trad_frame_set_reg_addr (this_cache, + num_regs + AARCH64_H0_REGNUM + i, offset); + trad_frame_set_reg_addr (this_cache, + num_regs + AARCH64_B0_REGNUM + i, offset); } offset = sve_regs + AARCH64_SVE_CONTEXT_P_REGS_OFFSET (tdep->vq); @@ -447,80 +453,66 @@ aarch64_linux_sigframe_init (const struct tramp_frame *self, trad_frame_set_id (this_cache, frame_id_build (sp, func)); } -static const struct tramp_frame aarch64_linux_rt_sigframe = -{ - SIGTRAMP_FRAME, - 4, - { - /* movz x8, 0x8b (S=1,o=10,h=0,i=0x8b,r=8) +static const struct tramp_frame aarch64_linux_rt_sigframe + = { SIGTRAMP_FRAME, + 4, + { /* movz x8, 0x8b (S=1,o=10,h=0,i=0x8b,r=8) Soo1 0010 1hhi iiii iiii iiii iiir rrrr */ - {0xd2801168, ULONGEST_MAX}, + { 0xd2801168, ULONGEST_MAX }, - /* svc 0x0 (o=0, l=1) + /* svc 0x0 (o=0, l=1) 1101 0100 oooi iiii iiii iiii iii0 00ll */ - {0xd4000001, ULONGEST_MAX}, - {TRAMP_SENTINEL_INSN, ULONGEST_MAX} - }, - aarch64_linux_sigframe_init -}; + { 0xd4000001, ULONGEST_MAX }, + { TRAMP_SENTINEL_INSN, ULONGEST_MAX } }, + aarch64_linux_sigframe_init }; /* Register maps. */ -static const struct regcache_map_entry aarch64_linux_gregmap[] = - { - { 31, AARCH64_X0_REGNUM, 8 }, /* x0 ... x30 */ - { 1, AARCH64_SP_REGNUM, 8 }, - { 1, AARCH64_PC_REGNUM, 8 }, - { 1, AARCH64_CPSR_REGNUM, 8 }, - { 0 } - }; +static const struct regcache_map_entry aarch64_linux_gregmap[] + = { { 31, AARCH64_X0_REGNUM, 8 }, /* x0 ... x30 */ + { 1, AARCH64_SP_REGNUM, 8 }, + { 1, AARCH64_PC_REGNUM, 8 }, + { 1, AARCH64_CPSR_REGNUM, 8 }, + { 0 } }; -static const struct regcache_map_entry aarch64_linux_fpregmap[] = - { - { 32, AARCH64_V0_REGNUM, 16 }, /* v0 ... v31 */ - { 1, AARCH64_FPSR_REGNUM, 4 }, - { 1, AARCH64_FPCR_REGNUM, 4 }, - { 0 } - }; +static const struct regcache_map_entry aarch64_linux_fpregmap[] + = { { 32, AARCH64_V0_REGNUM, 16 }, /* v0 ... v31 */ + { 1, AARCH64_FPSR_REGNUM, 4 }, + { 1, AARCH64_FPCR_REGNUM, 4 }, + { 0 } }; /* Register set definitions. */ -const struct regset aarch64_linux_gregset = - { - aarch64_linux_gregmap, - regcache_supply_regset, regcache_collect_regset - }; +const struct regset aarch64_linux_gregset + = { aarch64_linux_gregmap, regcache_supply_regset, regcache_collect_regset }; -const struct regset aarch64_linux_fpregset = - { - aarch64_linux_fpregmap, - regcache_supply_regset, regcache_collect_regset - }; +const struct regset aarch64_linux_fpregset + = { aarch64_linux_fpregmap, regcache_supply_regset, + regcache_collect_regset }; /* The fields in an SVE header at the start of a SVE regset. */ -#define SVE_HEADER_SIZE_LENGTH 4 -#define SVE_HEADER_MAX_SIZE_LENGTH 4 -#define SVE_HEADER_VL_LENGTH 2 -#define SVE_HEADER_MAX_VL_LENGTH 2 -#define SVE_HEADER_FLAGS_LENGTH 2 -#define SVE_HEADER_RESERVED_LENGTH 2 +#define SVE_HEADER_SIZE_LENGTH 4 +#define SVE_HEADER_MAX_SIZE_LENGTH 4 +#define SVE_HEADER_VL_LENGTH 2 +#define SVE_HEADER_MAX_VL_LENGTH 2 +#define SVE_HEADER_FLAGS_LENGTH 2 +#define SVE_HEADER_RESERVED_LENGTH 2 -#define SVE_HEADER_SIZE_OFFSET 0 -#define SVE_HEADER_MAX_SIZE_OFFSET \ +#define SVE_HEADER_SIZE_OFFSET 0 +#define SVE_HEADER_MAX_SIZE_OFFSET \ (SVE_HEADER_SIZE_OFFSET + SVE_HEADER_SIZE_LENGTH) -#define SVE_HEADER_VL_OFFSET \ +#define SVE_HEADER_VL_OFFSET \ (SVE_HEADER_MAX_SIZE_OFFSET + SVE_HEADER_MAX_SIZE_LENGTH) -#define SVE_HEADER_MAX_VL_OFFSET \ - (SVE_HEADER_VL_OFFSET + SVE_HEADER_VL_LENGTH) -#define SVE_HEADER_FLAGS_OFFSET \ +#define SVE_HEADER_MAX_VL_OFFSET (SVE_HEADER_VL_OFFSET + SVE_HEADER_VL_LENGTH) +#define SVE_HEADER_FLAGS_OFFSET \ (SVE_HEADER_MAX_VL_OFFSET + SVE_HEADER_MAX_VL_LENGTH) -#define SVE_HEADER_RESERVED_OFFSET \ +#define SVE_HEADER_RESERVED_OFFSET \ (SVE_HEADER_FLAGS_OFFSET + SVE_HEADER_FLAGS_LENGTH) -#define SVE_HEADER_SIZE \ +#define SVE_HEADER_SIZE \ (SVE_HEADER_RESERVED_OFFSET + SVE_HEADER_RESERVED_LENGTH) -#define SVE_HEADER_FLAG_SVE 1 +#define SVE_HEADER_FLAG_SVE 1 /* Get VQ value from SVE section in the core dump. */ @@ -542,14 +534,15 @@ aarch64_linux_core_read_vq (struct gdbarch *gdbarch, bfd *abfd) /* Check extended state size. */ if (size < SVE_HEADER_SIZE) { - warning (_("'.reg-aarch-sve' section in core file too small.")); + warning (_ ("'.reg-aarch-sve' section in core file too small.")); return 0; } - if (!bfd_get_section_contents (abfd, sve_section, header, 0, SVE_HEADER_SIZE)) + if (!bfd_get_section_contents (abfd, sve_section, header, 0, + SVE_HEADER_SIZE)) { - warning (_("Couldn't read sve header from " - "'.reg-aarch-sve' section in core file.")); + warning (_ ("Couldn't read sve header from " + "'.reg-aarch-sve' section in core file.")); return 0; } @@ -559,13 +552,15 @@ aarch64_linux_core_read_vq (struct gdbarch *gdbarch, bfd *abfd) if (vq > AARCH64_MAX_SVE_VQ) { - warning (_("SVE Vector length in core file not supported by this version" - " of GDB. (VQ=%s)"), pulongest (vq)); + warning ( + _ ("SVE Vector length in core file not supported by this version" + " of GDB. (VQ=%s)"), + pulongest (vq)); return 0; } else if (vq == 0) { - warning (_("SVE Vector length in core file is invalid. (VQ=%s"), + warning (_ ("SVE Vector length in core file is invalid. (VQ=%s"), pulongest (vq)); return 0; } @@ -579,8 +574,8 @@ aarch64_linux_core_read_vq (struct gdbarch *gdbarch, bfd *abfd) static void aarch64_linux_supply_sve_regset (const struct regset *regset, - struct regcache *regcache, - int regnum, const void *buf, size_t size) + struct regcache *regcache, int regnum, + const void *buf, size_t size) { gdb_byte *header = (gdb_byte *) buf; struct gdbarch *gdbarch = regcache->arch (); @@ -596,14 +591,14 @@ aarch64_linux_supply_sve_regset (const struct regset *regset, /* Extract required fields from the header. */ ULONGEST vl = extract_unsigned_integer (header + SVE_HEADER_VL_OFFSET, SVE_HEADER_VL_LENGTH, byte_order); - uint16_t flags = extract_unsigned_integer (header + SVE_HEADER_FLAGS_OFFSET, - SVE_HEADER_FLAGS_LENGTH, - byte_order); + uint16_t flags + = extract_unsigned_integer (header + SVE_HEADER_FLAGS_OFFSET, + SVE_HEADER_FLAGS_LENGTH, byte_order); if (regnum == -1 || regnum == AARCH64_SVE_VG_REGNUM) { gdb_byte vg_target[8]; - store_integer ((gdb_byte *)&vg_target, sizeof (uint64_t), byte_order, + store_integer ((gdb_byte *) &vg_target, sizeof (uint64_t), byte_order, sve_vg_from_vl (vl)); regcache->raw_supply (AARCH64_SVE_VG_REGNUM, &vg_target); } @@ -638,8 +633,8 @@ aarch64_linux_supply_sve_regset (const struct regset *regset, static void aarch64_linux_collect_sve_regset (const struct regset *regset, - const struct regcache *regcache, - int regnum, void *buf, size_t size) + const struct regcache *regcache, int regnum, + void *buf, size_t size) { gdb_byte *header = (gdb_byte *) buf; struct gdbarch *gdbarch = regcache->arch (); @@ -675,10 +670,9 @@ aarch64_linux_collect_sve_regset (const struct regset *regset, /* Implement the "iterate_over_regset_sections" gdbarch method. */ static void -aarch64_linux_iterate_over_regset_sections (struct gdbarch *gdbarch, - iterate_over_regset_sections_cb *cb, - void *cb_data, - const struct regcache *regcache) +aarch64_linux_iterate_over_regset_sections ( + struct gdbarch *gdbarch, iterate_over_regset_sections_cb *cb, void *cb_data, + const struct regcache *regcache) { aarch64_gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); @@ -688,22 +682,17 @@ aarch64_linux_iterate_over_regset_sections (struct gdbarch *gdbarch, if (tdep->has_sve ()) { /* Create this on the fly in order to handle vector register sizes. */ - const struct regcache_map_entry sve_regmap[] = - { - { 32, AARCH64_SVE_Z0_REGNUM, (int) (tdep->vq * 16) }, - { 16, AARCH64_SVE_P0_REGNUM, (int) (tdep->vq * 16 / 8) }, - { 1, AARCH64_SVE_FFR_REGNUM, (int) (tdep->vq * 16 / 8) }, - { 1, AARCH64_FPSR_REGNUM, 4 }, - { 1, AARCH64_FPCR_REGNUM, 4 }, - { 0 } - }; - - const struct regset aarch64_linux_sve_regset = - { - sve_regmap, - aarch64_linux_supply_sve_regset, aarch64_linux_collect_sve_regset, - REGSET_VARIABLE_SIZE - }; + const struct regcache_map_entry sve_regmap[] + = { { 32, AARCH64_SVE_Z0_REGNUM, (int) (tdep->vq * 16) }, + { 16, AARCH64_SVE_P0_REGNUM, (int) (tdep->vq * 16 / 8) }, + { 1, AARCH64_SVE_FFR_REGNUM, (int) (tdep->vq * 16 / 8) }, + { 1, AARCH64_FPSR_REGNUM, 4 }, + { 1, AARCH64_FPCR_REGNUM, 4 }, + { 0 } }; + + const struct regset aarch64_linux_sve_regset + = { sve_regmap, aarch64_linux_supply_sve_regset, + aarch64_linux_collect_sve_regset, REGSET_VARIABLE_SIZE }; cb (".reg-aarch-sve", SVE_HEADER_SIZE + regcache_map_entry_size (aarch64_linux_fpregmap), @@ -714,20 +703,15 @@ aarch64_linux_iterate_over_regset_sections (struct gdbarch *gdbarch, cb (".reg2", AARCH64_LINUX_SIZEOF_FPREGSET, AARCH64_LINUX_SIZEOF_FPREGSET, &aarch64_linux_fpregset, NULL, cb_data); - if (tdep->has_pauth ()) { /* Create this on the fly in order to handle the variable location. */ - const struct regcache_map_entry pauth_regmap[] = - { - { 2, AARCH64_PAUTH_DMASK_REGNUM (tdep->pauth_reg_base), 8}, - { 0 } - }; + const struct regcache_map_entry pauth_regmap[] + = { { 2, AARCH64_PAUTH_DMASK_REGNUM (tdep->pauth_reg_base), 8 }, + { 0 } }; - const struct regset aarch64_linux_pauth_regset = - { - pauth_regmap, regcache_supply_regset, regcache_collect_regset - }; + const struct regset aarch64_linux_pauth_regset + = { pauth_regmap, regcache_supply_regset, regcache_collect_regset }; cb (".reg-aarch-pauth", AARCH64_LINUX_SIZEOF_PAUTH, AARCH64_LINUX_SIZEOF_PAUTH, &aarch64_linux_pauth_regset, @@ -738,16 +722,11 @@ aarch64_linux_iterate_over_regset_sections (struct gdbarch *gdbarch, if (tdep->has_mte ()) { /* Create this on the fly in order to handle the variable location. */ - const struct regcache_map_entry mte_regmap[] = - { - { 1, tdep->mte_reg_base, 8}, - { 0 } - }; + const struct regcache_map_entry mte_regmap[] + = { { 1, tdep->mte_reg_base, 8 }, { 0 } }; - const struct regset aarch64_linux_mte_regset = - { - mte_regmap, regcache_supply_regset, regcache_collect_regset - }; + const struct regset aarch64_linux_mte_regset + = { mte_regmap, regcache_supply_regset, regcache_collect_regset }; cb (".reg-aarch-mte", AARCH64_LINUX_SIZEOF_MTE_REGSET, AARCH64_LINUX_SIZEOF_MTE_REGSET, &aarch64_linux_mte_regset, @@ -763,18 +742,14 @@ aarch64_linux_iterate_over_regset_sections (struct gdbarch *gdbarch, int sizeof_tls_regset = AARCH64_TLS_REGISTER_SIZE * tdep->tls_register_count; - const struct regcache_map_entry tls_regmap[] = - { - { tdep->tls_register_count, tdep->tls_regnum_base, - AARCH64_TLS_REGISTER_SIZE }, - { 0 } - }; + const struct regcache_map_entry tls_regmap[] + = { { tdep->tls_register_count, tdep->tls_regnum_base, + AARCH64_TLS_REGISTER_SIZE }, + { 0 } }; - const struct regset aarch64_linux_tls_regset = - { - tls_regmap, regcache_supply_regset, regcache_collect_regset, - REGSET_VARIABLE_SIZE - }; + const struct regset aarch64_linux_tls_regset + = { tls_regmap, regcache_supply_regset, regcache_collect_regset, + REGSET_VARIABLE_SIZE }; cb (".reg-aarch-tls", sizeof_tls_regset, sizeof_tls_regset, &aarch64_linux_tls_regset, "TLS register", cb_data); @@ -816,8 +791,8 @@ static int aarch64_stap_is_single_operand (struct gdbarch *gdbarch, const char *s) { return (*s == '#' || isdigit (*s) /* Literal number. */ - || *s == '[' /* Register indirection. */ - || isalpha (*s)); /* Register value. */ + || *s == '[' /* Register indirection. */ + || isalpha (*s)); /* Register value. */ } /* This routine is used to parse a special token in AArch64's assembly. @@ -858,7 +833,7 @@ aarch64_stap_parse_special_token (struct gdbarch *gdbarch, std::string regname (start, len); if (user_reg_map_name_to_regnum (gdbarch, regname.c_str (), len) == -1) - error (_("Invalid register name `%s' on expression `%s'."), + error (_ ("Invalid register name `%s' on expression `%s'."), regname.c_str (), p->saved_arg); ++tmp; @@ -893,8 +868,8 @@ aarch64_stap_parse_special_token (struct gdbarch *gdbarch, struct type *long_type = builtin_type (gdbarch)->builtin_long; if (got_minus) displacement = -displacement; - operation_up disp = make_operation (long_type, - displacement); + operation_up disp + = make_operation (long_type, displacement); /* The register name. */ operation_up reg @@ -905,8 +880,8 @@ aarch64_stap_parse_special_token (struct gdbarch *gdbarch, /* Casting to the expected type. */ struct type *arg_ptr_type = lookup_pointer_type (p->arg_type); - sum = make_operation (std::move (sum), - arg_ptr_type); + sum + = make_operation (std::move (sum), arg_ptr_type); return make_operation (std::move (sum)); } return {}; @@ -919,7 +894,8 @@ static linux_record_tdep aarch64_linux_record_tdep; /* Enum that defines the AArch64 linux specific syscall identifiers used for process record/replay. */ -enum aarch64_syscall { +enum aarch64_syscall +{ aarch64_sys_io_setup = 0, aarch64_sys_io_destroy = 1, aarch64_sys_io_submit = 2, @@ -1190,11 +1166,13 @@ enum aarch64_syscall { static enum gdb_syscall aarch64_canonicalize_syscall (enum aarch64_syscall syscall_number) { -#define SYSCALL_MAP(SYSCALL) case aarch64_sys_##SYSCALL: \ - return gdb_sys_##SYSCALL +#define SYSCALL_MAP(SYSCALL) \ + case aarch64_sys_##SYSCALL: \ + return gdb_sys_##SYSCALL -#define UNSUPPORTED_SYSCALL_MAP(SYSCALL) case aarch64_sys_##SYSCALL: \ - return gdb_sys_no_syscall +#define UNSUPPORTED_SYSCALL_MAP(SYSCALL) \ + case aarch64_sys_##SYSCALL: \ + return gdb_sys_no_syscall switch (syscall_number) { @@ -1464,9 +1442,9 @@ aarch64_canonicalize_syscall (enum aarch64_syscall syscall_number) UNSUPPORTED_SYSCALL_MAP (sched_setattr); UNSUPPORTED_SYSCALL_MAP (sched_getattr); SYSCALL_MAP (getrandom); - default: - return gdb_sys_no_syscall; - } + default: + return gdb_sys_no_syscall; + } } /* Retrieve the syscall number at a ptrace syscall-stop, either on syscall entry @@ -1496,7 +1474,7 @@ aarch64_linux_get_syscall_number (struct gdbarch *gdbarch, thread_info *thread) regs->cooked_read (AARCH64_X0_REGNUM + 1, &x1); regs->cooked_read (AARCH64_FP_REGNUM, &fp); regs->cooked_read (AARCH64_LR_REGNUM, &lr); - if (x1 == 0 && fp ==0 && lr == 0) + if (x1 == 0 && fp == 0 && lr == 0) return aarch64_sys_execve; } @@ -1529,25 +1507,24 @@ aarch64_linux_syscall_record (struct regcache *regcache, int ret = 0; enum gdb_syscall syscall_gdb; - syscall_gdb = - aarch64_canonicalize_syscall ((enum aarch64_syscall) svc_number); + syscall_gdb + = aarch64_canonicalize_syscall ((enum aarch64_syscall) svc_number); if (syscall_gdb < 0) { gdb_printf (gdb_stderr, - _("Process record and replay target doesn't " - "support syscall number %s\n"), + _ ("Process record and replay target doesn't " + "support syscall number %s\n"), plongest (svc_number)); return -1; } - if (syscall_gdb == gdb_sys_sigreturn - || syscall_gdb == gdb_sys_rt_sigreturn) - { - if (aarch64_all_but_pc_registers_record (regcache)) - return -1; - return 0; - } + if (syscall_gdb == gdb_sys_sigreturn || syscall_gdb == gdb_sys_rt_sigreturn) + { + if (aarch64_all_but_pc_registers_record (regcache)) + return -1; + return 0; + } ret = record_linux_system_call (syscall_gdb, regcache, &aarch64_linux_record_tdep); @@ -1592,7 +1569,7 @@ aarch64_mte_get_atag (CORE_ADDR address) /* Only one tag should've been returned. Make sure we got exactly that. */ if (tags.size () != 1) - error (_("Target returned an unexpected number of tags.")); + error (_ ("Target returned an unexpected number of tags.")); /* Although our tags are 4 bits in size, they are stored in a byte. */ @@ -1622,8 +1599,7 @@ aarch64_linux_tagged_address_p (struct gdbarch *gdbarch, struct value *address) /* Implement the memtag_matches_p gdbarch method. */ static bool -aarch64_linux_memtag_matches_p (struct gdbarch *gdbarch, - struct value *address) +aarch64_linux_memtag_matches_p (struct gdbarch *gdbarch, struct value *address) { gdb_assert (address != nullptr); @@ -1698,10 +1674,10 @@ aarch64_linux_set_memtags (struct gdbarch *gdbarch, struct value *address, size_t n = tags.size (); if (g < n) - warning (_("Got more tags than memory granules. Tags will be " - "truncated.")); + warning (_ ("Got more tags than memory granules. Tags will be " + "truncated.")); else if (g > n) - warning (_("Using tag pattern to fill memory range.")); + warning (_ ("Using tag pattern to fill memory range.")); if (!target_store_memtags (addr, length, tags, static_cast (memtag_type::allocation))) @@ -1748,7 +1724,8 @@ aarch64_linux_get_memtag (struct gdbarch *gdbarch, struct value *address, /* Implement the memtag_to_string gdbarch method. */ static std::string -aarch64_linux_memtag_to_string (struct gdbarch *gdbarch, struct value *tag_value) +aarch64_linux_memtag_to_string (struct gdbarch *gdbarch, + struct value *tag_value) { if (tag_value == nullptr) return ""; @@ -1795,12 +1772,12 @@ aarch64_linux_report_signal_info (struct gdbarch *gdbarch, uiout->text ("\n"); - uiout->field_string ("sigcode-meaning", _("Memory tag violation")); + uiout->field_string ("sigcode-meaning", _ ("Memory tag violation")); /* For synchronous faults, show additional information. */ if (si_code == SEGV_MTESERR) { - uiout->text (_(" while accessing address ")); + uiout->text (_ (" while accessing address ")); uiout->field_core_addr ("fault-addr", gdbarch, fault_addr); uiout->text ("\n"); @@ -1810,20 +1787,20 @@ aarch64_linux_report_signal_info (struct gdbarch *gdbarch, gdb_byte ltag = aarch64_mte_get_ltag (fault_addr); if (!atag.has_value ()) - uiout->text (_("Allocation tag unavailable")); + uiout->text (_ ("Allocation tag unavailable")); else { - uiout->text (_("Allocation tag ")); + uiout->text (_ ("Allocation tag ")); uiout->field_string ("allocation-tag", hex_string (*atag)); uiout->text ("\n"); - uiout->text (_("Logical tag ")); + uiout->text (_ ("Logical tag ")); uiout->field_string ("logical-tag", hex_string (ltag)); } } else { uiout->text ("\n"); - uiout->text (_("Fault address unavailable")); + uiout->text (_ ("Fault address unavailable")); } } @@ -1894,17 +1871,16 @@ aarch64_linux_fill_memtag_section (struct gdbarch *gdbarch, asection *osec) { /* Transfer tags in chunks. */ gdb::byte_vector tags_read; - size_t xfer_len - = ((granules >= MAX_TAGS_TO_TRANSFER) - ? MAX_TAGS_TO_TRANSFER * AARCH64_MTE_GRANULE_SIZE - : granules * AARCH64_MTE_GRANULE_SIZE); + size_t xfer_len = ((granules >= MAX_TAGS_TO_TRANSFER) + ? MAX_TAGS_TO_TRANSFER * AARCH64_MTE_GRANULE_SIZE + : granules * AARCH64_MTE_GRANULE_SIZE); if (!target_fetch_memtags (address, xfer_len, tags_read, static_cast (memtag_type::allocation))) { - warning (_("Failed to read MTE tags from memory range [%s,%s)."), - phex_nz (start_address, sizeof (start_address)), - phex_nz (end_address, sizeof (end_address))); + warning (_ ("Failed to read MTE tags from memory range [%s,%s)."), + phex_nz (start_address, sizeof (start_address)), + phex_nz (end_address, sizeof (end_address))); return false; } @@ -1919,13 +1895,12 @@ aarch64_linux_fill_memtag_section (struct gdbarch *gdbarch, asection *osec) /* Pack the MTE tag bits. */ aarch64_mte_pack_tags (tags); - if (!bfd_set_section_contents (osec->owner, osec, tags.data (), - 0, tags.size ())) + if (!bfd_set_section_contents (osec->owner, osec, tags.data (), 0, + tags.size ())) { - warning (_("Failed to write %s bytes of corefile memory " - "tag content (%s)."), - pulongest (tags.size ()), - bfd_errmsg (bfd_get_error ())); + warning (_ ("Failed to write %s bytes of corefile memory " + "tag content (%s)."), + pulongest (tags.size ()), bfd_errmsg (bfd_get_error ())); } return true; } @@ -1938,8 +1913,7 @@ aarch64_linux_fill_memtag_section (struct gdbarch *gdbarch, asection *osec) static gdb::byte_vector aarch64_linux_decode_memtag_section (struct gdbarch *gdbarch, - bfd_section *section, - int type, + bfd_section *section, int type, CORE_ADDR address, size_t length) { gdb_assert (section != nullptr); @@ -1948,8 +1922,8 @@ aarch64_linux_decode_memtag_section (struct gdbarch *gdbarch, gdb_assert (section->vma <= address); /* Figure out how many tags we need to fetch in this memory range. */ - size_t granules = aarch64_mte_get_tag_granules (address, length, - AARCH64_MTE_GRANULE_SIZE); + size_t granules + = aarch64_mte_get_tag_granules (address, length, AARCH64_MTE_GRANULE_SIZE); /* Sanity check. */ gdb_assert (granules > 0); @@ -1965,9 +1939,9 @@ aarch64_linux_decode_memtag_section (struct gdbarch *gdbarch, /* Figure out the starting offset into the packed tags data. */ file_ptr offset = ((granules_from_vma - granules) >> 1); - if (!bfd_get_section_contents (section->owner, section, tags.data (), - offset, tags.size ())) - error (_("Couldn't read contents from memtag section.")); + if (!bfd_get_section_contents (section->owner, section, tags.data (), offset, + tags.size ())) + error (_ ("Couldn't read contents from memtag section.")); /* At this point, the tags are packed 2 per byte. Unpack them before returning. */ @@ -2019,10 +1993,10 @@ aarch64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { static const char *const stap_integer_prefixes[] = { "#", "", NULL }; static const char *const stap_register_prefixes[] = { "", NULL }; - static const char *const stap_register_indirection_prefixes[] = { "[", - NULL }; - static const char *const stap_register_indirection_suffixes[] = { "]", - NULL }; + static const char *const stap_register_indirection_prefixes[] + = { "[", NULL }; + static const char *const stap_register_indirection_suffixes[] + = { "]", NULL }; aarch64_gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); tdep->lowest_pc = 0x8000; @@ -2045,18 +2019,18 @@ aarch64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) /* Enable longjmp. */ tdep->jb_pc = 11; - set_gdbarch_iterate_over_regset_sections - (gdbarch, aarch64_linux_iterate_over_regset_sections); - set_gdbarch_core_read_description - (gdbarch, aarch64_linux_core_read_description); + set_gdbarch_iterate_over_regset_sections ( + gdbarch, aarch64_linux_iterate_over_regset_sections); + set_gdbarch_core_read_description (gdbarch, + aarch64_linux_core_read_description); /* SystemTap related. */ set_gdbarch_stap_integer_prefixes (gdbarch, stap_integer_prefixes); set_gdbarch_stap_register_prefixes (gdbarch, stap_register_prefixes); - set_gdbarch_stap_register_indirection_prefixes (gdbarch, - stap_register_indirection_prefixes); - set_gdbarch_stap_register_indirection_suffixes (gdbarch, - stap_register_indirection_suffixes); + set_gdbarch_stap_register_indirection_prefixes ( + gdbarch, stap_register_indirection_prefixes); + set_gdbarch_stap_register_indirection_suffixes ( + gdbarch, stap_register_indirection_suffixes); set_gdbarch_stap_is_single_operand (gdbarch, aarch64_stap_is_single_operand); set_gdbarch_stap_parse_special_token (gdbarch, aarch64_stap_parse_special_token); @@ -2079,8 +2053,7 @@ aarch64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) set_gdbarch_tagged_address_p (gdbarch, aarch64_linux_tagged_address_p); /* Register a hook for checking if there is a memory tag match. */ - set_gdbarch_memtag_matches_p (gdbarch, - aarch64_linux_memtag_matches_p); + set_gdbarch_memtag_matches_p (gdbarch, aarch64_linux_memtag_matches_p); /* Register a hook for setting the logical/allocation tags for a range of addresses. */ @@ -2103,12 +2076,12 @@ aarch64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) /* Core file helper to create a memory tag section for a particular PT_LOAD segment. */ - set_gdbarch_create_memtag_section - (gdbarch, aarch64_linux_create_memtag_section); + set_gdbarch_create_memtag_section (gdbarch, + aarch64_linux_create_memtag_section); /* Core file helper to fill a memory tag section with tag data. */ - set_gdbarch_fill_memtag_section - (gdbarch, aarch64_linux_fill_memtag_section); + set_gdbarch_fill_memtag_section (gdbarch, + aarch64_linux_fill_memtag_section); /* Core file helper to decode a memory tag section. */ set_gdbarch_decode_memtag_section (gdbarch, @@ -2284,15 +2257,16 @@ aarch64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) set_gdbarch_displaced_step_copy_insn (gdbarch, aarch64_displaced_step_copy_insn); set_gdbarch_displaced_step_fixup (gdbarch, aarch64_displaced_step_fixup); - set_gdbarch_displaced_step_hw_singlestep (gdbarch, - aarch64_displaced_step_hw_singlestep); + set_gdbarch_displaced_step_hw_singlestep ( + gdbarch, aarch64_displaced_step_hw_singlestep); set_gdbarch_gcc_target_options (gdbarch, aarch64_linux_gcc_target_options); } #if GDB_SELF_TEST -namespace selftests { +namespace selftests +{ /* Verify functions to read and write logical tags. */ @@ -2315,6 +2289,7 @@ aarch64_linux_ltag_tests (void) #endif /* GDB_SELF_TEST */ void _initialize_aarch64_linux_tdep (); + void _initialize_aarch64_linux_tdep () { diff --git a/gdb/aarch64-linux-tdep.h b/gdb/aarch64-linux-tdep.h index 2077597..531c7c0 100644 --- a/gdb/aarch64-linux-tdep.h +++ b/gdb/aarch64-linux-tdep.h @@ -26,7 +26,7 @@ /* The general-purpose regset consists of 31 X registers, plus SP, PC, and PSTATE registers, as defined in the AArch64 port of the Linux kernel. */ -#define AARCH64_LINUX_SIZEOF_GREGSET (34 * X_REGISTER_SIZE) +#define AARCH64_LINUX_SIZEOF_GREGSET (34 * X_REGISTER_SIZE) /* The fp regset consists of 32 V registers, plus FPCR and FPSR which are 4 bytes wide each, and the whole structure is padded to 128 bit diff --git a/gdb/aarch64-nat.c b/gdb/aarch64-nat.c index ee8c5a1..0bd30ea 100644 --- a/gdb/aarch64-nat.c +++ b/gdb/aarch64-nat.c @@ -31,7 +31,7 @@ (e.g., fork children, checkpoints). */ static std::unordered_map -aarch64_debug_process_state; + aarch64_debug_process_state; /* See aarch64-nat.h. */ @@ -123,8 +123,8 @@ aarch64_insert_hw_breakpoint (struct gdbarch *gdbarch, if (show_debug_regs) { - aarch64_show_debug_reg_state (state, - "insert_hw_breakpoint", addr, len, type); + aarch64_show_debug_reg_state (state, "insert_hw_breakpoint", addr, len, + type); } return ret; @@ -156,8 +156,8 @@ aarch64_remove_hw_breakpoint (struct gdbarch *gdbarch, if (show_debug_regs) { - aarch64_show_debug_reg_state (state, - "remove_hw_watchpoint", addr, len, type); + aarch64_show_debug_reg_state (state, "remove_hw_watchpoint", addr, len, + type); } return ret; @@ -168,7 +168,8 @@ aarch64_remove_hw_breakpoint (struct gdbarch *gdbarch, of the type TYPE. Return 0 on success, -1 on failure. */ int -aarch64_insert_watchpoint (CORE_ADDR addr, int len, enum target_hw_bp_type type, +aarch64_insert_watchpoint (CORE_ADDR addr, int len, + enum target_hw_bp_type type, struct expression *cond) { int ret; @@ -187,8 +188,8 @@ aarch64_insert_watchpoint (CORE_ADDR addr, int len, enum target_hw_bp_type type, if (show_debug_regs) { - aarch64_show_debug_reg_state (state, - "insert_watchpoint", addr, len, type); + aarch64_show_debug_reg_state (state, "insert_watchpoint", addr, len, + type); } return ret; @@ -199,7 +200,8 @@ aarch64_insert_watchpoint (CORE_ADDR addr, int len, enum target_hw_bp_type type, type TYPE. Return 0 on success, -1 on failure. */ int -aarch64_remove_watchpoint (CORE_ADDR addr, int len, enum target_hw_bp_type type, +aarch64_remove_watchpoint (CORE_ADDR addr, int len, + enum target_hw_bp_type type, struct expression *cond) { int ret; @@ -218,8 +220,8 @@ aarch64_remove_watchpoint (CORE_ADDR addr, int len, enum target_hw_bp_type type, if (show_debug_regs) { - aarch64_show_debug_reg_state (state, - "remove_watchpoint", addr, len, type); + aarch64_show_debug_reg_state (state, "remove_watchpoint", addr, len, + type); } return ret; @@ -237,15 +239,16 @@ aarch64_stopped_data_address (const struct aarch64_debug_reg_state *state, { const unsigned int offset = aarch64_watchpoint_offset (state->dr_ctrl_wp[i]); - const unsigned int len = aarch64_watchpoint_length (state->dr_ctrl_wp[i]); + const unsigned int len + = aarch64_watchpoint_length (state->dr_ctrl_wp[i]); const CORE_ADDR addr_watch = state->dr_addr_wp[i] + offset; - const CORE_ADDR addr_watch_aligned = align_down (state->dr_addr_wp[i], 8); + const CORE_ADDR addr_watch_aligned + = align_down (state->dr_addr_wp[i], 8); const CORE_ADDR addr_orig = state->dr_addr_orig_wp[i]; if (state->dr_ref_count_wp[i] && DR_CONTROL_ENABLED (state->dr_ctrl_wp[i]) - && addr_trap >= addr_watch_aligned - && addr_trap < addr_watch + len) + && addr_trap >= addr_watch_aligned && addr_trap < addr_watch + len) { /* ADDR_TRAP reports the first address of the memory range accessed by the CPU, regardless of what was the memory @@ -281,16 +284,16 @@ add_show_debug_regs_command (void) /* A maintenance command to enable printing the internal DRi mirror variables. */ add_setshow_boolean_cmd ("show-debug-regs", class_maintenance, - &show_debug_regs, _("\ -Set whether to show variables that mirror the AArch64 debug registers."), _("\ -Show whether to show variables that mirror the AArch64 debug registers."), _("\ + &show_debug_regs, _ ("\ +Set whether to show variables that mirror the AArch64 debug registers."), + _ ("\ +Show whether to show variables that mirror the AArch64 debug registers."), + _ ("\ Use \"on\" to enable, \"off\" to disable.\n\ If enabled, the debug registers values are shown when GDB inserts\n\ or removes a hardware breakpoint or watchpoint, and when the inferior\n\ triggers a breakpoint or watchpoint."), - NULL, - NULL, - &maintenance_set_cmdlist, + NULL, NULL, &maintenance_set_cmdlist, &maintenance_show_cmdlist); } diff --git a/gdb/aarch64-nat.h b/gdb/aarch64-nat.h index fee6bda..fece3e4 100644 --- a/gdb/aarch64-nat.h +++ b/gdb/aarch64-nat.h @@ -72,38 +72,50 @@ int aarch64_stopped_by_hw_breakpoint (); /* Convenience template mixin used to add aarch64 watchpoints support to a target. */ -template +template struct aarch64_nat_target : public BaseTarget { /* Hook in common aarch64 hardware watchpoints/breakpoints support. */ int can_use_hw_breakpoint (enum bptype type, int cnt, int othertype) override - { return aarch64_can_use_hw_breakpoint (type, cnt, othertype); } + { + return aarch64_can_use_hw_breakpoint (type, cnt, othertype); + } int region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) override - { return aarch64_region_ok_for_watchpoint (addr, len); } + { + return aarch64_region_ok_for_watchpoint (addr, len); + } - int insert_watchpoint (CORE_ADDR addr, int len, - enum target_hw_bp_type type, + int insert_watchpoint (CORE_ADDR addr, int len, enum target_hw_bp_type type, struct expression *cond) override - { return aarch64_insert_watchpoint (addr, len, type, cond); } + { + return aarch64_insert_watchpoint (addr, len, type, cond); + } - int remove_watchpoint (CORE_ADDR addr, int len, - enum target_hw_bp_type type, + int remove_watchpoint (CORE_ADDR addr, int len, enum target_hw_bp_type type, struct expression *cond) override - { return aarch64_remove_watchpoint (addr, len, type, cond); } + { + return aarch64_remove_watchpoint (addr, len, type, cond); + } int insert_hw_breakpoint (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt) override - { return aarch64_insert_hw_breakpoint (gdbarch, bp_tgt); } + { + return aarch64_insert_hw_breakpoint (gdbarch, bp_tgt); + } int remove_hw_breakpoint (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt) override - { return aarch64_remove_hw_breakpoint (gdbarch, bp_tgt); } + { + return aarch64_remove_hw_breakpoint (gdbarch, bp_tgt); + } bool watchpoint_addr_within_range (CORE_ADDR addr, CORE_ADDR start, int length) override - { return start <= addr && start + length - 1 >= addr; } + { + return start <= addr && start + length - 1 >= addr; + } }; #endif /* AARCH64_NAT_H */ diff --git a/gdb/aarch64-newlib-tdep.c b/gdb/aarch64-newlib-tdep.c index 276d88d..1182895 100644 --- a/gdb/aarch64-newlib-tdep.c +++ b/gdb/aarch64-newlib-tdep.c @@ -37,6 +37,7 @@ aarch64_newlib_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) } void _initialize_aarch64_newlib_tdep (); + void _initialize_aarch64_newlib_tdep () { diff --git a/gdb/aarch64-ravenscar-thread.c b/gdb/aarch64-ravenscar-thread.c index 7f6d9ef..09df197 100644 --- a/gdb/aarch64-ravenscar-thread.c +++ b/gdb/aarch64-ravenscar-thread.c @@ -30,48 +30,94 @@ /* See aarch64-tdep.h for register numbers. */ -static const int aarch64_context_offsets[] = -{ +static const int aarch64_context_offsets[] = { /* X0 - X28 */ - NO_OFFSET, NO_OFFSET, NO_OFFSET, NO_OFFSET, - NO_OFFSET, NO_OFFSET, NO_OFFSET, NO_OFFSET, - NO_OFFSET, NO_OFFSET, NO_OFFSET, NO_OFFSET, - NO_OFFSET, NO_OFFSET, NO_OFFSET, NO_OFFSET, - NO_OFFSET, NO_OFFSET, NO_OFFSET, 0, - 8, 16, 24, 32, - 40, 48, 56, 64, + NO_OFFSET, + NO_OFFSET, + NO_OFFSET, + NO_OFFSET, + NO_OFFSET, + NO_OFFSET, + NO_OFFSET, + NO_OFFSET, + NO_OFFSET, + NO_OFFSET, + NO_OFFSET, + NO_OFFSET, + NO_OFFSET, + NO_OFFSET, + NO_OFFSET, + NO_OFFSET, + NO_OFFSET, + NO_OFFSET, + NO_OFFSET, + 0, + 8, + 16, + 24, + 32, + 40, + 48, + 56, + 64, 72, /* FP, LR, SP, PC, CPSR */ /* Note that as task switch is synchronous, PC is in fact the LR here */ - 80, 88, 96, 88, + 80, + 88, + 96, + 88, NO_OFFSET, /* V0 - V31 */ - 128, 144, 160, 176, - 192, 208, 224, 240, - 256, 272, 288, 304, - 320, 336, 352, 368, - 384, 400, 416, 432, - 448, 464, 480, 496, - 512, 528, 544, 560, - 576, 592, 608, 624, + 128, + 144, + 160, + 176, + 192, + 208, + 224, + 240, + 256, + 272, + 288, + 304, + 320, + 336, + 352, + 368, + 384, + 400, + 416, + 432, + 448, + 464, + 480, + 496, + 512, + 528, + 544, + 560, + 576, + 592, + 608, + 624, /* FPSR, FPCR */ - 112, 116, + 112, + 116, }; #define V_INIT_OFFSET 640 /* The ravenscar_arch_ops vector for most Aarch64 targets. */ -static struct ravenscar_arch_ops aarch64_ravenscar_ops - (aarch64_context_offsets, - -1, -1, - V_INIT_OFFSET, - /* The FPU context buffer starts with the FPSR register. */ - aarch64_context_offsets[AARCH64_FPSR_REGNUM], - AARCH64_V0_REGNUM, AARCH64_FPCR_REGNUM); +static struct ravenscar_arch_ops aarch64_ravenscar_ops ( + aarch64_context_offsets, -1, -1, V_INIT_OFFSET, + /* The FPU context buffer starts with the FPSR register. */ + aarch64_context_offsets[AARCH64_FPSR_REGNUM], AARCH64_V0_REGNUM, + AARCH64_FPCR_REGNUM); /* Register aarch64_ravenscar_ops in GDBARCH. */ diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c index ea93e9a..2e7af20 100644 --- a/gdb/aarch64-tdep.c +++ b/gdb/aarch64-tdep.c @@ -57,10 +57,10 @@ /* A Homogeneous Floating-Point or Short-Vector Aggregate may have at most four members. */ -#define HA_MAX_NUM_FLDS 4 +#define HA_MAX_NUM_FLDS 4 /* All possible aarch64 target descriptors. */ -static std::unordered_map tdesc_aarch64_map; +static std::unordered_map tdesc_aarch64_map; /* The standard register names, and all the valid aliases for them. We're not adding fp here, that name is already taken, see @@ -69,82 +69,57 @@ static const struct { const char *const name; int regnum; -} aarch64_register_aliases[] = -{ +} aarch64_register_aliases[] = { /* Link register alias for x30. */ - {"lr", AARCH64_LR_REGNUM}, + { "lr", AARCH64_LR_REGNUM }, /* SP is the canonical name for x31 according to aarch64_r_register_names, so we're adding an x31 alias for sp. */ - {"x31", AARCH64_SP_REGNUM}, + { "x31", AARCH64_SP_REGNUM }, /* specials */ - {"ip0", AARCH64_X0_REGNUM + 16}, - {"ip1", AARCH64_X0_REGNUM + 17} + { "ip0", AARCH64_X0_REGNUM + 16 }, + { "ip1", AARCH64_X0_REGNUM + 17 } }; /* The required core 'R' registers. */ -static const char *const aarch64_r_register_names[] = -{ +static const char *const aarch64_r_register_names[] = { /* These registers must appear in consecutive RAW register number order and they must begin with AARCH64_X0_REGNUM! */ - "x0", "x1", "x2", "x3", - "x4", "x5", "x6", "x7", - "x8", "x9", "x10", "x11", - "x12", "x13", "x14", "x15", - "x16", "x17", "x18", "x19", - "x20", "x21", "x22", "x23", - "x24", "x25", "x26", "x27", - "x28", "x29", "x30", "sp", - "pc", "cpsr" + "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7", "x8", + "x9", "x10", "x11", "x12", "x13", "x14", "x15", "x16", "x17", + "x18", "x19", "x20", "x21", "x22", "x23", "x24", "x25", "x26", + "x27", "x28", "x29", "x30", "sp", "pc", "cpsr" }; /* The FP/SIMD 'V' registers. */ -static const char *const aarch64_v_register_names[] = -{ +static const char *const aarch64_v_register_names[] = { /* These registers must appear in consecutive RAW register number order and they must begin with AARCH64_V0_REGNUM! */ - "v0", "v1", "v2", "v3", - "v4", "v5", "v6", "v7", - "v8", "v9", "v10", "v11", - "v12", "v13", "v14", "v15", - "v16", "v17", "v18", "v19", - "v20", "v21", "v22", "v23", - "v24", "v25", "v26", "v27", - "v28", "v29", "v30", "v31", - "fpsr", - "fpcr" + "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", + "v9", "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", + "v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", "v26", + "v27", "v28", "v29", "v30", "v31", "fpsr", "fpcr" }; /* The SVE 'Z' and 'P' registers. */ -static const char *const aarch64_sve_register_names[] = -{ +static const char *const aarch64_sve_register_names[] = { /* These registers must appear in consecutive RAW register number order and they must begin with AARCH64_SVE_Z0_REGNUM! */ - "z0", "z1", "z2", "z3", - "z4", "z5", "z6", "z7", - "z8", "z9", "z10", "z11", - "z12", "z13", "z14", "z15", - "z16", "z17", "z18", "z19", - "z20", "z21", "z22", "z23", - "z24", "z25", "z26", "z27", - "z28", "z29", "z30", "z31", - "fpsr", "fpcr", - "p0", "p1", "p2", "p3", - "p4", "p5", "p6", "p7", - "p8", "p9", "p10", "p11", - "p12", "p13", "p14", "p15", - "ffr", "vg" + "z0", "z1", "z2", "z3", "z4", "z5", "z6", "z7", "z8", + "z9", "z10", "z11", "z12", "z13", "z14", "z15", "z16", "z17", + "z18", "z19", "z20", "z21", "z22", "z23", "z24", "z25", "z26", + "z27", "z28", "z29", "z30", "z31", "fpsr", "fpcr", "p0", "p1", + "p2", "p3", "p4", "p5", "p6", "p7", "p8", "p9", "p10", + "p11", "p12", "p13", "p14", "p15", "ffr", "vg" }; -static const char *const aarch64_pauth_register_names[] = -{ +static const char *const aarch64_pauth_register_names[] = { /* Authentication mask for data pointer. */ "pauth_dmask", /* Authentication mask for code pointer. */ "pauth_cmask" }; -static const char *const aarch64_mte_register_names[] = -{ +static const char *const aarch64_mte_register_names[] = { /* Tag Control Register. */ "tag_ctl" }; @@ -187,28 +162,32 @@ static void show_aarch64_debug (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) { - gdb_printf (file, _("AArch64 debugging is %s.\n"), value); + gdb_printf (file, _ ("AArch64 debugging is %s.\n"), value); } -namespace { +namespace +{ /* Abstract instruction reader. */ class abstract_instruction_reader { public: + /* Read in one instruction. */ virtual ULONGEST read (CORE_ADDR memaddr, int len, - enum bfd_endian byte_order) = 0; + enum bfd_endian byte_order) + = 0; }; /* Instruction reader from real target. */ class instruction_reader : public abstract_instruction_reader { - public: - ULONGEST read (CORE_ADDR memaddr, int len, enum bfd_endian byte_order) - override +public: + + ULONGEST read (CORE_ADDR memaddr, int len, + enum bfd_endian byte_order) override { return read_code_unsigned_integer (memaddr, len, byte_order); } @@ -221,8 +200,8 @@ class instruction_reader : public abstract_instruction_reader THIS_FRAME. */ static CORE_ADDR -aarch64_frame_unmask_lr (aarch64_gdbarch_tdep *tdep, - frame_info_ptr this_frame, CORE_ADDR addr) +aarch64_frame_unmask_lr (aarch64_gdbarch_tdep *tdep, frame_info_ptr this_frame, + CORE_ADDR addr) { if (tdep->has_pauth () && frame_unwind_register_unsigned (this_frame, @@ -255,10 +234,10 @@ aarch64_get_pc_address_flags (frame_info_ptr frame, CORE_ADDR pc) clobber the stack frame unexpectedly, or an unknown instruction. */ static CORE_ADDR -aarch64_analyze_prologue (struct gdbarch *gdbarch, - CORE_ADDR start, CORE_ADDR limit, +aarch64_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR start, + CORE_ADDR limit, struct aarch64_prologue_cache *cache, - abstract_instruction_reader& reader) + abstract_instruction_reader &reader) { enum bfd_endian byte_order_for_code = gdbarch_byte_order_for_code (gdbarch); int i; @@ -299,13 +278,13 @@ aarch64_analyze_prologue (struct gdbarch *gdbarch, if (inst.opcode->op == OP_ADD) { - regs[rd] = pv_add_constant (regs[rn], - inst.operands[2].imm.value); + regs[rd] + = pv_add_constant (regs[rn], inst.operands[2].imm.value); } else { - regs[rd] = pv_add_constant (regs[rn], - -inst.operands[2].imm.value); + regs[rd] + = pv_add_constant (regs[rn], -inst.operands[2].imm.value); } /* Did we move SP to FP? */ @@ -374,8 +353,7 @@ aarch64_analyze_prologue (struct gdbarch *gdbarch, gdb_assert (inst.operands[1].type == AARCH64_OPND_Rn); gdb_assert (inst.operands[2].type == AARCH64_OPND_Rm_SFT); - if (inst.operands[2].shifter.amount == 0 - && rn == AARCH64_SP_REGNUM) + if (inst.operands[2].shifter.amount == 0 && rn == AARCH64_SP_REGNUM) regs[rd] = regs[rm]; else { @@ -397,9 +375,9 @@ aarch64_analyze_prologue (struct gdbarch *gdbarch, gdb_assert (inst.operands[1].type == AARCH64_OPND_ADDR_SIMM9); gdb_assert (!inst.operands[1].addr.offset.is_reg); - stack.store - (pv_add_constant (regs[rn], inst.operands[1].addr.offset.imm), - size, regs[rt]); + stack.store (pv_add_constant (regs[rn], + inst.operands[1].addr.offset.imm), + size, regs[rt]); /* Are we storing with SP as a base? */ if (rn == AARCH64_SP_REGNUM) @@ -442,7 +420,8 @@ aarch64_analyze_prologue (struct gdbarch *gdbarch, } stack.store (pv_add_constant (regs[rn], imm), size, regs[rt1]); - stack.store (pv_add_constant (regs[rn], imm + size), size, regs[rt2]); + stack.store (pv_add_constant (regs[rn], imm + size), size, + regs[rt2]); if (inst.operands[2].addr.writeback) regs[rn] = pv_add_constant (regs[rn], imm); @@ -452,7 +431,7 @@ aarch64_analyze_prologue (struct gdbarch *gdbarch, if (rn == AARCH64_SP_REGNUM && !inst.operands[2].addr.writeback) seen_stack_set = true; } - else if ((inst.opcode->iclass == ldst_imm9 /* Signed immediate. */ + else if ((inst.opcode->iclass == ldst_imm9 /* Signed immediate. */ || (inst.opcode->iclass == ldst_pos /* Unsigned immediate. */ && (inst.opcode->op == OP_STR_POS || inst.opcode->op == OP_STRF_POS))) @@ -490,7 +469,7 @@ aarch64_analyze_prologue (struct gdbarch *gdbarch, int ra_state_val = 0; if (insn == 0xd503233f /* paciasp. */ - || insn == 0xd503237f /* pacibsp. */) + || insn == 0xd503237f /* pacibsp. */) { /* Return addresses are mangled. */ ra_state_val = 1; @@ -563,8 +542,7 @@ aarch64_analyze_prologue (struct gdbarch *gdbarch, int regnum = gdbarch_num_regs (gdbarch); CORE_ADDR offset; - if (stack.find_reg (gdbarch, i + AARCH64_X_REGISTER_COUNT, - &offset)) + if (stack.find_reg (gdbarch, i + AARCH64_X_REGISTER_COUNT, &offset)) cache->saved_regs[i + regnum + AARCH64_D0_REGNUM].set_addr (offset); } @@ -572,32 +550,35 @@ aarch64_analyze_prologue (struct gdbarch *gdbarch, } static CORE_ADDR -aarch64_analyze_prologue (struct gdbarch *gdbarch, - CORE_ADDR start, CORE_ADDR limit, +aarch64_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR start, + CORE_ADDR limit, struct aarch64_prologue_cache *cache) { instruction_reader reader; - return aarch64_analyze_prologue (gdbarch, start, limit, cache, - reader); + return aarch64_analyze_prologue (gdbarch, start, limit, cache, reader); } #if GDB_SELF_TEST -namespace selftests { +namespace selftests +{ /* Instruction reader from manually cooked instruction sequences. */ class instruction_reader_test : public abstract_instruction_reader { public: + template explicit instruction_reader_test (const uint32_t (&insns)[SIZE]) - : m_insns (insns), m_insns_size (SIZE) - {} + : m_insns (insns), + m_insns_size (SIZE) + { + } - ULONGEST read (CORE_ADDR memaddr, int len, enum bfd_endian byte_order) - override + ULONGEST read (CORE_ADDR memaddr, int len, + enum bfd_endian byte_order) override { SELF_CHECK (len == 4); SELF_CHECK (memaddr % 4 == 0); @@ -607,6 +588,7 @@ public: } private: + const uint32_t *m_insns; size_t m_insns_size; }; @@ -699,7 +681,6 @@ aarch64_analyze_prologue_test (void) int num_regs = gdbarch_num_regs (gdbarch); int regnum = i + num_regs + AARCH64_D0_REGNUM; - if (i == 0) SELF_CHECK (cache.saved_regs[regnum].addr () == -24); else @@ -832,8 +813,8 @@ aarch64_analyze_prologue_test (void) instruction_reader_test reader (insns); trad_frame_reset_saved_regs (gdbarch, cache.saved_regs); - CORE_ADDR end = aarch64_analyze_prologue (gdbarch, 0, 128, &cache, - reader); + CORE_ADDR end + = aarch64_analyze_prologue (gdbarch, 0, 128, &cache, reader); SELF_CHECK (end == 4 * 4); SELF_CHECK (cache.framereg == AARCH64_FP_REGNUM); @@ -860,37 +841,36 @@ aarch64_analyze_prologue_test (void) } /* Test a prologue with a BTI instruction. */ - { - static const uint32_t insns[] = { - 0xd503245f, /* bti */ - 0xa9bd7bfd, /* stp x29, x30, [sp, #-48]! */ - 0x910003fd, /* mov x29, sp */ - 0xf801c3f3, /* str x19, [sp, #28] */ - 0xb9401fa0, /* ldr x19, [x29, #28] */ - }; - instruction_reader_test reader (insns); + { + static const uint32_t insns[] = { + 0xd503245f, /* bti */ + 0xa9bd7bfd, /* stp x29, x30, [sp, #-48]! */ + 0x910003fd, /* mov x29, sp */ + 0xf801c3f3, /* str x19, [sp, #28] */ + 0xb9401fa0, /* ldr x19, [x29, #28] */ + }; + instruction_reader_test reader (insns); - trad_frame_reset_saved_regs (gdbarch, cache.saved_regs); - CORE_ADDR end = aarch64_analyze_prologue (gdbarch, 0, 128, &cache, - reader); + trad_frame_reset_saved_regs (gdbarch, cache.saved_regs); + CORE_ADDR end = aarch64_analyze_prologue (gdbarch, 0, 128, &cache, reader); - SELF_CHECK (end == 4 * 4); - SELF_CHECK (cache.framereg == AARCH64_FP_REGNUM); - SELF_CHECK (cache.framesize == 48); + SELF_CHECK (end == 4 * 4); + SELF_CHECK (cache.framereg == AARCH64_FP_REGNUM); + SELF_CHECK (cache.framesize == 48); - for (int i = 0; i < AARCH64_X_REGISTER_COUNT; i++) - { - if (i == 19) - SELF_CHECK (cache.saved_regs[i].addr () == -20); - else if (i == AARCH64_FP_REGNUM) - SELF_CHECK (cache.saved_regs[i].addr () == -48); - else if (i == AARCH64_LR_REGNUM) - SELF_CHECK (cache.saved_regs[i].addr () == -40); - else - SELF_CHECK (cache.saved_regs[i].is_realreg () - && cache.saved_regs[i].realreg () == i); - } - } + for (int i = 0; i < AARCH64_X_REGISTER_COUNT; i++) + { + if (i == 19) + SELF_CHECK (cache.saved_regs[i].addr () == -20); + else if (i == AARCH64_FP_REGNUM) + SELF_CHECK (cache.saved_regs[i].addr () == -48); + else if (i == AARCH64_LR_REGNUM) + SELF_CHECK (cache.saved_regs[i].addr () == -40); + else + SELF_CHECK (cache.saved_regs[i].is_realreg () + && cache.saved_regs[i].realreg () == i); + } + } } } // namespace selftests #endif /* GDB_SELF_TEST */ @@ -923,7 +903,7 @@ aarch64_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) upper bound. */ limit_pc = skip_prologue_using_sal (gdbarch, pc); if (limit_pc == 0) - limit_pc = pc + 128; /* Magic. */ + limit_pc = pc + 128; /* Magic. */ /* Try disassembling prologue. */ return aarch64_analyze_prologue (gdbarch, pc, limit_pc, NULL); @@ -1078,8 +1058,8 @@ aarch64_prologue_frame_unwind_stop_reason (frame_info_ptr this_frame, PC and the caller's SP when we were called. */ static void -aarch64_prologue_this_id (frame_info_ptr this_frame, - void **this_cache, struct frame_id *this_id) +aarch64_prologue_this_id (frame_info_ptr this_frame, void **this_cache, + struct frame_id *this_id) { struct aarch64_prologue_cache *cache = aarch64_make_prologue_cache (this_frame, this_cache); @@ -1093,8 +1073,8 @@ aarch64_prologue_this_id (frame_info_ptr this_frame, /* Implement the "prev_register" frame_unwind method. */ static struct value * -aarch64_prologue_prev_register (frame_info_ptr this_frame, - void **this_cache, int prev_regnum) +aarch64_prologue_prev_register (frame_info_ptr this_frame, void **this_cache, + int prev_regnum) { struct aarch64_prologue_cache *cache = aarch64_make_prologue_cache (this_frame, this_cache); @@ -1134,24 +1114,21 @@ aarch64_prologue_prev_register (frame_info_ptr this_frame, | |<- SP +----------+ */ if (prev_regnum == AARCH64_SP_REGNUM) - return frame_unwind_got_constant (this_frame, prev_regnum, - cache->prev_sp); + return frame_unwind_got_constant (this_frame, prev_regnum, cache->prev_sp); return trad_frame_get_prev_register (this_frame, cache->saved_regs, prev_regnum); } /* AArch64 prologue unwinder. */ -static frame_unwind aarch64_prologue_unwind = -{ - "aarch64 prologue", - NORMAL_FRAME, - aarch64_prologue_frame_unwind_stop_reason, - aarch64_prologue_this_id, - aarch64_prologue_prev_register, - NULL, - default_frame_sniffer -}; +static frame_unwind aarch64_prologue_unwind + = { "aarch64 prologue", + NORMAL_FRAME, + aarch64_prologue_frame_unwind_stop_reason, + aarch64_prologue_this_id, + aarch64_prologue_prev_register, + NULL, + default_frame_sniffer }; /* Allocate and fill in *THIS_CACHE with information about the prologue of *THIS_FRAME. Do not do this is if *THIS_CACHE was already allocated. @@ -1172,8 +1149,8 @@ aarch64_make_stub_cache (frame_info_ptr this_frame, void **this_cache) try { - cache->prev_sp = get_frame_register_unsigned (this_frame, - AARCH64_SP_REGNUM); + cache->prev_sp + = get_frame_register_unsigned (this_frame, AARCH64_SP_REGNUM); cache->prev_pc = get_frame_pc (this_frame); cache->available_p = 1; } @@ -1204,8 +1181,8 @@ aarch64_stub_frame_unwind_stop_reason (frame_info_ptr this_frame, /* Our frame ID for a stub frame is the current SP and LR. */ static void -aarch64_stub_this_id (frame_info_ptr this_frame, - void **this_cache, struct frame_id *this_id) +aarch64_stub_this_id (frame_info_ptr this_frame, void **this_cache, + struct frame_id *this_id) { struct aarch64_prologue_cache *cache = aarch64_make_stub_cache (this_frame, this_cache); @@ -1237,16 +1214,14 @@ aarch64_stub_unwind_sniffer (const struct frame_unwind *self, } /* AArch64 stub unwinder. */ -static frame_unwind aarch64_stub_unwind = -{ - "aarch64 stub", - NORMAL_FRAME, - aarch64_stub_frame_unwind_stop_reason, - aarch64_stub_this_id, - aarch64_prologue_prev_register, - NULL, - aarch64_stub_unwind_sniffer -}; +static frame_unwind aarch64_stub_unwind + = { "aarch64 stub", + NORMAL_FRAME, + aarch64_stub_frame_unwind_stop_reason, + aarch64_stub_this_id, + aarch64_prologue_prev_register, + NULL, + aarch64_stub_unwind_sniffer }; /* Return the frame base address of *THIS_FRAME. */ @@ -1260,20 +1235,16 @@ aarch64_normal_frame_base (frame_info_ptr this_frame, void **this_cache) } /* AArch64 default frame base information. */ -static frame_base aarch64_normal_base = -{ - &aarch64_prologue_unwind, - aarch64_normal_frame_base, - aarch64_normal_frame_base, - aarch64_normal_frame_base -}; +static frame_base aarch64_normal_base + = { &aarch64_prologue_unwind, aarch64_normal_frame_base, + aarch64_normal_frame_base, aarch64_normal_frame_base }; /* Return the value of the REGNUM register in the previous frame of *THIS_FRAME. */ static struct value * -aarch64_dwarf2_prev_register (frame_info_ptr this_frame, - void **this_cache, int regnum) +aarch64_dwarf2_prev_register (frame_info_ptr this_frame, void **this_cache, + int regnum) { gdbarch *arch = get_frame_arch (this_frame); aarch64_gdbarch_tdep *tdep = gdbarch_tdep (arch); @@ -1287,7 +1258,7 @@ aarch64_dwarf2_prev_register (frame_info_ptr this_frame, return frame_unwind_got_constant (this_frame, regnum, lr); default: - internal_error (_("Unexpected register %d"), regnum); + internal_error (_ ("Unexpected register %d"), regnum); } } @@ -1391,14 +1362,13 @@ aarch64_program_breakpoint_here_p (gdbarch *gdbarch, CORE_ADDR address) if (target_read_memory (address, target_mem, insn_len) == 0) { - uint32_t insn = - (uint32_t) extract_unsigned_integer (target_mem, insn_len, - gdbarch_byte_order_for_code (gdbarch)); + uint32_t insn = (uint32_t) extract_unsigned_integer ( + target_mem, insn_len, gdbarch_byte_order_for_code (gdbarch)); /* Check if INSN is a BRK instruction pattern. There are multiple choices of such instructions with different immediate values. Different OS' may use a different variation, but they have the same outcome. */ - return ((insn & BRK_INSN_MASK) == BRK_INSN_BASE); + return ((insn & BRK_INSN_MASK) == BRK_INSN_BASE); } return false; @@ -1501,14 +1471,15 @@ aapcs_is_vfp_call_or_return_candidate_1 (struct type *type, else { struct type *target_type = type->target_type (); - int count = aapcs_is_vfp_call_or_return_candidate_1 - (target_type, fundamental_type); + int count + = aapcs_is_vfp_call_or_return_candidate_1 (target_type, + fundamental_type); if (count == -1) return count; count *= (type->length () / target_type->length ()); - return count; + return count; } } @@ -1525,8 +1496,9 @@ aapcs_is_vfp_call_or_return_candidate_1 (struct type *type, struct type *member = check_typedef (type->field (i).type ()); - int sub_count = aapcs_is_vfp_call_or_return_candidate_1 - (member, fundamental_type); + int sub_count + = aapcs_is_vfp_call_or_return_candidate_1 (member, + fundamental_type); if (sub_count == -1) return -1; count += sub_count; @@ -1535,7 +1507,8 @@ aapcs_is_vfp_call_or_return_candidate_1 (struct type *type, /* Ensure there is no padding between the fields (allowing for empty zero length structs) */ int ftype_length = (*fundamental_type == nullptr) - ? 0 : (*fundamental_type)->length (); + ? 0 + : (*fundamental_type)->length (); if (count * ftype_length != type->length ()) return -1; @@ -1576,8 +1549,8 @@ aapcs_is_vfp_call_or_return_candidate (struct type *type, int *count, *fundamental_type = nullptr; - int ag_count = aapcs_is_vfp_call_or_return_candidate_1 (type, - fundamental_type); + int ag_count + = aapcs_is_vfp_call_or_return_candidate_1 (type, fundamental_type); if (ag_count > 0 && ag_count <= HA_MAX_NUM_FLDS) { @@ -1629,13 +1602,11 @@ pass_in_x (struct gdbarch *gdbarch, struct regcache *regcache, while (len > 0) { int partial_len = len < X_REGISTER_SIZE ? len : X_REGISTER_SIZE; - CORE_ADDR regval = extract_unsigned_integer (buf, partial_len, - byte_order); - + CORE_ADDR regval + = extract_unsigned_integer (buf, partial_len, byte_order); /* Adjust sub-word struct/union args when big-endian. */ - if (byte_order == BFD_ENDIAN_BIG - && partial_len < X_REGISTER_SIZE + if (byte_order == BFD_ENDIAN_BIG && partial_len < X_REGISTER_SIZE && (typecode == TYPE_CODE_STRUCT || typecode == TYPE_CODE_UNION)) regval <<= ((X_REGISTER_SIZE - partial_len) * TARGET_CHAR_BIT); @@ -1656,10 +1627,8 @@ pass_in_x (struct gdbarch *gdbarch, struct regcache *regcache, handle arguments spread across multiple registers. */ static int -pass_in_v (struct gdbarch *gdbarch, - struct regcache *regcache, - struct aarch64_call_info *info, - int len, const bfd_byte *buf) +pass_in_v (struct gdbarch *gdbarch, struct regcache *regcache, + struct aarch64_call_info *info, int len, const bfd_byte *buf) { if (info->nsrn < 8) { @@ -1777,8 +1746,7 @@ pass_in_v_vfp_candidate (struct gdbarch *gdbarch, struct regcache *regcache, const bfd_byte *buf = value_contents (arg).data (); struct type *target_type = check_typedef (arg_type->target_type ()); - if (!pass_in_v (gdbarch, regcache, info, target_type->length (), - buf)) + if (!pass_in_v (gdbarch, regcache, info, target_type->length (), buf)) return false; return pass_in_v (gdbarch, regcache, info, target_type->length (), @@ -1818,8 +1786,7 @@ pass_in_v_vfp_candidate (struct gdbarch *gdbarch, struct regcache *regcache, static CORE_ADDR aarch64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, struct regcache *regcache, CORE_ADDR bp_addr, - int nargs, - struct value **args, CORE_ADDR sp, + int nargs, struct value **args, CORE_ADDR sp, function_call_return_method return_method, CORE_ADDR struct_addr) { @@ -1860,10 +1827,10 @@ aarch64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, /* The struct_return pointer occupies X8. */ if (return_method != return_method_normal) { - aarch64_debug_printf ("struct return in %s = 0x%s", - gdbarch_register_name - (gdbarch, AARCH64_STRUCT_RETURN_REGNUM), - paddress (gdbarch, struct_addr)); + aarch64_debug_printf ( + "struct return in %s = 0x%s", + gdbarch_register_name (gdbarch, AARCH64_STRUCT_RETURN_REGNUM), + paddress (gdbarch, struct_addr)); regcache_cooked_write_unsigned (regcache, AARCH64_STRUCT_RETURN_REGNUM, struct_addr); @@ -2141,8 +2108,9 @@ aarch64_vnv_type (struct gdbarch *gdbarch) struct type *t = arch_composite_type (gdbarch, "__gdb_builtin_type_vnv", TYPE_CODE_UNION); - struct type *sub = arch_composite_type (gdbarch, "__gdb_builtin_type_vnd", - TYPE_CODE_UNION); + struct type *sub + = arch_composite_type (gdbarch, "__gdb_builtin_type_vnd", + TYPE_CODE_UNION); append_composite_type_field (sub, "f", init_vector_type (bt->builtin_double, 2)); append_composite_type_field (sub, "u", @@ -2247,7 +2215,7 @@ aarch64_gdb_print_insn (bfd_vma memaddr, disassemble_info *info) /* AArch64 BRK software debug mode instruction. Note that AArch64 code is always little-endian. 1101.0100.0010.0000.0000.0000.0000.0000 = 0xd4200000. */ -constexpr gdb_byte aarch64_default_breakpoint[] = {0x00, 0x00, 0x20, 0xd4}; +constexpr gdb_byte aarch64_default_breakpoint[] = { 0x00, 0x00, 0x20, 0xd4 }; typedef BP_MANIPULATION (aarch64_default_breakpoint) aarch64_breakpoint; @@ -2276,9 +2244,9 @@ aarch64_extract_return_value (struct type *type, struct regcache *regs, gdb_byte buf[register_size (gdbarch, regno)]; gdb_assert (len <= sizeof (buf)); - aarch64_debug_printf - ("read HFA or HVA return value element %d from %s", - i + 1, gdbarch_register_name (gdbarch, regno)); + aarch64_debug_printf ( + "read HFA or HVA return value element %d from %s", i + 1, + gdbarch_register_name (gdbarch, regno)); regs->cooked_read (regno, buf); @@ -2286,12 +2254,9 @@ aarch64_extract_return_value (struct type *type, struct regcache *regs, valbuf += len; } } - else if (type->code () == TYPE_CODE_INT - || type->code () == TYPE_CODE_CHAR - || type->code () == TYPE_CODE_BOOL - || type->code () == TYPE_CODE_PTR - || TYPE_IS_REFERENCE (type) - || type->code () == TYPE_CODE_ENUM) + else if (type->code () == TYPE_CODE_INT || type->code () == TYPE_CODE_CHAR + || type->code () == TYPE_CODE_BOOL || type->code () == TYPE_CODE_PTR + || TYPE_IS_REFERENCE (type) || type->code () == TYPE_CODE_ENUM) { /* If the type is a plain integer, then the access is straight-forward. Otherwise we have to play around a bit @@ -2306,8 +2271,9 @@ aarch64_extract_return_value (struct type *type, struct regcache *regs, anything special for small big-endian values. */ regcache_cooked_read_unsigned (regs, regno++, &tmp); store_unsigned_integer (valbuf, - (len > X_REGISTER_SIZE - ? X_REGISTER_SIZE : len), byte_order, tmp); + (len > X_REGISTER_SIZE ? X_REGISTER_SIZE + : len), + byte_order, tmp); len -= X_REGISTER_SIZE; valbuf += X_REGISTER_SIZE; } @@ -2331,7 +2297,6 @@ aarch64_extract_return_value (struct type *type, struct regcache *regs, } } - /* Will a function return an aggregate type in memory or in a register? Return 0 if an aggregate type can be returned in a register, 1 if it must be returned in memory. */ @@ -2390,9 +2355,9 @@ aarch64_store_return_value (struct type *type, struct regcache *regs, gdb_byte tmpbuf[register_size (gdbarch, regno)]; gdb_assert (len <= sizeof (tmpbuf)); - aarch64_debug_printf - ("write HFA or HVA return value element %d to %s", - i + 1, gdbarch_register_name (gdbarch, regno)); + aarch64_debug_printf ( + "write HFA or HVA return value element %d to %s", i + 1, + gdbarch_register_name (gdbarch, regno)); memcpy (tmpbuf, valbuf, len > V_REGISTER_SIZE ? V_REGISTER_SIZE : len); @@ -2400,12 +2365,9 @@ aarch64_store_return_value (struct type *type, struct regcache *regs, valbuf += len; } } - else if (type->code () == TYPE_CODE_INT - || type->code () == TYPE_CODE_CHAR - || type->code () == TYPE_CODE_BOOL - || type->code () == TYPE_CODE_PTR - || TYPE_IS_REFERENCE (type) - || type->code () == TYPE_CODE_ENUM) + else if (type->code () == TYPE_CODE_INT || type->code () == TYPE_CODE_CHAR + || type->code () == TYPE_CODE_BOOL || type->code () == TYPE_CODE_PTR + || TYPE_IS_REFERENCE (type) || type->code () == TYPE_CODE_ENUM) { if (type->length () <= X_REGISTER_SIZE) { @@ -2526,15 +2488,13 @@ aarch64_get_longjmp_target (frame_info_ptr frame, CORE_ADDR *pc) /* Implement the "gen_return_address" gdbarch method. */ static void -aarch64_gen_return_address (struct gdbarch *gdbarch, - struct agent_expr *ax, struct axs_value *value, - CORE_ADDR scope) +aarch64_gen_return_address (struct gdbarch *gdbarch, struct agent_expr *ax, + struct axs_value *value, CORE_ADDR scope) { value->type = register_type (gdbarch, AARCH64_LR_REGNUM); value->kind = axs_lvalue_register; value->u.reg = AARCH64_LR_REGNUM; } - /* Return TRUE if REGNUM is a W pseudo-register number. Return FALSE otherwise. */ @@ -2559,77 +2519,47 @@ aarch64_pseudo_register_name (struct gdbarch *gdbarch, int regnum) aarch64_gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); /* W pseudo-registers. Bottom halves of the X registers. */ - static const char *const w_name[] = - { - "w0", "w1", "w2", "w3", - "w4", "w5", "w6", "w7", - "w8", "w9", "w10", "w11", - "w12", "w13", "w14", "w15", - "w16", "w17", "w18", "w19", - "w20", "w21", "w22", "w23", - "w24", "w25", "w26", "w27", - "w28", "w29", "w30", - }; - - static const char *const q_name[] = - { - "q0", "q1", "q2", "q3", - "q4", "q5", "q6", "q7", - "q8", "q9", "q10", "q11", - "q12", "q13", "q14", "q15", - "q16", "q17", "q18", "q19", - "q20", "q21", "q22", "q23", - "q24", "q25", "q26", "q27", - "q28", "q29", "q30", "q31", - }; - - static const char *const d_name[] = - { - "d0", "d1", "d2", "d3", - "d4", "d5", "d6", "d7", - "d8", "d9", "d10", "d11", - "d12", "d13", "d14", "d15", - "d16", "d17", "d18", "d19", - "d20", "d21", "d22", "d23", - "d24", "d25", "d26", "d27", - "d28", "d29", "d30", "d31", - }; - - static const char *const s_name[] = - { - "s0", "s1", "s2", "s3", - "s4", "s5", "s6", "s7", - "s8", "s9", "s10", "s11", - "s12", "s13", "s14", "s15", - "s16", "s17", "s18", "s19", - "s20", "s21", "s22", "s23", - "s24", "s25", "s26", "s27", - "s28", "s29", "s30", "s31", - }; - - static const char *const h_name[] = - { - "h0", "h1", "h2", "h3", - "h4", "h5", "h6", "h7", - "h8", "h9", "h10", "h11", - "h12", "h13", "h14", "h15", - "h16", "h17", "h18", "h19", - "h20", "h21", "h22", "h23", - "h24", "h25", "h26", "h27", - "h28", "h29", "h30", "h31", - }; - - static const char *const b_name[] = - { - "b0", "b1", "b2", "b3", - "b4", "b5", "b6", "b7", - "b8", "b9", "b10", "b11", - "b12", "b13", "b14", "b15", - "b16", "b17", "b18", "b19", - "b20", "b21", "b22", "b23", - "b24", "b25", "b26", "b27", - "b28", "b29", "b30", "b31", - }; + static const char *const w_name[] = { + "w0", "w1", "w2", "w3", "w4", "w5", "w6", "w7", + "w8", "w9", "w10", "w11", "w12", "w13", "w14", "w15", + "w16", "w17", "w18", "w19", "w20", "w21", "w22", "w23", + "w24", "w25", "w26", "w27", "w28", "w29", "w30", + }; + + static const char *const q_name[] = { + "q0", "q1", "q2", "q3", "q4", "q5", "q6", "q7", + "q8", "q9", "q10", "q11", "q12", "q13", "q14", "q15", + "q16", "q17", "q18", "q19", "q20", "q21", "q22", "q23", + "q24", "q25", "q26", "q27", "q28", "q29", "q30", "q31", + }; + + static const char *const d_name[] = { + "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7", + "d8", "d9", "d10", "d11", "d12", "d13", "d14", "d15", + "d16", "d17", "d18", "d19", "d20", "d21", "d22", "d23", + "d24", "d25", "d26", "d27", "d28", "d29", "d30", "d31", + }; + + static const char *const s_name[] = { + "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", + "s8", "s9", "s10", "s11", "s12", "s13", "s14", "s15", + "s16", "s17", "s18", "s19", "s20", "s21", "s22", "s23", + "s24", "s25", "s26", "s27", "s28", "s29", "s30", "s31", + }; + + static const char *const h_name[] = { + "h0", "h1", "h2", "h3", "h4", "h5", "h6", "h7", + "h8", "h9", "h10", "h11", "h12", "h13", "h14", "h15", + "h16", "h17", "h18", "h19", "h20", "h21", "h22", "h23", + "h24", "h25", "h26", "h27", "h28", "h29", "h30", "h31", + }; + + static const char *const b_name[] = { + "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", + "b8", "b9", "b10", "b11", "b12", "b13", "b14", "b15", + "b16", "b17", "b18", "b19", "b20", "b21", "b22", "b23", + "b24", "b25", "b26", "b27", "b28", "b29", "b30", "b31", + }; int p_regnum = regnum - gdbarch_num_regs (gdbarch); @@ -2654,17 +2584,12 @@ aarch64_pseudo_register_name (struct gdbarch *gdbarch, int regnum) if (tdep->has_sve ()) { - static const char *const sve_v_name[] = - { - "v0", "v1", "v2", "v3", - "v4", "v5", "v6", "v7", - "v8", "v9", "v10", "v11", - "v12", "v13", "v14", "v15", - "v16", "v17", "v18", "v19", - "v20", "v21", "v22", "v23", - "v24", "v25", "v26", "v27", - "v28", "v29", "v30", "v31", - }; + static const char *const sve_v_name[] = { + "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", + "v8", "v9", "v10", "v11", "v12", "v13", "v14", "v15", + "v16", "v17", "v18", "v19", "v20", "v21", "v22", "v23", + "v24", "v25", "v26", "v27", "v28", "v29", "v30", "v31", + }; if (p_regnum >= AARCH64_SVE_V0_REGNUM && p_regnum < AARCH64_SVE_V0_REGNUM + AARCH64_V_REGS_NUM) @@ -2677,7 +2602,7 @@ aarch64_pseudo_register_name (struct gdbarch *gdbarch, int regnum) if (tdep->has_pauth () && regnum == tdep->ra_sign_state_regnum) return ""; - internal_error (_("aarch64_pseudo_register_name: bad register number %d"), + internal_error (_ ("aarch64_pseudo_register_name: bad register number %d"), p_regnum); } @@ -2716,7 +2641,7 @@ aarch64_pseudo_register_type (struct gdbarch *gdbarch, int regnum) if (tdep->has_pauth () && regnum == tdep->ra_sign_state_regnum) return builtin_type (gdbarch)->builtin_uint64; - internal_error (_("aarch64_pseudo_register_type: bad register number %d"), + internal_error (_ ("aarch64_pseudo_register_type: bad register number %d"), p_regnum); } @@ -2772,16 +2697,17 @@ aarch64_pseudo_read_value_1 (struct gdbarch *gdbarch, memcpy (value_contents_raw (result_value).data (), reg_buf, regsize); return result_value; - } +} /* Implement the "pseudo_register_read_value" gdbarch method. */ static struct value * -aarch64_pseudo_read_value (struct gdbarch *gdbarch, readable_regcache *regcache, - int regnum) +aarch64_pseudo_read_value (struct gdbarch *gdbarch, + readable_regcache *regcache, int regnum) { aarch64_gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - struct value *result_value = allocate_value (register_type (gdbarch, regnum)); + struct value *result_value + = allocate_value (register_type (gdbarch, regnum)); VALUE_LVAL (result_value) = lval_register; VALUE_REGNUM (result_value) = regnum; @@ -2939,7 +2865,6 @@ value_of_aarch64_user_reg (frame_info_ptr frame, const void *baton) return value_of_register (*reg_p, frame); } - /* Implement the "software_single_step" gdbarch method, needed to single step through atomic sequences on AArch64. */ @@ -2957,19 +2882,18 @@ aarch64_software_single_step (struct regcache *regcache) CORE_ADDR closing_insn = 0; ULONGEST insn_from_memory; - if (!safe_read_memory_unsigned_integer (loc, insn_size, - byte_order_for_code, + if (!safe_read_memory_unsigned_integer (loc, insn_size, byte_order_for_code, &insn_from_memory)) - { - /* Assume we don't have a atomic sequence, as we couldn't read the + { + /* Assume we don't have a atomic sequence, as we couldn't read the instruction in this location. */ - return {}; - } + return {}; + } uint32_t insn = insn_from_memory; int index; int insn_count; - int bc_insn_count = 0; /* Conditional branch instruction count. */ + int bc_insn_count = 0; /* Conditional branch instruction count. */ int last_breakpoint = 0; /* Defaults to 0 (no breakpoints placed). */ aarch64_inst inst; @@ -2987,11 +2911,11 @@ aarch64_software_single_step (struct regcache *regcache) if (!safe_read_memory_unsigned_integer (loc, insn_size, byte_order_for_code, &insn_from_memory)) - { - /* Assume we don't have a atomic sequence, as we couldn't read the + { + /* Assume we don't have a atomic sequence, as we couldn't read the instruction in this location. */ - return {}; - } + return {}; + } insn = insn_from_memory; if (aarch64_decode_insn (insn, &inst, 1, NULL) != 0) @@ -3212,8 +3136,8 @@ aarch64_displaced_step_adr (const int32_t offset, const unsigned rd, address & ~0xfff); } else - regcache_cooked_write_unsigned (dsd->regs, AARCH64_X0_REGNUM + rd, - address); + regcache_cooked_write_unsigned (dsd->regs, AARCH64_X0_REGNUM + rd, + address); dsd->dsc->pc_adjust = 4; emit_nop (dsd->insn_buf); @@ -3232,8 +3156,7 @@ aarch64_displaced_step_ldr_literal (const int32_t offset, const int is_sw, CORE_ADDR address = data->insn_addr + offset; struct aarch64_memory_operand zero = { MEMORY_OPERAND_OFFSET, 0 }; - regcache_cooked_write_unsigned (dsd->regs, AARCH64_X0_REGNUM + rt, - address); + regcache_cooked_write_unsigned (dsd->regs, AARCH64_X0_REGNUM + rt, address); if (is_sw) dsd->insn_count = emit_ldrsw (dsd->insn_buf, aarch64_register (rt, 1), @@ -3273,23 +3196,18 @@ aarch64_displaced_step_others (const uint32_t insn, dsd->dsc->pc_adjust = 4; } -static const struct aarch64_insn_visitor visitor = -{ - aarch64_displaced_step_b, - aarch64_displaced_step_b_cond, - aarch64_displaced_step_cb, - aarch64_displaced_step_tb, - aarch64_displaced_step_adr, - aarch64_displaced_step_ldr_literal, +static const struct aarch64_insn_visitor visitor = { + aarch64_displaced_step_b, aarch64_displaced_step_b_cond, + aarch64_displaced_step_cb, aarch64_displaced_step_tb, + aarch64_displaced_step_adr, aarch64_displaced_step_ldr_literal, aarch64_displaced_step_others, }; /* Implement the "displaced_step_copy_insn" gdbarch method. */ displaced_step_copy_insn_closure_up -aarch64_displaced_step_copy_insn (struct gdbarch *gdbarch, - CORE_ADDR from, CORE_ADDR to, - struct regcache *regs) +aarch64_displaced_step_copy_insn (struct gdbarch *gdbarch, CORE_ADDR from, + CORE_ADDR to, struct regcache *regs) { enum bfd_endian byte_order_for_code = gdbarch_byte_order_for_code (gdbarch); struct aarch64_displaced_step_data dsd; @@ -3312,8 +3230,8 @@ aarch64_displaced_step_copy_insn (struct gdbarch *gdbarch, return NULL; } - std::unique_ptr dsc - (new aarch64_displaced_step_copy_insn_closure); + std::unique_ptr dsc ( + new aarch64_displaced_step_copy_insn_closure); dsd.base.insn_addr = from; dsd.new_addr = to; dsd.regs = regs; @@ -3331,8 +3249,7 @@ aarch64_displaced_step_copy_insn (struct gdbarch *gdbarch, relocated instruction(s) there. */ for (i = 0; i < dsd.insn_count; i++) { - displaced_debug_printf ("writing insn %.8x at %s", - dsd.insn_buf[i], + displaced_debug_printf ("writing insn %.8x at %s", dsd.insn_buf[i], paddress (gdbarch, to + i * 4)); write_memory_unsigned_integer (to + i * 4, 4, byte_order_for_code, @@ -3381,7 +3298,8 @@ aarch64_displaced_step_fixup (struct gdbarch *gdbarch, dsc->pc_adjust = 4; } else - gdb_assert_not_reached ("Unexpected PC value after displaced stepping"); + gdb_assert_not_reached ( + "Unexpected PC value after displaced stepping"); displaced_debug_printf ("[Conditional] pc_adjust after: %d", dsc->pc_adjust); @@ -3399,7 +3317,8 @@ aarch64_displaced_step_fixup (struct gdbarch *gdbarch, took place. */ if ((pc - to) == 0) { - displaced_debug_printf ("PC did not move. Discarding PC adjustment."); + displaced_debug_printf ( + "PC did not move. Discarding PC adjustment."); dsc->pc_adjust = 0; } @@ -3431,7 +3350,7 @@ const target_desc * aarch64_read_description (const aarch64_features &features) { if (features.vq > AARCH64_MAX_SVE_VQ) - error (_("VQ is %" PRIu64 ", maximum supported value is %d"), features.vq, + error (_ ("VQ is %" PRIu64 ", maximum supported value is %d"), features.vq, AARCH64_MAX_SVE_VQ); struct target_desc *tdesc = tdesc_aarch64_map[features]; @@ -3460,8 +3379,8 @@ aarch64_get_tdesc_vq (const struct target_desc *tdesc) if (feature_sve == nullptr) return 0; - uint64_t vl = tdesc_register_bitsize (feature_sve, - aarch64_sve_register_names[0]) / 8; + uint64_t vl + = tdesc_register_bitsize (feature_sve, aarch64_sve_register_names[0]) / 8; return sve_vq_from_vl (vl); } @@ -3477,9 +3396,9 @@ aarch64_features_from_target_desc (const struct target_desc *tdesc) features.vq = aarch64_get_tdesc_vq (tdesc); features.pauth - = (tdesc_find_feature (tdesc, "org.gnu.gdb.aarch64.pauth") != nullptr); + = (tdesc_find_feature (tdesc, "org.gnu.gdb.aarch64.pauth") != nullptr); features.mte - = (tdesc_find_feature (tdesc, "org.gnu.gdb.aarch64.mte") != nullptr); + = (tdesc_find_feature (tdesc, "org.gnu.gdb.aarch64.mte") != nullptr); const struct tdesc_feature *tls_feature = tdesc_find_feature (tdesc, "org.gnu.gdb.aarch64.tls"); @@ -3555,8 +3474,8 @@ aarch64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) uint64_t vq = aarch64_get_tdesc_vq (info.target_desc); if (vq > AARCH64_MAX_SVE_VQ) - internal_error (_("VQ out of bounds: %s (max %d)"), - pulongest (vq), AARCH64_MAX_SVE_VQ); + internal_error (_ ("VQ out of bounds: %s (max %d)"), pulongest (vq), + AARCH64_MAX_SVE_VQ); /* If there is already a candidate, use it. */ for (gdbarch_list *best_arch = gdbarch_list_lookup_by_info (arches, &info); @@ -3576,7 +3495,7 @@ aarch64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) tdesc = aarch64_read_description ({}); gdb_assert (tdesc); - feature_core = tdesc_find_feature (tdesc,"org.gnu.gdb.aarch64.core"); + feature_core = tdesc_find_feature (tdesc, "org.gnu.gdb.aarch64.core"); feature_fpu = tdesc_find_feature (tdesc, "org.gnu.gdb.aarch64.fpu"); feature_sve = tdesc_find_feature (tdesc, "org.gnu.gdb.aarch64.sve"); feature_pauth = tdesc_find_feature (tdesc, "org.gnu.gdb.aarch64.pauth"); @@ -3603,7 +3522,7 @@ aarch64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) if (feature_fpu != nullptr) { if (feature_sve != nullptr) - error (_("Program contains both fpu and SVE features.")); + error (_ ("Program contains both fpu and SVE features.")); /* Validate the description provides the mandatory V registers and allocate their numbers. */ @@ -3626,16 +3545,16 @@ aarch64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) aarch64_sve_register_names[i]); num_regs = AARCH64_SVE_Z0_REGNUM + i; - num_pseudo_regs += 32; /* add the Vn register pseudos. */ + num_pseudo_regs += 32; /* add the Vn register pseudos. */ } if (feature_fpu != nullptr || feature_sve != nullptr) { - num_pseudo_regs += 32; /* add the Qn scalar register pseudos */ - num_pseudo_regs += 32; /* add the Dn scalar register pseudos */ - num_pseudo_regs += 32; /* add the Sn scalar register pseudos */ - num_pseudo_regs += 32; /* add the Hn scalar register pseudos */ - num_pseudo_regs += 32; /* add the Bn scalar register pseudos */ + num_pseudo_regs += 32; /* add the Qn scalar register pseudos */ + num_pseudo_regs += 32; /* add the Dn scalar register pseudos */ + num_pseudo_regs += 32; /* add the Sn scalar register pseudos */ + num_pseudo_regs += 32; /* add the Hn scalar register pseudos */ + num_pseudo_regs += 32; /* add the Bn scalar register pseudos */ } /* Add the TLS register. */ @@ -3646,9 +3565,8 @@ aarch64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Look for the TLS registers. tpidr is required, but tpidr2 is optional. */ - valid_p - = tdesc_numbered_register (feature_tls, tdesc_data.get (), - first_tls_regnum, "tpidr"); + valid_p = tdesc_numbered_register (feature_tls, tdesc_data.get (), + first_tls_regnum, "tpidr"); if (valid_p) { @@ -3667,8 +3585,8 @@ aarch64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) } else { - warning (_("Provided TLS register feature doesn't contain " - "required tpidr register.")); + warning (_ ("Provided TLS register feature doesn't contain " + "required tpidr register.")); return nullptr; } } @@ -3686,7 +3604,7 @@ aarch64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) aarch64_pauth_register_names[i]); num_regs += i; - num_pseudo_regs += 1; /* Count RA_STATE pseudo register. */ + num_pseudo_regs += 1; /* Count RA_STATE pseudo register. */ } /* Add the MTE registers. */ @@ -3702,9 +3620,9 @@ aarch64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) num_regs += i; } - /* W pseudo-registers */ - int first_w_regnum = num_pseudo_regs; - num_pseudo_regs += 31; + /* W pseudo-registers */ + int first_w_regnum = num_pseudo_regs; + num_pseudo_regs += 31; if (!valid_p) return nullptr; @@ -3718,7 +3636,7 @@ aarch64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* This should be low enough for everything. */ tdep->lowest_pc = 0x20; - tdep->jb_pc = -1; /* Longjump support not enabled by default. */ + tdep->jb_pc = -1; /* Longjump support not enabled by default. */ tdep->jb_elt_size = 8; tdep->vq = vq; tdep->pauth_reg_base = first_pauth_regnum; @@ -3775,7 +3693,8 @@ aarch64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_type_align (gdbarch, aarch64_type_align); /* Detect whether PC is at a point where the stack has been destroyed. */ - set_gdbarch_stack_frame_destroyed_p (gdbarch, aarch64_stack_frame_destroyed_p); + set_gdbarch_stack_frame_destroyed_p (gdbarch, + aarch64_stack_frame_destroyed_p); /* Internal <-> external register number maps. */ set_gdbarch_dwarf2_reg_to_regnum (gdbarch, aarch64_dwarf_reg_to_regnum); @@ -3796,8 +3715,8 @@ aarch64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) dwarf2_frame_set_init_reg (gdbarch, aarch64_dwarf2_frame_init_reg); /* Register DWARF CFA vendor handler. */ - set_gdbarch_execute_dwarf_cfa_vendor_op (gdbarch, - aarch64_execute_dwarf_cfa_vendor_op); + set_gdbarch_execute_dwarf_cfa_vendor_op ( + gdbarch, aarch64_execute_dwarf_cfa_vendor_op); /* Permanent/Program breakpoint handling. */ set_gdbarch_program_breakpoint_here_p (gdbarch, @@ -3857,7 +3776,7 @@ aarch64_dump_tdep (struct gdbarch *gdbarch, struct ui_file *file) if (tdep == NULL) return; - gdb_printf (file, _("aarch64_dump_tdep: Lowest pc = 0x%s\n"), + gdb_printf (file, _ ("aarch64_dump_tdep: Lowest pc = 0x%s\n"), paddress (gdbarch, tdep->lowest_pc)); } @@ -3869,20 +3788,21 @@ static void aarch64_process_record_test (void); #endif void _initialize_aarch64_tdep (); + void _initialize_aarch64_tdep () { - gdbarch_register (bfd_arch_aarch64, aarch64_gdbarch_init, - aarch64_dump_tdep); + gdbarch_register (bfd_arch_aarch64, aarch64_gdbarch_init, aarch64_dump_tdep); /* Debug this file's internals. */ - add_setshow_boolean_cmd ("aarch64", class_maintenance, &aarch64_debug, _("\ -Set AArch64 debugging."), _("\ -Show AArch64 debugging."), _("\ + add_setshow_boolean_cmd ("aarch64", class_maintenance, &aarch64_debug, _ ("\ +Set AArch64 debugging."), + _ ("\ +Show AArch64 debugging."), + _ ("\ When on, AArch64 specific debugging is enabled."), - NULL, - show_aarch64_debug, - &setdebuglist, &showdebuglist); + NULL, show_aarch64_debug, &setdebuglist, + &showdebuglist); #if GDB_SELF_TEST selftests::register_test ("aarch64-analyze-prologue", @@ -3894,37 +3814,37 @@ When on, AArch64 specific debugging is enabled."), /* AArch64 process record-replay related structures, defines etc. */ -#define REG_ALLOC(REGS, LENGTH, RECORD_BUF) \ - do \ - { \ - unsigned int reg_len = LENGTH; \ - if (reg_len) \ - { \ - REGS = XNEWVEC (uint32_t, reg_len); \ - memcpy(®S[0], &RECORD_BUF[0], sizeof(uint32_t)*LENGTH); \ - } \ - } \ - while (0) - -#define MEM_ALLOC(MEMS, LENGTH, RECORD_BUF) \ - do \ - { \ - unsigned int mem_len = LENGTH; \ - if (mem_len) \ - { \ - MEMS = XNEWVEC (struct aarch64_mem_r, mem_len); \ - memcpy(MEMS, &RECORD_BUF[0], \ - sizeof(struct aarch64_mem_r) * LENGTH); \ - } \ - } \ - while (0) +#define REG_ALLOC(REGS, LENGTH, RECORD_BUF) \ + do \ + { \ + unsigned int reg_len = LENGTH; \ + if (reg_len) \ + { \ + REGS = XNEWVEC (uint32_t, reg_len); \ + memcpy (®S[0], &RECORD_BUF[0], sizeof (uint32_t) * LENGTH); \ + } \ + } \ + while (0) + +#define MEM_ALLOC(MEMS, LENGTH, RECORD_BUF) \ + do \ + { \ + unsigned int mem_len = LENGTH; \ + if (mem_len) \ + { \ + MEMS = XNEWVEC (struct aarch64_mem_r, mem_len); \ + memcpy (MEMS, &RECORD_BUF[0], \ + sizeof (struct aarch64_mem_r) * LENGTH); \ + } \ + } \ + while (0) /* AArch64 record/replay structures and enumerations. */ struct aarch64_mem_r { - uint64_t len; /* Record length. */ - uint64_t addr; /* Memory address. */ + uint64_t len; /* Record length. */ + uint64_t addr; /* Memory address. */ }; enum aarch64_record_result @@ -3938,12 +3858,12 @@ struct aarch64_insn_decode_record { struct gdbarch *gdbarch; struct regcache *regcache; - CORE_ADDR this_addr; /* Address of insn to be recorded. */ - uint32_t aarch64_insn; /* Insn to be recorded. */ - uint32_t mem_rec_count; /* Count of memory records. */ - uint32_t reg_rec_count; /* Count of register records. */ - uint32_t *aarch64_regs; /* Registers to be recorded. */ - struct aarch64_mem_r *aarch64_mems; /* Memory locations to be recorded. */ + CORE_ADDR this_addr; /* Address of insn to be recorded. */ + uint32_t aarch64_insn; /* Insn to be recorded. */ + uint32_t mem_rec_count; /* Count of memory records. */ + uint32_t reg_rec_count; /* Count of register records. */ + uint32_t *aarch64_regs; /* Registers to be recorded. */ + struct aarch64_mem_r *aarch64_mems; /* Memory locations to be recorded. */ }; /* Record handler for data processing - register instructions. */ @@ -4034,9 +3954,9 @@ aarch64_record_data_proc_imm (aarch64_insn_decode_record *aarch64_insn_r) insn_bit23 = bit (aarch64_insn_r->aarch64_insn, 23); insn_bits24_27 = bits (aarch64_insn_r->aarch64_insn, 24, 27); - if (insn_bits24_27 == 0x00 /* PC rel addressing. */ - || insn_bits24_27 == 0x03 /* Bitfield and Extract. */ - || (insn_bits24_27 == 0x02 && insn_bit23)) /* Move wide (immediate). */ + if (insn_bits24_27 == 0x00 /* PC rel addressing. */ + || insn_bits24_27 == 0x03 /* Bitfield and Extract. */ + || (insn_bits24_27 == 0x02 && insn_bit23)) /* Move wide (immediate). */ { record_buf[0] = reg_rd; aarch64_insn_r->reg_rec_count = 1; @@ -4072,7 +3992,6 @@ aarch64_record_data_proc_imm (aarch64_insn_decode_record *aarch64_insn_r) static unsigned int aarch64_record_branch_except_sys (aarch64_insn_decode_record *aarch64_insn_r) { - aarch64_gdbarch_tdep *tdep = gdbarch_tdep (aarch64_insn_r->gdbarch); uint8_t insn_bits24_27, insn_bits28_31, insn_bits22_23; @@ -4123,7 +4042,7 @@ aarch64_record_branch_except_sys (aarch64_insn_decode_record *aarch64_insn_r) } } /* Unconditional branch (register). */ - else if((insn_bits24_27 & 0x0e) == 0x06) + else if ((insn_bits24_27 & 0x0e) == 0x06) { record_buf[aarch64_insn_r->reg_rec_count++] = AARCH64_PC_REGNUM; if (bits (aarch64_insn_r->aarch64_insn, 21, 22) == 0x01) @@ -4176,8 +4095,8 @@ aarch64_record_asimd_load_store (aarch64_insn_decode_record *aarch64_insn_r) { uint8_t sindex, scale, selem, esize, replicate = 0; scale = opcode_bits >> 2; - selem = ((opcode_bits & 0x02) | - bit (aarch64_insn_r->aarch64_insn, 21)) + 1; + selem + = ((opcode_bits & 0x02) | bit (aarch64_insn_r->aarch64_insn, 21)) + 1; switch (scale) { case 1: @@ -4470,8 +4389,8 @@ aarch64_record_load_store (aarch64_insn_decode_record *aarch64_insn_r) if (record_debug) { debug_printf ("Process record: load/store (unsigned immediate):" - " size %x V %d opc %x\n", size_bits, vector_flag, - opc); + " size %x V %d opc %x\n", + size_bits, vector_flag, opc); } if (!ld_flag) @@ -4508,18 +4427,19 @@ aarch64_record_load_store (aarch64_insn_decode_record *aarch64_insn_r) ld_flag = 0x01; else ld_flag = 0x0; + else if (size_bits != 0x03) + ld_flag = 0x01; else - if (size_bits != 0x03) - ld_flag = 0x01; - else - return AARCH64_RECORD_UNKNOWN; + return AARCH64_RECORD_UNKNOWN; if (!ld_flag) { ULONGEST reg_rm_val; regcache_raw_read_unsigned (aarch64_insn_r->regcache, - bits (aarch64_insn_r->aarch64_insn, 16, 20), ®_rm_val); + bits (aarch64_insn_r->aarch64_insn, 16, + 20), + ®_rm_val); if (bit (aarch64_insn_r->aarch64_insn, 12)) offset = reg_rm_val << size_bits; else @@ -4556,17 +4476,17 @@ aarch64_record_load_store (aarch64_insn_decode_record *aarch64_insn_r) ld_flag = 0x01; else ld_flag = 0x0; + else if (size_bits != 0x03) + ld_flag = 0x01; else - if (size_bits != 0x03) - ld_flag = 0x01; - else - return AARCH64_RECORD_UNKNOWN; + return AARCH64_RECORD_UNKNOWN; if (!ld_flag) { uint16_t imm9_off; imm9_off = bits (aarch64_insn_r->aarch64_insn, 12, 20); - offset = (imm9_off & 0x0100) ? (((~imm9_off) & 0x01ff) + 1) : imm9_off; + offset + = (imm9_off & 0x0100) ? (((~imm9_off) & 0x01ff) + 1) : imm9_off; datasize = 8 << size_bits; regcache_raw_read_unsigned (aarch64_insn_r->regcache, reg_rn, &address); @@ -4801,7 +4721,8 @@ deallocate_reg_mem (aarch64_insn_decode_record *record) } #if GDB_SELF_TEST -namespace selftests { +namespace selftests +{ static void aarch64_process_record_test (void) @@ -4852,8 +4773,7 @@ aarch64_process_record (struct gdbarch *gdbarch, struct regcache *regcache, memset (&aarch64_record, 0, sizeof (aarch64_insn_decode_record)); target_read_memory (insn_addr, &buf[0], insn_size); aarch64_record.aarch64_insn - = (uint32_t) extract_unsigned_integer (&buf[0], - insn_size, + = (uint32_t) extract_unsigned_integer (&buf[0], insn_size, gdbarch_byte_order (gdbarch)); aarch64_record.regcache = regcache; aarch64_record.this_addr = insn_addr; @@ -4863,10 +4783,9 @@ aarch64_process_record (struct gdbarch *gdbarch, struct regcache *regcache, if (ret == AARCH64_RECORD_UNSUPPORTED) { gdb_printf (gdb_stderr, - _("Process record does not support instruction " - "0x%0x at address %s.\n"), - aarch64_record.aarch64_insn, - paddress (gdbarch, insn_addr)); + _ ("Process record does not support instruction " + "0x%0x at address %s.\n"), + aarch64_record.aarch64_insn, paddress (gdbarch, insn_addr)); ret = -1; } @@ -4880,16 +4799,16 @@ aarch64_process_record (struct gdbarch *gdbarch, struct regcache *regcache, AARCH64_CPSR_REGNUM); if (aarch64_record.aarch64_regs) for (rec_no = 0; rec_no < aarch64_record.reg_rec_count; rec_no++) - if (record_full_arch_list_add_reg (aarch64_record.regcache, - aarch64_record.aarch64_regs[rec_no])) + if (record_full_arch_list_add_reg ( + aarch64_record.regcache, aarch64_record.aarch64_regs[rec_no])) ret = -1; /* Record memories. */ if (aarch64_record.aarch64_mems) for (rec_no = 0; rec_no < aarch64_record.mem_rec_count; rec_no++) - if (record_full_arch_list_add_mem - ((CORE_ADDR)aarch64_record.aarch64_mems[rec_no].addr, - aarch64_record.aarch64_mems[rec_no].len)) + if (record_full_arch_list_add_mem ( + (CORE_ADDR) aarch64_record.aarch64_mems[rec_no].addr, + aarch64_record.aarch64_mems[rec_no].len)) ret = -1; if (record_full_arch_list_add_end ()) diff --git a/gdb/aarch64-tdep.h b/gdb/aarch64-tdep.h index 97b8d0c..5deac7e 100644 --- a/gdb/aarch64-tdep.h +++ b/gdb/aarch64-tdep.h @@ -18,7 +18,6 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ - #ifndef AARCH64_TDEP_H #define AARCH64_TDEP_H @@ -32,22 +31,22 @@ struct gdbarch; struct regset; /* AArch64 Dwarf register numbering. */ -#define AARCH64_DWARF_X0 0 -#define AARCH64_DWARF_SP 31 -#define AARCH64_DWARF_PC 32 -#define AARCH64_DWARF_RA_SIGN_STATE 34 -#define AARCH64_DWARF_V0 64 -#define AARCH64_DWARF_SVE_VG 46 -#define AARCH64_DWARF_SVE_FFR 47 -#define AARCH64_DWARF_SVE_P0 48 -#define AARCH64_DWARF_SVE_Z0 96 +#define AARCH64_DWARF_X0 0 +#define AARCH64_DWARF_SP 31 +#define AARCH64_DWARF_PC 32 +#define AARCH64_DWARF_RA_SIGN_STATE 34 +#define AARCH64_DWARF_V0 64 +#define AARCH64_DWARF_SVE_VG 46 +#define AARCH64_DWARF_SVE_FFR 47 +#define AARCH64_DWARF_SVE_P0 48 +#define AARCH64_DWARF_SVE_Z0 96 /* Size of integer registers. */ -#define X_REGISTER_SIZE 8 -#define B_REGISTER_SIZE 1 -#define H_REGISTER_SIZE 2 -#define S_REGISTER_SIZE 4 -#define D_REGISTER_SIZE 8 +#define X_REGISTER_SIZE 8 +#define B_REGISTER_SIZE 1 +#define H_REGISTER_SIZE 2 +#define S_REGISTER_SIZE 4 +#define D_REGISTER_SIZE 8 #define Q_REGISTER_SIZE 16 /* Total number of general (X) registers. */ @@ -82,43 +81,32 @@ struct aarch64_gdbarch_tdep : gdbarch_tdep_base /* syscall record. */ int (*aarch64_syscall_record) (struct regcache *regcache, - unsigned long svc_number) = nullptr; + unsigned long svc_number) + = nullptr; /* The VQ value for SVE targets, or zero if SVE is not supported. */ uint64_t vq = 0; /* Returns true if the target supports SVE. */ - bool has_sve () const - { - return vq != 0; - } + bool has_sve () const { return vq != 0; } int pauth_reg_base = 0; int ra_sign_state_regnum = 0; /* Returns true if the target supports pauth. */ - bool has_pauth () const - { - return pauth_reg_base != -1; - } + bool has_pauth () const { return pauth_reg_base != -1; } /* First MTE register. This is -1 if no MTE registers are available. */ int mte_reg_base = 0; /* Returns true if the target supports MTE. */ - bool has_mte () const - { - return mte_reg_base != -1; - } + bool has_mte () const { return mte_reg_base != -1; } /* TLS registers. This is -1 if the TLS registers are not available. */ int tls_regnum_base = 0; int tls_register_count = 0; - bool has_tls() const - { - return tls_regnum_base != -1; - } + bool has_tls () const { return tls_regnum_base != -1; } /* The W pseudo-registers. */ int w_pseudo_base = 0; @@ -130,12 +118,11 @@ aarch64_features aarch64_features_from_target_desc (const struct target_desc *tdesc); extern int aarch64_process_record (struct gdbarch *gdbarch, - struct regcache *regcache, CORE_ADDR addr); + struct regcache *regcache, CORE_ADDR addr); displaced_step_copy_insn_closure_up - aarch64_displaced_step_copy_insn (struct gdbarch *gdbarch, - CORE_ADDR from, CORE_ADDR to, - struct regcache *regs); +aarch64_displaced_step_copy_insn (struct gdbarch *gdbarch, CORE_ADDR from, + CORE_ADDR to, struct regcache *regs); void aarch64_displaced_step_fixup (struct gdbarch *gdbarch, displaced_step_copy_insn_closure *dsc, diff --git a/gdb/ada-casefold.h b/gdb/ada-casefold.h index f7c1fca..4ba9518 100644 --- a/gdb/ada-casefold.h +++ b/gdb/ada-casefold.h @@ -1,5 +1,5 @@ /* *INDENT-OFF* */ /* THIS FILE IS GENERATED -*- buffer-read-only: t -*- */ -/* vi:set ro: */ + /* vi:set ro: */ /* UTF-32 case-folding for GDB @@ -24,1322 +24,447 @@ ./ada-unicode.py */ - {65, 90, 0, 32}, - {97, 122, -32, 0}, - {181, 181, 743, 0}, - {192, 214, 0, 32}, - {216, 222, 0, 32}, - {224, 246, -32, 0}, - {248, 254, -32, 0}, - {255, 255, 121, 0}, - {256, 256, 0, 1}, - {257, 257, -1, 0}, - {258, 258, 0, 1}, - {259, 259, -1, 0}, - {260, 260, 0, 1}, - {261, 261, -1, 0}, - {262, 262, 0, 1}, - {263, 263, -1, 0}, - {264, 264, 0, 1}, - {265, 265, -1, 0}, - {266, 266, 0, 1}, - {267, 267, -1, 0}, - {268, 268, 0, 1}, - {269, 269, -1, 0}, - {270, 270, 0, 1}, - {271, 271, -1, 0}, - {272, 272, 0, 1}, - {273, 273, -1, 0}, - {274, 274, 0, 1}, - {275, 275, -1, 0}, - {276, 276, 0, 1}, - {277, 277, -1, 0}, - {278, 278, 0, 1}, - {279, 279, -1, 0}, - {280, 280, 0, 1}, - {281, 281, -1, 0}, - {282, 282, 0, 1}, - {283, 283, -1, 0}, - {284, 284, 0, 1}, - {285, 285, -1, 0}, - {286, 286, 0, 1}, - {287, 287, -1, 0}, - {288, 288, 0, 1}, - {289, 289, -1, 0}, - {290, 290, 0, 1}, - {291, 291, -1, 0}, - {292, 292, 0, 1}, - {293, 293, -1, 0}, - {294, 294, 0, 1}, - {295, 295, -1, 0}, - {296, 296, 0, 1}, - {297, 297, -1, 0}, - {298, 298, 0, 1}, - {299, 299, -1, 0}, - {300, 300, 0, 1}, - {301, 301, -1, 0}, - {302, 302, 0, 1}, - {303, 303, -1, 0}, - {305, 305, -232, 0}, - {306, 306, 0, 1}, - {307, 307, -1, 0}, - {308, 308, 0, 1}, - {309, 309, -1, 0}, - {310, 310, 0, 1}, - {311, 311, -1, 0}, - {313, 313, 0, 1}, - {314, 314, -1, 0}, - {315, 315, 0, 1}, - {316, 316, -1, 0}, - {317, 317, 0, 1}, - {318, 318, -1, 0}, - {319, 319, 0, 1}, - {320, 320, -1, 0}, - {321, 321, 0, 1}, - {322, 322, -1, 0}, - {323, 323, 0, 1}, - {324, 324, -1, 0}, - {325, 325, 0, 1}, - {326, 326, -1, 0}, - {327, 327, 0, 1}, - {328, 328, -1, 0}, - {330, 330, 0, 1}, - {331, 331, -1, 0}, - {332, 332, 0, 1}, - {333, 333, -1, 0}, - {334, 334, 0, 1}, - {335, 335, -1, 0}, - {336, 336, 0, 1}, - {337, 337, -1, 0}, - {338, 338, 0, 1}, - {339, 339, -1, 0}, - {340, 340, 0, 1}, - {341, 341, -1, 0}, - {342, 342, 0, 1}, - {343, 343, -1, 0}, - {344, 344, 0, 1}, - {345, 345, -1, 0}, - {346, 346, 0, 1}, - {347, 347, -1, 0}, - {348, 348, 0, 1}, - {349, 349, -1, 0}, - {350, 350, 0, 1}, - {351, 351, -1, 0}, - {352, 352, 0, 1}, - {353, 353, -1, 0}, - {354, 354, 0, 1}, - {355, 355, -1, 0}, - {356, 356, 0, 1}, - {357, 357, -1, 0}, - {358, 358, 0, 1}, - {359, 359, -1, 0}, - {360, 360, 0, 1}, - {361, 361, -1, 0}, - {362, 362, 0, 1}, - {363, 363, -1, 0}, - {364, 364, 0, 1}, - {365, 365, -1, 0}, - {366, 366, 0, 1}, - {367, 367, -1, 0}, - {368, 368, 0, 1}, - {369, 369, -1, 0}, - {370, 370, 0, 1}, - {371, 371, -1, 0}, - {372, 372, 0, 1}, - {373, 373, -1, 0}, - {374, 374, 0, 1}, - {375, 375, -1, 0}, - {376, 376, 0, -121}, - {377, 377, 0, 1}, - {378, 378, -1, 0}, - {379, 379, 0, 1}, - {380, 380, -1, 0}, - {381, 381, 0, 1}, - {382, 382, -1, 0}, - {383, 383, -300, 0}, - {384, 384, 195, 0}, - {385, 385, 0, 210}, - {386, 386, 0, 1}, - {387, 387, -1, 0}, - {388, 388, 0, 1}, - {389, 389, -1, 0}, - {390, 390, 0, 206}, - {391, 391, 0, 1}, - {392, 392, -1, 0}, - {393, 394, 0, 205}, - {395, 395, 0, 1}, - {396, 396, -1, 0}, - {398, 398, 0, 79}, - {399, 399, 0, 202}, - {400, 400, 0, 203}, - {401, 401, 0, 1}, - {402, 402, -1, 0}, - {403, 403, 0, 205}, - {404, 404, 0, 207}, - {405, 405, 97, 0}, - {406, 406, 0, 211}, - {407, 407, 0, 209}, - {408, 408, 0, 1}, - {409, 409, -1, 0}, - {410, 410, 163, 0}, - {412, 412, 0, 211}, - {413, 413, 0, 213}, - {414, 414, 130, 0}, - {415, 415, 0, 214}, - {416, 416, 0, 1}, - {417, 417, -1, 0}, - {418, 418, 0, 1}, - {419, 419, -1, 0}, - {420, 420, 0, 1}, - {421, 421, -1, 0}, - {422, 422, 0, 218}, - {423, 423, 0, 1}, - {424, 424, -1, 0}, - {425, 425, 0, 218}, - {428, 428, 0, 1}, - {429, 429, -1, 0}, - {430, 430, 0, 218}, - {431, 431, 0, 1}, - {432, 432, -1, 0}, - {433, 434, 0, 217}, - {435, 435, 0, 1}, - {436, 436, -1, 0}, - {437, 437, 0, 1}, - {438, 438, -1, 0}, - {439, 439, 0, 219}, - {440, 440, 0, 1}, - {441, 441, -1, 0}, - {444, 444, 0, 1}, - {445, 445, -1, 0}, - {447, 447, 56, 0}, - {452, 452, 0, 2}, - {453, 453, -1, 1}, - {454, 454, -2, 0}, - {455, 455, 0, 2}, - {456, 456, -1, 1}, - {457, 457, -2, 0}, - {458, 458, 0, 2}, - {459, 459, -1, 1}, - {460, 460, -2, 0}, - {461, 461, 0, 1}, - {462, 462, -1, 0}, - {463, 463, 0, 1}, - {464, 464, -1, 0}, - {465, 465, 0, 1}, - {466, 466, -1, 0}, - {467, 467, 0, 1}, - {468, 468, -1, 0}, - {469, 469, 0, 1}, - {470, 470, -1, 0}, - {471, 471, 0, 1}, - {472, 472, -1, 0}, - {473, 473, 0, 1}, - {474, 474, -1, 0}, - {475, 475, 0, 1}, - {476, 476, -1, 0}, - {477, 477, -79, 0}, - {478, 478, 0, 1}, - {479, 479, -1, 0}, - {480, 480, 0, 1}, - {481, 481, -1, 0}, - {482, 482, 0, 1}, - {483, 483, -1, 0}, - {484, 484, 0, 1}, - {485, 485, -1, 0}, - {486, 486, 0, 1}, - {487, 487, -1, 0}, - {488, 488, 0, 1}, - {489, 489, -1, 0}, - {490, 490, 0, 1}, - {491, 491, -1, 0}, - {492, 492, 0, 1}, - {493, 493, -1, 0}, - {494, 494, 0, 1}, - {495, 495, -1, 0}, - {497, 497, 0, 2}, - {498, 498, -1, 1}, - {499, 499, -2, 0}, - {500, 500, 0, 1}, - {501, 501, -1, 0}, - {502, 502, 0, -97}, - {503, 503, 0, -56}, - {504, 504, 0, 1}, - {505, 505, -1, 0}, - {506, 506, 0, 1}, - {507, 507, -1, 0}, - {508, 508, 0, 1}, - {509, 509, -1, 0}, - {510, 510, 0, 1}, - {511, 511, -1, 0}, - {512, 512, 0, 1}, - {513, 513, -1, 0}, - {514, 514, 0, 1}, - {515, 515, -1, 0}, - {516, 516, 0, 1}, - {517, 517, -1, 0}, - {518, 518, 0, 1}, - {519, 519, -1, 0}, - {520, 520, 0, 1}, - {521, 521, -1, 0}, - {522, 522, 0, 1}, - {523, 523, -1, 0}, - {524, 524, 0, 1}, - {525, 525, -1, 0}, - {526, 526, 0, 1}, - {527, 527, -1, 0}, - {528, 528, 0, 1}, - {529, 529, -1, 0}, - {530, 530, 0, 1}, - {531, 531, -1, 0}, - {532, 532, 0, 1}, - {533, 533, -1, 0}, - {534, 534, 0, 1}, - {535, 535, -1, 0}, - {536, 536, 0, 1}, - {537, 537, -1, 0}, - {538, 538, 0, 1}, - {539, 539, -1, 0}, - {540, 540, 0, 1}, - {541, 541, -1, 0}, - {542, 542, 0, 1}, - {543, 543, -1, 0}, - {544, 544, 0, -130}, - {546, 546, 0, 1}, - {547, 547, -1, 0}, - {548, 548, 0, 1}, - {549, 549, -1, 0}, - {550, 550, 0, 1}, - {551, 551, -1, 0}, - {552, 552, 0, 1}, - {553, 553, -1, 0}, - {554, 554, 0, 1}, - {555, 555, -1, 0}, - {556, 556, 0, 1}, - {557, 557, -1, 0}, - {558, 558, 0, 1}, - {559, 559, -1, 0}, - {560, 560, 0, 1}, - {561, 561, -1, 0}, - {562, 562, 0, 1}, - {563, 563, -1, 0}, - {570, 570, 0, 10795}, - {571, 571, 0, 1}, - {572, 572, -1, 0}, - {573, 573, 0, -163}, - {574, 574, 0, 10792}, - {575, 576, 10815, 0}, - {577, 577, 0, 1}, - {578, 578, -1, 0}, - {579, 579, 0, -195}, - {580, 580, 0, 69}, - {581, 581, 0, 71}, - {582, 582, 0, 1}, - {583, 583, -1, 0}, - {584, 584, 0, 1}, - {585, 585, -1, 0}, - {586, 586, 0, 1}, - {587, 587, -1, 0}, - {588, 588, 0, 1}, - {589, 589, -1, 0}, - {590, 590, 0, 1}, - {591, 591, -1, 0}, - {592, 592, 10783, 0}, - {593, 593, 10780, 0}, - {594, 594, 10782, 0}, - {595, 595, -210, 0}, - {596, 596, -206, 0}, - {598, 599, -205, 0}, - {601, 601, -202, 0}, - {603, 603, -203, 0}, - {604, 604, 42319, 0}, - {608, 608, -205, 0}, - {609, 609, 42315, 0}, - {611, 611, -207, 0}, - {613, 613, 42280, 0}, - {614, 614, 42308, 0}, - {616, 616, -209, 0}, - {617, 617, -211, 0}, - {618, 618, 42308, 0}, - {619, 619, 10743, 0}, - {620, 620, 42305, 0}, - {623, 623, -211, 0}, - {625, 625, 10749, 0}, - {626, 626, -213, 0}, - {629, 629, -214, 0}, - {637, 637, 10727, 0}, - {640, 640, -218, 0}, - {642, 642, 42307, 0}, - {643, 643, -218, 0}, - {647, 647, 42282, 0}, - {648, 648, -218, 0}, - {649, 649, -69, 0}, - {650, 651, -217, 0}, - {652, 652, -71, 0}, - {658, 658, -219, 0}, - {669, 669, 42261, 0}, - {670, 670, 42258, 0}, - {837, 837, 84, 0}, - {880, 880, 0, 1}, - {881, 881, -1, 0}, - {882, 882, 0, 1}, - {883, 883, -1, 0}, - {886, 886, 0, 1}, - {887, 887, -1, 0}, - {891, 893, 130, 0}, - {895, 895, 0, 116}, - {902, 902, 0, 38}, - {904, 906, 0, 37}, - {908, 908, 0, 64}, - {910, 911, 0, 63}, - {913, 929, 0, 32}, - {931, 939, 0, 32}, - {940, 940, -38, 0}, - {941, 943, -37, 0}, - {945, 961, -32, 0}, - {962, 962, -31, 0}, - {963, 971, -32, 0}, - {972, 972, -64, 0}, - {973, 974, -63, 0}, - {975, 975, 0, 8}, - {976, 976, -62, 0}, - {977, 977, -57, 0}, - {981, 981, -47, 0}, - {982, 982, -54, 0}, - {983, 983, -8, 0}, - {984, 984, 0, 1}, - {985, 985, -1, 0}, - {986, 986, 0, 1}, - {987, 987, -1, 0}, - {988, 988, 0, 1}, - {989, 989, -1, 0}, - {990, 990, 0, 1}, - {991, 991, -1, 0}, - {992, 992, 0, 1}, - {993, 993, -1, 0}, - {994, 994, 0, 1}, - {995, 995, -1, 0}, - {996, 996, 0, 1}, - {997, 997, -1, 0}, - {998, 998, 0, 1}, - {999, 999, -1, 0}, - {1000, 1000, 0, 1}, - {1001, 1001, -1, 0}, - {1002, 1002, 0, 1}, - {1003, 1003, -1, 0}, - {1004, 1004, 0, 1}, - {1005, 1005, -1, 0}, - {1006, 1006, 0, 1}, - {1007, 1007, -1, 0}, - {1008, 1008, -86, 0}, - {1009, 1009, -80, 0}, - {1010, 1010, 7, 0}, - {1011, 1011, -116, 0}, - {1012, 1012, 0, -60}, - {1013, 1013, -96, 0}, - {1015, 1015, 0, 1}, - {1016, 1016, -1, 0}, - {1017, 1017, 0, -7}, - {1018, 1018, 0, 1}, - {1019, 1019, -1, 0}, - {1021, 1023, 0, -130}, - {1024, 1039, 0, 80}, - {1040, 1071, 0, 32}, - {1072, 1103, -32, 0}, - {1104, 1119, -80, 0}, - {1120, 1120, 0, 1}, - {1121, 1121, -1, 0}, - {1122, 1122, 0, 1}, - {1123, 1123, -1, 0}, - {1124, 1124, 0, 1}, - {1125, 1125, -1, 0}, - {1126, 1126, 0, 1}, - {1127, 1127, -1, 0}, - {1128, 1128, 0, 1}, - {1129, 1129, -1, 0}, - {1130, 1130, 0, 1}, - {1131, 1131, -1, 0}, - {1132, 1132, 0, 1}, - {1133, 1133, -1, 0}, - {1134, 1134, 0, 1}, - {1135, 1135, -1, 0}, - {1136, 1136, 0, 1}, - {1137, 1137, -1, 0}, - {1138, 1138, 0, 1}, - {1139, 1139, -1, 0}, - {1140, 1140, 0, 1}, - {1141, 1141, -1, 0}, - {1142, 1142, 0, 1}, - {1143, 1143, -1, 0}, - {1144, 1144, 0, 1}, - {1145, 1145, -1, 0}, - {1146, 1146, 0, 1}, - {1147, 1147, -1, 0}, - {1148, 1148, 0, 1}, - {1149, 1149, -1, 0}, - {1150, 1150, 0, 1}, - {1151, 1151, -1, 0}, - {1152, 1152, 0, 1}, - {1153, 1153, -1, 0}, - {1162, 1162, 0, 1}, - {1163, 1163, -1, 0}, - {1164, 1164, 0, 1}, - {1165, 1165, -1, 0}, - {1166, 1166, 0, 1}, - {1167, 1167, -1, 0}, - {1168, 1168, 0, 1}, - {1169, 1169, -1, 0}, - {1170, 1170, 0, 1}, - {1171, 1171, -1, 0}, - {1172, 1172, 0, 1}, - {1173, 1173, -1, 0}, - {1174, 1174, 0, 1}, - {1175, 1175, -1, 0}, - {1176, 1176, 0, 1}, - {1177, 1177, -1, 0}, - {1178, 1178, 0, 1}, - {1179, 1179, -1, 0}, - {1180, 1180, 0, 1}, - {1181, 1181, -1, 0}, - {1182, 1182, 0, 1}, - {1183, 1183, -1, 0}, - {1184, 1184, 0, 1}, - {1185, 1185, -1, 0}, - {1186, 1186, 0, 1}, - {1187, 1187, -1, 0}, - {1188, 1188, 0, 1}, - {1189, 1189, -1, 0}, - {1190, 1190, 0, 1}, - {1191, 1191, -1, 0}, - {1192, 1192, 0, 1}, - {1193, 1193, -1, 0}, - {1194, 1194, 0, 1}, - {1195, 1195, -1, 0}, - {1196, 1196, 0, 1}, - {1197, 1197, -1, 0}, - {1198, 1198, 0, 1}, - {1199, 1199, -1, 0}, - {1200, 1200, 0, 1}, - {1201, 1201, -1, 0}, - {1202, 1202, 0, 1}, - {1203, 1203, -1, 0}, - {1204, 1204, 0, 1}, - {1205, 1205, -1, 0}, - {1206, 1206, 0, 1}, - {1207, 1207, -1, 0}, - {1208, 1208, 0, 1}, - {1209, 1209, -1, 0}, - {1210, 1210, 0, 1}, - {1211, 1211, -1, 0}, - {1212, 1212, 0, 1}, - {1213, 1213, -1, 0}, - {1214, 1214, 0, 1}, - {1215, 1215, -1, 0}, - {1216, 1216, 0, 15}, - {1217, 1217, 0, 1}, - {1218, 1218, -1, 0}, - {1219, 1219, 0, 1}, - {1220, 1220, -1, 0}, - {1221, 1221, 0, 1}, - {1222, 1222, -1, 0}, - {1223, 1223, 0, 1}, - {1224, 1224, -1, 0}, - {1225, 1225, 0, 1}, - {1226, 1226, -1, 0}, - {1227, 1227, 0, 1}, - {1228, 1228, -1, 0}, - {1229, 1229, 0, 1}, - {1230, 1230, -1, 0}, - {1231, 1231, -15, 0}, - {1232, 1232, 0, 1}, - {1233, 1233, -1, 0}, - {1234, 1234, 0, 1}, - {1235, 1235, -1, 0}, - {1236, 1236, 0, 1}, - {1237, 1237, -1, 0}, - {1238, 1238, 0, 1}, - {1239, 1239, -1, 0}, - {1240, 1240, 0, 1}, - {1241, 1241, -1, 0}, - {1242, 1242, 0, 1}, - {1243, 1243, -1, 0}, - {1244, 1244, 0, 1}, - {1245, 1245, -1, 0}, - {1246, 1246, 0, 1}, - {1247, 1247, -1, 0}, - {1248, 1248, 0, 1}, - {1249, 1249, -1, 0}, - {1250, 1250, 0, 1}, - {1251, 1251, -1, 0}, - {1252, 1252, 0, 1}, - {1253, 1253, -1, 0}, - {1254, 1254, 0, 1}, - {1255, 1255, -1, 0}, - {1256, 1256, 0, 1}, - {1257, 1257, -1, 0}, - {1258, 1258, 0, 1}, - {1259, 1259, -1, 0}, - {1260, 1260, 0, 1}, - {1261, 1261, -1, 0}, - {1262, 1262, 0, 1}, - {1263, 1263, -1, 0}, - {1264, 1264, 0, 1}, - {1265, 1265, -1, 0}, - {1266, 1266, 0, 1}, - {1267, 1267, -1, 0}, - {1268, 1268, 0, 1}, - {1269, 1269, -1, 0}, - {1270, 1270, 0, 1}, - {1271, 1271, -1, 0}, - {1272, 1272, 0, 1}, - {1273, 1273, -1, 0}, - {1274, 1274, 0, 1}, - {1275, 1275, -1, 0}, - {1276, 1276, 0, 1}, - {1277, 1277, -1, 0}, - {1278, 1278, 0, 1}, - {1279, 1279, -1, 0}, - {1280, 1280, 0, 1}, - {1281, 1281, -1, 0}, - {1282, 1282, 0, 1}, - {1283, 1283, -1, 0}, - {1284, 1284, 0, 1}, - {1285, 1285, -1, 0}, - {1286, 1286, 0, 1}, - {1287, 1287, -1, 0}, - {1288, 1288, 0, 1}, - {1289, 1289, -1, 0}, - {1290, 1290, 0, 1}, - {1291, 1291, -1, 0}, - {1292, 1292, 0, 1}, - {1293, 1293, -1, 0}, - {1294, 1294, 0, 1}, - {1295, 1295, -1, 0}, - {1296, 1296, 0, 1}, - {1297, 1297, -1, 0}, - {1298, 1298, 0, 1}, - {1299, 1299, -1, 0}, - {1300, 1300, 0, 1}, - {1301, 1301, -1, 0}, - {1302, 1302, 0, 1}, - {1303, 1303, -1, 0}, - {1304, 1304, 0, 1}, - {1305, 1305, -1, 0}, - {1306, 1306, 0, 1}, - {1307, 1307, -1, 0}, - {1308, 1308, 0, 1}, - {1309, 1309, -1, 0}, - {1310, 1310, 0, 1}, - {1311, 1311, -1, 0}, - {1312, 1312, 0, 1}, - {1313, 1313, -1, 0}, - {1314, 1314, 0, 1}, - {1315, 1315, -1, 0}, - {1316, 1316, 0, 1}, - {1317, 1317, -1, 0}, - {1318, 1318, 0, 1}, - {1319, 1319, -1, 0}, - {1320, 1320, 0, 1}, - {1321, 1321, -1, 0}, - {1322, 1322, 0, 1}, - {1323, 1323, -1, 0}, - {1324, 1324, 0, 1}, - {1325, 1325, -1, 0}, - {1326, 1326, 0, 1}, - {1327, 1327, -1, 0}, - {1329, 1366, 0, 48}, - {1377, 1414, -48, 0}, - {4256, 4293, 0, 7264}, - {4295, 4295, 0, 7264}, - {4301, 4301, 0, 7264}, - {4304, 4346, 3008, 0}, - {4349, 4351, 3008, 0}, - {5024, 5103, 0, 38864}, - {5104, 5109, 0, 8}, - {5112, 5117, -8, 0}, - {7296, 7296, -6254, 0}, - {7297, 7297, -6253, 0}, - {7298, 7298, -6244, 0}, - {7299, 7300, -6242, 0}, - {7301, 7301, -6243, 0}, - {7302, 7302, -6236, 0}, - {7303, 7303, -6181, 0}, - {7304, 7304, 35266, 0}, - {7312, 7354, 0, -3008}, - {7357, 7359, 0, -3008}, - {7545, 7545, 35332, 0}, - {7549, 7549, 3814, 0}, - {7566, 7566, 35384, 0}, - {7680, 7680, 0, 1}, - {7681, 7681, -1, 0}, - {7682, 7682, 0, 1}, - {7683, 7683, -1, 0}, - {7684, 7684, 0, 1}, - {7685, 7685, -1, 0}, - {7686, 7686, 0, 1}, - {7687, 7687, -1, 0}, - {7688, 7688, 0, 1}, - {7689, 7689, -1, 0}, - {7690, 7690, 0, 1}, - {7691, 7691, -1, 0}, - {7692, 7692, 0, 1}, - {7693, 7693, -1, 0}, - {7694, 7694, 0, 1}, - {7695, 7695, -1, 0}, - {7696, 7696, 0, 1}, - {7697, 7697, -1, 0}, - {7698, 7698, 0, 1}, - {7699, 7699, -1, 0}, - {7700, 7700, 0, 1}, - {7701, 7701, -1, 0}, - {7702, 7702, 0, 1}, - {7703, 7703, -1, 0}, - {7704, 7704, 0, 1}, - {7705, 7705, -1, 0}, - {7706, 7706, 0, 1}, - {7707, 7707, -1, 0}, - {7708, 7708, 0, 1}, - {7709, 7709, -1, 0}, - {7710, 7710, 0, 1}, - {7711, 7711, -1, 0}, - {7712, 7712, 0, 1}, - {7713, 7713, -1, 0}, - {7714, 7714, 0, 1}, - {7715, 7715, -1, 0}, - {7716, 7716, 0, 1}, - {7717, 7717, -1, 0}, - {7718, 7718, 0, 1}, - {7719, 7719, -1, 0}, - {7720, 7720, 0, 1}, - {7721, 7721, -1, 0}, - {7722, 7722, 0, 1}, - {7723, 7723, -1, 0}, - {7724, 7724, 0, 1}, - {7725, 7725, -1, 0}, - {7726, 7726, 0, 1}, - {7727, 7727, -1, 0}, - {7728, 7728, 0, 1}, - {7729, 7729, -1, 0}, - {7730, 7730, 0, 1}, - {7731, 7731, -1, 0}, - {7732, 7732, 0, 1}, - {7733, 7733, -1, 0}, - {7734, 7734, 0, 1}, - {7735, 7735, -1, 0}, - {7736, 7736, 0, 1}, - {7737, 7737, -1, 0}, - {7738, 7738, 0, 1}, - {7739, 7739, -1, 0}, - {7740, 7740, 0, 1}, - {7741, 7741, -1, 0}, - {7742, 7742, 0, 1}, - {7743, 7743, -1, 0}, - {7744, 7744, 0, 1}, - {7745, 7745, -1, 0}, - {7746, 7746, 0, 1}, - {7747, 7747, -1, 0}, - {7748, 7748, 0, 1}, - {7749, 7749, -1, 0}, - {7750, 7750, 0, 1}, - {7751, 7751, -1, 0}, - {7752, 7752, 0, 1}, - {7753, 7753, -1, 0}, - {7754, 7754, 0, 1}, - {7755, 7755, -1, 0}, - {7756, 7756, 0, 1}, - {7757, 7757, -1, 0}, - {7758, 7758, 0, 1}, - {7759, 7759, -1, 0}, - {7760, 7760, 0, 1}, - {7761, 7761, -1, 0}, - {7762, 7762, 0, 1}, - {7763, 7763, -1, 0}, - {7764, 7764, 0, 1}, - {7765, 7765, -1, 0}, - {7766, 7766, 0, 1}, - {7767, 7767, -1, 0}, - {7768, 7768, 0, 1}, - {7769, 7769, -1, 0}, - {7770, 7770, 0, 1}, - {7771, 7771, -1, 0}, - {7772, 7772, 0, 1}, - {7773, 7773, -1, 0}, - {7774, 7774, 0, 1}, - {7775, 7775, -1, 0}, - {7776, 7776, 0, 1}, - {7777, 7777, -1, 0}, - {7778, 7778, 0, 1}, - {7779, 7779, -1, 0}, - {7780, 7780, 0, 1}, - {7781, 7781, -1, 0}, - {7782, 7782, 0, 1}, - {7783, 7783, -1, 0}, - {7784, 7784, 0, 1}, - {7785, 7785, -1, 0}, - {7786, 7786, 0, 1}, - {7787, 7787, -1, 0}, - {7788, 7788, 0, 1}, - {7789, 7789, -1, 0}, - {7790, 7790, 0, 1}, - {7791, 7791, -1, 0}, - {7792, 7792, 0, 1}, - {7793, 7793, -1, 0}, - {7794, 7794, 0, 1}, - {7795, 7795, -1, 0}, - {7796, 7796, 0, 1}, - {7797, 7797, -1, 0}, - {7798, 7798, 0, 1}, - {7799, 7799, -1, 0}, - {7800, 7800, 0, 1}, - {7801, 7801, -1, 0}, - {7802, 7802, 0, 1}, - {7803, 7803, -1, 0}, - {7804, 7804, 0, 1}, - {7805, 7805, -1, 0}, - {7806, 7806, 0, 1}, - {7807, 7807, -1, 0}, - {7808, 7808, 0, 1}, - {7809, 7809, -1, 0}, - {7810, 7810, 0, 1}, - {7811, 7811, -1, 0}, - {7812, 7812, 0, 1}, - {7813, 7813, -1, 0}, - {7814, 7814, 0, 1}, - {7815, 7815, -1, 0}, - {7816, 7816, 0, 1}, - {7817, 7817, -1, 0}, - {7818, 7818, 0, 1}, - {7819, 7819, -1, 0}, - {7820, 7820, 0, 1}, - {7821, 7821, -1, 0}, - {7822, 7822, 0, 1}, - {7823, 7823, -1, 0}, - {7824, 7824, 0, 1}, - {7825, 7825, -1, 0}, - {7826, 7826, 0, 1}, - {7827, 7827, -1, 0}, - {7828, 7828, 0, 1}, - {7829, 7829, -1, 0}, - {7835, 7835, -59, 0}, - {7838, 7838, 0, -7615}, - {7840, 7840, 0, 1}, - {7841, 7841, -1, 0}, - {7842, 7842, 0, 1}, - {7843, 7843, -1, 0}, - {7844, 7844, 0, 1}, - {7845, 7845, -1, 0}, - {7846, 7846, 0, 1}, - {7847, 7847, -1, 0}, - {7848, 7848, 0, 1}, - {7849, 7849, -1, 0}, - {7850, 7850, 0, 1}, - {7851, 7851, -1, 0}, - {7852, 7852, 0, 1}, - {7853, 7853, -1, 0}, - {7854, 7854, 0, 1}, - {7855, 7855, -1, 0}, - {7856, 7856, 0, 1}, - {7857, 7857, -1, 0}, - {7858, 7858, 0, 1}, - {7859, 7859, -1, 0}, - {7860, 7860, 0, 1}, - {7861, 7861, -1, 0}, - {7862, 7862, 0, 1}, - {7863, 7863, -1, 0}, - {7864, 7864, 0, 1}, - {7865, 7865, -1, 0}, - {7866, 7866, 0, 1}, - {7867, 7867, -1, 0}, - {7868, 7868, 0, 1}, - {7869, 7869, -1, 0}, - {7870, 7870, 0, 1}, - {7871, 7871, -1, 0}, - {7872, 7872, 0, 1}, - {7873, 7873, -1, 0}, - {7874, 7874, 0, 1}, - {7875, 7875, -1, 0}, - {7876, 7876, 0, 1}, - {7877, 7877, -1, 0}, - {7878, 7878, 0, 1}, - {7879, 7879, -1, 0}, - {7880, 7880, 0, 1}, - {7881, 7881, -1, 0}, - {7882, 7882, 0, 1}, - {7883, 7883, -1, 0}, - {7884, 7884, 0, 1}, - {7885, 7885, -1, 0}, - {7886, 7886, 0, 1}, - {7887, 7887, -1, 0}, - {7888, 7888, 0, 1}, - {7889, 7889, -1, 0}, - {7890, 7890, 0, 1}, - {7891, 7891, -1, 0}, - {7892, 7892, 0, 1}, - {7893, 7893, -1, 0}, - {7894, 7894, 0, 1}, - {7895, 7895, -1, 0}, - {7896, 7896, 0, 1}, - {7897, 7897, -1, 0}, - {7898, 7898, 0, 1}, - {7899, 7899, -1, 0}, - {7900, 7900, 0, 1}, - {7901, 7901, -1, 0}, - {7902, 7902, 0, 1}, - {7903, 7903, -1, 0}, - {7904, 7904, 0, 1}, - {7905, 7905, -1, 0}, - {7906, 7906, 0, 1}, - {7907, 7907, -1, 0}, - {7908, 7908, 0, 1}, - {7909, 7909, -1, 0}, - {7910, 7910, 0, 1}, - {7911, 7911, -1, 0}, - {7912, 7912, 0, 1}, - {7913, 7913, -1, 0}, - {7914, 7914, 0, 1}, - {7915, 7915, -1, 0}, - {7916, 7916, 0, 1}, - {7917, 7917, -1, 0}, - {7918, 7918, 0, 1}, - {7919, 7919, -1, 0}, - {7920, 7920, 0, 1}, - {7921, 7921, -1, 0}, - {7922, 7922, 0, 1}, - {7923, 7923, -1, 0}, - {7924, 7924, 0, 1}, - {7925, 7925, -1, 0}, - {7926, 7926, 0, 1}, - {7927, 7927, -1, 0}, - {7928, 7928, 0, 1}, - {7929, 7929, -1, 0}, - {7930, 7930, 0, 1}, - {7931, 7931, -1, 0}, - {7932, 7932, 0, 1}, - {7933, 7933, -1, 0}, - {7934, 7934, 0, 1}, - {7935, 7935, -1, 0}, - {7936, 7943, 8, 0}, - {7944, 7951, 0, -8}, - {7952, 7957, 8, 0}, - {7960, 7965, 0, -8}, - {7968, 7975, 8, 0}, - {7976, 7983, 0, -8}, - {7984, 7991, 8, 0}, - {7992, 7999, 0, -8}, - {8000, 8005, 8, 0}, - {8008, 8013, 0, -8}, - {8017, 8017, 8, 0}, - {8019, 8019, 8, 0}, - {8021, 8021, 8, 0}, - {8023, 8023, 8, 0}, - {8025, 8025, 0, -8}, - {8027, 8027, 0, -8}, - {8029, 8029, 0, -8}, - {8031, 8031, 0, -8}, - {8032, 8039, 8, 0}, - {8040, 8047, 0, -8}, - {8048, 8049, 74, 0}, - {8050, 8053, 86, 0}, - {8054, 8055, 100, 0}, - {8056, 8057, 128, 0}, - {8058, 8059, 112, 0}, - {8060, 8061, 126, 0}, - {8112, 8113, 8, 0}, - {8120, 8121, 0, -8}, - {8122, 8123, 0, -74}, - {8126, 8126, -7205, 0}, - {8136, 8139, 0, -86}, - {8144, 8145, 8, 0}, - {8152, 8153, 0, -8}, - {8154, 8155, 0, -100}, - {8160, 8161, 8, 0}, - {8165, 8165, 7, 0}, - {8168, 8169, 0, -8}, - {8170, 8171, 0, -112}, - {8172, 8172, 0, -7}, - {8184, 8185, 0, -128}, - {8186, 8187, 0, -126}, - {8486, 8486, 0, -7517}, - {8490, 8490, 0, -8383}, - {8491, 8491, 0, -8262}, - {8498, 8498, 0, 28}, - {8526, 8526, -28, 0}, - {8544, 8559, 0, 16}, - {8560, 8575, -16, 0}, - {8579, 8579, 0, 1}, - {8580, 8580, -1, 0}, - {9398, 9423, 0, 26}, - {9424, 9449, -26, 0}, - {11264, 11310, 0, 48}, - {11312, 11358, -48, 0}, - {11360, 11360, 0, 1}, - {11361, 11361, -1, 0}, - {11362, 11362, 0, -10743}, - {11363, 11363, 0, -3814}, - {11364, 11364, 0, -10727}, - {11365, 11365, -10795, 0}, - {11366, 11366, -10792, 0}, - {11367, 11367, 0, 1}, - {11368, 11368, -1, 0}, - {11369, 11369, 0, 1}, - {11370, 11370, -1, 0}, - {11371, 11371, 0, 1}, - {11372, 11372, -1, 0}, - {11373, 11373, 0, -10780}, - {11374, 11374, 0, -10749}, - {11375, 11375, 0, -10783}, - {11376, 11376, 0, -10782}, - {11378, 11378, 0, 1}, - {11379, 11379, -1, 0}, - {11381, 11381, 0, 1}, - {11382, 11382, -1, 0}, - {11390, 11391, 0, -10815}, - {11392, 11392, 0, 1}, - {11393, 11393, -1, 0}, - {11394, 11394, 0, 1}, - {11395, 11395, -1, 0}, - {11396, 11396, 0, 1}, - {11397, 11397, -1, 0}, - {11398, 11398, 0, 1}, - {11399, 11399, -1, 0}, - {11400, 11400, 0, 1}, - {11401, 11401, -1, 0}, - {11402, 11402, 0, 1}, - {11403, 11403, -1, 0}, - {11404, 11404, 0, 1}, - {11405, 11405, -1, 0}, - {11406, 11406, 0, 1}, - {11407, 11407, -1, 0}, - {11408, 11408, 0, 1}, - {11409, 11409, -1, 0}, - {11410, 11410, 0, 1}, - {11411, 11411, -1, 0}, - {11412, 11412, 0, 1}, - {11413, 11413, -1, 0}, - {11414, 11414, 0, 1}, - {11415, 11415, -1, 0}, - {11416, 11416, 0, 1}, - {11417, 11417, -1, 0}, - {11418, 11418, 0, 1}, - {11419, 11419, -1, 0}, - {11420, 11420, 0, 1}, - {11421, 11421, -1, 0}, - {11422, 11422, 0, 1}, - {11423, 11423, -1, 0}, - {11424, 11424, 0, 1}, - {11425, 11425, -1, 0}, - {11426, 11426, 0, 1}, - {11427, 11427, -1, 0}, - {11428, 11428, 0, 1}, - {11429, 11429, -1, 0}, - {11430, 11430, 0, 1}, - {11431, 11431, -1, 0}, - {11432, 11432, 0, 1}, - {11433, 11433, -1, 0}, - {11434, 11434, 0, 1}, - {11435, 11435, -1, 0}, - {11436, 11436, 0, 1}, - {11437, 11437, -1, 0}, - {11438, 11438, 0, 1}, - {11439, 11439, -1, 0}, - {11440, 11440, 0, 1}, - {11441, 11441, -1, 0}, - {11442, 11442, 0, 1}, - {11443, 11443, -1, 0}, - {11444, 11444, 0, 1}, - {11445, 11445, -1, 0}, - {11446, 11446, 0, 1}, - {11447, 11447, -1, 0}, - {11448, 11448, 0, 1}, - {11449, 11449, -1, 0}, - {11450, 11450, 0, 1}, - {11451, 11451, -1, 0}, - {11452, 11452, 0, 1}, - {11453, 11453, -1, 0}, - {11454, 11454, 0, 1}, - {11455, 11455, -1, 0}, - {11456, 11456, 0, 1}, - {11457, 11457, -1, 0}, - {11458, 11458, 0, 1}, - {11459, 11459, -1, 0}, - {11460, 11460, 0, 1}, - {11461, 11461, -1, 0}, - {11462, 11462, 0, 1}, - {11463, 11463, -1, 0}, - {11464, 11464, 0, 1}, - {11465, 11465, -1, 0}, - {11466, 11466, 0, 1}, - {11467, 11467, -1, 0}, - {11468, 11468, 0, 1}, - {11469, 11469, -1, 0}, - {11470, 11470, 0, 1}, - {11471, 11471, -1, 0}, - {11472, 11472, 0, 1}, - {11473, 11473, -1, 0}, - {11474, 11474, 0, 1}, - {11475, 11475, -1, 0}, - {11476, 11476, 0, 1}, - {11477, 11477, -1, 0}, - {11478, 11478, 0, 1}, - {11479, 11479, -1, 0}, - {11480, 11480, 0, 1}, - {11481, 11481, -1, 0}, - {11482, 11482, 0, 1}, - {11483, 11483, -1, 0}, - {11484, 11484, 0, 1}, - {11485, 11485, -1, 0}, - {11486, 11486, 0, 1}, - {11487, 11487, -1, 0}, - {11488, 11488, 0, 1}, - {11489, 11489, -1, 0}, - {11490, 11490, 0, 1}, - {11491, 11491, -1, 0}, - {11499, 11499, 0, 1}, - {11500, 11500, -1, 0}, - {11501, 11501, 0, 1}, - {11502, 11502, -1, 0}, - {11506, 11506, 0, 1}, - {11507, 11507, -1, 0}, - {11520, 11557, -7264, 0}, - {11559, 11559, -7264, 0}, - {11565, 11565, -7264, 0}, - {42560, 42560, 0, 1}, - {42561, 42561, -1, 0}, - {42562, 42562, 0, 1}, - {42563, 42563, -1, 0}, - {42564, 42564, 0, 1}, - {42565, 42565, -1, 0}, - {42566, 42566, 0, 1}, - {42567, 42567, -1, 0}, - {42568, 42568, 0, 1}, - {42569, 42569, -1, 0}, - {42570, 42570, 0, 1}, - {42571, 42571, -1, 0}, - {42572, 42572, 0, 1}, - {42573, 42573, -1, 0}, - {42574, 42574, 0, 1}, - {42575, 42575, -1, 0}, - {42576, 42576, 0, 1}, - {42577, 42577, -1, 0}, - {42578, 42578, 0, 1}, - {42579, 42579, -1, 0}, - {42580, 42580, 0, 1}, - {42581, 42581, -1, 0}, - {42582, 42582, 0, 1}, - {42583, 42583, -1, 0}, - {42584, 42584, 0, 1}, - {42585, 42585, -1, 0}, - {42586, 42586, 0, 1}, - {42587, 42587, -1, 0}, - {42588, 42588, 0, 1}, - {42589, 42589, -1, 0}, - {42590, 42590, 0, 1}, - {42591, 42591, -1, 0}, - {42592, 42592, 0, 1}, - {42593, 42593, -1, 0}, - {42594, 42594, 0, 1}, - {42595, 42595, -1, 0}, - {42596, 42596, 0, 1}, - {42597, 42597, -1, 0}, - {42598, 42598, 0, 1}, - {42599, 42599, -1, 0}, - {42600, 42600, 0, 1}, - {42601, 42601, -1, 0}, - {42602, 42602, 0, 1}, - {42603, 42603, -1, 0}, - {42604, 42604, 0, 1}, - {42605, 42605, -1, 0}, - {42624, 42624, 0, 1}, - {42625, 42625, -1, 0}, - {42626, 42626, 0, 1}, - {42627, 42627, -1, 0}, - {42628, 42628, 0, 1}, - {42629, 42629, -1, 0}, - {42630, 42630, 0, 1}, - {42631, 42631, -1, 0}, - {42632, 42632, 0, 1}, - {42633, 42633, -1, 0}, - {42634, 42634, 0, 1}, - {42635, 42635, -1, 0}, - {42636, 42636, 0, 1}, - {42637, 42637, -1, 0}, - {42638, 42638, 0, 1}, - {42639, 42639, -1, 0}, - {42640, 42640, 0, 1}, - {42641, 42641, -1, 0}, - {42642, 42642, 0, 1}, - {42643, 42643, -1, 0}, - {42644, 42644, 0, 1}, - {42645, 42645, -1, 0}, - {42646, 42646, 0, 1}, - {42647, 42647, -1, 0}, - {42648, 42648, 0, 1}, - {42649, 42649, -1, 0}, - {42650, 42650, 0, 1}, - {42651, 42651, -1, 0}, - {42786, 42786, 0, 1}, - {42787, 42787, -1, 0}, - {42788, 42788, 0, 1}, - {42789, 42789, -1, 0}, - {42790, 42790, 0, 1}, - {42791, 42791, -1, 0}, - {42792, 42792, 0, 1}, - {42793, 42793, -1, 0}, - {42794, 42794, 0, 1}, - {42795, 42795, -1, 0}, - {42796, 42796, 0, 1}, - {42797, 42797, -1, 0}, - {42798, 42798, 0, 1}, - {42799, 42799, -1, 0}, - {42802, 42802, 0, 1}, - {42803, 42803, -1, 0}, - {42804, 42804, 0, 1}, - {42805, 42805, -1, 0}, - {42806, 42806, 0, 1}, - {42807, 42807, -1, 0}, - {42808, 42808, 0, 1}, - {42809, 42809, -1, 0}, - {42810, 42810, 0, 1}, - {42811, 42811, -1, 0}, - {42812, 42812, 0, 1}, - {42813, 42813, -1, 0}, - {42814, 42814, 0, 1}, - {42815, 42815, -1, 0}, - {42816, 42816, 0, 1}, - {42817, 42817, -1, 0}, - {42818, 42818, 0, 1}, - {42819, 42819, -1, 0}, - {42820, 42820, 0, 1}, - {42821, 42821, -1, 0}, - {42822, 42822, 0, 1}, - {42823, 42823, -1, 0}, - {42824, 42824, 0, 1}, - {42825, 42825, -1, 0}, - {42826, 42826, 0, 1}, - {42827, 42827, -1, 0}, - {42828, 42828, 0, 1}, - {42829, 42829, -1, 0}, - {42830, 42830, 0, 1}, - {42831, 42831, -1, 0}, - {42832, 42832, 0, 1}, - {42833, 42833, -1, 0}, - {42834, 42834, 0, 1}, - {42835, 42835, -1, 0}, - {42836, 42836, 0, 1}, - {42837, 42837, -1, 0}, - {42838, 42838, 0, 1}, - {42839, 42839, -1, 0}, - {42840, 42840, 0, 1}, - {42841, 42841, -1, 0}, - {42842, 42842, 0, 1}, - {42843, 42843, -1, 0}, - {42844, 42844, 0, 1}, - {42845, 42845, -1, 0}, - {42846, 42846, 0, 1}, - {42847, 42847, -1, 0}, - {42848, 42848, 0, 1}, - {42849, 42849, -1, 0}, - {42850, 42850, 0, 1}, - {42851, 42851, -1, 0}, - {42852, 42852, 0, 1}, - {42853, 42853, -1, 0}, - {42854, 42854, 0, 1}, - {42855, 42855, -1, 0}, - {42856, 42856, 0, 1}, - {42857, 42857, -1, 0}, - {42858, 42858, 0, 1}, - {42859, 42859, -1, 0}, - {42860, 42860, 0, 1}, - {42861, 42861, -1, 0}, - {42862, 42862, 0, 1}, - {42863, 42863, -1, 0}, - {42873, 42873, 0, 1}, - {42874, 42874, -1, 0}, - {42875, 42875, 0, 1}, - {42876, 42876, -1, 0}, - {42877, 42877, 0, -35332}, - {42878, 42878, 0, 1}, - {42879, 42879, -1, 0}, - {42880, 42880, 0, 1}, - {42881, 42881, -1, 0}, - {42882, 42882, 0, 1}, - {42883, 42883, -1, 0}, - {42884, 42884, 0, 1}, - {42885, 42885, -1, 0}, - {42886, 42886, 0, 1}, - {42887, 42887, -1, 0}, - {42891, 42891, 0, 1}, - {42892, 42892, -1, 0}, - {42893, 42893, 0, -42280}, - {42896, 42896, 0, 1}, - {42897, 42897, -1, 0}, - {42898, 42898, 0, 1}, - {42899, 42899, -1, 0}, - {42900, 42900, 48, 0}, - {42902, 42902, 0, 1}, - {42903, 42903, -1, 0}, - {42904, 42904, 0, 1}, - {42905, 42905, -1, 0}, - {42906, 42906, 0, 1}, - {42907, 42907, -1, 0}, - {42908, 42908, 0, 1}, - {42909, 42909, -1, 0}, - {42910, 42910, 0, 1}, - {42911, 42911, -1, 0}, - {42912, 42912, 0, 1}, - {42913, 42913, -1, 0}, - {42914, 42914, 0, 1}, - {42915, 42915, -1, 0}, - {42916, 42916, 0, 1}, - {42917, 42917, -1, 0}, - {42918, 42918, 0, 1}, - {42919, 42919, -1, 0}, - {42920, 42920, 0, 1}, - {42921, 42921, -1, 0}, - {42922, 42922, 0, -42308}, - {42923, 42923, 0, -42319}, - {42924, 42924, 0, -42315}, - {42925, 42925, 0, -42305}, - {42926, 42926, 0, -42308}, - {42928, 42928, 0, -42258}, - {42929, 42929, 0, -42282}, - {42930, 42930, 0, -42261}, - {42931, 42931, 0, 928}, - {42932, 42932, 0, 1}, - {42933, 42933, -1, 0}, - {42934, 42934, 0, 1}, - {42935, 42935, -1, 0}, - {42936, 42936, 0, 1}, - {42937, 42937, -1, 0}, - {42938, 42938, 0, 1}, - {42939, 42939, -1, 0}, - {42940, 42940, 0, 1}, - {42941, 42941, -1, 0}, - {42942, 42942, 0, 1}, - {42943, 42943, -1, 0}, - {42946, 42946, 0, 1}, - {42947, 42947, -1, 0}, - {42948, 42948, 0, -48}, - {42949, 42949, 0, -42307}, - {42950, 42950, 0, -35384}, - {42951, 42951, 0, 1}, - {42952, 42952, -1, 0}, - {42953, 42953, 0, 1}, - {42954, 42954, -1, 0}, - {42997, 42997, 0, 1}, - {42998, 42998, -1, 0}, - {43859, 43859, -928, 0}, - {43888, 43967, -38864, 0}, - {65313, 65338, 0, 32}, - {65345, 65370, -32, 0}, - {66560, 66599, 0, 40}, - {66600, 66639, -40, 0}, - {66736, 66771, 0, 40}, - {66776, 66811, -40, 0}, - {68736, 68786, 0, 64}, - {68800, 68850, -64, 0}, - {71840, 71871, 0, 32}, - {71872, 71903, -32, 0}, - {93760, 93791, 0, 32}, - {93792, 93823, -32, 0}, - {125184, 125217, 0, 34}, - {125218, 125251, -34, 0}, +{ 65, 90, 0, 32 }, { 97, 122, -32, 0 }, { 181, 181, 743, 0 }, + { 192, 214, 0, 32 }, { 216, 222, 0, 32 }, { 224, 246, -32, 0 }, + { 248, 254, -32, 0 }, { 255, 255, 121, 0 }, { 256, 256, 0, 1 }, + { 257, 257, -1, 0 }, { 258, 258, 0, 1 }, { 259, 259, -1, 0 }, + { 260, 260, 0, 1 }, { 261, 261, -1, 0 }, { 262, 262, 0, 1 }, + { 263, 263, -1, 0 }, { 264, 264, 0, 1 }, { 265, 265, -1, 0 }, + { 266, 266, 0, 1 }, { 267, 267, -1, 0 }, { 268, 268, 0, 1 }, + { 269, 269, -1, 0 }, { 270, 270, 0, 1 }, { 271, 271, -1, 0 }, + { 272, 272, 0, 1 }, { 273, 273, -1, 0 }, { 274, 274, 0, 1 }, + { 275, 275, -1, 0 }, { 276, 276, 0, 1 }, { 277, 277, -1, 0 }, + { 278, 278, 0, 1 }, { 279, 279, -1, 0 }, { 280, 280, 0, 1 }, + { 281, 281, -1, 0 }, { 282, 282, 0, 1 }, { 283, 283, -1, 0 }, + { 284, 284, 0, 1 }, { 285, 285, -1, 0 }, { 286, 286, 0, 1 }, + { 287, 287, -1, 0 }, { 288, 288, 0, 1 }, { 289, 289, -1, 0 }, + { 290, 290, 0, 1 }, { 291, 291, -1, 0 }, { 292, 292, 0, 1 }, + { 293, 293, -1, 0 }, { 294, 294, 0, 1 }, { 295, 295, -1, 0 }, + { 296, 296, 0, 1 }, { 297, 297, -1, 0 }, { 298, 298, 0, 1 }, + { 299, 299, -1, 0 }, { 300, 300, 0, 1 }, { 301, 301, -1, 0 }, + { 302, 302, 0, 1 }, { 303, 303, -1, 0 }, { 305, 305, -232, 0 }, + { 306, 306, 0, 1 }, { 307, 307, -1, 0 }, { 308, 308, 0, 1 }, + { 309, 309, -1, 0 }, { 310, 310, 0, 1 }, { 311, 311, -1, 0 }, + { 313, 313, 0, 1 }, { 314, 314, -1, 0 }, { 315, 315, 0, 1 }, + { 316, 316, -1, 0 }, { 317, 317, 0, 1 }, { 318, 318, -1, 0 }, + { 319, 319, 0, 1 }, { 320, 320, -1, 0 }, { 321, 321, 0, 1 }, + { 322, 322, -1, 0 }, { 323, 323, 0, 1 }, { 324, 324, -1, 0 }, + { 325, 325, 0, 1 }, { 326, 326, -1, 0 }, { 327, 327, 0, 1 }, + { 328, 328, -1, 0 }, { 330, 330, 0, 1 }, { 331, 331, -1, 0 }, + { 332, 332, 0, 1 }, { 333, 333, -1, 0 }, { 334, 334, 0, 1 }, + { 335, 335, -1, 0 }, { 336, 336, 0, 1 }, { 337, 337, -1, 0 }, + { 338, 338, 0, 1 }, { 339, 339, -1, 0 }, { 340, 340, 0, 1 }, + { 341, 341, -1, 0 }, { 342, 342, 0, 1 }, { 343, 343, -1, 0 }, + { 344, 344, 0, 1 }, { 345, 345, -1, 0 }, { 346, 346, 0, 1 }, + { 347, 347, -1, 0 }, { 348, 348, 0, 1 }, { 349, 349, -1, 0 }, + { 350, 350, 0, 1 }, { 351, 351, -1, 0 }, { 352, 352, 0, 1 }, + { 353, 353, -1, 0 }, { 354, 354, 0, 1 }, { 355, 355, -1, 0 }, + { 356, 356, 0, 1 }, { 357, 357, -1, 0 }, { 358, 358, 0, 1 }, + { 359, 359, -1, 0 }, { 360, 360, 0, 1 }, { 361, 361, -1, 0 }, + { 362, 362, 0, 1 }, { 363, 363, -1, 0 }, { 364, 364, 0, 1 }, + { 365, 365, -1, 0 }, { 366, 366, 0, 1 }, { 367, 367, -1, 0 }, + { 368, 368, 0, 1 }, { 369, 369, -1, 0 }, { 370, 370, 0, 1 }, + { 371, 371, -1, 0 }, { 372, 372, 0, 1 }, { 373, 373, -1, 0 }, + { 374, 374, 0, 1 }, { 375, 375, -1, 0 }, { 376, 376, 0, -121 }, + { 377, 377, 0, 1 }, { 378, 378, -1, 0 }, { 379, 379, 0, 1 }, + { 380, 380, -1, 0 }, { 381, 381, 0, 1 }, { 382, 382, -1, 0 }, + { 383, 383, -300, 0 }, { 384, 384, 195, 0 }, { 385, 385, 0, 210 }, + { 386, 386, 0, 1 }, { 387, 387, -1, 0 }, { 388, 388, 0, 1 }, + { 389, 389, -1, 0 }, { 390, 390, 0, 206 }, { 391, 391, 0, 1 }, + { 392, 392, -1, 0 }, { 393, 394, 0, 205 }, { 395, 395, 0, 1 }, + { 396, 396, -1, 0 }, { 398, 398, 0, 79 }, { 399, 399, 0, 202 }, + { 400, 400, 0, 203 }, { 401, 401, 0, 1 }, { 402, 402, -1, 0 }, + { 403, 403, 0, 205 }, { 404, 404, 0, 207 }, { 405, 405, 97, 0 }, + { 406, 406, 0, 211 }, { 407, 407, 0, 209 }, { 408, 408, 0, 1 }, + { 409, 409, -1, 0 }, { 410, 410, 163, 0 }, { 412, 412, 0, 211 }, + { 413, 413, 0, 213 }, { 414, 414, 130, 0 }, { 415, 415, 0, 214 }, + { 416, 416, 0, 1 }, { 417, 417, -1, 0 }, { 418, 418, 0, 1 }, + { 419, 419, -1, 0 }, { 420, 420, 0, 1 }, { 421, 421, -1, 0 }, + { 422, 422, 0, 218 }, { 423, 423, 0, 1 }, { 424, 424, -1, 0 }, + { 425, 425, 0, 218 }, { 428, 428, 0, 1 }, { 429, 429, -1, 0 }, + { 430, 430, 0, 218 }, { 431, 431, 0, 1 }, { 432, 432, -1, 0 }, + { 433, 434, 0, 217 }, { 435, 435, 0, 1 }, { 436, 436, -1, 0 }, + { 437, 437, 0, 1 }, { 438, 438, -1, 0 }, { 439, 439, 0, 219 }, + { 440, 440, 0, 1 }, { 441, 441, -1, 0 }, { 444, 444, 0, 1 }, + { 445, 445, -1, 0 }, { 447, 447, 56, 0 }, { 452, 452, 0, 2 }, + { 453, 453, -1, 1 }, { 454, 454, -2, 0 }, { 455, 455, 0, 2 }, + { 456, 456, -1, 1 }, { 457, 457, -2, 0 }, { 458, 458, 0, 2 }, + { 459, 459, -1, 1 }, { 460, 460, -2, 0 }, { 461, 461, 0, 1 }, + { 462, 462, -1, 0 }, { 463, 463, 0, 1 }, { 464, 464, -1, 0 }, + { 465, 465, 0, 1 }, { 466, 466, -1, 0 }, { 467, 467, 0, 1 }, + { 468, 468, -1, 0 }, { 469, 469, 0, 1 }, { 470, 470, -1, 0 }, + { 471, 471, 0, 1 }, { 472, 472, -1, 0 }, { 473, 473, 0, 1 }, + { 474, 474, -1, 0 }, { 475, 475, 0, 1 }, { 476, 476, -1, 0 }, + { 477, 477, -79, 0 }, { 478, 478, 0, 1 }, { 479, 479, -1, 0 }, + { 480, 480, 0, 1 }, { 481, 481, -1, 0 }, { 482, 482, 0, 1 }, + { 483, 483, -1, 0 }, { 484, 484, 0, 1 }, { 485, 485, -1, 0 }, + { 486, 486, 0, 1 }, { 487, 487, -1, 0 }, { 488, 488, 0, 1 }, + { 489, 489, -1, 0 }, { 490, 490, 0, 1 }, { 491, 491, -1, 0 }, + { 492, 492, 0, 1 }, { 493, 493, -1, 0 }, { 494, 494, 0, 1 }, + { 495, 495, -1, 0 }, { 497, 497, 0, 2 }, { 498, 498, -1, 1 }, + { 499, 499, -2, 0 }, { 500, 500, 0, 1 }, { 501, 501, -1, 0 }, + { 502, 502, 0, -97 }, { 503, 503, 0, -56 }, { 504, 504, 0, 1 }, + { 505, 505, -1, 0 }, { 506, 506, 0, 1 }, { 507, 507, -1, 0 }, + { 508, 508, 0, 1 }, { 509, 509, -1, 0 }, { 510, 510, 0, 1 }, + { 511, 511, -1, 0 }, { 512, 512, 0, 1 }, { 513, 513, -1, 0 }, + { 514, 514, 0, 1 }, { 515, 515, -1, 0 }, { 516, 516, 0, 1 }, + { 517, 517, -1, 0 }, { 518, 518, 0, 1 }, { 519, 519, -1, 0 }, + { 520, 520, 0, 1 }, { 521, 521, -1, 0 }, { 522, 522, 0, 1 }, + { 523, 523, -1, 0 }, { 524, 524, 0, 1 }, { 525, 525, -1, 0 }, + { 526, 526, 0, 1 }, { 527, 527, -1, 0 }, { 528, 528, 0, 1 }, + { 529, 529, -1, 0 }, { 530, 530, 0, 1 }, { 531, 531, -1, 0 }, + { 532, 532, 0, 1 }, { 533, 533, -1, 0 }, { 534, 534, 0, 1 }, + { 535, 535, -1, 0 }, { 536, 536, 0, 1 }, { 537, 537, -1, 0 }, + { 538, 538, 0, 1 }, { 539, 539, -1, 0 }, { 540, 540, 0, 1 }, + { 541, 541, -1, 0 }, { 542, 542, 0, 1 }, { 543, 543, -1, 0 }, + { 544, 544, 0, -130 }, { 546, 546, 0, 1 }, { 547, 547, -1, 0 }, + { 548, 548, 0, 1 }, { 549, 549, -1, 0 }, { 550, 550, 0, 1 }, + { 551, 551, -1, 0 }, { 552, 552, 0, 1 }, { 553, 553, -1, 0 }, + { 554, 554, 0, 1 }, { 555, 555, -1, 0 }, { 556, 556, 0, 1 }, + { 557, 557, -1, 0 }, { 558, 558, 0, 1 }, { 559, 559, -1, 0 }, + { 560, 560, 0, 1 }, { 561, 561, -1, 0 }, { 562, 562, 0, 1 }, + { 563, 563, -1, 0 }, { 570, 570, 0, 10795 }, { 571, 571, 0, 1 }, + { 572, 572, -1, 0 }, { 573, 573, 0, -163 }, { 574, 574, 0, 10792 }, + { 575, 576, 10815, 0 }, { 577, 577, 0, 1 }, { 578, 578, -1, 0 }, + { 579, 579, 0, -195 }, { 580, 580, 0, 69 }, { 581, 581, 0, 71 }, + { 582, 582, 0, 1 }, { 583, 583, -1, 0 }, { 584, 584, 0, 1 }, + { 585, 585, -1, 0 }, { 586, 586, 0, 1 }, { 587, 587, -1, 0 }, + { 588, 588, 0, 1 }, { 589, 589, -1, 0 }, { 590, 590, 0, 1 }, + { 591, 591, -1, 0 }, { 592, 592, 10783, 0 }, { 593, 593, 10780, 0 }, + { 594, 594, 10782, 0 }, { 595, 595, -210, 0 }, { 596, 596, -206, 0 }, + { 598, 599, -205, 0 }, { 601, 601, -202, 0 }, { 603, 603, -203, 0 }, + { 604, 604, 42319, 0 }, { 608, 608, -205, 0 }, { 609, 609, 42315, 0 }, + { 611, 611, -207, 0 }, { 613, 613, 42280, 0 }, { 614, 614, 42308, 0 }, + { 616, 616, -209, 0 }, { 617, 617, -211, 0 }, { 618, 618, 42308, 0 }, + { 619, 619, 10743, 0 }, { 620, 620, 42305, 0 }, { 623, 623, -211, 0 }, + { 625, 625, 10749, 0 }, { 626, 626, -213, 0 }, { 629, 629, -214, 0 }, + { 637, 637, 10727, 0 }, { 640, 640, -218, 0 }, { 642, 642, 42307, 0 }, + { 643, 643, -218, 0 }, { 647, 647, 42282, 0 }, { 648, 648, -218, 0 }, + { 649, 649, -69, 0 }, { 650, 651, -217, 0 }, { 652, 652, -71, 0 }, + { 658, 658, -219, 0 }, { 669, 669, 42261, 0 }, { 670, 670, 42258, 0 }, + { 837, 837, 84, 0 }, { 880, 880, 0, 1 }, { 881, 881, -1, 0 }, + { 882, 882, 0, 1 }, { 883, 883, -1, 0 }, { 886, 886, 0, 1 }, + { 887, 887, -1, 0 }, { 891, 893, 130, 0 }, { 895, 895, 0, 116 }, + { 902, 902, 0, 38 }, { 904, 906, 0, 37 }, { 908, 908, 0, 64 }, + { 910, 911, 0, 63 }, { 913, 929, 0, 32 }, { 931, 939, 0, 32 }, + { 940, 940, -38, 0 }, { 941, 943, -37, 0 }, { 945, 961, -32, 0 }, + { 962, 962, -31, 0 }, { 963, 971, -32, 0 }, { 972, 972, -64, 0 }, + { 973, 974, -63, 0 }, { 975, 975, 0, 8 }, { 976, 976, -62, 0 }, + { 977, 977, -57, 0 }, { 981, 981, -47, 0 }, { 982, 982, -54, 0 }, + { 983, 983, -8, 0 }, { 984, 984, 0, 1 }, { 985, 985, -1, 0 }, + { 986, 986, 0, 1 }, { 987, 987, -1, 0 }, { 988, 988, 0, 1 }, + { 989, 989, -1, 0 }, { 990, 990, 0, 1 }, { 991, 991, -1, 0 }, + { 992, 992, 0, 1 }, { 993, 993, -1, 0 }, { 994, 994, 0, 1 }, + { 995, 995, -1, 0 }, { 996, 996, 0, 1 }, { 997, 997, -1, 0 }, + { 998, 998, 0, 1 }, { 999, 999, -1, 0 }, { 1000, 1000, 0, 1 }, + { 1001, 1001, -1, 0 }, { 1002, 1002, 0, 1 }, { 1003, 1003, -1, 0 }, + { 1004, 1004, 0, 1 }, { 1005, 1005, -1, 0 }, { 1006, 1006, 0, 1 }, + { 1007, 1007, -1, 0 }, { 1008, 1008, -86, 0 }, { 1009, 1009, -80, 0 }, + { 1010, 1010, 7, 0 }, { 1011, 1011, -116, 0 }, { 1012, 1012, 0, -60 }, + { 1013, 1013, -96, 0 }, { 1015, 1015, 0, 1 }, { 1016, 1016, -1, 0 }, + { 1017, 1017, 0, -7 }, { 1018, 1018, 0, 1 }, { 1019, 1019, -1, 0 }, + { 1021, 1023, 0, -130 }, { 1024, 1039, 0, 80 }, { 1040, 1071, 0, 32 }, + { 1072, 1103, -32, 0 }, { 1104, 1119, -80, 0 }, { 1120, 1120, 0, 1 }, + { 1121, 1121, -1, 0 }, { 1122, 1122, 0, 1 }, { 1123, 1123, -1, 0 }, + { 1124, 1124, 0, 1 }, { 1125, 1125, -1, 0 }, { 1126, 1126, 0, 1 }, + { 1127, 1127, -1, 0 }, { 1128, 1128, 0, 1 }, { 1129, 1129, -1, 0 }, + { 1130, 1130, 0, 1 }, { 1131, 1131, -1, 0 }, { 1132, 1132, 0, 1 }, + { 1133, 1133, -1, 0 }, { 1134, 1134, 0, 1 }, { 1135, 1135, -1, 0 }, + { 1136, 1136, 0, 1 }, { 1137, 1137, -1, 0 }, { 1138, 1138, 0, 1 }, + { 1139, 1139, -1, 0 }, { 1140, 1140, 0, 1 }, { 1141, 1141, -1, 0 }, + { 1142, 1142, 0, 1 }, { 1143, 1143, -1, 0 }, { 1144, 1144, 0, 1 }, + { 1145, 1145, -1, 0 }, { 1146, 1146, 0, 1 }, { 1147, 1147, -1, 0 }, + { 1148, 1148, 0, 1 }, { 1149, 1149, -1, 0 }, { 1150, 1150, 0, 1 }, + { 1151, 1151, -1, 0 }, { 1152, 1152, 0, 1 }, { 1153, 1153, -1, 0 }, + { 1162, 1162, 0, 1 }, { 1163, 1163, -1, 0 }, { 1164, 1164, 0, 1 }, + { 1165, 1165, -1, 0 }, { 1166, 1166, 0, 1 }, { 1167, 1167, -1, 0 }, + { 1168, 1168, 0, 1 }, { 1169, 1169, -1, 0 }, { 1170, 1170, 0, 1 }, + { 1171, 1171, -1, 0 }, { 1172, 1172, 0, 1 }, { 1173, 1173, -1, 0 }, + { 1174, 1174, 0, 1 }, { 1175, 1175, -1, 0 }, { 1176, 1176, 0, 1 }, + { 1177, 1177, -1, 0 }, { 1178, 1178, 0, 1 }, { 1179, 1179, -1, 0 }, + { 1180, 1180, 0, 1 }, { 1181, 1181, -1, 0 }, { 1182, 1182, 0, 1 }, + { 1183, 1183, -1, 0 }, { 1184, 1184, 0, 1 }, { 1185, 1185, -1, 0 }, + { 1186, 1186, 0, 1 }, { 1187, 1187, -1, 0 }, { 1188, 1188, 0, 1 }, + { 1189, 1189, -1, 0 }, { 1190, 1190, 0, 1 }, { 1191, 1191, -1, 0 }, + { 1192, 1192, 0, 1 }, { 1193, 1193, -1, 0 }, { 1194, 1194, 0, 1 }, + { 1195, 1195, -1, 0 }, { 1196, 1196, 0, 1 }, { 1197, 1197, -1, 0 }, + { 1198, 1198, 0, 1 }, { 1199, 1199, -1, 0 }, { 1200, 1200, 0, 1 }, + { 1201, 1201, -1, 0 }, { 1202, 1202, 0, 1 }, { 1203, 1203, -1, 0 }, + { 1204, 1204, 0, 1 }, { 1205, 1205, -1, 0 }, { 1206, 1206, 0, 1 }, + { 1207, 1207, -1, 0 }, { 1208, 1208, 0, 1 }, { 1209, 1209, -1, 0 }, + { 1210, 1210, 0, 1 }, { 1211, 1211, -1, 0 }, { 1212, 1212, 0, 1 }, + { 1213, 1213, -1, 0 }, { 1214, 1214, 0, 1 }, { 1215, 1215, -1, 0 }, + { 1216, 1216, 0, 15 }, { 1217, 1217, 0, 1 }, { 1218, 1218, -1, 0 }, + { 1219, 1219, 0, 1 }, { 1220, 1220, -1, 0 }, { 1221, 1221, 0, 1 }, + { 1222, 1222, -1, 0 }, { 1223, 1223, 0, 1 }, { 1224, 1224, -1, 0 }, + { 1225, 1225, 0, 1 }, { 1226, 1226, -1, 0 }, { 1227, 1227, 0, 1 }, + { 1228, 1228, -1, 0 }, { 1229, 1229, 0, 1 }, { 1230, 1230, -1, 0 }, + { 1231, 1231, -15, 0 }, { 1232, 1232, 0, 1 }, { 1233, 1233, -1, 0 }, + { 1234, 1234, 0, 1 }, { 1235, 1235, -1, 0 }, { 1236, 1236, 0, 1 }, + { 1237, 1237, -1, 0 }, { 1238, 1238, 0, 1 }, { 1239, 1239, -1, 0 }, + { 1240, 1240, 0, 1 }, { 1241, 1241, -1, 0 }, { 1242, 1242, 0, 1 }, + { 1243, 1243, -1, 0 }, { 1244, 1244, 0, 1 }, { 1245, 1245, -1, 0 }, + { 1246, 1246, 0, 1 }, { 1247, 1247, -1, 0 }, { 1248, 1248, 0, 1 }, + { 1249, 1249, -1, 0 }, { 1250, 1250, 0, 1 }, { 1251, 1251, -1, 0 }, + { 1252, 1252, 0, 1 }, { 1253, 1253, -1, 0 }, { 1254, 1254, 0, 1 }, + { 1255, 1255, -1, 0 }, { 1256, 1256, 0, 1 }, { 1257, 1257, -1, 0 }, + { 1258, 1258, 0, 1 }, { 1259, 1259, -1, 0 }, { 1260, 1260, 0, 1 }, + { 1261, 1261, -1, 0 }, { 1262, 1262, 0, 1 }, { 1263, 1263, -1, 0 }, + { 1264, 1264, 0, 1 }, { 1265, 1265, -1, 0 }, { 1266, 1266, 0, 1 }, + { 1267, 1267, -1, 0 }, { 1268, 1268, 0, 1 }, { 1269, 1269, -1, 0 }, + { 1270, 1270, 0, 1 }, { 1271, 1271, -1, 0 }, { 1272, 1272, 0, 1 }, + { 1273, 1273, -1, 0 }, { 1274, 1274, 0, 1 }, { 1275, 1275, -1, 0 }, + { 1276, 1276, 0, 1 }, { 1277, 1277, -1, 0 }, { 1278, 1278, 0, 1 }, + { 1279, 1279, -1, 0 }, { 1280, 1280, 0, 1 }, { 1281, 1281, -1, 0 }, + { 1282, 1282, 0, 1 }, { 1283, 1283, -1, 0 }, { 1284, 1284, 0, 1 }, + { 1285, 1285, -1, 0 }, { 1286, 1286, 0, 1 }, { 1287, 1287, -1, 0 }, + { 1288, 1288, 0, 1 }, { 1289, 1289, -1, 0 }, { 1290, 1290, 0, 1 }, + { 1291, 1291, -1, 0 }, { 1292, 1292, 0, 1 }, { 1293, 1293, -1, 0 }, + { 1294, 1294, 0, 1 }, { 1295, 1295, -1, 0 }, { 1296, 1296, 0, 1 }, + { 1297, 1297, -1, 0 }, { 1298, 1298, 0, 1 }, { 1299, 1299, -1, 0 }, + { 1300, 1300, 0, 1 }, { 1301, 1301, -1, 0 }, { 1302, 1302, 0, 1 }, + { 1303, 1303, -1, 0 }, { 1304, 1304, 0, 1 }, { 1305, 1305, -1, 0 }, + { 1306, 1306, 0, 1 }, { 1307, 1307, -1, 0 }, { 1308, 1308, 0, 1 }, + { 1309, 1309, -1, 0 }, { 1310, 1310, 0, 1 }, { 1311, 1311, -1, 0 }, + { 1312, 1312, 0, 1 }, { 1313, 1313, -1, 0 }, { 1314, 1314, 0, 1 }, + { 1315, 1315, -1, 0 }, { 1316, 1316, 0, 1 }, { 1317, 1317, -1, 0 }, + { 1318, 1318, 0, 1 }, { 1319, 1319, -1, 0 }, { 1320, 1320, 0, 1 }, + { 1321, 1321, -1, 0 }, { 1322, 1322, 0, 1 }, { 1323, 1323, -1, 0 }, + { 1324, 1324, 0, 1 }, { 1325, 1325, -1, 0 }, { 1326, 1326, 0, 1 }, + { 1327, 1327, -1, 0 }, { 1329, 1366, 0, 48 }, { 1377, 1414, -48, 0 }, + { 4256, 4293, 0, 7264 }, { 4295, 4295, 0, 7264 }, { 4301, 4301, 0, 7264 }, + { 4304, 4346, 3008, 0 }, { 4349, 4351, 3008, 0 }, { 5024, 5103, 0, 38864 }, + { 5104, 5109, 0, 8 }, { 5112, 5117, -8, 0 }, { 7296, 7296, -6254, 0 }, + { 7297, 7297, -6253, 0 }, { 7298, 7298, -6244, 0 }, { 7299, 7300, -6242, 0 }, + { 7301, 7301, -6243, 0 }, { 7302, 7302, -6236, 0 }, { 7303, 7303, -6181, 0 }, + { 7304, 7304, 35266, 0 }, { 7312, 7354, 0, -3008 }, { 7357, 7359, 0, -3008 }, + { 7545, 7545, 35332, 0 }, { 7549, 7549, 3814, 0 }, { 7566, 7566, 35384, 0 }, + { 7680, 7680, 0, 1 }, { 7681, 7681, -1, 0 }, { 7682, 7682, 0, 1 }, + { 7683, 7683, -1, 0 }, { 7684, 7684, 0, 1 }, { 7685, 7685, -1, 0 }, + { 7686, 7686, 0, 1 }, { 7687, 7687, -1, 0 }, { 7688, 7688, 0, 1 }, + { 7689, 7689, -1, 0 }, { 7690, 7690, 0, 1 }, { 7691, 7691, -1, 0 }, + { 7692, 7692, 0, 1 }, { 7693, 7693, -1, 0 }, { 7694, 7694, 0, 1 }, + { 7695, 7695, -1, 0 }, { 7696, 7696, 0, 1 }, { 7697, 7697, -1, 0 }, + { 7698, 7698, 0, 1 }, { 7699, 7699, -1, 0 }, { 7700, 7700, 0, 1 }, + { 7701, 7701, -1, 0 }, { 7702, 7702, 0, 1 }, { 7703, 7703, -1, 0 }, + { 7704, 7704, 0, 1 }, { 7705, 7705, -1, 0 }, { 7706, 7706, 0, 1 }, + { 7707, 7707, -1, 0 }, { 7708, 7708, 0, 1 }, { 7709, 7709, -1, 0 }, + { 7710, 7710, 0, 1 }, { 7711, 7711, -1, 0 }, { 7712, 7712, 0, 1 }, + { 7713, 7713, -1, 0 }, { 7714, 7714, 0, 1 }, { 7715, 7715, -1, 0 }, + { 7716, 7716, 0, 1 }, { 7717, 7717, -1, 0 }, { 7718, 7718, 0, 1 }, + { 7719, 7719, -1, 0 }, { 7720, 7720, 0, 1 }, { 7721, 7721, -1, 0 }, + { 7722, 7722, 0, 1 }, { 7723, 7723, -1, 0 }, { 7724, 7724, 0, 1 }, + { 7725, 7725, -1, 0 }, { 7726, 7726, 0, 1 }, { 7727, 7727, -1, 0 }, + { 7728, 7728, 0, 1 }, { 7729, 7729, -1, 0 }, { 7730, 7730, 0, 1 }, + { 7731, 7731, -1, 0 }, { 7732, 7732, 0, 1 }, { 7733, 7733, -1, 0 }, + { 7734, 7734, 0, 1 }, { 7735, 7735, -1, 0 }, { 7736, 7736, 0, 1 }, + { 7737, 7737, -1, 0 }, { 7738, 7738, 0, 1 }, { 7739, 7739, -1, 0 }, + { 7740, 7740, 0, 1 }, { 7741, 7741, -1, 0 }, { 7742, 7742, 0, 1 }, + { 7743, 7743, -1, 0 }, { 7744, 7744, 0, 1 }, { 7745, 7745, -1, 0 }, + { 7746, 7746, 0, 1 }, { 7747, 7747, -1, 0 }, { 7748, 7748, 0, 1 }, + { 7749, 7749, -1, 0 }, { 7750, 7750, 0, 1 }, { 7751, 7751, -1, 0 }, + { 7752, 7752, 0, 1 }, { 7753, 7753, -1, 0 }, { 7754, 7754, 0, 1 }, + { 7755, 7755, -1, 0 }, { 7756, 7756, 0, 1 }, { 7757, 7757, -1, 0 }, + { 7758, 7758, 0, 1 }, { 7759, 7759, -1, 0 }, { 7760, 7760, 0, 1 }, + { 7761, 7761, -1, 0 }, { 7762, 7762, 0, 1 }, { 7763, 7763, -1, 0 }, + { 7764, 7764, 0, 1 }, { 7765, 7765, -1, 0 }, { 7766, 7766, 0, 1 }, + { 7767, 7767, -1, 0 }, { 7768, 7768, 0, 1 }, { 7769, 7769, -1, 0 }, + { 7770, 7770, 0, 1 }, { 7771, 7771, -1, 0 }, { 7772, 7772, 0, 1 }, + { 7773, 7773, -1, 0 }, { 7774, 7774, 0, 1 }, { 7775, 7775, -1, 0 }, + { 7776, 7776, 0, 1 }, { 7777, 7777, -1, 0 }, { 7778, 7778, 0, 1 }, + { 7779, 7779, -1, 0 }, { 7780, 7780, 0, 1 }, { 7781, 7781, -1, 0 }, + { 7782, 7782, 0, 1 }, { 7783, 7783, -1, 0 }, { 7784, 7784, 0, 1 }, + { 7785, 7785, -1, 0 }, { 7786, 7786, 0, 1 }, { 7787, 7787, -1, 0 }, + { 7788, 7788, 0, 1 }, { 7789, 7789, -1, 0 }, { 7790, 7790, 0, 1 }, + { 7791, 7791, -1, 0 }, { 7792, 7792, 0, 1 }, { 7793, 7793, -1, 0 }, + { 7794, 7794, 0, 1 }, { 7795, 7795, -1, 0 }, { 7796, 7796, 0, 1 }, + { 7797, 7797, -1, 0 }, { 7798, 7798, 0, 1 }, { 7799, 7799, -1, 0 }, + { 7800, 7800, 0, 1 }, { 7801, 7801, -1, 0 }, { 7802, 7802, 0, 1 }, + { 7803, 7803, -1, 0 }, { 7804, 7804, 0, 1 }, { 7805, 7805, -1, 0 }, + { 7806, 7806, 0, 1 }, { 7807, 7807, -1, 0 }, { 7808, 7808, 0, 1 }, + { 7809, 7809, -1, 0 }, { 7810, 7810, 0, 1 }, { 7811, 7811, -1, 0 }, + { 7812, 7812, 0, 1 }, { 7813, 7813, -1, 0 }, { 7814, 7814, 0, 1 }, + { 7815, 7815, -1, 0 }, { 7816, 7816, 0, 1 }, { 7817, 7817, -1, 0 }, + { 7818, 7818, 0, 1 }, { 7819, 7819, -1, 0 }, { 7820, 7820, 0, 1 }, + { 7821, 7821, -1, 0 }, { 7822, 7822, 0, 1 }, { 7823, 7823, -1, 0 }, + { 7824, 7824, 0, 1 }, { 7825, 7825, -1, 0 }, { 7826, 7826, 0, 1 }, + { 7827, 7827, -1, 0 }, { 7828, 7828, 0, 1 }, { 7829, 7829, -1, 0 }, + { 7835, 7835, -59, 0 }, { 7838, 7838, 0, -7615 }, { 7840, 7840, 0, 1 }, + { 7841, 7841, -1, 0 }, { 7842, 7842, 0, 1 }, { 7843, 7843, -1, 0 }, + { 7844, 7844, 0, 1 }, { 7845, 7845, -1, 0 }, { 7846, 7846, 0, 1 }, + { 7847, 7847, -1, 0 }, { 7848, 7848, 0, 1 }, { 7849, 7849, -1, 0 }, + { 7850, 7850, 0, 1 }, { 7851, 7851, -1, 0 }, { 7852, 7852, 0, 1 }, + { 7853, 7853, -1, 0 }, { 7854, 7854, 0, 1 }, { 7855, 7855, -1, 0 }, + { 7856, 7856, 0, 1 }, { 7857, 7857, -1, 0 }, { 7858, 7858, 0, 1 }, + { 7859, 7859, -1, 0 }, { 7860, 7860, 0, 1 }, { 7861, 7861, -1, 0 }, + { 7862, 7862, 0, 1 }, { 7863, 7863, -1, 0 }, { 7864, 7864, 0, 1 }, + { 7865, 7865, -1, 0 }, { 7866, 7866, 0, 1 }, { 7867, 7867, -1, 0 }, + { 7868, 7868, 0, 1 }, { 7869, 7869, -1, 0 }, { 7870, 7870, 0, 1 }, + { 7871, 7871, -1, 0 }, { 7872, 7872, 0, 1 }, { 7873, 7873, -1, 0 }, + { 7874, 7874, 0, 1 }, { 7875, 7875, -1, 0 }, { 7876, 7876, 0, 1 }, + { 7877, 7877, -1, 0 }, { 7878, 7878, 0, 1 }, { 7879, 7879, -1, 0 }, + { 7880, 7880, 0, 1 }, { 7881, 7881, -1, 0 }, { 7882, 7882, 0, 1 }, + { 7883, 7883, -1, 0 }, { 7884, 7884, 0, 1 }, { 7885, 7885, -1, 0 }, + { 7886, 7886, 0, 1 }, { 7887, 7887, -1, 0 }, { 7888, 7888, 0, 1 }, + { 7889, 7889, -1, 0 }, { 7890, 7890, 0, 1 }, { 7891, 7891, -1, 0 }, + { 7892, 7892, 0, 1 }, { 7893, 7893, -1, 0 }, { 7894, 7894, 0, 1 }, + { 7895, 7895, -1, 0 }, { 7896, 7896, 0, 1 }, { 7897, 7897, -1, 0 }, + { 7898, 7898, 0, 1 }, { 7899, 7899, -1, 0 }, { 7900, 7900, 0, 1 }, + { 7901, 7901, -1, 0 }, { 7902, 7902, 0, 1 }, { 7903, 7903, -1, 0 }, + { 7904, 7904, 0, 1 }, { 7905, 7905, -1, 0 }, { 7906, 7906, 0, 1 }, + { 7907, 7907, -1, 0 }, { 7908, 7908, 0, 1 }, { 7909, 7909, -1, 0 }, + { 7910, 7910, 0, 1 }, { 7911, 7911, -1, 0 }, { 7912, 7912, 0, 1 }, + { 7913, 7913, -1, 0 }, { 7914, 7914, 0, 1 }, { 7915, 7915, -1, 0 }, + { 7916, 7916, 0, 1 }, { 7917, 7917, -1, 0 }, { 7918, 7918, 0, 1 }, + { 7919, 7919, -1, 0 }, { 7920, 7920, 0, 1 }, { 7921, 7921, -1, 0 }, + { 7922, 7922, 0, 1 }, { 7923, 7923, -1, 0 }, { 7924, 7924, 0, 1 }, + { 7925, 7925, -1, 0 }, { 7926, 7926, 0, 1 }, { 7927, 7927, -1, 0 }, + { 7928, 7928, 0, 1 }, { 7929, 7929, -1, 0 }, { 7930, 7930, 0, 1 }, + { 7931, 7931, -1, 0 }, { 7932, 7932, 0, 1 }, { 7933, 7933, -1, 0 }, + { 7934, 7934, 0, 1 }, { 7935, 7935, -1, 0 }, { 7936, 7943, 8, 0 }, + { 7944, 7951, 0, -8 }, { 7952, 7957, 8, 0 }, { 7960, 7965, 0, -8 }, + { 7968, 7975, 8, 0 }, { 7976, 7983, 0, -8 }, { 7984, 7991, 8, 0 }, + { 7992, 7999, 0, -8 }, { 8000, 8005, 8, 0 }, { 8008, 8013, 0, -8 }, + { 8017, 8017, 8, 0 }, { 8019, 8019, 8, 0 }, { 8021, 8021, 8, 0 }, + { 8023, 8023, 8, 0 }, { 8025, 8025, 0, -8 }, { 8027, 8027, 0, -8 }, + { 8029, 8029, 0, -8 }, { 8031, 8031, 0, -8 }, { 8032, 8039, 8, 0 }, + { 8040, 8047, 0, -8 }, { 8048, 8049, 74, 0 }, { 8050, 8053, 86, 0 }, + { 8054, 8055, 100, 0 }, { 8056, 8057, 128, 0 }, { 8058, 8059, 112, 0 }, + { 8060, 8061, 126, 0 }, { 8112, 8113, 8, 0 }, { 8120, 8121, 0, -8 }, + { 8122, 8123, 0, -74 }, { 8126, 8126, -7205, 0 }, { 8136, 8139, 0, -86 }, + { 8144, 8145, 8, 0 }, { 8152, 8153, 0, -8 }, { 8154, 8155, 0, -100 }, + { 8160, 8161, 8, 0 }, { 8165, 8165, 7, 0 }, { 8168, 8169, 0, -8 }, + { 8170, 8171, 0, -112 }, { 8172, 8172, 0, -7 }, { 8184, 8185, 0, -128 }, + { 8186, 8187, 0, -126 }, { 8486, 8486, 0, -7517 }, { 8490, 8490, 0, -8383 }, + { 8491, 8491, 0, -8262 }, { 8498, 8498, 0, 28 }, { 8526, 8526, -28, 0 }, + { 8544, 8559, 0, 16 }, { 8560, 8575, -16, 0 }, { 8579, 8579, 0, 1 }, + { 8580, 8580, -1, 0 }, { 9398, 9423, 0, 26 }, { 9424, 9449, -26, 0 }, + { 11264, 11310, 0, 48 }, { 11312, 11358, -48, 0 }, { 11360, 11360, 0, 1 }, + { 11361, 11361, -1, 0 }, { 11362, 11362, 0, -10743 }, + { 11363, 11363, 0, -3814 }, { 11364, 11364, 0, -10727 }, + { 11365, 11365, -10795, 0 }, { 11366, 11366, -10792, 0 }, + { 11367, 11367, 0, 1 }, { 11368, 11368, -1, 0 }, { 11369, 11369, 0, 1 }, + { 11370, 11370, -1, 0 }, { 11371, 11371, 0, 1 }, { 11372, 11372, -1, 0 }, + { 11373, 11373, 0, -10780 }, { 11374, 11374, 0, -10749 }, + { 11375, 11375, 0, -10783 }, { 11376, 11376, 0, -10782 }, + { 11378, 11378, 0, 1 }, { 11379, 11379, -1, 0 }, { 11381, 11381, 0, 1 }, + { 11382, 11382, -1, 0 }, { 11390, 11391, 0, -10815 }, { 11392, 11392, 0, 1 }, + { 11393, 11393, -1, 0 }, { 11394, 11394, 0, 1 }, { 11395, 11395, -1, 0 }, + { 11396, 11396, 0, 1 }, { 11397, 11397, -1, 0 }, { 11398, 11398, 0, 1 }, + { 11399, 11399, -1, 0 }, { 11400, 11400, 0, 1 }, { 11401, 11401, -1, 0 }, + { 11402, 11402, 0, 1 }, { 11403, 11403, -1, 0 }, { 11404, 11404, 0, 1 }, + { 11405, 11405, -1, 0 }, { 11406, 11406, 0, 1 }, { 11407, 11407, -1, 0 }, + { 11408, 11408, 0, 1 }, { 11409, 11409, -1, 0 }, { 11410, 11410, 0, 1 }, + { 11411, 11411, -1, 0 }, { 11412, 11412, 0, 1 }, { 11413, 11413, -1, 0 }, + { 11414, 11414, 0, 1 }, { 11415, 11415, -1, 0 }, { 11416, 11416, 0, 1 }, + { 11417, 11417, -1, 0 }, { 11418, 11418, 0, 1 }, { 11419, 11419, -1, 0 }, + { 11420, 11420, 0, 1 }, { 11421, 11421, -1, 0 }, { 11422, 11422, 0, 1 }, + { 11423, 11423, -1, 0 }, { 11424, 11424, 0, 1 }, { 11425, 11425, -1, 0 }, + { 11426, 11426, 0, 1 }, { 11427, 11427, -1, 0 }, { 11428, 11428, 0, 1 }, + { 11429, 11429, -1, 0 }, { 11430, 11430, 0, 1 }, { 11431, 11431, -1, 0 }, + { 11432, 11432, 0, 1 }, { 11433, 11433, -1, 0 }, { 11434, 11434, 0, 1 }, + { 11435, 11435, -1, 0 }, { 11436, 11436, 0, 1 }, { 11437, 11437, -1, 0 }, + { 11438, 11438, 0, 1 }, { 11439, 11439, -1, 0 }, { 11440, 11440, 0, 1 }, + { 11441, 11441, -1, 0 }, { 11442, 11442, 0, 1 }, { 11443, 11443, -1, 0 }, + { 11444, 11444, 0, 1 }, { 11445, 11445, -1, 0 }, { 11446, 11446, 0, 1 }, + { 11447, 11447, -1, 0 }, { 11448, 11448, 0, 1 }, { 11449, 11449, -1, 0 }, + { 11450, 11450, 0, 1 }, { 11451, 11451, -1, 0 }, { 11452, 11452, 0, 1 }, + { 11453, 11453, -1, 0 }, { 11454, 11454, 0, 1 }, { 11455, 11455, -1, 0 }, + { 11456, 11456, 0, 1 }, { 11457, 11457, -1, 0 }, { 11458, 11458, 0, 1 }, + { 11459, 11459, -1, 0 }, { 11460, 11460, 0, 1 }, { 11461, 11461, -1, 0 }, + { 11462, 11462, 0, 1 }, { 11463, 11463, -1, 0 }, { 11464, 11464, 0, 1 }, + { 11465, 11465, -1, 0 }, { 11466, 11466, 0, 1 }, { 11467, 11467, -1, 0 }, + { 11468, 11468, 0, 1 }, { 11469, 11469, -1, 0 }, { 11470, 11470, 0, 1 }, + { 11471, 11471, -1, 0 }, { 11472, 11472, 0, 1 }, { 11473, 11473, -1, 0 }, + { 11474, 11474, 0, 1 }, { 11475, 11475, -1, 0 }, { 11476, 11476, 0, 1 }, + { 11477, 11477, -1, 0 }, { 11478, 11478, 0, 1 }, { 11479, 11479, -1, 0 }, + { 11480, 11480, 0, 1 }, { 11481, 11481, -1, 0 }, { 11482, 11482, 0, 1 }, + { 11483, 11483, -1, 0 }, { 11484, 11484, 0, 1 }, { 11485, 11485, -1, 0 }, + { 11486, 11486, 0, 1 }, { 11487, 11487, -1, 0 }, { 11488, 11488, 0, 1 }, + { 11489, 11489, -1, 0 }, { 11490, 11490, 0, 1 }, { 11491, 11491, -1, 0 }, + { 11499, 11499, 0, 1 }, { 11500, 11500, -1, 0 }, { 11501, 11501, 0, 1 }, + { 11502, 11502, -1, 0 }, { 11506, 11506, 0, 1 }, { 11507, 11507, -1, 0 }, + { 11520, 11557, -7264, 0 }, { 11559, 11559, -7264, 0 }, + { 11565, 11565, -7264, 0 }, { 42560, 42560, 0, 1 }, { 42561, 42561, -1, 0 }, + { 42562, 42562, 0, 1 }, { 42563, 42563, -1, 0 }, { 42564, 42564, 0, 1 }, + { 42565, 42565, -1, 0 }, { 42566, 42566, 0, 1 }, { 42567, 42567, -1, 0 }, + { 42568, 42568, 0, 1 }, { 42569, 42569, -1, 0 }, { 42570, 42570, 0, 1 }, + { 42571, 42571, -1, 0 }, { 42572, 42572, 0, 1 }, { 42573, 42573, -1, 0 }, + { 42574, 42574, 0, 1 }, { 42575, 42575, -1, 0 }, { 42576, 42576, 0, 1 }, + { 42577, 42577, -1, 0 }, { 42578, 42578, 0, 1 }, { 42579, 42579, -1, 0 }, + { 42580, 42580, 0, 1 }, { 42581, 42581, -1, 0 }, { 42582, 42582, 0, 1 }, + { 42583, 42583, -1, 0 }, { 42584, 42584, 0, 1 }, { 42585, 42585, -1, 0 }, + { 42586, 42586, 0, 1 }, { 42587, 42587, -1, 0 }, { 42588, 42588, 0, 1 }, + { 42589, 42589, -1, 0 }, { 42590, 42590, 0, 1 }, { 42591, 42591, -1, 0 }, + { 42592, 42592, 0, 1 }, { 42593, 42593, -1, 0 }, { 42594, 42594, 0, 1 }, + { 42595, 42595, -1, 0 }, { 42596, 42596, 0, 1 }, { 42597, 42597, -1, 0 }, + { 42598, 42598, 0, 1 }, { 42599, 42599, -1, 0 }, { 42600, 42600, 0, 1 }, + { 42601, 42601, -1, 0 }, { 42602, 42602, 0, 1 }, { 42603, 42603, -1, 0 }, + { 42604, 42604, 0, 1 }, { 42605, 42605, -1, 0 }, { 42624, 42624, 0, 1 }, + { 42625, 42625, -1, 0 }, { 42626, 42626, 0, 1 }, { 42627, 42627, -1, 0 }, + { 42628, 42628, 0, 1 }, { 42629, 42629, -1, 0 }, { 42630, 42630, 0, 1 }, + { 42631, 42631, -1, 0 }, { 42632, 42632, 0, 1 }, { 42633, 42633, -1, 0 }, + { 42634, 42634, 0, 1 }, { 42635, 42635, -1, 0 }, { 42636, 42636, 0, 1 }, + { 42637, 42637, -1, 0 }, { 42638, 42638, 0, 1 }, { 42639, 42639, -1, 0 }, + { 42640, 42640, 0, 1 }, { 42641, 42641, -1, 0 }, { 42642, 42642, 0, 1 }, + { 42643, 42643, -1, 0 }, { 42644, 42644, 0, 1 }, { 42645, 42645, -1, 0 }, + { 42646, 42646, 0, 1 }, { 42647, 42647, -1, 0 }, { 42648, 42648, 0, 1 }, + { 42649, 42649, -1, 0 }, { 42650, 42650, 0, 1 }, { 42651, 42651, -1, 0 }, + { 42786, 42786, 0, 1 }, { 42787, 42787, -1, 0 }, { 42788, 42788, 0, 1 }, + { 42789, 42789, -1, 0 }, { 42790, 42790, 0, 1 }, { 42791, 42791, -1, 0 }, + { 42792, 42792, 0, 1 }, { 42793, 42793, -1, 0 }, { 42794, 42794, 0, 1 }, + { 42795, 42795, -1, 0 }, { 42796, 42796, 0, 1 }, { 42797, 42797, -1, 0 }, + { 42798, 42798, 0, 1 }, { 42799, 42799, -1, 0 }, { 42802, 42802, 0, 1 }, + { 42803, 42803, -1, 0 }, { 42804, 42804, 0, 1 }, { 42805, 42805, -1, 0 }, + { 42806, 42806, 0, 1 }, { 42807, 42807, -1, 0 }, { 42808, 42808, 0, 1 }, + { 42809, 42809, -1, 0 }, { 42810, 42810, 0, 1 }, { 42811, 42811, -1, 0 }, + { 42812, 42812, 0, 1 }, { 42813, 42813, -1, 0 }, { 42814, 42814, 0, 1 }, + { 42815, 42815, -1, 0 }, { 42816, 42816, 0, 1 }, { 42817, 42817, -1, 0 }, + { 42818, 42818, 0, 1 }, { 42819, 42819, -1, 0 }, { 42820, 42820, 0, 1 }, + { 42821, 42821, -1, 0 }, { 42822, 42822, 0, 1 }, { 42823, 42823, -1, 0 }, + { 42824, 42824, 0, 1 }, { 42825, 42825, -1, 0 }, { 42826, 42826, 0, 1 }, + { 42827, 42827, -1, 0 }, { 42828, 42828, 0, 1 }, { 42829, 42829, -1, 0 }, + { 42830, 42830, 0, 1 }, { 42831, 42831, -1, 0 }, { 42832, 42832, 0, 1 }, + { 42833, 42833, -1, 0 }, { 42834, 42834, 0, 1 }, { 42835, 42835, -1, 0 }, + { 42836, 42836, 0, 1 }, { 42837, 42837, -1, 0 }, { 42838, 42838, 0, 1 }, + { 42839, 42839, -1, 0 }, { 42840, 42840, 0, 1 }, { 42841, 42841, -1, 0 }, + { 42842, 42842, 0, 1 }, { 42843, 42843, -1, 0 }, { 42844, 42844, 0, 1 }, + { 42845, 42845, -1, 0 }, { 42846, 42846, 0, 1 }, { 42847, 42847, -1, 0 }, + { 42848, 42848, 0, 1 }, { 42849, 42849, -1, 0 }, { 42850, 42850, 0, 1 }, + { 42851, 42851, -1, 0 }, { 42852, 42852, 0, 1 }, { 42853, 42853, -1, 0 }, + { 42854, 42854, 0, 1 }, { 42855, 42855, -1, 0 }, { 42856, 42856, 0, 1 }, + { 42857, 42857, -1, 0 }, { 42858, 42858, 0, 1 }, { 42859, 42859, -1, 0 }, + { 42860, 42860, 0, 1 }, { 42861, 42861, -1, 0 }, { 42862, 42862, 0, 1 }, + { 42863, 42863, -1, 0 }, { 42873, 42873, 0, 1 }, { 42874, 42874, -1, 0 }, + { 42875, 42875, 0, 1 }, { 42876, 42876, -1, 0 }, { 42877, 42877, 0, -35332 }, + { 42878, 42878, 0, 1 }, { 42879, 42879, -1, 0 }, { 42880, 42880, 0, 1 }, + { 42881, 42881, -1, 0 }, { 42882, 42882, 0, 1 }, { 42883, 42883, -1, 0 }, + { 42884, 42884, 0, 1 }, { 42885, 42885, -1, 0 }, { 42886, 42886, 0, 1 }, + { 42887, 42887, -1, 0 }, { 42891, 42891, 0, 1 }, { 42892, 42892, -1, 0 }, + { 42893, 42893, 0, -42280 }, { 42896, 42896, 0, 1 }, { 42897, 42897, -1, 0 }, + { 42898, 42898, 0, 1 }, { 42899, 42899, -1, 0 }, { 42900, 42900, 48, 0 }, + { 42902, 42902, 0, 1 }, { 42903, 42903, -1, 0 }, { 42904, 42904, 0, 1 }, + { 42905, 42905, -1, 0 }, { 42906, 42906, 0, 1 }, { 42907, 42907, -1, 0 }, + { 42908, 42908, 0, 1 }, { 42909, 42909, -1, 0 }, { 42910, 42910, 0, 1 }, + { 42911, 42911, -1, 0 }, { 42912, 42912, 0, 1 }, { 42913, 42913, -1, 0 }, + { 42914, 42914, 0, 1 }, { 42915, 42915, -1, 0 }, { 42916, 42916, 0, 1 }, + { 42917, 42917, -1, 0 }, { 42918, 42918, 0, 1 }, { 42919, 42919, -1, 0 }, + { 42920, 42920, 0, 1 }, { 42921, 42921, -1, 0 }, { 42922, 42922, 0, -42308 }, + { 42923, 42923, 0, -42319 }, { 42924, 42924, 0, -42315 }, + { 42925, 42925, 0, -42305 }, { 42926, 42926, 0, -42308 }, + { 42928, 42928, 0, -42258 }, { 42929, 42929, 0, -42282 }, + { 42930, 42930, 0, -42261 }, { 42931, 42931, 0, 928 }, + { 42932, 42932, 0, 1 }, { 42933, 42933, -1, 0 }, { 42934, 42934, 0, 1 }, + { 42935, 42935, -1, 0 }, { 42936, 42936, 0, 1 }, { 42937, 42937, -1, 0 }, + { 42938, 42938, 0, 1 }, { 42939, 42939, -1, 0 }, { 42940, 42940, 0, 1 }, + { 42941, 42941, -1, 0 }, { 42942, 42942, 0, 1 }, { 42943, 42943, -1, 0 }, + { 42946, 42946, 0, 1 }, { 42947, 42947, -1, 0 }, { 42948, 42948, 0, -48 }, + { 42949, 42949, 0, -42307 }, { 42950, 42950, 0, -35384 }, + { 42951, 42951, 0, 1 }, { 42952, 42952, -1, 0 }, { 42953, 42953, 0, 1 }, + { 42954, 42954, -1, 0 }, { 42997, 42997, 0, 1 }, { 42998, 42998, -1, 0 }, + { 43859, 43859, -928, 0 }, { 43888, 43967, -38864, 0 }, + { 65313, 65338, 0, 32 }, { 65345, 65370, -32, 0 }, { 66560, 66599, 0, 40 }, + { 66600, 66639, -40, 0 }, { 66736, 66771, 0, 40 }, { 66776, 66811, -40, 0 }, + { 68736, 68786, 0, 64 }, { 68800, 68850, -64, 0 }, { 71840, 71871, 0, 32 }, + { 71872, 71903, -32, 0 }, { 93760, 93791, 0, 32 }, { 93792, 93823, -32, 0 }, + { 125184, 125217, 0, 34 }, { 125218, 125251, -34, 0 }, diff --git a/gdb/ada-exp.h b/gdb/ada-exp.h index 36ac3aa..0cd4eb9 100644 --- a/gdb/ada-exp.h +++ b/gdb/ada-exp.h @@ -23,19 +23,15 @@ #include "expop.h" extern struct value *ada_unop_neg (struct type *expect_type, - struct expression *exp, - enum noside noside, enum exp_opcode op, - struct value *arg1); + struct expression *exp, enum noside noside, + enum exp_opcode op, struct value *arg1); extern struct value *ada_atr_tag (struct type *expect_type, - struct expression *exp, - enum noside noside, enum exp_opcode op, - struct value *arg1); + struct expression *exp, enum noside noside, + enum exp_opcode op, struct value *arg1); extern struct value *ada_atr_size (struct type *expect_type, - struct expression *exp, - enum noside noside, enum exp_opcode op, - struct value *arg1); -extern struct value *ada_abs (struct type *expect_type, - struct expression *exp, + struct expression *exp, enum noside noside, + enum exp_opcode op, struct value *arg1); +extern struct value *ada_abs (struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1); extern struct value *ada_unop_in_range (struct type *expect_type, @@ -51,30 +47,26 @@ extern struct value *ada_equal_binop (struct type *expect_type, enum noside noside, enum exp_opcode op, struct value *arg1, struct value *arg2); extern struct value *ada_ternop_slice (struct expression *exp, - enum noside noside, - struct value *array, + enum noside noside, struct value *array, struct value *low_bound_val, struct value *high_bound_val); extern struct value *ada_binop_in_bounds (struct expression *exp, enum noside noside, struct value *arg1, - struct value *arg2, - int n); + struct value *arg2, int n); extern struct value *ada_binop_minmax (struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, - struct value *arg1, - struct value *arg2); + struct value *arg1, struct value *arg2); extern struct value *ada_pos_atr (struct type *expect_type, - struct expression *exp, - enum noside noside, enum exp_opcode op, - struct value *arg); + struct expression *exp, enum noside noside, + enum exp_opcode op, struct value *arg); extern struct value *ada_val_atr (enum noside noside, struct type *type, struct value *arg); extern struct value *ada_binop_exp (struct type *expect_type, - struct expression *exp, - enum noside noside, enum exp_opcode op, - struct value *arg1, struct value *arg2); + struct expression *exp, enum noside noside, + enum exp_opcode op, struct value *arg1, + struct value *arg2); namespace expr { @@ -90,11 +82,10 @@ struct ada_resolvable is the expected type of the expression, or nullptr if none is known. This method should return true if the operation should be replaced by a function call with this object as the callee. */ - virtual bool resolve (struct expression *exp, - bool deprocedure_p, - bool parse_completion, - innermost_block_tracker *tracker, - struct type *context_type) = 0; + virtual bool + resolve (struct expression *exp, bool deprocedure_p, bool parse_completion, + innermost_block_tracker *tracker, struct type *context_type) + = 0; /* Possibly replace this object with some other expression object. This is like 'resolve', but can return a replacement. @@ -107,47 +98,40 @@ struct ada_resolvable This should either return a new object, or OWNER -- never nullptr. */ - virtual operation_up replace (operation_up &&owner, - struct expression *exp, - bool deprocedure_p, - bool parse_completion, + virtual operation_up replace (operation_up &&owner, struct expression *exp, + bool deprocedure_p, bool parse_completion, innermost_block_tracker *tracker, struct type *context_type); }; /* In Ada, some generic operations must be wrapped with a handler that handles some Ada-specific type conversions. */ -class ada_wrapped_operation - : public tuple_holding_operation +class ada_wrapped_operation : public tuple_holding_operation { public: using tuple_holding_operation::tuple_holding_operation; - value *evaluate (struct type *expect_type, - struct expression *exp, + value *evaluate (struct type *expect_type, struct expression *exp, enum noside noside) override; enum exp_opcode opcode () const override - { return std::get<0> (m_storage)->opcode (); } + { + return std::get<0> (m_storage)->opcode (); + } }; /* An Ada string constant. */ -class ada_string_operation - : public string_operation +class ada_string_operation : public string_operation { public: using string_operation::string_operation; /* Return the underlying string. */ - const char *get_name () const - { - return std::get<0> (m_storage).c_str (); - } + const char *get_name () const { return std::get<0> (m_storage).c_str (); } - value *evaluate (struct type *expect_type, - struct expression *exp, + value *evaluate (struct type *expect_type, struct expression *exp, enum noside noside) override; }; @@ -159,12 +143,10 @@ public: using tuple_holding_operation::tuple_holding_operation; - value *evaluate (struct type *expect_type, - struct expression *exp, + value *evaluate (struct type *expect_type, struct expression *exp, enum noside noside) override; - enum exp_opcode opcode () const override - { return UNOP_QUAL; } + enum exp_opcode opcode () const override { return UNOP_QUAL; } }; /* Ternary in-range operator. */ @@ -175,12 +157,10 @@ public: using tuple_holding_operation::tuple_holding_operation; - value *evaluate (struct type *expect_type, - struct expression *exp, + value *evaluate (struct type *expect_type, struct expression *exp, enum noside noside) override; - enum exp_opcode opcode () const override - { return TERNOP_IN_RANGE; } + enum exp_opcode opcode () const override { return TERNOP_IN_RANGE; } }; using ada_neg_operation = unop_operation; @@ -197,17 +177,15 @@ public: using tuple_holding_operation::tuple_holding_operation; - value *evaluate (struct type *expect_type, - struct expression *exp, + value *evaluate (struct type *expect_type, struct expression *exp, enum noside noside) override { value *val = std::get<0> (m_storage)->evaluate (nullptr, exp, noside); - return ada_unop_in_range (expect_type, exp, noside, UNOP_IN_RANGE, - val, std::get<1> (m_storage)); + return ada_unop_in_range (expect_type, exp, noside, UNOP_IN_RANGE, val, + std::get<1> (m_storage)); } - enum exp_opcode opcode () const override - { return UNOP_IN_RANGE; } + enum exp_opcode opcode () const override { return UNOP_IN_RANGE; } }; /* The Ada + and - operators. */ @@ -218,12 +196,10 @@ public: using tuple_holding_operation::tuple_holding_operation; - value *evaluate (struct type *expect_type, - struct expression *exp, + value *evaluate (struct type *expect_type, struct expression *exp, enum noside noside) override; - enum exp_opcode opcode () const override - { return std::get<0> (m_storage); } + enum exp_opcode opcode () const override { return std::get<0> (m_storage); } }; using ada_binop_mul_operation = binop_operation; @@ -244,19 +220,17 @@ public: using tuple_holding_operation::tuple_holding_operation; - value *evaluate (struct type *expect_type, - struct expression *exp, + value *evaluate (struct type *expect_type, struct expression *exp, enum noside noside) override { value *arg1 = std::get<1> (m_storage)->evaluate (nullptr, exp, noside); - value *arg2 = std::get<2> (m_storage)->evaluate (value_type (arg1), - exp, noside); + value *arg2 + = std::get<2> (m_storage)->evaluate (value_type (arg1), exp, noside); return ada_equal_binop (expect_type, exp, noside, std::get<0> (m_storage), arg1, arg2); } - enum exp_opcode opcode () const override - { return std::get<0> (m_storage); } + enum exp_opcode opcode () const override { return std::get<0> (m_storage); } }; /* Bitwise operators for Ada. */ @@ -268,8 +242,7 @@ public: using maybe_constant_operation::maybe_constant_operation; - value *evaluate (struct type *expect_type, - struct expression *exp, + value *evaluate (struct type *expect_type, struct expression *exp, enum noside noside) override { value *lhs = std::get<0> (m_storage)->evaluate (nullptr, exp, noside); @@ -278,8 +251,7 @@ public: return value_cast (value_type (lhs), result); } - enum exp_opcode opcode () const override - { return OP; } + enum exp_opcode opcode () const override { return OP; } }; using ada_bitwise_and_operation = ada_bitwise_operation; @@ -295,8 +267,7 @@ public: using maybe_constant_operation::maybe_constant_operation; - value *evaluate (struct type *expect_type, - struct expression *exp, + value *evaluate (struct type *expect_type, struct expression *exp, enum noside noside) override { value *array = std::get<0> (m_storage)->evaluate (nullptr, exp, noside); @@ -305,13 +276,10 @@ public: return ada_ternop_slice (exp, noside, array, low, high); } - enum exp_opcode opcode () const override - { return TERNOP_SLICE; } + enum exp_opcode opcode () const override { return TERNOP_SLICE; } - bool resolve (struct expression *exp, - bool deprocedure_p, - bool parse_completion, - innermost_block_tracker *tracker, + bool resolve (struct expression *exp, bool deprocedure_p, + bool parse_completion, innermost_block_tracker *tracker, struct type *context_type) override; }; @@ -323,8 +291,7 @@ public: using maybe_constant_operation::maybe_constant_operation; - value *evaluate (struct type *expect_type, - struct expression *exp, + value *evaluate (struct type *expect_type, struct expression *exp, enum noside noside) override { value *arg1 = std::get<0> (m_storage)->evaluate (nullptr, exp, noside); @@ -333,8 +300,7 @@ public: std::get<2> (m_storage)); } - enum exp_opcode opcode () const override - { return BINOP_IN_BOUNDS; } + enum exp_opcode opcode () const override { return BINOP_IN_BOUNDS; } }; /* Implement several unary Ada OP_ATR_* operations. */ @@ -345,37 +311,30 @@ public: using maybe_constant_operation::maybe_constant_operation; - value *evaluate (struct type *expect_type, - struct expression *exp, + value *evaluate (struct type *expect_type, struct expression *exp, enum noside noside) override; - enum exp_opcode opcode () const override - { return std::get<1> (m_storage); } + enum exp_opcode opcode () const override { return std::get<1> (m_storage); } }; /* Variant of var_value_operation for Ada. */ -class ada_var_value_operation - : public var_value_operation, public ada_resolvable +class ada_var_value_operation : public var_value_operation, + public ada_resolvable { public: using var_value_operation::var_value_operation; - value *evaluate (struct type *expect_type, - struct expression *exp, + value *evaluate (struct type *expect_type, struct expression *exp, enum noside noside) override; - value *evaluate_for_cast (struct type *expect_type, - struct expression *exp, + value *evaluate_for_cast (struct type *expect_type, struct expression *exp, enum noside noside) override; - const block *get_block () const - { return std::get<0> (m_storage).block; } + const block *get_block () const { return std::get<0> (m_storage).block; } - bool resolve (struct expression *exp, - bool deprocedure_p, - bool parse_completion, - innermost_block_tracker *tracker, + bool resolve (struct expression *exp, bool deprocedure_p, + bool parse_completion, innermost_block_tracker *tracker, struct type *context_type) override; protected: @@ -384,15 +343,13 @@ protected: }; /* Variant of var_msym_value_operation for Ada. */ -class ada_var_msym_value_operation - : public var_msym_value_operation +class ada_var_msym_value_operation : public var_msym_value_operation { public: using var_msym_value_operation::var_msym_value_operation; - value *evaluate_for_cast (struct type *expect_type, - struct expression *exp, + value *evaluate_for_cast (struct type *expect_type, struct expression *exp, enum noside noside) override; protected: @@ -408,47 +365,37 @@ public: using tuple_holding_operation::tuple_holding_operation; - value *evaluate (struct type *expect_type, - struct expression *exp, + value *evaluate (struct type *expect_type, struct expression *exp, enum noside noside) override; - enum exp_opcode opcode () const override - { return OP_ATR_VAL; } + enum exp_opcode opcode () const override { return OP_ATR_VAL; } }; /* The indirection operator for Ada. */ -class ada_unop_ind_operation - : public unop_ind_base_operation +class ada_unop_ind_operation : public unop_ind_base_operation { public: using unop_ind_base_operation::unop_ind_base_operation; - value *evaluate (struct type *expect_type, - struct expression *exp, + value *evaluate (struct type *expect_type, struct expression *exp, enum noside noside) override; }; /* Implement STRUCTOP_STRUCT for Ada. */ -class ada_structop_operation - : public structop_base_operation +class ada_structop_operation : public structop_base_operation { public: using structop_base_operation::structop_base_operation; - value *evaluate (struct type *expect_type, - struct expression *exp, + value *evaluate (struct type *expect_type, struct expression *exp, enum noside noside) override; - enum exp_opcode opcode () const override - { return STRUCTOP_STRUCT; } + enum exp_opcode opcode () const override { return STRUCTOP_STRUCT; } /* Set the completion prefix. */ - void set_prefix (std::string &&prefix) - { - m_prefix = std::move (prefix); - } + void set_prefix (std::string &&prefix) { m_prefix = std::move (prefix); } bool complete (struct expression *exp, completion_tracker &tracker) override { @@ -477,34 +424,27 @@ public: using tuple_holding_operation::tuple_holding_operation; - value *evaluate (struct type *expect_type, - struct expression *exp, + value *evaluate (struct type *expect_type, struct expression *exp, enum noside noside) override; - bool resolve (struct expression *exp, - bool deprocedure_p, - bool parse_completion, - innermost_block_tracker *tracker, + bool resolve (struct expression *exp, bool deprocedure_p, + bool parse_completion, innermost_block_tracker *tracker, struct type *context_type) override; - enum exp_opcode opcode () const override - { return OP_FUNCALL; } + enum exp_opcode opcode () const override { return OP_FUNCALL; } }; /* An Ada assignment operation. */ -class ada_assign_operation - : public assign_operation +class ada_assign_operation : public assign_operation { public: using assign_operation::assign_operation; - value *evaluate (struct type *expect_type, - struct expression *exp, + value *evaluate (struct type *expect_type, struct expression *exp, enum noside noside) override; - enum exp_opcode opcode () const override - { return BINOP_ASSIGN; } + enum exp_opcode opcode () const override { return BINOP_ASSIGN; } }; /* This abstract class represents a single component in an Ada @@ -517,10 +457,10 @@ public: being evaluated. INDICES, LOW, and HIGH indicate which sub-components have already been assigned; INDICES should be updated by this call. */ - virtual void assign (struct value *container, - struct value *lhs, struct expression *exp, - std::vector &indices, - LONGEST low, LONGEST high) = 0; + virtual void assign (struct value *container, struct value *lhs, + struct expression *exp, std::vector &indices, + LONGEST low, LONGEST high) + = 0; /* Same as operation::uses_objfile. */ virtual bool uses_objfile (struct objfile *objfile) = 0; @@ -554,19 +494,16 @@ public: contents of LHS (unless == CONTAINER). Returns the modified CONTAINER. */ - value *assign_aggregate (struct value *container, - struct value *lhs, + value *assign_aggregate (struct value *container, struct value *lhs, struct expression *exp); - value *evaluate (struct type *expect_type, - struct expression *exp, + value *evaluate (struct type *expect_type, struct expression *exp, enum noside noside) override { - error (_("Aggregates only allowed on the right of an assignment")); + error (_ ("Aggregates only allowed on the right of an assignment")); } - enum exp_opcode opcode () const override - { return OP_AGGREGATE; } + enum exp_opcode opcode () const override { return OP_AGGREGATE; } }; /* A component holding a vector of other components to assign. */ @@ -579,9 +516,8 @@ public: { } - void assign (struct value *container, - struct value *lhs, struct expression *exp, - std::vector &indices, + void assign (struct value *container, struct value *lhs, + struct expression *exp, std::vector &indices, LONGEST low, LONGEST high) override; bool uses_objfile (struct objfile *objfile) override; @@ -605,9 +541,8 @@ public: { } - void assign (struct value *container, - struct value *lhs, struct expression *exp, - std::vector &indices, + void assign (struct value *container, struct value *lhs, + struct expression *exp, std::vector &indices, LONGEST low, LONGEST high) override; bool uses_objfile (struct objfile *objfile) override; @@ -630,9 +565,8 @@ public: { } - void assign (struct value *container, - struct value *lhs, struct expression *exp, - std::vector &indices, + void assign (struct value *container, struct value *lhs, + struct expression *exp, std::vector &indices, LONGEST low, LONGEST high) override; bool uses_objfile (struct objfile *objfile) override; @@ -653,12 +587,10 @@ public: /* Like ada_component::assign, but takes an operation as a parameter. The operation is evaluated and then assigned into LHS according to the rules of the concrete implementation. */ - virtual void assign (struct value *container, - struct value *lhs, - struct expression *exp, - std::vector &indices, - LONGEST low, LONGEST high, - operation_up &op) = 0; + virtual void assign (struct value *container, struct value *lhs, + struct expression *exp, std::vector &indices, + LONGEST low, LONGEST high, operation_up &op) + = 0; /* Same as operation::uses_objfile. */ virtual bool uses_objfile (struct objfile *objfile) = 0; @@ -696,9 +628,8 @@ public: m_assocs = std::move (assoc); } - void assign (struct value *container, - struct value *lhs, struct expression *exp, - std::vector &indices, + void assign (struct value *container, struct value *lhs, + struct expression *exp, std::vector &indices, LONGEST low, LONGEST high) override; bool uses_objfile (struct objfile *objfile) override; @@ -722,11 +653,9 @@ public: { } - void assign (struct value *container, - struct value *lhs, struct expression *exp, - std::vector &indices, - LONGEST low, LONGEST high, - operation_up &op) override; + void assign (struct value *container, struct value *lhs, + struct expression *exp, std::vector &indices, + LONGEST low, LONGEST high, operation_up &op) override; bool uses_objfile (struct objfile *objfile) override; @@ -750,11 +679,9 @@ public: { } - void assign (struct value *container, - struct value *lhs, struct expression *exp, - std::vector &indices, - LONGEST low, LONGEST high, - operation_up &op) override; + void assign (struct value *container, struct value *lhs, + struct expression *exp, std::vector &indices, + LONGEST low, LONGEST high, operation_up &op) override; bool uses_objfile (struct objfile *objfile) override; @@ -768,17 +695,14 @@ private: /* A character constant expression. This is a separate operation so that it can participate in resolution, so that TYPE'(CST) can work correctly for enums with character enumerators. */ -class ada_char_operation : public long_const_operation, - public ada_resolvable +class ada_char_operation : public long_const_operation, public ada_resolvable { public: using long_const_operation::long_const_operation; - bool resolve (struct expression *exp, - bool deprocedure_p, - bool parse_completion, - innermost_block_tracker *tracker, + bool resolve (struct expression *exp, bool deprocedure_p, + bool parse_completion, innermost_block_tracker *tracker, struct type *context_type) override { /* This should never be called, because this class also implements @@ -786,15 +710,12 @@ public: gdb_assert_not_reached ("unexpected call"); } - operation_up replace (operation_up &&owner, - struct expression *exp, - bool deprocedure_p, - bool parse_completion, + operation_up replace (operation_up &&owner, struct expression *exp, + bool deprocedure_p, bool parse_completion, innermost_block_tracker *tracker, struct type *context_type) override; - value *evaluate (struct type *expect_type, - struct expression *exp, + value *evaluate (struct type *expect_type, struct expression *exp, enum noside noside) override; }; @@ -804,8 +725,7 @@ public: using concat_operation::concat_operation; - value *evaluate (struct type *expect_type, - struct expression *exp, + value *evaluate (struct type *expect_type, struct expression *exp, enum noside noside) override; }; diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 3cd6f73..1bc3f5c 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -17,7 +17,6 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ - #include "defs.h" #include #include "gdbsupport/gdb_regex.h" @@ -114,8 +113,7 @@ static void ada_add_all_symbols (std::vector &, static int is_nonfunction (const std::vector &); static void add_defn_to_vec (std::vector &, - struct symbol *, - const struct block *); + struct symbol *, const struct block *); static int possible_user_operator_p (enum exp_opcode, struct value **); @@ -138,8 +136,8 @@ static struct type *ada_find_parallel_type_with_name (struct type *, static int is_dynamic_field (struct type *, int); static struct type *to_fixed_variant_branch_type (struct type *, - const gdb_byte *, - CORE_ADDR, struct value *); + const gdb_byte *, CORE_ADDR, + struct value *); static struct type *to_fixed_array_type (struct type *, struct value *, int); @@ -163,8 +161,7 @@ static int ada_is_unconstrained_packed_array_type (struct type *); static struct value *value_subscript_packed (struct value *, int, struct value **); -static struct value *coerce_unspec_val_to_type (struct value *, - struct type *); +static struct value *coerce_unspec_val_to_type (struct value *, struct type *); static int lesseq_defined_than (struct symbol *, struct symbol *); @@ -185,11 +182,11 @@ static struct value *val_atr (struct type *, LONGEST); static struct symbol *standard_lookup (const char *, const struct block *, domain_enum); -static struct value *ada_search_struct_field (const char *, struct value *, int, - struct type *); +static struct value *ada_search_struct_field (const char *, struct value *, + int, struct type *); -static int find_struct_field (const char *, struct type *, int, - struct type **, int *, int *, int *, int *); +static int find_struct_field (const char *, struct type *, int, struct type **, + int *, int *, int *, int *); static int ada_resolve_function (std::vector &, struct value **, int, const char *, @@ -202,13 +199,10 @@ static struct value *ada_index_struct_field (int, struct value *, int, static void add_component_interval (LONGEST, LONGEST, std::vector &); - static struct type *ada_find_any_type (const char *name); -static symbol_name_matcher_ftype *ada_get_symbol_name_matcher - (const lookup_name_info &lookup_name); - - +static symbol_name_matcher_ftype * +ada_get_symbol_name_matcher (const lookup_name_info &lookup_name); /* The character set used for source files. */ static const char *ada_source_charset; @@ -229,19 +223,13 @@ struct utf8_entry already lower-case. */ int lower_delta; - bool operator< (uint32_t val) const - { - return end < val; - } + bool operator<(uint32_t val) const { return end < val; } }; -static const utf8_entry ada_case_fold[] = -{ +static const utf8_entry ada_case_fold[] = { #include "ada-casefold.h" }; - - /* The result of a symbol lookup to be stored in our symbol cache. */ struct cache_entry @@ -298,13 +286,11 @@ static int warning_limit = 2; expression evaluation. */ static int warnings_issued = 0; -static const char * const known_runtime_file_name_patterns[] = { - ADA_KNOWN_RUNTIME_FILE_NAME_PATTERNS NULL -}; +static const char *const known_runtime_file_name_patterns[] + = { ADA_KNOWN_RUNTIME_FILE_NAME_PATTERNS NULL }; -static const char * const known_auxiliary_function_name_patterns[] = { - ADA_KNOWN_AUXILIARY_FUNCTION_NAME_PATTERNS NULL -}; +static const char *const known_auxiliary_function_name_patterns[] + = { ADA_KNOWN_AUXILIARY_FUNCTION_NAME_PATTERNS NULL }; /* Maintenance-related settings for this module. */ @@ -315,7 +301,7 @@ static struct cmd_list_element *maint_show_ada_cmdlist; static bool ada_ignore_descriptive_types_p = false; - /* Inferior-specific data. */ +/* Inferior-specific data. */ /* Per-inferior data for this module. */ @@ -365,8 +351,7 @@ ada_inferior_exit (struct inferior *inf) ada_inferior_data.clear (inf); } - - /* program-space-specific data. */ +/* program-space-specific data. */ /* This module's per-program-space data. */ struct ada_pspace_data @@ -396,7 +381,7 @@ get_ada_pspace_data (struct program_space *pspace) return data; } - /* Utilities */ +/* Utilities */ /* If TYPE is a TYPE_CODE_TYPEDEF type, return the target type after all typedef layers have been peeled. Otherwise, return TYPE. @@ -441,7 +426,7 @@ static const char * ada_unqualified_name (const char *decoded_name) { const char *result; - + /* If the decoded name starts with '<', it means that the encoded name does not follow standard naming conventions, and thus that it is not your typical Ada symbol name. Trying to unqualify it @@ -451,7 +436,7 @@ ada_unqualified_name (const char *decoded_name) result = strrchr (decoded_name, '.'); if (result != NULL) - result++; /* Skip the dot... */ + result++; /* Skip the dot... */ else result = decoded_name; @@ -474,15 +459,13 @@ field_name_match (const char *field_name, const char *target) { int len = strlen (target); - return - (strncmp (field_name, target, len) == 0 - && (field_name[len] == '\0' - || (startswith (field_name + len, "___") - && strcmp (field_name + strlen (field_name) - 6, - "___XVN") != 0))); + return (strncmp (field_name, target, len) == 0 + && (field_name[len] == '\0' + || (startswith (field_name + len, "___") + && strcmp (field_name + strlen (field_name) - 6, "___XVN") + != 0))); } - /* Assuming TYPE is a TYPE_CODE_STRUCT or a TYPE_CODE_TYPDEF to a TYPE_CODE_STRUCT, find the field whose name matches FIELD_NAME, and return its index. This function also handles fields whose name @@ -503,8 +486,8 @@ ada_get_field_index (const struct type *type, const char *field_name, return fieldno; if (!maybe_missing) - error (_("Unable to find field %s in struct %s. Aborting"), - field_name, struct_type->name ()); + error (_ ("Unable to find field %s in struct %s. Aborting"), field_name, + struct_type->name ()); return -1; } @@ -692,7 +675,7 @@ ada_discrete_type_high_bound (struct type *type) case TYPE_CODE_INT: return max_of_type (type); default: - error (_("Unexpected type in ada_discrete_type_high_bound.")); + error (_ ("Unexpected type in ada_discrete_type_high_bound.")); } } @@ -727,7 +710,7 @@ ada_discrete_type_low_bound (struct type *type) case TYPE_CODE_INT: return min_of_type (type); default: - error (_("Unexpected type in ada_discrete_type_low_bound.")); + error (_ ("Unexpected type in ada_discrete_type_low_bound.")); } } @@ -760,7 +743,7 @@ ada_get_decoded_value (struct value *value) || (ada_is_constrained_packed_array_type (type) && type->code () != TYPE_CODE_PTR)) { - if (type->code () == TYPE_CODE_TYPEDEF) /* array access type. */ + if (type->code () == TYPE_CODE_TYPEDEF) /* array access type. */ value = ada_coerce_to_simple_array_ptr (value); else value = ada_coerce_to_simple_array (value); @@ -785,9 +768,7 @@ ada_get_decoded_type (struct type *type) return type; } - - - /* Language Selection */ +/* Language Selection */ /* If the main program is in Ada, return language_ada, otherwise return LANG (the main program is in Ada iif the adainit symbol is found). */ @@ -822,7 +803,7 @@ ada_main_name (void) { CORE_ADDR main_program_name_addr = msym.value_address (); if (main_program_name_addr == 0) - error (_("Invalid address for Ada main program name.")); + error (_ ("Invalid address for Ada main program name.")); main_program_name = target_read_string (main_program_name_addr, 1024); return main_program_name.get (); @@ -831,36 +812,35 @@ ada_main_name (void) /* The main procedure doesn't seem to be in Ada. */ return NULL; } - - /* Symbols */ + +/* Symbols */ /* Table of Ada operators and their GNAT-encoded names. Last entry is pair of NULLs. */ -const struct ada_opname_map ada_opname_table[] = { - {"Oadd", "\"+\"", BINOP_ADD}, - {"Osubtract", "\"-\"", BINOP_SUB}, - {"Omultiply", "\"*\"", BINOP_MUL}, - {"Odivide", "\"/\"", BINOP_DIV}, - {"Omod", "\"mod\"", BINOP_MOD}, - {"Orem", "\"rem\"", BINOP_REM}, - {"Oexpon", "\"**\"", BINOP_EXP}, - {"Olt", "\"<\"", BINOP_LESS}, - {"Ole", "\"<=\"", BINOP_LEQ}, - {"Ogt", "\">\"", BINOP_GTR}, - {"Oge", "\">=\"", BINOP_GEQ}, - {"Oeq", "\"=\"", BINOP_EQUAL}, - {"One", "\"/=\"", BINOP_NOTEQUAL}, - {"Oand", "\"and\"", BINOP_BITWISE_AND}, - {"Oor", "\"or\"", BINOP_BITWISE_IOR}, - {"Oxor", "\"xor\"", BINOP_BITWISE_XOR}, - {"Oconcat", "\"&\"", BINOP_CONCAT}, - {"Oabs", "\"abs\"", UNOP_ABS}, - {"Onot", "\"not\"", UNOP_LOGICAL_NOT}, - {"Oadd", "\"+\"", UNOP_PLUS}, - {"Osubtract", "\"-\"", UNOP_NEG}, - {NULL, NULL} -}; +const struct ada_opname_map ada_opname_table[] + = { { "Oadd", "\"+\"", BINOP_ADD }, + { "Osubtract", "\"-\"", BINOP_SUB }, + { "Omultiply", "\"*\"", BINOP_MUL }, + { "Odivide", "\"/\"", BINOP_DIV }, + { "Omod", "\"mod\"", BINOP_MOD }, + { "Orem", "\"rem\"", BINOP_REM }, + { "Oexpon", "\"**\"", BINOP_EXP }, + { "Olt", "\"<\"", BINOP_LESS }, + { "Ole", "\"<=\"", BINOP_LEQ }, + { "Ogt", "\">\"", BINOP_GTR }, + { "Oge", "\">=\"", BINOP_GEQ }, + { "Oeq", "\"=\"", BINOP_EQUAL }, + { "One", "\"/=\"", BINOP_NOTEQUAL }, + { "Oand", "\"and\"", BINOP_BITWISE_AND }, + { "Oor", "\"or\"", BINOP_BITWISE_IOR }, + { "Oxor", "\"xor\"", BINOP_BITWISE_XOR }, + { "Oconcat", "\"&\"", BINOP_CONCAT }, + { "Oabs", "\"abs\"", UNOP_ABS }, + { "Onot", "\"not\"", UNOP_LOGICAL_NOT }, + { "Oadd", "\"+\"", UNOP_PLUS }, + { "Osubtract", "\"-\"", UNOP_NEG }, + { NULL, NULL } }; /* If STR is a decoded version of a compiler-provided suffix (like the "[cold]" in "symbol[cold]"), return true. Otherwise, return @@ -954,13 +934,13 @@ ada_encode_1 (const char *decoded, bool throw_errors) const struct ada_opname_map *mapping; for (mapping = ada_opname_table; - mapping->encoded != NULL - && !startswith (p, mapping->decoded); mapping += 1) + mapping->encoded != NULL && !startswith (p, mapping->decoded); + mapping += 1) ; if (mapping->encoded == NULL) { if (throw_errors) - error (_("invalid Ada operator name: %s"), p); + error (_ ("invalid Ada operator name: %s"), p); else return {}; } @@ -980,12 +960,10 @@ ada_encode_1 (const char *decoded, bool throw_errors) bool is_utf8 = ada_source_charset == ada_utf8; try { - convert_between_encodings - (host_charset (), - is_utf8 ? HOST_UTF32 : ada_source_charset, - (const gdb_byte *) encoding_buffer.c_str (), - encoding_buffer.length (), 1, - &storage, translit_none); + convert_between_encodings ( + host_charset (), is_utf8 ? HOST_UTF32 : ada_source_charset, + (const gdb_byte *) encoding_buffer.c_str (), + encoding_buffer.length (), 1, &storage, translit_none); } catch (const gdb_exception &) { @@ -996,8 +974,9 @@ ada_encode_1 (const char *decoded, bool throw_errors) if (!warned) { warned = true; - warning (_("charset conversion failure for '%s'.\n" - "You may have the wrong value for 'set ada source-charset'."), + warning (_ ("charset conversion failure for '%s'.\n" + "You may have the wrong value for 'set ada " + "source-charset'."), encoding_buffer.c_str ()); } @@ -1019,11 +998,8 @@ static const utf8_entry * find_case_fold_entry (uint32_t c) { auto iter = std::lower_bound (std::begin (ada_case_fold), - std::end (ada_case_fold), - c); - if (iter == std::end (ada_case_fold) - || c < iter->start - || c > iter->end) + std::end (ada_case_fold), c); + if (iter == std::end (ada_case_fold) || c < iter->start || c > iter->end) return nullptr; return &*iter; } @@ -1060,11 +1036,10 @@ ada_fold_name (gdb::string_view name, bool throw_on_error = false) auto_obstack storage; try { - convert_between_encodings - (host_charset (), HOST_UTF32, - (const gdb_byte *) name.data (), - name.length (), 1, - &storage, translit_none); + convert_between_encodings (host_charset (), HOST_UTF32, + (const gdb_byte *) name.data (), + name.length (), 1, &storage, + translit_none); } catch (const gdb_exception &) { @@ -1078,8 +1053,10 @@ ada_fold_name (gdb::string_view name, bool throw_on_error = false) if (!warned) { warned = true; - warning (_("could not convert '%s' from the host encoding (%s) to UTF-32.\n" - "This normally should not happen, please file a bug report."), + warning (_ ("could not convert '%s' from the host encoding (%s) " + "to UTF-32.\n" + "This normally should not happen, please file a bug " + "report."), gdb::to_string (name).c_str (), host_charset ()); } @@ -1109,15 +1086,14 @@ ada_fold_name (gdb::string_view name, bool throw_on_error = false) auto_obstack reconverted; try { - convert_between_encodings (HOST_UTF32, - host_charset (), + convert_between_encodings (HOST_UTF32, host_charset (), (const gdb_byte *) chars, num_chars * sizeof (uint32_t), - sizeof (uint32_t), - &reconverted, + sizeof (uint32_t), &reconverted, translit_none); obstack_1grow (&reconverted, '\0'); - fold_storage = std::string ((const char *) obstack_base (&reconverted)); + fold_storage + = std::string ((const char *) obstack_base (&reconverted)); } catch (const gdb_exception &) { @@ -1132,8 +1108,8 @@ ada_fold_name (gdb::string_view name, bool throw_on_error = false) if (!warned) { warned = true; - warning (_("could not convert the lower-cased variant of '%s'\n" - "from UTF-32 to the host encoding (%s)."), + warning (_ ("could not convert the lower-cased variant of '%s'\n" + "from UTF-32 to the host encoding (%s)."), gdb::to_string (name).c_str (), host_charset ()); } @@ -1214,8 +1190,7 @@ ada_remove_po_subprogram_suffix (const char *encoded, int *len) we leave these names undecoded, giving the user a clue that this entity is internal. */ - if (*len > 1 - && encoded[*len - 1] == 'N' + if (*len > 1 && encoded[*len - 1] == 'N' && (isdigit (encoded[*len - 2]) || islower (encoded[*len - 2]))) *len = *len - 1; } @@ -1282,15 +1257,13 @@ convert_from_hex_encoded (std::string &out, const char *str, int n) gdb_byte one_char = (gdb_byte) value; convert_between_encodings (ada_source_charset, host_charset (), - &one_char, - sizeof (one_char), sizeof (one_char), - &bytes, translit_none); + &one_char, sizeof (one_char), + sizeof (one_char), &bytes, translit_none); } else convert_between_encodings (HOST_UTF32, host_charset (), - (const gdb_byte *) &value, - sizeof (value), sizeof (value), - &bytes, translit_none); + (const gdb_byte *) &value, sizeof (value), + sizeof (value), &bytes, translit_none); obstack_1grow (&bytes, '\0'); out.append ((const char *) obstack_base (&bytes)); } @@ -1410,7 +1383,8 @@ ada_decode (const char *encoded, bool wrap, bool operators) { int op_len = strlen (ada_opname_table[k].encoded); if ((strncmp (ada_opname_table[k].encoded + 1, encoded + i + 1, - op_len - 1) == 0) + op_len - 1) + == 0) && !isalnum (encoded[i + op_len])) { decoded.append (ada_opname_table[k].decoded); @@ -1434,18 +1408,18 @@ ada_decode (const char *encoded, bool wrap, bool operators) be translated into "." (just below). These are internal names generated for anonymous blocks inside which our symbol is nested. */ - if (len0 - i > 5 && encoded [i] == '_' && encoded [i+1] == '_' - && encoded [i+2] == 'B' && encoded [i+3] == '_' - && isdigit (encoded [i+4])) + if (len0 - i > 5 && encoded[i] == '_' && encoded[i + 1] == '_' + && encoded[i + 2] == 'B' && encoded[i + 3] == '_' + && isdigit (encoded[i + 4])) { int k = i + 5; - + while (k < len0 && isdigit (encoded[k])) - k++; /* Skip any extra digit. */ + k++; /* Skip any extra digit. */ /* Double-check that the "__B_{DIGITS}+" sequence we found is indeed followed by "__". */ - if (len0 - k > 2 && encoded [k] == '_' && encoded [k+1] == '_') + if (len0 - k > 2 && encoded[k] == '_' && encoded[k + 1] == '_') i = k; } @@ -1462,23 +1436,21 @@ ada_decode (const char *encoded, bool wrap, bool operators) to give the user a clue that the code he is debugging has been internally generated. */ - if (len0 - i > 3 && encoded [i] == '_' && encoded[i+1] == 'E' - && isdigit (encoded[i+2])) + if (len0 - i > 3 && encoded[i] == '_' && encoded[i + 1] == 'E' + && isdigit (encoded[i + 2])) { int k = i + 3; while (k < len0 && isdigit (encoded[k])) k++; - if (k < len0 - && (encoded[k] == 'b' || encoded[k] == 's')) + if (k < len0 && (encoded[k] == 'b' || encoded[k] == 's')) { k++; /* Just as an extra precaution, make sure that if this suffix is followed by anything else, it is a '_'. Otherwise, we matched this sequence by accident. */ - if (k == len0 - || (k < len0 && encoded[k] == '_')) + if (k == len0 || (k < len0 && encoded[k] == '_')) i = k; } } @@ -1486,8 +1458,8 @@ ada_decode (const char *encoded, bool wrap, bool operators) /* Remove trailing "N" in [a-z0-9]+N__. The N is added by the GNAT front-end in protected object subprograms. */ - if (i < len0 + 3 - && encoded[i] == 'N' && encoded[i+1] == '_' && encoded[i+2] == '_') + if (i < len0 + 3 && encoded[i] == 'N' && encoded[i + 1] == '_' + && encoded[i + 2] == '_') { /* Backtrack a bit up until we reach either the begining of the encoded name, or "__". Make sure that we only find @@ -1544,7 +1516,7 @@ ada_decode (const char *encoded, bool wrap, bool operators) } else if (i < len0 - 2 && encoded[i] == '_' && encoded[i + 1] == '_') { - /* Replace '__' by '.'. */ + /* Replace '__' by '.'. */ decoded.push_back ('.'); at_start_name = 1; i += 2; @@ -1563,7 +1535,7 @@ ada_decode (const char *encoded, bool wrap, bool operators) if (operators) { - for (i = 0; i < decoded.length(); ++i) + for (i = 0; i < decoded.length (); ++i) if (isupper (decoded[i]) || decoded[i] == ' ') goto Suppress; } @@ -1581,7 +1553,7 @@ Suppress: if (encoded[0] == '<') decoded = encoded; else - decoded = '<' + std::string(encoded) + '>'; + decoded = '<' + std::string (encoded) + '>'; return decoded; } @@ -1606,8 +1578,7 @@ const char * ada_decode_symbol (const struct general_symbol_info *arg) { struct general_symbol_info *gsymbol = (struct general_symbol_info *) arg; - const char **resultp = - &gsymbol->language_specific.demangled_name; + const char **resultp = &gsymbol->language_specific.demangled_name; if (!gsymbol->ada_mangled) { @@ -1637,9 +1608,7 @@ ada_decode_symbol (const struct general_symbol_info *arg) return *resultp; } - - - /* Arrays */ +/* Arrays */ /* Assuming that INDEX_DESC_TYPE is an ___XA structure, a structure generated by the GNAT compiler to describe the index type used @@ -1682,18 +1651,19 @@ ada_fixup_array_indexes_type (struct type *index_desc_type) is not equal to the field name. */ if (index_desc_type->field (0).type ()->name () != NULL && strcmp (index_desc_type->field (0).type ()->name (), - index_desc_type->field (0).name ()) == 0) + index_desc_type->field (0).name ()) + == 0) return; /* Fixup each field of INDEX_DESC_TYPE. */ for (i = 0; i < index_desc_type->num_fields (); i++) - { - const char *name = index_desc_type->field (i).name (); - struct type *raw_type = ada_check_typedef (ada_find_any_type (name)); + { + const char *name = index_desc_type->field (i).name (); + struct type *raw_type = ada_check_typedef (ada_find_any_type (name)); - if (raw_type) - index_desc_type->field (i).set_type (raw_type); - } + if (raw_type) + index_desc_type->field (i).set_type (raw_type); + } } /* The desc_* routines return primitive portions of array descriptors @@ -1712,8 +1682,7 @@ desc_base_type (struct type *type) type = ada_typedef_target_type (type); if (type != NULL - && (type->code () == TYPE_CODE_PTR - || type->code () == TYPE_CODE_REF)) + && (type->code () == TYPE_CODE_PTR || type->code () == TYPE_CODE_REF)) return ada_check_typedef (type->target_type ()); else return type; @@ -1724,9 +1693,8 @@ desc_base_type (struct type *type) static int is_thin_pntr (struct type *type) { - return - is_suffix (ada_type_name (desc_base_type (type)), "___XUT") - || is_suffix (ada_type_name (desc_base_type (type)), "___XUT___XVE"); + return is_suffix (ada_type_name (desc_base_type (type)), "___XUT") + || is_suffix (ada_type_name (desc_base_type (type)), "___XUT___XVE"); } /* The descriptor type for thin pointer type TYPE. */ @@ -1817,12 +1785,12 @@ desc_bounds (struct value *arr) if (is_thin_pntr (type)) { - struct type *bounds_type = - desc_bounds_type (thin_descriptor_type (type)); + struct type *bounds_type + = desc_bounds_type (thin_descriptor_type (type)); LONGEST addr; if (bounds_type == NULL) - error (_("Bad GNAT array descriptor")); + error (_ ("Bad GNAT array descriptor")); /* NOTE: The following calculation is not really kosher, but since desc_type is an XVE-encoded type (and shouldn't be), @@ -1832,29 +1800,27 @@ desc_bounds (struct value *arr) else addr = value_address (arr); - return - value_from_longest (lookup_pointer_type (bounds_type), - addr - bounds_type->length ()); + return value_from_longest (lookup_pointer_type (bounds_type), + addr - bounds_type->length ()); } else if (is_thick_pntr (type)) { - struct value *p_bounds = value_struct_elt (&arr, {}, "P_BOUNDS", NULL, - _("Bad GNAT array descriptor")); + struct value *p_bounds + = value_struct_elt (&arr, {}, "P_BOUNDS", NULL, + _ ("Bad GNAT array descriptor")); struct type *p_bounds_type = value_type (p_bounds); - if (p_bounds_type - && p_bounds_type->code () == TYPE_CODE_PTR) + if (p_bounds_type && p_bounds_type->code () == TYPE_CODE_PTR) { struct type *target_type = p_bounds_type->target_type (); if (target_type->is_stub ()) - p_bounds = value_cast (lookup_pointer_type - (ada_check_typedef (target_type)), - p_bounds); + p_bounds = value_cast ( + lookup_pointer_type (ada_check_typedef (target_type)), p_bounds); } else - error (_("Bad GNAT array descriptor")); + error (_ ("Bad GNAT array descriptor")); return p_bounds; } @@ -1902,8 +1868,7 @@ desc_data_target_type (struct type *type) { struct type *data_type = lookup_struct_elt_type (type, "P_ARRAY", 1); - if (data_type - && ada_check_typedef (data_type)->code () == TYPE_CODE_PTR) + if (data_type && ada_check_typedef (data_type)->code () == TYPE_CODE_PTR) return ada_check_typedef (data_type->target_type ()); } @@ -1922,12 +1887,11 @@ desc_data (struct value *arr) return thin_data_pntr (arr); else if (is_thick_pntr (type)) return value_struct_elt (&arr, {}, "P_ARRAY", NULL, - _("Bad GNAT array descriptor")); + _ ("Bad GNAT array descriptor")); else return NULL; } - /* If TYPE is the type of an array-descriptor (fat pointer), the bit position of the field containing the address of the data. */ @@ -1959,10 +1923,10 @@ static struct value * desc_one_bound (struct value *bounds, int i, int which) { char bound_name[20]; - xsnprintf (bound_name, sizeof (bound_name), "%cB%d", - which ? 'U' : 'L', i - 1); + xsnprintf (bound_name, sizeof (bound_name), "%cB%d", which ? 'U' : 'L', + i - 1); return value_struct_elt (&bounds, {}, bound_name, NULL, - _("Bad GNAT array descriptor bounds")); + _ ("Bad GNAT array descriptor bounds")); } /* If BOUNDS is an array-bounds structure type, return the bit position @@ -2042,8 +2006,7 @@ static int ada_is_array_type (struct type *type) { while (type != NULL - && (type->code () == TYPE_CODE_PTR - || type->code () == TYPE_CODE_REF)) + && (type->code () == TYPE_CODE_PTR || type->code () == TYPE_CODE_REF)) type = type->target_type (); return ada_is_direct_array_type (type); } @@ -2072,8 +2035,7 @@ ada_is_array_descriptor_type (struct type *type) if (type == NULL) return 0; type = ada_check_typedef (type); - return (data_type != NULL - && data_type->code () == TYPE_CODE_ARRAY + return (data_type != NULL && data_type->code () == TYPE_CODE_ARRAY && desc_arity (desc_bounds_type (type)) > 0); } @@ -2085,15 +2047,12 @@ ada_is_array_descriptor_type (struct type *type) int ada_is_bogus_array_descriptor (struct type *type) { - return - type != NULL - && type->code () == TYPE_CODE_STRUCT - && (lookup_struct_elt_type (type, "P_BOUNDS", 1) != NULL - || lookup_struct_elt_type (type, "P_ARRAY", 1) != NULL) - && !ada_is_array_descriptor_type (type); + return type != NULL && type->code () == TYPE_CODE_STRUCT + && (lookup_struct_elt_type (type, "P_BOUNDS", 1) != NULL + || lookup_struct_elt_type (type, "P_ARRAY", 1) != NULL) + && !ada_is_array_descriptor_type (type); } - /* If ARR has a record type in the form of a standard GNAT array descriptor, (fat pointer) returns the type of the array data described---specifically, a pointer-to-array type. If BOUNDS is non-zero, the bounds data are filled @@ -2113,13 +2072,13 @@ ada_type_of_array (struct value *arr, int bounds) if (!bounds) { - struct type *array_type = - ada_check_typedef (desc_data_target_type (value_type (arr))); + struct type *array_type + = ada_check_typedef (desc_data_target_type (value_type (arr))); if (ada_is_unconstrained_packed_array_type (value_type (arr))) - TYPE_FIELD_BITSIZE (array_type, 0) = - decode_packed_array_bitsize (value_type (arr)); - + TYPE_FIELD_BITSIZE (array_type, 0) + = decode_packed_array_bitsize (value_type (arr)); + return array_type; } else @@ -2158,14 +2117,14 @@ ada_type_of_array (struct value *arr, int bounds) LONGEST lo = value_as_long (low); LONGEST hi = value_as_long (high); - TYPE_FIELD_BITSIZE (elt_type, 0) = - decode_packed_array_bitsize (value_type (arr)); + TYPE_FIELD_BITSIZE (elt_type, 0) + = decode_packed_array_bitsize (value_type (arr)); /* If the array has no element, then the size is already zero, and does not need to be recomputed. */ if (lo < hi) { - int array_bitsize = - (hi - lo + 1) * TYPE_FIELD_BITSIZE (elt_type, 0); + int array_bitsize + = (hi - lo + 1) * TYPE_FIELD_BITSIZE (elt_type, 0); array_type->set_length ((array_bitsize + 7) / 8); } @@ -2210,7 +2169,7 @@ ada_coerce_to_simple_array (struct value *arr) struct value *arrVal = ada_coerce_to_simple_array_ptr (arr); if (arrVal == NULL) - error (_("Bounds unavailable for null array pointer.")); + error (_ ("Bounds unavailable for null array pointer.")); return value_ind (arrVal); } else if (ada_is_constrained_packed_array_type (value_type (arr))) @@ -2238,15 +2197,14 @@ ada_coerce_to_simple_array_type (struct type *type) /* Non-zero iff TYPE represents a standard GNAT packed-array type. */ static int -ada_is_gnat_encoded_packed_array_type (struct type *type) +ada_is_gnat_encoded_packed_array_type (struct type *type) { if (type == NULL) return 0; type = desc_base_type (type); type = ada_check_typedef (type); - return - ada_type_name (type) != NULL - && strstr (ada_type_name (type), "___XP") != NULL; + return ada_type_name (type) != NULL + && strstr (ada_type_name (type), "___XP") != NULL; } /* Non-zero iff TYPE represents a standard GNAT constrained @@ -2256,7 +2214,7 @@ int ada_is_constrained_packed_array_type (struct type *type) { return ada_is_gnat_encoded_packed_array_type (type) - && !ada_is_array_descriptor_type (type); + && !ada_is_array_descriptor_type (type); } /* Non-zero iff TYPE represents an array descriptor for a @@ -2336,8 +2294,8 @@ decode_packed_array_bitsize (struct type *type) if (sscanf (tail + sizeof ("___XP") - 1, "%ld", &bits) != 1) { - lim_warning - (_("could not understand bit size information on packed array")); + lim_warning ( + _ ("could not understand bit size information on packed array")); return 0; } @@ -2376,15 +2334,15 @@ constrained_packed_array_type (struct type *type, long *elt_bits) index_type_desc = ada_find_parallel_type (type, "___XA"); if (index_type_desc) - index_type = to_fixed_range_type (index_type_desc->field (0).type (), - NULL); + index_type + = to_fixed_range_type (index_type_desc->field (0).type (), NULL); else index_type = type->index_type (); new_type = alloc_type_copy (type); - new_elt_type = - constrained_packed_array_type (ada_check_typedef (type->target_type ()), - elt_bits); + new_elt_type + = constrained_packed_array_type (ada_check_typedef (type->target_type ()), + elt_bits); create_array_type (new_type, new_elt_type, index_type); TYPE_FIELD_BITSIZE (new_type, 0) = *elt_bits; new_type->set_name (ada_type_name (type)); @@ -2437,15 +2395,15 @@ decode_constrained_packed_array_type (struct type *type) if (shadow_type == NULL) { - lim_warning (_("could not find bounds information on packed array")); + lim_warning (_ ("could not find bounds information on packed array")); return NULL; } shadow_type = check_typedef (shadow_type); if (shadow_type->code () != TYPE_CODE_ARRAY) { - lim_warning (_("could not understand bounds " - "information on packed array")); + lim_warning (_ ("could not understand bounds " + "information on packed array")); return NULL; } @@ -2463,8 +2421,7 @@ recursively_update_array_bitsize (struct type *type) gdb_assert (type->code () == TYPE_CODE_ARRAY); LONGEST low, high; - if (!get_discrete_bounds (type->index_type (), &low, &high) - || low > high) + if (!get_discrete_bounds (type->index_type (), &low, &high) || low > high) return 0; LONGEST our_len = high - low + 1; @@ -2507,7 +2464,7 @@ decode_constrained_packed_array (struct value *arr) type = decode_constrained_packed_array_type (value_type (arr)); if (type == NULL) { - error (_("can't unpack array")); + error (_ ("can't unpack array")); return NULL; } @@ -2526,7 +2483,7 @@ decode_constrained_packed_array (struct value *arr) if (type_byte_order (value_type (arr)) == BFD_ENDIAN_BIG && ada_is_modular_type (value_type (arr))) { - /* This is a (right-justified) modular type representing a packed + /* This is a (right-justified) modular type representing a packed array with no wrapper. In order to interpret the value through the (left-justified) packed array type we just built, we must first left-justify it. */ @@ -2541,17 +2498,14 @@ decode_constrained_packed_array (struct value *arr) mod >>= 1; } bit_pos = HOST_CHAR_BIT * value_type (arr)->length () - bit_size; - arr = ada_value_primitive_packed_val (arr, NULL, - bit_pos / HOST_CHAR_BIT, - bit_pos % HOST_CHAR_BIT, - bit_size, + arr = ada_value_primitive_packed_val (arr, NULL, bit_pos / HOST_CHAR_BIT, + bit_pos % HOST_CHAR_BIT, bit_size, type); } return coerce_unspec_val_to_type (arr, type); } - /* The value of the element of packed array ARR at the ARITY indices given in IND. ARR must be a simple array. */ @@ -2571,9 +2525,8 @@ value_subscript_packed (struct value *arr, int arity, struct value **ind) { if (elt_type->code () != TYPE_CODE_ARRAY || TYPE_FIELD_BITSIZE (elt_type, 0) == 0) - error - (_("attempt to do packed indexing of " - "something other than a packed array")); + error (_ ("attempt to do packed indexing of " + "something other than a packed array")); else { struct type *range_type = elt_type->index_type (); @@ -2582,13 +2535,13 @@ value_subscript_packed (struct value *arr, int arity, struct value **ind) if (!get_discrete_bounds (range_type, &lowerbound, &upperbound)) { - lim_warning (_("don't know bounds of array")); + lim_warning (_ ("don't know bounds of array")); lowerbound = upperbound = 0; } idx = pos_atr (ind[i]); if (idx < lowerbound || idx > upperbound) - lim_warning (_("packed array index %ld out of bounds"), + lim_warning (_ ("packed array index %ld out of bounds"), (long) idx); bits = TYPE_FIELD_BITSIZE (elt_type, 0); elt_total_bit_offset += (idx - lowerbound) * bits; @@ -2598,8 +2551,8 @@ value_subscript_packed (struct value *arr, int arity, struct value **ind) elt_off = elt_total_bit_offset / HOST_CHAR_BIT; bit_off = elt_total_bit_offset % HOST_CHAR_BIT; - v = ada_value_primitive_packed_val (arr, NULL, elt_off, bit_off, - bits, elt_type); + v = ada_value_primitive_packed_val (arr, NULL, elt_off, bit_off, bits, + elt_type); return v; } @@ -2636,21 +2589,20 @@ has_negatives (struct type *type) static void ada_unpack_from_contents (const gdb_byte *src, int bit_offset, int bit_size, gdb_byte *unpacked, int unpacked_len, - int is_big_endian, int is_signed_type, - int is_scalar) + int is_big_endian, int is_signed_type, int is_scalar) { int src_len = (bit_size + bit_offset + HOST_CHAR_BIT - 1) / 8; - int src_idx; /* Index into the source area */ - int src_bytes_left; /* Number of source bytes left to process. */ - int srcBitsLeft; /* Number of source bits left to move */ - int unusedLS; /* Number of bits in next significant + int src_idx; /* Index into the source area */ + int src_bytes_left; /* Number of source bytes left to process. */ + int srcBitsLeft; /* Number of source bits left to move */ + int unusedLS; /* Number of bits in next significant byte of source that are unused */ - int unpacked_idx; /* Index into the unpacked buffer */ - int unpacked_bytes_left; /* Number of bytes left to set in unpacked. */ + int unpacked_idx; /* Index into the unpacked buffer */ + int unpacked_bytes_left; /* Number of bytes left to set in unpacked. */ - unsigned long accum; /* Staging area for bits being transferred */ - int accumSize; /* Number of meaningful bits in accum */ + unsigned long accum; /* Staging area for bits being transferred */ + int accumSize; /* Number of meaningful bits in accum */ unsigned char sign; /* Transmit bytes from least to most significant; delta is the direction @@ -2660,8 +2612,8 @@ ada_unpack_from_contents (const gdb_byte *src, int bit_offset, int bit_size, /* Make sure that unpacked is large enough to receive the BIT_SIZE bits from SRC. .*/ if ((bit_size + HOST_CHAR_BIT - 1) / HOST_CHAR_BIT > unpacked_len) - error (_("Cannot unpack %d bits into buffer of %d bytes"), - bit_size, unpacked_len); + error (_ ("Cannot unpack %d bits into buffer of %d bytes"), bit_size, + unpacked_len); srcBitsLeft = bit_size; src_bytes_left = src_len; @@ -2675,9 +2627,8 @@ ada_unpack_from_contents (const gdb_byte *src, int bit_offset, int bit_size, && ((src[0] << bit_offset) & (1 << (HOST_CHAR_BIT - 1)))) sign = ~0; - unusedLS = - (HOST_CHAR_BIT - (bit_size + bit_offset) % HOST_CHAR_BIT) - % HOST_CHAR_BIT; + unusedLS = (HOST_CHAR_BIT - (bit_size + bit_offset) % HOST_CHAR_BIT) + % HOST_CHAR_BIT; if (is_scalar) { @@ -2687,8 +2638,8 @@ ada_unpack_from_contents (const gdb_byte *src, int bit_offset, int bit_size, else { /* Non-scalar values must be aligned at a byte boundary... */ - accumSize = - (HOST_CHAR_BIT - bit_size % HOST_CHAR_BIT) % HOST_CHAR_BIT; + accumSize + = (HOST_CHAR_BIT - bit_size % HOST_CHAR_BIT) % HOST_CHAR_BIT; /* ... And are placed at the beginning (most-significant) bytes of the target. */ unpacked_idx = (bit_size + HOST_CHAR_BIT - 1) / HOST_CHAR_BIT - 1; @@ -2712,14 +2663,14 @@ ada_unpack_from_contents (const gdb_byte *src, int bit_offset, int bit_size, { /* Mask for removing bits of the next source byte that are not part of the value. */ - unsigned int unusedMSMask = - (1 << (srcBitsLeft >= HOST_CHAR_BIT ? HOST_CHAR_BIT : srcBitsLeft)) - - 1; + unsigned int unusedMSMask + = (1 << (srcBitsLeft >= HOST_CHAR_BIT ? HOST_CHAR_BIT : srcBitsLeft)) + - 1; /* Sign-extend bits for this byte. */ unsigned int signMask = sign & ~unusedMSMask; - accum |= - (((src[src_idx] >> unusedLS) & unusedMSMask) | signMask) << accumSize; + accum |= (((src[src_idx] >> unusedLS) & unusedMSMask) | signMask) + << accumSize; accumSize += HOST_CHAR_BIT - unusedLS; if (accumSize >= HOST_CHAR_BIT) { @@ -2762,7 +2713,7 @@ ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr, struct type *type) { struct value *v; - const gdb_byte *src; /* First byte containing data to unpack */ + const gdb_byte *src; /* First byte containing data to unpack */ gdb_byte *unpacked; const int is_scalar = is_scalar_type (type); const int is_big_endian = type_byte_order (type) == BFD_ENDIAN_BIG; @@ -2787,10 +2738,9 @@ ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr, int staging_len = (bit_size + HOST_CHAR_BIT - 1) / HOST_CHAR_BIT; staging.resize (staging_len); - ada_unpack_from_contents (src, bit_offset, bit_size, - staging.data (), staging.size (), - is_big_endian, has_negatives (type), - is_scalar); + ada_unpack_from_contents (src, bit_offset, bit_size, staging.data (), + staging.size (), is_big_endian, + has_negatives (type), is_scalar); type = resolve_dynamic_type (type, staging, 0); if (type->length () < (bit_size + HOST_CHAR_BIT - 1) / HOST_CHAR_BIT) { @@ -2862,9 +2812,9 @@ ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr, memcpy (unpacked, staging.data (), staging.size ()); } else - ada_unpack_from_contents (src, bit_offset, bit_size, - unpacked, type->length (), - is_big_endian, has_negatives (type), is_scalar); + ada_unpack_from_contents (src, bit_offset, bit_size, unpacked, + type->length (), is_big_endian, + has_negatives (type), is_scalar); return v; } @@ -2889,15 +2839,13 @@ ada_value_assign (struct value *toval, struct value *fromval) fromval = ada_coerce_to_simple_array (fromval); if (!deprecated_value_modifiable (toval)) - error (_("Left operand of assignment is not a modifiable lvalue.")); + error (_ ("Left operand of assignment is not a modifiable lvalue.")); - if (VALUE_LVAL (toval) == lval_memory - && bits > 0 - && (type->code () == TYPE_CODE_FLT - || type->code () == TYPE_CODE_STRUCT)) + if (VALUE_LVAL (toval) == lval_memory && bits > 0 + && (type->code () == TYPE_CODE_FLT || type->code () == TYPE_CODE_STRUCT)) { - int len = (value_bitpos (toval) - + bits + HOST_CHAR_BIT - 1) / HOST_CHAR_BIT; + int len + = (value_bitpos (toval) + bits + HOST_CHAR_BIT - 1) / HOST_CHAR_BIT; int from_size; gdb_byte *buffer = (gdb_byte *) alloca (len); struct value *val; @@ -2916,14 +2864,13 @@ ada_value_assign (struct value *toval, struct value *fromval) if (is_big_endian && is_scalar_type (value_type (fromval))) from_offset = from_size - bits; copy_bitwise (buffer, value_bitpos (toval), - value_contents (fromval).data (), from_offset, - bits, is_big_endian); + value_contents (fromval).data (), from_offset, bits, + is_big_endian); write_memory_with_notification (to_addr, buffer, len); val = value_copy (toval); memcpy (value_contents_raw (val).data (), - value_contents (fromval).data (), - type->length ()); + value_contents (fromval).data (), type->length ()); deprecated_set_value_type (val, type); return val; @@ -2932,7 +2879,6 @@ ada_value_assign (struct value *toval, struct value *fromval) return value_assign (toval, fromval); } - /* Given that COMPONENT is a memory lvalue that is part of the lvalue CONTAINER, assign the contents of VAL to COMPONENTS's place in CONTAINER. Modifies the VALUE_CONTENTS of CONTAINER only, not @@ -2948,10 +2894,10 @@ static void value_assign_to_component (struct value *container, struct value *component, struct value *val) { - LONGEST offset_in_container = - (LONGEST) (value_address (component) - value_address (container)); - int bit_offset_in_container = - value_bitpos (component) - value_bitpos (container); + LONGEST offset_in_container + = (LONGEST) (value_address (component) - value_address (container)); + int bit_offset_in_container + = value_bitpos (component) - value_bitpos (container); int bits; val = value_cast (value_type (component), val); @@ -3014,7 +2960,7 @@ ada_value_subscript (struct value *arr, int arity, struct value **ind) struct type *saved_elt_type = elt_type->target_type (); if (elt_type->code () != TYPE_CODE_ARRAY) - error (_("too many subscripts (%d expected)"), k); + error (_ ("too many subscripts (%d expected)"), k); elt = value_subscript (elt, pos_atr (ind[k])); @@ -3059,11 +3005,9 @@ ada_value_ptr_subscript (struct value *arr, int arity, struct value **ind) { int k; struct value *array_ind = ada_value_ind (arr); - struct type *type - = check_typedef (value_enclosing_type (array_ind)); + struct type *type = check_typedef (value_enclosing_type (array_ind)); - if (type->code () == TYPE_CODE_ARRAY - && TYPE_FIELD_BITSIZE (type, 0) > 0) + if (type->code () == TYPE_CODE_ARRAY && TYPE_FIELD_BITSIZE (type, 0) > 0) return value_subscript_packed (array_ind, arity, ind); for (k = 0; k < arity; k += 1) @@ -3071,7 +3015,7 @@ ada_value_ptr_subscript (struct value *arr, int arity, struct value **ind) LONGEST lwb, upb; if (type->code () != TYPE_CODE_ARRAY) - error (_("too many subscripts (%d expected)"), k); + error (_ ("too many subscripts (%d expected)"), k); arr = value_cast (lookup_pointer_type (type->target_type ()), value_copy (arr)); get_discrete_bounds (type->index_type (), &lwb, &upb); @@ -3087,18 +3031,18 @@ ada_value_ptr_subscript (struct value *arr, int arity, struct value **ind) HIGH'Pos-LOW'Pos+1 elements starting at index LOW. The lower bound of this array is LOW, as per Ada rules. */ static struct value * -ada_value_slice_from_ptr (struct value *array_ptr, struct type *type, - int low, int high) +ada_value_slice_from_ptr (struct value *array_ptr, struct type *type, int low, + int high) { struct type *type0 = ada_check_typedef (type); struct type *base_index_type = type0->index_type ()->target_type (); struct type *index_type = create_static_range_type (NULL, base_index_type, low, high); - struct type *slice_type = create_array_type_with_stride - (NULL, type0->target_type (), index_type, - type0->dyn_prop (DYN_PROP_BYTE_STRIDE), - TYPE_FIELD_BITSIZE (type0, 0)); - int base_low = ada_discrete_type_low_bound (type0->index_type ()); + struct type *slice_type + = create_array_type_with_stride (NULL, type0->target_type (), index_type, + type0->dyn_prop (DYN_PROP_BYTE_STRIDE), + TYPE_FIELD_BITSIZE (type0, 0)); + int base_low = ada_discrete_type_low_bound (type0->index_type ()); gdb::optional base_low_pos, low_pos; CORE_ADDR base; @@ -3107,7 +3051,7 @@ ada_value_slice_from_ptr (struct value *array_ptr, struct type *type, if (!low_pos.has_value () || !base_low_pos.has_value ()) { - warning (_("unable to get positions in slice, use bounds instead")); + warning (_ ("unable to get positions in slice, use bounds instead")); low_pos = low; base_low_pos = base_low; } @@ -3120,7 +3064,6 @@ ada_value_slice_from_ptr (struct value *array_ptr, struct type *type, return value_at_lazy (slice_type, base); } - static struct value * ada_value_slice (struct value *array, int low, int high) { @@ -3128,19 +3071,18 @@ ada_value_slice (struct value *array, int low, int high) struct type *base_index_type = type->index_type ()->target_type (); struct type *index_type = create_static_range_type (NULL, type->index_type (), low, high); - struct type *slice_type = create_array_type_with_stride - (NULL, type->target_type (), index_type, - type->dyn_prop (DYN_PROP_BYTE_STRIDE), - TYPE_FIELD_BITSIZE (type, 0)); + struct type *slice_type + = create_array_type_with_stride (NULL, type->target_type (), index_type, + type->dyn_prop (DYN_PROP_BYTE_STRIDE), + TYPE_FIELD_BITSIZE (type, 0)); gdb::optional low_pos, high_pos; - low_pos = discrete_position (base_index_type, low); high_pos = discrete_position (base_index_type, high); if (!low_pos.has_value () || !high_pos.has_value ()) { - warning (_("unable to get positions in slice, use bounds instead")); + warning (_ ("unable to get positions in slice, use bounds instead")); low_pos = low; high_pos = high; } @@ -3237,7 +3179,7 @@ ada_index_type (struct type *type, int n, const char *name) type = desc_base_type (type); if (n < 0 || n > ada_array_arity (type)) - error (_("invalid dimension number to '%s"), name); + error (_ ("invalid dimension number to '%s"), name); if (ada_is_simple_array_type (type)) { @@ -3259,7 +3201,7 @@ ada_index_type (struct type *type, int n, const char *name) { result_type = desc_index_type (desc_bounds_type (type), n); if (result_type == NULL) - error (_("attempt to take bound of something that is not an array")); + error (_ ("attempt to take bound of something that is not an array")); } return result_type; @@ -3283,7 +3225,7 @@ ada_array_bound_from_type (struct type *arr_type, int n, int which) arr_type = decode_constrained_packed_array_type (arr_type); if (arr_type == NULL || !ada_is_simple_array_type (arr_type)) - return (LONGEST) - which; + return (LONGEST) -which; if (arr_type->code () == TYPE_CODE_PTR) type = arr_type->target_type (); @@ -3304,8 +3246,8 @@ ada_array_bound_from_type (struct type *arr_type, int n, int which) } if (index_type_desc != NULL) - index_type = to_fixed_range_type (index_type_desc->field (n - 1).type (), - NULL); + index_type + = to_fixed_range_type (index_type_desc->field (n - 1).type (), NULL); else { struct type *elt_type = check_typedef (type); @@ -3316,10 +3258,8 @@ ada_array_bound_from_type (struct type *arr_type, int n, int which) index_type = elt_type->index_type (); } - return - (LONGEST) (which == 0 - ? ada_discrete_type_low_bound (index_type) - : ada_discrete_type_high_bound (index_type)); + return (LONGEST) (which == 0 ? ada_discrete_type_low_bound (index_type) + : ada_discrete_type_high_bound (index_type)); } /* Given that arr is an array value, returns the lower bound of the @@ -3399,16 +3339,14 @@ empty_array (struct type *arr_type, int low, int high) { struct type *arr_type0 = ada_check_typedef (arr_type); struct type *index_type - = create_static_range_type - (NULL, arr_type0->index_type ()->target_type (), low, - high < low ? low - 1 : high); + = create_static_range_type (NULL, arr_type0->index_type ()->target_type (), + low, high < low ? low - 1 : high); struct type *elt_type = ada_array_element_type (arr_type0, 1); return allocate_value (create_array_type (NULL, elt_type, index_type)); } - - /* Name resolution */ +/* Name resolution */ /* The "decoded" name for the user-definable Ada operator corresponding to OP. */ @@ -3423,7 +3361,7 @@ ada_decoded_op_name (enum exp_opcode op) if (ada_opname_table[i].op == op) return ada_opname_table[i].decoded; } - error (_("Could not find operator name for opcode")); + error (_ ("Could not find operator name for opcode")); } /* Returns true (non-zero) iff decoded name N0 should appear before N1 @@ -3505,9 +3443,7 @@ ada_print_symbol_signature (struct ui_file *stream, struct symbol *sym, struct type *type = sym->type (); gdb_printf (stream, "%s", sym->print_name ()); - if (!print_signatures - || type == NULL - || type->code () != TYPE_CODE_FUNC) + if (!print_signatures || type == NULL || type->code () != TYPE_CODE_FUNC) return; if (type->num_fields () > 0) @@ -3519,8 +3455,7 @@ ada_print_symbol_signature (struct ui_file *stream, struct symbol *sym, { if (i > 0) gdb_printf (stream, "; "); - ada_print_type (type->field (i).type (), NULL, stream, -1, 0, - flags); + ada_print_type (type->field (i).type (), NULL, stream, -1, 0, flags); } gdb_printf (stream, ")"); } @@ -3565,7 +3500,7 @@ get_selections (int *choices, int n_choices, int max_results, args = command_line_input (buffer, prompt, annotation_suffix); if (args == NULL) - error_no_arg (_("one or more choice numbers")); + error_no_arg (_ ("one or more choice numbers")); n_chosen = 0; @@ -3578,18 +3513,17 @@ get_selections (int *choices, int n_choices, int max_results, args = skip_spaces (args); if (*args == '\0' && n_chosen == 0) - error_no_arg (_("one or more choice numbers")); + error_no_arg (_ ("one or more choice numbers")); else if (*args == '\0') break; choice = strtol (args, &args2, 10); - if (args == args2 || choice < 0 - || choice > n_choices + first_choice - 1) - error (_("Argument must be choice number")); + if (args == args2 || choice < 0 || choice > n_choices + first_choice - 1) + error (_ ("Argument must be choice number")); args = args2; if (choice == 0) - error (_("cancelled")); + error (_ ("cancelled")); if (choice < first_choice) { @@ -3616,7 +3550,7 @@ get_selections (int *choices, int n_choices, int max_results, } if (n_chosen > max_results) - error (_("Select no more than %d of the above"), max_results); + error (_ ("Select no more than %d of the above"), max_results); return n_chosen; } @@ -3633,18 +3567,18 @@ static int user_select_syms (struct block_symbol *syms, int nsyms, int max_results) { int i; - int *chosen = XALLOCAVEC (int , nsyms); + int *chosen = XALLOCAVEC (int, nsyms); int n_chosen; int first_choice = (max_results == 1) ? 1 : 2; const char *select_mode = multiple_symbols_select_mode (); if (max_results < 1) - error (_("Request to select 0 symbols!")); + error (_ ("Request to select 0 symbols!")); if (nsyms <= 1) return nsyms; if (select_mode == multiple_symbols_cancel) - error (_("\ + error (_ ("\ canceled because the command is ambiguous\n\ See set/show multiple-symbol.")); @@ -3654,9 +3588,9 @@ See set/show multiple-symbol.")); if (select_mode == multiple_symbols_all && max_results > 1) return nsyms; - gdb_printf (_("[0] cancel\n")); + gdb_printf (_ ("[0] cancel\n")); if (max_results > 1) - gdb_printf (_("[1] all\n")); + gdb_printf (_ ("[1] all\n")); sort_choices (syms, nsyms); @@ -3667,29 +3601,29 @@ See set/show multiple-symbol.")); if (syms[i].symbol->aclass () == LOC_BLOCK) { - struct symtab_and_line sal = - find_function_start_sal (syms[i].symbol, 1); + struct symtab_and_line sal + = find_function_start_sal (syms[i].symbol, 1); gdb_printf ("[%d] ", i + first_choice); ada_print_symbol_signature (gdb_stdout, syms[i].symbol, &type_print_raw_options); if (sal.symtab == NULL) - gdb_printf (_(" at %p[%p]:%d\n"), + gdb_printf (_ (" at %p[%p]:%d\n"), metadata_style.style ().ptr (), nullptr, sal.line); else - gdb_printf - (_(" at %ps:%d\n"), - styled_string (file_name_style.style (), - symtab_to_filename_for_display (sal.symtab)), - sal.line); + gdb_printf ( + _ (" at %ps:%d\n"), + styled_string (file_name_style.style (), + symtab_to_filename_for_display (sal.symtab)), + sal.line); continue; } else { - int is_enumeral = - (syms[i].symbol->aclass () == LOC_CONST - && syms[i].symbol->type () != NULL - && syms[i].symbol->type ()->code () == TYPE_CODE_ENUM); + int is_enumeral + = (syms[i].symbol->aclass () == LOC_CONST + && syms[i].symbol->type () != NULL + && syms[i].symbol->type ()->code () == TYPE_CODE_ENUM); struct symtab *symtab = NULL; if (syms[i].symbol->is_objfile_owned ()) @@ -3700,17 +3634,16 @@ See set/show multiple-symbol.")); gdb_printf ("[%d] ", i + first_choice); ada_print_symbol_signature (gdb_stdout, syms[i].symbol, &type_print_raw_options); - gdb_printf (_(" at %s:%d\n"), + gdb_printf (_ (" at %s:%d\n"), symtab_to_filename_for_display (symtab), syms[i].symbol->line ()); } - else if (is_enumeral - && syms[i].symbol->type ()->name () != NULL) + else if (is_enumeral && syms[i].symbol->type ()->name () != NULL) { gdb_printf (("[%d] "), i + first_choice); - ada_print_type (syms[i].symbol->type (), NULL, - gdb_stdout, -1, 0, &type_print_raw_options); - gdb_printf (_("'(%s) (enumeral)\n"), + ada_print_type (syms[i].symbol->type (), NULL, gdb_stdout, -1, 0, + &type_print_raw_options); + gdb_printf (_ ("'(%s) (enumeral)\n"), syms[i].symbol->print_name ()); } else @@ -3720,14 +3653,11 @@ See set/show multiple-symbol.")); &type_print_raw_options); if (symtab != NULL) - gdb_printf (is_enumeral - ? _(" in %s (enumeral)\n") - : _(" at %s:?\n"), + gdb_printf (is_enumeral ? _ (" in %s (enumeral)\n") + : _ (" at %s:?\n"), symtab_to_filename_for_display (symtab)); else - gdb_printf (is_enumeral - ? _(" (enumeral)\n") - : _(" at ?\n")); + gdb_printf (is_enumeral ? _ (" (enumeral)\n") : _ (" at ?\n")); } } } @@ -3744,17 +3674,16 @@ See set/show multiple-symbol.")); /* See ada-lang.h. */ block_symbol -ada_find_operator_symbol (enum exp_opcode op, bool parse_completion, - int nargs, value *argvec[]) +ada_find_operator_symbol (enum exp_opcode op, bool parse_completion, int nargs, + value *argvec[]) { if (possible_user_operator_p (op, argvec)) { std::vector candidates - = ada_lookup_symbol_list (ada_decoded_op_name (op), - NULL, VAR_DOMAIN); + = ada_lookup_symbol_list (ada_decoded_op_name (op), NULL, VAR_DOMAIN); - int i = ada_resolve_function (candidates, argvec, - nargs, ada_decoded_op_name (op), NULL, + int i = ada_resolve_function (candidates, argvec, nargs, + ada_decoded_op_name (op), NULL, parse_completion); if (i >= 0) return candidates[i]; @@ -3766,8 +3695,7 @@ ada_find_operator_symbol (enum exp_opcode op, bool parse_completion, block_symbol ada_resolve_funcall (struct symbol *sym, const struct block *block, - struct type *context_type, - bool parse_completion, + struct type *context_type, bool parse_completion, int nargs, value *argvec[], innermost_block_tracker *tracker) { @@ -3779,13 +3707,11 @@ ada_resolve_funcall (struct symbol *sym, const struct block *block, i = 0; else { - i = ada_resolve_function - (candidates, - argvec, nargs, - sym->linkage_name (), - context_type, parse_completion); + i = ada_resolve_function (candidates, argvec, nargs, + sym->linkage_name (), context_type, + parse_completion); if (i < 0) - error (_("Could not find a match for %s"), sym->print_name ()); + error (_ ("Could not find a match for %s"), sym->print_name ()); } tracker->update (candidates[i]); @@ -3796,9 +3722,8 @@ ada_resolve_funcall (struct symbol *sym, const struct block *block, enumeration type. */ static int -ada_resolve_enum (std::vector &syms, - const char *name, struct type *context_type, - bool parse_completion) +ada_resolve_enum (std::vector &syms, const char *name, + struct type *context_type, bool parse_completion) { gdb_assert (context_type->code () == TYPE_CODE_ENUM); context_type = ada_check_typedef (context_type); @@ -3811,7 +3736,7 @@ ada_resolve_enum (std::vector &syms, return i; } - error (_("No name '%s' in enumeration type '%s'"), name, + error (_ ("No name '%s' in enumeration type '%s'"), name, ada_type_name (context_type)); } @@ -3819,78 +3744,65 @@ ada_resolve_enum (std::vector &syms, block_symbol ada_resolve_variable (struct symbol *sym, const struct block *block, - struct type *context_type, - bool parse_completion, - int deprocedure_p, - innermost_block_tracker *tracker) + struct type *context_type, bool parse_completion, + int deprocedure_p, innermost_block_tracker *tracker) { std::vector candidates = ada_lookup_symbol_list (sym->linkage_name (), block, VAR_DOMAIN); - if (std::any_of (candidates.begin (), - candidates.end (), - [] (block_symbol &bsym) - { - switch (bsym.symbol->aclass ()) - { - case LOC_REGISTER: - case LOC_ARG: - case LOC_REF_ARG: - case LOC_REGPARM_ADDR: - case LOC_LOCAL: - case LOC_COMPUTED: - return true; - default: - return false; - } - })) + if (std::any_of (candidates.begin (), candidates.end (), + [] (block_symbol &bsym) { + switch (bsym.symbol->aclass ()) + { + case LOC_REGISTER: + case LOC_ARG: + case LOC_REF_ARG: + case LOC_REGPARM_ADDR: + case LOC_LOCAL: + case LOC_COMPUTED: + return true; + default: + return false; + } + })) { /* Types tend to get re-introduced locally, so if there are any local symbols that are not types, first filter out all types. */ - candidates.erase - (std::remove_if - (candidates.begin (), - candidates.end (), - [] (block_symbol &bsym) - { - return bsym.symbol->aclass () == LOC_TYPEDEF; - }), - candidates.end ()); + candidates.erase (std::remove_if ( + candidates.begin (), candidates.end (), + [] (block_symbol &bsym) { + return bsym.symbol->aclass () == LOC_TYPEDEF; + }), + candidates.end ()); } /* Filter out artificial symbols. */ - candidates.erase - (std::remove_if - (candidates.begin (), - candidates.end (), - [] (block_symbol &bsym) - { - return bsym.symbol->is_artificial (); - }), - candidates.end ()); + candidates.erase (std::remove_if ( + candidates.begin (), candidates.end (), + [] (block_symbol &bsym) { + return bsym.symbol->is_artificial (); + }), + candidates.end ()); int i; if (candidates.empty ()) - error (_("No definition found for %s"), sym->print_name ()); + error (_ ("No definition found for %s"), sym->print_name ()); else if (candidates.size () == 1) i = 0; - else if (context_type != nullptr - && context_type->code () == TYPE_CODE_ENUM) + else if (context_type != nullptr && context_type->code () == TYPE_CODE_ENUM) i = ada_resolve_enum (candidates, sym->linkage_name (), context_type, parse_completion); else if (deprocedure_p && !is_nonfunction (candidates)) { - i = ada_resolve_function - (candidates, NULL, 0, - sym->linkage_name (), - context_type, parse_completion); + i = ada_resolve_function (candidates, NULL, 0, sym->linkage_name (), + context_type, parse_completion); if (i < 0) - error (_("Could not find a match for %s"), sym->print_name ()); + error (_ ("Could not find a match for %s"), sym->print_name ()); } else { - gdb_printf (_("Multiple matches for %s\n"), sym->print_name ()); + gdb_printf (_ ("Multiple matches for %s\n"), sym->print_name ()); user_select_syms (candidates.data (), candidates.size (), 1); i = 0; } @@ -3968,8 +3880,7 @@ ada_args_match (struct symbol *func, struct value **actuals, int n_actuals) int i; struct type *func_type = func->type (); - if (func->aclass () == LOC_CONST - && func_type->code () == TYPE_CODE_ENUM) + if (func->aclass () == LOC_CONST && func_type->code () == TYPE_CODE_ENUM) return (n_actuals == 0); else if (func_type == NULL || func_type->code () != TYPE_CODE_FUNC) return 0; @@ -3983,7 +3894,8 @@ ada_args_match (struct symbol *func, struct value **actuals, int n_actuals) return 0; else { - struct type *ftype = ada_check_typedef (func_type->field (i).type ()); + struct type *ftype + = ada_check_typedef (func_type->field (i).type ()); struct type *atype = ada_check_typedef (value_type (actuals[i])); if (!ada_type_match (ftype, atype)) @@ -4023,7 +3935,6 @@ return_match (struct type *func_type, struct type *context_type) return return_type->code () == context_type->code (); } - /* Returns the index in SYMS that contains the symbol for the function (if any) that matches the types of the NARGS arguments in ARGS. If CONTEXT_TYPE is non-null and there is at least one match @@ -4038,13 +3949,12 @@ return_match (struct type *func_type, struct type *context_type) static int ada_resolve_function (std::vector &syms, - struct value **args, int nargs, - const char *name, struct type *context_type, - bool parse_completion) + struct value **args, int nargs, const char *name, + struct type *context_type, bool parse_completion) { int fallback; int k; - int m; /* Number of hits */ + int m; /* Number of hits */ m = 0; /* In the first pass of the loop, we only accept functions matching @@ -4073,7 +3983,7 @@ ada_resolve_function (std::vector &syms, return -1; else if (m > 1 && !parse_completion) { - gdb_printf (_("Multiple matches for %s\n"), name); + gdb_printf (_ ("Multiple matches for %s\n"), name); user_select_syms (syms.data (), m, 1); return 0; } @@ -4184,10 +4094,10 @@ discrete_type_p (struct type *type) static int possible_user_operator_p (enum exp_opcode op, struct value *args[]) { - struct type *type0 = - (args[0] == NULL) ? NULL : ada_check_typedef (value_type (args[0])); - struct type *type1 = - (args[1] == NULL) ? NULL : ada_check_typedef (value_type (args[1])); + struct type *type0 + = (args[0] == NULL) ? NULL : ada_check_typedef (value_type (args[0])); + struct type *type1 + = (args[1] == NULL) ? NULL : ada_check_typedef (value_type (args[1])); if (type0 == NULL) return 0; @@ -4229,11 +4139,10 @@ possible_user_operator_p (enum exp_opcode op, struct value *args[]) case UNOP_LOGICAL_NOT: case UNOP_ABS: return (!numeric_type_p (type0)); - } } - - /* Renaming */ + +/* Renaming */ /* NOTES: @@ -4267,8 +4176,7 @@ possible_user_operator_p (enum exp_opcode op, struct value *args[]) [Currently, however, GCC does not generate subprogram renamings.] */ enum ada_renaming_category -ada_parse_renaming (struct symbol *sym, - const char **renamed_entity, int *len, +ada_parse_renaming (struct symbol *sym, const char **renamed_entity, int *len, const char **renaming_expr) { enum ada_renaming_category kind; @@ -4277,7 +4185,7 @@ ada_parse_renaming (struct symbol *sym, if (sym == NULL) return ADA_NOT_RENAMING; - switch (sym->aclass ()) + switch (sym->aclass ()) { default: return ADA_NOT_RENAMING; @@ -4338,9 +4246,8 @@ ada_read_renaming_var_value (struct symbol *renaming_sym, expression_up expr = parse_exp_1 (&sym_name, 0, block, 0); return evaluate_expression (expr.get ()); } - - /* Evaluation: Function Calls */ +/* Evaluation: Function Calls */ /* Return an lvalue containing the value VAL. This is the identity on lvalues, and otherwise has the side-effect of allocating memory @@ -4349,12 +4256,11 @@ ada_read_renaming_var_value (struct symbol *renaming_sym, static struct value * ensure_lval (struct value *val) { - if (VALUE_LVAL (val) == not_lval - || VALUE_LVAL (val) == lval_internalvar) + if (VALUE_LVAL (val) == not_lval || VALUE_LVAL (val) == lval_internalvar) { int len = ada_check_typedef (value_type (val))->length (); - const CORE_ADDR addr = - value_as_long (value_allocate_space_in_inferior (len)); + const CORE_ADDR addr + = value_as_long (value_allocate_space_in_inferior (len)); VALUE_LVAL (val) = lval_memory; set_value_address (val, addr); @@ -4442,8 +4348,7 @@ ada_value_struct_elt (struct value *arg, const char *name, int no_err) /* We first try to find the searched field in the current type. If not found then let's look in the fixed type. */ - if (!find_struct_field (name, t1, 0, - nullptr, nullptr, nullptr, + if (!find_struct_field (name, t1, 0, nullptr, nullptr, nullptr, nullptr, nullptr)) check_tag = 1; else @@ -4454,16 +4359,15 @@ ada_value_struct_elt (struct value *arg, const char *name, int no_err) /* Convert to fixed type in all cases, so that we have proper offsets to each field in unconstrained record types. */ - t1 = ada_to_fixed_type (ada_get_base_type (t1), NULL, - address, NULL, check_tag); + t1 = ada_to_fixed_type (ada_get_base_type (t1), NULL, address, NULL, + check_tag); /* Resolve the dynamic type as well. */ arg = value_from_contents_and_address (t1, nullptr, address); t1 = value_type (arg); - if (find_struct_field (name, t1, 0, - &field_type, &byte_offset, &bit_offset, - &bit_size, NULL)) + if (find_struct_field (name, t1, 0, &field_type, &byte_offset, + &bit_offset, &bit_size, NULL)) { if (bit_size != 0) { @@ -4483,14 +4387,14 @@ ada_value_struct_elt (struct value *arg, const char *name, int no_err) if (v != NULL || no_err) return v; else - error (_("There is no member named %s."), name); + error (_ ("There is no member named %s."), name); - BadValue: +BadValue: if (no_err) return NULL; else - error (_("Attempt to extract a component of " - "a value that is not a record.")); + error (_ ("Attempt to extract a component of " + "a value that is not a record.")); } /* Return the value ACTUAL, converted to be an appropriate value for a @@ -4503,12 +4407,14 @@ ada_convert_actual (struct value *actual, struct type *formal_type0) { struct type *actual_type = ada_check_typedef (value_type (actual)); struct type *formal_type = ada_check_typedef (formal_type0); - struct type *formal_target = - formal_type->code () == TYPE_CODE_PTR - ? ada_check_typedef (formal_type->target_type ()) : formal_type; - struct type *actual_target = - actual_type->code () == TYPE_CODE_PTR - ? ada_check_typedef (actual_type->target_type ()) : actual_type; + struct type *formal_target + = formal_type->code () == TYPE_CODE_PTR + ? ada_check_typedef (formal_type->target_type ()) + : formal_type; + struct type *actual_target + = actual_type->code () == TYPE_CODE_PTR + ? ada_check_typedef (actual_type->target_type ()) + : actual_type; if (ada_is_array_descriptor_type (formal_target) && actual_target->code () == TYPE_CODE_ARRAY) @@ -4572,7 +4478,6 @@ value_pointer (struct value *value, struct type *type) return addr; } - /* Push a descriptor of type TYPE for array value ARR on the stack at *SP, updating *SP to reflect the new descriptor. Return either an lvalue representing the new descriptor, or (if TYPE is a pointer- @@ -4588,8 +4493,8 @@ make_array_descriptor (struct type *type, struct value *arr) struct value *bounds = allocate_value (bounds_type); int i; - for (i = ada_array_arity (ada_check_typedef (value_type (arr))); - i > 0; i -= 1) + for (i = ada_array_arity (ada_check_typedef (value_type (arr))); i > 0; + i -= 1) { modify_field (value_type (bounds), value_contents_writeable (bounds).data (), @@ -4605,17 +4510,14 @@ make_array_descriptor (struct type *type, struct value *arr) bounds = ensure_lval (bounds); - modify_field (value_type (descriptor), - value_contents_writeable (descriptor).data (), - value_pointer (ensure_lval (arr), - desc_type->field (0).type ()), - fat_pntr_data_bitpos (desc_type), - fat_pntr_data_bitsize (desc_type)); + modify_field ( + value_type (descriptor), value_contents_writeable (descriptor).data (), + value_pointer (ensure_lval (arr), desc_type->field (0).type ()), + fat_pntr_data_bitpos (desc_type), fat_pntr_data_bitsize (desc_type)); modify_field (value_type (descriptor), value_contents_writeable (descriptor).data (), - value_pointer (bounds, - desc_type->field (1).type ()), + value_pointer (bounds, desc_type->field (1).type ()), fat_pntr_bounds_bitpos (desc_type), fat_pntr_bounds_bitsize (desc_type)); @@ -4626,8 +4528,8 @@ make_array_descriptor (struct type *type, struct value *arr) else return descriptor; } - - /* Symbol Cache Module */ + +/* Symbol Cache Module */ /* Performance measurements made as of 2010-01-15 indicate that this cache does bring some noticeable improvements. Depending @@ -4743,8 +4645,8 @@ cache_symbol (const char *name, domain_enum domain, struct symbol *sym, e->domain = domain; e->block = block; } - - /* Symbol Lookup */ + +/* Symbol Lookup */ /* Return the symbol name match type that should be used used when searching for all symbols matching LOOKUP_NAME. @@ -4755,9 +4657,8 @@ cache_symbol (const char *name, domain_enum domain, struct symbol *sym, static symbol_name_match_type name_match_type_from_name (const char *lookup_name) { - return (strstr (lookup_name, "__") == NULL - ? symbol_name_match_type::WILD - : symbol_name_match_type::FULL); + return (strstr (lookup_name, "__") == NULL ? symbol_name_match_type::WILD + : symbol_name_match_type::FULL); } /* Return the result of a standard (literal, C-like) lookup of NAME in @@ -4777,7 +4678,6 @@ standard_lookup (const char *name, const struct block *block, return sym.symbol; } - /* Non-zero iff there is at least one non-function/non-enumeral symbol in the symbol fields of SYMS. We treat enumerals as functions, since they contend in overloading in the same way. */ @@ -4801,11 +4701,9 @@ equiv_types (struct type *type0, struct type *type1) { if (type0 == type1) return 1; - if (type0 == NULL || type1 == NULL - || type0->code () != type1->code ()) + if (type0 == NULL || type1 == NULL || type0->code () != type1->code ()) return 0; - if ((type0->code () == TYPE_CODE_STRUCT - || type0->code () == TYPE_CODE_ENUM) + if ((type0->code () == TYPE_CODE_STRUCT || type0->code () == TYPE_CODE_ENUM) && ada_type_name (type0) != NULL && ada_type_name (type1) != NULL && strcmp (ada_type_name (type0), ada_type_name (type1)) == 0) return 1; @@ -4821,8 +4719,7 @@ lesseq_defined_than (struct symbol *sym0, struct symbol *sym1) { if (sym0 == sym1) return 1; - if (sym0->domain () != sym1->domain () - || sym0->aclass () != sym1->aclass ()) + if (sym0->domain () != sym1->domain () || sym0->aclass () != sym1->aclass ()) return 0; switch (sym0->aclass ()) @@ -4837,15 +4734,15 @@ lesseq_defined_than (struct symbol *sym0, struct symbol *sym1) const char *name1 = sym1->linkage_name (); int len0 = strlen (name0); - return - type0->code () == type1->code () - && (equiv_types (type0, type1) - || (len0 < strlen (name1) && strncmp (name0, name1, len0) == 0 - && startswith (name1 + len0, "___XV"))); + return type0->code () == type1->code () + && (equiv_types (type0, type1) + || (len0 < strlen (name1) + && strncmp (name0, name1, len0) == 0 + && startswith (name1 + len0, "___XV"))); } case LOC_CONST: return sym0->value_longest () == sym1->value_longest () - && equiv_types (sym0->type (), sym1->type ()); + && equiv_types (sym0->type (), sym1->type ()); case LOC_STATIC: { @@ -4864,8 +4761,7 @@ lesseq_defined_than (struct symbol *sym0, struct symbol *sym1) records in RESULT. Do nothing if SYM is a duplicate. */ static void -add_defn_to_vec (std::vector &result, - struct symbol *sym, +add_defn_to_vec (std::vector &result, struct symbol *sym, const struct block *block) { /* Do not try to complete stub types, as the debugger is probably @@ -4912,23 +4808,23 @@ ada_lookup_simple_minsym (const char *name, struct objfile *objfile) symbol_name_matcher_ftype *match_name = ada_get_symbol_name_matcher (lookup_name); - gdbarch_iterate_over_objfiles_in_search_order - (objfile != NULL ? objfile->arch () : target_gdbarch (), - [&result, lookup_name, match_name] (struct objfile *obj) - { - for (minimal_symbol *msymbol : obj->msymbols ()) - { - if (match_name (msymbol->linkage_name (), lookup_name, nullptr) - && msymbol->type () != mst_solib_trampoline) - { - result.minsym = msymbol; - result.objfile = obj; - return 1; - } - } - - return 0; - }, objfile); + gdbarch_iterate_over_objfiles_in_search_order ( + objfile != NULL ? objfile->arch () : target_gdbarch (), + [&result, lookup_name, match_name] (struct objfile *obj) { + for (minimal_symbol *msymbol : obj->msymbols ()) + { + if (match_name (msymbol->linkage_name (), lookup_name, nullptr) + && msymbol->type () != mst_solib_trampoline) + { + result.minsym = msymbol; + result.objfile = obj; + return 1; + } + } + + return 0; + }, + objfile); return result; } @@ -4978,9 +4874,9 @@ ada_identical_enum_types_p (struct type *type1, struct type *type2) ada_remove_trailing_digits (type1->field (i).name (), &len_1); ada_remove_trailing_digits (type2->field (i).name (), &len_2); if (len_1 != len_2 - || strncmp (type1->field (i).name (), - type2->field (i).name (), - len_1) != 0) + || strncmp (type1->field (i).name (), type2->field (i).name (), + len_1) + != 0) return 0; } @@ -5076,11 +4972,11 @@ remove_extra_symbols (std::vector *syms) { for (j = 0; j < syms->size (); j++) { - if (j != i - && !(*syms)[j].symbol->type ()->is_stub () + if (j != i && !(*syms)[j].symbol->type ()->is_stub () && (*syms)[j].symbol->linkage_name () != NULL && strcmp ((*syms)[i].symbol->linkage_name (), - (*syms)[j].symbol->linkage_name ()) == 0) + (*syms)[j].symbol->linkage_name ()) + == 0) remove_p = 1; } } @@ -5089,23 +4985,23 @@ remove_extra_symbols (std::vector *syms) should be identical. */ else if ((*syms)[i].symbol->linkage_name () != NULL - && (*syms)[i].symbol->aclass () == LOC_STATIC - && is_nondebugging_type ((*syms)[i].symbol->type ())) + && (*syms)[i].symbol->aclass () == LOC_STATIC + && is_nondebugging_type ((*syms)[i].symbol->type ())) { for (j = 0; j < syms->size (); j += 1) { - if (i != j - && (*syms)[j].symbol->linkage_name () != NULL + if (i != j && (*syms)[j].symbol->linkage_name () != NULL && strcmp ((*syms)[i].symbol->linkage_name (), - (*syms)[j].symbol->linkage_name ()) == 0 + (*syms)[j].symbol->linkage_name ()) + == 0 && ((*syms)[i].symbol->aclass () == (*syms)[j].symbol->aclass ()) && (*syms)[i].symbol->value_address () - == (*syms)[j].symbol->value_address ()) + == (*syms)[j].symbol->value_address ()) remove_p = 1; } } - + if (remove_p) syms->erase (syms->begin () + i); else @@ -5283,8 +5179,8 @@ remove_irrelevant_renamings (std::vector *syms, is_new_style_renaming = 1; for (j = 0; j < syms->size (); j += 1) if (i != j && (*syms)[j].symbol != NULL - && strncmp (name, (*syms)[j].symbol->linkage_name (), - name_len) == 0 + && strncmp (name, (*syms)[j].symbol->linkage_name (), name_len) + == 0 && block == (*syms)[j].block) (*syms)[j].symbol = NULL; } @@ -5295,10 +5191,10 @@ remove_irrelevant_renamings (std::vector *syms, for (j = k = 0; j < syms->size (); j += 1) if ((*syms)[j].symbol != NULL) - { - (*syms)[k] = (*syms)[j]; - k += 1; - } + { + (*syms)[k] = (*syms)[j]; + k += 1; + } syms->resize (k); return; } @@ -5325,7 +5221,7 @@ remove_irrelevant_renamings (std::vector *syms, while (i < syms->size ()) { if (ada_parse_renaming ((*syms)[i].symbol, NULL, NULL, NULL) - == ADA_OBJECT_RENAMING + == ADA_OBJECT_RENAMING && old_renaming_is_invisible ((*syms)[i].symbol, current_function_name)) syms->erase (syms->begin () + i); @@ -5367,6 +5263,7 @@ struct match_data : resultp (rp) { } + DISABLE_COPY_AND_ASSIGN (match_data); bool operator() (struct block_symbol *bsym); @@ -5393,7 +5290,7 @@ match_data::operator() (struct block_symbol *bsym) found_sym = false; arg_sym = NULL; } - else + else { if (sym->aclass () == LOC_UNRESOLVED) return true; @@ -5424,8 +5321,7 @@ ada_add_block_renamings (std::vector &result, symbol_name_matcher_ftype *name_match = ada_get_symbol_name_matcher (lookup_name); - for (renaming = block_using (block); - renaming != NULL; + for (renaming = block_using (block); renaming != NULL; renaming = renaming->next) { const char *r_name; @@ -5436,8 +5332,7 @@ ada_add_block_renamings (std::vector &result, Currently, symbol lookup in Ada don't use the namespace machinery from C++/Fortran support: skip namespace imports that use them. */ if (renaming->searched - || (renaming->import_src != NULL - && renaming->import_src[0] != '\0') + || (renaming->import_src != NULL && renaming->import_src[0] != '\0') || (renaming->import_dest != NULL && renaming->import_dest[0] != '\0')) continue; @@ -5450,15 +5345,14 @@ ada_add_block_renamings (std::vector &result, the DWARF reader to associate a symbol to this renaming, instead of a name. So, for now, we do something simpler: re-use the C++/Fortran namespace machinery. */ - r_name = (renaming->alias != NULL - ? renaming->alias - : renaming->declaration); + r_name + = (renaming->alias != NULL ? renaming->alias : renaming->declaration); if (name_match (r_name, lookup_name, NULL)) { lookup_name_info decl_lookup_name (renaming->declaration, lookup_name.match_type ()); - ada_add_all_symbols (result, block, decl_lookup_name, domain, - 1, NULL); + ada_add_all_symbols (result, block, decl_lookup_name, domain, 1, + NULL); } renaming->searched = 0; } @@ -5565,11 +5459,8 @@ ada_lookup_name (const lookup_name_info &lookup_name) static void map_matching_symbols (struct objfile *objfile, - const lookup_name_info &lookup_name, - bool is_wild_match, - domain_enum domain, - int global, - match_data &data) + const lookup_name_info &lookup_name, bool is_wild_match, + domain_enum domain, int global, match_data &data) { data.objfile = objfile; objfile->expand_matching_symbols (lookup_name, domain, global, @@ -5578,10 +5469,8 @@ map_matching_symbols (struct objfile *objfile, const int block_kind = global ? GLOBAL_BLOCK : STATIC_BLOCK; for (compunit_symtab *symtab : objfile->compunits ()) { - const struct block *block - = symtab->blockvector ()->block (block_kind); - if (!iterate_over_symbols_terminated (block, lookup_name, - domain, data)) + const struct block *block = symtab->blockvector ()->block (block_kind); + if (!iterate_over_symbols_terminated (block, lookup_name, domain, data)) break; } } @@ -5593,8 +5482,8 @@ map_matching_symbols (struct objfile *objfile, static void add_nonlocal_symbols (std::vector &result, - const lookup_name_info &lookup_name, - domain_enum domain, int global) + const lookup_name_info &lookup_name, domain_enum domain, + int global) { struct match_data data (&result); @@ -5647,10 +5536,8 @@ add_nonlocal_symbols (std::vector &result, static void ada_add_all_symbols (std::vector &result, const struct block *block, - const lookup_name_info &lookup_name, - domain_enum domain, - int full_search, - int *made_global_lookup_p) + const lookup_name_info &lookup_name, domain_enum domain, + int full_search, int *made_global_lookup_p) { struct symbol *sym; @@ -5688,8 +5575,8 @@ ada_add_all_symbols (std::vector &result, already performed this search before. If we have, then return the same result. */ - if (lookup_cached_symbol (ada_lookup_name (lookup_name), - domain, &sym, &block)) + if (lookup_cached_symbol (ada_lookup_name (lookup_name), domain, &sym, + &block)) { if (sym != NULL) add_defn_to_vec (result, sym, block); @@ -5700,7 +5587,7 @@ ada_add_all_symbols (std::vector &result, *made_global_lookup_p = 1; /* Search symbols from all global blocks. */ - + add_nonlocal_symbols (result, lookup_name, domain, 1); /* Now add symbols from all per-file blocks if we've gotten no hits @@ -5727,15 +5614,14 @@ ada_add_all_symbols (std::vector &result, static std::vector ada_lookup_symbol_list_worker (const lookup_name_info &lookup_name, - const struct block *block, - domain_enum domain, + const struct block *block, domain_enum domain, int full_search) { int syms_from_global_search; std::vector results; - ada_add_all_symbols (results, block, lookup_name, - domain, full_search, &syms_from_global_search); + ada_add_all_symbols (results, block, lookup_name, domain, full_search, + &syms_from_global_search); remove_extra_symbols (&results); @@ -5743,8 +5629,8 @@ ada_lookup_symbol_list_worker (const lookup_name_info &lookup_name, cache_symbol (ada_lookup_name (lookup_name), domain, NULL, NULL); if (results.size () == 1 && full_search && syms_from_global_search) - cache_symbol (ada_lookup_name (lookup_name), domain, - results[0].symbol, results[0].block); + cache_symbol (ada_lookup_name (lookup_name), domain, results[0].symbol, + results[0].block); remove_irrelevant_renamings (&results, block); return results; @@ -5774,8 +5660,7 @@ ada_lookup_symbol_list (const char *name, const struct block *block, void ada_lookup_encoded_symbol (const char *name, const struct block *block, - domain_enum domain, - struct block_symbol *info) + domain_enum domain, struct block_symbol *info) { /* Since we already have an encoded name, wrap it in '<>' to force a verbatim match. Otherwise, if the name happens to not look like @@ -5807,7 +5692,6 @@ ada_lookup_symbol (const char *name, const struct block *block0, return candidates[0]; } - /* True iff STR is a possible encoded suffix of a normal Ada name that is to be ignored for matching purposes. Suffixes of parallel names (e.g., XVE) are not included here. Currently, the possible suffixes @@ -5838,7 +5722,7 @@ is_name_suffix (const char *str) while (isdigit (str[0])) str += 1; } - + /* [.$][0-9]+ */ if (str[0] == '.' || str[0] == '$') @@ -5884,13 +5768,12 @@ is_name_suffix (const char *str) #endif /* _E[0-9]+[bs]$ */ - if (len > 3 && str[0] == '_' && str [1] == 'E' && isdigit (str[2])) + if (len > 3 && str[0] == '_' && str[1] == 'E' && isdigit (str[2])) { matching = str + 3; while (isdigit (matching[0])) matching += 1; - if ((matching[0] == 'b' || matching[0] == 's') - && matching [1] == '\0') + if ((matching[0] == 'b' || matching[0] == 's') && matching[1] == '\0') return 1; } @@ -5930,8 +5813,8 @@ is_name_suffix (const char *str) return 1; if (str[3] != 'X') return 0; - if (str[4] == 'F' || str[4] == 'D' || str[4] == 'B' - || str[4] == 'U' || str[4] == 'P') + if (str[4] == 'F' || str[4] == 'D' || str[4] == 'B' || str[4] == 'U' + || str[4] == 'P') return 1; if (str[4] == 'R' && str[5] != 'T') return 1; @@ -5969,7 +5852,7 @@ is_valid_name_for_wild_match (const char *name0) if (decoded_name[0] == '<') return 0; - for (i=0; decoded_name[i] != '\0'; i++) + for (i = 0; decoded_name[i] != '\0'; i++) if (isalpha (decoded_name[i]) && !islower (decoded_name[i])) return 0; @@ -6001,8 +5884,9 @@ advance_wild_match (const char **namep, const char *name0, char target0) else name += 1; } - else if (t1 == '_' && ((name[2] >= 'a' && name[2] <= 'z') - || name[2] == target0)) + else if (t1 == '_' + && ((name[2] >= 'a' && name[2] <= 'z') + || name[2] == target0)) { name += 2; break; @@ -6067,8 +5951,8 @@ wild_match (const char *name, const char *patn) static void ada_add_block_symbols (std::vector &result, const struct block *block, - const lookup_name_info &lookup_name, - domain_enum domain, struct objfile *objfile) + const lookup_name_info &lookup_name, domain_enum domain, + struct objfile *objfile) { struct block_iterator iter; /* A matching argument symbol, if any. */ @@ -6079,8 +5963,7 @@ ada_add_block_symbols (std::vector &result, arg_sym = NULL; found_sym = false; - for (sym = block_iter_match_first (block, lookup_name, &iter); - sym != NULL; + for (sym = block_iter_match_first (block, lookup_name, &iter); sym != NULL; sym = block_iter_match_next (lookup_name, &iter)) { if (symbol_matches_domain (sym->language (), sym->domain (), domain)) @@ -6117,37 +6000,35 @@ ada_add_block_symbols (std::vector &result, size_t name_len = ada_lookup_name.size (); ALL_BLOCK_SYMBOLS (block, iter, sym) - { - if (symbol_matches_domain (sym->language (), - sym->domain (), domain)) - { - int cmp; + { + if (symbol_matches_domain (sym->language (), sym->domain (), domain)) + { + int cmp; - cmp = (int) '_' - (int) sym->linkage_name ()[0]; - if (cmp == 0) - { - cmp = !startswith (sym->linkage_name (), "_ada_"); - if (cmp == 0) - cmp = strncmp (name, sym->linkage_name () + 5, - name_len); - } + cmp = (int) '_' - (int) sym->linkage_name ()[0]; + if (cmp == 0) + { + cmp = !startswith (sym->linkage_name (), "_ada_"); + if (cmp == 0) + cmp = strncmp (name, sym->linkage_name () + 5, name_len); + } - if (cmp == 0 - && is_name_suffix (sym->linkage_name () + name_len + 5)) - { - if (sym->aclass () != LOC_UNRESOLVED) - { - if (sym->is_argument ()) - arg_sym = sym; - else - { - found_sym = true; - add_defn_to_vec (result, sym, block); - } - } - } - } - } + if (cmp == 0 + && is_name_suffix (sym->linkage_name () + name_len + 5)) + { + if (sym->aclass () != LOC_UNRESOLVED) + { + if (sym->is_argument ()) + arg_sym = sym; + else + { + found_sym = true; + add_defn_to_vec (result, sym, block); + } + } + } + } + } /* NOTE: This really shouldn't be needed for _ada_ symbols. They aren't parameters, right? */ @@ -6157,17 +6038,15 @@ ada_add_block_symbols (std::vector &result, } } } - - /* Symbol Completion */ +/* Symbol Completion */ /* See symtab.h. */ bool -ada_lookup_name_info::matches - (const char *sym_name, - symbol_name_match_type match_type, - completion_match_result *comp_match_res) const +ada_lookup_name_info::matches (const char *sym_name, + symbol_name_match_type match_type, + completion_match_result *comp_match_res) const { bool match = false; const char *text = m_encoded_name.c_str (); @@ -6199,7 +6078,8 @@ ada_lookup_name_info::matches angle bracket notation. */ const char *tmp; - for (tmp = sym_name; *tmp != '\0' && !isupper (*tmp); tmp++); + for (tmp = sym_name; *tmp != '\0' && !isupper (*tmp); tmp++) + ; if (*tmp != '\0') match = false; } @@ -6234,7 +6114,6 @@ ada_lookup_name_info::matches match_str = add_angle_brackets (sym_name); else match_str = sym_name; - } comp_match_res->set_match (match_str.c_str ()); @@ -6243,7 +6122,7 @@ ada_lookup_name_info::matches return true; } - /* Field Access */ +/* Field Access */ /* Return non-zero if TYPE is a pointer to the GNAT dispatch table used for tagged types. */ @@ -6351,8 +6230,7 @@ ada_is_tag_type (struct type *type) { const char *name = ada_type_name (type->target_type ()); - return (name != NULL - && strcmp (name, "ada__tags__dispatch_table") == 0); + return (name != NULL && strcmp (name, "ada__tags__dispatch_table") == 0); } } @@ -6400,9 +6278,8 @@ value_tag_from_contents_and_address (struct type *type, if (find_struct_field ("_tag", resolved_type, 0, &tag_type, &tag_byte_offset, NULL, NULL, NULL)) { - const gdb_byte *valaddr1 = ((valaddr == NULL) - ? NULL - : valaddr + tag_byte_offset); + const gdb_byte *valaddr1 + = ((valaddr == NULL) ? NULL : valaddr + tag_byte_offset); CORE_ADDR address1 = (address == 0) ? 0 : address + tag_byte_offset; return value_from_contents_and_address (tag_type, valaddr1, address1); @@ -6453,7 +6330,7 @@ ada_tag_value_at_base_address (struct value *obj) struct type *offset_type = language_lookup_primitive_type (language_def (language_ada), - target_gdbarch(), "storage_offset"); + target_gdbarch (), "storage_offset"); ptr_type = lookup_pointer_type (offset_type); val = value_cast (ptr_type, tag); if (!val) @@ -6565,7 +6442,7 @@ ada_get_tsd_from_tag (struct value *tag) and instead the tsd pointer is stored just before the dispatch table. */ - type = ada_get_tsd_type (current_inferior()); + type = ada_get_tsd_type (current_inferior ()); if (type == NULL) return NULL; type = lookup_pointer_type (lookup_pointer_type (type)); @@ -6683,8 +6560,7 @@ ada_is_parent_field (struct type *type, int field_num) const char *name = ada_check_typedef (type)->field (field_num).name (); return (name != NULL - && (startswith (name, "PARENT") - || startswith (name, "_parent"))); + && (startswith (name, "PARENT") || startswith (name, "_parent"))); } /* True iff field number FIELD_NUM of structure type TYPE is a @@ -6710,10 +6586,9 @@ ada_is_wrapper_field (struct type *type, int field_num) } return (name != NULL - && (startswith (name, "PARENT") - || strcmp (name, "REP") == 0 - || startswith (name, "_parent") - || name[0] == 'S' || name[0] == 'R' || name[0] == 'O')); + && (startswith (name, "PARENT") || strcmp (name, "REP") == 0 + || startswith (name, "_parent") || name[0] == 'S' + || name[0] == 'R' || name[0] == 'O')); } /* True iff field number FIELD_NUM of structure or union type TYPE @@ -6731,8 +6606,7 @@ ada_is_variant_part (struct type *type, int field_num) return (field_type->code () == TYPE_CODE_UNION || (is_dynamic_field (type, field_num) - && (field_type->target_type ()->code () - == TYPE_CODE_UNION))); + && (field_type->target_type ()->code () == TYPE_CODE_UNION))); } /* Assuming that VAR_TYPE is a variant wrapper (type of the variant part) @@ -6797,8 +6671,7 @@ ada_variant_discrim_name (struct type *type0) { if (discrim_start == name + 1) return ""; - if ((discrim_start > name + 3 - && startswith (discrim_start - 3, "___")) + if ((discrim_start > name + 3 && startswith (discrim_start - 3, "___")) || discrim_start[-1] == '.') break; } @@ -6816,7 +6689,7 @@ ada_variant_discrim_name (struct type *type0) Assumes 0m does not occur. */ int -ada_scan_number (const char str[], int k, LONGEST * R, int *new_k) +ada_scan_number (const char str[], int k, LONGEST *R, int *new_k) { ULONGEST RU; @@ -6884,8 +6757,8 @@ ada_in_variant (LONGEST val, struct type *type, int field_num) { LONGEST L, U; - if (!ada_scan_number (name, p + 1, &L, &p) - || name[p] != 'T' || !ada_scan_number (name, p + 1, &U, &p)) + if (!ada_scan_number (name, p + 1, &L, &p) || name[p] != 'T' + || !ada_scan_number (name, p + 1, &U, &p)) return 0; if (val >= L && val <= U) return 1; @@ -6925,8 +6798,8 @@ ada_value_primitive_field (struct value *arg1, int offset, int fieldno, return ada_value_primitive_packed_val (arg1, value_contents (arg1).data (), - offset + bit_pos / 8, - bit_pos % 8, bit_size, type); + offset + bit_pos / 8, bit_pos % 8, + bit_size, type); } else return value_primitive_field (arg1, offset, fieldno, arg_type); @@ -6999,9 +6872,8 @@ ada_value_primitive_field (struct value *arg1, int offset, int fieldno, static int find_struct_field (const char *name, struct type *type, int offset, - struct type **field_type_p, - int *byte_offset_p, int *bit_offset_p, int *bit_size_p, - int *index_p) + struct type **field_type_p, int *byte_offset_p, + int *bit_offset_p, int *bit_size_p, int *index_p) { int i; int parent_offset = -1; @@ -7079,11 +6951,11 @@ find_struct_field (const char *name, struct type *type, int offset, for (j = 0; j < field_type->num_fields (); j += 1) { - if (find_struct_field (name, field_type->field (j).type (), - fld_offset - + field_type->field (j).loc_bitpos () / 8, - field_type_p, byte_offset_p, - bit_offset_p, bit_size_p, index_p)) + if (find_struct_field ( + name, field_type->field (j).type (), + fld_offset + field_type->field (j).loc_bitpos () / 8, + field_type_p, byte_offset_p, bit_offset_p, bit_size_p, + index_p)) return 1; } } @@ -7168,9 +7040,10 @@ ada_search_struct_field (const char *name, struct value *arg, int offset, else if (ada_is_wrapper_field (type, i)) { - struct value *v = /* Do not let indent join lines here. */ + struct value *v = /* Do not let indent join lines here. */ ada_search_struct_field (name, arg, - offset + type->field (i).loc_bitpos () / 8, + offset + + type->field (i).loc_bitpos () / 8, type->field (i).type ()); if (v != NULL) @@ -7181,7 +7054,8 @@ ada_search_struct_field (const char *name, struct value *arg, int offset, { /* PNH: Do we ever get here? See find_struct_field. */ int j; - struct type *field_type = ada_check_typedef (type->field (i).type ()); + struct type *field_type + = ada_check_typedef (type->field (i).type ()); int var_offset = offset + type->field (i).loc_bitpos () / 8; for (j = 0; j < field_type->num_fields (); j += 1) @@ -7214,9 +7088,8 @@ ada_search_struct_field (const char *name, struct value *arg, int offset, return NULL; } -static struct value *ada_index_struct_field_1 (int *, struct value *, - int, struct type *); - +static struct value *ada_index_struct_field_1 (int *, struct value *, int, + struct type *); /* Return field #INDEX in ARG, where the index is that returned by * find_struct_field through its INDEX_P argument. Adjust the address @@ -7230,7 +7103,6 @@ ada_index_struct_field (int index, struct value *arg, int offset, return ada_index_struct_field_1 (&index, arg, offset, type); } - /* Auxiliary function for ada_index_struct_field. Like * ada_index_struct_field, but takes index from *INDEX_P and modifies * *INDEX_P. */ @@ -7248,9 +7120,10 @@ ada_index_struct_field_1 (int *index_p, struct value *arg, int offset, continue; else if (ada_is_wrapper_field (type, i)) { - struct value *v = /* Do not let indent join lines here. */ + struct value *v = /* Do not let indent join lines here. */ ada_index_struct_field_1 (index_p, arg, - offset + type->field (i).loc_bitpos () / 8, + offset + + type->field (i).loc_bitpos () / 8, type->field (i).type ()); if (v != NULL) @@ -7261,7 +7134,7 @@ ada_index_struct_field_1 (int *index_p, struct value *arg, int offset, { /* PNH: Do we ever get here? See ada_search_struct_field, find_struct_field. */ - error (_("Cannot assign this kind of variant record")); + error (_ ("Cannot assign this kind of variant record")); } else if (*index_p == 0) return ada_value_primitive_field (arg, offset, i, type); @@ -7329,8 +7202,8 @@ ada_lookup_struct_elt_type (struct type *type, const char *name, int refok, if (noerr) return NULL; - error (_("Type %s is not a structure or union type"), - type != NULL ? type_as_string (type).c_str () : _("(null)")); + error (_ ("Type %s is not a structure or union type"), + type != NULL ? type_as_string (type).c_str () : _ ("(null)")); } type = to_static_fixed_type (type); @@ -7362,8 +7235,7 @@ ada_lookup_struct_elt_type (struct type *type, const char *name, int refok, else if (ada_is_wrapper_field (type, i)) { - t = ada_lookup_struct_elt_type (type->field (i).type (), name, - 0, 1); + t = ada_lookup_struct_elt_type (type->field (i).type (), name, 0, 1); if (t != NULL) return t; } @@ -7371,7 +7243,8 @@ ada_lookup_struct_elt_type (struct type *type, const char *name, int refok, else if (ada_is_variant_part (type, i)) { int j; - struct type *field_type = ada_check_typedef (type->field (i).type ()); + struct type *field_type + = ada_check_typedef (type->field (i).type ()); for (j = field_type->num_fields () - 1; j >= 0; j -= 1) { @@ -7381,7 +7254,7 @@ ada_lookup_struct_elt_type (struct type *type, const char *name, int refok, if the compiler changes this practice. */ const char *v_field_name = field_type->field (j).name (); - if (v_field_name != NULL + if (v_field_name != NULL && field_name_match (v_field_name, name)) t = field_type->field (j).type (); else @@ -7392,28 +7265,27 @@ ada_lookup_struct_elt_type (struct type *type, const char *name, int refok, return t; } } - } - /* Field not found so far. If this is a tagged type which + /* Field not found so far. If this is a tagged type which has a parent, try finding that field in the parent now. */ - if (parent_offset != -1) - { - struct type *t; + if (parent_offset != -1) + { + struct type *t; - t = ada_lookup_struct_elt_type (type->field (parent_offset).type (), - name, 0, 1); - if (t != NULL) - return t; - } + t = ada_lookup_struct_elt_type (type->field (parent_offset).type (), + name, 0, 1); + if (t != NULL) + return t; + } BadName: if (!noerr) { - const char *name_str = name != NULL ? name : _(""); + const char *name_str = name != NULL ? name : _ (""); - error (_("Type %s has no component named %s"), + error (_ ("Type %s has no component named %s"), type_as_string (type).c_str (), name_str); } @@ -7433,7 +7305,6 @@ is_unchecked_variant (struct type *var_type, struct type *outer_type) return (ada_lookup_struct_elt_type (outer_type, discrim_name, 0, 1) == NULL); } - /* Assuming that VAR_TYPE is the type of a variant part of a record (a union), within OUTER, determine which variant clause (field number in VAR_TYPE, numbering from 0) is applicable. Returns -1 if none are. */ @@ -7466,10 +7337,8 @@ ada_which_variant_applies (struct type *var_type, struct value *outer) return others_clause; } - - - /* Dynamic-Sized Records */ +/* Dynamic-Sized Records */ /* Strategy: The type ostensibly attached to a value with dynamic size (i.e., a size that is not statically recorded in the debugging @@ -7683,7 +7552,7 @@ find_parallel_type_by_descriptive_type (struct type *type, const char *name) if (result_name == NULL) { - warning (_("unexpected null name on descriptive type")); + warning (_ ("unexpected null name on descriptive type")); return NULL; } @@ -7791,8 +7660,8 @@ is_dynamic_field (struct type *templ_type, int field_num) const char *name = templ_type->field (field_num).name (); return name != NULL - && templ_type->field (field_num).type ()->code () == TYPE_CODE_PTR - && strstr (name, "___XVL") != NULL; + && templ_type->field (field_num).type ()->code () == TYPE_CODE_PTR + && strstr (name, "___XVL") != NULL; } /* The index of the variant field of TYPE, or -1 if TYPE does not @@ -7879,8 +7748,8 @@ ada_template_to_fixed_record_type_1 (struct type *type, rtype->set_code (TYPE_CODE_STRUCT); INIT_NONE_SPECIFIC (rtype); rtype->set_num_fields (nfields); - rtype->set_fields - ((struct field *) TYPE_ZALLOC (rtype, nfields * sizeof (struct field))); + rtype->set_fields ((struct field *) + TYPE_ZALLOC (rtype, nfields * sizeof (struct field))); rtype->set_name (ada_type_name (type)); rtype->set_is_fixed_instance (true); @@ -7891,7 +7760,7 @@ ada_template_to_fixed_record_type_1 (struct type *type, for (f = 0; f < nfields; f += 1) { off = align_up (off, field_alignment (type, f)) - + type->field (f).loc_bitpos (); + + type->field (f).loc_bitpos (); rtype->field (f).set_loc_bitpos (off); TYPE_FIELD_BITSIZE (rtype, f) = 0; @@ -7912,9 +7781,9 @@ ada_template_to_fixed_record_type_1 (struct type *type, causes problems because we will end up trying to resolve a type that is currently being constructed. */ - dval = value_from_contents_and_address_unresolved (rtype, - valaddr, - address); + dval + = value_from_contents_and_address_unresolved (rtype, valaddr, + address); rtype = value_type (dval); } else @@ -7934,10 +7803,10 @@ ada_template_to_fixed_record_type_1 (struct type *type, field_type = ada_aligned_type (field_type); } - field_valaddr = cond_offset_host (field_valaddr, - off / TARGET_CHAR_BIT); - field_address = cond_offset_target (field_address, - off / TARGET_CHAR_BIT); + field_valaddr + = cond_offset_host (field_valaddr, off / TARGET_CHAR_BIT); + field_address + = cond_offset_target (field_address, off / TARGET_CHAR_BIT); /* Get the fixed type of the field. Note that, in this case, we do not want to get the real type out of the tag: if @@ -7974,8 +7843,8 @@ ada_template_to_fixed_record_type_1 (struct type *type, rtype->field (f).set_type (type->field (f).type ()); rtype->field (f).set_name (type->field (f).name ()); if (TYPE_FIELD_BITSIZE (type, f) > 0) - fld_bit_len = - TYPE_FIELD_BITSIZE (rtype, f) = TYPE_FIELD_BITSIZE (type, f); + fld_bit_len = TYPE_FIELD_BITSIZE (rtype, f) + = TYPE_FIELD_BITSIZE (type, f); else { struct type *field_type = type->field (f).type (); @@ -7987,14 +7856,15 @@ ada_template_to_fixed_record_type_1 (struct type *type, if (field_type->code () == TYPE_CODE_TYPEDEF) field_type = ada_typedef_target_type (field_type); - fld_bit_len = - ada_check_typedef (field_type)->length () * TARGET_CHAR_BIT; + fld_bit_len + = ada_check_typedef (field_type)->length () * TARGET_CHAR_BIT; } } if (off + fld_bit_len > bit_len) bit_len = off + fld_bit_len; off += fld_bit_len; - rtype->set_length (align_up (bit_len, TARGET_CHAR_BIT) / TARGET_CHAR_BIT); + rtype->set_length (align_up (bit_len, TARGET_CHAR_BIT) + / TARGET_CHAR_BIT); } /* We handle the variant part, if any, at the end because of certain @@ -8019,11 +7889,10 @@ ada_template_to_fixed_record_type_1 (struct type *type, else dval = dval0; - branch_type = - to_fixed_variant_branch_type - (type->field (variant_field).type (), - cond_offset_host (valaddr, off / TARGET_CHAR_BIT), - cond_offset_target (address, off / TARGET_CHAR_BIT), dval); + branch_type = to_fixed_variant_branch_type ( + type->field (variant_field).type (), + cond_offset_host (valaddr, off / TARGET_CHAR_BIT), + cond_offset_target (address, off / TARGET_CHAR_BIT), dval); if (branch_type == NULL) { for (f = variant_field + 1; f < rtype->num_fields (); f += 1) @@ -8034,13 +7903,13 @@ ada_template_to_fixed_record_type_1 (struct type *type, { rtype->field (variant_field).set_type (branch_type); rtype->field (variant_field).set_name ("S"); - fld_bit_len = - rtype->field (variant_field).type ()->length () * TARGET_CHAR_BIT; + fld_bit_len = rtype->field (variant_field).type ()->length () + * TARGET_CHAR_BIT; if (off + fld_bit_len > bit_len) bit_len = off + fld_bit_len; - rtype->set_length - (align_up (bit_len, TARGET_CHAR_BIT) / TARGET_CHAR_BIT); + rtype->set_length (align_up (bit_len, TARGET_CHAR_BIT) + / TARGET_CHAR_BIT); } } @@ -8053,10 +7922,10 @@ ada_template_to_fixed_record_type_1 (struct type *type, if (type->length () <= 0) { if (rtype->name ()) - warning (_("Invalid type size for `%s' detected: %s."), + warning (_ ("Invalid type size for `%s' detected: %s."), rtype->name (), pulongest (type->length ())); else - warning (_("Invalid type size for detected: %s."), + warning (_ ("Invalid type size for detected: %s."), pulongest (type->length ())); } else @@ -8072,8 +7941,8 @@ static struct type * template_to_fixed_record_type (struct type *type, const gdb_byte *valaddr, CORE_ADDR address, struct value *dval0) { - return ada_template_to_fixed_record_type_1 (type, valaddr, - address, dval0, 1); + return ada_template_to_fixed_record_type_1 (type, valaddr, address, dval0, + 1); } /* An ordinary record type in which ___XVL-convention fields and @@ -8132,9 +8001,8 @@ template_to_static_fixed_type (struct type *type0) INIT_NONE_SPECIFIC (type); type->set_num_fields (nfields); - field *fields = - ((struct field *) - TYPE_ALLOC (type, nfields * sizeof (struct field))); + field *fields = ((struct field *) TYPE_ALLOC ( + type, nfields * sizeof (struct field))); memcpy (fields, type0->fields (), sizeof (struct field) * nfields); type->set_fields (fields); @@ -8185,8 +8053,8 @@ to_record_with_fixed_variant_part (struct type *type, const gdb_byte *valaddr, INIT_NONE_SPECIFIC (rtype); rtype->set_num_fields (nfields); - field *fields = - (struct field *) TYPE_ALLOC (rtype, nfields * sizeof (struct field)); + field *fields + = (struct field *) TYPE_ALLOC (rtype, nfields * sizeof (struct field)); memcpy (fields, type->fields (), sizeof (struct field) * nfields); rtype->set_fields (fields); @@ -8194,14 +8062,13 @@ to_record_with_fixed_variant_part (struct type *type, const gdb_byte *valaddr, rtype->set_is_fixed_instance (true); rtype->set_length (type->length ()); - branch_type = to_fixed_variant_branch_type - (type->field (variant_field).type (), - cond_offset_host (valaddr, - type->field (variant_field).loc_bitpos () - / TARGET_CHAR_BIT), - cond_offset_target (address, - type->field (variant_field).loc_bitpos () - / TARGET_CHAR_BIT), dval); + branch_type = to_fixed_variant_branch_type ( + type->field (variant_field).type (), + cond_offset_host (valaddr, type->field (variant_field).loc_bitpos () + / TARGET_CHAR_BIT), + cond_offset_target (address, type->field (variant_field).loc_bitpos () + / TARGET_CHAR_BIT), + dval); if (branch_type == NULL) { int f; @@ -8259,15 +8126,13 @@ to_fixed_record_type (struct type *type0, const gdb_byte *valaddr, { if (dval == NULL && valaddr == NULL && address == 0) return type0; - return to_record_with_fixed_variant_part (type0, valaddr, address, - dval); + return to_record_with_fixed_variant_part (type0, valaddr, address, dval); } else { type0->set_is_fixed_instance (true); return type0; } - } /* An ordinary record type (with fixed-length fields) that describes @@ -8297,18 +8162,17 @@ to_fixed_variant_branch_type (struct type *var_type0, const gdb_byte *valaddr, var_type = templ_type; if (is_unchecked_variant (var_type, value_type (dval))) - return var_type0; + return var_type0; which = ada_which_variant_applies (var_type, dval); if (which < 0) return empty_record (var_type); else if (is_dynamic_field (var_type, which)) - return to_fixed_record_type - (var_type->field (which).type ()->target_type(), valaddr, address, dval); + return to_fixed_record_type ( + var_type->field (which).type ()->target_type (), valaddr, address, dval); else if (variant_field_index (var_type->field (which).type ()) >= 0) - return - to_fixed_record_type - (var_type->field (which).type (), valaddr, address, dval); + return to_fixed_record_type (var_type->field (which).type (), valaddr, + address, dval); else return var_type->field (which).type (); } @@ -8411,7 +8275,7 @@ to_fixed_array_type (struct type *type0, struct value *dval, { type0 = decode_constrained_packed_array_type (type0); if (type0 == nullptr) - error (_("could not decode constrained packed array type")); + error (_ ("could not decode constrained packed array type")); } index_type_desc = ada_find_parallel_type (type0, xa_suffix); @@ -8473,8 +8337,8 @@ to_fixed_array_type (struct type *type0, struct value *dval, if (elt_type0 == elt_type && !constrained_packed_array_p) result = type0; else - result = create_array_type (alloc_type_copy (type0), - elt_type, type0->index_type ()); + result = create_array_type (alloc_type_copy (type0), elt_type, + type0->index_type ()); } else { @@ -8496,17 +8360,17 @@ to_fixed_array_type (struct type *type0, struct value *dval, the elements of an array of a tagged type should all be of the same type specified in the debugging info. No need to consult the object tag. */ - result = - ada_to_fixed_type (ada_check_typedef (elt_type0), 0, 0, dval, 1); + result + = ada_to_fixed_type (ada_check_typedef (elt_type0), 0, 0, dval, 1); elt_type0 = type0; for (i = index_type_desc->num_fields () - 1; i >= 0; i -= 1) { - struct type *range_type = - to_fixed_range_type (index_type_desc->field (i).type (), dval); + struct type *range_type + = to_fixed_range_type (index_type_desc->field (i).type (), dval); - result = create_array_type (alloc_type_copy (elt_type0), - result, range_type); + result = create_array_type (alloc_type_copy (elt_type0), result, + range_type); elt_type0 = elt_type0->target_type (); } } @@ -8535,7 +8399,6 @@ to_fixed_array_type (struct type *type0, struct value *dval, return result; } - /* A standard type (containing no dynamically sized components) corresponding to TYPE for the value (TYPE, VALADDR, ADDRESS) DVAL describes a record containing any discriminants used in TYPE0, @@ -8547,10 +8410,10 @@ to_fixed_array_type (struct type *type0, struct value *dval, type. However, when ADDRESS is null, we cannot use it to determine the location of the tag, and therefore compute the tagged type's actual type. So we return the tagged type without consulting the tag. */ - + static struct type * ada_to_fixed_type_1 (struct type *type, const gdb_byte *valaddr, - CORE_ADDR address, struct value *dval, int check_tag) + CORE_ADDR address, struct value *dval, int check_tag) { type = ada_check_typedef (type); @@ -8565,8 +8428,8 @@ ada_to_fixed_type_1 (struct type *type, const gdb_byte *valaddr, case TYPE_CODE_STRUCT: { struct type *static_type = to_static_fixed_type (type); - struct type *fixed_record_type = - to_fixed_record_type (type, valaddr, address, NULL); + struct type *fixed_record_type + = to_fixed_record_type (type, valaddr, address, NULL); /* If STATIC_TYPE is a tagged type and we know the object's address, then we can determine its tag, and compute the object's actual @@ -8577,21 +8440,18 @@ ada_to_fixed_type_1 (struct type *type, const gdb_byte *valaddr, if (check_tag && address != 0 && ada_is_tagged_type (static_type, 0)) { - struct value *tag = - value_tag_from_contents_and_address - (fixed_record_type, - valaddr, - address); + struct value *tag + = value_tag_from_contents_and_address (fixed_record_type, + valaddr, address); struct type *real_type = type_from_tag (tag); - struct value *obj = - value_from_contents_and_address (fixed_record_type, - valaddr, - address); + struct value *obj + = value_from_contents_and_address (fixed_record_type, valaddr, + address); fixed_record_type = value_type (obj); if (real_type != NULL) - return to_fixed_record_type - (real_type, NULL, - value_address (ada_tag_value_at_base_address (obj)), NULL); + return to_fixed_record_type ( + real_type, NULL, + value_address (ada_tag_value_at_base_address (obj)), NULL); } /* Check to see if there is a parallel ___XVZ variable. @@ -8617,8 +8477,8 @@ ada_to_fixed_type_1 (struct type *type, const gdb_byte *valaddr, what went wrong (Eg: the variable might have been optimized out). */ throw_error (except.error, - _("unable to read value of %s (%s)"), - xvz_name, except.what ()); + _ ("unable to read value of %s (%s)"), xvz_name, + except.what ()); } if (xvz_found && fixed_record_type->length () != size) @@ -8686,8 +8546,8 @@ ada_to_fixed_type (struct type *type, const gdb_byte *valaddr, CORE_ADDR address, struct value *dval, int check_tag) { - struct type *fixed_type = - ada_to_fixed_type_1 (type, valaddr, address, dval, check_tag); + struct type *fixed_type + = ada_to_fixed_type_1 (type, valaddr, address, dval, check_tag); /* If TYPE is a typedef and its target type is the same as the FIXED_TYPE, then preserve the typedef layer. @@ -8803,8 +8663,7 @@ ada_check_typedef (struct type *type) return type; type = check_typedef (type); - if (type == NULL || type->code () != TYPE_CODE_ENUM - || !type->is_stub () + if (type == NULL || type->code () != TYPE_CODE_ENUM || !type->is_stub () || type->name () == NULL) return type; else @@ -8863,29 +8722,17 @@ ada_to_fixed_value (struct value *val) val = ada_to_fixed_value_create (value_type (val), value_address (val), val); return val; } - /* Attributes */ /* Table mapping attribute numbers to names. NOTE: Keep up to date with enum ada_attribute definition in ada-lang.h. */ -static const char * const attribute_names[] = { - "", - - "first", - "last", - "length", - "image", - "max", - "min", - "modulus", - "pos", - "size", - "tag", - "val", - 0 -}; +static const char *const attribute_names[] + = { "", + + "first", "last", "length", "image", "max", "min", + "modulus", "pos", "size", "tag", "val", 0 }; static const char * ada_attribute_name (enum exp_opcode n) @@ -8905,20 +8752,19 @@ pos_atr (struct value *arg) struct type *type = value_type (val); if (!discrete_type_p (type)) - error (_("'POS only defined on discrete types")); + error (_ ("'POS only defined on discrete types")); - gdb::optional result = discrete_position (type, value_as_long (val)); + gdb::optional result + = discrete_position (type, value_as_long (val)); if (!result.has_value ()) - error (_("enumeration value is invalid: can't find 'POS")); + error (_ ("enumeration value is invalid: can't find 'POS")); return *result; } struct value * -ada_pos_atr (struct type *expect_type, - struct expression *exp, - enum noside noside, enum exp_opcode op, - struct value *arg) +ada_pos_atr (struct type *expect_type, struct expression *exp, + enum noside noside, enum exp_opcode op, struct value *arg) { struct type *type = builtin_type (exp->gdbarch)->builtin_int; if (noside == EVAL_AVOID_SIDE_EFFECTS) @@ -8937,7 +8783,7 @@ val_atr (struct type *type, LONGEST val) if (type->code () == TYPE_CODE_ENUM) { if (val < 0 || val >= type->num_fields ()) - error (_("argument to 'VAL out of range")); + error (_ ("argument to 'VAL out of range")); val = type->field (val).loc_enumval (); } return value_from_longest (type, val); @@ -8950,15 +8796,14 @@ ada_val_atr (enum noside noside, struct type *type, struct value *arg) return value_zero (type, not_lval); if (!discrete_type_p (type)) - error (_("'VAL only defined on discrete types")); + error (_ ("'VAL only defined on discrete types")); if (!integer_type_p (value_type (arg))) - error (_("'VAL requires integral argument")); + error (_ ("'VAL requires integral argument")); return val_atr (type, value_as_long (arg)); } - - /* Evaluation */ +/* Evaluation */ /* True if TYPE appears to be an Ada character type. [At the moment, this is true only for Character and Wide_Character; @@ -8973,7 +8818,7 @@ ada_is_character_type (struct type *type) and don't check any further. */ if (type->code () == TYPE_CODE_CHAR) return true; - + /* Otherwise, assume it's a character type iff it is a discrete type with a known character type name. */ name = ada_type_name (type); @@ -8992,8 +8837,7 @@ bool ada_is_string_type (struct type *type) { type = ada_check_typedef (type); - if (type != NULL - && type->code () != TYPE_CODE_PTR + if (type != NULL && type->code () != TYPE_CODE_PTR && (ada_is_simple_array_type (type) || ada_is_array_descriptor_type (type)) && ada_array_arity (type) == 1) @@ -9029,8 +8873,7 @@ ada_is_aligner_type (struct type *type) if (!trust_pad_over_xvs && ada_find_parallel_type (type, "___XVS") != NULL) return 0; - return (type->code () == TYPE_CODE_STRUCT - && type->num_fields () == 1 + return (type->code () == TYPE_CODE_STRUCT && type->num_fields () == 1 && strcmp (type->field (0).name (), "F") == 0); } @@ -9062,8 +8905,7 @@ ada_get_base_type (struct type *raw_type) return raw_type; real_type_namer = ada_find_parallel_type (raw_type, "___XVS"); - if (real_type_namer == NULL - || real_type_namer->code () != TYPE_CODE_STRUCT + if (real_type_namer == NULL || real_type_namer->code () != TYPE_CODE_STRUCT || real_type_namer->num_fields () != 1) return raw_type; @@ -9094,7 +8936,6 @@ ada_aligned_type (struct type *type) return ada_get_base_type (type); } - /* The address of the aligned value in an object at address VALADDR having type TYPE. Assumes ada_is_aligner_type (TYPE). */ @@ -9102,15 +8943,14 @@ const gdb_byte * ada_aligned_value_addr (struct type *type, const gdb_byte *valaddr) { if (ada_is_aligner_type (type)) - return ada_aligned_value_addr - (type->field (0).type (), - valaddr + type->field (0).loc_bitpos () / TARGET_CHAR_BIT); + return ada_aligned_value_addr (type->field (0).type (), + valaddr + + type->field (0).loc_bitpos () + / TARGET_CHAR_BIT); else return valaddr; } - - /* The printed representation of an enumeration literal with encoded name NAME. The value is good to the next call of ada_enum_name. */ const char * @@ -9213,8 +9053,8 @@ unwrap_value (struct value *val) } else { - struct type *raw_real_type = - ada_check_typedef (ada_get_base_type (type)); + struct type *raw_real_type + = ada_check_typedef (ada_get_base_type (type)); /* If there is no parallel XVS or XVE type, then the value is already unwrapped. Return it without further modification. */ @@ -9222,11 +9062,10 @@ unwrap_value (struct value *val) && ada_find_parallel_type (type, "___XVE") == NULL) return val; - return - coerce_unspec_val_to_type - (val, ada_to_fixed_type (raw_real_type, 0, - value_address (val), - NULL, 1)); + return coerce_unspec_val_to_type (val, + ada_to_fixed_type (raw_real_type, 0, + value_address (val), + NULL, 1)); } } @@ -9240,9 +9079,8 @@ ada_same_array_size_p (struct type *t1, struct type *t2) /* Get the array bounds in order to verify that the size of the two arrays match. */ - if (!get_array_bounds (t1, &lo1, &hi1) - || !get_array_bounds (t2, &lo2, &hi2)) - error (_("unable to determine array bounds")); + if (!get_array_bounds (t1, &lo1, &hi1) || !get_array_bounds (t2, &lo2, &hi2)) + error (_ ("unable to determine array bounds")); /* To make things easier for size comparison, normalize a bit the case of empty arrays by making sure that the difference @@ -9279,7 +9117,7 @@ ada_promote_array_of_integrals (struct type *type, struct value *val) > value_type (val)->target_type ()->length ()); if (!get_array_bounds (type, &lo, &hi)) - error (_("unable to determine array bounds")); + error (_ ("unable to determine array bounds")); value *res = allocate_value (type); gdb::array_view res_contents = value_contents_writeable (res); @@ -9290,7 +9128,8 @@ ada_promote_array_of_integrals (struct type *type, struct value *val) struct value *elt = value_cast (elt_type, value_subscript (val, lo + i)); int elt_len = elt_type->length (); - copy (value_contents_all (elt), res_contents.slice (elt_len * i, elt_len)); + copy (value_contents_all (elt), + res_contents.slice (elt_len * i, elt_len)); } return res; @@ -9310,22 +9149,21 @@ coerce_for_assign (struct type *type, struct value *val) type2 = ada_check_typedef (type2); type = ada_check_typedef (type); - if (type2->code () == TYPE_CODE_PTR - && type->code () == TYPE_CODE_ARRAY) + if (type2->code () == TYPE_CODE_PTR && type->code () == TYPE_CODE_ARRAY) { val = ada_value_ind (val); type2 = value_type (val); } - if (type2->code () == TYPE_CODE_ARRAY - && type->code () == TYPE_CODE_ARRAY) + if (type2->code () == TYPE_CODE_ARRAY && type->code () == TYPE_CODE_ARRAY) { if (!ada_same_array_size_p (type, type2)) - error (_("cannot assign arrays of different length")); + error (_ ("cannot assign arrays of different length")); if (is_integral_type (type->target_type ()) && is_integral_type (type2->target_type ()) - && type2->target_type ()->length () < type->target_type ()->length ()) + && type2->target_type ()->length () + < type->target_type ()->length ()) { /* Allow implicit promotion of the array elements to a wider type. */ @@ -9333,7 +9171,7 @@ coerce_for_assign (struct type *type, struct value *val) } if (type2->target_type ()->length () != type->target_type ()->length ()) - error (_("Incompatible types in assignment")); + error (_ ("Incompatible types in assignment")); deprecated_set_value_type (val, type); } return val; @@ -9351,8 +9189,7 @@ ada_value_binop (struct value *arg1, struct value *arg2, enum exp_opcode op) type1 = get_base_type (ada_check_typedef (value_type (arg1))); type2 = get_base_type (ada_check_typedef (value_type (arg2))); - if (type1->code () != TYPE_CODE_INT - || type2->code () != TYPE_CODE_INT) + if (type1->code () != TYPE_CODE_INT || type2->code () != TYPE_CODE_INT) return value_binop (arg1, arg2, op); switch (op) @@ -9379,7 +9216,7 @@ ada_value_binop (struct value *arg1, struct value *arg2, enum exp_opcode op) name = "rem"; } - error (_("second operand of %s must not be zero."), name); + error (_ ("second operand of %s must not be zero."), name); } if (type1->is_unsigned () || op == BINOP_MOD) @@ -9405,8 +9242,8 @@ ada_value_binop (struct value *arg1, struct value *arg2, enum exp_opcode op) val = allocate_value (type1); store_unsigned_integer (value_contents_raw (val).data (), - value_type (val)->length (), - type_byte_order (type1), v); + value_type (val)->length (), type_byte_order (type1), + v); return val; } @@ -9431,14 +9268,14 @@ ada_value_equal (struct value *arg1, struct value *arg2) if (arg1_type->code () != TYPE_CODE_ARRAY || arg2_type->code () != TYPE_CODE_ARRAY) - error (_("Attempt to compare array with non-array")); + error (_ ("Attempt to compare array with non-array")); /* FIXME: The following works only for types whose representations use all bits (no padding or undefined bits) and do not have user-defined equality. */ return (arg1_type->length () == arg2_type->length () && memcmp (value_contents (arg1).data (), - value_contents (arg2).data (), - arg1_type->length ()) == 0); + value_contents (arg2).data (), arg1_type->length ()) + == 0); } return value_equal (arg1, arg2); } @@ -9486,8 +9323,7 @@ assign_component (struct value *container, struct value *lhs, LONGEST index, ag_op->assign_aggregate (container, elt, exp); else value_assign_to_component (container, elt, - arg->evaluate (nullptr, exp, - EVAL_NORMAL)); + arg->evaluate (nullptr, exp, EVAL_NORMAL)); } bool @@ -9502,16 +9338,16 @@ ada_aggregate_component::uses_objfile (struct objfile *objfile) void ada_aggregate_component::dump (ui_file *stream, int depth) { - gdb_printf (stream, _("%*sAggregate\n"), depth, ""); + gdb_printf (stream, _ ("%*sAggregate\n"), depth, ""); for (const auto &item : m_components) item->dump (stream, depth + 1); } void -ada_aggregate_component::assign (struct value *container, - struct value *lhs, struct expression *exp, - std::vector &indices, - LONGEST low, LONGEST high) +ada_aggregate_component::assign (struct value *container, struct value *lhs, + struct expression *exp, + std::vector &indices, LONGEST low, + LONGEST high) { for (auto &item : m_components) item->assign (container, lhs, exp, indices, low, high); @@ -9532,7 +9368,7 @@ ada_aggregate_operation::assign_aggregate (struct value *container, container = ada_coerce_to_simple_array (container); lhs = ada_coerce_ref (lhs); if (!deprecated_value_modifiable (lhs)) - error (_("Left operand of assignment is not a modifiable lvalue.")); + error (_ ("Left operand of assignment is not a modifiable lvalue.")); lhs_type = check_typedef (value_type (lhs)); if (ada_is_direct_array_type (lhs_type)) @@ -9548,14 +9384,14 @@ ada_aggregate_operation::assign_aggregate (struct value *container, high_index = num_visible_fields (lhs_type) - 1; } else - error (_("Left-hand side must be array or record.")); + error (_ ("Left-hand side must be array or record.")); std::vector indices (4); indices[0] = indices[1] = low_index - 1; indices[2] = indices[3] = high_index + 1; - std::get<0> (m_storage)->assign (container, lhs, exp, indices, - low_index, high_index); + std::get<0> (m_storage)->assign (container, lhs, exp, indices, low_index, + high_index); return container; } @@ -9569,8 +9405,7 @@ ada_positional_component::uses_objfile (struct objfile *objfile) void ada_positional_component::dump (ui_file *stream, int depth) { - gdb_printf (stream, _("%*sPositional, index = %d\n"), - depth, "", m_index); + gdb_printf (stream, _ ("%*sPositional, index = %d\n"), depth, "", m_index); m_op->dump (stream, depth + 1); } @@ -9579,15 +9414,15 @@ ada_positional_component::dump (ui_file *stream, int depth) LOW, where HIGH is the upper bound. Record the position in INDICES. CONTAINER is as for assign_aggregate. */ void -ada_positional_component::assign (struct value *container, - struct value *lhs, struct expression *exp, - std::vector &indices, - LONGEST low, LONGEST high) +ada_positional_component::assign (struct value *container, struct value *lhs, + struct expression *exp, + std::vector &indices, LONGEST low, + LONGEST high) { LONGEST ind = m_index + low; if (ind - 1 == high) - warning (_("Extra components in aggregate ignored.")); + warning (_ ("Extra components in aggregate ignored.")); if (ind <= high) { add_component_interval (ind, ind, indices); @@ -9604,24 +9439,21 @@ ada_discrete_range_association::uses_objfile (struct objfile *objfile) void ada_discrete_range_association::dump (ui_file *stream, int depth) { - gdb_printf (stream, _("%*sDiscrete range:\n"), depth, ""); + gdb_printf (stream, _ ("%*sDiscrete range:\n"), depth, ""); m_low->dump (stream, depth + 1); m_high->dump (stream, depth + 1); } void -ada_discrete_range_association::assign (struct value *container, - struct value *lhs, - struct expression *exp, - std::vector &indices, - LONGEST low, LONGEST high, - operation_up &op) +ada_discrete_range_association::assign ( + struct value *container, struct value *lhs, struct expression *exp, + std::vector &indices, LONGEST low, LONGEST high, operation_up &op) { LONGEST lower = value_as_long (m_low->evaluate (nullptr, exp, EVAL_NORMAL)); LONGEST upper = value_as_long (m_high->evaluate (nullptr, exp, EVAL_NORMAL)); if (lower <= upper && (lower < low || upper > high)) - error (_("Index in component association out of bounds.")); + error (_ ("Index in component association out of bounds.")); add_component_interval (lower, upper, indices); while (lower <= upper) @@ -9640,17 +9472,15 @@ ada_name_association::uses_objfile (struct objfile *objfile) void ada_name_association::dump (ui_file *stream, int depth) { - gdb_printf (stream, _("%*sName:\n"), depth, ""); + gdb_printf (stream, _ ("%*sName:\n"), depth, ""); m_val->dump (stream, depth + 1); } void -ada_name_association::assign (struct value *container, - struct value *lhs, +ada_name_association::assign (struct value *container, struct value *lhs, struct expression *exp, - std::vector &indices, - LONGEST low, LONGEST high, - operation_up &op) + std::vector &indices, LONGEST low, + LONGEST high, operation_up &op) { int index; @@ -9670,14 +9500,14 @@ ada_name_association::assign (struct value *container, ada_var_value_operation *vvo = dynamic_cast (m_val.get ()); if (vvo != nullptr) - error (_("Invalid record component association.")); + error (_ ("Invalid record component association.")); name = vvo->get_symbol ()->natural_name (); } index = 0; - if (! find_struct_field (name, value_type (lhs), 0, - NULL, NULL, NULL, NULL, &index)) - error (_("Unknown component name: %s."), name); + if (!find_struct_field (name, value_type (lhs), 0, NULL, NULL, NULL, + NULL, &index)) + error (_ ("Unknown component name: %s."), name); } add_component_interval (index, index, indices); @@ -9698,7 +9528,7 @@ ada_choices_component::uses_objfile (struct objfile *objfile) void ada_choices_component::dump (ui_file *stream, int depth) { - gdb_printf (stream, _("%*sChoices:\n"), depth, ""); + gdb_printf (stream, _ ("%*sChoices:\n"), depth, ""); m_op->dump (stream, depth + 1); for (const auto &item : m_assocs) item->dump (stream, depth + 1); @@ -9709,10 +9539,10 @@ ada_choices_component::dump (ui_file *stream, int depth) the allowable indices are LOW..HIGH. Record the indices assigned to in INDICES. CONTAINER is as for assign_aggregate. */ void -ada_choices_component::assign (struct value *container, - struct value *lhs, struct expression *exp, - std::vector &indices, - LONGEST low, LONGEST high) +ada_choices_component::assign (struct value *container, struct value *lhs, + struct expression *exp, + std::vector &indices, LONGEST low, + LONGEST high) { for (auto &item : m_assocs) item->assign (container, lhs, exp, indices, low, high, m_op); @@ -9727,7 +9557,7 @@ ada_others_component::uses_objfile (struct objfile *objfile) void ada_others_component::dump (ui_file *stream, int depth) { - gdb_printf (stream, _("%*sOthers:\n"), depth, ""); + gdb_printf (stream, _ ("%*sOthers:\n"), depth, ""); m_op->dump (stream, depth + 1); } @@ -9736,10 +9566,10 @@ ada_others_component::dump (ui_file *stream, int depth) have not been previously assigned. The index intervals already assigned are in INDICES. CONTAINER is as for assign_aggregate. */ void -ada_others_component::assign (struct value *container, - struct value *lhs, struct expression *exp, - std::vector &indices, - LONGEST low, LONGEST high) +ada_others_component::assign (struct value *container, struct value *lhs, + struct expression *exp, + std::vector &indices, LONGEST low, + LONGEST high) { int num_indices = indices.size (); for (int i = 0; i < num_indices - 2; i += 2) @@ -9751,8 +9581,7 @@ ada_others_component::assign (struct value *container, struct value * ada_assign_operation::evaluate (struct type *expect_type, - struct expression *exp, - enum noside noside) + struct expression *exp, enum noside noside) { value *arg1 = std::get<0> (m_storage)->evaluate (nullptr, exp, noside); @@ -9791,33 +9620,34 @@ ada_assign_operation::evaluate (struct type *expect_type, [ INDICES[0] .. INDICES[1] ],... The resulting intervals do not overlap. */ static void -add_component_interval (LONGEST low, LONGEST high, +add_component_interval (LONGEST low, LONGEST high, std::vector &indices) { int i, j; int size = indices.size (); - for (i = 0; i < size; i += 2) { - if (high >= indices[i] && low <= indices[i + 1]) - { - int kh; + for (i = 0; i < size; i += 2) + { + if (high >= indices[i] && low <= indices[i + 1]) + { + int kh; + + for (kh = i + 2; kh < size; kh += 2) + if (high < indices[kh]) + break; + if (low < indices[i]) + indices[i] = low; + indices[i + 1] = indices[kh - 1]; + if (high > indices[i + 1]) + indices[i + 1] = high; + memcpy (indices.data () + i + 2, indices.data () + kh, size - kh); + indices.resize (kh - i - 2); + return; + } + else if (high < indices[i]) + break; + } - for (kh = i + 2; kh < size; kh += 2) - if (high < indices[kh]) - break; - if (low < indices[i]) - indices[i] = low; - indices[i + 1] = indices[kh - 1]; - if (high > indices[i + 1]) - indices[i + 1] = high; - memcpy (indices.data () + i + 2, indices.data () + kh, size - kh); - indices.resize (kh - i - 2); - return; - } - else if (high < indices[i]) - break; - } - indices.resize (indices.size () + 2); for (j = indices.size () - 1; j >= i + 2; j -= 1) indices[j] = indices[j - 2]; @@ -10095,27 +9925,22 @@ ada_value_cast (struct type *type, struct value *arg2) static value * eval_ternop_in_range (struct type *expect_type, struct expression *exp, - enum noside noside, - value *arg1, value *arg2, value *arg3) + enum noside noside, value *arg1, value *arg2, + value *arg3) { binop_promote (exp->language_defn, exp->gdbarch, &arg1, &arg2); binop_promote (exp->language_defn, exp->gdbarch, &arg1, &arg3); struct type *type = language_bool_type (exp->language_defn, exp->gdbarch); - return - value_from_longest (type, - (value_less (arg1, arg3) - || value_equal (arg1, arg3)) - && (value_less (arg2, arg1) - || value_equal (arg2, arg1))); + return value_from_longest ( + type, (value_less (arg1, arg3) || value_equal (arg1, arg3)) + && (value_less (arg2, arg1) || value_equal (arg2, arg1))); } /* A helper function for UNOP_NEG. */ value * -ada_unop_neg (struct type *expect_type, - struct expression *exp, - enum noside noside, enum exp_opcode op, - struct value *arg1) +ada_unop_neg (struct type *expect_type, struct expression *exp, + enum noside noside, enum exp_opcode op, struct value *arg1) { unop_promote (exp->language_defn, exp->gdbarch, &arg1); return value_neg (arg1); @@ -10124,44 +9949,36 @@ ada_unop_neg (struct type *expect_type, /* A helper function for UNOP_IN_RANGE. */ value * -ada_unop_in_range (struct type *expect_type, - struct expression *exp, - enum noside noside, enum exp_opcode op, - struct value *arg1, struct type *type) +ada_unop_in_range (struct type *expect_type, struct expression *exp, + enum noside noside, enum exp_opcode op, struct value *arg1, + struct type *type) { struct value *arg2, *arg3; switch (type->code ()) { default: - lim_warning (_("Membership test incompletely implemented; " - "always returns true")); + lim_warning (_ ("Membership test incompletely implemented; " + "always returns true")); type = language_bool_type (exp->language_defn, exp->gdbarch); return value_from_longest (type, (LONGEST) 1); case TYPE_CODE_RANGE: - arg2 = value_from_longest (type, - type->bounds ()->low.const_val ()); - arg3 = value_from_longest (type, - type->bounds ()->high.const_val ()); + arg2 = value_from_longest (type, type->bounds ()->low.const_val ()); + arg3 = value_from_longest (type, type->bounds ()->high.const_val ()); binop_promote (exp->language_defn, exp->gdbarch, &arg1, &arg2); binop_promote (exp->language_defn, exp->gdbarch, &arg1, &arg3); type = language_bool_type (exp->language_defn, exp->gdbarch); - return - value_from_longest (type, - (value_less (arg1, arg3) - || value_equal (arg1, arg3)) - && (value_less (arg2, arg1) - || value_equal (arg2, arg1))); + return value_from_longest ( + type, (value_less (arg1, arg3) || value_equal (arg1, arg3)) + && (value_less (arg2, arg1) || value_equal (arg2, arg1))); } } /* A helper function for OP_ATR_TAG. */ value * -ada_atr_tag (struct type *expect_type, - struct expression *exp, - enum noside noside, enum exp_opcode op, - struct value *arg1) +ada_atr_tag (struct type *expect_type, struct expression *exp, + enum noside noside, enum exp_opcode op, struct value *arg1) { if (noside == EVAL_AVOID_SIDE_EFFECTS) return value_zero (ada_tag_type (arg1), not_lval); @@ -10172,10 +9989,8 @@ ada_atr_tag (struct type *expect_type, /* A helper function for OP_ATR_SIZE. */ value * -ada_atr_size (struct type *expect_type, - struct expression *exp, - enum noside noside, enum exp_opcode op, - struct value *arg1) +ada_atr_size (struct type *expect_type, struct expression *exp, + enum noside noside, enum exp_opcode op, struct value *arg1) { struct type *type = value_type (arg1); @@ -10195,10 +10010,8 @@ ada_atr_size (struct type *expect_type, /* A helper function for UNOP_ABS. */ value * -ada_abs (struct type *expect_type, - struct expression *exp, - enum noside noside, enum exp_opcode op, - struct value *arg1) +ada_abs (struct type *expect_type, struct expression *exp, enum noside noside, + enum exp_opcode op, struct value *arg1) { unop_promote (exp->language_defn, exp->gdbarch, &arg1); if (value_less (arg1, value_zero (value_type (arg1), not_lval))) @@ -10210,10 +10023,9 @@ ada_abs (struct type *expect_type, /* A helper function for BINOP_MUL. */ value * -ada_mult_binop (struct type *expect_type, - struct expression *exp, - enum noside noside, enum exp_opcode op, - struct value *arg1, struct value *arg2) +ada_mult_binop (struct type *expect_type, struct expression *exp, + enum noside noside, enum exp_opcode op, struct value *arg1, + struct value *arg2) { if (noside == EVAL_AVOID_SIDE_EFFECTS) { @@ -10230,10 +10042,9 @@ ada_mult_binop (struct type *expect_type, /* A helper function for BINOP_EQUAL and BINOP_NOTEQUAL. */ value * -ada_equal_binop (struct type *expect_type, - struct expression *exp, - enum noside noside, enum exp_opcode op, - struct value *arg1, struct value *arg2) +ada_equal_binop (struct type *expect_type, struct expression *exp, + enum noside noside, enum exp_opcode op, struct value *arg1, + struct value *arg2) { int tem; if (noside == EVAL_AVOID_SIDE_EFFECTS) @@ -10252,8 +10063,7 @@ ada_equal_binop (struct type *expect_type, /* A helper function for TERNOP_SLICE. */ value * -ada_ternop_slice (struct expression *exp, - enum noside noside, +ada_ternop_slice (struct expression *exp, enum noside noside, struct value *array, struct value *low_bound_val, struct value *high_bound_val) { @@ -10269,11 +10079,11 @@ ada_ternop_slice (struct expression *exp, the aligners. */ if (value_type (array)->code () == TYPE_CODE_REF && ada_is_aligner_type (value_type (array)->target_type ())) - value_type (array)->set_target_type - (ada_aligned_type (value_type (array)->target_type ())); + value_type (array)->set_target_type ( + ada_aligned_type (value_type (array)->target_type ())); if (ada_is_any_packed_array_type (value_type (array))) - error (_("cannot slice a packed array")); + error (_ ("cannot slice a packed array")); /* If this is a reference to an array or an array lvalue, convert to a pointer. */ @@ -10283,18 +10093,15 @@ ada_ternop_slice (struct expression *exp, array = value_addr (array); if (noside == EVAL_AVOID_SIDE_EFFECTS - && ada_is_array_descriptor_type (ada_check_typedef - (value_type (array)))) - return empty_array (ada_type_of_array (array, 0), low_bound, - high_bound); + && ada_is_array_descriptor_type (ada_check_typedef (value_type (array)))) + return empty_array (ada_type_of_array (array, 0), low_bound, high_bound); array = ada_coerce_to_simple_array_ptr (array); /* If we have more than one level of pointer indirection, dereference the value until we get only one level. */ while (value_type (array)->code () == TYPE_CODE_PTR - && (value_type (array)->target_type ()->code () - == TYPE_CODE_PTR)) + && (value_type (array)->target_type ()->code () == TYPE_CODE_PTR)) array = value_ind (array); /* Make sure we really do have an array type before going further, @@ -10302,10 +10109,9 @@ ada_ternop_slice (struct expression *exp, type later down the road if the debug info generated by the compiler is incorrect or incomplete. */ if (!ada_is_simple_array_type (value_type (array))) - error (_("cannot take slice of non-array")); + error (_ ("cannot take slice of non-array")); - if (ada_check_typedef (value_type (array))->code () - == TYPE_CODE_PTR) + if (ada_check_typedef (value_type (array))->code () == TYPE_CODE_PTR) { struct type *type0 = ada_check_typedef (value_type (array)); @@ -10313,8 +10119,8 @@ ada_ternop_slice (struct expression *exp, return empty_array (type0->target_type (), low_bound, high_bound); else { - struct type *arr_type0 = - to_fixed_array_type (type0->target_type (), NULL, 1); + struct type *arr_type0 + = to_fixed_array_type (type0->target_type (), NULL, 1); return ada_value_slice_from_ptr (array, arr_type0, longest_to_int (low_bound), @@ -10338,8 +10144,8 @@ ada_binop_in_bounds (struct expression *exp, enum noside noside, { if (noside == EVAL_AVOID_SIDE_EFFECTS) { - struct type *type = language_bool_type (exp->language_defn, - exp->gdbarch); + struct type *type + = language_bool_type (exp->language_defn, exp->gdbarch); return value_zero (type, not_lval); } @@ -10353,11 +10159,9 @@ ada_binop_in_bounds (struct expression *exp, enum noside noside, binop_promote (exp->language_defn, exp->gdbarch, &arg1, &arg2); binop_promote (exp->language_defn, exp->gdbarch, &arg1, &arg3); type = language_bool_type (exp->language_defn, exp->gdbarch); - return value_from_longest (type, - (value_less (arg1, arg3) - || value_equal (arg1, arg3)) - && (value_less (arg2, arg1) - || value_equal (arg2, arg1))); + return value_from_longest ( + type, (value_less (arg1, arg3) || value_equal (arg1, arg3)) + && (value_less (arg2, arg1) || value_equal (arg2, arg1))); } /* A helper function for some attribute operations. */ @@ -10378,12 +10182,12 @@ ada_unop_atr (struct expression *exp, enum noside noside, enum exp_opcode op, { switch (op) { - default: /* Should never happen. */ - error (_("unexpected attribute encountered")); + default: /* Should never happen. */ + error (_ ("unexpected attribute encountered")); case OP_ATR_FIRST: case OP_ATR_LAST: - type_arg = ada_index_type (type_arg, tem, - ada_attribute_name (op)); + type_arg + = ada_index_type (type_arg, tem, ada_attribute_name (op)); break; case OP_ATR_LENGTH: type_arg = builtin_type (exp->gdbarch)->builtin_int; @@ -10405,25 +10209,22 @@ ada_unop_atr (struct expression *exp, enum noside noside, enum exp_opcode op, type = builtin_type (exp->gdbarch)->builtin_int; else { - type = ada_index_type (value_type (arg1), tem, - ada_attribute_name (op)); + type + = ada_index_type (value_type (arg1), tem, ada_attribute_name (op)); if (type == NULL) type = builtin_type (exp->gdbarch)->builtin_int; } switch (op) { - default: /* Should never happen. */ - error (_("unexpected attribute encountered")); + default: /* Should never happen. */ + error (_ ("unexpected attribute encountered")); case OP_ATR_FIRST: - return value_from_longest - (type, ada_array_bound (arg1, tem, 0)); + return value_from_longest (type, ada_array_bound (arg1, tem, 0)); case OP_ATR_LAST: - return value_from_longest - (type, ada_array_bound (arg1, tem, 1)); + return value_from_longest (type, ada_array_bound (arg1, tem, 1)); case OP_ATR_LENGTH: - return value_from_longest - (type, ada_array_length (arg1, tem)); + return value_from_longest (type, ada_array_length (arg1, tem)); } } else if (discrete_type_p (type_arg)) @@ -10439,19 +10240,19 @@ ada_unop_atr (struct expression *exp, enum noside noside, enum exp_opcode op, switch (op) { default: - error (_("unexpected attribute encountered")); + error (_ ("unexpected attribute encountered")); case OP_ATR_FIRST: - return value_from_longest - (range_type, ada_discrete_type_low_bound (range_type)); + return value_from_longest (range_type, + ada_discrete_type_low_bound (range_type)); case OP_ATR_LAST: - return value_from_longest - (range_type, ada_discrete_type_high_bound (range_type)); + return value_from_longest ( + range_type, ada_discrete_type_high_bound (range_type)); case OP_ATR_LENGTH: - error (_("the 'length attribute applies only to array types")); + error (_ ("the 'length attribute applies only to array types")); } } else if (type_arg->code () == TYPE_CODE_FLT) - error (_("unimplemented type attribute")); + error (_ ("unimplemented type attribute")); else { LONGEST low, high; @@ -10472,7 +10273,7 @@ ada_unop_atr (struct expression *exp, enum noside noside, enum exp_opcode op, switch (op) { default: - error (_("unexpected attribute encountered")); + error (_ ("unexpected attribute encountered")); case OP_ATR_FIRST: low = ada_array_bound_from_type (type_arg, tem, 0); return value_from_longest (type, low); @@ -10490,10 +10291,9 @@ ada_unop_atr (struct expression *exp, enum noside noside, enum exp_opcode op, /* A helper function for OP_ATR_MIN and OP_ATR_MAX. */ struct value * -ada_binop_minmax (struct type *expect_type, - struct expression *exp, - enum noside noside, enum exp_opcode op, - struct value *arg1, struct value *arg2) +ada_binop_minmax (struct type *expect_type, struct expression *exp, + enum noside noside, enum exp_opcode op, struct value *arg1, + struct value *arg2) { if (noside == EVAL_AVOID_SIDE_EFFECTS) return value_zero (value_type (arg1), not_lval); @@ -10507,10 +10307,9 @@ ada_binop_minmax (struct type *expect_type, /* A helper function for BINOP_EXP. */ struct value * -ada_binop_exp (struct type *expect_type, - struct expression *exp, - enum noside noside, enum exp_opcode op, - struct value *arg1, struct value *arg2) +ada_binop_exp (struct type *expect_type, struct expression *exp, + enum noside noside, enum exp_opcode op, struct value *arg1, + struct value *arg2) { if (noside == EVAL_AVOID_SIDE_EFFECTS) return value_zero (value_type (arg1), not_lval); @@ -10533,17 +10332,14 @@ namespace expr /* See ada-exp.h. */ operation_up -ada_resolvable::replace (operation_up &&owner, - struct expression *exp, - bool deprocedure_p, - bool parse_completion, +ada_resolvable::replace (operation_up &&owner, struct expression *exp, + bool deprocedure_p, bool parse_completion, innermost_block_tracker *tracker, struct type *context_type) { if (resolve (exp, deprocedure_p, parse_completion, tracker, context_type)) - return (make_operation - (std::move (owner), - std::vector ())); + return (make_operation ( + std::move (owner), std::vector ())); return std::move (owner); } @@ -10589,8 +10385,7 @@ convert_char_literal (struct type *type, LONGEST val) } value * -ada_char_operation::evaluate (struct type *expect_type, - struct expression *exp, +ada_char_operation::evaluate (struct type *expect_type, struct expression *exp, enum noside noside) { value *result = long_const_operation::evaluate (expect_type, exp, noside); @@ -10602,10 +10397,8 @@ ada_char_operation::evaluate (struct type *expect_type, /* See ada-exp.h. */ operation_up -ada_char_operation::replace (operation_up &&owner, - struct expression *exp, - bool deprocedure_p, - bool parse_completion, +ada_char_operation::replace (operation_up &&owner, struct expression *exp, + bool deprocedure_p, bool parse_completion, innermost_block_tracker *tracker, struct type *context_type) { @@ -10624,8 +10417,7 @@ ada_char_operation::replace (operation_up &&owner, value * ada_wrapped_operation::evaluate (struct type *expect_type, - struct expression *exp, - enum noside noside) + struct expression *exp, enum noside noside) { value *result = std::get<0> (m_storage)->evaluate (expect_type, exp, noside); if (noside == EVAL_NORMAL) @@ -10647,8 +10439,7 @@ ada_wrapped_operation::evaluate (struct type *expect_type, value * ada_string_operation::evaluate (struct type *expect_type, - struct expression *exp, - enum noside noside) + struct expression *exp, enum noside noside) { struct type *char_type; if (expect_type != nullptr && ada_is_string_type (expect_type)) @@ -10668,8 +10459,7 @@ ada_string_operation::evaluate (struct type *expect_type, struct type *stringtype = lookup_array_range_type (char_type, 1, str.length ()); struct value *val = allocate_value (stringtype); - memcpy (value_contents_raw (val).data (), str.c_str (), - str.length ()); + memcpy (value_contents_raw (val).data (), str.c_str (), str.length ()); return val; } @@ -10688,31 +10478,26 @@ ada_string_operation::evaluate (struct type *expect_type, break; default: - error (_("unexpected character type size %s"), + error (_ ("unexpected character type size %s"), pulongest (char_type->length ())); } auto_obstack converted; convert_between_encodings (host_charset (), encoding, - (const gdb_byte *) str.c_str (), - str.length (), 1, + (const gdb_byte *) str.c_str (), str.length (), 1, &converted, translit_none); - struct type *stringtype - = lookup_array_range_type (char_type, 1, - obstack_object_size (&converted) - / char_type->length ()); + struct type *stringtype = lookup_array_range_type ( + char_type, 1, obstack_object_size (&converted) / char_type->length ()); struct value *val = allocate_value (stringtype); - memcpy (value_contents_raw (val).data (), - obstack_base (&converted), + memcpy (value_contents_raw (val).data (), obstack_base (&converted), obstack_object_size (&converted)); return val; } value * ada_concat_operation::evaluate (struct type *expect_type, - struct expression *exp, - enum noside noside) + struct expression *exp, enum noside noside) { /* If one side is a literal, evaluate the other side first so that the expected type can be set properly. */ @@ -10755,8 +10540,7 @@ ada_concat_operation::evaluate (struct type *expect_type, } value * -ada_qual_operation::evaluate (struct type *expect_type, - struct expression *exp, +ada_qual_operation::evaluate (struct type *expect_type, struct expression *exp, enum noside noside) { struct type *type = std::get<1> (m_storage); @@ -10782,21 +10566,20 @@ ada_binop_addsub_operation::evaluate (struct type *expect_type, value *arg1 = std::get<1> (m_storage)->evaluate_with_coercion (exp, noside); value *arg2 = std::get<2> (m_storage)->evaluate_with_coercion (exp, noside); - auto do_op = [=] (LONGEST x, LONGEST y) - { - if (std::get<0> (m_storage) == BINOP_ADD) - return x + y; - return x - y; - }; + auto do_op = [=] (LONGEST x, LONGEST y) { + if (std::get<0> (m_storage) == BINOP_ADD) + return x + y; + return x - y; + }; if (value_type (arg1)->code () == TYPE_CODE_PTR) - return (value_from_longest - (value_type (arg1), - do_op (value_as_long (arg1), value_as_long (arg2)))); + return (value_from_longest (value_type (arg1), + do_op (value_as_long (arg1), + value_as_long (arg2)))); if (value_type (arg2)->code () == TYPE_CODE_PTR) - return (value_from_longest - (value_type (arg2), - do_op (value_as_long (arg1), value_as_long (arg2)))); + return (value_from_longest (value_type (arg2), + do_op (value_as_long (arg1), + value_as_long (arg2)))); /* Preserve the original type for use by the range case below. We cannot cast the result to a reference type, so if ARG1 is a reference type, find its underlying type. */ @@ -10816,8 +10599,7 @@ ada_binop_addsub_operation::evaluate (struct type *expect_type, value * ada_unop_atr_operation::evaluate (struct type *expect_type, - struct expression *exp, - enum noside noside) + struct expression *exp, enum noside noside) { struct type *type_arg = nullptr; value *val = nullptr; @@ -10831,8 +10613,8 @@ ada_unop_atr_operation::evaluate (struct type *expect_type, else val = std::get<0> (m_storage)->evaluate (nullptr, exp, noside); - return ada_unop_atr (exp, noside, std::get<1> (m_storage), - val, type_arg, std::get<2> (m_storage)); + return ada_unop_atr (exp, noside, std::get<1> (m_storage), val, type_arg, + std::get<2> (m_storage)); } value * @@ -10864,8 +10646,7 @@ ada_var_value_operation::evaluate_for_cast (struct type *expect_type, struct expression *exp, enum noside noside) { - value *val = evaluate_var_value (noside, - std::get<0> (m_storage).block, + value *val = evaluate_var_value (noside, std::get<0> (m_storage).block, std::get<0> (m_storage).symbol); val = ada_value_cast (expect_type, val); @@ -10883,8 +10664,7 @@ ada_var_value_operation::evaluate_for_cast (struct type *expect_type, value * ada_var_value_operation::evaluate (struct type *expect_type, - struct expression *exp, - enum noside noside) + struct expression *exp, enum noside noside) { symbol *sym = std::get<0> (m_storage).symbol; @@ -10892,7 +10672,7 @@ ada_var_value_operation::evaluate (struct type *expect_type, /* Only encountered when an unresolved symbol occurs in a context other than a function call, in which case, it is invalid. */ - error (_("Unexpected unresolved symbol, %s, during evaluation"), + error (_ ("Unexpected unresolved symbol, %s, during evaluation"), sym->print_name ()); if (noside == EVAL_AVOID_SIDE_EFFECTS) @@ -10971,8 +10751,7 @@ ada_var_value_operation::evaluate (struct type *expect_type, } bool -ada_var_value_operation::resolve (struct expression *exp, - bool deprocedure_p, +ada_var_value_operation::resolve (struct expression *exp, bool deprocedure_p, bool parse_completion, innermost_block_tracker *tracker, struct type *context_type) @@ -10982,14 +10761,13 @@ ada_var_value_operation::resolve (struct expression *exp, { block_symbol resolved = ada_resolve_variable (sym, std::get<0> (m_storage).block, - context_type, parse_completion, - deprocedure_p, tracker); + context_type, parse_completion, deprocedure_p, + tracker); std::get<0> (m_storage) = resolved; } if (deprocedure_p - && (std::get<0> (m_storage).symbol->type ()->code () - == TYPE_CODE_FUNC)) + && (std::get<0> (m_storage).symbol->type ()->code () == TYPE_CODE_FUNC)) return true; return false; @@ -10997,8 +10775,7 @@ ada_var_value_operation::resolve (struct expression *exp, value * ada_atr_val_operation::evaluate (struct type *expect_type, - struct expression *exp, - enum noside noside) + struct expression *exp, enum noside noside) { value *arg = std::get<1> (m_storage)->evaluate (nullptr, exp, noside); return ada_val_atr (noside, std::get<0> (m_storage), arg); @@ -11006,8 +10783,7 @@ ada_atr_val_operation::evaluate (struct type *expect_type, value * ada_unop_ind_operation::evaluate (struct type *expect_type, - struct expression *exp, - enum noside noside) + struct expression *exp, enum noside noside) { value *arg1 = std::get<0> (m_storage)->evaluate (expect_type, exp, noside); @@ -11020,7 +10796,7 @@ ada_unop_ind_operation::evaluate (struct type *expect_type, struct type *arrType = ada_type_of_array (arg1, 0); if (arrType == NULL) - error (_("Attempt to dereference null array pointer.")); + error (_ ("Attempt to dereference null array pointer.")); return value_at_lazy (arrType, 0); } else if (type->code () == TYPE_CODE_PTR @@ -11043,9 +10819,8 @@ ada_unop_ind_operation::evaluate (struct type *expect_type, } else { - type = to_static_fixed_type - (ada_aligned_type - (ada_check_typedef (type->target_type ()))); + type = to_static_fixed_type ( + ada_aligned_type (ada_check_typedef (type->target_type ()))); } return value_zero (type, lval_memory); } @@ -11057,15 +10832,15 @@ ada_unop_ind_operation::evaluate (struct type *expect_type, lval_memory); else { - expect_type = - to_static_fixed_type (ada_aligned_type (expect_type)); + expect_type + = to_static_fixed_type (ada_aligned_type (expect_type)); return value_zero (expect_type, lval_memory); } } else - error (_("Attempt to take contents of a non-pointer value.")); + error (_ ("Attempt to take contents of a non-pointer value.")); } - arg1 = ada_coerce_ref (arg1); /* FIXME: What is this for?? */ + arg1 = ada_coerce_ref (arg1); /* FIXME: What is this for?? */ type = ada_check_typedef (value_type (arg1)); if (type->code () == TYPE_CODE_INT) @@ -11090,8 +10865,7 @@ ada_unop_ind_operation::evaluate (struct type *expect_type, value * ada_structop_operation::evaluate (struct type *expect_type, - struct expression *exp, - enum noside noside) + struct expression *exp, enum noside noside) { value *arg1 = std::get<0> (m_storage)->evaluate (nullptr, exp, noside); const char *str = std::get<1> (m_storage).c_str (); @@ -11132,8 +10906,7 @@ ada_structop_operation::evaluate (struct type *expect_type, value * ada_funcall_operation::evaluate (struct type *expect_type, - struct expression *exp, - enum noside noside) + struct expression *exp, enum noside noside) { const std::vector &args_up = std::get<1> (m_storage); int nargs = args_up.size (); @@ -11142,17 +10915,16 @@ ada_funcall_operation::evaluate (struct type *expect_type, ada_var_value_operation *avv = dynamic_cast (callee_op.get ()); - if (avv != nullptr - && avv->get_symbol ()->domain () == UNDEF_DOMAIN) - error (_("Unexpected unresolved symbol, %s, during evaluation"), + if (avv != nullptr && avv->get_symbol ()->domain () == UNDEF_DOMAIN) + error (_ ("Unexpected unresolved symbol, %s, during evaluation"), avv->get_symbol ()->print_name ()); value *callee = callee_op->evaluate (nullptr, exp, noside); for (int i = 0; i < args_up.size (); ++i) argvec[i] = args_up[i]->evaluate (nullptr, exp, noside); - if (ada_is_constrained_packed_array_type - (desc_base_type (value_type (callee)))) + if (ada_is_constrained_packed_array_type ( + desc_base_type (value_type (callee)))) callee = ada_coerce_to_simple_array (callee); else if (value_type (callee)->code () == TYPE_CODE_ARRAY && TYPE_FIELD_BITSIZE (value_type (callee), 0) != 0) @@ -11195,7 +10967,7 @@ ada_funcall_operation::evaluate (struct type *expect_type, type = ada_check_typedef (type->target_type ()); break; default: - error (_("cannot subscript or call something of type `%s'"), + error (_ ("cannot subscript or call something of type `%s'"), ada_type_name (value_type (callee))); break; } @@ -11216,12 +10988,10 @@ ada_funcall_operation::evaluate (struct type *expect_type, /* We don't know anything about what the internal function might return, but we have to return something. */ - return value_zero (builtin_type (exp->gdbarch)->builtin_int, - not_lval); + return value_zero (builtin_type (exp->gdbarch)->builtin_int, not_lval); else return call_internal_function (exp->gdbarch, exp->language_defn, - callee, nargs, - argvec.data ()); + callee, nargs, argvec.data ()); case TYPE_CODE_STRUCT: { @@ -11230,51 +11000,46 @@ ada_funcall_operation::evaluate (struct type *expect_type, arity = ada_array_arity (type); type = ada_array_element_type (type, nargs); if (type == NULL) - error (_("cannot subscript or call a record")); + error (_ ("cannot subscript or call a record")); if (arity != nargs) - error (_("wrong number of subscripts; expecting %d"), arity); + error (_ ("wrong number of subscripts; expecting %d"), arity); if (noside == EVAL_AVOID_SIDE_EFFECTS) return value_zero (ada_aligned_type (type), lval_memory); - return - unwrap_value (ada_value_subscript - (callee, nargs, argvec.data ())); + return unwrap_value (ada_value_subscript (callee, nargs, + argvec.data ())); } case TYPE_CODE_ARRAY: if (noside == EVAL_AVOID_SIDE_EFFECTS) { type = ada_array_element_type (type, nargs); if (type == NULL) - error (_("element type of array unknown")); + error (_ ("element type of array unknown")); else return value_zero (ada_aligned_type (type), lval_memory); } - return - unwrap_value (ada_value_subscript - (ada_coerce_to_simple_array (callee), - nargs, argvec.data ())); - case TYPE_CODE_PTR: /* Pointer to array */ + return unwrap_value (ada_value_subscript ( + ada_coerce_to_simple_array (callee), nargs, argvec.data ())); + case TYPE_CODE_PTR: /* Pointer to array */ if (noside == EVAL_AVOID_SIDE_EFFECTS) { type = to_fixed_array_type (type->target_type (), NULL, 1); type = ada_array_element_type (type, nargs); if (type == NULL) - error (_("element type of array unknown")); + error (_ ("element type of array unknown")); else return value_zero (ada_aligned_type (type), lval_memory); } - return - unwrap_value (ada_value_ptr_subscript (callee, nargs, - argvec.data ())); + return unwrap_value (ada_value_ptr_subscript (callee, nargs, + argvec.data ())); default: - error (_("Attempt to index or call something other than an " - "array or function")); + error (_ ("Attempt to index or call something other than an " + "array or function")); } } bool -ada_funcall_operation::resolve (struct expression *exp, - bool deprocedure_p, +ada_funcall_operation::resolve (struct expression *exp, bool deprocedure_p, bool parse_completion, innermost_block_tracker *tracker, struct type *context_type) @@ -11299,20 +11064,16 @@ ada_funcall_operation::resolve (struct expression *exp, const block *block = avv->get_block (); block_symbol resolved - = ada_resolve_funcall (sym, block, - context_type, parse_completion, - nargs, argvec.data (), - tracker); + = ada_resolve_funcall (sym, block, context_type, parse_completion, nargs, + argvec.data (), tracker); - std::get<0> (m_storage) - = make_operation (resolved); + std::get<0> (m_storage) = make_operation (resolved); return false; } bool ada_ternop_slice_operation::resolve (struct expression *exp, - bool deprocedure_p, - bool parse_completion, + bool deprocedure_p, bool parse_completion, innermost_block_tracker *tracker, struct type *context_type) { @@ -11321,13 +11082,11 @@ ada_ternop_slice_operation::resolve (struct expression *exp, value *v = std::get<0> (m_storage)->evaluate (context_type, exp, EVAL_AVOID_SIDE_EFFECTS); if (ada_is_any_packed_array_type (value_type (v))) - error (_("cannot slice a packed array")); + error (_ ("cannot slice a packed array")); return false; } -} - - +} // namespace expr /* Return non-zero iff TYPE represents a System.Address type. */ @@ -11337,9 +11096,7 @@ ada_is_system_address_type (struct type *type) return (type->name () && strcmp (type->name (), "system__address") == 0); } - - - /* Range types */ +/* Range types */ /* Scan STR beginning at position K for a discriminant name, and return the value of that discriminant field of DVAL in *PX. If @@ -11348,7 +11105,7 @@ ada_is_system_address_type (struct type *type) not alter *PX and *PNEW_K if unsuccessful. */ static int -scan_discrim_bound (const char *str, int k, struct value *dval, LONGEST * px, +scan_discrim_bound (const char *str, int k, struct value *dval, LONGEST *px, int *pnew_k) { static std::string storage; @@ -11397,8 +11154,7 @@ get_var_value (const char *name, const char *err_msg) lookup_name_info lookup_name (quoted_name, symbol_name_match_type::FULL); std::vector syms - = ada_lookup_symbol_list_worker (lookup_name, - get_selected_block (0), + = ada_lookup_symbol_list_worker (lookup_name, get_selected_block (0), VAR_DOMAIN, 1); if (syms.size () != 1) @@ -11428,7 +11184,6 @@ get_int_var_value (const char *name, LONGEST &value) return true; } - /* Return a range type whose base type is that of the range type named NAME in the current environment, and whose bounds are calculated from NAME according to the GNAT range encoding conventions. @@ -11485,7 +11240,7 @@ to_fixed_range_type (struct type *raw_type, struct value *dval) return raw_type; if (bounds_str[n] == '_') n += 2; - else if (bounds_str[n] == '.') /* FIXME? SGI Workshop kludge. */ + else if (bounds_str[n] == '.') /* FIXME? SGI Workshop kludge. */ n += 1; subtype_info += 1; } @@ -11494,7 +11249,7 @@ to_fixed_range_type (struct type *raw_type, struct value *dval) std::string name_buf = std::string (name, prefix_len) + "___L"; if (!get_int_var_value (name_buf.c_str (), L)) { - lim_warning (_("Unknown lower bound, using 1.")); + lim_warning (_ ("Unknown lower bound, using 1.")); L = 1; } } @@ -11510,13 +11265,13 @@ to_fixed_range_type (struct type *raw_type, struct value *dval) std::string name_buf = std::string (name, prefix_len) + "___U"; if (!get_int_var_value (name_buf.c_str (), U)) { - lim_warning (_("Unknown upper bound, using %ld."), (long) L); + lim_warning (_ ("Unknown upper bound, using %ld."), (long) L); U = L; } } - type = create_static_range_type (alloc_type_copy (raw_type), - base_type, L, U); + type = create_static_range_type (alloc_type_copy (raw_type), base_type, + L, U); /* create_static_range_type alters the resulting type's length to match the size of the base_type, which is not what we want. Set it back to the original range type's length. */ @@ -11533,9 +11288,8 @@ ada_is_range_type_name (const char *name) { return (name != NULL && strstr (name, "___XD")); } - - /* Modular types */ +/* Modular types */ /* True iff TYPE is an Ada modular type. */ @@ -11563,7 +11317,6 @@ ada_modulus (struct type *type) 0, for lack of a better value to return. */ return 0; } - /* Ada exception catchpoint support: --------------------------------- @@ -11605,12 +11358,8 @@ ada_modulus (struct type *type) an Ada83 compiler). As such, we do not include Numeric_Error from this list of standard exceptions. */ -static const char * const standard_exc[] = { - "constraint_error", - "program_error", - "storage_error", - "tasking_error" -}; +static const char *const standard_exc[] + = { "constraint_error", "program_error", "storage_error", "tasking_error" }; typedef CORE_ADDR (ada_unhandled_exception_name_addr_ftype) (void); @@ -11619,27 +11368,27 @@ typedef CORE_ADDR (ada_unhandled_exception_name_addr_ftype) (void); struct exception_support_info { - /* The name of the symbol to break on in order to insert + /* The name of the symbol to break on in order to insert a catchpoint on exceptions. */ - const char *catch_exception_sym; + const char *catch_exception_sym; - /* The name of the symbol to break on in order to insert + /* The name of the symbol to break on in order to insert a catchpoint on unhandled exceptions. */ - const char *catch_exception_unhandled_sym; + const char *catch_exception_unhandled_sym; - /* The name of the symbol to break on in order to insert + /* The name of the symbol to break on in order to insert a catchpoint on failed assertions. */ - const char *catch_assert_sym; + const char *catch_assert_sym; - /* The name of the symbol to break on in order to insert + /* The name of the symbol to break on in order to insert a catchpoint on exception handling. */ - const char *catch_handlers_sym; + const char *catch_handlers_sym; - /* Assuming that the inferior just triggered an unhandled exception + /* Assuming that the inferior just triggered an unhandled exception catchpoint, this function is responsible for returning the address in inferior memory where the name of that exception is stored. Return zero if the address could not be computed. */ - ada_unhandled_exception_name_addr_ftype *unhandled_exception_name_addr; + ada_unhandled_exception_name_addr_ftype *unhandled_exception_name_addr; }; static CORE_ADDR ada_unhandled_exception_name_addr (void); @@ -11649,40 +11398,34 @@ static CORE_ADDR ada_unhandled_exception_name_addr_from_raise (void); implement exception catchpoints with the latest version of the Ada runtime (as of 2019-08-??). */ -static const struct exception_support_info default_exception_support_info = -{ - "__gnat_debug_raise_exception", /* catch_exception_sym */ - "__gnat_unhandled_exception", /* catch_exception_unhandled_sym */ - "__gnat_debug_raise_assert_failure", /* catch_assert_sym */ - "__gnat_begin_handler_v1", /* catch_handlers_sym */ - ada_unhandled_exception_name_addr -}; +static const struct exception_support_info default_exception_support_info + = { "__gnat_debug_raise_exception", /* catch_exception_sym */ + "__gnat_unhandled_exception", /* catch_exception_unhandled_sym */ + "__gnat_debug_raise_assert_failure", /* catch_assert_sym */ + "__gnat_begin_handler_v1", /* catch_handlers_sym */ + ada_unhandled_exception_name_addr }; /* The following exception support info structure describes how to implement exception catchpoints with an earlier version of the Ada runtime (as of 2007-03-06) using v0 of the EH ABI. */ -static const struct exception_support_info exception_support_info_v0 = -{ - "__gnat_debug_raise_exception", /* catch_exception_sym */ - "__gnat_unhandled_exception", /* catch_exception_unhandled_sym */ - "__gnat_debug_raise_assert_failure", /* catch_assert_sym */ - "__gnat_begin_handler", /* catch_handlers_sym */ - ada_unhandled_exception_name_addr -}; +static const struct exception_support_info exception_support_info_v0 + = { "__gnat_debug_raise_exception", /* catch_exception_sym */ + "__gnat_unhandled_exception", /* catch_exception_unhandled_sym */ + "__gnat_debug_raise_assert_failure", /* catch_assert_sym */ + "__gnat_begin_handler", /* catch_handlers_sym */ + ada_unhandled_exception_name_addr }; /* The following exception support info structure describes how to implement exception catchpoints with a slightly older version of the Ada runtime. */ -static const struct exception_support_info exception_support_info_fallback = -{ - "__gnat_raise_nodefer_with_msg", /* catch_exception_sym */ - "__gnat_unhandled_exception", /* catch_exception_unhandled_sym */ - "system__assertions__raise_assert_failure", /* catch_assert_sym */ - "__gnat_begin_handler", /* catch_handlers_sym */ - ada_unhandled_exception_name_addr_from_raise -}; +static const struct exception_support_info exception_support_info_fallback + = { "__gnat_raise_nodefer_with_msg", /* catch_exception_sym */ + "__gnat_unhandled_exception", /* catch_exception_unhandled_sym */ + "system__assertions__raise_assert_failure", /* catch_assert_sym */ + "__gnat_begin_handler", /* catch_handlers_sym */ + ada_unhandled_exception_name_addr_from_raise }; /* Return nonzero if we can detect the exception support routines described in EINFO. @@ -11721,9 +11464,9 @@ ada_has_this_exception_support (const struct exception_support_info *einfo) = lookup_minimal_symbol (einfo->catch_exception_sym, NULL, NULL); if (msym.minsym && msym.minsym->type () != mst_solib_trampoline) - error (_("Your Ada runtime appears to be missing some debugging " - "information.\nCannot insert Ada exception catchpoint " - "in this configuration.")); + error (_ ("Your Ada runtime appears to be missing some debugging " + "information.\nCannot insert Ada exception catchpoint " + "in this configuration.")); return 0; } @@ -11732,7 +11475,7 @@ ada_has_this_exception_support (const struct exception_support_info *einfo) if (sym->aclass () != LOC_BLOCK) { - error (_("Symbol \"%s\" is not a function (class = %d)"), + error (_ ("Symbol \"%s\" is not a function (class = %d)"), sym->linkage_name (), sym->aclass ()); return 0; } @@ -11744,9 +11487,9 @@ ada_has_this_exception_support (const struct exception_support_info *einfo) = lookup_minimal_symbol (einfo->catch_handlers_sym, NULL, NULL); if (msym.minsym && msym.minsym->type () != mst_solib_trampoline) - error (_("Your Ada runtime appears to be missing some debugging " - "information.\nCannot insert Ada exception catchpoint " - "in this configuration.")); + error (_ ("Your Ada runtime appears to be missing some debugging " + "information.\nCannot insert Ada exception catchpoint " + "in this configuration.")); return 0; } @@ -11755,7 +11498,7 @@ ada_has_this_exception_support (const struct exception_support_info *einfo) if (sym->aclass () != LOC_BLOCK) { - error (_("Symbol \"%s\" is not a function (class = %d)"), + error (_ ("Symbol \"%s\" is not a function (class = %d)"), sym->linkage_name (), sym->aclass ()); return 0; } @@ -11806,7 +11549,7 @@ ada_exception_support_info_sniffer (void) applicable. */ if (ada_update_initial_language (language_unknown) != language_ada) - error (_("Unable to insert catchpoint. Is this an Ada main program?")); + error (_ ("Unable to insert catchpoint. Is this an Ada main program?")); /* If the symbol does not exist, then check that the program is already started, to make sure that shared libraries have been @@ -11814,7 +11557,7 @@ ada_exception_support_info_sniffer (void) in a shared library. */ if (inferior_ptid.pid () == 0) - error (_("Unable to insert catchpoint. Try to start the program first.")); + error (_ ("Unable to insert catchpoint. Try to start the program first.")); /* At this point, we know that we are debugging an Ada program and that the inferior has been started, but we still are not able to @@ -11823,7 +11566,7 @@ ada_exception_support_info_sniffer (void) out by the linker... In any case, at this point it is not worth supporting this feature. */ - error (_("Cannot insert Ada exception catchpoints in this configuration.")); + error (_ ("Cannot insert Ada exception catchpoints in this configuration.")); } /* True iff FRAME is very likely to be that of a function that is @@ -11901,7 +11644,6 @@ ada_find_printable_frame (frame_info_ptr fi) break; } } - } /* Assuming that the inferior just triggered an unhandled exception @@ -11935,7 +11677,7 @@ ada_unhandled_exception_name_addr_from_raise (void) fi = get_current_frame (); for (frame_level = 0; frame_level < 3; frame_level += 1) if (fi != NULL) - fi = get_prev_frame (fi); + fi = get_prev_frame (fi); while (fi != NULL) { @@ -11946,7 +11688,8 @@ ada_unhandled_exception_name_addr_from_raise (void) if (func_name != NULL) { if (strcmp (func_name.get (), - data->exception_info->catch_exception_sym) == 0) + data->exception_info->catch_exception_sym) + == 0) break; /* We found the frame we were looking for... */ } fi = get_prev_frame (fi); @@ -11974,26 +11717,26 @@ ada_exception_name_addr_1 (enum ada_exception_catchpoint_kind ex) switch (ex) { - case ada_catch_exception: - return (parse_and_eval_address ("e.full_name")); - break; + case ada_catch_exception: + return (parse_and_eval_address ("e.full_name")); + break; - case ada_catch_exception_unhandled: - return data->exception_info->unhandled_exception_name_addr (); - break; + case ada_catch_exception_unhandled: + return data->exception_info->unhandled_exception_name_addr (); + break; - case ada_catch_handlers: - return 0; /* The runtimes does not provide access to the exception + case ada_catch_handlers: + return 0; /* The runtimes does not provide access to the exception name. */ - break; + break; - case ada_catch_assert: - return 0; /* Exception name is not relevant in this case. */ - break; + case ada_catch_assert: + return 0; /* Exception name is not relevant in this case. */ + break; - default: - internal_error (_("unexpected catchpoint type")); - break; + default: + internal_error (_ ("unexpected catchpoint type")); + break; } return 0; /* Should never be reached. */ @@ -12077,16 +11820,16 @@ ada_exception_name_addr (enum ada_exception_catchpoint_kind ex) catch (const gdb_exception_error &e) { - warning (_("failed to get exception name: %s"), e.what ()); + warning (_ ("failed to get exception name: %s"), e.what ()); return 0; } return result; } -static std::string ada_exception_catchpoint_cond_string - (const char *excep_string, - enum ada_exception_catchpoint_kind ex); +static std::string +ada_exception_catchpoint_cond_string (const char *excep_string, + enum ada_exception_catchpoint_kind ex); /* Ada catchpoints. @@ -12107,11 +11850,8 @@ struct ada_catchpoint : public code_breakpoint { ada_catchpoint (struct gdbarch *gdbarch_, enum ada_exception_catchpoint_kind kind, - struct symtab_and_line sal, - const char *addr_string_, - bool tempflag, - bool enabled, - bool from_tty) + struct symtab_and_line sal, const char *addr_string_, + bool tempflag, bool enabled, bool from_tty) : code_breakpoint (gdbarch_, bp_catchpoint), m_kind (kind) { @@ -12128,8 +11868,8 @@ struct ada_catchpoint : public code_breakpoint if (!loc_gdbarch) loc_gdbarch = gdbarch; - describe_other_breakpoints (loc_gdbarch, - sal.pspace, sal.pc, sal.section, -1); + describe_other_breakpoints (loc_gdbarch, sal.pspace, sal.pc, + sal.section, -1); /* FIXME: brobecker/2006-12-28: Actually, re-implement a special version for exception catchpoints, because two catchpoints used for different exception names will use the same address. @@ -12142,8 +11882,8 @@ struct ada_catchpoint : public code_breakpoint enable_state = enabled ? bp_enabled : bp_disabled; disposition = tempflag ? disp_del : disp_donttouch; - locspec = string_to_location_spec (&addr_string_, - language_def (language_ada)); + locspec + = string_to_location_spec (&addr_string_, language_def (language_ada)); language = language_ada; } @@ -12168,9 +11908,11 @@ struct ada_catchpoint : public code_breakpoint class ada_catchpoint_location : public bp_location { public: + explicit ada_catchpoint_location (ada_catchpoint *owner) : bp_location (owner, bp_loc_software_breakpoint) - {} + { + } /* The condition that checks whether the exception that was raised is the specific exception the user specified on catchpoint @@ -12213,14 +11955,13 @@ create_excep_cond_exprs (struct ada_catchpoint *c, s = cond_string.c_str (); try { - exp = parse_exp_1 (&s, bl->address, - block_for_pc (bl->address), - 0); + exp + = parse_exp_1 (&s, bl->address, block_for_pc (bl->address), 0); } catch (const gdb_exception_error &e) { - warning (_("failed to reevaluate internal exception condition " - "for catchpoint %d: %s"), + warning (_ ("failed to reevaluate internal exception condition " + "for catchpoint %d: %s"), c->number, e.what ()); } } @@ -12304,12 +12045,13 @@ should_stop_exception (const struct bp_location *bl) try { scoped_value_mark mark; - stop = value_true (evaluate_expression (ada_loc->excep_cond_expr.get ())); + stop + = value_true (evaluate_expression (ada_loc->excep_cond_expr.get ())); } catch (const gdb_exception &ex) { exception_fprintf (gdb_stderr, ex, - _("Error in testing exception condition:\n")); + _ ("Error in testing exception condition:\n")); } return stop; @@ -12341,8 +12083,8 @@ ada_catchpoint::print_it (const bpstat *bs) const uiout->field_string ("disp", bpdisp_text (disposition)); } - uiout->text (disposition == disp_del - ? "\nTemporary catchpoint " : "\nCatchpoint "); + uiout->text (disposition == disp_del ? "\nTemporary catchpoint " + : "\nCatchpoint "); print_num_locno (bs, uiout); uiout->text (", "); @@ -12355,47 +12097,47 @@ ada_catchpoint::print_it (const bpstat *bs) const switch (m_kind) { - case ada_catch_exception: - case ada_catch_exception_unhandled: - case ada_catch_handlers: - { - const CORE_ADDR addr = ada_exception_name_addr (m_kind); - char exception_name[256]; + case ada_catch_exception: + case ada_catch_exception_unhandled: + case ada_catch_handlers: + { + const CORE_ADDR addr = ada_exception_name_addr (m_kind); + char exception_name[256]; - if (addr != 0) - { - read_memory (addr, (gdb_byte *) exception_name, - sizeof (exception_name) - 1); - exception_name [sizeof (exception_name) - 1] = '\0'; - } - else - { - /* For some reason, we were unable to read the exception + if (addr != 0) + { + read_memory (addr, (gdb_byte *) exception_name, + sizeof (exception_name) - 1); + exception_name[sizeof (exception_name) - 1] = '\0'; + } + else + { + /* For some reason, we were unable to read the exception name. This could happen if the Runtime was compiled without debugging info, for instance. In that case, just replace the exception name by the generic string "exception" - it will read as "an exception" in the notification we are about to print. */ - memcpy (exception_name, "exception", sizeof ("exception")); - } - /* In the case of unhandled exception breakpoints, we print + memcpy (exception_name, "exception", sizeof ("exception")); + } + /* In the case of unhandled exception breakpoints, we print the exception name as "unhandled EXCEPTION_NAME", to make it clearer to the user which kind of catchpoint just got hit. We used ui_out_text to make sure that this extra info does not pollute the exception name in the MI case. */ - if (m_kind == ada_catch_exception_unhandled) - uiout->text ("unhandled "); - uiout->field_string ("exception-name", exception_name); - } - break; - case ada_catch_assert: - /* In this case, the name of the exception is not really + if (m_kind == ada_catch_exception_unhandled) + uiout->text ("unhandled "); + uiout->field_string ("exception-name", exception_name); + } + break; + case ada_catch_assert: + /* In this case, the name of the exception is not really important. Just print "failed assertion" to make it clearer that his program just hit an assertion-failure catchpoint. We used ui_out_text because this info does not belong in the MI output. */ - uiout->text ("failed assertion"); - break; + uiout->text ("failed assertion"); + break; } gdb::unique_xmalloc_ptr exception_message = ada_exception_message (); @@ -12417,7 +12159,7 @@ ada_catchpoint::print_it (const bpstat *bs) const bool ada_catchpoint::print_one (bp_location **last_loc) const -{ +{ struct ui_out *uiout = current_uiout; struct value_print_options opts; @@ -12429,41 +12171,40 @@ ada_catchpoint::print_one (bp_location **last_loc) const annotate_field (5); switch (m_kind) { - case ada_catch_exception: - if (!excep_string.empty ()) - { - std::string msg = string_printf (_("`%s' Ada exception"), - excep_string.c_str ()); + case ada_catch_exception: + if (!excep_string.empty ()) + { + std::string msg + = string_printf (_ ("`%s' Ada exception"), excep_string.c_str ()); - uiout->field_string ("what", msg); - } - else - uiout->field_string ("what", "all Ada exceptions"); - - break; + uiout->field_string ("what", msg); + } + else + uiout->field_string ("what", "all Ada exceptions"); - case ada_catch_exception_unhandled: - uiout->field_string ("what", "unhandled Ada exceptions"); - break; - - case ada_catch_handlers: - if (!excep_string.empty ()) - { - uiout->field_fmt ("what", - _("`%s' Ada exception handlers"), - excep_string.c_str ()); - } - else - uiout->field_string ("what", "all Ada exceptions handlers"); - break; + break; - case ada_catch_assert: - uiout->field_string ("what", "failed Ada assertions"); - break; + case ada_catch_exception_unhandled: + uiout->field_string ("what", "unhandled Ada exceptions"); + break; - default: - internal_error (_("unexpected catchpoint type")); - break; + case ada_catch_handlers: + if (!excep_string.empty ()) + { + uiout->field_fmt ("what", _ ("`%s' Ada exception handlers"), + excep_string.c_str ()); + } + else + uiout->field_string ("what", "all Ada exceptions handlers"); + break; + + case ada_catch_assert: + uiout->field_string ("what", "failed Ada assertions"); + break; + + default: + internal_error (_ ("unexpected catchpoint type")); + break; } return true; @@ -12477,47 +12218,46 @@ ada_catchpoint::print_mention () const { struct ui_out *uiout = current_uiout; - uiout->text (disposition == disp_del ? _("Temporary catchpoint ") - : _("Catchpoint ")); + uiout->text (disposition == disp_del ? _ ("Temporary catchpoint ") + : _ ("Catchpoint ")); uiout->field_signed ("bkptno", number); uiout->text (": "); switch (m_kind) { - case ada_catch_exception: - if (!excep_string.empty ()) - { - std::string info = string_printf (_("`%s' Ada exception"), - excep_string.c_str ()); - uiout->text (info); - } - else - uiout->text (_("all Ada exceptions")); - break; + case ada_catch_exception: + if (!excep_string.empty ()) + { + std::string info + = string_printf (_ ("`%s' Ada exception"), excep_string.c_str ()); + uiout->text (info); + } + else + uiout->text (_ ("all Ada exceptions")); + break; - case ada_catch_exception_unhandled: - uiout->text (_("unhandled Ada exceptions")); - break; + case ada_catch_exception_unhandled: + uiout->text (_ ("unhandled Ada exceptions")); + break; - case ada_catch_handlers: - if (!excep_string.empty ()) - { - std::string info - = string_printf (_("`%s' Ada exception handlers"), - excep_string.c_str ()); - uiout->text (info); - } - else - uiout->text (_("all Ada exceptions handlers")); - break; + case ada_catch_handlers: + if (!excep_string.empty ()) + { + std::string info = string_printf (_ ("`%s' Ada exception handlers"), + excep_string.c_str ()); + uiout->text (info); + } + else + uiout->text (_ ("all Ada exceptions handlers")); + break; - case ada_catch_assert: - uiout->text (_("failed Ada assertions")); - break; + case ada_catch_assert: + uiout->text (_ ("failed Ada assertions")); + break; - default: - internal_error (_("unexpected catchpoint type")); - break; + default: + internal_error (_ ("unexpected catchpoint type")); + break; } } @@ -12529,26 +12269,26 @@ ada_catchpoint::print_recreate (struct ui_file *fp) const { switch (m_kind) { - case ada_catch_exception: - gdb_printf (fp, "catch exception"); - if (!excep_string.empty ()) - gdb_printf (fp, " %s", excep_string.c_str ()); - break; + case ada_catch_exception: + gdb_printf (fp, "catch exception"); + if (!excep_string.empty ()) + gdb_printf (fp, " %s", excep_string.c_str ()); + break; - case ada_catch_exception_unhandled: - gdb_printf (fp, "catch exception unhandled"); - break; + case ada_catch_exception_unhandled: + gdb_printf (fp, "catch exception unhandled"); + break; - case ada_catch_handlers: - gdb_printf (fp, "catch handlers"); - break; + case ada_catch_handlers: + gdb_printf (fp, "catch handlers"); + break; - case ada_catch_assert: - gdb_printf (fp, "catch assert"); - break; + case ada_catch_assert: + gdb_printf (fp, "catch assert"); + break; - default: - internal_error (_("unexpected catchpoint type")); + default: + internal_error (_ ("unexpected catchpoint type")); } print_recreate_thread (fp); } @@ -12593,14 +12333,13 @@ catch_ada_exception_command_split (const char *args, /* Check to see if we have a condition. */ args = skip_spaces (args); - if (startswith (args, "if") - && (isspace (args[2]) || args[2] == '\0')) + if (startswith (args, "if") && (isspace (args[2]) || args[2] == '\0')) { args += 2; args = skip_spaces (args); if (args[0] == '\0') - error (_("Condition missing after `if' keyword")); + error (_ ("Condition missing after `if' keyword")); *cond_string = args; args += strlen (args); @@ -12610,7 +12349,7 @@ catch_ada_exception_command_split (const char *args, is unexpected. */ if (args[0] != '\0') - error (_("Junk at end of expression")); + error (_ ("Junk at end of expression")); if (is_catch_handlers_cmd) { @@ -12650,20 +12389,20 @@ ada_exception_sym_name (enum ada_exception_catchpoint_kind ex) switch (ex) { - case ada_catch_exception: - return (data->exception_info->catch_exception_sym); - break; - case ada_catch_exception_unhandled: - return (data->exception_info->catch_exception_unhandled_sym); - break; - case ada_catch_assert: - return (data->exception_info->catch_assert_sym); - break; - case ada_catch_handlers: - return (data->exception_info->catch_handlers_sym); - break; - default: - internal_error (_("unexpected catchpoint kind (%d)"), ex); + case ada_catch_exception: + return (data->exception_info->catch_exception_sym); + break; + case ada_catch_exception_unhandled: + return (data->exception_info->catch_exception_unhandled_sym); + break; + case ada_catch_assert: + return (data->exception_info->catch_assert_sym); + break; + case ada_catch_handlers: + return (data->exception_info->catch_handlers_sym); + break; + default: + internal_error (_ ("unexpected catchpoint kind (%d)"), ex); } } @@ -12751,10 +12490,10 @@ ada_exception_sal (enum ada_exception_catchpoint_kind ex, sym = standard_lookup (sym_name, NULL, VAR_DOMAIN); if (sym == NULL) - error (_("Catchpoint symbol not found: %s"), sym_name); + error (_ ("Catchpoint symbol not found: %s"), sym_name); if (sym->aclass () != LOC_BLOCK) - error (_("Unable to insert catchpoint. %s is not a function."), sym_name); + error (_ ("Unable to insert catchpoint. %s is not a function."), sym_name); /* Set ADDR_STRING. */ *addr_string = sym_name; @@ -12781,17 +12520,16 @@ void create_ada_exception_catchpoint (struct gdbarch *gdbarch, enum ada_exception_catchpoint_kind ex_kind, const std::string &excep_string, - const std::string &cond_string, - int tempflag, - int disabled, - int from_tty) + const std::string &cond_string, int tempflag, + int disabled, int from_tty) { std::string addr_string; struct symtab_and_line sal = ada_exception_sal (ex_kind, &addr_string); - std::unique_ptr c - (new ada_catchpoint (gdbarch, ex_kind, sal, addr_string.c_str (), - tempflag, disabled, from_tty)); + std::unique_ptr c (new ada_catchpoint (gdbarch, ex_kind, sal, + addr_string.c_str (), + tempflag, disabled, + from_tty)); c->excep_string = excep_string; create_excep_cond_exprs (c.get (), ex_kind); if (!cond_string.empty ()) @@ -12818,10 +12556,8 @@ catch_ada_exception_command (const char *arg_entry, int from_tty, arg = ""; catch_ada_exception_command_split (arg, false, &ex_kind, &excep_string, &cond_string); - create_ada_exception_catchpoint (gdbarch, ex_kind, - excep_string, cond_string, - tempflag, 1 /* enabled */, - from_tty); + create_ada_exception_catchpoint (gdbarch, ex_kind, excep_string, cond_string, + tempflag, 1 /* enabled */, from_tty); } /* Implement the "catch handlers" command. */ @@ -12843,10 +12579,8 @@ catch_ada_handlers_command (const char *arg_entry, int from_tty, arg = ""; catch_ada_exception_command_split (arg, true, &ex_kind, &excep_string, &cond_string); - create_ada_exception_catchpoint (gdbarch, ex_kind, - excep_string, cond_string, - tempflag, 1 /* enabled */, - from_tty); + create_ada_exception_catchpoint (gdbarch, ex_kind, excep_string, cond_string, + tempflag, 1 /* enabled */, from_tty); } /* Completion function for the Ada "catch" commands. */ @@ -12878,20 +12612,19 @@ catch_ada_assert_command_split (const char *args, std::string &cond_string) args = skip_spaces (args); /* Check whether a condition was provided. */ - if (startswith (args, "if") - && (isspace (args[2]) || args[2] == '\0')) + if (startswith (args, "if") && (isspace (args[2]) || args[2] == '\0')) { args += 2; args = skip_spaces (args); if (args[0] == '\0') - error (_("condition missing after `if' keyword")); + error (_ ("condition missing after `if' keyword")); cond_string.assign (args); } /* Otherwise, there should be no other argument at the end of the command. */ else if (args[0] != '\0') - error (_("Junk at end of arguments.")); + error (_ ("Junk at end of arguments.")); } /* Implement the "catch assert" command. */ @@ -12910,10 +12643,8 @@ catch_assert_command (const char *arg_entry, int from_tty, if (!arg) arg = ""; catch_ada_assert_command_split (arg, cond_string); - create_ada_exception_catchpoint (gdbarch, ada_catch_assert, - "", cond_string, - tempflag, 1 /* enabled */, - from_tty); + create_ada_exception_catchpoint (gdbarch, ada_catch_assert, "", cond_string, + tempflag, 1 /* enabled */, from_tty); } /* Return non-zero if the symbol SYM is an Ada exception object. */ @@ -12923,10 +12654,8 @@ ada_is_exception_sym (struct symbol *sym) { const char *type_name = sym->type ()->name (); - return (sym->aclass () != LOC_TYPEDEF - && sym->aclass () != LOC_BLOCK - && sym->aclass () != LOC_CONST - && sym->aclass () != LOC_UNRESOLVED + return (sym->aclass () != LOC_TYPEDEF && sym->aclass () != LOC_BLOCK + && sym->aclass () != LOC_CONST && sym->aclass () != LOC_UNRESOLVED && type_name != NULL && strcmp (type_name, "exception") == 0); } @@ -12942,7 +12671,7 @@ ada_is_non_standard_exception_sym (struct symbol *sym) for (const char *name : standard_exc) if (strcmp (sym->linkage_name (), name) == 0) - return 0; /* A standard exception. */ + return 0; /* A standard exception. */ /* Numeric_Error is also a standard exception, so exclude it. See the STANDARD_EXC description for more details as to why @@ -12960,7 +12689,7 @@ ada_is_non_standard_exception_sym (struct symbol *sym) by exception address. */ bool -ada_exc_info::operator< (const ada_exc_info &other) const +ada_exc_info::operator<(const ada_exc_info &other) const { int result; @@ -12988,7 +12717,8 @@ sort_remove_dups_ada_exceptions_list (std::vector *exceptions, int skip) { std::sort (exceptions->begin () + skip, exceptions->end ()); - exceptions->erase (std::unique (exceptions->begin () + skip, exceptions->end ()), + exceptions->erase (std::unique (exceptions->begin () + skip, + exceptions->end ()), exceptions->end ()); } @@ -13028,7 +12758,7 @@ ada_add_standard_exceptions (compiled_regex *preg, && msymbol->type () != mst_solib_trampoline) { ada_exc_info info - = {name, msymbol->value_address (objfile)}; + = { name, msymbol->value_address (objfile) }; exceptions->push_back (info); } @@ -13049,8 +12779,7 @@ ada_add_standard_exceptions (compiled_regex *preg, gets pushed. */ static void -ada_add_exceptions_from_frame (compiled_regex *preg, - frame_info_ptr frame, +ada_add_exceptions_from_frame (compiled_regex *preg, frame_info_ptr frame, std::vector *exceptions) { const struct block *block = get_frame_block (frame, 0); @@ -13071,8 +12800,8 @@ ada_add_exceptions_from_frame (compiled_regex *preg, default: if (ada_is_exception_sym (sym)) { - struct ada_exc_info info = {sym->print_name (), - sym->value_address ()}; + struct ada_exc_info info + = { sym->print_name (), sym->value_address () }; exceptions->push_back (info); } @@ -13119,16 +12848,13 @@ ada_add_global_exceptions (compiled_regex *preg, /* In Ada, the symbol "search name" is a linkage name, whereas the regular expression used to do the matching refers to the natural name. So match against the decoded name. */ - expand_symtabs_matching (NULL, - lookup_name_info::match_any (), - [&] (const char *search_name) - { - std::string decoded = ada_decode (search_name); - return name_matches_regex (decoded.c_str (), preg); - }, - NULL, - SEARCH_GLOBAL_BLOCK | SEARCH_STATIC_BLOCK, - VARIABLES_DOMAIN); + expand_symtabs_matching ( + NULL, lookup_name_info::match_any (), + [&] (const char *search_name) { + std::string decoded = ada_decode (search_name); + return name_matches_regex (decoded.c_str (), preg); + }, + NULL, SEARCH_GLOBAL_BLOCK | SEARCH_STATIC_BLOCK, VARIABLES_DOMAIN); /* Iterate over all objfiles irrespective of scope or linker namespaces so we get all exceptions anywhere in the progspace. */ @@ -13150,7 +12876,7 @@ ada_add_global_exceptions (compiled_regex *preg, && name_matches_regex (sym->natural_name (), preg)) { struct ada_exc_info info - = {sym->print_name (), sym->value_address ()}; + = { sym->print_name (), sym->value_address () }; exceptions->push_back (info); } @@ -13183,8 +12909,7 @@ ada_exceptions_list_1 (compiled_regex *preg) if (has_stack_frames ()) { prev_len = result.size (); - ada_add_exceptions_from_frame (preg, get_selected_frame (NULL), - &result); + ada_add_exceptions_from_frame (preg, get_selected_frame (NULL), &result); if (result.size () > prev_len) sort_remove_dups_ada_exceptions_list (&result, prev_len); } @@ -13219,7 +12944,7 @@ ada_exceptions_list (const char *regexp) if (regexp == NULL) return ada_exceptions_list_1 (NULL); - compiled_regex reg (regexp, REG_NOSUB, _("invalid regular expression")); + compiled_regex reg (regexp, REG_NOSUB, _ ("invalid regular expression")); return ada_exceptions_list_1 (®); } @@ -13233,17 +12958,16 @@ info_exceptions_command (const char *regexp, int from_tty) std::vector exceptions = ada_exceptions_list (regexp); if (regexp != NULL) - gdb_printf - (_("All Ada exceptions matching regular expression \"%s\":\n"), regexp); + gdb_printf (_ ("All Ada exceptions matching regular expression \"%s\":\n"), + regexp); else - gdb_printf (_("All defined Ada exceptions:\n")); + gdb_printf (_ ("All defined Ada exceptions:\n")); for (const ada_exc_info &info : exceptions) gdb_printf ("%s: %s\n", info.name, paddress (gdbarch, info.addr)); } - - /* Language vector */ +/* Language vector */ /* symbol_name_matcher_ftype adapter for wild_match. */ @@ -13268,8 +12992,7 @@ do_full_match (const char *symbol_search_name, handle the comparison. However, if only the symbol name starts with "_ada_", skip the prefix and let the match proceed as usual. */ - if (startswith (symbol_search_name, "_ada_") - && !startswith (lname, "_ada")) + if (startswith (symbol_search_name, "_ada_") && !startswith (lname, "_ada")) symbol_search_name += 5; /* Likewise for ghost entities. */ if (startswith (symbol_search_name, "___ghost_") @@ -13287,8 +13010,7 @@ do_full_match (const char *symbol_search_name, symbol_search_name += 2; while (isdigit (*symbol_search_name)) ++symbol_search_name; - if (symbol_search_name[0] == '_' - && symbol_search_name[1] == '_') + if (symbol_search_name[0] == '_' && symbol_search_name[1] == '_') { symbol_search_name += 2; continue; @@ -13321,7 +13043,8 @@ do_exact_match (const char *symbol_search_name, /* Build the Ada lookup name for LOOKUP_NAME. */ -ada_lookup_name_info::ada_lookup_name_info (const lookup_name_info &lookup_name) +ada_lookup_name_info::ada_lookup_name_info ( + const lookup_name_info &lookup_name) { gdb::string_view user_name = lookup_name.name (); @@ -13372,8 +13095,7 @@ ada_lookup_name_info::ada_lookup_name_info (const lookup_name_info &lookup_name) non-wild matching. */ m_wild_match_p = (lookup_name.match_type () != symbol_name_match_type::FULL - && !m_encoded_p - && !m_standard_p + && !m_encoded_p && !m_standard_p && user_name.find ('.') == std::string::npos); } } @@ -13402,9 +13124,9 @@ literal_symbol_name_matcher (const char *symbol_search_name, gdb::string_view name_view = lookup_name.name (); if (lookup_name.completion_mode () - ? (strncmp (symbol_search_name, name_view.data (), - name_view.size ()) == 0) - : symbol_search_name == name_view) + ? (strncmp (symbol_search_name, name_view.data (), name_view.size ()) + == 0) + : symbol_search_name == name_view) { if (comp_match_res != NULL) comp_match_res->set_match (symbol_search_name); @@ -13441,19 +13163,19 @@ ada_get_symbol_name_matcher (const lookup_name_info &lookup_name) class ada_language : public language_defn { public: + ada_language () : language_defn (language_ada) - { /* Nothing. */ } + { /* Nothing. */ + } /* See language.h. */ - const char *name () const override - { return "ada"; } + const char *name () const override { return "ada"; } /* See language.h. */ - const char *natural_name () const override - { return "Ada"; } + const char *natural_name () const override { return "Ada"; } /* See language.h. */ @@ -13466,8 +13188,7 @@ public: /* Print an array element index using the Ada syntax. */ - void print_array_index (struct type *index_type, - LONGEST index, + void print_array_index (struct type *index_type, LONGEST index, struct ui_file *stream, const value_print_options *options) const override { @@ -13510,41 +13231,36 @@ public: const struct builtin_type *builtin = builtin_type (gdbarch); /* Helper function to allow shorter lines below. */ - auto add = [&] (struct type *t) - { - lai->add_primitive_type (t); - }; - - add (arch_integer_type (gdbarch, gdbarch_int_bit (gdbarch), - 0, "integer")); - add (arch_integer_type (gdbarch, gdbarch_long_bit (gdbarch), - 0, "long_integer")); - add (arch_integer_type (gdbarch, gdbarch_short_bit (gdbarch), - 0, "short_integer")); - struct type *char_type = arch_character_type (gdbarch, TARGET_CHAR_BIT, - 1, "character"); + auto add = [&] (struct type *t) { lai->add_primitive_type (t); }; + + add (arch_integer_type (gdbarch, gdbarch_int_bit (gdbarch), 0, "integer")); + add (arch_integer_type (gdbarch, gdbarch_long_bit (gdbarch), 0, + "long_integer")); + add (arch_integer_type (gdbarch, gdbarch_short_bit (gdbarch), 0, + "short_integer")); + struct type *char_type + = arch_character_type (gdbarch, TARGET_CHAR_BIT, 1, "character"); lai->set_string_char_type (char_type); add (char_type); add (arch_character_type (gdbarch, 16, 1, "wide_character")); add (arch_character_type (gdbarch, 32, 1, "wide_wide_character")); - add (arch_float_type (gdbarch, gdbarch_float_bit (gdbarch), - "float", gdbarch_float_format (gdbarch))); - add (arch_float_type (gdbarch, gdbarch_double_bit (gdbarch), - "long_float", gdbarch_double_format (gdbarch))); - add (arch_integer_type (gdbarch, gdbarch_long_long_bit (gdbarch), - 0, "long_long_integer")); + add (arch_float_type (gdbarch, gdbarch_float_bit (gdbarch), "float", + gdbarch_float_format (gdbarch))); + add (arch_float_type (gdbarch, gdbarch_double_bit (gdbarch), "long_float", + gdbarch_double_format (gdbarch))); + add (arch_integer_type (gdbarch, gdbarch_long_long_bit (gdbarch), 0, + "long_long_integer")); add (arch_float_type (gdbarch, gdbarch_long_double_bit (gdbarch), "long_long_float", gdbarch_long_double_format (gdbarch))); - add (arch_integer_type (gdbarch, gdbarch_int_bit (gdbarch), - 0, "natural")); - add (arch_integer_type (gdbarch, gdbarch_int_bit (gdbarch), - 0, "positive")); + add (arch_integer_type (gdbarch, gdbarch_int_bit (gdbarch), 0, "natural")); + add (arch_integer_type (gdbarch, gdbarch_int_bit (gdbarch), 0, + "positive")); add (builtin->builtin_void); struct type *system_addr_ptr - = lookup_pointer_type (arch_type (gdbarch, TYPE_CODE_VOID, TARGET_CHAR_BIT, - "void")); + = lookup_pointer_type (arch_type (gdbarch, TYPE_CODE_VOID, + TARGET_CHAR_BIT, "void")); system_addr_ptr->set_name ("system__address"); add (system_addr_ptr); @@ -13560,10 +13276,10 @@ public: /* See language.h. */ - bool iterate_over_symbols - (const struct block *block, const lookup_name_info &name, - domain_enum domain, - gdb::function_view callback) const override + bool iterate_over_symbols ( + const struct block *block, const lookup_name_info &name, + domain_enum domain, + gdb::function_view callback) const override { std::vector results = ada_lookup_symbol_list_worker (name, block, domain, 0); @@ -13577,9 +13293,9 @@ public: } /* See language.h. */ - bool sniff_from_mangled_name - (const char *mangled, - gdb::unique_xmalloc_ptr *out) const override + bool + sniff_from_mangled_name (const char *mangled, + gdb::unique_xmalloc_ptr *out) const override { std::string demangled = ada_decode (mangled); @@ -13641,11 +13357,10 @@ public: /* See language.h. */ - void collect_symbol_completion_matches (completion_tracker &tracker, - complete_symbol_mode mode, - symbol_name_match_type name_match_type, - const char *text, const char *word, - enum type_code code) const override + void collect_symbol_completion_matches ( + completion_tracker &tracker, complete_symbol_mode mode, + symbol_name_match_type name_match_type, const char *text, const char *word, + enum type_code code) const override { struct symbol *sym; const struct block *b, *surrounding_static_block = 0; @@ -13656,10 +13371,7 @@ public: lookup_name_info lookup_name (text, name_match_type, true); /* First, look at the partial symtab symbols. */ - expand_symtabs_matching (NULL, - lookup_name, - NULL, - NULL, + expand_symtabs_matching (NULL, lookup_name, NULL, NULL, SEARCH_GLOBAL_BLOCK | SEARCH_STATIC_BLOCK, ALL_DOMAIN); @@ -13694,10 +13406,9 @@ public: || symbol_language == language_cplus) symbol_language = language_ada; - completion_list_add_name (tracker, - symbol_language, - msymbol->linkage_name (), - lookup_name, text, word); + completion_list_add_name (tracker, symbol_language, + msymbol->linkage_name (), lookup_name, + text, word); } } @@ -13707,17 +13418,16 @@ public: for (b = get_selected_block (0); b != NULL; b = b->superblock ()) { if (!b->superblock ()) - surrounding_static_block = b; /* For elmin of dups */ + surrounding_static_block = b; /* For elmin of dups */ ALL_BLOCK_SYMBOLS (b, iter, sym) { if (completion_skip_symbol (mode, sym)) continue; - completion_list_add_name (tracker, - sym->language (), - sym->linkage_name (), - lookup_name, text, word); + completion_list_add_name (tracker, sym->language (), + sym->linkage_name (), lookup_name, text, + word); } } @@ -13735,10 +13445,9 @@ public: if (completion_skip_symbol (mode, sym)) continue; - completion_list_add_name (tracker, - sym->language (), - sym->linkage_name (), - lookup_name, text, word); + completion_list_add_name (tracker, sym->language (), + sym->linkage_name (), lookup_name, + text, word); } } } @@ -13757,10 +13466,9 @@ public: if (completion_skip_symbol (mode, sym)) continue; - completion_list_add_name (tracker, - sym->language (), - sym->linkage_name (), - lookup_name, text, word); + completion_list_add_name (tracker, sym->language (), + sym->linkage_name (), lookup_name, + text, word); } } } @@ -13768,8 +13476,8 @@ public: /* See language.h. */ - gdb::unique_xmalloc_ptr watch_location_expression - (struct type *type, CORE_ADDR addr) const override + gdb::unique_xmalloc_ptr + watch_location_expression (struct type *type, CORE_ADDR addr) const override { type = check_typedef (check_typedef (type)->target_type ()); std::string name = type_to_string (type); @@ -13786,18 +13494,18 @@ public: /* See language.h. */ - void value_print_inner - (struct value *val, struct ui_file *stream, int recurse, - const struct value_print_options *options) const override + void + value_print_inner (struct value *val, struct ui_file *stream, int recurse, + const struct value_print_options *options) const override { return ada_value_print_inner (val, stream, recurse, options); } /* See language.h. */ - struct block_symbol lookup_symbol_nonlocal - (const char *name, const struct block *block, - const domain_enum domain) const override + struct block_symbol + lookup_symbol_nonlocal (const char *name, const struct block *block, + const domain_enum domain) const override { struct block_symbol sym; @@ -13844,8 +13552,8 @@ public: /* See language.h. */ - void emitchar (int ch, struct type *chtype, - struct ui_file *stream, int quoter) const override + void emitchar (int ch, struct type *chtype, struct ui_file *stream, + int quoter) const override { ada_emit_char (ch, chtype, stream, quoter, 1); } @@ -13865,8 +13573,8 @@ public: const char *encoding, int force_ellipses, const struct value_print_options *options) const override { - ada_printstr (stream, elttype, string, length, encoding, - force_ellipses, options); + ada_printstr (stream, elttype, string, length, encoding, force_ellipses, + options); } /* See language.h. */ @@ -13886,29 +13594,29 @@ public: /* See language.h. */ - const char *struct_too_deep_ellipsis () const override - { return "(...)"; } + const char *struct_too_deep_ellipsis () const override { return "(...)"; } /* See language.h. */ - bool c_style_arrays_p () const override - { return false; } + bool c_style_arrays_p () const override { return false; } /* See language.h. */ - bool store_sym_names_in_linkage_form_p () const override - { return true; } + bool store_sym_names_in_linkage_form_p () const override { return true; } /* See language.h. */ const struct lang_varobj_ops *varobj_ops () const override - { return &ada_varobj_ops; } + { + return &ada_varobj_ops; + } protected: + /* See language.h. */ - symbol_name_matcher_ftype *get_symbol_name_matcher_inner - (const lookup_name_info &lookup_name) const override + symbol_name_matcher_ftype *get_symbol_name_matcher_inner ( + const lookup_name_info &lookup_name) const override { return ada_get_symbol_name_matcher (lookup_name); } @@ -13939,41 +13647,33 @@ ada_free_objfile_observer (struct objfile *objfile) } /* Charsets known to GNAT. */ -static const char * const gnat_source_charsets[] = -{ +static const char *const gnat_source_charsets[] = { /* Note that code below assumes that the default comes first. Latin-1 is the default here, because that is also GNAT's default. */ - "ISO-8859-1", - "ISO-8859-2", - "ISO-8859-3", - "ISO-8859-4", - "ISO-8859-5", - "ISO-8859-15", - "CP437", - "CP850", + "ISO-8859-1", "ISO-8859-2", "ISO-8859-3", "ISO-8859-4", "ISO-8859-5", + "ISO-8859-15", "CP437", "CP850", /* Note that this value is special-cased in the encoder and decoder. */ - ada_utf8, - nullptr + ada_utf8, nullptr }; void _initialize_ada_language (); + void _initialize_ada_language () { - add_setshow_prefix_cmd - ("ada", no_class, - _("Prefix command for changing Ada-specific settings."), - _("Generic command for showing Ada-specific settings."), - &set_ada_list, &show_ada_list, - &setlist, &showlist); + add_setshow_prefix_cmd ( + "ada", no_class, _ ("Prefix command for changing Ada-specific settings."), + _ ("Generic command for showing Ada-specific settings."), &set_ada_list, + &show_ada_list, &setlist, &showlist); add_setshow_boolean_cmd ("trust-PAD-over-XVS", class_obscure, - &trust_pad_over_xvs, _("\ -Enable or disable an optimization trusting PAD types over XVS types."), _("\ + &trust_pad_over_xvs, _ ("\ +Enable or disable an optimization trusting PAD types over XVS types."), + _ ("\ Show whether an optimization trusting PAD types over XVS types is activated."), - _("\ + _ ("\ This is related to the encoding used by the GNAT compiler. The debugger\n\ should normally trust the contents of PAD types, but certain older versions\n\ of GNAT have a bug that sometimes causes the information in the PAD type\n\ @@ -13981,28 +13681,29 @@ to be incorrect. Turning this setting \"off\" allows the debugger to\n\ work around this bug. It is always safe to turn this option \"off\", but\n\ this incurs a slight performance penalty, so it is recommended to NOT change\n\ this option to \"off\" unless necessary."), - NULL, NULL, &set_ada_list, &show_ada_list); + NULL, NULL, &set_ada_list, &show_ada_list); - add_setshow_boolean_cmd ("print-signatures", class_vars, - &print_signatures, _("\ + add_setshow_boolean_cmd ("print-signatures", class_vars, &print_signatures, + _ ("\ Enable or disable the output of formal and return types for functions in the \ -overloads selection menu."), _("\ +overloads selection menu."), + _ ("\ Show whether the output of formal and return types for functions in the \ overloads selection menu is activated."), NULL, NULL, NULL, &set_ada_list, &show_ada_list); ada_source_charset = gnat_source_charsets[0]; - add_setshow_enum_cmd ("source-charset", class_files, - gnat_source_charsets, - &ada_source_charset, _("\ -Set the Ada source character set."), _("\ -Show the Ada source character set."), _("\ + add_setshow_enum_cmd ("source-charset", class_files, gnat_source_charsets, + &ada_source_charset, _ ("\ +Set the Ada source character set."), + _ ("\ +Show the Ada source character set."), + _ ("\ The character set used for Ada source files.\n\ This must correspond to the '-gnati' or '-gnatW' option passed to GNAT."), - nullptr, nullptr, - &set_ada_list, &show_ada_list); + nullptr, nullptr, &set_ada_list, &show_ada_list); - add_catch_command ("exception", _("\ + add_catch_command ("exception", _ ("\ Catch Ada exceptions, when raised.\n\ Usage: catch exception [ARG] [if CONDITION]\n\ Without any argument, stop when any Ada exception is raised.\n\ @@ -14013,58 +13714,51 @@ Otherwise, the catchpoint only stops when the name of the exception being\n\ raised is the same as ARG.\n\ CONDITION is a boolean expression that is evaluated to see whether the\n\ exception should cause a stop."), - catch_ada_exception_command, - catch_ada_completer, - CATCH_PERMANENT, - CATCH_TEMPORARY); + catch_ada_exception_command, catch_ada_completer, + CATCH_PERMANENT, CATCH_TEMPORARY); - add_catch_command ("handlers", _("\ + add_catch_command ("handlers", _ ("\ Catch Ada exceptions, when handled.\n\ Usage: catch handlers [ARG] [if CONDITION]\n\ Without any argument, stop when any Ada exception is handled.\n\ With an argument, catch only exceptions with the given name.\n\ CONDITION is a boolean expression that is evaluated to see whether the\n\ exception should cause a stop."), - catch_ada_handlers_command, - catch_ada_completer, - CATCH_PERMANENT, - CATCH_TEMPORARY); - add_catch_command ("assert", _("\ + catch_ada_handlers_command, catch_ada_completer, + CATCH_PERMANENT, CATCH_TEMPORARY); + add_catch_command ("assert", _ ("\ Catch failed Ada assertions, when raised.\n\ Usage: catch assert [if CONDITION]\n\ CONDITION is a boolean expression that is evaluated to see whether the\n\ exception should cause a stop."), - catch_assert_command, - NULL, - CATCH_PERMANENT, + catch_assert_command, NULL, CATCH_PERMANENT, CATCH_TEMPORARY); - add_info ("exceptions", info_exceptions_command, - _("\ + add_info ("exceptions", info_exceptions_command, _ ("\ List all Ada exception names.\n\ Usage: info exceptions [REGEXP]\n\ If a regular expression is passed as an argument, only those matching\n\ the regular expression are listed.")); add_setshow_prefix_cmd ("ada", class_maintenance, - _("Set Ada maintenance-related variables."), - _("Show Ada maintenance-related variables."), + _ ("Set Ada maintenance-related variables."), + _ ("Show Ada maintenance-related variables."), &maint_set_ada_cmdlist, &maint_show_ada_cmdlist, &maintenance_set_cmdlist, &maintenance_show_cmdlist); - add_setshow_boolean_cmd - ("ignore-descriptive-types", class_maintenance, - &ada_ignore_descriptive_types_p, - _("Set whether descriptive types generated by GNAT should be ignored."), - _("Show whether descriptive types generated by GNAT should be ignored."), - _("\ + add_setshow_boolean_cmd ( + "ignore-descriptive-types", class_maintenance, + &ada_ignore_descriptive_types_p, + _ ("Set whether descriptive types generated by GNAT should be ignored."), + _ ("Show whether descriptive types generated by GNAT should be ignored."), + _ ("\ When enabled, the debugger will stop using the DW_AT_GNAT_descriptive_type\n\ DWARF attribute."), - NULL, NULL, &maint_set_ada_cmdlist, &maint_show_ada_cmdlist); + NULL, NULL, &maint_set_ada_cmdlist, &maint_show_ada_cmdlist); - decoded_names_store = htab_create_alloc (256, htab_hash_string, - htab_eq_string, - NULL, xcalloc, xfree); + decoded_names_store + = htab_create_alloc (256, htab_hash_string, htab_eq_string, NULL, xcalloc, + xfree); /* The ada-lang observers. */ gdb::observers::new_objfile.attach (ada_new_objfile_observer, "ada-lang"); diff --git a/gdb/ada-lang.h b/gdb/ada-lang.h index 9fb7ac7..a3c5305 100644 --- a/gdb/ada-lang.h +++ b/gdb/ada-lang.h @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#if !defined (ADA_LANG_H) +#if !defined(ADA_LANG_H) #define ADA_LANG_H 1 class frame_info_ptr; @@ -33,25 +33,22 @@ struct parser_state; system and that might consider (confusing) debugging information. Each name (a basic regular expression string) is followed by a comma. FIXME: Should be part of a configuration file. */ -#if defined (__linux__) -#define ADA_KNOWN_RUNTIME_FILE_NAME_PATTERNS \ - "^[agis]-.*\\.ad[bs]$", \ - "/lib.*/libpthread\\.so[.0-9]*$", "/lib.*/libpthread\\.a$", \ - "/lib.*/libc\\.so[.0-9]*$", "/lib.*/libc\\.a$", +#if defined(__linux__) +#define ADA_KNOWN_RUNTIME_FILE_NAME_PATTERNS \ + "^[agis]-.*\\.ad[bs]$", "/lib.*/libpthread\\.so[.0-9]*$", \ + "/lib.*/libpthread\\.a$", "/lib.*/libc\\.so[.0-9]*$", "/lib.*/libc\\.a$", #endif -#if !defined (ADA_KNOWN_RUNTIME_FILE_NAME_PATTERNS) +#if !defined(ADA_KNOWN_RUNTIME_FILE_NAME_PATTERNS) #define ADA_KNOWN_RUNTIME_FILE_NAME_PATTERNS \ - "^unwind-seh.c$", \ - "^[agis]-.*\\.ad[bs]$", + "^unwind-seh.c$", "^[agis]-.*\\.ad[bs]$", #endif /* Names of compiler-generated auxiliary functions probably of no interest to users. Each name (a basic regular expression string) is followed by a comma. */ #define ADA_KNOWN_AUXILIARY_FUNCTION_NAME_PATTERNS \ - "___clean[.$a-zA-Z0-9_]*$", \ - "___finalizer[.$a-zA-Z0-9_]*$", + "___clean[.$a-zA-Z0-9_]*$", "___finalizer[.$a-zA-Z0-9_]*$", /* The maximum number of frame levels searched for non-local, non-global symbols. This limit exists as a precaution to prevent @@ -80,25 +77,25 @@ extern const struct ada_opname_map ada_opname_table[]; /* Denotes a type of renaming symbol (see ada_parse_renaming). */ enum ada_renaming_category - { - /* Indicates a symbol that does not encode a renaming. */ - ADA_NOT_RENAMING, +{ + /* Indicates a symbol that does not encode a renaming. */ + ADA_NOT_RENAMING, - /* For symbols declared + /* For symbols declared Foo : TYPE renamed OBJECT; */ - ADA_OBJECT_RENAMING, + ADA_OBJECT_RENAMING, - /* For symbols declared + /* For symbols declared Foo : exception renames EXCEPTION; */ - ADA_EXCEPTION_RENAMING, - /* For packages declared + ADA_EXCEPTION_RENAMING, + /* For packages declared package Foo renames PACKAGE; */ - ADA_PACKAGE_RENAMING, - /* For subprograms declared + ADA_PACKAGE_RENAMING, + /* For subprograms declared SUBPROGRAM_SPEC renames SUBPROGRAM; (Currently not used). */ - ADA_SUBPROGRAM_RENAMING - }; + ADA_SUBPROGRAM_RENAMING +}; /* The different types of catchpoints that we introduced for catching Ada exceptions. */ @@ -150,12 +147,11 @@ struct ada_task_info }; extern int ada_get_field_index (const struct type *type, - const char *field_name, - int maybe_missing); + const char *field_name, int maybe_missing); -extern int ada_parse (struct parser_state *); /* Defined in ada-exp.y */ +extern int ada_parse (struct parser_state *); /* Defined in ada-exp.y */ - /* Defined in ada-typeprint.c */ +/* Defined in ada-typeprint.c */ extern void ada_print_type (struct type *, const char *, struct ui_file *, int, int, const struct type_print_options *); @@ -170,7 +166,7 @@ extern void ada_value_print_inner (struct value *, struct ui_file *, int, extern void ada_value_print (struct value *, struct ui_file *, const struct value_print_options *); - /* Defined in ada-lang.c */ +/* Defined in ada-lang.c */ extern void ada_emit_char (int, struct type *, struct ui_file *, int, int); @@ -223,24 +219,23 @@ extern const char *ada_decode_symbol (const struct general_symbol_info *); extern std::string ada_decode (const char *name, bool wrap = true, bool operators = true); -extern std::vector ada_lookup_symbol_list - (const char *, const struct block *, domain_enum); +extern std::vector +ada_lookup_symbol_list (const char *, const struct block *, domain_enum); -extern struct block_symbol ada_lookup_symbol (const char *, - const struct block *, - domain_enum); +extern struct block_symbol +ada_lookup_symbol (const char *, const struct block *, domain_enum); -extern void ada_lookup_encoded_symbol - (const char *name, const struct block *block, domain_enum domain, - struct block_symbol *symbol_info); +extern void ada_lookup_encoded_symbol (const char *name, + const struct block *block, + domain_enum domain, + struct block_symbol *symbol_info); extern struct bound_minimal_symbol ada_lookup_simple_minsym (const char *, objfile *); extern int ada_scan_number (const char *, int, LONGEST *, int *); -extern struct value *ada_value_primitive_field (struct value *arg1, - int offset, +extern struct value *ada_value_primitive_field (struct value *arg1, int offset, int fieldno, struct type *arg_type); @@ -251,9 +246,8 @@ extern int ada_is_ignored_field (struct type *, int); extern int ada_is_constrained_packed_array_type (struct type *); extern struct value *ada_value_primitive_packed_val (struct value *, - const gdb_byte *, - long, int, int, - struct type *); + const gdb_byte *, long, + int, int, struct type *); extern struct type *ada_coerce_to_simple_array_type (struct type *); @@ -296,18 +290,15 @@ extern struct type *ada_to_fixed_type (struct type *, const gdb_byte *, extern struct value *ada_to_fixed_value (struct value *val); -extern struct type *ada_template_to_fixed_record_type_1 (struct type *type, - const gdb_byte *valaddr, - CORE_ADDR address, - struct value *dval0, - int keep_dynamic_fields); +extern struct type *ada_template_to_fixed_record_type_1 ( + struct type *type, const gdb_byte *valaddr, CORE_ADDR address, + struct value *dval0, int keep_dynamic_fields); extern int ada_name_prefix_len (const char *); extern const char *ada_type_name (struct type *); -extern struct type *ada_find_parallel_type (struct type *, - const char *suffix); +extern struct type *ada_find_parallel_type (struct type *, const char *suffix); extern bool get_int_var_value (const char *, LONGEST &value); @@ -331,9 +322,8 @@ extern void ada_print_scalar (struct type *, LONGEST, struct ui_file *); extern int ada_is_range_type_name (const char *); -extern enum ada_renaming_category ada_parse_renaming (struct symbol *, - const char **, - int *, const char **); +extern enum ada_renaming_category +ada_parse_renaming (struct symbol *, const char **, int *, const char **); extern void ada_find_printable_frame (frame_info_ptr fi); @@ -341,10 +331,10 @@ extern char *ada_breakpoint_rewrite (char *, int *); extern char *ada_main_name (void); -extern void create_ada_exception_catchpoint - (struct gdbarch *gdbarch, enum ada_exception_catchpoint_kind ex_kind, - const std::string &excep_string, const std::string &cond_string, int tempflag, - int disabled, int from_tty); +extern void create_ada_exception_catchpoint ( + struct gdbarch *gdbarch, enum ada_exception_catchpoint_kind ex_kind, + const std::string &excep_string, const std::string &cond_string, + int tempflag, int disabled, int from_tty); /* Return true if BP is an Ada catchpoint. */ @@ -360,7 +350,7 @@ struct ada_exc_info /* The address of the symbol corresponding to that exception. */ CORE_ADDR addr; - bool operator< (const ada_exc_info &) const; + bool operator<(const ada_exc_info &) const; bool operator== (const ada_exc_info &) const; }; @@ -376,13 +366,12 @@ extern int ada_get_task_number (thread_info *thread); typedef gdb::function_view ada_task_list_iterator_ftype; -extern void iterate_over_live_ada_tasks - (ada_task_list_iterator_ftype iterator); +extern void +iterate_over_live_ada_tasks (ada_task_list_iterator_ftype iterator); extern const char *ada_get_tcb_types_info (void); -extern void print_ada_task_info (struct ui_out *uiout, - const char *taskno_str, +extern void print_ada_task_info (struct ui_out *uiout, const char *taskno_str, struct inferior *inf); /* Look for a symbol for an overloaded operator for the operation OP. @@ -391,8 +380,8 @@ extern void print_ada_task_info (struct ui_out *uiout, "null" block_symbol if no such operator is found. */ extern block_symbol ada_find_operator_symbol (enum exp_opcode op, - bool parse_completion, - int nargs, value *argvec[]); + bool parse_completion, int nargs, + value *argvec[]); /* Resolve a function call, selecting among possible function symbols. SYM and BLOCK are passed to ada_lookup_symbol_list. CONTEXT_TYPE @@ -404,8 +393,8 @@ extern block_symbol ada_find_operator_symbol (enum exp_opcode op, extern block_symbol ada_resolve_funcall (struct symbol *sym, const struct block *block, struct type *context_type, - bool parse_completion, - int nargs, value *argvec[], + bool parse_completion, int nargs, + value *argvec[], innermost_block_tracker *tracker); /* Resolve a symbol reference, selecting among possible values. SYM @@ -416,12 +405,10 @@ extern block_symbol ada_resolve_funcall (struct symbol *sym, through ada_resolve_function. This returns the chosen symbol and will update TRACKER accordingly. */ -extern block_symbol ada_resolve_variable (struct symbol *sym, - const struct block *block, - struct type *context_type, - bool parse_completion, - int deprocedure_p, - innermost_block_tracker *tracker); +extern block_symbol +ada_resolve_variable (struct symbol *sym, const struct block *block, + struct type *context_type, bool parse_completion, + int deprocedure_p, innermost_block_tracker *tracker); /* The type of nth index in arrays of given type (n numbering from 1). Does not examine memory. Throws an error if N is invalid or TYPE diff --git a/gdb/ada-tasks.c b/gdb/ada-tasks.c index a3a2806..a5bbf3a 100644 --- a/gdb/ada-tasks.c +++ b/gdb/ada-tasks.c @@ -64,75 +64,70 @@ enum task_states }; /* A short description corresponding to each possible task state. */ -static const char * const task_states[] = { - N_("Unactivated"), - N_("Runnable"), - N_("Terminated"), - N_("Child Activation Wait"), - N_("Accept or Select Term"), - N_("Waiting on entry call"), - N_("Async Select Wait"), - N_("Delay Sleep"), - N_("Child Termination Wait"), - N_("Wait Child in Term Alt"), - "", - "", - "", - "", - N_("Asynchronous Hold"), - "", - N_("Activating"), - N_("Selective Wait") -}; +static const char *const task_states[] = { N_ ("Unactivated"), + N_ ("Runnable"), + N_ ("Terminated"), + N_ ("Child Activation Wait"), + N_ ("Accept or Select Term"), + N_ ("Waiting on entry call"), + N_ ("Async Select Wait"), + N_ ("Delay Sleep"), + N_ ("Child Termination Wait"), + N_ ("Wait Child in Term Alt"), + "", + "", + "", + "", + N_ ("Asynchronous Hold"), + "", + N_ ("Activating"), + N_ ("Selective Wait") }; /* Return a string representing the task state. */ static const char * get_state (unsigned value) { - if (value >= 0 - && value <= ARRAY_SIZE (task_states) + if (value >= 0 && value <= ARRAY_SIZE (task_states) && task_states[value][0] != '\0') - return _(task_states[value]); + return _ (task_states[value]); static char buffer[100]; - xsnprintf (buffer, sizeof (buffer), _("Unknown task state: %d"), value); + xsnprintf (buffer, sizeof (buffer), _ ("Unknown task state: %d"), value); return buffer; } /* A longer description corresponding to each possible task state. */ -static const char * const long_task_states[] = { - N_("Unactivated"), - N_("Runnable"), - N_("Terminated"), - N_("Waiting for child activation"), - N_("Blocked in accept or select with terminate"), - N_("Waiting on entry call"), - N_("Asynchronous Selective Wait"), - N_("Delay Sleep"), - N_("Waiting for children termination"), - N_("Waiting for children in terminate alternative"), - "", - "", - "", - "", - N_("Asynchronous Hold"), - "", - N_("Activating"), - N_("Blocked in selective wait statement") -}; +static const char *const long_task_states[] + = { N_ ("Unactivated"), + N_ ("Runnable"), + N_ ("Terminated"), + N_ ("Waiting for child activation"), + N_ ("Blocked in accept or select with terminate"), + N_ ("Waiting on entry call"), + N_ ("Asynchronous Selective Wait"), + N_ ("Delay Sleep"), + N_ ("Waiting for children termination"), + N_ ("Waiting for children in terminate alternative"), + "", + "", + "", + "", + N_ ("Asynchronous Hold"), + "", + N_ ("Activating"), + N_ ("Blocked in selective wait statement") }; /* Return a string representing the task state. This uses the long descriptions. */ static const char * get_long_state (unsigned value) { - if (value >= 0 - && value <= ARRAY_SIZE (long_task_states) + if (value >= 0 && value <= ARRAY_SIZE (long_task_states) && long_task_states[value][0] != '\0') - return _(long_task_states[value]); + return _ (long_task_states[value]); static char buffer[100]; - xsnprintf (buffer, sizeof (buffer), _("Unknown task state: %d"), value); + xsnprintf (buffer, sizeof (buffer), _ ("Unknown task state: %d"), value); return buffer; } @@ -151,7 +146,7 @@ struct atcb_fieldnos int parent; int priority; int image; - int image_len; /* This field may be missing. */ + int image_len; /* This field may be missing. */ int activation_link; int call; int ll; @@ -159,7 +154,7 @@ struct atcb_fieldnos /* Fields in Task_Primitives.Private_Data. */ int ll_thread; - int ll_lwp; /* This field may be missing. */ + int ll_lwp; /* This field may be missing. */ /* Fields in Common_ATCB.Call.all. */ int call_self; @@ -187,7 +182,9 @@ struct ada_tasks_pspace_data struct type *atcb_call_type = nullptr; /* The index of various fields in the ATCB record and sub-records. */ - struct atcb_fieldnos atcb_fieldno {}; + struct atcb_fieldnos atcb_fieldno + { + }; /* On some systems, gdbserver applies an offset to the CPU that is reported. */ @@ -343,12 +340,12 @@ ada_get_task_number (thread_info *thread) if (data->task_list[i].ptid == thread->ptid) return i + 1; - return 0; /* No matching task found. */ + return 0; /* No matching task found. */ } /* Return the task number of the task running in inferior INF which matches TASK_ID , or zero if the task could not be found. */ - + static int get_task_number_from_id (CORE_ADDR task_id, struct inferior *inf) { @@ -467,7 +464,7 @@ read_fat_string_value (char *dest, struct value *val, int max_len) if (bounds_type->code () == TYPE_CODE_PTR) bounds_type = bounds_type->target_type (); if (bounds_type->code () != TYPE_CODE_STRUCT) - error (_("Unknown task name format. Aborting")); + error (_ ("Unknown task name format. Aborting")); upper_bound_fieldno = ada_get_field_index (bounds_type, "UB0", 0); initialize_fieldnos = 0; @@ -519,29 +516,33 @@ ada_get_tcb_types_info (void) are only interested in one instance, use standard (literal, C-like) lookups to get the first match. */ - struct symbol *atcb_sym = - lookup_symbol_in_language (atcb_name, NULL, STRUCT_DOMAIN, - language_c, NULL).symbol; - const struct symbol *common_atcb_sym = - lookup_symbol_in_language (common_atcb_name, NULL, STRUCT_DOMAIN, - language_c, NULL).symbol; - const struct symbol *private_data_sym = - lookup_symbol_in_language (private_data_name, NULL, STRUCT_DOMAIN, - language_c, NULL).symbol; - const struct symbol *entry_call_record_sym = - lookup_symbol_in_language (entry_call_record_name, NULL, STRUCT_DOMAIN, - language_c, NULL).symbol; + struct symbol *atcb_sym + = lookup_symbol_in_language (atcb_name, NULL, STRUCT_DOMAIN, language_c, + NULL) + .symbol; + const struct symbol *common_atcb_sym + = lookup_symbol_in_language (common_atcb_name, NULL, STRUCT_DOMAIN, + language_c, NULL) + .symbol; + const struct symbol *private_data_sym + = lookup_symbol_in_language (private_data_name, NULL, STRUCT_DOMAIN, + language_c, NULL) + .symbol; + const struct symbol *entry_call_record_sym + = lookup_symbol_in_language (entry_call_record_name, NULL, STRUCT_DOMAIN, + language_c, NULL) + .symbol; if (atcb_sym == NULL || atcb_sym->type () == NULL) { /* In Ravenscar run-time libs, the ATCB does not have a dynamic size, so the symbol name differs. */ atcb_sym = lookup_symbol_in_language (atcb_name_fixed, NULL, - STRUCT_DOMAIN, language_c, - NULL).symbol; + STRUCT_DOMAIN, language_c, NULL) + .symbol; if (atcb_sym == NULL || atcb_sym->type () == NULL) - return _("Cannot find Ada_Task_Control_Block type"); + return _ ("Cannot find Ada_Task_Control_Block type"); type = atcb_sym->type (); } @@ -554,11 +555,11 @@ ada_get_tcb_types_info (void) } if (common_atcb_sym == NULL || common_atcb_sym->type () == NULL) - return _("Cannot find Common_ATCB type"); - if (private_data_sym == NULL || private_data_sym->type ()== NULL) - return _("Cannot find Private_Data type"); + return _ ("Cannot find Common_ATCB type"); + if (private_data_sym == NULL || private_data_sym->type () == NULL) + return _ ("Cannot find Private_Data type"); if (entry_call_record_sym == NULL || entry_call_record_sym->type () == NULL) - return _("Cannot find Entry_Call_Record type"); + return _ ("Cannot find Entry_Call_Record type"); /* Get the type for Ada_Task_Control_Block.Common. */ common_type = common_atcb_sym->type (); @@ -572,15 +573,15 @@ ada_get_tcb_types_info (void) /* Get the field indices. */ fieldnos.common = ada_get_field_index (type, "common", 0); fieldnos.entry_calls = ada_get_field_index (type, "entry_calls", 1); - fieldnos.atc_nesting_level = - ada_get_field_index (type, "atc_nesting_level", 1); + fieldnos.atc_nesting_level + = ada_get_field_index (type, "atc_nesting_level", 1); fieldnos.state = ada_get_field_index (common_type, "state", 0); fieldnos.parent = ada_get_field_index (common_type, "parent", 1); fieldnos.priority = ada_get_field_index (common_type, "base_priority", 0); fieldnos.image = ada_get_field_index (common_type, "task_image", 1); fieldnos.image_len = ada_get_field_index (common_type, "task_image_len", 1); - fieldnos.activation_link = ada_get_field_index (common_type, - "activation_link", 1); + fieldnos.activation_link + = ada_get_field_index (common_type, "activation_link", 1); fieldnos.call = ada_get_field_index (common_type, "call", 1); fieldnos.ll = ada_get_field_index (common_type, "ll", 0); fieldnos.base_cpu = ada_get_field_index (common_type, "base_cpu", 0); @@ -675,11 +676,11 @@ read_atcb (CORE_ADDR task_id, struct ada_task_info *task_info) const char *err_msg = ada_get_tcb_types_info (); if (err_msg != NULL) - error (_("%s. Aborting"), err_msg); + error (_ ("%s. Aborting"), err_msg); } - tcb_value = value_from_contents_and_address (pspace_data->atcb_type, - NULL, task_id); + tcb_value + = value_from_contents_and_address (pspace_data->atcb_type, NULL, task_id); common_value = value_field (tcb_value, pspace_data->atcb_fieldno.common); /* Fill in the task_id. */ @@ -738,9 +739,9 @@ read_atcb (CORE_ADDR task_id, struct ada_task_info *task_info) } else { - int len = value_as_long - (value_field (common_value, - pspace_data->atcb_fieldno.image_len)); + int len + = value_as_long (value_field (common_value, + pspace_data->atcb_fieldno.image_len)); value_as_string (task_info->name, value_field (common_value, @@ -750,20 +751,20 @@ read_atcb (CORE_ADDR task_id, struct ada_task_info *task_info) /* Compute the task state and priority. */ - task_info->state = - value_as_long (value_field (common_value, - pspace_data->atcb_fieldno.state)); - task_info->priority = - value_as_long (value_field (common_value, - pspace_data->atcb_fieldno.priority)); + task_info->state + = value_as_long (value_field (common_value, + pspace_data->atcb_fieldno.state)); + task_info->priority + = value_as_long (value_field (common_value, + pspace_data->atcb_fieldno.priority)); /* If the ATCB contains some information about the parent task, then compute it as well. Otherwise, zero. */ if (pspace_data->atcb_fieldno.parent >= 0) - task_info->parent = - value_as_address (value_field (common_value, - pspace_data->atcb_fieldno.parent)); + task_info->parent + = value_as_address (value_field (common_value, + pspace_data->atcb_fieldno.parent)); /* If the task is in an entry call waiting for another task, then determine which task it is. */ @@ -775,20 +776,19 @@ read_atcb (CORE_ADDR task_id, struct ada_task_info *task_info) /* Let My_ATCB be the Ada task control block of a task calling the entry of another task; then the Task_Id of the called task is in My_ATCB.Entry_Calls (My_ATCB.ATC_Nesting_Level).Called_Task. */ - atc_nesting_level_value = - value_field (tcb_value, pspace_data->atcb_fieldno.atc_nesting_level); - entry_calls_value = - ada_coerce_to_simple_array_ptr - (value_field (tcb_value, pspace_data->atcb_fieldno.entry_calls)); - entry_calls_value_element = - value_subscript (entry_calls_value, - value_as_long (atc_nesting_level_value)); - called_task_fieldno = - ada_get_field_index (value_type (entry_calls_value_element), - "called_task", 0); - task_info->called_task = - value_as_address (value_field (entry_calls_value_element, - called_task_fieldno)); + atc_nesting_level_value + = value_field (tcb_value, pspace_data->atcb_fieldno.atc_nesting_level); + entry_calls_value = ada_coerce_to_simple_array_ptr ( + value_field (tcb_value, pspace_data->atcb_fieldno.entry_calls)); + entry_calls_value_element + = value_subscript (entry_calls_value, + value_as_long (atc_nesting_level_value)); + called_task_fieldno + = ada_get_field_index (value_type (entry_calls_value_element), + "called_task", 0); + task_info->called_task + = value_as_address (value_field (entry_calls_value_element, + called_task_fieldno)); } /* If the ATCB contains some information about RV callers, then @@ -798,26 +798,25 @@ read_atcb (CORE_ADDR task_id, struct ada_task_info *task_info) { /* Get the ID of the caller task from Common_ATCB.Call.all.Self. If Common_ATCB.Call is null, then there is no caller. */ - const CORE_ADDR call = - value_as_address (value_field (common_value, - pspace_data->atcb_fieldno.call)); + const CORE_ADDR call + = value_as_address (value_field (common_value, + pspace_data->atcb_fieldno.call)); struct value *call_val; if (call != 0) { - call_val = - value_from_contents_and_address (pspace_data->atcb_call_type, - NULL, call); - task_info->caller_task = - value_as_address - (value_field (call_val, pspace_data->atcb_fieldno.call_self)); + call_val + = value_from_contents_and_address (pspace_data->atcb_call_type, + NULL, call); + task_info->caller_task = value_as_address ( + value_field (call_val, pspace_data->atcb_fieldno.call_self)); } } task_info->base_cpu = (pspace_data->cpu_id_offset - + value_as_long (value_field (common_value, - pspace_data->atcb_fieldno.base_cpu))); + + value_as_long (value_field (common_value, + pspace_data->atcb_fieldno.base_cpu))); /* And finally, compute the task ptid. Note that there is not point in computing it if the task is no longer alive, in which case @@ -857,9 +856,9 @@ read_known_tasks_array (struct ada_tasks_inferior_data *data) read_memory (data->known_tasks_addr, known_tasks, known_tasks_size); for (i = 0; i < data->known_tasks_length; i++) { - CORE_ADDR task_id = - extract_typed_address (known_tasks + i * target_ptr_byte, - data->known_tasks_element); + CORE_ADDR task_id + = extract_typed_address (known_tasks + i * target_ptr_byte, + data->known_tasks_element); if (task_id != 0) add_ada_task (task_id, current_inferior ()); @@ -898,9 +897,8 @@ read_known_tasks_list (struct ada_tasks_inferior_data *data) tcb_value = value_from_contents_and_address (pspace_data->atcb_type, NULL, task_id); common_value = value_field (tcb_value, pspace_data->atcb_fieldno.common); - task_id = value_as_address - (value_field (common_value, - pspace_data->atcb_fieldno.activation_link)); + task_id = value_as_address ( + value_field (common_value, pspace_data->atcb_fieldno.activation_link)); } return true; @@ -929,7 +927,8 @@ ada_tasks_inferior_data_sniffer (struct ada_tasks_inferior_data *data) /* Try to get pointer type and array length from the symtab. */ sym = lookup_symbol_in_language (KNOWN_TASKS_NAME, NULL, VAR_DOMAIN, - language_c, NULL).symbol; + language_c, NULL) + .symbol; if (sym != NULL) { /* Validate. */ @@ -939,17 +938,16 @@ ada_tasks_inferior_data_sniffer (struct ada_tasks_inferior_data *data) if (type->code () == TYPE_CODE_ARRAY) eltype = check_typedef (type->target_type ()); - if (eltype != NULL - && eltype->code () == TYPE_CODE_PTR) + if (eltype != NULL && eltype->code () == TYPE_CODE_PTR) idxtype = check_typedef (type->index_type ()); if (idxtype != NULL && idxtype->bounds ()->low.kind () != PROP_UNDEFINED && idxtype->bounds ()->high.kind () != PROP_UNDEFINED) { data->known_tasks_element = eltype; - data->known_tasks_length = - (idxtype->bounds ()->high.const_val () - - idxtype->bounds ()->low.const_val () + 1); + data->known_tasks_length + = (idxtype->bounds ()->high.const_val () + - idxtype->bounds ()->low.const_val () + 1); return; } } @@ -958,13 +956,12 @@ ada_tasks_inferior_data_sniffer (struct ada_tasks_inferior_data *data) in some distributions), but it is likely that the executable still contains debug information on the task type (due to implicit with of Ada.Tasking). */ - data->known_tasks_element = - builtin_type (target_gdbarch ())->builtin_data_ptr; + data->known_tasks_element + = builtin_type (target_gdbarch ())->builtin_data_ptr; data->known_tasks_length = MAX_NUMBER_OF_KNOWN_TASKS; return; } - /* Try list. */ msym = lookup_minimal_symbol (KNOWN_TASKS_LIST, NULL, NULL); @@ -975,7 +972,8 @@ ada_tasks_inferior_data_sniffer (struct ada_tasks_inferior_data *data) data->known_tasks_length = 1; sym = lookup_symbol_in_language (KNOWN_TASKS_LIST, NULL, VAR_DOMAIN, - language_c, NULL).symbol; + language_c, NULL) + .symbol; if (sym != NULL && sym->value_address () != 0) { /* Validate. */ @@ -989,8 +987,8 @@ ada_tasks_inferior_data_sniffer (struct ada_tasks_inferior_data *data) } /* Fallback to default values. */ - data->known_tasks_element = - builtin_type (target_gdbarch ())->builtin_data_ptr; + data->known_tasks_element + = builtin_type (target_gdbarch ())->builtin_data_ptr; data->known_tasks_length = 1; return; } @@ -1007,8 +1005,8 @@ ada_tasks_inferior_data_sniffer (struct ada_tasks_inferior_data *data) static void read_known_tasks () { - struct ada_tasks_inferior_data *data = - get_ada_tasks_inferior_data (current_inferior ()); + struct ada_tasks_inferior_data *data + = get_ada_tasks_inferior_data (current_inferior ()); /* Step 1: Clear the current list, if necessary. */ data->task_list.clear (); @@ -1047,7 +1045,7 @@ ada_build_task_list () struct ada_tasks_inferior_data *data; if (!target_has_stack ()) - error (_("Cannot inspect Ada tasks when program is not running")); + error (_ ("Cannot inspect Ada tasks when program is not running")); data = get_ada_tasks_inferior_data (current_inferior ()); if (!data->task_list_valid_p) @@ -1062,8 +1060,7 @@ ada_build_task_list () that task only. */ void -print_ada_task_info (struct ui_out *uiout, - const char *arg_str, +print_ada_task_info (struct ui_out *uiout, const char *arg_str, struct inferior *inf) { struct ada_tasks_inferior_data *data; @@ -1073,7 +1070,7 @@ print_ada_task_info (struct ui_out *uiout, if (ada_build_task_list () == 0) { - uiout->message (_("Your application does not use any Ada tasks.\n")); + uiout->message (_ ("Your application does not use any Ada tasks.\n")); return; } @@ -1122,9 +1119,9 @@ print_ada_task_info (struct ui_out *uiout, gdb_assert (task_info != NULL); - tid_width = std::max (tid_width, - 1 + strlen (phex_nz (task_info->task_id, - sizeof (CORE_ADDR)))); + tid_width = std::max ( + tid_width, + 1 + strlen (phex_nz (task_info->task_id, sizeof (CORE_ADDR)))); } } uiout->table_header (tid_width, ui_right, "task-id", "TID"); @@ -1145,8 +1142,8 @@ print_ada_task_info (struct ui_out *uiout, for (taskno = 1; taskno <= data->task_list.size (); taskno++) { - const struct ada_task_info *const task_info = - &data->task_list[taskno - 1]; + const struct ada_task_info *const task_info + = &data->task_list[taskno - 1]; int parent_id; gdb_assert (task_info != NULL); @@ -1170,15 +1167,15 @@ print_ada_task_info (struct ui_out *uiout, uiout->field_signed ("id", taskno); /* Print the Task ID. */ - uiout->field_string ("task-id", phex_nz (task_info->task_id, - sizeof (CORE_ADDR))); + uiout->field_string ("task-id", + phex_nz (task_info->task_id, sizeof (CORE_ADDR))); /* Print the associated Thread ID. */ if (uiout->is_mi_like_p ()) { thread_info *thread = (ada_task_is_alive (task_info) - ? find_thread_ptid (inf, task_info->ptid) - : nullptr); + ? find_thread_ptid (inf, task_info->ptid) + : nullptr); if (thread != NULL) uiout->field_signed ("thread-id", thread->global_num); @@ -1201,13 +1198,11 @@ print_ada_task_info (struct ui_out *uiout, /* Print the task current state. */ if (task_info->caller_task) - uiout->field_fmt ("state", - _("Accepting RV with %-4d"), + uiout->field_fmt ("state", _ ("Accepting RV with %-4d"), get_task_number_from_id (task_info->caller_task, inf)); else if (task_info->called_task) - uiout->field_fmt ("state", - _("Waiting on RV with %-3d"), + uiout->field_fmt ("state", _ ("Waiting on RV with %-3d"), get_task_number_from_id (task_info->called_task, inf)); else @@ -1217,13 +1212,11 @@ print_ada_task_info (struct ui_out *uiout, is not expecting quotes, and in non mi-like no need for quotes as there is a specific column for the name. */ uiout->field_fmt ("name", - (task_info->name[0] != '\0' - ? ui_file_style () - : metadata_style.style ()), + (task_info->name[0] != '\0' ? ui_file_style () + : metadata_style.style ()), "%s", - (task_info->name[0] != '\0' - ? task_info->name - : _(""))); + (task_info->name[0] != '\0' ? task_info->name + : _ (""))); uiout->text ("\n"); } @@ -1242,33 +1235,34 @@ info_task (struct ui_out *uiout, const char *taskno_str, struct inferior *inf) if (ada_build_task_list () == 0) { - uiout->message (_("Your application does not use any Ada tasks.\n")); + uiout->message (_ ("Your application does not use any Ada tasks.\n")); return; } if (taskno <= 0 || taskno > data->task_list.size ()) - error (_("Task ID %d not known. Use the \"info tasks\" command to\n" - "see the IDs of currently known tasks"), taskno); + error (_ ("Task ID %d not known. Use the \"info tasks\" command to\n" + "see the IDs of currently known tasks"), + taskno); task_info = &data->task_list[taskno - 1]; /* Print the Ada task ID. */ - gdb_printf (_("Ada Task: %s\n"), + gdb_printf (_ ("Ada Task: %s\n"), paddress (target_gdbarch (), task_info->task_id)); /* Print the name of the task. */ if (task_info->name[0] != '\0') - gdb_printf (_("Name: %s\n"), task_info->name); + gdb_printf (_ ("Name: %s\n"), task_info->name); else - fprintf_styled (gdb_stdout, metadata_style.style (), _("\n")); + fprintf_styled (gdb_stdout, metadata_style.style (), _ ("\n")); /* Print the TID and LWP. */ - gdb_printf (_("Thread: 0x%s\n"), phex_nz (task_info->ptid.tid (), - sizeof (ULONGEST))); - gdb_printf (_("LWP: %#lx\n"), task_info->ptid.lwp ()); + gdb_printf (_ ("Thread: 0x%s\n"), + phex_nz (task_info->ptid.tid (), sizeof (ULONGEST))); + gdb_printf (_ ("LWP: %#lx\n"), task_info->ptid.lwp ()); /* If set, print the base CPU. */ if (task_info->base_cpu != 0) - gdb_printf (_("Base CPU: %d\n"), task_info->base_cpu); + gdb_printf (_ ("Base CPU: %d\n"), task_info->base_cpu); /* Print who is the parent (if any). */ if (task_info->parent != 0) @@ -1277,16 +1271,16 @@ info_task (struct ui_out *uiout, const char *taskno_str, struct inferior *inf) { struct ada_task_info *parent = &data->task_list[parent_taskno - 1]; - gdb_printf (_("Parent: %d"), parent_taskno); + gdb_printf (_ ("Parent: %d"), parent_taskno); if (parent->name[0] != '\0') gdb_printf (" (%s)", parent->name); gdb_printf ("\n"); } else - gdb_printf (_("No parent\n")); + gdb_printf (_ ("No parent\n")); /* Print the base priority. */ - gdb_printf (_("Base Priority: %d\n"), task_info->priority); + gdb_printf (_ ("Base Priority: %d\n"), task_info->priority); /* print the task current state. */ { @@ -1295,17 +1289,15 @@ info_task (struct ui_out *uiout, const char *taskno_str, struct inferior *inf) if (task_info->caller_task) { target_taskno = get_task_number_from_id (task_info->caller_task, inf); - gdb_printf (_("State: Accepting rendezvous with %d"), - target_taskno); + gdb_printf (_ ("State: Accepting rendezvous with %d"), target_taskno); } else if (task_info->called_task) { target_taskno = get_task_number_from_id (task_info->called_task, inf); - gdb_printf (_("State: Waiting on task %d's entry"), - target_taskno); + gdb_printf (_ ("State: Waiting on task %d's entry"), target_taskno); } else - gdb_printf (_("State: %s"), get_long_state (task_info->state)); + gdb_printf (_ ("State: %s"), get_long_state (task_info->state)); if (target_taskno) { @@ -1345,14 +1337,14 @@ display_current_task_id (void) const int current_task = ada_get_task_number (inferior_thread ()); if (current_task == 0) - gdb_printf (_("[Current task is unknown]\n")); + gdb_printf (_ ("[Current task is unknown]\n")); else { struct ada_tasks_inferior_data *data = get_ada_tasks_inferior_data (current_inferior ()); struct ada_task_info *task_info = &data->task_list[current_task - 1]; - gdb_printf (_("[Current task is %s]\n"), + gdb_printf (_ ("[Current task is %s]\n"), task_to_str (current_task, task_info).c_str ()); } } @@ -1368,14 +1360,15 @@ task_command_1 (const char *taskno_str, int from_tty, struct inferior *inf) struct ada_tasks_inferior_data *data = get_ada_tasks_inferior_data (inf); if (taskno <= 0 || taskno > data->task_list.size ()) - error (_("Task ID %d not known. Use the \"info tasks\" command to\n" - "see the IDs of currently known tasks"), taskno); + error (_ ("Task ID %d not known. Use the \"info tasks\" command to\n" + "see the IDs of currently known tasks"), + taskno); task_info = &data->task_list[taskno - 1]; if (!ada_task_is_alive (task_info)) - error (_("Cannot switch to task %s: Task is no longer running"), + error (_ ("Cannot switch to task %s: Task is no longer running"), task_to_str (taskno, task_info).c_str ()); - + /* On some platforms, the thread list is not updated until the user performs a thread-related operation (by using the "info threads" command, for instance). So this thread list may not be up to date @@ -1395,20 +1388,19 @@ task_command_1 (const char *taskno_str, int from_tty, struct inferior *inf) it's nicer for the user to just refuse to perform the task switch. */ thread_info *tp = find_thread_ptid (inf, task_info->ptid); if (tp == NULL) - error (_("Unable to compute thread ID for task %s.\n" - "Cannot switch to this task."), + error (_ ("Unable to compute thread ID for task %s.\n" + "Cannot switch to this task."), task_to_str (taskno, task_info).c_str ()); switch_to_thread (tp); ada_find_printable_frame (get_selected_frame (NULL)); - gdb_printf (_("[Switching to task %s]\n"), + gdb_printf (_ ("[Switching to task %s]\n"), task_to_str (taskno, task_info).c_str ()); print_stack_frame (get_selected_frame (NULL), frame_relative_level (get_selected_frame (NULL)), SRC_AND_LOC, 1); } - /* Print the ID of the current task if TASKNO_STR is empty or NULL. Otherwise, switch to the task indicated by TASKNO_STR. */ @@ -1419,7 +1411,7 @@ task_command (const char *taskno_str, int from_tty) if (ada_build_task_list () == 0) { - uiout->message (_("Your application does not use any Ada tasks.\n")); + uiout->message (_ ("Your application does not use any Ada tasks.\n")); return; } @@ -1504,23 +1496,25 @@ ada_tasks_new_objfile_observer (struct objfile *objfile) /* The qcs command line flags for the "task apply" commands. Keep this in sync with the "frame apply" commands. */ -using qcs_flag_option_def - = gdb::option::flag_option_def; +using qcs_flag_option_def = gdb::option::flag_option_def; static const gdb::option::option_def task_qcs_flags_option_defs[] = { qcs_flag_option_def { - "q", [] (qcs_flags *opt) { return &opt->quiet; }, - N_("Disables printing the task information."), + "q", + [] (qcs_flags *opt) { return &opt->quiet; }, + N_ ("Disables printing the task information."), }, qcs_flag_option_def { - "c", [] (qcs_flags *opt) { return &opt->cont; }, - N_("Print any error raised by COMMAND and continue."), + "c", + [] (qcs_flags *opt) { return &opt->cont; }, + N_ ("Print any error raised by COMMAND and continue."), }, qcs_flag_option_def { - "s", [] (qcs_flags *opt) { return &opt->silent; }, - N_("Silently ignore any errors or empty output produced by COMMAND."), + "s", + [] (qcs_flags *opt) { return &opt->silent; }, + N_ ("Silently ignore any errors or empty output produced by COMMAND."), }, }; @@ -1530,9 +1524,9 @@ static const gdb::option::option_def task_qcs_flags_option_defs[] = { static inline std::array make_task_apply_all_options_def_group (qcs_flags *flags) { - return {{ - { {task_qcs_flags_option_defs}, flags }, - }}; + return { { + { { task_qcs_flags_option_defs }, flags }, + } }; } /* Create an option_def_group for the "task apply" options, with @@ -1541,7 +1535,7 @@ make_task_apply_all_options_def_group (qcs_flags *flags) static inline gdb::option::option_def_group make_task_apply_options_def_group (qcs_flags *flags) { - return {{task_qcs_flags_option_defs}, flags}; + return { { task_qcs_flags_option_defs }, flags }; } /* Implementation of 'task apply all'. */ @@ -1552,13 +1546,13 @@ task_apply_all_command (const char *cmd, int from_tty) qcs_flags flags; auto group = make_task_apply_all_options_def_group (&flags); - gdb::option::process_options - (&cmd, gdb::option::PROCESS_OPTIONS_UNKNOWN_IS_OPERAND, group); + gdb::option::process_options ( + &cmd, gdb::option::PROCESS_OPTIONS_UNKNOWN_IS_OPERAND, group); validate_flags_qcs ("task apply all", &flags); if (cmd == nullptr || *cmd == '\0') - error (_("Please specify a command at the end of 'task apply all'")); + error (_ ("Please specify a command at the end of 'task apply all'")); update_thread_list (); ada_build_task_list (); @@ -1579,8 +1573,8 @@ task_apply_all_command (const char *cmd, int from_tty) thread_info *tp = find_thread_ptid (inf, task.ptid); if (tp == nullptr) - warning (_("Unable to compute thread ID for task %s.\n" - "Cannot switch to this task."), + warning (_ ("Unable to compute thread ID for task %s.\n" + "Cannot switch to this task."), task_to_str (i, &task).c_str ()); else thr_list_cpy.emplace_back (i, thread_info_ref::new_reference (tp)); @@ -1590,8 +1584,8 @@ task_apply_all_command (const char *cmd, int from_tty) for (const auto &info : thr_list_cpy) if (switch_to_thread_if_alive (info.second.get ())) - thread_try_catch_cmd (info.second.get (), info.first, cmd, - from_tty, flags); + thread_try_catch_cmd (info.second.get (), info.first, cmd, from_tty, + flags); } /* Implementation of 'task apply'. */ @@ -1599,9 +1593,8 @@ task_apply_all_command (const char *cmd, int from_tty) static void task_apply_command (const char *tidlist, int from_tty) { - if (tidlist == nullptr || *tidlist == '\0') - error (_("Please specify a task ID list")); + error (_ ("Please specify a task ID list")); update_thread_list (); ada_build_task_list (); @@ -1620,7 +1613,7 @@ task_apply_command (const char *tidlist, int from_tty) int num = parser.get_number (); if (num < 1 || num - 1 >= data->task_list.size ()) - warning (_("no Ada Task with number %d"), num); + warning (_ ("no Ada Task with number %d"), num); else { ada_task_info &task = data->task_list[num - 1]; @@ -1629,8 +1622,8 @@ task_apply_command (const char *tidlist, int from_tty) thread_info *tp = find_thread_ptid (inf, task.ptid); if (tp == nullptr) - warning (_("Unable to compute thread ID for task %s.\n" - "Cannot switch to this task."), + warning (_ ("Unable to compute thread ID for task %s.\n" + "Cannot switch to this task."), task_to_str (num, &task).c_str ()); else thr_list_cpy.emplace_back (num, @@ -1642,23 +1635,24 @@ task_apply_command (const char *tidlist, int from_tty) const char *cmd = parser.cur_tok (); auto group = make_task_apply_options_def_group (&flags); - gdb::option::process_options - (&cmd, gdb::option::PROCESS_OPTIONS_UNKNOWN_IS_OPERAND, group); + gdb::option::process_options ( + &cmd, gdb::option::PROCESS_OPTIONS_UNKNOWN_IS_OPERAND, group); validate_flags_qcs ("task apply", &flags); if (*cmd == '\0') - error (_("Please specify a command following the task ID list")); + error (_ ("Please specify a command following the task ID list")); scoped_restore_current_thread restore_thread; for (const auto &info : thr_list_cpy) if (switch_to_thread_if_alive (info.second.get ())) - thread_try_catch_cmd (info.second.get (), info.first, cmd, - from_tty, flags); + thread_try_catch_cmd (info.second.get (), info.first, cmd, from_tty, + flags); } void _initialize_tasks (); + void _initialize_tasks () { @@ -1671,17 +1665,17 @@ _initialize_tasks () static struct cmd_list_element *task_cmd_list; static struct cmd_list_element *task_apply_list; - /* Some new commands provided by this module. */ add_info ("tasks", info_tasks_command, - _("Provide information about all known Ada tasks.")); + _ ("Provide information about all known Ada tasks.")); add_prefix_cmd ("task", class_run, task_command, - _("Use this command to switch between Ada tasks.\n\ + _ ("Use this command to switch between Ada tasks.\n\ Without argument, this command simply prints the current task ID."), &task_cmd_list, 1, &cmdlist); -#define TASK_APPLY_OPTION_HELP "\ +#define TASK_APPLY_OPTION_HELP \ + "\ Prints per-inferior task number followed by COMMAND output.\n\ \n\ By default, an error raised during the execution of COMMAND\n\ @@ -1693,26 +1687,26 @@ Options:\n\ static const auto task_apply_opts = make_task_apply_options_def_group (nullptr); - static std::string task_apply_help = gdb::option::build_help (_("\ + static std::string task_apply_help + = gdb::option::build_help (_ ("\ Apply a command to a list of tasks.\n\ Usage: task apply ID... [OPTION]... COMMAND\n\ -ID is a space-separated list of IDs of tasks to apply COMMAND on.\n" -TASK_APPLY_OPTION_HELP), task_apply_opts); +ID is a space-separated list of IDs of tasks to apply COMMAND on.\n" TASK_APPLY_OPTION_HELP), + task_apply_opts); - add_prefix_cmd ("apply", class_run, - task_apply_command, - task_apply_help.c_str (), - &task_apply_list, 1, + add_prefix_cmd ("apply", class_run, task_apply_command, + task_apply_help.c_str (), &task_apply_list, 1, &task_cmd_list); static const auto task_apply_all_opts = make_task_apply_all_options_def_group (nullptr); - static std::string task_apply_all_help = gdb::option::build_help (_("\ + static std::string task_apply_all_help + = gdb::option::build_help (_ ("\ Apply a command to all tasks in the current inferior.\n\ \n\ -Usage: task apply all [OPTION]... COMMAND\n" -TASK_APPLY_OPTION_HELP), task_apply_all_opts); +Usage: task apply all [OPTION]... COMMAND\n" TASK_APPLY_OPTION_HELP), + task_apply_all_opts); add_cmd ("all", class_run, task_apply_all_command, task_apply_all_help.c_str (), &task_apply_list); diff --git a/gdb/ada-typeprint.c b/gdb/ada-typeprint.c index e95034c..56e0974 100644 --- a/gdb/ada-typeprint.c +++ b/gdb/ada-typeprint.c @@ -17,7 +17,7 @@ along with this program. If not, see . */ #include "defs.h" -#include "bfd.h" /* Binary File Description */ +#include "bfd.h" /* Binary File Description */ #include "gdbtypes.h" #include "value.h" #include "c-lang.h" @@ -27,16 +27,14 @@ #include "ada-lang.h" #include -static int print_selected_record_field_types (struct type *, struct type *, - int, int, - struct ui_file *, int, int, - const struct type_print_options *); +static int +print_selected_record_field_types (struct type *, struct type *, int, int, + struct ui_file *, int, int, + const struct type_print_options *); static int print_record_field_types (struct type *, struct type *, struct ui_file *, int, int, const struct type_print_options *); - - static char *name_buffer; static int name_buffer_len; @@ -126,8 +124,7 @@ type_is_full_subrange_of_target_type (struct type *type) is nonzero. */ static void -print_range (struct type *type, struct ui_file *stream, - int bounds_prefered_p) +print_range (struct type *type, struct ui_file *stream, int bounds_prefered_p) { if (!bounds_prefered_p) { @@ -179,8 +176,7 @@ print_range (struct type *type, struct ui_file *stream, } break; default: - gdb_printf (stream, "%.*s", - ada_name_prefix_len (type->name ()), + gdb_printf (stream, "%.*s", ada_name_prefix_len (type->name ()), type->name ()); break; } @@ -361,7 +357,7 @@ print_array_type (struct type *type, struct ui_file *stream, int show, if (type == NULL) { fprintf_styled (stream, metadata_style.style (), - _("")); + _ ("")); return; } @@ -377,7 +373,7 @@ print_array_type (struct type *type, struct ui_file *stream, int show, bitsize = 0; if (range_desc_type == NULL) { - for (arr_type = type; arr_type->code () == TYPE_CODE_ARRAY; ) + for (arr_type = type; arr_type->code () == TYPE_CODE_ARRAY;) { if (arr_type != type) gdb_printf (stream, ", "); @@ -400,14 +396,13 @@ print_array_type (struct type *type, struct ui_file *stream, int show, int k; n_indices = range_desc_type->num_fields (); - for (k = 0, arr_type = type; - k < n_indices; + for (k = 0, arr_type = type; k < n_indices; k += 1, arr_type = arr_type->target_type ()) { if (k > 0) gdb_printf (stream, ", "); - print_range_type (range_desc_type->field (k).type (), - stream, 0 /* bounds_prefered_p */); + print_range_type (range_desc_type->field (k).type (), stream, + 0 /* bounds_prefered_p */); if (TYPE_FIELD_BITSIZE (arr_type, 0) > 0) bitsize = TYPE_FIELD_BITSIZE (arr_type, 0); } @@ -493,8 +488,8 @@ print_choices (struct type *type, int field_num, struct ui_file *stream, { LONGEST L, U; - if (!ada_scan_number (name, p + 1, &L, &p) - || name[p] != 'T' || !ada_scan_number (name, p + 1, &U, &p)) + if (!ada_scan_number (name, p + 1, &L, &p) || name[p] != 'T' + || !ada_scan_number (name, p + 1, &U, &p)) goto Huh; ada_print_scalar (val_type, L, stream); gdb_printf (stream, " .. "); @@ -531,14 +526,13 @@ print_variant_clauses (struct type *var_type, struct type *discr_type, if (print_choices (var_type, i, stream, discr_type)) { if (print_record_field_types (var_type->field (i).type (), - outer_type, stream, show, level, - flags) + outer_type, stream, show, level, flags) <= 0) gdb_printf (stream, " null;"); } else - print_selected_record_field_types (var_type, outer_type, i, i, - stream, show, level, flags); + print_selected_record_field_types (var_type, outer_type, i, i, stream, + show, level, flags); } } @@ -596,8 +590,8 @@ print_variant_part (struct type *type, int field_num, struct type *outer_type, variant = "?"; gdb_printf (stream, "\n%*scase %s is", level + 4, "", variant); - print_variant_clauses (type, field_num, outer_type, stream, show, - level + 4, flags); + print_variant_clauses (type, field_num, outer_type, stream, show, level + 4, + flags); gdb_printf (stream, "\n%*send case;", level + 4, ""); } @@ -612,8 +606,8 @@ print_variant_part (struct type *type, int field_num, struct type *outer_type, static int print_selected_record_field_types (struct type *type, struct type *outer_type, - int fld0, int fld1, - struct ui_file *stream, int show, int level, + int fld0, int fld1, struct ui_file *stream, + int show, int level, const struct type_print_options *flags) { int i, flds; @@ -641,8 +635,7 @@ print_selected_record_field_types (struct type *type, struct type *outer_type, { flds += 1; gdb_printf (stream, "\n%*s", level + 4, ""); - ada_print_type (type->field (i).type (), - type->field (i).name (), + ada_print_type (type->field (i).type (), type->field (i).name (), stream, show - 1, level + 4, flags); gdb_printf (stream, ";"); } @@ -651,10 +644,11 @@ print_selected_record_field_types (struct type *type, struct type *outer_type, return flds; } -static void print_record_field_types_dynamic - (const gdb::array_view &parts, - int from, int to, struct type *type, struct ui_file *stream, - int show, int level, const struct type_print_options *flags); +static void +print_record_field_types_dynamic (const gdb::array_view &parts, + int from, int to, struct type *type, + struct ui_file *stream, int show, int level, + const struct type_print_options *flags); /* Print the choices encoded by VARIANT on STREAM. LEVEL is the indentation level. The type of the discriminant for VARIANT is @@ -693,9 +687,8 @@ print_choices (struct type *discr_type, const variant &variant, call. */ static int -print_variant_part (const variant_part &part, - struct type *type, struct ui_file *stream, - int show, int level, +print_variant_part (const variant_part &part, struct type *type, + struct ui_file *stream, int show, int level, const struct type_print_options *flags) { struct type *discr_type = nullptr; @@ -704,7 +697,8 @@ print_variant_part (const variant_part &part, name = "?"; else { - name = type->field (part.discriminant_index).name ();; + name = type->field (part.discriminant_index).name (); + ; discr_type = type->field (part.discriminant_index).type (); } @@ -719,8 +713,7 @@ print_variant_part (const variant_part &part, gdb_printf (stream, " null;"); else { - print_record_field_types_dynamic (variant.parts, - variant.first_field, + print_record_field_types_dynamic (variant.parts, variant.first_field, variant.last_field, type, stream, show, level + 8, flags); last_field = variant.last_field; @@ -739,9 +732,8 @@ print_variant_part (const variant_part &part, static void print_record_field_types_dynamic (const gdb::array_view &parts, - int from, int to, - struct type *type, struct ui_file *stream, - int show, int level, + int from, int to, struct type *type, + struct ui_file *stream, int show, int level, const struct type_print_options *flags) { int field = from; @@ -753,9 +745,8 @@ print_record_field_types_dynamic (const gdb::array_view &parts, /* Print any non-varying fields. */ int first_varying = part.variants[0].first_field; - print_selected_record_field_types (type, type, field, - first_varying - 1, stream, - show, level, flags); + print_selected_record_field_types (type, type, field, first_varying - 1, + stream, show, level, flags); field = print_variant_part (part, type, stream, show, level, flags); } @@ -782,17 +773,16 @@ print_record_field_types (struct type *type, struct type *outer_type, prop = type->dyn_prop (DYN_PROP_VARIANT_PARTS); } gdb_assert (prop->kind () == PROP_VARIANT_PARTS); - print_record_field_types_dynamic (*prop->variant_parts (), - 0, type->num_fields (), - type, stream, show, level, flags); + print_record_field_types_dynamic (*prop->variant_parts (), 0, + type->num_fields (), type, stream, + show, level, flags); return type->num_fields (); } - return print_selected_record_field_types (type, outer_type, - 0, type->num_fields () - 1, - stream, show, level, flags); + return print_selected_record_field_types (type, outer_type, 0, + type->num_fields () - 1, stream, + show, level, flags); } - /* Print record type TYPE on STREAM. LEVEL is the recursion (indentation) level, in case the element type itself has nested structure, and SHOW is @@ -835,15 +825,15 @@ print_record_type (struct type *type0, struct ui_file *stream, int show, flds = 0; if (parent_type != NULL && ada_type_name (parent_type) == NULL) - flds += print_record_field_types (parent_type, parent_type, - stream, show, level, flags); - flds += print_record_field_types (type, type, stream, show, level, - flags); + flds += print_record_field_types (parent_type, parent_type, stream, + show, level, flags); + flds + += print_record_field_types (type, type, stream, show, level, flags); if (flds > 0) gdb_printf (stream, "\n%*send record", level, ""); else if (flds < 0) - gdb_printf (stream, _(" end record")); + gdb_printf (stream, _ (" end record")); else gdb_printf (stream, " null; end record"); } @@ -866,15 +856,14 @@ print_unchecked_union_type (struct type *type, struct ui_file *stream, { gdb_printf (stream, "record (?) is\n%*scase ? is", level + 4, ""); - print_variant_clauses (type, nullptr, type, stream, show, level + 8, flags); + print_variant_clauses (type, nullptr, type, stream, show, level + 8, + flags); - gdb_printf (stream, "\n%*send case;\n%*send record", - level + 4, "", level, ""); + gdb_printf (stream, "\n%*send case;\n%*send record", level + 4, "", + level, ""); } } - - /* Print function or procedure type TYPE on STREAM. Make it a header for function or procedure NAME if NAME is not null. */ @@ -907,8 +896,7 @@ print_func_type (struct type *type, struct ui_file *stream, const char *name, stream->wrap_here (4); } gdb_printf (stream, "a%d: ", i + 1); - ada_print_type (type->field (i).type (), "", stream, -1, 0, - flags); + ada_print_type (type->field (i).type (), "", stream, -1, 0, flags); } gdb_printf (stream, ")"); } @@ -922,7 +910,6 @@ print_func_type (struct type *type, struct ui_file *stream, const char *name, } } - /* Print a description of a type TYPE0. Output goes to STREAM (via stdio). If VARSTRING is a non-NULL, non-empty string, print as an Ada @@ -961,20 +948,18 @@ ada_print_type (struct type *type0, const char *varstring, if (type == NULL) { if (is_var_decl) - gdb_printf (stream, "%.*s: ", - ada_name_prefix_len (varstring), varstring); + gdb_printf (stream, "%.*s: ", ada_name_prefix_len (varstring), + varstring); fprintf_styled (stream, metadata_style.style (), ""); return; } if (is_var_decl && type->code () != TYPE_CODE_FUNC) - gdb_printf (stream, "%.*s: ", - ada_name_prefix_len (varstring), varstring); + gdb_printf (stream, "%.*s: ", ada_name_prefix_len (varstring), varstring); if (type_name != NULL && show <= 0 && !ada_is_aligner_type (type)) { - gdb_printf (stream, "%.*s", - ada_name_prefix_len (type_name), type_name); + gdb_printf (stream, "%.*s", ada_name_prefix_len (type_name), type_name); return; } @@ -999,13 +984,11 @@ ada_print_type (struct type *type0, const char *varstring, || (varstring != nullptr && strstr (varstring, "___XVL") == nullptr)) gdb_printf (stream, "access "); - ada_print_type (type->target_type (), "", stream, show, level, - flags); + ada_print_type (type->target_type (), "", stream, show, level, flags); break; case TYPE_CODE_REF: gdb_printf (stream, " "); - ada_print_type (type->target_type (), "", stream, show, level, - flags); + ada_print_type (type->target_type (), "", stream, show, level, flags); break; case TYPE_CODE_ARRAY: print_array_type (type, stream, show, level, flags); @@ -1019,7 +1002,7 @@ ada_print_type (struct type *type0, const char *varstring, if (!ada_is_range_type_name (name)) fprintf_styled (stream, metadata_style.style (), - _("<%s-byte integer>"), + _ ("<%s-byte integer>"), pulongest (type->length ())); else { @@ -1036,7 +1019,7 @@ ada_print_type (struct type *type0, const char *varstring, gdb_printf (stream, ">"); } else if (ada_is_modular_type (type)) - gdb_printf (stream, "mod %s", + gdb_printf (stream, "mod %s", int_string (ada_modulus (type), 10, 0, 0, 1)); else { @@ -1045,8 +1028,7 @@ ada_print_type (struct type *type0, const char *varstring, } break; case TYPE_CODE_FLT: - fprintf_styled (stream, metadata_style.style (), - _("<%s-byte float>"), + fprintf_styled (stream, metadata_style.style (), _ ("<%s-byte float>"), pulongest (type->length ())); break; case TYPE_CODE_ENUM: @@ -1059,8 +1041,7 @@ ada_print_type (struct type *type0, const char *varstring, if (ada_is_array_descriptor_type (type)) print_array_type (type, stream, show, level, flags); else if (ada_is_bogus_array_descriptor (type)) - gdb_printf (stream, - _("array (?) of ? ()")); + gdb_printf (stream, _ ("array (?) of ? ()")); else print_record_type (type, stream, show, level, flags); break; diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c index 10d3b0a..ed9d8a3 100644 --- a/gdb/ada-valprint.c +++ b/gdb/ada-valprint.c @@ -32,10 +32,8 @@ static int print_field_values (struct value *, struct value *, struct ui_file *, int, - const struct value_print_options *, - int, const struct language_defn *); - - + const struct value_print_options *, int, + const struct language_defn *); /* Make TYPE unsigned if its range of values includes no negatives. */ static void @@ -199,8 +197,8 @@ val_print_packed_array_elements (struct type *type, const gdb_byte *valaddr, if (check_typedef (value_type (v0))->length () != check_typedef (value_type (v1))->length ()) break; - if (!value_contents_eq (v0, value_embedded_offset (v0), - v1, value_embedded_offset (v1), + if (!value_contents_eq (v0, value_embedded_offset (v0), v1, + value_embedded_offset (v1), check_typedef (value_type (v0))->length ())) break; } @@ -212,10 +210,9 @@ val_print_packed_array_elements (struct type *type, const gdb_byte *valaddr, opts.deref_ref = false; common_val_print (v0, stream, recurse + 1, &opts, current_language); annotate_elt_rep (i - i0); - gdb_printf (stream, _(" %p[%p]"), + gdb_printf (stream, _ (" %p[%p]"), metadata_style.style ().ptr (), i - i0, nullptr); annotate_elt_rep_end (); - } else { @@ -237,8 +234,8 @@ val_print_packed_array_elements (struct type *type, const gdb_byte *valaddr, gdb_printf (stream, ", "); } stream->wrap_here (2 + 2 * recurse); - maybe_print_array_index (index_type, j + low, - stream, options); + maybe_print_array_index (index_type, j + low, stream, + options); } common_val_print (v0, stream, recurse + 1, &opts, current_language); @@ -259,8 +256,8 @@ val_print_packed_array_elements (struct type *type, const gdb_byte *valaddr, of the character. */ void -ada_emit_char (int c, struct type *type, struct ui_file *stream, - int quoter, int type_len) +ada_emit_char (int c, struct type *type, struct ui_file *stream, int quoter, + int type_len) { /* If this character fits in the normal ASCII range, and is a printable character, then print the character as if it was @@ -293,8 +290,8 @@ char_at (const gdb_byte *string, int i, int type_len, if (type_len == 1) return string[i]; else - return (int) extract_unsigned_integer (string + type_len * i, - type_len, byte_order); + return (int) extract_unsigned_integer (string + type_len * i, type_len, + byte_order); } /* Print a floating-point value of type TYPE, pointed to in GDB by @@ -345,8 +342,7 @@ ada_print_floating (const gdb_byte *valaddr, struct type *type, } } - if (pos == std::string::npos - && s.find ('.') == std::string::npos) + if (pos == std::string::npos && s.find ('.') == std::string::npos) { pos = s.find ('e'); if (pos == std::string::npos) @@ -386,7 +382,6 @@ ada_print_scalar (struct type *type, LONGEST val, struct ui_file *stream) switch (type->code ()) { - case TYPE_CODE_ENUM: len = type->num_fields (); for (i = 0; i < len; i++) @@ -438,11 +433,11 @@ ada_print_scalar (struct type *type, LONGEST val, struct ui_file *stream) case TYPE_CODE_METHODPTR: case TYPE_CODE_METHOD: case TYPE_CODE_REF: - warning (_("internal error: unhandled type in ada_print_scalar")); + warning (_ ("internal error: unhandled type in ada_print_scalar")); break; default: - error (_("Invalid type code in symbol table.")); + error (_ ("Invalid type code in symbol table.")); } } @@ -490,7 +485,7 @@ printstr (struct ui_file *stream, struct type *elttype, const gdb_byte *string, reps = 1; while (rep1 < length && char_at (string, rep1, type_len, byte_order) - == char_at (string, i, type_len, byte_order)) + == char_at (string, i, type_len, byte_order)) { rep1 += 1; reps += 1; @@ -504,10 +499,10 @@ printstr (struct ui_file *stream, struct type *elttype, const gdb_byte *string, in_quotes = 0; } gdb_puts ("'", stream); - ada_emit_char (char_at (string, i, type_len, byte_order), - elttype, stream, '\'', type_len); + ada_emit_char (char_at (string, i, type_len, byte_order), elttype, + stream, '\'', type_len); gdb_puts ("'", stream); - gdb_printf (stream, _(" %p[%p]"), + gdb_printf (stream, _ (" %p[%p]"), metadata_style.style ().ptr (), reps, nullptr); i = rep1 - 1; things_printed += options->repeat_count_threshold; @@ -520,8 +515,8 @@ printstr (struct ui_file *stream, struct type *elttype, const gdb_byte *string, gdb_puts ("\"", stream); in_quotes = 1; } - ada_emit_char (char_at (string, i, type_len, byte_order), - elttype, stream, '"', type_len); + ada_emit_char (char_at (string, i, type_len, byte_order), elttype, + stream, '"', type_len); things_printed += 1; } } @@ -546,11 +541,9 @@ ada_printstr (struct ui_file *stream, struct type *type, static int print_variant_part (struct value *value, int field_num, - struct value *outer_value, - struct ui_file *stream, int recurse, - const struct value_print_options *options, - int comma_needed, - const struct language_defn *language) + struct value *outer_value, struct ui_file *stream, + int recurse, const struct value_print_options *options, + int comma_needed, const struct language_defn *language) { struct type *type = value_type (value); struct type *var_type = type->field (field_num).type (); @@ -583,8 +576,7 @@ static int print_field_values (struct value *value, struct value *outer_value, struct ui_file *stream, int recurse, const struct value_print_options *options, - int comma_needed, - const struct language_defn *language) + int comma_needed, const struct language_defn *language) { int i, len; @@ -598,19 +590,18 @@ print_field_values (struct value *value, struct value *outer_value, if (ada_is_wrapper_field (type, i)) { - struct value *field_val = ada_value_primitive_field (value, 0, - i, type); - comma_needed = - print_field_values (field_val, field_val, - stream, recurse, options, - comma_needed, language); + struct value *field_val + = ada_value_primitive_field (value, 0, i, type); + comma_needed + = print_field_values (field_val, field_val, stream, recurse, + options, comma_needed, language); continue; } else if (ada_is_variant_part (type, i)) { - comma_needed = - print_variant_part (value, i, outer_value, stream, recurse, - options, comma_needed, language); + comma_needed + = print_variant_part (value, i, outer_value, stream, recurse, + options, comma_needed, language); continue; } @@ -642,7 +633,7 @@ print_field_values (struct value *value, struct value *outer_value, order problems. */ if (HAVE_CPLUS_STRUCT (type) && TYPE_FIELD_IGNORE (type, i)) { - fputs_styled (_(""), + fputs_styled (_ (""), metadata_style.style (), stream); } else @@ -653,11 +644,11 @@ print_field_values (struct value *value, struct value *outer_value, struct value_print_options opts; adjust_type_signedness (type->field (i).type ()); - v = ada_value_primitive_packed_val - (value, nullptr, - bit_pos / HOST_CHAR_BIT, - bit_pos % HOST_CHAR_BIT, - bit_size, type->field (i).type ()); + v = ada_value_primitive_packed_val (value, nullptr, + bit_pos / HOST_CHAR_BIT, + bit_pos % HOST_CHAR_BIT, + bit_size, + type->field (i).type ()); opts = *options; opts.deref_ref = false; common_val_print (v, stream, recurse + 1, &opts, language); @@ -683,8 +674,7 @@ print_field_values (struct value *value, struct value *outer_value, static void ada_val_print_string (struct type *type, const gdb_byte *valaddr, - int offset_aligned, - struct ui_file *stream, int recurse, + int offset_aligned, struct ui_file *stream, int recurse, const struct value_print_options *options) { enum bfd_endian byte_order = type_byte_order (type); @@ -711,24 +701,23 @@ ada_val_print_string (struct type *type, const gdb_byte *valaddr, /* Look for a NULL char. */ for (temp_len = 0; - (temp_len < len - && temp_len < print_max_chars - && char_at (valaddr + offset_aligned, - temp_len, eltlen, byte_order) != 0); - temp_len += 1); + (temp_len < len && temp_len < print_max_chars + && char_at (valaddr + offset_aligned, temp_len, eltlen, byte_order) + != 0); + temp_len += 1) + ; len = temp_len; } - printstr (stream, elttype, valaddr + offset_aligned, len, 0, - eltlen, options); + printstr (stream, elttype, valaddr + offset_aligned, len, 0, eltlen, + options); } /* Implement Ada value_print'ing for the case where TYPE is a TYPE_CODE_PTR. */ static void -ada_value_print_ptr (struct value *val, - struct ui_file *stream, int recurse, +ada_value_print_ptr (struct value *val, struct ui_file *stream, int recurse, const struct value_print_options *options) { if (!options->format @@ -778,8 +767,8 @@ ada_value_print_num (struct value *val, struct ui_file *stream, int recurse, } else { - int format = (options->format ? options->format - : options->output_format); + int format + = (options->format ? options->format : options->output_format); if (format) { @@ -857,8 +846,7 @@ ada_val_print_enum (struct value *value, struct ui_file *stream, int recurse, if (name[0] == '\'') gdb_printf (stream, "%ld %ps", (long) val, - styled_string (variable_name_style.style (), - name)); + styled_string (variable_name_style.style (), name)); else fputs_styled (name, variable_name_style.style (), stream); } @@ -870,8 +858,7 @@ ada_val_print_enum (struct value *value, struct ui_file *stream, int recurse, TYPE_CODE_STRUCT or TYPE_CODE_UNION. */ static void -ada_val_print_struct_union (struct value *value, - struct ui_file *stream, +ada_val_print_struct_union (struct value *value, struct ui_file *stream, int recurse, const struct value_print_options *options) { @@ -883,8 +870,9 @@ ada_val_print_struct_union (struct value *value, gdb_printf (stream, "("); - if (print_field_values (value, value, stream, recurse, options, - 0, language_def (language_ada)) != 0 + if (print_field_values (value, value, stream, recurse, options, 0, + language_def (language_ada)) + != 0 && options->prettyformat) { gdb_printf (stream, "\n"); @@ -924,8 +912,8 @@ ada_value_print_array (struct value *val, struct ui_file *stream, int recurse, { const gdb_byte *valaddr = value_contents_for_printing (val).data (); int offset_aligned = ada_aligned_value_addr (type, valaddr) - valaddr; - val_print_packed_array_elements (type, valaddr, offset_aligned, - stream, recurse, options); + val_print_packed_array_elements (type, valaddr, offset_aligned, stream, + recurse, options); } else value_print_array_elements (val, stream, recurse, options, 0); @@ -936,8 +924,8 @@ ada_value_print_array (struct value *val, struct ui_file *stream, int recurse, a TYPE_CODE_REF. */ static void -ada_val_print_ref (struct type *type, const gdb_byte *valaddr, - int offset, int offset_aligned, CORE_ADDR address, +ada_val_print_ref (struct type *type, const gdb_byte *valaddr, int offset, + int offset_aligned, CORE_ADDR address, struct ui_file *stream, int recurse, struct value *original_value, const struct value_print_options *options) @@ -976,17 +964,16 @@ ada_val_print_ref (struct type *type, const gdb_byte *valaddr, return; } - deref_val - = ada_value_ind (value_from_pointer (lookup_pointer_type (elttype), - deref_val_int)); + deref_val = ada_value_ind (value_from_pointer (lookup_pointer_type (elttype), + deref_val_int)); if (ada_is_tagged_type (value_type (deref_val), 1)) deref_val = ada_tag_value_at_base_address (deref_val); if (value_lazy (deref_val)) value_fetch_lazy (deref_val); - common_val_print (deref_val, stream, recurse + 1, - options, language_def (language_ada)); + common_val_print (deref_val, stream, recurse + 1, options, + language_def (language_ada)); } /* See the comment on ada_value_print. This function differs in that @@ -1076,8 +1063,7 @@ ada_value_print_inner (struct value *val, struct ui_file *stream, int recurse, return; case TYPE_CODE_REF: - ada_val_print_ref (type, valaddr, 0, 0, - address, stream, recurse, val, + ada_val_print_ref (type, valaddr, 0, 0, address, stream, recurse, val, options); break; } diff --git a/gdb/ada-varobj.c b/gdb/ada-varobj.c index 6b92b76..5e2b937 100644 --- a/gdb/ada-varobj.c +++ b/gdb/ada-varobj.c @@ -90,10 +90,8 @@ ada_varobj_scalar_image (struct type *type, LONGEST val) corresponding to the field number FIELDNO. */ static void -ada_varobj_struct_elt (struct value *parent_value, - struct type *parent_type, - int fieldno, - struct value **child_value, +ada_varobj_struct_elt (struct value *parent_value, struct type *parent_type, + int fieldno, struct value **child_value, struct type **child_type) { struct value *value = NULL; @@ -118,10 +116,8 @@ ada_varobj_struct_elt (struct value *parent_value, to the dereferenced value. */ static void -ada_varobj_ind (struct value *parent_value, - struct type *parent_type, - struct value **child_value, - struct type **child_type) +ada_varobj_ind (struct value *parent_value, struct type *parent_type, + struct value **child_value, struct type **child_type) { struct value *value = NULL; struct type *type = NULL; @@ -167,8 +163,7 @@ ada_varobj_ind (struct value *parent_value, static void ada_varobj_simple_array_elt (struct value *parent_value, - struct type *parent_type, - int elt_index, + struct type *parent_type, int elt_index, struct value **child_value, struct type **child_type) { @@ -177,8 +172,8 @@ ada_varobj_simple_array_elt (struct value *parent_value, if (parent_value) { - struct value *index_value = - value_from_longest (parent_type->index_type (), elt_index); + struct value *index_value + = value_from_longest (parent_type->index_type (), elt_index); value = ada_value_subscript (parent_value, 1, &index_value); type = value_type (value); @@ -199,18 +194,16 @@ ada_varobj_simple_array_elt (struct value *parent_value, The replacement is performed in place. */ static void -ada_varobj_adjust_for_child_access (struct value **value, - struct type **type) +ada_varobj_adjust_for_child_access (struct value **value, struct type **type) { - /* Pointers to struct/union types are special: Instead of having + /* Pointers to struct/union types are special: Instead of having one child (the struct), their children are the components of the struct/union type. We handle this situation by dereferencing the (value, type) couple. */ if ((*type)->code () == TYPE_CODE_PTR && ((*type)->target_type ()->code () == TYPE_CODE_STRUCT || (*type)->target_type ()->code () == TYPE_CODE_UNION) - && *value != nullptr - && value_as_address (*value) != 0 + && *value != nullptr && value_as_address (*value) != 0 && !ada_is_array_descriptor_type ((*type)->target_type ()) && !ada_is_constrained_packed_array_type ((*type)->target_type ())) ada_varobj_ind (*value, *type, value, type); @@ -235,8 +228,7 @@ ada_varobj_get_array_number_of_children (struct value *parent_value, { LONGEST lo, hi; - if (parent_value == NULL - && is_dynamic_type (parent_type->index_type ())) + if (parent_value == NULL && is_dynamic_type (parent_type->index_type ())) { /* This happens when listing the children of an object which does not exist in memory (Eg: when requesting @@ -250,7 +242,7 @@ ada_varobj_get_array_number_of_children (struct value *parent_value, if (!get_array_bounds (parent_type, &lo, &hi)) { /* Could not get the array bounds. Pretend this is an empty array. */ - warning (_("unable to get bounds of array, assuming null array")); + warning (_ ("unable to get bounds of array, assuming null array")); return 0; } @@ -285,8 +277,8 @@ ada_varobj_get_struct_number_of_children (struct value *parent_value, struct value *elt_value; struct type *elt_type; - ada_varobj_struct_elt (parent_value, parent_type, i, - &elt_value, &elt_type); + ada_varobj_struct_elt (parent_value, parent_type, i, &elt_value, + &elt_type); if (ada_is_tagged_type (elt_type, 0)) { /* We must not use ada_varobj_get_number_of_children @@ -297,11 +289,13 @@ ada_varobj_get_struct_number_of_children (struct value *parent_value, real type, which happens to be the parent_type, and leads to an infinite loop (because the element gets fixed back into the parent). */ - n_children += ada_varobj_get_struct_number_of_children - (elt_value, elt_type); + n_children + += ada_varobj_get_struct_number_of_children (elt_value, + elt_type); } else - n_children += ada_varobj_get_number_of_children (elt_value, elt_type); + n_children + += ada_varobj_get_number_of_children (elt_value, elt_type); } else if (ada_is_variant_part (parent_type, i)) { @@ -360,8 +354,7 @@ ada_varobj_get_number_of_children (struct value *parent_value, return 1; if (parent_type->code () == TYPE_CODE_ARRAY) - return ada_varobj_get_array_number_of_children (parent_value, - parent_type); + return ada_varobj_get_array_number_of_children (parent_value, parent_type); if (parent_type->code () == TYPE_CODE_STRUCT || parent_type->code () == TYPE_CODE_UNION) @@ -369,8 +362,7 @@ ada_varobj_get_number_of_children (struct value *parent_value, parent_type); if (parent_type->code () == TYPE_CODE_PTR) - return ada_varobj_get_ptr_number_of_children (parent_value, - parent_type); + return ada_varobj_get_ptr_number_of_children (parent_value, parent_type); /* All other types have no child. */ return 0; @@ -397,29 +389,21 @@ ada_varobj_get_number_of_children (struct value *parent_value, PARENT_NAME is the name of the parent, and should never be NULL. */ -static void ada_varobj_describe_child (struct value *parent_value, - struct type *parent_type, - const char *parent_name, - const char *parent_path_expr, - int child_index, - std::string *child_name, - struct value **child_value, - struct type **child_type, - std::string *child_path_expr); +static void ada_varobj_describe_child ( + struct value *parent_value, struct type *parent_type, + const char *parent_name, const char *parent_path_expr, int child_index, + std::string *child_name, struct value **child_value, + struct type **child_type, std::string *child_path_expr); /* Same as ada_varobj_describe_child, but limited to struct/union objects. */ static void -ada_varobj_describe_struct_child (struct value *parent_value, - struct type *parent_type, - const char *parent_name, - const char *parent_path_expr, - int child_index, - std::string *child_name, - struct value **child_value, - struct type **child_type, - std::string *child_path_expr) +ada_varobj_describe_struct_child ( + struct value *parent_value, struct type *parent_type, + const char *parent_name, const char *parent_path_expr, int child_index, + std::string *child_name, struct value **child_value, + struct type **child_type, std::string *child_path_expr) { int fieldno; int childno = 0; @@ -446,12 +430,13 @@ ada_varobj_describe_struct_child (struct value *parent_value, For tagged types, we must be careful to not call ada_varobj_get_number_of_children, to prevent our element from being fixed back into the parent. */ - elt_n_children = ada_varobj_get_struct_number_of_children - (elt_value, elt_type); + elt_n_children + = ada_varobj_get_struct_number_of_children (elt_value, + elt_type); } else - elt_n_children = - ada_varobj_get_number_of_children (elt_value, elt_type); + elt_n_children + = ada_varobj_get_number_of_children (elt_value, elt_type); /* Is the child we're looking for one of the children of this wrapper field? */ @@ -463,17 +448,17 @@ ada_varobj_describe_struct_child (struct value *parent_value, For tagged types, we must be careful to not call ada_varobj_describe_child, to prevent our element from being fixed back into the parent. */ - ada_varobj_describe_struct_child - (elt_value, elt_type, parent_name, parent_path_expr, - child_index - childno, child_name, child_value, - child_type, child_path_expr); + ada_varobj_describe_struct_child ( + elt_value, elt_type, parent_name, parent_path_expr, + child_index - childno, child_name, child_value, child_type, + child_path_expr); } else - ada_varobj_describe_child (elt_value, elt_type, - parent_name, parent_path_expr, - child_index - childno, - child_name, child_value, - child_type, child_path_expr); + ada_varobj_describe_child (elt_value, elt_type, parent_name, + parent_path_expr, + child_index - childno, child_name, + child_value, child_type, + child_path_expr); return; } @@ -513,8 +498,8 @@ ada_varobj_describe_struct_child (struct value *parent_value, child_value, NULL); if (child_type) - ada_varobj_struct_elt (parent_value, parent_type, fieldno, - NULL, child_type); + ada_varobj_struct_elt (parent_value, parent_type, fieldno, NULL, + child_type); if (child_path_expr) { @@ -525,9 +510,8 @@ ada_varobj_describe_struct_child (struct value *parent_value, const char *field_name = parent_type->field (fieldno).name (); int child_name_len = ada_name_prefix_len (field_name); - *child_path_expr = - string_printf ("(%s).%.*s", parent_path_expr, - child_name_len, field_name); + *child_path_expr = string_printf ("(%s).%.*s", parent_path_expr, + child_name_len, field_name); } return; @@ -550,15 +534,11 @@ ada_varobj_describe_struct_child (struct value *parent_value, child. */ static void -ada_varobj_describe_ptr_child (struct value *parent_value, - struct type *parent_type, - const char *parent_name, - const char *parent_path_expr, - int child_index, - std::string *child_name, - struct value **child_value, - struct type **child_type, - std::string *child_path_expr) +ada_varobj_describe_ptr_child ( + struct value *parent_value, struct type *parent_type, + const char *parent_name, const char *parent_path_expr, int child_index, + std::string *child_name, struct value **child_value, + struct type **child_type, std::string *child_path_expr) { if (child_name) *child_name = string_printf ("%s.all", parent_name); @@ -580,15 +560,11 @@ ada_varobj_describe_ptr_child (struct value *parent_value, This is done by ada_varobj_describe_child before calling us. */ static void -ada_varobj_describe_simple_array_child (struct value *parent_value, - struct type *parent_type, - const char *parent_name, - const char *parent_path_expr, - int child_index, - std::string *child_name, - struct value **child_value, - struct type **child_type, - std::string *child_path_expr) +ada_varobj_describe_simple_array_child ( + struct value *parent_value, struct type *parent_type, + const char *parent_name, const char *parent_path_expr, int child_index, + std::string *child_name, struct value **child_value, + struct type **child_type, std::string *child_path_expr) { struct type *index_type; int real_index; @@ -606,8 +582,8 @@ ada_varobj_describe_simple_array_child (struct value *parent_value, child_value, NULL); if (child_type) - ada_varobj_simple_array_elt (parent_value, parent_type, real_index, - NULL, child_type); + ada_varobj_simple_array_elt (parent_value, parent_type, real_index, NULL, + child_type); if (child_path_expr) { @@ -648,13 +624,13 @@ ada_varobj_describe_simple_array_child (struct value *parent_value, } if (index_type_name != NULL) - *child_path_expr = - string_printf ("(%s)(%.*s'(%s))", parent_path_expr, - ada_name_prefix_len (index_type_name), - index_type_name, index_img.c_str ()); + *child_path_expr + = string_printf ("(%s)(%.*s'(%s))", parent_path_expr, + ada_name_prefix_len (index_type_name), + index_type_name, index_img.c_str ()); else - *child_path_expr = - string_printf ("(%s)(%s)", parent_path_expr, index_img.c_str ()); + *child_path_expr + = string_printf ("(%s)(%s)", parent_path_expr, index_img.c_str ()); } } @@ -662,12 +638,9 @@ ada_varobj_describe_simple_array_child (struct value *parent_value, static void ada_varobj_describe_child (struct value *parent_value, - struct type *parent_type, - const char *parent_name, - const char *parent_path_expr, - int child_index, - std::string *child_name, - struct value **child_value, + struct type *parent_type, const char *parent_name, + const char *parent_path_expr, int child_index, + std::string *child_name, struct value **child_value, struct type **child_type, std::string *child_path_expr) { @@ -691,41 +664,37 @@ ada_varobj_describe_child (struct value *parent_value, if (ada_is_access_to_unconstrained_array (parent_type)) { - ada_varobj_describe_ptr_child (parent_value, parent_type, - parent_name, parent_path_expr, - child_index, child_name, - child_value, child_type, - child_path_expr); + ada_varobj_describe_ptr_child (parent_value, parent_type, parent_name, + parent_path_expr, child_index, child_name, + child_value, child_type, child_path_expr); return; } if (parent_type->code () == TYPE_CODE_ARRAY) { - ada_varobj_describe_simple_array_child - (parent_value, parent_type, parent_name, parent_path_expr, - child_index, child_name, child_value, child_type, - child_path_expr); + ada_varobj_describe_simple_array_child (parent_value, parent_type, + parent_name, parent_path_expr, + child_index, child_name, + child_value, child_type, + child_path_expr); return; } if (parent_type->code () == TYPE_CODE_STRUCT || parent_type->code () == TYPE_CODE_UNION) { - ada_varobj_describe_struct_child (parent_value, parent_type, - parent_name, parent_path_expr, - child_index, child_name, - child_value, child_type, + ada_varobj_describe_struct_child (parent_value, parent_type, parent_name, + parent_path_expr, child_index, + child_name, child_value, child_type, child_path_expr); return; } if (parent_type->code () == TYPE_CODE_PTR) { - ada_varobj_describe_ptr_child (parent_value, parent_type, - parent_name, parent_path_expr, - child_index, child_name, - child_value, child_type, - child_path_expr); + ada_varobj_describe_ptr_child (parent_value, parent_type, parent_name, + parent_path_expr, child_index, child_name, + child_value, child_type, child_path_expr); return; } @@ -745,9 +714,8 @@ ada_varobj_get_name_of_child (struct value *parent_value, { std::string child_name; - ada_varobj_describe_child (parent_value, parent_type, parent_name, - NULL, child_index, &child_name, NULL, - NULL, NULL); + ada_varobj_describe_child (parent_value, parent_type, parent_name, NULL, + child_index, &child_name, NULL, NULL, NULL); return child_name; } @@ -766,8 +734,8 @@ ada_varobj_get_path_expr_of_child (struct value *parent_value, std::string child_path_expr; ada_varobj_describe_child (parent_value, parent_type, parent_name, - parent_path_expr, child_index, NULL, - NULL, NULL, &child_path_expr); + parent_path_expr, child_index, NULL, NULL, NULL, + &child_path_expr); return child_path_expr; } @@ -782,9 +750,8 @@ ada_varobj_get_value_of_child (struct value *parent_value, { struct value *child_value; - ada_varobj_describe_child (parent_value, parent_type, parent_name, - NULL, child_index, NULL, &child_value, - NULL, NULL); + ada_varobj_describe_child (parent_value, parent_type, parent_name, NULL, + child_index, NULL, &child_value, NULL, NULL); return child_value; } @@ -794,8 +761,7 @@ ada_varobj_get_value_of_child (struct value *parent_value, static struct type * ada_varobj_get_type_of_child (struct value *parent_value, - struct type *parent_type, - int child_index) + struct type *parent_type, int child_index) { struct type *child_type; @@ -831,8 +797,7 @@ ada_varobj_get_value_image (struct value *value, The result should be deallocated after use using xfree. */ static std::string -ada_varobj_get_value_of_array_variable (struct value *value, - struct type *type, +ada_varobj_get_value_of_array_variable (struct value *value, struct type *type, struct value_print_options *opts) { const int numchild = ada_varobj_get_array_number_of_children (value, type); @@ -841,8 +806,7 @@ ada_varobj_get_value_of_array_variable (struct value *value, Otherwise, the only other way to inspect the contents of the string is by looking at the value of each element, as in any other array, which is not very convenient... */ - if (value - && ada_is_string_type (type) + if (value && ada_is_string_type (type) && (opts->format == 0 || opts->format == 's')) { std::string str = ada_varobj_get_value_image (value, opts); @@ -856,8 +820,7 @@ ada_varobj_get_value_of_array_variable (struct value *value, the given print options OPTS as our formatting options. */ static std::string -ada_varobj_get_value_of_variable (struct value *value, - struct type *type, +ada_varobj_get_value_of_variable (struct value *value, struct type *type, struct value_print_options *opts) { ada_varobj_decode_var (&value, &type); @@ -904,11 +867,9 @@ ada_path_expr_of_child (const struct varobj *child) const struct varobj *parent = child->parent; const char *parent_path_expr = varobj_get_path_expr (parent); - return ada_varobj_get_path_expr_of_child (parent->value.get (), - parent->type, + return ada_varobj_get_path_expr_of_child (parent->value.get (), parent->type, parent->name.c_str (), - parent_path_expr, - child->index); + parent_path_expr, child->index); } static struct value * @@ -942,8 +903,8 @@ ada_value_of_variable (const struct varobj *var, static bool ada_value_is_changeable_p (const struct varobj *var) { - struct type *type = (var->value != nullptr - ? value_type (var->value.get ()) : var->type); + struct type *type + = (var->value != nullptr ? value_type (var->value.get ()) : var->type); if (type->code () == TYPE_CODE_REF) type = type->target_type (); @@ -996,8 +957,7 @@ ada_value_has_mutated (const struct varobj *var, struct value *new_val, varobj_restrict_range (var->children, &from, &to); for (int i = from; i < to; i++) - if (ada_varobj_get_name_of_child (new_val, new_type, - var->name.c_str (), i) + if (ada_varobj_get_name_of_child (new_val, new_type, var->name.c_str (), i) != var->children[i]->name) return true; @@ -1006,16 +966,9 @@ ada_value_has_mutated (const struct varobj *var, struct value *new_val, /* varobj operations for ada. */ -const struct lang_varobj_ops ada_varobj_ops = -{ - ada_number_of_children, - ada_name_of_variable, - ada_name_of_child, - ada_path_expr_of_child, - ada_value_of_child, - ada_type_of_child, - ada_value_of_variable, - ada_value_is_changeable_p, - ada_value_has_mutated, - varobj_default_is_path_expr_parent -}; +const struct lang_varobj_ops ada_varobj_ops + = { ada_number_of_children, ada_name_of_variable, + ada_name_of_child, ada_path_expr_of_child, + ada_value_of_child, ada_type_of_child, + ada_value_of_variable, ada_value_is_changeable_p, + ada_value_has_mutated, varobj_default_is_path_expr_parent }; diff --git a/gdb/addrmap.c b/gdb/addrmap.c index 33dc776..494590d 100644 --- a/gdb/addrmap.c +++ b/gdb/addrmap.c @@ -27,18 +27,15 @@ gdb_static_assert (sizeof (splay_tree_key) >= sizeof (CORE_ADDR *)); gdb_static_assert (sizeof (splay_tree_value) >= sizeof (void *)); - /* Fixed address maps. */ void -addrmap_fixed::set_empty (CORE_ADDR start, CORE_ADDR end_inclusive, - void *obj) +addrmap_fixed::set_empty (CORE_ADDR start, CORE_ADDR end_inclusive, void *obj) { internal_error ("addrmap_fixed_set_empty: " "fixed addrmaps can't be changed\n"); } - void * addrmap_fixed::do_find (CORE_ADDR addr) const { @@ -70,7 +67,6 @@ addrmap_fixed::do_find (CORE_ADDR addr) const return bottom->value; } - void addrmap_fixed::relocate (CORE_ADDR offset) { @@ -80,7 +76,6 @@ addrmap_fixed::relocate (CORE_ADDR offset) transitions[i].addr += offset; } - int addrmap_fixed::do_foreach (addrmap_foreach_fn fn) const { @@ -97,8 +92,6 @@ addrmap_fixed::do_foreach (addrmap_foreach_fn fn) const return 0; } - - /* Mutable address maps. */ /* Allocate a copy of CORE_ADDR. */ @@ -111,7 +104,6 @@ addrmap_mutable::allocate_key (CORE_ADDR addr) return (splay_tree_key) key; } - /* Type-correct wrappers for splay tree access. */ splay_tree_node addrmap_mutable::splay_tree_lookup (CORE_ADDR addr) const @@ -119,58 +111,48 @@ addrmap_mutable::splay_tree_lookup (CORE_ADDR addr) const return ::splay_tree_lookup (tree, (splay_tree_key) &addr); } - splay_tree_node addrmap_mutable::splay_tree_predecessor (CORE_ADDR addr) const { return ::splay_tree_predecessor (tree, (splay_tree_key) &addr); } - splay_tree_node addrmap_mutable::splay_tree_successor (CORE_ADDR addr) { return ::splay_tree_successor (tree, (splay_tree_key) &addr); } - void addrmap_mutable::splay_tree_remove (CORE_ADDR addr) { ::splay_tree_remove (tree, (splay_tree_key) &addr); } - static CORE_ADDR addrmap_node_key (splay_tree_node node) { - return * (CORE_ADDR *) node->key; + return *(CORE_ADDR *) node->key; } - static void * addrmap_node_value (splay_tree_node node) { return (void *) node->value; } - static void addrmap_node_set_value (splay_tree_node node, void *value) { node->value = (splay_tree_value) value; } - void addrmap_mutable::splay_tree_insert (CORE_ADDR key, void *value) { - ::splay_tree_insert (tree, - allocate_key (key), - (splay_tree_value) value); + ::splay_tree_insert (tree, allocate_key (key), (splay_tree_value) value); } - /* Without changing the mapping of any address, ensure that there is a tree node at ADDR, even if it would represent a "transition" from one value to the same value. */ @@ -179,14 +161,13 @@ addrmap_mutable::force_transition (CORE_ADDR addr) { splay_tree_node n = splay_tree_lookup (addr); - if (! n) + if (!n) { n = splay_tree_predecessor (addr); splay_tree_insert (addr, n ? addrmap_node_value (n) : NULL); } } - void addrmap_mutable::set_empty (CORE_ADDR start, CORE_ADDR end_inclusive, void *obj) @@ -216,7 +197,7 @@ addrmap_mutable::set_empty (CORE_ADDR start, CORE_ADDR end_inclusive, n && addrmap_node_key (n) <= end_inclusive; n = splay_tree_successor (addrmap_node_key (n))) { - if (! addrmap_node_value (n)) + if (!addrmap_node_value (n)) addrmap_node_set_value (n, obj); } @@ -226,8 +207,9 @@ addrmap_mutable::set_empty (CORE_ADDR start, CORE_ADDR end_inclusive, n = splay_tree_predecessor (start); prior_value = n ? addrmap_node_value (n) : NULL; for (n = splay_tree_lookup (start), gdb_assert (n); - n && (end_inclusive == CORE_ADDR_MAX - || addrmap_node_key (n) <= end_inclusive + 1); + n + && (end_inclusive == CORE_ADDR_MAX + || addrmap_node_key (n) <= end_inclusive + 1); n = next) { next = splay_tree_successor (addrmap_node_key (n)); @@ -238,7 +220,6 @@ addrmap_mutable::set_empty (CORE_ADDR start, CORE_ADDR end_inclusive, } } - void * addrmap_mutable::do_find (CORE_ADDR addr) const { @@ -259,52 +240,47 @@ addrmap_mutable::do_find (CORE_ADDR addr) const return nullptr; } - addrmap_fixed::addrmap_fixed (struct obstack *obstack, addrmap_mutable *mut) { size_t transition_count = 0; /* Count the number of transitions in the tree. */ - mut->foreach ([&] (CORE_ADDR start, void *obj) - { - ++transition_count; - return 0; - }); + mut->foreach ([&] (CORE_ADDR start, void *obj) { + ++transition_count; + return 0; + }); /* Include an extra entry for the transition at zero (which fixed maps have, but mutable maps do not.) */ transition_count++; num_transitions = 1; - transitions = XOBNEWVEC (obstack, struct addrmap_transition, - transition_count); + transitions + = XOBNEWVEC (obstack, struct addrmap_transition, transition_count); transitions[0].addr = 0; transitions[0].value = NULL; /* Copy all entries from the splay tree to the array, in order of increasing address. */ - mut->foreach ([&] (CORE_ADDR start, void *obj) - { - transitions[num_transitions].addr = start; - transitions[num_transitions].value = obj; - ++num_transitions; - return 0; - }); + mut->foreach ([&] (CORE_ADDR start, void *obj) { + transitions[num_transitions].addr = start; + transitions[num_transitions].value = obj; + ++num_transitions; + return 0; + }); /* We should have filled the array. */ gdb_assert (num_transitions == transition_count); } - void addrmap_mutable::relocate (CORE_ADDR offset) { /* Not needed yet. */ - internal_error (_("addrmap_relocate is not implemented yet " - "for mutable addrmaps")); + internal_error (_ ("addrmap_relocate is not implemented yet " + "for mutable addrmaps")); } - /* This is a splay_tree_foreach_fn. */ static int @@ -315,20 +291,18 @@ addrmap_mutable_foreach_worker (splay_tree_node node, void *data) return (*fn) (addrmap_node_key (node), addrmap_node_value (node)); } - int addrmap_mutable::do_foreach (addrmap_foreach_fn fn) const { return splay_tree_foreach (tree, addrmap_mutable_foreach_worker, &fn); } - /* Compare keys as CORE_ADDR * values. */ static int splay_compare_CORE_ADDR_ptr (splay_tree_key ak, splay_tree_key bk) { - CORE_ADDR a = * (CORE_ADDR *) ak; - CORE_ADDR b = * (CORE_ADDR *) bk; + CORE_ADDR a = *(CORE_ADDR *) ak; + CORE_ADDR b = *(CORE_ADDR *) bk; /* We can't just return a-b here, because of over/underflow. */ if (a < b) @@ -339,7 +313,6 @@ splay_compare_CORE_ADDR_ptr (splay_tree_key ak, splay_tree_key bk) return 1; } - static void xfree_wrapper (splay_tree_key key) { @@ -357,7 +330,6 @@ addrmap_mutable::~addrmap_mutable () splay_tree_delete (tree); } - /* See addrmap.h. */ void @@ -368,8 +340,7 @@ addrmap_dump (struct addrmap *map, struct ui_file *outfile, void *payload) addrmap entry defines the end of the range). */ bool previous_matched = false; - auto callback = [&] (CORE_ADDR start_addr, const void *obj) - { + auto callback = [&] (CORE_ADDR start_addr, const void *obj) { QUIT; bool matches = payload == nullptr || payload == obj; @@ -380,10 +351,8 @@ addrmap_dump (struct addrmap *map, struct ui_file *outfile, void *payload) addr_str = ""; if (matches || previous_matched) - gdb_printf (outfile, " %s%s %s\n", - payload != nullptr ? " " : "", - core_addr_to_string (start_addr), - addr_str); + gdb_printf (outfile, " %s%s %s\n", payload != nullptr ? " " : "", + core_addr_to_string (start_addr), addr_str); previous_matched = matches; @@ -394,24 +363,25 @@ addrmap_dump (struct addrmap *map, struct ui_file *outfile, void *payload) } #if GDB_SELF_TEST -namespace selftests { +namespace selftests +{ /* Convert P to CORE_ADDR. */ static CORE_ADDR core_addr (void *p) { - return (CORE_ADDR)(uintptr_t)p; + return (CORE_ADDR) (uintptr_t) p; } /* Check that &ARRAY[LOW]..&ARRAY[HIGH] has VAL in MAP. */ -#define CHECK_ADDRMAP_FIND(MAP, ARRAY, LOW, HIGH, VAL) \ - do \ - { \ - for (unsigned i = LOW; i <= HIGH; ++i) \ - SELF_CHECK (MAP->find (core_addr (&ARRAY[i])) == VAL); \ - } \ +#define CHECK_ADDRMAP_FIND(MAP, ARRAY, LOW, HIGH, VAL) \ + do \ + { \ + for (unsigned i = LOW; i <= HIGH; ++i) \ + SELF_CHECK (MAP->find (core_addr (&ARRAY[i])) == VAL); \ + } \ while (0) /* Entry point for addrmap unit tests. */ @@ -449,18 +419,17 @@ test_addrmap () CHECK_ADDRMAP_FIND (map2, array, 13, 19, nullptr); /* Iterate over both addrmaps. */ - auto callback = [&] (CORE_ADDR start_addr, void *obj) - { - if (start_addr == core_addr (nullptr)) - SELF_CHECK (obj == nullptr); - else if (start_addr == core_addr (&array[10])) - SELF_CHECK (obj == val1); - else if (start_addr == core_addr (&array[13])) - SELF_CHECK (obj == nullptr); - else - SELF_CHECK (false); - return 0; - }; + auto callback = [&] (CORE_ADDR start_addr, void *obj) { + if (start_addr == core_addr (nullptr)) + SELF_CHECK (obj == nullptr); + else if (start_addr == core_addr (&array[10])) + SELF_CHECK (obj == val1); + else if (start_addr == core_addr (&array[13])) + SELF_CHECK (obj == nullptr); + else + SELF_CHECK (false); + return 0; + }; SELF_CHECK (map->foreach (callback) == 0); SELF_CHECK (map2->foreach (callback) == 0); @@ -482,6 +451,7 @@ test_addrmap () #endif /* GDB_SELF_TEST */ void _initialize_addrmap (); + void _initialize_addrmap () { diff --git a/gdb/addrmap.h b/gdb/addrmap.h index e00dda6..03c866d 100644 --- a/gdb/addrmap.h +++ b/gdb/addrmap.h @@ -83,15 +83,13 @@ struct addrmap semantics than to provide an interface which allows it to be implemented efficiently, but doesn't reveal too much of the representation. */ - virtual void set_empty (CORE_ADDR start, CORE_ADDR end_inclusive, - void *obj) = 0; + virtual void set_empty (CORE_ADDR start, CORE_ADDR end_inclusive, void *obj) + = 0; /* Return the object associated with ADDR in MAP. */ - const void *find (CORE_ADDR addr) const - { return this->do_find (addr); } + const void *find (CORE_ADDR addr) const { return this->do_find (addr); } - void *find (CORE_ADDR addr) - { return this->do_find (addr); } + void *find (CORE_ADDR addr) { return this->do_find (addr); } /* Relocate all the addresses in MAP by OFFSET. (This can be applied to either mutable or immutable maps.) */ @@ -102,13 +100,14 @@ struct addrmap immediately, and the value is returned. Otherwise, this function returns 0. */ int foreach (addrmap_foreach_const_fn fn) const - { return this->do_foreach (fn); } - - int foreach (addrmap_foreach_fn fn) - { return this->do_foreach (fn); } + { + return this->do_foreach (fn); + } + int foreach (addrmap_foreach_fn fn) { return this->do_foreach (fn); } private: + /* Worker for find, implemented by sub-classes. */ virtual void *do_find (CORE_ADDR addr) const = 0; @@ -119,8 +118,7 @@ private: struct addrmap_mutable; /* Fixed address maps. */ -struct addrmap_fixed : public addrmap, - public allocate_on_obstack +struct addrmap_fixed : public addrmap, public allocate_on_obstack { public: @@ -132,6 +130,7 @@ public: void relocate (CORE_ADDR offset) override; private: + void *do_find (CORE_ADDR addr) const override; int do_foreach (addrmap_foreach_fn fn) const override; @@ -170,6 +169,7 @@ public: void relocate (CORE_ADDR offset) override; private: + void *do_find (CORE_ADDR addr) const override; int do_foreach (addrmap_foreach_fn fn) const override; @@ -202,7 +202,6 @@ private: void splay_tree_insert (CORE_ADDR key, void *value); }; - /* Dump the addrmap to OUTFILE. If PAYLOAD is non-NULL, only dump any components that map to PAYLOAD. (If PAYLOAD is NULL, the entire map is dumped.) */ diff --git a/gdb/agent.c b/gdb/agent.c index e2ad3b5..b1c46a0 100644 --- a/gdb/agent.c +++ b/gdb/agent.c @@ -27,8 +27,7 @@ static const char can_use_agent_on[] = "on"; static const char can_use_agent_off[] = "off"; -static const char * const can_use_agent_enum[] = -{ +static const char *const can_use_agent_enum[] = { can_use_agent_on, can_use_agent_off, NULL, @@ -41,8 +40,9 @@ show_can_use_agent (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) { gdb_printf (file, - _("Debugger's willingness to use agent in inferior " - "as a helper is %s.\n"), value); + _ ("Debugger's willingness to use agent in inferior " + "as a helper is %s.\n"), + value); } static void @@ -75,23 +75,23 @@ agent_new_objfile (struct objfile *objfile) } void _initialize_agent (); + void _initialize_agent () { - gdb::observers::new_objfile.attach (agent_new_objfile, - "agent"); - - add_setshow_enum_cmd ("agent", class_run, - can_use_agent_enum, - &can_use_agent, _("\ -Set debugger's willingness to use agent as a helper."), _("\ -Show debugger's willingness to use agent as a helper."), _("\ + gdb::observers::new_objfile.attach (agent_new_objfile, "agent"); + + add_setshow_enum_cmd ("agent", class_run, can_use_agent_enum, &can_use_agent, + _ ("\ +Set debugger's willingness to use agent as a helper."), + _ ("\ +Show debugger's willingness to use agent as a helper."), + _ ("\ If on, GDB will delegate some of the debugging operations to the\n\ agent, if the target supports it. This will speed up those\n\ operations that are supported by the agent.\n\ If off, GDB will not use agent, even if such is supported by the\n\ target."), - set_can_use_agent, - show_can_use_agent, - &setlist, &showlist); + set_can_use_agent, show_can_use_agent, &setlist, + &showlist); } diff --git a/gdb/aix-thread.c b/gdb/aix-thread.c index 1e28b68..c73a867 100644 --- a/gdb/aix-thread.c +++ b/gdb/aix-thread.c @@ -18,7 +18,6 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ - /* This module uses the libpthdebug.a library provided by AIX 4.3+ for debugging pthread applications. @@ -65,24 +64,24 @@ static bool debug_aix_thread; /* In AIX 5.1, functions use pthdb_tid_t instead of tid_t. */ #ifndef PTHDB_VERSION_3 -#define pthdb_tid_t tid_t +#define pthdb_tid_t tid_t #endif /* Return whether to treat PID as a debuggable thread id. */ -#define PD_TID(ptid) (pd_active && ptid.tid () != 0) +#define PD_TID(ptid) (pd_active && ptid.tid () != 0) /* Success and failure values returned by pthdb callbacks. */ -#define PDC_SUCCESS PTHDB_SUCCESS -#define PDC_FAILURE PTHDB_CALLBACK +#define PDC_SUCCESS PTHDB_SUCCESS +#define PDC_FAILURE PTHDB_CALLBACK /* Private data attached to each element in GDB's thread list. */ struct aix_thread_info : public private_thread_info { - pthdb_pthread_t pdtid; /* thread's libpthdebug id */ - pthdb_tid_t tid; /* kernel thread id */ + pthdb_pthread_t pdtid; /* thread's libpthdebug id */ + pthdb_tid_t tid; /* kernel thread id */ }; /* Return the aix_thread_info attached to THREAD. */ @@ -95,7 +94,8 @@ get_aix_thread_info (thread_info *thread) /* Information about a thread of which libpthdebug is aware. */ -struct pd_thread { +struct pd_thread +{ pthdb_pthread_t pdtid; pthread_t pthid; pthdb_tid_t tid; @@ -103,17 +103,14 @@ struct pd_thread { /* This module's target-specific operations, active while pd_able is true. */ -static const target_info aix_thread_target_info = { - "aix-threads", - N_("AIX pthread support"), - N_("AIX pthread support") -}; +static const target_info aix_thread_target_info + = { "aix-threads", N_ ("AIX pthread support"), N_ ("AIX pthread support") }; class aix_thread_target final : public target_ops { public: - const target_info &info () const override - { return aix_thread_target_info; } + + const target_info &info () const override { return aix_thread_target_info; } strata stratum () const override { return thread_stratum; } @@ -125,8 +122,7 @@ public: void store_registers (struct regcache *, int) override; enum target_xfer_status xfer_partial (enum target_object object, - const char *annex, - gdb_byte *readbuf, + const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len, ULONGEST *xfered_len) override; @@ -168,28 +164,19 @@ static int pdc_symbol_addrs (pthdb_user_t, pthdb_symbol_t *, int); static int pdc_read_data (pthdb_user_t, void *, pthdb_addr_t, size_t); static int pdc_write_data (pthdb_user_t, void *, pthdb_addr_t, size_t); static int pdc_read_regs (pthdb_user_t user, pthdb_tid_t tid, - unsigned long long flags, - pthdb_context_t *context); + unsigned long long flags, pthdb_context_t *context); static int pdc_write_regs (pthdb_user_t user, pthdb_tid_t tid, - unsigned long long flags, - pthdb_context_t *context); + unsigned long long flags, pthdb_context_t *context); static int pdc_alloc (pthdb_user_t, size_t, void **); static int pdc_realloc (pthdb_user_t, void *, size_t, void **); static int pdc_dealloc (pthdb_user_t, void *); /* pthdb callbacks. */ -static pthdb_callbacks_t pd_callbacks = { - pdc_symbol_addrs, - pdc_read_data, - pdc_write_data, - pdc_read_regs, - pdc_write_regs, - pdc_alloc, - pdc_realloc, - pdc_dealloc, - NULL -}; +static pthdb_callbacks_t pd_callbacks + = { pdc_symbol_addrs, pdc_read_data, pdc_write_data, + pdc_read_regs, pdc_write_regs, pdc_alloc, + pdc_realloc, pdc_dealloc, NULL }; /* Current pthdb session. */ @@ -203,38 +190,70 @@ pd_status2str (int status) { switch (status) { - case PTHDB_SUCCESS: return "SUCCESS"; - case PTHDB_NOSYS: return "NOSYS"; - case PTHDB_NOTSUP: return "NOTSUP"; - case PTHDB_BAD_VERSION: return "BAD_VERSION"; - case PTHDB_BAD_USER: return "BAD_USER"; - case PTHDB_BAD_SESSION: return "BAD_SESSION"; - case PTHDB_BAD_MODE: return "BAD_MODE"; - case PTHDB_BAD_FLAGS: return "BAD_FLAGS"; - case PTHDB_BAD_CALLBACK: return "BAD_CALLBACK"; - case PTHDB_BAD_POINTER: return "BAD_POINTER"; - case PTHDB_BAD_CMD: return "BAD_CMD"; - case PTHDB_BAD_PTHREAD: return "BAD_PTHREAD"; - case PTHDB_BAD_ATTR: return "BAD_ATTR"; - case PTHDB_BAD_MUTEX: return "BAD_MUTEX"; - case PTHDB_BAD_MUTEXATTR: return "BAD_MUTEXATTR"; - case PTHDB_BAD_COND: return "BAD_COND"; - case PTHDB_BAD_CONDATTR: return "BAD_CONDATTR"; - case PTHDB_BAD_RWLOCK: return "BAD_RWLOCK"; - case PTHDB_BAD_RWLOCKATTR: return "BAD_RWLOCKATTR"; - case PTHDB_BAD_KEY: return "BAD_KEY"; - case PTHDB_BAD_PTID: return "BAD_PTID"; - case PTHDB_BAD_TID: return "BAD_TID"; - case PTHDB_CALLBACK: return "CALLBACK"; - case PTHDB_CONTEXT: return "CONTEXT"; - case PTHDB_HELD: return "HELD"; - case PTHDB_NOT_HELD: return "NOT_HELD"; - case PTHDB_MEMORY: return "MEMORY"; - case PTHDB_NOT_PTHREADED: return "NOT_PTHREADED"; - case PTHDB_SYMBOL: return "SYMBOL"; - case PTHDB_NOT_AVAIL: return "NOT_AVAIL"; - case PTHDB_INTERNAL: return "INTERNAL"; - default: return "UNKNOWN"; + case PTHDB_SUCCESS: + return "SUCCESS"; + case PTHDB_NOSYS: + return "NOSYS"; + case PTHDB_NOTSUP: + return "NOTSUP"; + case PTHDB_BAD_VERSION: + return "BAD_VERSION"; + case PTHDB_BAD_USER: + return "BAD_USER"; + case PTHDB_BAD_SESSION: + return "BAD_SESSION"; + case PTHDB_BAD_MODE: + return "BAD_MODE"; + case PTHDB_BAD_FLAGS: + return "BAD_FLAGS"; + case PTHDB_BAD_CALLBACK: + return "BAD_CALLBACK"; + case PTHDB_BAD_POINTER: + return "BAD_POINTER"; + case PTHDB_BAD_CMD: + return "BAD_CMD"; + case PTHDB_BAD_PTHREAD: + return "BAD_PTHREAD"; + case PTHDB_BAD_ATTR: + return "BAD_ATTR"; + case PTHDB_BAD_MUTEX: + return "BAD_MUTEX"; + case PTHDB_BAD_MUTEXATTR: + return "BAD_MUTEXATTR"; + case PTHDB_BAD_COND: + return "BAD_COND"; + case PTHDB_BAD_CONDATTR: + return "BAD_CONDATTR"; + case PTHDB_BAD_RWLOCK: + return "BAD_RWLOCK"; + case PTHDB_BAD_RWLOCKATTR: + return "BAD_RWLOCKATTR"; + case PTHDB_BAD_KEY: + return "BAD_KEY"; + case PTHDB_BAD_PTID: + return "BAD_PTID"; + case PTHDB_BAD_TID: + return "BAD_TID"; + case PTHDB_CALLBACK: + return "CALLBACK"; + case PTHDB_CONTEXT: + return "CONTEXT"; + case PTHDB_HELD: + return "HELD"; + case PTHDB_NOT_HELD: + return "NOT_HELD"; + case PTHDB_MEMORY: + return "MEMORY"; + case PTHDB_NOT_PTHREADED: + return "NOT_PTHREADED"; + case PTHDB_SYMBOL: + return "SYMBOL"; + case PTHDB_NOT_AVAIL: + return "NOT_AVAIL"; + case PTHDB_INTERNAL: + return "INTERNAL"; + default: + return "UNKNOWN"; } } @@ -261,16 +280,15 @@ ptrace_check (int req, int id, int ret) if (ret == -1 && errno == EPERM) { if (debug_aix_thread) - gdb_printf (gdb_stdlog, - "ptrace (%d, %d) = %d (errno = %d)\n", - req, id, ret, errno); + gdb_printf (gdb_stdlog, "ptrace (%d, %d) = %d (errno = %d)\n", req, + id, ret, errno); return ret == -1 ? 0 : 1; } break; } - error (_("aix-thread: ptrace (%d, %d) returned %d (errno = %d %s)"), - req, id, ret, errno, safe_strerror (errno)); - return 0; /* Not reached. */ + error (_ ("aix-thread: ptrace (%d, %d) returned %d (errno = %d %s)"), req, + id, ret, errno, safe_strerror (errno)); + return 0; /* Not reached. */ } /* Call ptracex (REQ, ID, ADDR, DATA, BUF) or @@ -278,8 +296,8 @@ ptrace_check (int req, int id, int ret) Return success. */ #ifdef HAVE_PTRACE64 -# define ptracex(request, pid, addr, data, buf) \ - ptrace64 (request, pid, addr, data, buf) +#define ptracex(request, pid, addr, data, buf) \ + ptrace64 (request, pid, addr, data, buf) #endif static int @@ -294,19 +312,18 @@ ptrace64aix (int req, int id, long long addr, int data, int *buf) Return success. */ #ifdef HAVE_PTRACE64 -# define ptrace(request, pid, addr, data, buf) \ - ptrace64 (request, pid, addr, data, buf) -# define addr_ptr long long +#define ptrace(request, pid, addr, data, buf) \ + ptrace64 (request, pid, addr, data, buf) +#define addr_ptr long long #else -# define addr_ptr int * +#define addr_ptr int * #endif static int ptrace32 (int req, int id, addr_ptr addr, int data, int *buf) { errno = 0; - return ptrace_check (req, id, - ptrace (req, id, addr, data, buf)); + return ptrace_check (req, id, ptrace (req, id, addr, data, buf)); } /* If *PIDP is a composite process/thread id, convert it to a @@ -326,7 +343,8 @@ pid_to_prc (ptid_t *ptidp) the address of SYMBOLS[].name. */ static int -pdc_symbol_addrs (pthdb_user_t user_current_pid, pthdb_symbol_t *symbols, int count) +pdc_symbol_addrs (pthdb_user_t user_current_pid, pthdb_symbol_t *symbols, + int count) { struct bound_minimal_symbol ms; int i; @@ -334,15 +352,15 @@ pdc_symbol_addrs (pthdb_user_t user_current_pid, pthdb_symbol_t *symbols, int co if (debug_aix_thread) gdb_printf (gdb_stdlog, - "pdc_symbol_addrs (user_current_pid = %ld, symbols = 0x%lx, count = %d)\n", + "pdc_symbol_addrs (user_current_pid = %ld, symbols = 0x%lx, " + "count = %d)\n", user_current_pid, (long) symbols, count); for (i = 0; i < count; i++) { name = symbols[i].name; if (debug_aix_thread) - gdb_printf (gdb_stdlog, - " symbols[%d].name = \"%s\"\n", i, name); + gdb_printf (gdb_stdlog, " symbols[%d].name = \"%s\"\n", i, name); if (!*name) symbols[i].addr = 0; @@ -358,8 +376,8 @@ pdc_symbol_addrs (pthdb_user_t user_current_pid, pthdb_symbol_t *symbols, int co symbols[i].addr = ms.value_address (); } if (debug_aix_thread) - gdb_printf (gdb_stdlog, " symbols[%d].addr = %s\n", - i, hex_string (symbols[i].addr)); + gdb_printf (gdb_stdlog, " symbols[%d].addr = %s\n", i, + hex_string (symbols[i].addr)); } if (debug_aix_thread) gdb_printf (gdb_stdlog, " returning PDC_SUCCESS\n"); @@ -373,10 +391,8 @@ pdc_symbol_addrs (pthdb_user_t user_current_pid, pthdb_symbol_t *symbols, int co If successful return 0, else non-zero is returned. */ static int -pdc_read_regs (pthdb_user_t user_current_pid, - pthdb_tid_t tid, - unsigned long long flags, - pthdb_context_t *context) +pdc_read_regs (pthdb_user_t user_current_pid, pthdb_tid_t tid, + unsigned long long flags, pthdb_context_t *context) { /* This function doesn't appear to be used, so we could probably just return 0 here. HOWEVER, if it is not defined, the OS will @@ -389,26 +405,26 @@ pdc_read_regs (pthdb_user_t user_current_pid, double fprs[ppc_num_fprs]; struct ptxsprs sprs64; struct ptsprs sprs32; - + if (debug_aix_thread) - gdb_printf (gdb_stdlog, "pdc_read_regs tid=%d flags=%s\n", - (int) tid, hex_string (flags)); + gdb_printf (gdb_stdlog, "pdc_read_regs tid=%d flags=%s\n", (int) tid, + hex_string (flags)); /* General-purpose registers. */ if (flags & PTHDB_FLAG_GPRS) { if (arch64) { - if (!ptrace64aix (PTT_READ_GPRS, tid, - (unsigned long) gprs64, 0, NULL)) + if (!ptrace64aix (PTT_READ_GPRS, tid, (unsigned long) gprs64, 0, + NULL)) memset (gprs64, 0, sizeof (gprs64)); - memcpy (context->gpr, gprs64, sizeof(gprs64)); + memcpy (context->gpr, gprs64, sizeof (gprs64)); } else { if (!ptrace32 (PTT_READ_GPRS, tid, (uintptr_t) gprs32, 0, NULL)) memset (gprs32, 0, sizeof (gprs32)); - memcpy (context->gpr, gprs32, sizeof(gprs32)); + memcpy (context->gpr, gprs32, sizeof (gprs32)); } } @@ -417,7 +433,7 @@ pdc_read_regs (pthdb_user_t user_current_pid, { if (!ptrace32 (PTT_READ_FPRS, tid, (uintptr_t) fprs, 0, NULL)) memset (fprs, 0, sizeof (fprs)); - memcpy (context->fpr, fprs, sizeof(fprs)); + memcpy (context->fpr, fprs, sizeof (fprs)); } /* Special-purpose registers. */ @@ -425,18 +441,18 @@ pdc_read_regs (pthdb_user_t user_current_pid, { if (arch64) { - if (!ptrace64aix (PTT_READ_SPRS, tid, - (unsigned long) &sprs64, 0, NULL)) + if (!ptrace64aix (PTT_READ_SPRS, tid, (unsigned long) &sprs64, 0, + NULL)) memset (&sprs64, 0, sizeof (sprs64)); - memcpy (&context->msr, &sprs64, sizeof(sprs64)); + memcpy (&context->msr, &sprs64, sizeof (sprs64)); } else { if (!ptrace32 (PTT_READ_SPRS, tid, (uintptr_t) &sprs32, 0, NULL)) memset (&sprs32, 0, sizeof (sprs32)); - memcpy (&context->msr, &sprs32, sizeof(sprs32)); + memcpy (&context->msr, &sprs32, sizeof (sprs32)); } - } + } return 0; } @@ -445,11 +461,9 @@ pdc_read_regs (pthdb_user_t user_current_pid, If successful return 0, else non-zero is returned. */ static int -pdc_write_regs (pthdb_user_t user_current_pid, - pthdb_tid_t tid, - unsigned long long flags, - pthdb_context_t *context) -{ +pdc_write_regs (pthdb_user_t user_current_pid, pthdb_tid_t tid, + unsigned long long flags, pthdb_context_t *context) +{ /* This function doesn't appear to be used, so we could probably just return 0 here. HOWEVER, if it is not defined, the OS will complain and several thread debug functions will fail. In case @@ -457,20 +471,20 @@ pdc_write_regs (pthdb_user_t user_current_pid, however this code is untested. */ if (debug_aix_thread) - gdb_printf (gdb_stdlog, "pdc_write_regs tid=%d flags=%s\n", - (int) tid, hex_string (flags)); + gdb_printf (gdb_stdlog, "pdc_write_regs tid=%d flags=%s\n", (int) tid, + hex_string (flags)); /* General-purpose registers. */ if (flags & PTHDB_FLAG_GPRS) { if (arch64) - ptrace64aix (PTT_WRITE_GPRS, tid, - (unsigned long) context->gpr, 0, NULL); + ptrace64aix (PTT_WRITE_GPRS, tid, (unsigned long) context->gpr, 0, + NULL); else ptrace32 (PTT_WRITE_GPRS, tid, (uintptr_t) context->gpr, 0, NULL); } - /* Floating-point registers. */ + /* Floating-point registers. */ if (flags & PTHDB_FLAG_FPRS) { ptrace32 (PTT_WRITE_FPRS, tid, (uintptr_t) context->fpr, 0, NULL); @@ -481,8 +495,8 @@ pdc_write_regs (pthdb_user_t user_current_pid, { if (arch64) { - ptrace64aix (PTT_WRITE_SPRS, tid, - (unsigned long) &context->msr, 0, NULL); + ptrace64aix (PTT_WRITE_SPRS, tid, (unsigned long) &context->msr, 0, + NULL); } else { @@ -495,14 +509,15 @@ pdc_write_regs (pthdb_user_t user_current_pid, /* pthdb callback: read LEN bytes from process ADDR into BUF. */ static int -pdc_read_data (pthdb_user_t user_current_pid, void *buf, - pthdb_addr_t addr, size_t len) +pdc_read_data (pthdb_user_t user_current_pid, void *buf, pthdb_addr_t addr, + size_t len) { int status, ret; if (debug_aix_thread) gdb_printf (gdb_stdlog, - "pdc_read_data (user_current_pid = %ld, buf = 0x%lx, addr = %s, len = %ld)\n", + "pdc_read_data (user_current_pid = %ld, buf = 0x%lx, addr = " + "%s, len = %ld)\n", user_current_pid, (long) buf, hex_string (addr), len); /* This is needed to eliminate the dependency of current thread @@ -521,22 +536,23 @@ pdc_read_data (pthdb_user_t user_current_pid, void *buf, ret = status == 0 ? PDC_SUCCESS : PDC_FAILURE; if (debug_aix_thread) - gdb_printf (gdb_stdlog, " status=%d, returning %s\n", - status, pd_status2str (ret)); + gdb_printf (gdb_stdlog, " status=%d, returning %s\n", status, + pd_status2str (ret)); return ret; } /* pthdb callback: write LEN bytes from BUF to process ADDR. */ static int -pdc_write_data (pthdb_user_t user_current_pid, void *buf, - pthdb_addr_t addr, size_t len) +pdc_write_data (pthdb_user_t user_current_pid, void *buf, pthdb_addr_t addr, + size_t len) { int status, ret; if (debug_aix_thread) gdb_printf (gdb_stdlog, - "pdc_write_data (user_current_pid = %ld, buf = 0x%lx, addr = %s, len = %ld)\n", + "pdc_write_data (user_current_pid = %ld, buf = 0x%lx, addr = " + "%s, len = %ld)\n", user_current_pid, (long) buf, hex_string (addr), len); status = target_write_memory (addr, (gdb_byte *) buf, len); @@ -555,13 +571,13 @@ static int pdc_alloc (pthdb_user_t user_current_pid, size_t len, void **bufp) { if (debug_aix_thread) - gdb_printf (gdb_stdlog, - "pdc_alloc (user_current_pid = %ld, len = %ld, bufp = 0x%lx)\n", - user_current_pid, len, (long) bufp); + gdb_printf ( + gdb_stdlog, + "pdc_alloc (user_current_pid = %ld, len = %ld, bufp = 0x%lx)\n", + user_current_pid, len, (long) bufp); *bufp = xmalloc (len); if (debug_aix_thread) - gdb_printf (gdb_stdlog, - " malloc returned 0x%lx\n", (long) *bufp); + gdb_printf (gdb_stdlog, " malloc returned 0x%lx\n", (long) *bufp); /* Note: xmalloc() can't return 0; therefore PDC_FAILURE will never be returned. */ @@ -578,12 +594,12 @@ pdc_realloc (pthdb_user_t user_current_pid, void *buf, size_t len, void **bufp) { if (debug_aix_thread) gdb_printf (gdb_stdlog, - "pdc_realloc (user_current_pid = %ld, buf = 0x%lx, len = %ld, bufp = 0x%lx)\n", + "pdc_realloc (user_current_pid = %ld, buf = 0x%lx, len = %ld, " + "bufp = 0x%lx)\n", user_current_pid, (long) buf, len, (long) bufp); *bufp = xrealloc (buf, len); if (debug_aix_thread) - gdb_printf (gdb_stdlog, - " realloc returned 0x%lx\n", (long) *bufp); + gdb_printf (gdb_stdlog, " realloc returned 0x%lx\n", (long) *bufp); return *bufp ? PDC_SUCCESS : PDC_FAILURE; } @@ -594,9 +610,8 @@ static int pdc_dealloc (pthdb_user_t user_current_pid, void *buf) { if (debug_aix_thread) - gdb_printf (gdb_stdlog, - "pdc_free (user_current_pid = %ld, buf = 0x%lx)\n", user_current_pid, - (long) buf); + gdb_printf (gdb_stdlog, "pdc_free (user_current_pid = %ld, buf = 0x%lx)\n", + user_current_pid, (long) buf); xfree (buf); return PDC_SUCCESS; } @@ -610,22 +625,22 @@ state2str (pthdb_state_t state) { case PST_IDLE: /* i18n: Like "Thread-Id %d, [state] idle" */ - return _("idle"); /* being created */ + return _ ("idle"); /* being created */ case PST_RUN: /* i18n: Like "Thread-Id %d, [state] running" */ - return _("running"); /* running */ + return _ ("running"); /* running */ case PST_SLEEP: /* i18n: Like "Thread-Id %d, [state] sleeping" */ - return _("sleeping"); /* awaiting an event */ + return _ ("sleeping"); /* awaiting an event */ case PST_READY: /* i18n: Like "Thread-Id %d, [state] ready" */ - return _("ready"); /* runnable */ + return _ ("ready"); /* runnable */ case PST_TERM: /* i18n: Like "Thread-Id %d, [state] finished" */ - return _("finished"); /* awaiting a join/detach */ + return _ ("finished"); /* awaiting a join/detach */ default: /* i18n: Like "Thread-Id %d, [state] unknown" */ - return _("unknown"); + return _ ("unknown"); } } @@ -715,8 +730,7 @@ get_signaled_thread (int pid) while (1) { - if (getthrds (pid, &thrinf, - sizeof (thrinf), &ktid, 1) != 1) + if (getthrds (pid, &thrinf, sizeof (thrinf), &ktid, 1) != 1) break; if (thrinf.ti_cursig == SIGTRAP) @@ -770,8 +784,7 @@ sync_threadlists (int pid) if (pcount == psize) { psize *= 2; - pbuf = (struct pd_thread *) xrealloc (pbuf, - psize * sizeof *pbuf); + pbuf = (struct pd_thread *) xrealloc (pbuf, psize * sizeof *pbuf); } pbuf[pcount].pdtid = pdtid; pbuf[pcount].pthid = pthid; @@ -812,9 +825,9 @@ sync_threadlists (int pid) process_stratum_target *proc_target = current_inferior ()->process_target (); - thread = add_thread_with_info (proc_target, - ptid_t (pid, 0, pbuf[pi].pthid), - priv); + thread + = add_thread_with_info (proc_target, + ptid_t (pid, 0, pbuf[pi].pthid), priv); pi++; } @@ -869,7 +882,7 @@ sync_threadlists (int pid) static int iter_tid (struct thread_info *thread, void *tidp) { - const pthdb_tid_t tid = *(pthdb_tid_t *)tidp; + const pthdb_tid_t tid = *(pthdb_tid_t *) tidp; aix_thread_info *priv = get_aix_thread_info (thread); return priv->tid == tid; @@ -918,10 +931,9 @@ static ptid_t pd_activate (int pid) { int status; - + status = pthdb_session_init (pid, arch64 ? PEM_64BIT : PEM_32BIT, - PTHDB_FLAG_REGS, &pd_callbacks, - &pd_session); + PTHDB_FLAG_REGS, &pd_callbacks, &pd_session); if (status != PTHDB_SUCCESS) { return ptid_t (pid); @@ -938,7 +950,7 @@ pd_deactivate (void) if (!pd_active) return; pthdb_session_destroy (pd_session); - + pid_to_prc (&inferior_ptid); pd_active = 0; } @@ -964,8 +976,7 @@ pd_enable (void) stub_name = NULL; status = pthdb_session_pthreaded (inferior_ptid.pid (), PTHDB_FLAG_REGS, &pd_callbacks, &stub_name); - if ((status != PTHDB_SUCCESS - && status != PTHDB_NOT_PTHREADED) || !stub_name) + if ((status != PTHDB_SUCCESS && status != PTHDB_NOT_PTHREADED) || !stub_name) return; /* Set a breakpoint on the returned stub function. */ @@ -1046,7 +1057,7 @@ aix_thread_target::resume (ptid_t ptid, int step, enum gdb_signal sig) if (!PD_TID (ptid)) { scoped_restore save_inferior_ptid = make_scoped_restore (&inferior_ptid); - + inferior_ptid = ptid_t (inferior_ptid.pid ()); beneath ()->resume (ptid, step, sig); } @@ -1054,23 +1065,21 @@ aix_thread_target::resume (ptid_t ptid, int step, enum gdb_signal sig) { thread = find_thread_ptid (current_inferior (), ptid); if (!thread) - error (_("aix-thread resume: unknown pthread %ld"), - ptid.lwp ()); + error (_ ("aix-thread resume: unknown pthread %ld"), ptid.lwp ()); aix_thread_info *priv = get_aix_thread_info (thread); tid[0] = priv->tid; if (tid[0] == PTHDB_INVALID_TID) - error (_("aix-thread resume: no tid for pthread %ld"), - ptid.lwp ()); + error (_ ("aix-thread resume: no tid for pthread %ld"), ptid.lwp ()); tid[1] = 0; if (arch64) ptrace64aix (PTT_CONTINUE, tid[0], (long long) 1, gdb_signal_to_host (sig), (PTRACE_TYPE_ARG5) tid); else - ptrace32 (PTT_CONTINUE, tid[0], (addr_ptr) 1, - gdb_signal_to_host (sig), (PTRACE_TYPE_ARG5) tid); + ptrace32 (PTT_CONTINUE, tid[0], (addr_ptr) 1, gdb_signal_to_host (sig), + (PTRACE_TYPE_ARG5) tid); } } @@ -1104,8 +1113,8 @@ aix_thread_target::wait (ptid_t ptid, struct target_waitstatus *status, struct regcache *regcache = get_thread_regcache (proc_target, ptid); struct gdbarch *gdbarch = regcache->arch (); - if (regcache_read_pc (regcache) - - gdbarch_decr_pc_after_break (gdbarch) == pd_brk_addr) + if (regcache_read_pc (regcache) - gdbarch_decr_pc_after_break (gdbarch) + == pd_brk_addr) return pd_activate (ptid.pid ()); } @@ -1117,8 +1126,7 @@ aix_thread_target::wait (ptid_t ptid, struct target_waitstatus *status, static void supply_gprs64 (struct regcache *regcache, uint64_t *vals) { - ppc_gdbarch_tdep *tdep - = gdbarch_tdep (regcache->arch ()); + ppc_gdbarch_tdep *tdep = gdbarch_tdep (regcache->arch ()); int regno; for (regno = 0; regno < ppc_num_gprs; regno++) @@ -1148,8 +1156,7 @@ supply_fprs (struct regcache *regcache, double *vals) gdb_assert (ppc_floating_point_unit_p (gdbarch)); for (regno = tdep->ppc_fp0_regnum; - regno < tdep->ppc_fp0_regnum + ppc_num_fprs; - regno++) + regno < tdep->ppc_fp0_regnum + ppc_num_fprs; regno++) regcache->raw_supply (regno, (char *) (vals + regno - tdep->ppc_fp0_regnum)); } @@ -1160,24 +1167,19 @@ special_register_p (struct gdbarch *gdbarch, int regno) { ppc_gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - return regno == gdbarch_pc_regnum (gdbarch) - || regno == tdep->ppc_ps_regnum - || regno == tdep->ppc_cr_regnum - || regno == tdep->ppc_lr_regnum - || regno == tdep->ppc_ctr_regnum - || regno == tdep->ppc_xer_regnum - || (tdep->ppc_fpscr_regnum >= 0 && regno == tdep->ppc_fpscr_regnum) - || (tdep->ppc_mq_regnum >= 0 && regno == tdep->ppc_mq_regnum); + return regno == gdbarch_pc_regnum (gdbarch) || regno == tdep->ppc_ps_regnum + || regno == tdep->ppc_cr_regnum || regno == tdep->ppc_lr_regnum + || regno == tdep->ppc_ctr_regnum || regno == tdep->ppc_xer_regnum + || (tdep->ppc_fpscr_regnum >= 0 && regno == tdep->ppc_fpscr_regnum) + || (tdep->ppc_mq_regnum >= 0 && regno == tdep->ppc_mq_regnum); } - /* Record that the special registers contain the specified 64-bit and 32-bit values. */ static void -supply_sprs64 (struct regcache *regcache, - uint64_t iar, uint64_t msr, uint32_t cr, - uint64_t lr, uint64_t ctr, uint32_t xer, +supply_sprs64 (struct regcache *regcache, uint64_t iar, uint64_t msr, + uint32_t cr, uint64_t lr, uint64_t ctr, uint32_t xer, uint32_t fpscr) { struct gdbarch *gdbarch = regcache->arch (); @@ -1197,9 +1199,8 @@ supply_sprs64 (struct regcache *regcache, values. */ static void -supply_sprs32 (struct regcache *regcache, - uint32_t iar, uint32_t msr, uint32_t cr, - uint32_t lr, uint32_t ctr, uint32_t xer, +supply_sprs32 (struct regcache *regcache, uint32_t iar, uint32_t msr, + uint32_t cr, uint32_t lr, uint32_t ctr, uint32_t xer, uint32_t fpscr) { struct gdbarch *gdbarch = regcache->arch (); @@ -1231,12 +1232,12 @@ fetch_regs_user_thread (struct regcache *regcache, pthdb_pthread_t pdtid) pthdb_context_t ctx; if (debug_aix_thread) - gdb_printf (gdb_stdlog, - "fetch_regs_user_thread %lx\n", (long) pdtid); + gdb_printf (gdb_stdlog, "fetch_regs_user_thread %lx\n", (long) pdtid); status = pthdb_pthread_context (pd_session, pdtid, &ctx); if (status != PTHDB_SUCCESS) - error (_("aix-thread: fetch_registers: pthdb_pthread_context returned %s"), - pd_status2str (status)); + error ( + _ ("aix-thread: fetch_registers: pthdb_pthread_context returned %s"), + pd_status2str (status)); /* General-purpose registers. */ @@ -1255,10 +1256,10 @@ fetch_regs_user_thread (struct regcache *regcache, pthdb_pthread_t pdtid) if (arch64) supply_sprs64 (regcache, ctx.iar, ctx.msr, ctx.cr, ctx.lr, ctx.ctr, - ctx.xer, ctx.fpscr); + ctx.xer, ctx.fpscr); else supply_sprs32 (regcache, ctx.iar, ctx.msr, ctx.cr, ctx.lr, ctx.ctr, - ctx.xer, ctx.fpscr); + ctx.xer, ctx.fpscr); } /* Fetch register REGNO if != -1 or all registers otherwise from @@ -1301,8 +1302,8 @@ fetch_regs_kernel_thread (struct regcache *regcache, int regno, { if (arch64) { - if (!ptrace64aix (PTT_READ_GPRS, tid, - (unsigned long) gprs64, 0, NULL)) + if (!ptrace64aix (PTT_READ_GPRS, tid, (unsigned long) gprs64, 0, + NULL)) memset (gprs64, 0, sizeof (gprs64)); supply_gprs64 (regcache, gprs64); } @@ -1333,12 +1334,12 @@ fetch_regs_kernel_thread (struct regcache *regcache, int regno, { if (arch64) { - if (!ptrace64aix (PTT_READ_SPRS, tid, - (unsigned long) &sprs64, 0, NULL)) + if (!ptrace64aix (PTT_READ_SPRS, tid, (unsigned long) &sprs64, 0, + NULL)) memset (&sprs64, 0, sizeof (sprs64)); - supply_sprs64 (regcache, sprs64.pt_iar, sprs64.pt_msr, - sprs64.pt_cr, sprs64.pt_lr, sprs64.pt_ctr, - sprs64.pt_xer, sprs64.pt_fpscr); + supply_sprs64 (regcache, sprs64.pt_iar, sprs64.pt_msr, sprs64.pt_cr, + sprs64.pt_lr, sprs64.pt_ctr, sprs64.pt_xer, + sprs64.pt_fpscr); } else { @@ -1383,26 +1384,24 @@ aix_thread_target::fetch_registers (struct regcache *regcache, int regno) static void fill_gprs64 (const struct regcache *regcache, uint64_t *vals) { - ppc_gdbarch_tdep *tdep - = gdbarch_tdep (regcache->arch ()); + ppc_gdbarch_tdep *tdep = gdbarch_tdep (regcache->arch ()); int regno; for (regno = 0; regno < ppc_num_gprs; regno++) - if (REG_VALID == regcache->get_register_status - (tdep->ppc_gp0_regnum + regno)) + if (REG_VALID + == regcache->get_register_status (tdep->ppc_gp0_regnum + regno)) regcache->raw_collect (tdep->ppc_gp0_regnum + regno, vals + regno); } -static void +static void fill_gprs32 (const struct regcache *regcache, uint32_t *vals) { - ppc_gdbarch_tdep *tdep - = gdbarch_tdep (regcache->arch ()); + ppc_gdbarch_tdep *tdep = gdbarch_tdep (regcache->arch ()); int regno; for (regno = 0; regno < ppc_num_gprs; regno++) - if (REG_VALID == regcache->get_register_status - (tdep->ppc_gp0_regnum + regno)) + if (REG_VALID + == regcache->get_register_status (tdep->ppc_gp0_regnum + regno)) regcache->raw_collect (tdep->ppc_gp0_regnum + regno, vals + regno); } @@ -1419,8 +1418,7 @@ fill_fprs (const struct regcache *regcache, double *vals) gdb_assert (ppc_floating_point_unit_p (gdbarch)); for (regno = tdep->ppc_fp0_regnum; - regno < tdep->ppc_fp0_regnum + ppc_num_fprs; - regno++) + regno < tdep->ppc_fp0_regnum + ppc_num_fprs; regno++) if (REG_VALID == regcache->get_register_status (regno)) regcache->raw_collect (regno, vals + regno - tdep->ppc_fp0_regnum); } @@ -1429,9 +1427,8 @@ fill_fprs (const struct regcache *regcache, double *vals) locations. */ static void -fill_sprs64 (const struct regcache *regcache, - uint64_t *iar, uint64_t *msr, uint32_t *cr, - uint64_t *lr, uint64_t *ctr, uint32_t *xer, +fill_sprs64 (const struct regcache *regcache, uint64_t *iar, uint64_t *msr, + uint32_t *cr, uint64_t *lr, uint64_t *ctr, uint32_t *xer, uint32_t *fpscr) { struct gdbarch *gdbarch = regcache->arch (); @@ -1442,8 +1439,8 @@ fill_sprs64 (const struct regcache *regcache, they're not, then either GDB has been built incorrectly, or there's some other kind of internal error. To be really safe, we should check all of the sizes. */ - gdb_assert (sizeof (*iar) == register_size - (gdbarch, gdbarch_pc_regnum (gdbarch))); + gdb_assert (sizeof (*iar) + == register_size (gdbarch, gdbarch_pc_regnum (gdbarch))); if (REG_VALID == regcache->get_register_status (gdbarch_pc_regnum (gdbarch))) regcache->raw_collect (gdbarch_pc_regnum (gdbarch), iar); @@ -1463,9 +1460,8 @@ fill_sprs64 (const struct regcache *regcache, } static void -fill_sprs32 (const struct regcache *regcache, - uint32_t *iar, uint32_t *msr, uint32_t *cr, - uint32_t *lr, uint32_t *ctr, uint32_t *xer, +fill_sprs32 (const struct regcache *regcache, uint32_t *iar, uint32_t *msr, + uint32_t *cr, uint32_t *lr, uint32_t *ctr, uint32_t *xer, uint32_t *fpscr) { struct gdbarch *gdbarch = regcache->arch (); @@ -1476,8 +1472,8 @@ fill_sprs32 (const struct regcache *regcache, they're not, then either GDB has been built incorrectly, or there's some other kind of internal error. To be really safe, we should check all of the sizes. */ - gdb_assert (sizeof (*iar) == register_size (gdbarch, - gdbarch_pc_regnum (gdbarch))); + gdb_assert (sizeof (*iar) + == register_size (gdbarch, gdbarch_pc_regnum (gdbarch))); if (REG_VALID == regcache->get_register_status (gdbarch_pc_regnum (gdbarch))) regcache->raw_collect (gdbarch_pc_regnum (gdbarch), iar); @@ -1513,15 +1509,15 @@ store_regs_user_thread (const struct regcache *regcache, pthdb_pthread_t pdtid) uint64_t int64; if (debug_aix_thread) - gdb_printf (gdb_stdlog, - "store_regs_user_thread %lx\n", (long) pdtid); + gdb_printf (gdb_stdlog, "store_regs_user_thread %lx\n", (long) pdtid); /* Retrieve the thread's current context for its non-register values. */ status = pthdb_pthread_context (pd_session, pdtid, &ctx); if (status != PTHDB_SUCCESS) - error (_("aix-thread: store_registers: pthdb_pthread_context returned %s"), - pd_status2str (status)); + error ( + _ ("aix-thread: store_registers: pthdb_pthread_context returned %s"), + pd_status2str (status)); /* Collect general-purpose register values from the regcache. */ @@ -1548,26 +1544,25 @@ store_regs_user_thread (const struct regcache *regcache, pthdb_pthread_t pdtid) if (arch64) { fill_sprs64 (regcache, &ctx.iar, &ctx.msr, &ctx.cr, &ctx.lr, &ctx.ctr, - &ctx.xer, &ctx.fpscr); + &ctx.xer, &ctx.fpscr); } else { /* Problem: ctx.iar etc. are 64 bits, but raw_registers are 32. Solution: use 32-bit temp variables. */ - uint32_t tmp_iar, tmp_msr, tmp_cr, tmp_lr, tmp_ctr, tmp_xer, - tmp_fpscr; + uint32_t tmp_iar, tmp_msr, tmp_cr, tmp_lr, tmp_ctr, tmp_xer, tmp_fpscr; fill_sprs32 (regcache, &tmp_iar, &tmp_msr, &tmp_cr, &tmp_lr, &tmp_ctr, - &tmp_xer, &tmp_fpscr); - if (REG_VALID == regcache->get_register_status - (gdbarch_pc_regnum (gdbarch))) + &tmp_xer, &tmp_fpscr); + if (REG_VALID + == regcache->get_register_status (gdbarch_pc_regnum (gdbarch))) ctx.iar = tmp_iar; if (REG_VALID == regcache->get_register_status (tdep->ppc_ps_regnum)) ctx.msr = tmp_msr; if (REG_VALID == regcache->get_register_status (tdep->ppc_cr_regnum)) - ctx.cr = tmp_cr; + ctx.cr = tmp_cr; if (REG_VALID == regcache->get_register_status (tdep->ppc_lr_regnum)) - ctx.lr = tmp_lr; + ctx.lr = tmp_lr; if (REG_VALID == regcache->get_register_status (tdep->ppc_ctr_regnum)) ctx.ctr = tmp_ctr; if (REG_VALID == regcache->get_register_status (tdep->ppc_xer_regnum)) @@ -1578,8 +1573,8 @@ store_regs_user_thread (const struct regcache *regcache, pthdb_pthread_t pdtid) status = pthdb_pthread_setcontext (pd_session, pdtid, &ctx); if (status != PTHDB_SUCCESS) - error (_("aix-thread: store_registers: " - "pthdb_pthread_setcontext returned %s"), + error (_ ("aix-thread: store_registers: " + "pthdb_pthread_setcontext returned %s"), pd_status2str (status)); } @@ -1601,11 +1596,10 @@ store_regs_kernel_thread (const struct regcache *regcache, int regno, uint32_t gprs32[ppc_num_gprs]; double fprs[ppc_num_fprs]; struct ptxsprs sprs64; - struct ptsprs sprs32; + struct ptsprs sprs32; if (debug_aix_thread) - gdb_printf (gdb_stdlog, - "store_regs_kernel_thread tid=%lx regno=%d\n", + gdb_printf (gdb_stdlog, "store_regs_kernel_thread tid=%lx regno=%d\n", (long) tid, regno); /* General-purpose registers. */ @@ -1649,13 +1643,11 @@ store_regs_kernel_thread (const struct regcache *regcache, int regno, if (arch64) { /* Pre-fetch: some registers won't be in the cache. */ - ptrace64aix (PTT_READ_SPRS, tid, - (unsigned long) &sprs64, 0, NULL); - fill_sprs64 (regcache, &sprs64.pt_iar, &sprs64.pt_msr, - &sprs64.pt_cr, &sprs64.pt_lr, &sprs64.pt_ctr, - &sprs64.pt_xer, &sprs64.pt_fpscr); - ptrace64aix (PTT_WRITE_SPRS, tid, - (unsigned long) &sprs64, 0, NULL); + ptrace64aix (PTT_READ_SPRS, tid, (unsigned long) &sprs64, 0, NULL); + fill_sprs64 (regcache, &sprs64.pt_iar, &sprs64.pt_msr, &sprs64.pt_cr, + &sprs64.pt_lr, &sprs64.pt_ctr, &sprs64.pt_xer, + &sprs64.pt_fpscr); + ptrace64aix (PTT_WRITE_SPRS, tid, (unsigned long) &sprs64, 0, NULL); } else { @@ -1666,7 +1658,7 @@ store_regs_kernel_thread (const struct regcache *regcache, int regno, use "unsigned long", and the size of that type is not what the headers expect. */ uint32_t tmp_iar, tmp_msr, tmp_cr, tmp_lr, tmp_ctr, tmp_xer, - tmp_fpscr; + tmp_fpscr; gdb_assert (sizeof (sprs32.pt_iar) == 4); @@ -1685,8 +1677,8 @@ store_regs_kernel_thread (const struct regcache *regcache, int regno, sprs32.pt_fpscr = tmp_fpscr; if (tdep->ppc_mq_regnum >= 0) - if (REG_VALID == regcache->get_register_status - (tdep->ppc_mq_regnum)) + if (REG_VALID + == regcache->get_register_status (tdep->ppc_mq_regnum)) regcache->raw_collect (tdep->ppc_mq_regnum, &sprs32.pt_mq); ptrace32 (PTT_WRITE_SPRS, tid, (uintptr_t) &sprs32, 0, NULL); @@ -1721,17 +1713,16 @@ aix_thread_target::store_registers (struct regcache *regcache, int regno) /* Implement the to_xfer_partial target_ops method. */ enum target_xfer_status -aix_thread_target::xfer_partial (enum target_object object, - const char *annex, gdb_byte *readbuf, - const gdb_byte *writebuf, +aix_thread_target::xfer_partial (enum target_object object, const char *annex, + gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len, ULONGEST *xfered_len) { scoped_restore save_inferior_ptid = make_scoped_restore (&inferior_ptid); inferior_ptid = ptid_t (inferior_ptid.pid ()); - return beneath ()->xfer_partial (object, annex, readbuf, - writebuf, offset, len, xfered_len); + return beneath ()->xfer_partial (object, annex, readbuf, writebuf, offset, + len, xfered_len); } /* Clean up after the inferior exits. */ @@ -1755,8 +1746,7 @@ aix_thread_target::thread_alive (ptid_t ptid) /* We update the thread list every time the child stops, so all valid threads should be in the thread list. */ - process_stratum_target *proc_target - = current_inferior ()->process_target (); + process_stratum_target *proc_target = current_inferior ()->process_target (); return in_thread_list (proc_target, ptid); } @@ -1769,7 +1759,7 @@ aix_thread_target::pid_to_str (ptid_t ptid) if (!PD_TID (ptid)) return beneath ()->pid_to_str (ptid); - return string_printf (_("Thread %s"), pulongest (ptid.tid ())); + return string_printf (_ ("Thread %s"), pulongest (ptid.tid ())); } /* Return a printable representation of extra information about @@ -1798,33 +1788,31 @@ aix_thread_target::extra_thread_info (struct thread_info *thread) if (tid != PTHDB_INVALID_TID) /* i18n: Like "thread-identifier %d, [state] running, suspended" */ - buf.printf (_("tid %d"), (int)tid); + buf.printf (_ ("tid %d"), (int) tid); status = pthdb_pthread_state (pd_session, pdtid, &state); if (status != PTHDB_SUCCESS) state = PST_NOTSUP; buf.printf (", %s", state2str (state)); - status = pthdb_pthread_suspendstate (pd_session, pdtid, - &suspendstate); + status = pthdb_pthread_suspendstate (pd_session, pdtid, &suspendstate); if (status == PTHDB_SUCCESS && suspendstate == PSS_SUSPENDED) /* i18n: Like "Thread-Id %d, [state] running, suspended" */ - buf.printf (_(", suspended")); + buf.printf (_ (", suspended")); - status = pthdb_pthread_detachstate (pd_session, pdtid, - &detachstate); + status = pthdb_pthread_detachstate (pd_session, pdtid, &detachstate); if (status == PTHDB_SUCCESS && detachstate == PDS_DETACHED) /* i18n: Like "Thread-Id %d, [state] running, detached" */ - buf.printf (_(", detached")); + buf.printf (_ (", detached")); pthdb_pthread_cancelpend (pd_session, pdtid, &cancelpend); if (status == PTHDB_SUCCESS && cancelpend) /* i18n: Like "Thread-Id %d, [state] running, cancel pending" */ - buf.printf (_(", cancel pending")); + buf.printf (_ (", cancel pending")); buf.write ("", 1); - xfree (ret); /* Free old buffer. */ + xfree (ret); /* Free old buffer. */ ret = xstrdup (buf.c_str ()); @@ -1837,11 +1825,11 @@ aix_thread_target::get_ada_task_ptid (long lwp, ULONGEST thread) return ptid_t (inferior_ptid.pid (), 0, thread); } - /* Module startup initialization function, automagically called by init.c. */ void _initialize_aix_thread (); + void _initialize_aix_thread () { @@ -1854,9 +1842,9 @@ _initialize_aix_thread () "aix-thread"); add_setshow_boolean_cmd ("aix-thread", class_maintenance, &debug_aix_thread, - _("Set debugging of AIX thread module."), - _("Show debugging of AIX thread module."), - _("Enables debugging output (used to debug GDB)."), + _ ("Set debugging of AIX thread module."), + _ ("Show debugging of AIX thread module."), + _ ("Enables debugging output (used to debug GDB)."), NULL, NULL, /* FIXME: i18n: Debugging of AIX thread module is \"%d\". */ diff --git a/gdb/alloc.c b/gdb/alloc.c index 82be0a6..2d09cfc 100644 --- a/gdb/alloc.c +++ b/gdb/alloc.c @@ -54,7 +54,7 @@ xmalloc (size_t size) if (size == 0) size = 1; - val = malloc (size); /* ARI: malloc */ + val = malloc (size); /* ARI: malloc */ if (val == NULL) malloc_failure (size); @@ -72,9 +72,9 @@ xrealloc (void *ptr, size_t size) size = 1; if (ptr != NULL) - val = realloc (ptr, size); /* ARI: realloc */ + val = realloc (ptr, size); /* ARI: realloc */ else - val = malloc (size); /* ARI: malloc */ + val = malloc (size); /* ARI: malloc */ if (val == NULL) malloc_failure (size); @@ -94,7 +94,7 @@ xcalloc (size_t number, size_t size) size = 1; } - mem = calloc (number, size); /* ARI: xcalloc */ + mem = calloc (number, size); /* ARI: xcalloc */ if (mem == NULL) malloc_failure (number * size); diff --git a/gdb/alpha-bsd-nat.c b/gdb/alpha-bsd-nat.c index 683fac3..ed75b76 100644 --- a/gdb/alpha-bsd-nat.c +++ b/gdb/alpha-bsd-nat.c @@ -62,22 +62,23 @@ alpha_bsd_nat_target::fetch_registers (struct regcache *regcache, int regno) struct reg gregs; if (ptrace (PT_GETREGS, regcache->ptid ().pid (), - (PTRACE_TYPE_ARG3) &gregs, lwp) == -1) - perror_with_name (_("Couldn't get registers")); + (PTRACE_TYPE_ARG3) &gregs, lwp) + == -1) + perror_with_name (_ ("Couldn't get registers")); alphabsd_supply_reg (regcache, (char *) &gregs, regno); if (regno != -1) return; } - if (regno == -1 - || regno >= gdbarch_fp0_regnum (regcache->arch ())) + if (regno == -1 || regno >= gdbarch_fp0_regnum (regcache->arch ())) { struct fpreg fpregs; if (ptrace (PT_GETFPREGS, regcache->ptid ().pid (), - (PTRACE_TYPE_ARG3) &fpregs, lwp) == -1) - perror_with_name (_("Couldn't get floating point status")); + (PTRACE_TYPE_ARG3) &fpregs, lwp) + == -1) + perror_with_name (_ ("Couldn't get floating point status")); alphabsd_supply_fpreg (regcache, (char *) &fpregs, regno); } @@ -95,36 +96,38 @@ alpha_bsd_nat_target::store_registers (struct regcache *regcache, int regno) { struct reg gregs; if (ptrace (PT_GETREGS, regcache->ptid ().pid (), - (PTRACE_TYPE_ARG3) &gregs, lwp) == -1) - perror_with_name (_("Couldn't get registers")); + (PTRACE_TYPE_ARG3) &gregs, lwp) + == -1) + perror_with_name (_ ("Couldn't get registers")); alphabsd_fill_reg (regcache, (char *) &gregs, regno); if (ptrace (PT_SETREGS, regcache->ptid ().pid (), - (PTRACE_TYPE_ARG3) &gregs, lwp) == -1) - perror_with_name (_("Couldn't write registers")); + (PTRACE_TYPE_ARG3) &gregs, lwp) + == -1) + perror_with_name (_ ("Couldn't write registers")); if (regno != -1) return; } - if (regno == -1 - || regno >= gdbarch_fp0_regnum (regcache->arch ())) + if (regno == -1 || regno >= gdbarch_fp0_regnum (regcache->arch ())) { struct fpreg fpregs; if (ptrace (PT_GETFPREGS, regcache->ptid ().pid (), - (PTRACE_TYPE_ARG3) &fpregs, lwp) == -1) - perror_with_name (_("Couldn't get floating point status")); + (PTRACE_TYPE_ARG3) &fpregs, lwp) + == -1) + perror_with_name (_ ("Couldn't get floating point status")); alphabsd_fill_fpreg (regcache, (char *) &fpregs, regno); if (ptrace (PT_SETFPREGS, regcache->ptid ().pid (), - (PTRACE_TYPE_ARG3) &fpregs, lwp) == -1) - perror_with_name (_("Couldn't write floating point status")); + (PTRACE_TYPE_ARG3) &fpregs, lwp) + == -1) + perror_with_name (_ ("Couldn't write floating point status")); } } - /* Support for debugging kernel virtual memory images. */ @@ -155,9 +158,9 @@ alphabsd_supply_pcb (struct regcache *regcache, struct pcb *pcb) return 1; } - void _initialize_alphabsd_nat (); + void _initialize_alphabsd_nat () { diff --git a/gdb/alpha-bsd-tdep.c b/gdb/alpha-bsd-tdep.c index 58b3fe8..5ceeb57 100644 --- a/gdb/alpha-bsd-tdep.c +++ b/gdb/alpha-bsd-tdep.c @@ -41,8 +41,8 @@ alphabsd_fill_reg (const struct regcache *regcache, char *regs, int regno) } void -alphabsd_supply_fpreg (struct regcache *regcache, - const char *fpregs, int regno) +alphabsd_supply_fpreg (struct regcache *regcache, const char *fpregs, + int regno) { /* FPCR is at slot 33; slot 32 unused. */ alpha_supply_fp_regs (regcache, regno, fpregs, fpregs + 32 * 8); diff --git a/gdb/alpha-bsd-tdep.h b/gdb/alpha-bsd-tdep.h index 973aab7..b5871e99 100644 --- a/gdb/alpha-bsd-tdep.h +++ b/gdb/alpha-bsd-tdep.h @@ -29,14 +29,12 @@ void alphabsd_fill_reg (const struct regcache *, char *, int); void alphabsd_supply_fpreg (struct regcache *, const char *, int); void alphabsd_fill_fpreg (const struct regcache *, char *, int); - /* Functions exported from alpha-netbsd-tdep.c. */ /* Iterate over supported core file register note sections. */ -void alphanbsd_iterate_over_regset_sections (struct gdbarch *gdbarch, - iterate_over_regset_sections_cb *cb, - void *cb_data, - const struct regcache *regcache); +void alphanbsd_iterate_over_regset_sections ( + struct gdbarch *gdbarch, iterate_over_regset_sections_cb *cb, void *cb_data, + const struct regcache *regcache); #endif /* alpha-bsd-tdep.h */ diff --git a/gdb/alpha-linux-nat.c b/gdb/alpha-linux-nat.c index 29f27bc..bc4c6b6 100644 --- a/gdb/alpha-linux-nat.c +++ b/gdb/alpha-linux-nat.c @@ -36,9 +36,10 @@ class alpha_linux_nat_target final : public linux_nat_trad_target { protected: + /* Override linux_nat_trad_target methods. */ - CORE_ADDR register_u_offset (struct gdbarch *gdbarch, - int regno, int store_p) override; + CORE_ADDR register_u_offset (struct gdbarch *gdbarch, int regno, + int store_p) override; }; static alpha_linux_nat_target the_alpha_linux_nat_target; @@ -49,17 +50,17 @@ static alpha_linux_nat_target the_alpha_linux_nat_target; void supply_gregset (struct regcache *regcache, const gdb_gregset_t *gregsetp) { - const long *regp = (const long *)gregsetp; + const long *regp = (const long *) gregsetp; /* PC is in slot 32, UNIQUE is in slot 33. */ alpha_supply_int_regs (regcache, -1, regp, regp + 31, regp + 32); } void -fill_gregset (const struct regcache *regcache, - gdb_gregset_t *gregsetp, int regno) +fill_gregset (const struct regcache *regcache, gdb_gregset_t *gregsetp, + int regno) { - long *regp = (long *)gregsetp; + long *regp = (long *) gregsetp; /* PC is in slot 32, UNIQUE is in slot 33. */ alpha_fill_int_regs (regcache, regno, regp, regp + 31, regp + 32); @@ -71,25 +72,25 @@ fill_gregset (const struct regcache *regcache, void supply_fpregset (struct regcache *regcache, const gdb_fpregset_t *fpregsetp) { - const long *regp = (const long *)fpregsetp; + const long *regp = (const long *) fpregsetp; /* FPCR is in slot 32. */ alpha_supply_fp_regs (regcache, -1, regp, regp + 31); } void -fill_fpregset (const struct regcache *regcache, - gdb_fpregset_t *fpregsetp, int regno) +fill_fpregset (const struct regcache *regcache, gdb_fpregset_t *fpregsetp, + int regno) { - long *regp = (long *)fpregsetp; + long *regp = (long *) fpregsetp; /* FPCR is in slot 32. */ alpha_fill_fp_regs (regcache, regno, regp, regp + 31); } CORE_ADDR -alpha_linux_nat_target::register_u_offset (struct gdbarch *gdbarch, - int regno, int store_p) +alpha_linux_nat_target::register_u_offset (struct gdbarch *gdbarch, int regno, + int store_p) { if (regno == gdbarch_pc_regnum (gdbarch)) return PC; @@ -102,6 +103,7 @@ alpha_linux_nat_target::register_u_offset (struct gdbarch *gdbarch, } void _initialize_alpha_linux_nat (); + void _initialize_alpha_linux_nat () { diff --git a/gdb/alpha-linux-tdep.c b/gdb/alpha-linux-tdep.c index 33b40da..3980d36 100644 --- a/gdb/alpha-linux-tdep.c +++ b/gdb/alpha-linux-tdep.c @@ -35,26 +35,26 @@ from the Linux kernel tree. */ enum - { - /* SIGABRT is the same as in the generic implementation, but is +{ + /* SIGABRT is the same as in the generic implementation, but is defined here because SIGIOT depends on it. */ - ALPHA_LINUX_SIGABRT = 6, - ALPHA_LINUX_SIGEMT = 7, - ALPHA_LINUX_SIGBUS = 10, - ALPHA_LINUX_SIGSYS = 12, - ALPHA_LINUX_SIGURG = 16, - ALPHA_LINUX_SIGSTOP = 17, - ALPHA_LINUX_SIGTSTP = 18, - ALPHA_LINUX_SIGCONT = 19, - ALPHA_LINUX_SIGCHLD = 20, - ALPHA_LINUX_SIGIO = 23, - ALPHA_LINUX_SIGINFO = 29, - ALPHA_LINUX_SIGUSR1 = 30, - ALPHA_LINUX_SIGUSR2 = 31, - ALPHA_LINUX_SIGPOLL = ALPHA_LINUX_SIGIO, - ALPHA_LINUX_SIGPWR = ALPHA_LINUX_SIGINFO, - ALPHA_LINUX_SIGIOT = ALPHA_LINUX_SIGABRT, - }; + ALPHA_LINUX_SIGABRT = 6, + ALPHA_LINUX_SIGEMT = 7, + ALPHA_LINUX_SIGBUS = 10, + ALPHA_LINUX_SIGSYS = 12, + ALPHA_LINUX_SIGURG = 16, + ALPHA_LINUX_SIGSTOP = 17, + ALPHA_LINUX_SIGTSTP = 18, + ALPHA_LINUX_SIGCONT = 19, + ALPHA_LINUX_SIGCHLD = 20, + ALPHA_LINUX_SIGIO = 23, + ALPHA_LINUX_SIGINFO = 29, + ALPHA_LINUX_SIGUSR1 = 30, + ALPHA_LINUX_SIGUSR2 = 31, + ALPHA_LINUX_SIGPOLL = ALPHA_LINUX_SIGIO, + ALPHA_LINUX_SIGPWR = ALPHA_LINUX_SIGINFO, + ALPHA_LINUX_SIGIOT = ALPHA_LINUX_SIGABRT, +}; /* Under GNU/Linux, signal handler invocations can be identified by the designated code sequence that is used to return from a signal @@ -75,16 +75,16 @@ alpha_linux_sigtramp_offset_1 (struct gdbarch *gdbarch, CORE_ADDR pc) { switch (alpha_read_insn (gdbarch, pc)) { - case 0x47de0410: /* bis $30,$30,$16 */ - case 0x47fe0410: /* bis $31,$30,$16 */ + case 0x47de0410: /* bis $30,$30,$16 */ + case 0x47fe0410: /* bis $31,$30,$16 */ return 0; - case 0x43ecf400: /* addq $31,103,$0 */ - case 0x201f0067: /* lda $0,103($31) */ - case 0x201f015f: /* lda $0,351($31) */ + case 0x43ecf400: /* addq $31,103,$0 */ + case 0x201f0067: /* lda $0,103($31) */ + case 0x201f015f: /* lda $0,351($31) */ return 4; - case 0x00000083: /* call_pal callsys */ + case 0x00000083: /* call_pal callsys */ return 8; default: @@ -119,8 +119,8 @@ alpha_linux_sigtramp_offset (struct gdbarch *gdbarch, CORE_ADDR pc) } static int -alpha_linux_pc_in_sigtramp (struct gdbarch *gdbarch, - CORE_ADDR pc, const char *func_name) +alpha_linux_pc_in_sigtramp (struct gdbarch *gdbarch, CORE_ADDR pc, + const char *func_name) { return alpha_linux_sigtramp_offset (gdbarch, pc) >= 0; } @@ -161,8 +161,8 @@ alpha_linux_sigcontext_addr (frame_info_ptr this_frame) static void alpha_linux_supply_gregset (const struct regset *regset, - struct regcache *regcache, - int regnum, const void *gregs, size_t len) + struct regcache *regcache, int regnum, + const void *gregs, size_t len) { const gdb_byte *regs = (const gdb_byte *) gregs; @@ -178,8 +178,8 @@ alpha_linux_supply_gregset (const struct regset *regset, static void alpha_linux_collect_gregset (const struct regset *regset, - const struct regcache *regcache, - int regnum, void *gregs, size_t len) + const struct regcache *regcache, int regnum, + void *gregs, size_t len) { gdb_byte *regs = (gdb_byte *) gregs; @@ -194,8 +194,8 @@ alpha_linux_collect_gregset (const struct regset *regset, static void alpha_linux_supply_fpregset (const struct regset *regset, - struct regcache *regcache, - int regnum, const void *fpregs, size_t len) + struct regcache *regcache, int regnum, + const void *fpregs, size_t len) { const gdb_byte *regs = (const gdb_byte *) fpregs; @@ -210,8 +210,8 @@ alpha_linux_supply_fpregset (const struct regset *regset, static void alpha_linux_collect_fpregset (const struct regset *regset, - const struct regcache *regcache, - int regnum, void *fpregs, size_t len) + const struct regcache *regcache, int regnum, + void *fpregs, size_t len) { gdb_byte *regs = (gdb_byte *) fpregs; @@ -219,17 +219,11 @@ alpha_linux_collect_fpregset (const struct regset *regset, alpha_fill_fp_regs (regcache, regnum, regs, regs + 31 * 8); } -static const struct regset alpha_linux_gregset = -{ - NULL, - alpha_linux_supply_gregset, alpha_linux_collect_gregset -}; +static const struct regset alpha_linux_gregset + = { NULL, alpha_linux_supply_gregset, alpha_linux_collect_gregset }; -static const struct regset alpha_linux_fpregset = -{ - NULL, - alpha_linux_supply_fpregset, alpha_linux_collect_fpregset -}; +static const struct regset alpha_linux_fpregset + = { NULL, alpha_linux_supply_fpregset, alpha_linux_collect_fpregset }; /* Iterate over core file register note sections. */ @@ -247,8 +241,7 @@ alpha_linux_iterate_over_regset_sections (struct gdbarch *gdbarch, gdbarch.h. */ static enum gdb_signal -alpha_linux_gdb_signal_from_target (struct gdbarch *gdbarch, - int signal) +alpha_linux_gdb_signal_from_target (struct gdbarch *gdbarch, int signal) { switch (signal) { @@ -371,23 +364,23 @@ alpha_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target); - set_solib_svr4_fetch_link_map_offsets - (gdbarch, linux_lp64_fetch_link_map_offsets); + set_solib_svr4_fetch_link_map_offsets (gdbarch, + linux_lp64_fetch_link_map_offsets); /* Enable TLS support. */ set_gdbarch_fetch_tls_load_module_address (gdbarch, svr4_fetch_objfile_link_map); - set_gdbarch_iterate_over_regset_sections - (gdbarch, alpha_linux_iterate_over_regset_sections); + set_gdbarch_iterate_over_regset_sections ( + gdbarch, alpha_linux_iterate_over_regset_sections); set_gdbarch_gdb_signal_from_target (gdbarch, alpha_linux_gdb_signal_from_target); - set_gdbarch_gdb_signal_to_target (gdbarch, - alpha_linux_gdb_signal_to_target); + set_gdbarch_gdb_signal_to_target (gdbarch, alpha_linux_gdb_signal_to_target); } void _initialize_alpha_linux_tdep (); + void _initialize_alpha_linux_tdep () { diff --git a/gdb/alpha-mdebug-tdep.c b/gdb/alpha-mdebug-tdep.c index 7050a7d..d1f6e72 100644 --- a/gdb/alpha-mdebug-tdep.c +++ b/gdb/alpha-mdebug-tdep.c @@ -85,7 +85,7 @@ #define PROC_FREG_OFFSET(proc) ((proc)->pdr.fregoffset) #define PROC_PC_REG(proc) ((proc)->pdr.pcreg) #define PROC_LOCALOFF(proc) ((proc)->pdr.localoff) - + /* Locate the mdebug PDR for the given PC. Return null if one can't be found; you'll have to fall back to other methods in that case. */ @@ -108,8 +108,8 @@ find_proc_desc (CORE_ADDR pc) symbol reading. */ sym = NULL; else - sym = lookup_symbol (MDEBUG_EFI_SYMBOL_NAME, b, LABEL_DOMAIN, - 0).symbol; + sym + = lookup_symbol (MDEBUG_EFI_SYMBOL_NAME, b, LABEL_DOMAIN, 0).symbol; } if (sym) @@ -118,8 +118,7 @@ find_proc_desc (CORE_ADDR pc) /* Correct incorrect setjmp procedure descriptor from the library to make backtrace through setjmp work. */ - if (proc_desc->pdr.pcreg == 0 - && strcmp (sh_name, "setjmp") == 0) + if (proc_desc->pdr.pcreg == 0 && strcmp (sh_name, "setjmp") == 0) { proc_desc->pdr.pcreg = ALPHA_RA_REGNUM; proc_desc->pdr.regmask = 0x80000000; @@ -173,7 +172,6 @@ alpha_mdebug_in_prologue (CORE_ADDR pc, return (after_prologue_pc == 0 || pc < after_prologue_pc); } - /* Frame unwinder that reads mdebug PDRs. */ struct alpha_mdebug_unwind_cache @@ -187,7 +185,7 @@ struct alpha_mdebug_unwind_cache and store the resulting register save locations in the structure. */ static struct alpha_mdebug_unwind_cache * -alpha_mdebug_frame_unwind_cache (frame_info_ptr this_frame, +alpha_mdebug_frame_unwind_cache (frame_info_ptr this_frame, void **this_prologue_cache) { struct alpha_mdebug_unwind_cache *info; @@ -288,7 +286,7 @@ alpha_mdebug_frame_prev_register (frame_info_ptr this_frame, the correct place. */ if (regnum == ALPHA_PC_REGNUM) regnum = PROC_PC_REG (info->proc_desc); - + return trad_frame_get_prev_register (this_frame, info->saved_regs, regnum); } @@ -308,8 +306,7 @@ alpha_mdebug_max_frame_size_exceeded (struct mdebug_extra_func_info *proc_desc) static int alpha_mdebug_frame_sniffer (const struct frame_unwind *self, - frame_info_ptr this_frame, - void **this_cache) + frame_info_ptr this_frame, void **this_cache) { CORE_ADDR pc = get_frame_address_in_block (this_frame); struct mdebug_extra_func_info *proc_desc; @@ -333,16 +330,14 @@ alpha_mdebug_frame_sniffer (const struct frame_unwind *self, return 1; } -static const struct frame_unwind alpha_mdebug_frame_unwind = -{ - "alpha mdebug", - NORMAL_FRAME, - default_frame_unwind_stop_reason, - alpha_mdebug_frame_this_id, - alpha_mdebug_frame_prev_register, - NULL, - alpha_mdebug_frame_sniffer -}; +static const struct frame_unwind alpha_mdebug_frame_unwind + = { "alpha mdebug", + NORMAL_FRAME, + default_frame_unwind_stop_reason, + alpha_mdebug_frame_this_id, + alpha_mdebug_frame_prev_register, + NULL, + alpha_mdebug_frame_sniffer }; static CORE_ADDR alpha_mdebug_frame_base_address (frame_info_ptr this_frame, @@ -374,12 +369,9 @@ alpha_mdebug_frame_args_address (frame_info_ptr this_frame, return info->vfp - ALPHA_NUM_ARG_REGS * 8; } -static const struct frame_base alpha_mdebug_frame_base = { - &alpha_mdebug_frame_unwind, - alpha_mdebug_frame_base_address, - alpha_mdebug_frame_locals_address, - alpha_mdebug_frame_args_address -}; +static const struct frame_base alpha_mdebug_frame_base + = { &alpha_mdebug_frame_unwind, alpha_mdebug_frame_base_address, + alpha_mdebug_frame_locals_address, alpha_mdebug_frame_args_address }; static const struct frame_base * alpha_mdebug_frame_base_sniffer (frame_info_ptr this_frame) @@ -401,7 +393,6 @@ alpha_mdebug_frame_base_sniffer (frame_info_ptr this_frame) return &alpha_mdebug_frame_base; } - void alpha_mdebug_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { diff --git a/gdb/alpha-netbsd-tdep.c b/gdb/alpha-netbsd-tdep.c index 5ea7d28..d4b71a0 100644 --- a/gdb/alpha-netbsd-tdep.c +++ b/gdb/alpha-netbsd-tdep.c @@ -36,10 +36,10 @@ /* Core file support. */ /* Sizeof `struct reg' in . */ -#define ALPHANBSD_SIZEOF_GREGS (32 * 8) +#define ALPHANBSD_SIZEOF_GREGS (32 * 8) /* Sizeof `struct fpreg' in = ALPHANBSD_SIZEOF_GREGS); - for (i = 0; i < ARRAY_SIZE(regmap); i++) + for (i = 0; i < ARRAY_SIZE (regmap); i++) { if (regnum == i || regnum == -1) regcache->raw_supply (i, regs + regmap[i] * 8); @@ -115,8 +107,8 @@ alphanbsd_aout_supply_gregset (const struct regset *regset, static void alphanbsd_supply_gregset (const struct regset *regset, - struct regcache *regcache, - int regnum, const void *gregs, size_t len) + struct regcache *regcache, int regnum, + const void *gregs, size_t len) { const gdb_byte *regs = (const gdb_byte *) gregs; int i; @@ -139,19 +131,11 @@ alphanbsd_supply_gregset (const struct regset *regset, /* NetBSD/alpha register sets. */ -static const struct regset alphanbsd_gregset = -{ - NULL, - alphanbsd_supply_gregset, - NULL, - REGSET_VARIABLE_SIZE -}; +static const struct regset alphanbsd_gregset + = { NULL, alphanbsd_supply_gregset, NULL, REGSET_VARIABLE_SIZE }; -static const struct regset alphanbsd_fpregset = -{ - NULL, - alphanbsd_supply_fpregset -}; +static const struct regset alphanbsd_fpregset + = { NULL, alphanbsd_supply_fpregset }; /* Iterate over supported core file register note sections. */ @@ -166,7 +150,6 @@ alphanbsd_iterate_over_regset_sections (struct gdbarch *gdbarch, cb (".reg2", ALPHANBSD_SIZEOF_FPREGS, ALPHANBSD_SIZEOF_FPREGS, &alphanbsd_fpregset, NULL, cb_data); } - /* Signal trampolines. */ @@ -186,15 +169,14 @@ alphanbsd_iterate_over_regset_sections (struct gdbarch *gdbarch, sequence and can then check whether we really are executing in the signal trampoline. If not, -1 is returned, otherwise the offset from the start of the return sequence is returned. */ -static const gdb_byte sigtramp_retcode[] = -{ - 0x00, 0x00, 0x1e, 0xa6, /* ldq a0, 0(sp) */ - 0x10, 0x00, 0xde, 0x23, /* lda sp, 16(sp) */ - 0x27, 0x01, 0x1f, 0x20, /* lda v0, 295(zero) */ - 0x83, 0x00, 0x00, 0x00, /* call_pal callsys */ +static const gdb_byte sigtramp_retcode[] = { + 0x00, 0x00, 0x1e, 0xa6, /* ldq a0, 0(sp) */ + 0x10, 0x00, 0xde, 0x23, /* lda sp, 16(sp) */ + 0x27, 0x01, 0x1f, 0x20, /* lda v0, 295(zero) */ + 0x83, 0x00, 0x00, 0x00, /* call_pal callsys */ }; -#define RETCODE_NWORDS 4 -#define RETCODE_SIZE (RETCODE_NWORDS * 4) +#define RETCODE_NWORDS 4 +#define RETCODE_SIZE (RETCODE_NWORDS * 4) static LONGEST alphanbsd_sigtramp_offset (struct gdbarch *gdbarch, CORE_ADDR pc) @@ -227,8 +209,8 @@ alphanbsd_sigtramp_offset (struct gdbarch *gdbarch, CORE_ADDR pc) } static int -alphanbsd_pc_in_sigtramp (struct gdbarch *gdbarch, - CORE_ADDR pc, const char *func_name) +alphanbsd_pc_in_sigtramp (struct gdbarch *gdbarch, CORE_ADDR pc, + const char *func_name) { return (nbsd_pc_in_sigtramp (pc, func_name) || alphanbsd_sigtramp_offset (gdbarch, pc) >= 0); @@ -244,11 +226,9 @@ alphanbsd_sigcontext_addr (frame_info_ptr frame) return 0; return get_frame_base (get_next_frame (frame)); } - static void -alphanbsd_init_abi (struct gdbarch_info info, - struct gdbarch *gdbarch) +alphanbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { alpha_gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); @@ -265,8 +245,8 @@ alphanbsd_init_abi (struct gdbarch_info info, set_gdbarch_software_single_step (gdbarch, alpha_software_single_step); /* NetBSD/alpha has SVR4-style shared libraries. */ - set_solib_svr4_fetch_link_map_offsets - (gdbarch, svr4_lp64_fetch_link_map_offsets); + set_solib_svr4_fetch_link_map_offsets (gdbarch, + svr4_lp64_fetch_link_map_offsets); tdep->dynamic_sigtramp_offset = alphanbsd_sigtramp_offset; tdep->pc_in_sigtramp = alphanbsd_pc_in_sigtramp; @@ -275,12 +255,12 @@ alphanbsd_init_abi (struct gdbarch_info info, tdep->jb_pc = 2; tdep->jb_elt_size = 8; - set_gdbarch_iterate_over_regset_sections - (gdbarch, alphanbsd_iterate_over_regset_sections); + set_gdbarch_iterate_over_regset_sections ( + gdbarch, alphanbsd_iterate_over_regset_sections); } - void _initialize_alphanbsd_tdep (); + void _initialize_alphanbsd_tdep () { diff --git a/gdb/alpha-obsd-tdep.c b/gdb/alpha-obsd-tdep.c index a3d713f..2491499 100644 --- a/gdb/alpha-obsd-tdep.c +++ b/gdb/alpha-obsd-tdep.c @@ -46,8 +46,8 @@ alphaobsd_sigtramp_offset (struct gdbarch *gdbarch, CORE_ADDR pc) } static int -alphaobsd_pc_in_sigtramp (struct gdbarch *gdbarch, - CORE_ADDR pc, const char *name) +alphaobsd_pc_in_sigtramp (struct gdbarch *gdbarch, CORE_ADDR pc, + const char *name) { CORE_ADDR start_pc = (pc & ~(alphaobsd_page_size - 1)); unsigned insn; @@ -92,10 +92,9 @@ alphaobsd_sigcontext_addr (frame_info_ptr this_frame) return get_frame_register_unsigned (this_frame, ALPHA_A0_REGNUM); } } - static void -alphaobsd_init_abi(struct gdbarch_info info, struct gdbarch *gdbarch) +alphaobsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { alpha_gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); @@ -110,8 +109,8 @@ alphaobsd_init_abi(struct gdbarch_info info, struct gdbarch *gdbarch) set_gdbarch_software_single_step (gdbarch, alpha_software_single_step); /* OpenBSD/alpha has SVR4-style shared libraries. */ - set_solib_svr4_fetch_link_map_offsets - (gdbarch, svr4_lp64_fetch_link_map_offsets); + set_solib_svr4_fetch_link_map_offsets (gdbarch, + svr4_lp64_fetch_link_map_offsets); set_gdbarch_skip_solib_resolver (gdbarch, obsd_skip_solib_resolver); tdep->dynamic_sigtramp_offset = alphaobsd_sigtramp_offset; @@ -121,12 +120,12 @@ alphaobsd_init_abi(struct gdbarch_info info, struct gdbarch *gdbarch) tdep->jb_pc = 2; tdep->jb_elt_size = 8; - set_gdbarch_iterate_over_regset_sections - (gdbarch, alphanbsd_iterate_over_regset_sections); + set_gdbarch_iterate_over_regset_sections ( + gdbarch, alphanbsd_iterate_over_regset_sections); } - void _initialize_alphaobsd_tdep (); + void _initialize_alphaobsd_tdep () { diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c index 14f5a04..363ca71 100644 --- a/gdb/alpha-tdep.c +++ b/gdb/alpha-tdep.c @@ -59,7 +59,7 @@ static const int lda_opcode = 0x08; static const int stq_opcode = 0x2d; /* Branch instruction format */ -#define BR_RA(insn) MEM_RA(insn) +#define BR_RA(insn) MEM_RA (insn) static const int br_opcode = 0x30; static const int bne_opcode = 0x3d; @@ -67,14 +67,13 @@ static const int bne_opcode = 0x3d; /* Operate instruction format */ #define OPR_FUNCTION(insn) ((insn & 0xfe0) >> 5) #define OPR_HAS_IMMEDIATE(insn) ((insn & 0x1000) == 0x1000) -#define OPR_RA(insn) MEM_RA(insn) +#define OPR_RA(insn) MEM_RA (insn) #define OPR_RC(insn) ((insn & 0x1f)) #define OPR_LIT(insn) ((insn & 0x1fe000) >> 13) static const int subq_opcode = 0x10; static const int subq_function = 0x29; - /* Return the name of the REGNO register. An empty name corresponds to a register number that used to @@ -85,18 +84,15 @@ static const int subq_function = 0x29; static const char * alpha_register_name (struct gdbarch *gdbarch, int regno) { - static const char * const register_names[] = - { - "v0", "t0", "t1", "t2", "t3", "t4", "t5", "t6", - "t7", "s0", "s1", "s2", "s3", "s4", "s5", "fp", - "a0", "a1", "a2", "a3", "a4", "a5", "t8", "t9", - "t10", "t11", "ra", "t12", "at", "gp", "sp", "zero", - "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", - "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", - "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23", - "f24", "f25", "f26", "f27", "f28", "f29", "f30", "fpcr", - "pc", "", "unique" - }; + static const char *const register_names[] + = { "v0", "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", + "s0", "s1", "s2", "s3", "s4", "s5", "fp", "a0", "a1", + "a2", "a3", "a4", "a5", "t8", "t9", "t10", "t11", "ra", + "t12", "at", "gp", "sp", "zero", "f0", "f1", "f2", "f3", + "f4", "f5", "f6", "f7", "f8", "f9", "f10", "f11", "f12", + "f13", "f14", "f15", "f16", "f17", "f18", "f19", "f20", "f21", + "f22", "f23", "f24", "f25", "f26", "f27", "f28", "f29", "f30", + "fpcr", "pc", "", "unique" }; gdb_static_assert (ALPHA_NUM_REGS == ARRAY_SIZE (register_names)); return register_names[regno]; @@ -182,8 +178,8 @@ alpha_lds (struct gdbarch *gdbarch, void *out, const void *in) enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); ULONGEST mem = extract_unsigned_integer ((const gdb_byte *) in, 4, byte_order); - ULONGEST frac = (mem >> 0) & 0x7fffff; - ULONGEST sign = (mem >> 31) & 1; + ULONGEST frac = (mem >> 0) & 0x7fffff; + ULONGEST sign = (mem >> 31) & 1; ULONGEST exp_msb = (mem >> 30) & 1; ULONGEST exp_low = (mem >> 23) & 0x7f; ULONGEST exp, reg; @@ -234,8 +230,8 @@ alpha_convert_register_p (struct gdbarch *gdbarch, int regno, static int alpha_register_to_value (frame_info_ptr frame, int regnum, - struct type *valtype, gdb_byte *out, - int *optimizedp, int *unavailablep) + struct type *valtype, gdb_byte *out, int *optimizedp, + int *unavailablep) { struct gdbarch *gdbarch = get_frame_arch (frame); struct value *value = get_frame_register_value (frame, regnum); @@ -273,7 +269,6 @@ alpha_value_to_register (frame_info_ptr frame, int regnum, put_frame_register (frame, regnum, out); } - /* The alpha passes the first six arguments in the registers, the rest on the stack. The register arguments are stored in ARG_REG_BUFFER, and then moved into the register file; this simplifies the passing of a @@ -288,20 +283,21 @@ alpha_value_to_register (frame_info_ptr frame, int regnum, static CORE_ADDR alpha_push_dummy_call (struct gdbarch *gdbarch, struct value *function, - struct regcache *regcache, CORE_ADDR bp_addr, - int nargs, struct value **args, CORE_ADDR sp, + struct regcache *regcache, CORE_ADDR bp_addr, int nargs, + struct value **args, CORE_ADDR sp, function_call_return_method return_method, CORE_ADDR struct_addr) { enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); int i; int accumulate_size = (return_method == return_method_struct) ? 8 : 0; + struct alpha_arg - { - const gdb_byte *contents; - int len; - int offset; - }; + { + const gdb_byte *contents; + int len; + int offset; + }; struct alpha_arg *alpha_args = XALLOCAVEC (struct alpha_arg, nargs); struct alpha_arg *m_arg; gdb_byte arg_reg_buffer[ALPHA_REGISTER_SIZE * ALPHA_NUM_ARG_REGS]; @@ -405,10 +401,10 @@ alpha_push_dummy_call (struct gdbarch *gdbarch, struct value *function, required_arg_regs = ALPHA_NUM_ARG_REGS; /* Make room for the arguments on the stack. */ - if (accumulate_size < sizeof(arg_reg_buffer)) + if (accumulate_size < sizeof (arg_reg_buffer)) accumulate_size = 0; else - accumulate_size -= sizeof(arg_reg_buffer); + accumulate_size -= sizeof (arg_reg_buffer); sp -= accumulate_size; /* Keep sp aligned to a multiple of 16 as the ABI requires. */ @@ -422,16 +418,16 @@ alpha_push_dummy_call (struct gdbarch *gdbarch, struct value *function, int len = m_arg->len; /* Copy the bytes destined for registers into arg_reg_buffer. */ - if (offset < sizeof(arg_reg_buffer)) + if (offset < sizeof (arg_reg_buffer)) { - if (offset + len <= sizeof(arg_reg_buffer)) + if (offset + len <= sizeof (arg_reg_buffer)) { memcpy (arg_reg_buffer + offset, contents, len); continue; } else { - int tlen = sizeof(arg_reg_buffer) - offset; + int tlen = sizeof (arg_reg_buffer) - offset; memcpy (arg_reg_buffer + offset, contents, tlen); offset += tlen; contents += tlen; @@ -440,11 +436,11 @@ alpha_push_dummy_call (struct gdbarch *gdbarch, struct value *function, } /* Everything else goes to the stack. */ - write_memory (sp + offset - sizeof(arg_reg_buffer), contents, len); + write_memory (sp + offset - sizeof (arg_reg_buffer), contents, len); } if (return_method == return_method_struct) - store_unsigned_integer (arg_reg_buffer, ALPHA_REGISTER_SIZE, - byte_order, struct_addr); + store_unsigned_integer (arg_reg_buffer, ALPHA_REGISTER_SIZE, byte_order, + struct_addr); /* Load the argument registers. */ for (i = 0; i < required_arg_regs; i++) @@ -493,7 +489,7 @@ alpha_extract_return_value (struct type *valtype, struct regcache *regcache, break; default: - internal_error (_("unknown floating point width")); + internal_error (_ ("unknown floating point width")); } break; @@ -516,7 +512,7 @@ alpha_extract_return_value (struct type *valtype, struct regcache *regcache, break; default: - internal_error (_("unknown floating point width")); + internal_error (_ ("unknown floating point width")); } break; @@ -557,10 +553,10 @@ alpha_store_return_value (struct type *valtype, struct regcache *regcache, /* FIXME: 128-bit long doubles are returned like structures: by writing into indirect storage provided by the caller as the first argument. */ - error (_("Cannot set a 128-bit long double return value.")); + error (_ ("Cannot set a 128-bit long double return value.")); default: - internal_error (_("unknown floating point width")); + internal_error (_ ("unknown floating point width")); } break; @@ -581,10 +577,10 @@ alpha_store_return_value (struct type *valtype, struct regcache *regcache, /* FIXME: 128-bit long doubles are returned like structures: by writing into indirect storage provided by the caller as the first argument. */ - error (_("Cannot set a 128-bit long double return value.")); + error (_ ("Cannot set a 128-bit long double return value.")); default: - internal_error (_("unknown floating point width")); + internal_error (_ ("unknown floating point width")); } break; @@ -608,8 +604,7 @@ alpha_return_value (struct gdbarch *gdbarch, struct value *function, enum type_code code = type->code (); alpha_gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - if ((code == TYPE_CODE_STRUCT - || code == TYPE_CODE_UNION + if ((code == TYPE_CODE_STRUCT || code == TYPE_CODE_UNION || code == TYPE_CODE_ARRAY) && tdep->return_in_memory (type)) { @@ -636,13 +631,11 @@ alpha_return_in_memory_always (struct type *type) { return 1; } - constexpr gdb_byte alpha_break_insn[] = { 0x80, 0, 0, 0 }; /* call_pal bpt */ typedef BP_MANIPULATION (alpha_break_insn) alpha_breakpoint; - /* This returns the PC of the first insn after the prologue. If we can't find the prologue, then return 0. */ @@ -722,23 +715,23 @@ alpha_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) { inst = alpha_read_insn (gdbarch, pc + offset); - if ((inst & 0xffff0000) == 0x27bb0000) /* ldah $gp,n($t12) */ + if ((inst & 0xffff0000) == 0x27bb0000) /* ldah $gp,n($t12) */ continue; - if ((inst & 0xffff0000) == 0x23bd0000) /* lda $gp,n($gp) */ + if ((inst & 0xffff0000) == 0x23bd0000) /* lda $gp,n($gp) */ continue; - if ((inst & 0xffff0000) == 0x23de0000) /* lda $sp,n($sp) */ + if ((inst & 0xffff0000) == 0x23de0000) /* lda $sp,n($sp) */ continue; - if ((inst & 0xffe01fff) == 0x43c0153e) /* subq $sp,n,$sp */ + if ((inst & 0xffe01fff) == 0x43c0153e) /* subq $sp,n,$sp */ continue; - if (((inst & 0xfc1f0000) == 0xb41e0000 /* stq reg,n($sp) */ - || (inst & 0xfc1f0000) == 0x9c1e0000) /* stt reg,n($sp) */ - && (inst & 0x03e00000) != 0x03e00000) /* reg != $zero */ + if (((inst & 0xfc1f0000) == 0xb41e0000 /* stq reg,n($sp) */ + || (inst & 0xfc1f0000) == 0x9c1e0000) /* stt reg,n($sp) */ + && (inst & 0x03e00000) != 0x03e00000) /* reg != $zero */ continue; - if (inst == 0x47de040f) /* bis sp,sp,fp */ + if (inst == 0x47de040f) /* bis sp,sp,fp */ continue; - if (inst == 0x47fe040f) /* bis zero,sp,fp */ + if (inst == 0x47fe040f) /* bis zero,sp,fp */ continue; break; @@ -746,7 +739,6 @@ alpha_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) return pc + offset; } - static const int ldl_l_opcode = 0x2a; static const int ldq_l_opcode = 0x2b; static const int stl_c_opcode = 0x2e; @@ -760,19 +752,18 @@ static const int stq_c_opcode = 0x2f; static std::vector alpha_deal_with_atomic_sequence (struct gdbarch *gdbarch, CORE_ADDR pc) { - CORE_ADDR breaks[2] = {CORE_ADDR_MAX, CORE_ADDR_MAX}; + CORE_ADDR breaks[2] = { CORE_ADDR_MAX, CORE_ADDR_MAX }; CORE_ADDR loc = pc; CORE_ADDR closing_insn; /* Instruction that closes the atomic sequence. */ unsigned int insn = alpha_read_insn (gdbarch, loc); int insn_count; int index; - int last_breakpoint = 0; /* Defaults to 0 (no breakpoints placed). */ + int last_breakpoint = 0; /* Defaults to 0 (no breakpoints placed). */ const int atomic_sequence_length = 16; /* Instruction sequence length. */ int bc_insn_count = 0; /* Conditional branch instruction count. */ /* Assume all atomic sequences start with a LDL_L/LDQ_L instruction. */ - if (INSN_OPCODE (insn) != ldl_l_opcode - && INSN_OPCODE (insn) != ldq_l_opcode) + if (INSN_OPCODE (insn) != ldl_l_opcode && INSN_OPCODE (insn) != ldq_l_opcode) return {}; /* Assume that no atomic sequence is longer than "atomic_sequence_length" @@ -807,8 +798,7 @@ alpha_deal_with_atomic_sequence (struct gdbarch *gdbarch, CORE_ADDR pc) } /* Assume that the atomic sequence ends with a STL_C/STQ_C instruction. */ - if (INSN_OPCODE (insn) != stl_c_opcode - && INSN_OPCODE (insn) != stq_c_opcode) + if (INSN_OPCODE (insn) != stl_c_opcode && INSN_OPCODE (insn) != stq_c_opcode) return {}; closing_insn = loc; @@ -818,7 +808,7 @@ alpha_deal_with_atomic_sequence (struct gdbarch *gdbarch, CORE_ADDR pc) breaks[0] = loc; /* Check for duplicated breakpoints. Check also for a breakpoint - placed (branch instruction's destination) anywhere in sequence. */ + placed (branch instruction's destination) anywhere in sequence. */ if (last_breakpoint && (breaks[1] == breaks[0] || (breaks[1] >= pc && breaks[1] <= closing_insn))) @@ -832,7 +822,6 @@ alpha_deal_with_atomic_sequence (struct gdbarch *gdbarch, CORE_ADDR pc) return next_pcs; } - /* Figure out where the longjmp will land. We expect the first arg to be a pointer to the jmp_buf structure from which we extract the PC (JB_PC) that we will land at. The PC is copied @@ -857,7 +846,6 @@ alpha_get_longjmp_target (frame_info_ptr frame, CORE_ADDR *pc) return 1; } - /* Frame unwinder for signal trampolines. We use alpha tdep bits that describe the location and shape of the sigcontext structure. After that, all registers are in memory, so it's easy. */ @@ -894,7 +882,7 @@ alpha_sigtramp_frame_unwind_cache (frame_info_ptr this_frame, static CORE_ADDR alpha_sigtramp_register_address (struct gdbarch *gdbarch, CORE_ADDR sigcontext_addr, int regnum) -{ +{ alpha_gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); if (regnum >= 0 && regnum < 32) @@ -902,7 +890,7 @@ alpha_sigtramp_register_address (struct gdbarch *gdbarch, else if (regnum >= ALPHA_FP0_REGNUM && regnum < ALPHA_FP0_REGNUM + 32) return sigcontext_addr + tdep->sc_fpregs_offset + regnum * 8; else if (regnum == ALPHA_PC_REGNUM) - return sigcontext_addr + tdep->sc_pc_offset; + return sigcontext_addr + tdep->sc_pc_offset; return 0; } @@ -944,8 +932,8 @@ alpha_sigtramp_frame_this_id (frame_info_ptr this_frame, /* The stack address is trivially read from the sigcontext. */ stack_addr = alpha_sigtramp_register_address (gdbarch, info->sigcontext_addr, ALPHA_SP_REGNUM); - stack_addr = get_frame_memory_unsigned (this_frame, stack_addr, - ALPHA_REGISTER_SIZE); + stack_addr + = get_frame_memory_unsigned (this_frame, stack_addr, ALPHA_REGISTER_SIZE); *this_id = frame_id_build (stack_addr, code_addr); } @@ -1006,18 +994,14 @@ alpha_sigtramp_frame_sniffer (const struct frame_unwind *self, return 0; } -static const struct frame_unwind alpha_sigtramp_frame_unwind = -{ - "alpha sigtramp", - SIGTRAMP_FRAME, - default_frame_unwind_stop_reason, - alpha_sigtramp_frame_this_id, - alpha_sigtramp_frame_prev_register, - NULL, - alpha_sigtramp_frame_sniffer -}; - - +static const struct frame_unwind alpha_sigtramp_frame_unwind + = { "alpha sigtramp", + SIGTRAMP_FRAME, + default_frame_unwind_stop_reason, + alpha_sigtramp_frame_this_id, + alpha_sigtramp_frame_prev_register, + NULL, + alpha_sigtramp_frame_sniffer }; /* Heuristic_proc_start may hunt through the text section for a long time across a 2400 baud serial line. Allows the user to limit this @@ -1049,8 +1033,7 @@ alpha_heuristic_proc_start (struct gdbarch *gdbarch, CORE_ADDR pc) if (func) return func; - if (heuristic_fence_post == -1 - || fence < tdep->vm_min_address) + if (heuristic_fence_post == -1 || fence < tdep->vm_min_address) fence = tdep->vm_min_address; /* Search back for previous return; also stop at a 0, which might be @@ -1061,12 +1044,12 @@ alpha_heuristic_proc_start (struct gdbarch *gdbarch, CORE_ADDR pc) unsigned int insn = alpha_read_insn (gdbarch, pc); switch (insn) { - case 0: /* invalid insn */ - case 0x6bfa8001: /* ret $31,($26),1 */ + case 0: /* invalid insn */ + case 0x6bfa8001: /* ret $31,($26),1 */ return last_non_nop; - case 0x2ffe0000: /* unop: ldq_u $31,0($30) */ - case 0x47ff041f: /* nop: bis $31,$31,$31 */ + case 0x2ffe0000: /* unop: ldq_u $31,0($30) */ + case 0x47ff041f: /* nop: bis $31,$31,$31 */ break; default: @@ -1085,15 +1068,17 @@ alpha_heuristic_proc_start (struct gdbarch *gdbarch, CORE_ADDR pc) static int blurb_printed = 0; if (fence == tdep->vm_min_address) - warning (_("Hit beginning of text section without finding \ -enclosing function for address %s"), paddress (gdbarch, orig_pc)); + warning (_ ("Hit beginning of text section without finding \ +enclosing function for address %s"), + paddress (gdbarch, orig_pc)); else - warning (_("Hit heuristic-fence-post without finding \ -enclosing function for address %s"), paddress (gdbarch, orig_pc)); + warning (_ ("Hit heuristic-fence-post without finding \ +enclosing function for address %s"), + paddress (gdbarch, orig_pc)); if (!blurb_printed) { - gdb_printf (_("\ + gdb_printf (_ ("\ This warning occurs if you are debugging a function without any symbols\n\ (for example, in a stripped executable). In that case, you may wish to\n\ increase the size of the search with the `set heuristic-fence-post' command.\n\ @@ -1111,7 +1096,7 @@ Otherwise, you told GDB there was a function where there isn't one, or\n\ something about the traditional layout of alpha stack frames. */ struct alpha_heuristic_unwind_cache -{ +{ CORE_ADDR vfp; CORE_ADDR start_pc; trad_frame_saved_reg *saved_regs; @@ -1160,39 +1145,33 @@ alpha_heuristic_analyze_probing_loop (struct gdbarch *gdbarch, CORE_ADDR *pc, cur_pc += ALPHA_INSN_SIZE; insn = alpha_read_insn (gdbarch, cur_pc); - if (INSN_OPCODE (insn) != lda_opcode - || MEM_RB (insn) != ALPHA_SP_REGNUM) + if (INSN_OPCODE (insn) != lda_opcode || MEM_RB (insn) != ALPHA_SP_REGNUM) return; reg_probe = MEM_RA (insn); cur_frame_size -= MEM_DISP (insn); /* stq zero,(REG_PROBE) */ - + cur_pc += ALPHA_INSN_SIZE; insn = alpha_read_insn (gdbarch, cur_pc); - if (INSN_OPCODE (insn) != stq_opcode - || MEM_RA (insn) != 0x1f + if (INSN_OPCODE (insn) != stq_opcode || MEM_RA (insn) != 0x1f || MEM_RB (insn) != reg_probe) return; - + /* subq REG_INDEX,0x1,REG_INDEX */ cur_pc += ALPHA_INSN_SIZE; insn = alpha_read_insn (gdbarch, cur_pc); - if (INSN_OPCODE (insn) != subq_opcode - || !OPR_HAS_IMMEDIATE (insn) - || OPR_FUNCTION (insn) != subq_function - || OPR_LIT(insn) != 1 - || OPR_RA (insn) != reg_index - || OPR_RC (insn) != reg_index) + if (INSN_OPCODE (insn) != subq_opcode || !OPR_HAS_IMMEDIATE (insn) + || OPR_FUNCTION (insn) != subq_function || OPR_LIT (insn) != 1 + || OPR_RA (insn) != reg_index || OPR_RC (insn) != reg_index) return; - + /* lda REG_PROBE,(REG_PROBE) */ - + cur_pc += ALPHA_INSN_SIZE; insn = alpha_read_insn (gdbarch, cur_pc); - if (INSN_OPCODE (insn) != lda_opcode - || MEM_RA (insn) != reg_probe + if (INSN_OPCODE (insn) != lda_opcode || MEM_RA (insn) != reg_probe || MEM_RB (insn) != reg_probe) return; cur_frame_size -= MEM_DISP (insn) * nb_of_iterations; @@ -1201,16 +1180,14 @@ alpha_heuristic_analyze_probing_loop (struct gdbarch *gdbarch, CORE_ADDR *pc, cur_pc += ALPHA_INSN_SIZE; insn = alpha_read_insn (gdbarch, cur_pc); - if (INSN_OPCODE (insn) != bne_opcode - || MEM_RA (insn) != reg_index) + if (INSN_OPCODE (insn) != bne_opcode || MEM_RA (insn) != reg_index) return; /* lda sp,(REG_PROBE) */ cur_pc += ALPHA_INSN_SIZE; insn = alpha_read_insn (gdbarch, cur_pc); - if (INSN_OPCODE (insn) != lda_opcode - || MEM_RA (insn) != ALPHA_SP_REGNUM + if (INSN_OPCODE (insn) != lda_opcode || MEM_RA (insn) != ALPHA_SP_REGNUM || MEM_RB (insn) != reg_probe) return; cur_frame_size -= MEM_DISP (insn); @@ -1257,7 +1234,7 @@ alpha_heuristic_frame_unwind_cache (frame_info_ptr this_frame, { unsigned int word = alpha_read_insn (gdbarch, cur_pc); - if ((word & 0xffff0000) == 0x23de0000) /* lda $sp,n($sp) */ + if ((word & 0xffff0000) == 0x23de0000) /* lda $sp,n($sp) */ { if (word & 0x8000) { @@ -1274,7 +1251,7 @@ alpha_heuristic_frame_unwind_cache (frame_info_ptr this_frame, break; } } - else if ((word & 0xfc1f0000) == 0xb41e0000) /* stq reg,n($sp) */ + else if ((word & 0xfc1f0000) == 0xb41e0000) /* stq reg,n($sp) */ { reg = (word & 0x03e00000) >> 21; @@ -1323,18 +1300,16 @@ alpha_heuristic_frame_unwind_cache (frame_info_ptr this_frame, FIXME: Rewriting GDB to access the procedure descriptors, e.g. via the minimal symbol table, might obviate this hack. */ - if (return_reg == -1 - && cur_pc < (start_pc + 80) - && (reg == ALPHA_T7_REGNUM - || reg == ALPHA_T9_REGNUM + if (return_reg == -1 && cur_pc < (start_pc + 80) + && (reg == ALPHA_T7_REGNUM || reg == ALPHA_T9_REGNUM || reg == ALPHA_RA_REGNUM)) return_reg = reg; } - else if ((word & 0xffe0ffff) == 0x6be08001) /* ret zero,reg,1 */ + else if ((word & 0xffe0ffff) == 0x6be08001) /* ret zero,reg,1 */ return_reg = (word >> 16) & 0x1f; - else if (word == 0x47de040f) /* bis sp,sp,fp */ + else if (word == 0x47de040f) /* bis sp,sp,fp */ frame_reg = ALPHA_GCC_FP_REGNUM; - else if (word == 0x47fe040f) /* bis zero,sp,fp */ + else if (word == 0x47fe040f) /* bis zero,sp,fp */ frame_reg = ALPHA_GCC_FP_REGNUM; alpha_heuristic_analyze_probing_loop (gdbarch, &cur_pc, &frame_size); @@ -1348,11 +1323,10 @@ alpha_heuristic_frame_unwind_cache (frame_info_ptr this_frame, { unsigned int word = alpha_read_insn (gdbarch, cur_pc); - if ((word & 0xfc1f0000) == 0xb41e0000) /* stq reg,n($sp) */ + if ((word & 0xfc1f0000) == 0xb41e0000) /* stq reg,n($sp) */ { reg = (word & 0x03e00000) >> 21; - if (reg == ALPHA_T7_REGNUM - || reg == ALPHA_T9_REGNUM + if (reg == ALPHA_T7_REGNUM || reg == ALPHA_T9_REGNUM || reg == ALPHA_RA_REGNUM) { return_reg = reg; @@ -1382,13 +1356,12 @@ alpha_heuristic_frame_unwind_cache (frame_info_ptr this_frame, one to the offsets to make all detected offsets non-zero. */ for (reg = 0; reg < ALPHA_NUM_REGS; ++reg) if (info->saved_regs[reg].is_addr ()) - info->saved_regs[reg].set_addr (info->saved_regs[reg].addr () - + val - 1); + info->saved_regs[reg].set_addr (info->saved_regs[reg].addr () + val - 1); /* The stack pointer of the previous frame is computed by popping the current stack frame. */ if (!info->saved_regs[ALPHA_SP_REGNUM].is_addr ()) - info->saved_regs[ALPHA_SP_REGNUM].set_value (info->vfp); + info->saved_regs[ALPHA_SP_REGNUM].set_value (info->vfp); return info; } @@ -1421,20 +1394,18 @@ alpha_heuristic_frame_prev_register (frame_info_ptr this_frame, the correct place. */ if (regnum == ALPHA_PC_REGNUM) regnum = info->return_reg; - + return trad_frame_get_prev_register (this_frame, info->saved_regs, regnum); } -static const struct frame_unwind alpha_heuristic_frame_unwind = -{ - "alpha prologue", - NORMAL_FRAME, - default_frame_unwind_stop_reason, - alpha_heuristic_frame_this_id, - alpha_heuristic_frame_prev_register, - NULL, - default_frame_sniffer -}; +static const struct frame_unwind alpha_heuristic_frame_unwind + = { "alpha prologue", + NORMAL_FRAME, + default_frame_unwind_stop_reason, + alpha_heuristic_frame_this_id, + alpha_heuristic_frame_prev_register, + NULL, + default_frame_sniffer }; static CORE_ADDR alpha_heuristic_frame_base_address (frame_info_ptr this_frame, @@ -1446,23 +1417,20 @@ alpha_heuristic_frame_base_address (frame_info_ptr this_frame, return info->vfp; } -static const struct frame_base alpha_heuristic_frame_base = { - &alpha_heuristic_frame_unwind, - alpha_heuristic_frame_base_address, - alpha_heuristic_frame_base_address, - alpha_heuristic_frame_base_address -}; +static const struct frame_base alpha_heuristic_frame_base + = { &alpha_heuristic_frame_unwind, alpha_heuristic_frame_base_address, + alpha_heuristic_frame_base_address, alpha_heuristic_frame_base_address }; /* Just like reinit_frame_cache, but with the right arguments to be callable as an sfunc. Used by the "set heuristic-fence-post" command. */ static void -reinit_frame_cache_sfunc (const char *args, - int from_tty, struct cmd_list_element *c) +reinit_frame_cache_sfunc (const char *args, int from_tty, + struct cmd_list_element *c) { reinit_frame_cache (); } - + /* Helper routines for alpha*-nat.c files to move register sets to and from core files. The UNIQUE pointer is allowed to be NULL, as most targets don't supply this value in their core files. */ @@ -1493,8 +1461,8 @@ alpha_supply_int_regs (struct regcache *regcache, int regno, } void -alpha_fill_int_regs (const struct regcache *regcache, - int regno, void *r0_r30, void *pc, void *unique) +alpha_fill_int_regs (const struct regcache *regcache, int regno, void *r0_r30, + void *pc, void *unique) { gdb_byte *regs = (gdb_byte *) r0_r30; int i; @@ -1511,8 +1479,8 @@ alpha_fill_int_regs (const struct regcache *regcache, } void -alpha_supply_fp_regs (struct regcache *regcache, int regno, - const void *f0_f30, const void *fpcr) +alpha_supply_fp_regs (struct regcache *regcache, int regno, const void *f0_f30, + const void *fpcr) { const gdb_byte *regs = (const gdb_byte *) f0_f30; int i; @@ -1526,8 +1494,8 @@ alpha_supply_fp_regs (struct regcache *regcache, int regno, } void -alpha_fill_fp_regs (const struct regcache *regcache, - int regno, void *f0_f30, void *fpcr) +alpha_fill_fp_regs (const struct regcache *regcache, int regno, void *f0_f30, + void *fpcr) { gdb_byte *regs = (gdb_byte *) f0_f30; int i; @@ -1540,11 +1508,9 @@ alpha_fill_fp_regs (const struct regcache *regcache, regcache->raw_collect (ALPHA_FPCR_REGNUM, fpcr); } - - /* Return nonzero if the G_floating register value in REG is equal to zero for FP control instructions. */ - + static int fp_register_zero_p (LONGEST reg) { @@ -1596,13 +1562,13 @@ alpha_next_pc (struct regcache *regcache, CORE_ADDR pc) { /* Branch format: target PC is: (new PC) + (4 * sext(displacement)) */ - if (op == 0x30 /* BR */ - || op == 0x34) /* BSR */ + if (op == 0x30 /* BR */ + || op == 0x34) /* BSR */ { - branch_taken: + branch_taken: offset = (insn & 0x001fffff); if (offset & 0x00100000) - offset |= 0xffe00000; + offset |= 0xffe00000; offset *= ALPHA_INSN_SIZE; return (pc + ALPHA_INSN_SIZE + offset); } @@ -1611,76 +1577,76 @@ alpha_next_pc (struct regcache *regcache, CORE_ADDR pc) regno = (insn >> 21) & 0x1f; switch (op) { - case 0x31: /* FBEQ */ - case 0x36: /* FBGE */ - case 0x37: /* FBGT */ - case 0x33: /* FBLE */ - case 0x32: /* FBLT */ - case 0x35: /* FBNE */ - regno += gdbarch_fp0_regnum (gdbarch); + case 0x31: /* FBEQ */ + case 0x36: /* FBGE */ + case 0x37: /* FBGT */ + case 0x33: /* FBLE */ + case 0x32: /* FBLT */ + case 0x35: /* FBNE */ + regno += gdbarch_fp0_regnum (gdbarch); } - + rav = regcache_raw_get_signed (regcache, regno); switch (op) { - case 0x38: /* BLBC */ + case 0x38: /* BLBC */ if ((rav & 1) == 0) goto branch_taken; break; - case 0x3c: /* BLBS */ + case 0x3c: /* BLBS */ if (rav & 1) goto branch_taken; break; - case 0x39: /* BEQ */ + case 0x39: /* BEQ */ if (rav == 0) goto branch_taken; break; - case 0x3d: /* BNE */ + case 0x3d: /* BNE */ if (rav != 0) goto branch_taken; break; - case 0x3a: /* BLT */ + case 0x3a: /* BLT */ if (rav < 0) goto branch_taken; break; - case 0x3b: /* BLE */ + case 0x3b: /* BLE */ if (rav <= 0) goto branch_taken; break; - case 0x3f: /* BGT */ + case 0x3f: /* BGT */ if (rav > 0) goto branch_taken; break; - case 0x3e: /* BGE */ + case 0x3e: /* BGE */ if (rav >= 0) goto branch_taken; break; - /* Floating point branches. */ - - case 0x31: /* FBEQ */ + /* Floating point branches. */ + + case 0x31: /* FBEQ */ if (fp_register_zero_p (rav)) goto branch_taken; break; - case 0x36: /* FBGE */ + case 0x36: /* FBGE */ if (fp_register_sign_bit (rav) == 0 || fp_register_zero_p (rav)) goto branch_taken; break; - case 0x37: /* FBGT */ - if (fp_register_sign_bit (rav) == 0 && ! fp_register_zero_p (rav)) + case 0x37: /* FBGT */ + if (fp_register_sign_bit (rav) == 0 && !fp_register_zero_p (rav)) goto branch_taken; break; - case 0x33: /* FBLE */ + case 0x33: /* FBLE */ if (fp_register_sign_bit (rav) == 1 || fp_register_zero_p (rav)) goto branch_taken; break; - case 0x32: /* FBLT */ - if (fp_register_sign_bit (rav) == 1 && ! fp_register_zero_p (rav)) + case 0x32: /* FBLT */ + if (fp_register_sign_bit (rav) == 1 && !fp_register_zero_p (rav)) goto branch_taken; break; - case 0x35: /* FBNE */ - if (! fp_register_zero_p (rav)) + case 0x35: /* FBNE */ + if (!fp_register_zero_p (rav)) goto branch_taken; break; } @@ -1704,10 +1670,9 @@ alpha_software_single_step (struct regcache *regcache) return next_pcs; CORE_ADDR next_pc = alpha_next_pc (regcache, pc); - return {next_pc}; + return { next_pc }; } - /* Initialize the current architecture based on INFO. If possible, re-use an architecture from ARCHES, which is a list of architectures already created during this debugging session. @@ -1737,7 +1702,7 @@ alpha_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) tdep->sc_regs_offset = 4 * 8; tdep->sc_fpregs_offset = tdep->sc_regs_offset + 32 * 8 + 8; - tdep->jb_pc = -1; /* longjmp support not enabled by default. */ + tdep->jb_pc = -1; /* longjmp support not enabled by default. */ tdep->return_in_memory = alpha_return_in_memory_always; @@ -1819,10 +1784,10 @@ alpha_dwarf2_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) } void _initialize_alpha_tdep (); + void _initialize_alpha_tdep () { - gdbarch_register (bfd_arch_alpha, alpha_gdbarch_init, NULL); /* Let the user set the fence post for heuristic_proc_start. */ @@ -1833,9 +1798,11 @@ _initialize_alpha_tdep () /* We need to throw away the frame cache when we set this, since it might change our ability to get backtraces. */ add_setshow_zinteger_cmd ("heuristic-fence-post", class_support, - &heuristic_fence_post, _("\ -Set the distance searched for the start of a function."), _("\ -Show the distance searched for the start of a function."), _("\ + &heuristic_fence_post, _ ("\ +Set the distance searched for the start of a function."), + _ ("\ +Show the distance searched for the start of a function."), + _ ("\ If you are debugging a stripped executable, GDB needs to search through the\n\ program for the start of a function. This command sets the distance of the\n\ search. The only need to set it is when debugging a stripped executable."), diff --git a/gdb/alpha-tdep.h b/gdb/alpha-tdep.h index 9913a08..941eb8f 100644 --- a/gdb/alpha-tdep.h +++ b/gdb/alpha-tdep.h @@ -35,25 +35,25 @@ struct regcache; these values are "real" register numbers, and correspond to the general registers of the machine. */ -#define ALPHA_V0_REGNUM 0 /* Function integer return value */ -#define ALPHA_T7_REGNUM 8 /* Return address register for OSF/1 __add* */ -#define ALPHA_S0_REGNUM 9 /* First saved register */ -#define ALPHA_GCC_FP_REGNUM 15 /* Used by gcc as frame register */ -#define ALPHA_A0_REGNUM 16 /* Loc of first arg during a subr call */ -#define ALPHA_T9_REGNUM 23 /* Return address register for OSF/1 __div* */ -#define ALPHA_RA_REGNUM 26 /* Contains return address value */ -#define ALPHA_T12_REGNUM 27 /* Contains start addr of current proc */ -#define ALPHA_GP_REGNUM 29 /* Contains the global pointer */ -#define ALPHA_SP_REGNUM 30 /* Contains address of top of stack */ -#define ALPHA_ZERO_REGNUM 31 /* Read-only register, always 0 */ -#define ALPHA_FP0_REGNUM 32 /* Floating point register 0 */ -#define ALPHA_FPA0_REGNUM 48 /* First float arg during a subr call */ -#define ALPHA_FPCR_REGNUM 63 /* Floating point control register */ -#define ALPHA_PC_REGNUM 64 /* Contains program counter */ -#define ALPHA_UNIQUE_REGNUM 66 /* PAL_rduniq value */ +#define ALPHA_V0_REGNUM 0 /* Function integer return value */ +#define ALPHA_T7_REGNUM 8 /* Return address register for OSF/1 __add* */ +#define ALPHA_S0_REGNUM 9 /* First saved register */ +#define ALPHA_GCC_FP_REGNUM 15 /* Used by gcc as frame register */ +#define ALPHA_A0_REGNUM 16 /* Loc of first arg during a subr call */ +#define ALPHA_T9_REGNUM 23 /* Return address register for OSF/1 __div* */ +#define ALPHA_RA_REGNUM 26 /* Contains return address value */ +#define ALPHA_T12_REGNUM 27 /* Contains start addr of current proc */ +#define ALPHA_GP_REGNUM 29 /* Contains the global pointer */ +#define ALPHA_SP_REGNUM 30 /* Contains address of top of stack */ +#define ALPHA_ZERO_REGNUM 31 /* Read-only register, always 0 */ +#define ALPHA_FP0_REGNUM 32 /* Floating point register 0 */ +#define ALPHA_FPA0_REGNUM 48 /* First float arg during a subr call */ +#define ALPHA_FPCR_REGNUM 63 /* Floating point control register */ +#define ALPHA_PC_REGNUM 64 /* Contains program counter */ +#define ALPHA_UNIQUE_REGNUM 66 /* PAL_rduniq value */ /* Instruction size. */ -#define ALPHA_INSN_SIZE 4 +#define ALPHA_INSN_SIZE 4 /* The alpha has two different virtual pointers for arguments and locals. @@ -67,12 +67,12 @@ struct regcache; The virtual local pointer is localoff bytes below the virtual frame pointer, the value of localoff is obtained from the PDR. */ -#define ALPHA_NUM_ARG_REGS 6 +#define ALPHA_NUM_ARG_REGS 6 /* Target-dependent structure in gdbarch. */ struct alpha_gdbarch_tdep : gdbarch_tdep_base { - CORE_ADDR vm_min_address = 0; /* Used by alpha_heuristic_proc_start. */ + CORE_ADDR vm_min_address = 0; /* Used by alpha_heuristic_proc_start. */ /* If PC is inside a dynamically-generated signal trampoline function (i.e. one copied onto the user stack at run-time), return how many @@ -88,7 +88,8 @@ struct alpha_gdbarch_tdep : gdbarch_tdep_base look at tramp-frame.h and other simpler per-architecture sigtramp unwinders. */ int (*pc_in_sigtramp) (struct gdbarch *gdbarch, CORE_ADDR pc, - const char *name) = nullptr; + const char *name) + = nullptr; /* If TYPE will be returned in memory, return true. */ int (*return_in_memory) (struct type *type) = nullptr; @@ -98,15 +99,15 @@ struct alpha_gdbarch_tdep : gdbarch_tdep_base int sc_regs_offset = 0; int sc_fpregs_offset = 0; - int jb_pc = 0; /* Offset to PC value in jump buffer. + int jb_pc = 0; /* Offset to PC value in jump buffer. If htis is negative, longjmp support will be disabled. */ - size_t jb_elt_size = 0; /* And the size of each entry in the buf. */ + size_t jb_elt_size = 0; /* And the size of each entry in the buf. */ }; extern unsigned int alpha_read_insn (struct gdbarch *gdbarch, CORE_ADDR pc); -extern std::vector alpha_software_single_step - (struct regcache *regcache); +extern std::vector +alpha_software_single_step (struct regcache *regcache); extern CORE_ADDR alpha_after_prologue (CORE_ADDR pc); extern void alpha_mdebug_init_abi (struct gdbarch_info, struct gdbarch *); @@ -114,11 +115,10 @@ extern void alpha_dwarf2_init_abi (struct gdbarch_info, struct gdbarch *); extern void alpha_supply_int_regs (struct regcache *, int, const void *, const void *, const void *); -extern void alpha_fill_int_regs (const struct regcache *, int, - void *, void *, void *); -extern void alpha_supply_fp_regs (struct regcache *, int, - const void *, const void *); -extern void alpha_fill_fp_regs (const struct regcache *, - int, void *, void *); +extern void alpha_fill_int_regs (const struct regcache *, int, void *, void *, + void *); +extern void alpha_supply_fp_regs (struct regcache *, int, const void *, + const void *); +extern void alpha_fill_fp_regs (const struct regcache *, int, void *, void *); #endif /* ALPHA_TDEP_H */ diff --git a/gdb/amd-dbgapi-target.c b/gdb/amd-dbgapi-target.c index 5f7de52..3c036c1 100644 --- a/gdb/amd-dbgapi-target.c +++ b/gdb/amd-dbgapi-target.c @@ -43,7 +43,7 @@ make_green (const char *s) { cli_style_option style (nullptr, ui_file_style::GREEN); string_file sf (true); - gdb_printf (&sf, "%ps", styled_string (style.style(), s)); + gdb_printf (&sf, "%ps", styled_string (style.style (), s)); return sf.release (); } @@ -52,8 +52,7 @@ make_green (const char *s) amd-dbgapi library. */ static const char *amd_dbgapi_debug_module_unstyled = "amd-dbgapi"; -static const char *amd_dbgapi_lib_debug_module_unstyled - = "amd-dbgapi-lib"; +static const char *amd_dbgapi_lib_debug_module_unstyled = "amd-dbgapi-lib"; /* Styled variants of the above. */ @@ -87,16 +86,15 @@ amd_dbgapi_lib_debug_module () /* Print an amd-dbgapi debug statement. */ -#define amd_dbgapi_debug_printf(fmt, ...) \ - debug_prefixed_printf_cond (debug_amd_dbgapi, \ - amd_dbgapi_debug_module (), \ +#define amd_dbgapi_debug_printf(fmt, ...) \ + debug_prefixed_printf_cond (debug_amd_dbgapi, amd_dbgapi_debug_module (), \ fmt, ##__VA_ARGS__) /* Print amd-dbgapi start/end debug statements. */ -#define AMD_DBGAPI_SCOPED_DEBUG_START_END(fmt, ...) \ - scoped_debug_start_end (debug_infrun, amd_dbgapi_debug_module (), \ - fmt, ##__VA_ARGS__) +#define AMD_DBGAPI_SCOPED_DEBUG_START_END(fmt, ...) \ + scoped_debug_start_end (debug_infrun, amd_dbgapi_debug_module (), fmt, \ + ##__VA_ARGS__) /* inferior_created observer token. */ @@ -108,7 +106,6 @@ get_amd_dbgapi_target_inferior_created_observer_token () return amd_dbgapi_target_inferior_created_observer_token; } - /* Big enough to hold the size of the largest register in bytes. */ #define AMDGPU_MAX_REGISTER_SIZE 256 @@ -118,7 +115,8 @@ struct amd_dbgapi_inferior_info { explicit amd_dbgapi_inferior_info (inferior *inf) : inf (inf) - {} + { + } /* Backlink to inferior. */ inferior *inf; @@ -147,30 +145,21 @@ struct amd_dbgapi_inferior_info std::list> wave_events; }; -static amd_dbgapi_event_id_t process_event_queue - (amd_dbgapi_process_id_t process_id = AMD_DBGAPI_PROCESS_NONE, - amd_dbgapi_event_kind_t until_event_kind = AMD_DBGAPI_EVENT_KIND_NONE); +static amd_dbgapi_event_id_t process_event_queue ( + amd_dbgapi_process_id_t process_id = AMD_DBGAPI_PROCESS_NONE, + amd_dbgapi_event_kind_t until_event_kind = AMD_DBGAPI_EVENT_KIND_NONE); -static const target_info amd_dbgapi_target_info = { - "amd-dbgapi", - N_("AMD Debugger API"), - N_("GPU debugging using the AMD Debugger API") -}; +static const target_info amd_dbgapi_target_info + = { "amd-dbgapi", N_ ("AMD Debugger API"), + N_ ("GPU debugging using the AMD Debugger API") }; static amd_dbgapi_log_level_t get_debug_amd_dbgapi_lib_log_level (); struct amd_dbgapi_target final : public target_ops { - const target_info & - info () const override - { - return amd_dbgapi_target_info; - } - strata - stratum () const override - { - return arch_stratum; - } + const target_info &info () const override { return amd_dbgapi_target_info; } + + strata stratum () const override { return arch_stratum; } void close () override; void mourn_inferior () override; @@ -213,6 +202,7 @@ struct amd_dbgapi_target final : public target_ops bool stopped_by_hw_breakpoint () override; private: + /* True if we must report thread events. */ bool m_report_thread_events = false; @@ -256,37 +246,38 @@ wave_target_id_string (amd_dbgapi_wave_id_t wave_id) = amd_dbgapi_wave_get_info (wave_id, AMD_DBGAPI_WAVE_INFO_AGENT, sizeof (agent_id), &agent_id); str += (status == AMD_DBGAPI_STATUS_SUCCESS - ? string_printf (" %ld", agent_id.handle) - : " ?"); + ? string_printf (" %ld", agent_id.handle) + : " ?"); status = amd_dbgapi_wave_get_info (wave_id, AMD_DBGAPI_WAVE_INFO_QUEUE, sizeof (queue_id), &queue_id); str += (status == AMD_DBGAPI_STATUS_SUCCESS - ? string_printf (":%ld", queue_id.handle) - : ":?"); + ? string_printf (":%ld", queue_id.handle) + : ":?"); status = amd_dbgapi_wave_get_info (wave_id, AMD_DBGAPI_WAVE_INFO_DISPATCH, sizeof (dispatch_id), &dispatch_id); str += (status == AMD_DBGAPI_STATUS_SUCCESS - ? string_printf (":%ld", dispatch_id.handle) - : ":?"); + ? string_printf (":%ld", dispatch_id.handle) + : ":?"); str += string_printf (":%ld", wave_id.handle); - status = amd_dbgapi_wave_get_info (wave_id, - AMD_DBGAPI_WAVE_INFO_WORKGROUP_COORD, - sizeof (group_ids), &group_ids); + status + = amd_dbgapi_wave_get_info (wave_id, AMD_DBGAPI_WAVE_INFO_WORKGROUP_COORD, + sizeof (group_ids), &group_ids); str += (status == AMD_DBGAPI_STATUS_SUCCESS - ? string_printf (" (%d,%d,%d)", group_ids[0], group_ids[1], - group_ids[2]) - : " (?,?,?)"); - - status = amd_dbgapi_wave_get_info - (wave_id, AMD_DBGAPI_WAVE_INFO_WAVE_NUMBER_IN_WORKGROUP, - sizeof (wave_in_group), &wave_in_group); + ? string_printf (" (%d,%d,%d)", group_ids[0], group_ids[1], + group_ids[2]) + : " (?,?,?)"); + + status + = amd_dbgapi_wave_get_info (wave_id, + AMD_DBGAPI_WAVE_INFO_WAVE_NUMBER_IN_WORKGROUP, + sizeof (wave_in_group), &wave_in_group); str += (status == AMD_DBGAPI_STATUS_SUCCESS - ? string_printf ("/%d", wave_in_group) - : "/?"); + ? string_printf ("/%d", wave_in_group) + : "/?"); return str; } @@ -343,11 +334,9 @@ require_forward_progress (ptid_t ptid, process_stratum_target *proc_target, if (info->forward_progress_required == require) continue; - amd_dbgapi_status_t status - = amd_dbgapi_process_set_progress - (info->process_id, (require - ? AMD_DBGAPI_PROGRESS_NORMAL - : AMD_DBGAPI_PROGRESS_NO_FORWARD)); + amd_dbgapi_status_t status = amd_dbgapi_process_set_progress ( + info->process_id, (require ? AMD_DBGAPI_PROGRESS_NORMAL + : AMD_DBGAPI_PROGRESS_NO_FORWARD)); gdb_assert (status == AMD_DBGAPI_STATUS_SUCCESS); info->forward_progress_required = require; @@ -407,28 +396,29 @@ amd_dbgapi_target_breakpoint::check_status (struct bpstat *bs) /* Find the address the breakpoint is set at. */ auto match_breakpoint - = [bs] (const decltype (info->breakpoint_map)::value_type &value) - { return value.second == bs->breakpoint_at; }; - auto it - = std::find_if (info->breakpoint_map.begin (), info->breakpoint_map.end (), - match_breakpoint); + = [bs] (const decltype (info->breakpoint_map)::value_type &value) { + return value.second == bs->breakpoint_at; + }; + auto it = std::find_if (info->breakpoint_map.begin (), + info->breakpoint_map.end (), match_breakpoint); if (it == info->breakpoint_map.end ()) - error (_("Could not find breakpoint_id for breakpoint at %s"), + error (_ ("Could not find breakpoint_id for breakpoint at %s"), paddress (inf->gdbarch, bs->bp_location_at->address)); amd_dbgapi_breakpoint_id_t breakpoint_id { it->first }; amd_dbgapi_breakpoint_action_t action; - status = amd_dbgapi_report_breakpoint_hit - (breakpoint_id, - reinterpret_cast (inferior_thread ()), - &action); + status = amd_dbgapi_report_breakpoint_hit ( + breakpoint_id, + reinterpret_cast (inferior_thread ()), + &action); if (status != AMD_DBGAPI_STATUS_SUCCESS) - error (_("amd_dbgapi_report_breakpoint_hit failed for breakpoint %ld " - "at %s (%s)"), - breakpoint_id.handle, paddress (inf->gdbarch, bs->bp_location_at->address), + error (_ ("amd_dbgapi_report_breakpoint_hit failed for breakpoint %ld " + "at %s (%s)"), + breakpoint_id.handle, + paddress (inf->gdbarch, bs->bp_location_at->address), get_status_string (status)); if (action == AMD_DBGAPI_BREAKPOINT_ACTION_RESUME) @@ -451,13 +441,14 @@ amd_dbgapi_target_breakpoint::check_status (struct bpstat *bs) &resume_breakpoint_id); if (status != AMD_DBGAPI_STATUS_SUCCESS) - error (_("amd_dbgapi_event_get_info failed (%s)"), get_status_string (status)); + error (_ ("amd_dbgapi_event_get_info failed (%s)"), + get_status_string (status)); /* The debugger API guarantees that [breakpoint_hit...resume_breakpoint] sequences cannot interleave, so this breakpoint resume event must be for our breakpoint_id. */ if (resume_breakpoint_id != breakpoint_id) - error (_("breakpoint resume event is not for this breakpoint. " + error (_ ("breakpoint resume event is not for this breakpoint. " "Expected breakpoint_%ld, got breakpoint_%ld"), breakpoint_id.handle, resume_breakpoint_id.handle); @@ -509,9 +500,9 @@ amd_dbgapi_target::extra_thread_info (thread_info *tp) target_xfer_status amd_dbgapi_target::xfer_partial (enum target_object object, const char *annex, - gdb_byte *readbuf, const gdb_byte *writebuf, - ULONGEST offset, ULONGEST requested_len, - ULONGEST *xfered_len) + gdb_byte *readbuf, const gdb_byte *writebuf, + ULONGEST offset, ULONGEST requested_len, + ULONGEST *xfered_len) { gdb::optional maybe_restore_thread; @@ -534,12 +525,12 @@ amd_dbgapi_target::xfer_partial (enum target_object object, const char *annex, if (readbuf != nullptr) status = amd_dbgapi_read_memory (process_id, wave_id, 0, - AMD_DBGAPI_ADDRESS_SPACE_GLOBAL, - offset, &len, readbuf); + AMD_DBGAPI_ADDRESS_SPACE_GLOBAL, offset, + &len, readbuf); else status = amd_dbgapi_write_memory (process_id, wave_id, 0, - AMD_DBGAPI_ADDRESS_SPACE_GLOBAL, - offset, &len, writebuf); + AMD_DBGAPI_ADDRESS_SPACE_GLOBAL, offset, + &len, writebuf); if (status != AMD_DBGAPI_STATUS_SUCCESS) return TARGET_XFER_E_IO; @@ -560,7 +551,8 @@ amd_dbgapi_target::stopped_by_watchpoint () void amd_dbgapi_target::resume (ptid_t scope_ptid, int step, enum gdb_signal signo) { - amd_dbgapi_debug_printf ("scope_ptid = %s", scope_ptid.to_string ().c_str ()); + amd_dbgapi_debug_printf ("scope_ptid = %s", + scope_ptid.to_string ().c_str ()); /* The amd_dbgapi_exceptions_t matching SIGNO will only be used if the thread which is the target of the signal SIGNO is a GPU thread. If so, @@ -593,7 +585,7 @@ amd_dbgapi_target::resume (ptid_t scope_ptid, int step, enum gdb_signal signo) exception = AMD_DBGAPI_EXCEPTION_NONE; break; default: - error (_("Resuming with signal %s is not supported by this agent."), + error (_ ("Resuming with signal %s is not supported by this agent."), gdb_signal_to_name (signo)); } } @@ -620,21 +612,22 @@ amd_dbgapi_target::resume (ptid_t scope_ptid, int step, enum gdb_signal signo) amd_dbgapi_wave_id_t wave_id = get_amd_dbgapi_wave_id (thread->ptid); amd_dbgapi_status_t status; if (thread->ptid == inferior_ptid) - status = amd_dbgapi_wave_resume (wave_id, - (step - ? AMD_DBGAPI_RESUME_MODE_SINGLE_STEP + status + = amd_dbgapi_wave_resume (wave_id, + (step ? AMD_DBGAPI_RESUME_MODE_SINGLE_STEP : AMD_DBGAPI_RESUME_MODE_NORMAL), - exception); + exception); else - status = amd_dbgapi_wave_resume (wave_id, AMD_DBGAPI_RESUME_MODE_NORMAL, - AMD_DBGAPI_EXCEPTION_NONE); + status + = amd_dbgapi_wave_resume (wave_id, AMD_DBGAPI_RESUME_MODE_NORMAL, + AMD_DBGAPI_EXCEPTION_NONE); if (status != AMD_DBGAPI_STATUS_SUCCESS /* Ignore the error that wave is no longer valid as that could indicate that the process has exited. GDB treats resuming a thread that no longer exists as being successful. */ && status != AMD_DBGAPI_STATUS_ERROR_INVALID_WAVE_ID) - error (_("wave_resume for wave_%ld failed (%s)"), wave_id.handle, + error (_ ("wave_resume for wave_%ld failed (%s)"), wave_id.handle, get_status_string (status)); } } @@ -666,48 +659,48 @@ amd_dbgapi_target::stop (ptid_t ptid) return; } - auto stop_one_thread = [this] (thread_info *thread) - { - gdb_assert (thread != nullptr); + auto stop_one_thread = [this] (thread_info *thread) { + gdb_assert (thread != nullptr); - amd_dbgapi_wave_id_t wave_id = get_amd_dbgapi_wave_id (thread->ptid); - amd_dbgapi_wave_state_t state; - amd_dbgapi_status_t status - = amd_dbgapi_wave_get_info (wave_id, AMD_DBGAPI_WAVE_INFO_STATE, - sizeof (state), &state); - if (status == AMD_DBGAPI_STATUS_SUCCESS) - { - /* If the wave is already known to be stopped then do nothing. */ - if (state == AMD_DBGAPI_WAVE_STATE_STOP) - return; + amd_dbgapi_wave_id_t wave_id = get_amd_dbgapi_wave_id (thread->ptid); + amd_dbgapi_wave_state_t state; + amd_dbgapi_status_t status + = amd_dbgapi_wave_get_info (wave_id, AMD_DBGAPI_WAVE_INFO_STATE, + sizeof (state), &state); + if (status == AMD_DBGAPI_STATUS_SUCCESS) + { + /* If the wave is already known to be stopped then do nothing. */ + if (state == AMD_DBGAPI_WAVE_STATE_STOP) + return; - status = amd_dbgapi_wave_stop (wave_id); - if (status == AMD_DBGAPI_STATUS_SUCCESS) - return; + status = amd_dbgapi_wave_stop (wave_id); + if (status == AMD_DBGAPI_STATUS_SUCCESS) + return; - if (status != AMD_DBGAPI_STATUS_ERROR_INVALID_WAVE_ID) - error (_("wave_stop for wave_%ld failed (%s)"), wave_id.handle, - get_status_string (status)); - } - else if (status != AMD_DBGAPI_STATUS_ERROR_INVALID_WAVE_ID) - error (_("wave_get_info for wave_%ld failed (%s)"), wave_id.handle, - get_status_string (status)); + if (status != AMD_DBGAPI_STATUS_ERROR_INVALID_WAVE_ID) + error (_ ("wave_stop for wave_%ld failed (%s)"), wave_id.handle, + get_status_string (status)); + } + else if (status != AMD_DBGAPI_STATUS_ERROR_INVALID_WAVE_ID) + error (_ ("wave_get_info for wave_%ld failed (%s)"), wave_id.handle, + get_status_string (status)); - /* The status is AMD_DBGAPI_STATUS_ERROR_INVALID_WAVE_ID. The wave + /* The status is AMD_DBGAPI_STATUS_ERROR_INVALID_WAVE_ID. The wave could have terminated since the last time the wave list was refreshed. */ - if (m_report_thread_events) - { - get_amd_dbgapi_inferior_info (thread->inf)->wave_events.emplace_back - (thread->ptid, target_waitstatus ().set_thread_exited (0)); + if (m_report_thread_events) + { + get_amd_dbgapi_inferior_info (thread->inf) + ->wave_events.emplace_back ( + thread->ptid, target_waitstatus ().set_thread_exited (0)); - if (target_is_async_p ()) - async_event_handler_mark (); - } + if (target_is_async_p ()) + async_event_handler_mark (); + } - delete_thread_silent (thread); - }; + delete_thread_silent (thread); + }; process_stratum_target *proc_target = current_inferior ()->process_target (); @@ -751,13 +744,14 @@ struct scoped_amd_dbgapi_event_processed { amd_dbgapi_status_t status = amd_dbgapi_event_processed (m_event_id); if (status != AMD_DBGAPI_STATUS_SUCCESS) - warning (_("Failed to acknowledge amd-dbgapi event %" PRIu64), + warning (_ ("Failed to acknowledge amd-dbgapi event %" PRIu64), m_event_id.handle); } DISABLE_COPY_AND_ASSIGN (scoped_amd_dbgapi_event_processed); private: + amd_dbgapi_event_id_t m_event_id; }; @@ -798,7 +792,8 @@ dbgapi_notifier_handler (int err, gdb_client_data client_data) = amd_dbgapi_process_next_pending_event (info->process_id, &event_id, &event_kind); if (status != AMD_DBGAPI_STATUS_SUCCESS) - error (_("next_pending_event failed (%s)"), get_status_string (status)); + error (_ ("next_pending_event failed (%s)"), + get_status_string (status)); if (event_id == AMD_DBGAPI_EVENT_NONE) return; @@ -808,18 +803,19 @@ dbgapi_notifier_handler (int err, gdb_client_data client_data) scoped_amd_dbgapi_event_processed mark_event_processed (event_id); amd_dbgapi_runtime_state_t runtime_state; - status = amd_dbgapi_event_get_info (event_id, - AMD_DBGAPI_EVENT_INFO_RUNTIME_STATE, - sizeof (runtime_state), - &runtime_state); + status + = amd_dbgapi_event_get_info (event_id, + AMD_DBGAPI_EVENT_INFO_RUNTIME_STATE, + sizeof (runtime_state), &runtime_state); if (status != AMD_DBGAPI_STATUS_SUCCESS) - error (_("event_get_info for event_%ld failed (%s)"), - event_id.handle, get_status_string (status)); + error (_ ("event_get_info for event_%ld failed (%s)"), event_id.handle, + get_status_string (status)); switch (runtime_state) { case AMD_DBGAPI_RUNTIME_STATE_LOADED_SUCCESS: - gdb_assert (info->runtime_state == AMD_DBGAPI_RUNTIME_STATE_UNLOADED); + gdb_assert (info->runtime_state + == AMD_DBGAPI_RUNTIME_STATE_UNLOADED); info->runtime_state = runtime_state; amd_dbgapi_debug_printf ("pushing amd-dbgapi target"); info->inf->push_target (&the_amd_dbgapi_target); @@ -843,10 +839,11 @@ dbgapi_notifier_handler (int err, gdb_client_data client_data) break; case AMD_DBGAPI_RUNTIME_STATE_LOADED_ERROR_RESTRICTION: - gdb_assert (info->runtime_state == AMD_DBGAPI_RUNTIME_STATE_UNLOADED); + gdb_assert (info->runtime_state + == AMD_DBGAPI_RUNTIME_STATE_UNLOADED); info->runtime_state = runtime_state; - warning (_("amd-dbgapi: unable to enable GPU debugging " - "due to a restriction error")); + warning (_ ("amd-dbgapi: unable to enable GPU debugging " + "due to a restriction error")); break; } } @@ -911,7 +908,7 @@ amd_dbgapi_target::async (bool enable) static ptid_t make_gpu_ptid (ptid_t::pid_type pid, amd_dbgapi_wave_id_t wave_id) { - return ptid_t (pid, 1, wave_id.handle); + return ptid_t (pid, 1, wave_id.handle); } /* Process an event that was just pulled out of the amd-dbgapi library. */ @@ -928,15 +925,15 @@ process_one_event (amd_dbgapi_event_id_t event_id, = amd_dbgapi_event_get_info (event_id, AMD_DBGAPI_EVENT_INFO_PROCESS, sizeof (process_id), &process_id); if (status != AMD_DBGAPI_STATUS_SUCCESS) - error (_("event_get_info for event_%ld failed (%s)"), event_id.handle, + error (_ ("event_get_info for event_%ld failed (%s)"), event_id.handle, get_status_string (status)); amd_dbgapi_os_process_id_t pid; - status = amd_dbgapi_process_get_info (process_id, - AMD_DBGAPI_PROCESS_INFO_OS_ID, - sizeof (pid), &pid); + status + = amd_dbgapi_process_get_info (process_id, AMD_DBGAPI_PROCESS_INFO_OS_ID, + sizeof (pid), &pid); if (status != AMD_DBGAPI_STATUS_SUCCESS) - error (_("process_get_info for process_%ld failed (%s)"), + error (_ ("process_get_info for process_%ld failed (%s)"), process_id.handle, get_status_string (status)); auto *proc_target = current_inferior ()->process_target (); @@ -954,7 +951,7 @@ process_one_event (amd_dbgapi_event_id_t event_id, = amd_dbgapi_event_get_info (event_id, AMD_DBGAPI_EVENT_INFO_WAVE, sizeof (wave_id), &wave_id); if (status != AMD_DBGAPI_STATUS_SUCCESS) - error (_("event_get_info for event_%ld failed (%s)"), + error (_ ("event_get_info for event_%ld failed (%s)"), event_id.handle, get_status_string (status)); ptid_t event_ptid = make_gpu_ptid (pid, wave_id); @@ -1025,8 +1022,8 @@ process_one_event (amd_dbgapi_event_id_t event_id, } } else - error (_("wave_get_info for wave_%ld failed (%s)"), - wave_id.handle, get_status_string (status)); + error (_ ("wave_get_info for wave_%ld failed (%s)"), wave_id.handle, + get_status_string (status)); info->wave_events.emplace_back (event_ptid, ws); break; @@ -1060,17 +1057,17 @@ process_one_event (amd_dbgapi_event_id_t event_id, { amd_dbgapi_runtime_state_t runtime_state; - status = amd_dbgapi_event_get_info (event_id, - AMD_DBGAPI_EVENT_INFO_RUNTIME_STATE, - sizeof (runtime_state), - &runtime_state); + status + = amd_dbgapi_event_get_info (event_id, + AMD_DBGAPI_EVENT_INFO_RUNTIME_STATE, + sizeof (runtime_state), &runtime_state); if (status != AMD_DBGAPI_STATUS_SUCCESS) - error (_("event_get_info for event_%ld failed (%s)"), + error (_ ("event_get_info for event_%ld failed (%s)"), event_id.handle, get_status_string (status)); gdb_assert (runtime_state == AMD_DBGAPI_RUNTIME_STATE_UNLOADED); - gdb_assert - (info->runtime_state == AMD_DBGAPI_RUNTIME_STATE_LOADED_SUCCESS); + gdb_assert (info->runtime_state + == AMD_DBGAPI_RUNTIME_STATE_LOADED_SUCCESS); info->runtime_state = runtime_state; @@ -1080,7 +1077,7 @@ process_one_event (amd_dbgapi_event_id_t event_id, break; default: - error (_("event kind (%d) not supported"), event_kind); + error (_ ("event kind (%d) not supported"), event_kind); } } @@ -1141,14 +1138,14 @@ process_event_queue (amd_dbgapi_process_id_t process_id, &event_kind); if (status != AMD_DBGAPI_STATUS_SUCCESS) - error (_("next_pending_event failed (%s)"), get_status_string (status)); + error (_ ("next_pending_event failed (%s)"), + get_status_string (status)); if (event_kind != AMD_DBGAPI_EVENT_KIND_NONE) amd_dbgapi_debug_printf ("Pulled event from dbgapi: " "event_id.handle = %" PRIu64 ", " "event_kind = %s", - event_id.handle, - event_kind_str (event_kind)); + event_id.handle, event_kind_str (event_kind)); if (event_id == AMD_DBGAPI_EVENT_NONE || event_kind == until_event_kind) return event_id; @@ -1207,7 +1204,7 @@ consume_one_event (int pid) ptid_t amd_dbgapi_target::wait (ptid_t ptid, struct target_waitstatus *ws, - target_wait_flags target_options) + target_wait_flags target_options) { gdb_assert (!current_inferior ()->process_target ()->commit_resumed_state); gdb_assert (ptid == minus_one_ptid || ptid.is_pid ()); @@ -1219,12 +1216,11 @@ amd_dbgapi_target::wait (ptid_t ptid, struct target_waitstatus *ws, { if (ws->kind () == TARGET_WAITKIND_EXITED || ws->kind () == TARGET_WAITKIND_SIGNALLED) - { - /* This inferior has exited so drain its dbgapi event queue. */ - while (consume_one_event (event_ptid.pid ()).first - != minus_one_ptid) - ; - } + { + /* This inferior has exited so drain its dbgapi event queue. */ + while (consume_one_event (event_ptid.pid ()).first != minus_one_ptid) + ; + } return event_ptid; } @@ -1239,11 +1235,10 @@ amd_dbgapi_target::wait (ptid_t ptid, struct target_waitstatus *ws, that we need to fetch from dbgapi. Mark the async event handler so that amd_dbgapi_target::wait gets called again and again, until it eventually returns minus_one_ptid. */ - auto more_events = make_scope_exit ([] () - { - if (target_is_async_p ()) - async_event_handler_mark (); - }); + auto more_events = make_scope_exit ([] () { + if (target_is_async_p ()) + async_event_handler_mark (); + }); auto *proc_target = current_inferior ()->process_target (); @@ -1338,8 +1333,8 @@ attach_amd_dbgapi (inferior *inf) if (!target_can_async_p ()) { - warning (_("The amd-dbgapi target requires the target beneath to be " - "asynchronous, GPU debugging is disabled")); + warning (_ ("The amd-dbgapi target requires the target beneath to be " + "asynchronous, GPU debugging is disabled")); return; } @@ -1348,26 +1343,24 @@ attach_amd_dbgapi (inferior *inf) /* Are we already attached? */ if (info->process_id != AMD_DBGAPI_PROCESS_NONE) { - amd_dbgapi_debug_printf - ("already attached: process_id = %" PRIu64, info->process_id.handle); + amd_dbgapi_debug_printf ("already attached: process_id = %" PRIu64, + info->process_id.handle); return; } - amd_dbgapi_status_t status - = amd_dbgapi_process_attach - (reinterpret_cast (inf), - &info->process_id); + amd_dbgapi_status_t status = amd_dbgapi_process_attach ( + reinterpret_cast (inf), &info->process_id); if (status == AMD_DBGAPI_STATUS_ERROR_RESTRICTION) { - warning (_("amd-dbgapi: unable to enable GPU debugging due to a " - "restriction error")); + warning (_ ("amd-dbgapi: unable to enable GPU debugging due to a " + "restriction error")); return; } else if (status != AMD_DBGAPI_STATUS_SUCCESS) { - warning (_("amd-dbgapi: could not attach to process %d (%s), GPU " - "debugging will not be available."), inf->pid, - get_status_string (status)); + warning (_ ("amd-dbgapi: could not attach to process %d (%s), GPU " + "debugging will not be available."), + inf->pid, get_status_string (status)); return; } @@ -1378,8 +1371,9 @@ attach_amd_dbgapi (inferior *inf) { amd_dbgapi_process_detach (info->process_id); info->process_id = AMD_DBGAPI_PROCESS_NONE; - warning (_("amd-dbgapi: could not retrieve process %d's notifier, GPU " - "debugging will not be available."), inf->pid); + warning (_ ("amd-dbgapi: could not retrieve process %d's notifier, GPU " + "debugging will not be available."), + inf->pid); return; } @@ -1417,8 +1411,8 @@ detach_amd_dbgapi (inferior *inf) amd_dbgapi_status_t status = amd_dbgapi_process_detach (info->process_id); if (status != AMD_DBGAPI_STATUS_SUCCESS) - warning (_("amd-dbgapi: could not detach from process %d (%s)"), - inf->pid, get_status_string (status)); + warning (_ ("amd-dbgapi: could not detach from process %d (%s)"), inf->pid, + get_status_string (status)); gdb_assert (info->notifier != -1); delete_file_handler (info->notifier); @@ -1481,7 +1475,7 @@ amd_dbgapi_target::fetch_registers (struct regcache *regcache, int regno) if (status == AMD_DBGAPI_STATUS_SUCCESS) regcache->raw_supply (regno, raw); else if (status != AMD_DBGAPI_STATUS_ERROR_REGISTER_NOT_AVAILABLE) - warning (_("Couldn't read register %s (#%d) (%s)."), + warning (_ ("Couldn't read register %s (#%d) (%s)."), gdbarch_register_name (gdbarch, regno), regno, get_status_string (status)); } @@ -1516,7 +1510,8 @@ amd_dbgapi_target::store_registers (struct regcache *regcache, int regno) & AMD_DBGAPI_REGISTER_PROPERTY_INVALIDATE_VOLATILE) { for (size_t r = 0; r < tdep->register_properties.size (); ++r) - if (tdep->register_properties[r] & AMD_DBGAPI_REGISTER_PROPERTY_VOLATILE) + if (tdep->register_properties[r] + & AMD_DBGAPI_REGISTER_PROPERTY_VOLATILE) regcache->invalidate (r); } @@ -1527,7 +1522,7 @@ amd_dbgapi_target::store_registers (struct regcache *regcache, int regno) raw); if (status != AMD_DBGAPI_STATUS_SUCCESS) - warning (_("Couldn't write register %s (#%d)."), + warning (_ ("Couldn't write register %s (#%d)."), gdbarch_register_name (gdbarch, regno), regno); } @@ -1546,18 +1541,18 @@ amd_dbgapi_target::thread_architecture (ptid_t ptid) amd_dbgapi_architecture_id_t architecture_id; amd_dbgapi_status_t status; - status = amd_dbgapi_wave_get_info (wave_id, AMD_DBGAPI_WAVE_INFO_ARCHITECTURE, - sizeof (architecture_id), - &architecture_id); + status + = amd_dbgapi_wave_get_info (wave_id, AMD_DBGAPI_WAVE_INFO_ARCHITECTURE, + sizeof (architecture_id), &architecture_id); if (status != AMD_DBGAPI_STATUS_SUCCESS) - error (_("Couldn't get architecture for wave_%ld"), ptid.tid ()); + error (_ ("Couldn't get architecture for wave_%ld"), ptid.tid ()); uint32_t elf_amdgpu_machine; - status = amd_dbgapi_architecture_get_info - (architecture_id, AMD_DBGAPI_ARCHITECTURE_INFO_ELF_AMDGPU_MACHINE, - sizeof (elf_amdgpu_machine), &elf_amdgpu_machine); + status = amd_dbgapi_architecture_get_info ( + architecture_id, AMD_DBGAPI_ARCHITECTURE_INFO_ELF_AMDGPU_MACHINE, + sizeof (elf_amdgpu_machine), &elf_amdgpu_machine); if (status != AMD_DBGAPI_STATUS_SUCCESS) - error (_("Couldn't get elf_amdgpu_machine for architecture_%ld"), + error (_ ("Couldn't get elf_amdgpu_machine for architecture_%ld"), architecture_id.handle); struct gdbarch_info info; @@ -1567,7 +1562,7 @@ amd_dbgapi_target::thread_architecture (ptid_t ptid) m_cached_arch_tid = ptid.tid (); m_cached_arch = gdbarch_find_by_info (info); if (m_cached_arch == nullptr) - error (_("Couldn't get elf_amdgpu_machine (%#x)"), elf_amdgpu_machine); + error (_ ("Couldn't get elf_amdgpu_machine (%#x)"), elf_amdgpu_machine); return m_cached_arch; } @@ -1584,8 +1579,7 @@ amd_dbgapi_target::update_thread_list () { for (inferior *inf : all_inferiors ()) { - amd_dbgapi_process_id_t process_id - = get_amd_dbgapi_process_id (inf); + amd_dbgapi_process_id_t process_id = get_amd_dbgapi_process_id (inf); if (process_id == AMD_DBGAPI_PROCESS_NONE) { /* The inferior may not be attached yet. */ @@ -1599,7 +1593,7 @@ amd_dbgapi_target::update_thread_list () = amd_dbgapi_process_wave_list (process_id, &count, &wave_list, &changed); if (status != AMD_DBGAPI_STATUS_SUCCESS) - error (_("amd_dbgapi_wave_list failed (%s)"), + error (_ ("amd_dbgapi_wave_list failed (%s)"), get_status_string (status)); if (changed == AMD_DBGAPI_CHANGED_NO) @@ -1630,7 +1624,7 @@ amd_dbgapi_target::update_thread_list () for (ptid_t::tid_type tid : threads) { ptid_t wave_ptid - = make_gpu_ptid (inf->pid, amd_dbgapi_wave_id_t {tid}); + = make_gpu_ptid (inf->pid, amd_dbgapi_wave_id_t { tid }); add_thread_silent (inf->process_target (), wave_ptid); set_running (inf->process_target (), wave_ptid, true); @@ -1681,8 +1675,8 @@ amd_dbgapi_inferior_pre_detach (inferior *inf) /* get_os_pid callback. */ static amd_dbgapi_status_t -amd_dbgapi_get_os_pid_callback - (amd_dbgapi_client_process_id_t client_process_id, pid_t *pid) +amd_dbgapi_get_os_pid_callback ( + amd_dbgapi_client_process_id_t client_process_id, pid_t *pid) { inferior *inf = reinterpret_cast (client_process_id); @@ -1696,10 +1690,10 @@ amd_dbgapi_get_os_pid_callback /* insert_breakpoint callback. */ static amd_dbgapi_status_t -amd_dbgapi_insert_breakpoint_callback - (amd_dbgapi_client_process_id_t client_process_id, - amd_dbgapi_global_address_t address, - amd_dbgapi_breakpoint_id_t breakpoint_id) +amd_dbgapi_insert_breakpoint_callback ( + amd_dbgapi_client_process_id_t client_process_id, + amd_dbgapi_global_address_t address, + amd_dbgapi_breakpoint_id_t breakpoint_id) { inferior *inf = reinterpret_cast (client_process_id); struct amd_dbgapi_inferior_info *info = get_amd_dbgapi_inferior_info (inf); @@ -1717,8 +1711,8 @@ amd_dbgapi_insert_breakpoint_callback if (section == nullptr || section->objfile == nullptr) return AMD_DBGAPI_STATUS_ERROR; - std::unique_ptr bp_up - (new amd_dbgapi_target_breakpoint (section->objfile->arch (), address)); + std::unique_ptr bp_up ( + new amd_dbgapi_target_breakpoint (section->objfile->arch (), address)); breakpoint *bp = install_breakpoint (true, std::move (bp_up), 1); @@ -1729,9 +1723,9 @@ amd_dbgapi_insert_breakpoint_callback /* remove_breakpoint callback. */ static amd_dbgapi_status_t -amd_dbgapi_remove_breakpoint_callback - (amd_dbgapi_client_process_id_t client_process_id, - amd_dbgapi_breakpoint_id_t breakpoint_id) +amd_dbgapi_remove_breakpoint_callback ( + amd_dbgapi_client_process_id_t client_process_id, + amd_dbgapi_breakpoint_id_t breakpoint_id) { inferior *inf = reinterpret_cast (client_process_id); struct amd_dbgapi_inferior_info *info = get_amd_dbgapi_inferior_info (inf); @@ -1748,14 +1742,14 @@ amd_dbgapi_remove_breakpoint_callback /* Style for some kinds of messages. */ -static cli_style_option fatal_error_style - ("amd_dbgapi_fatal_error", ui_file_style::RED); -static cli_style_option warning_style - ("amd_dbgapi_warning", ui_file_style::YELLOW); +static cli_style_option fatal_error_style ("amd_dbgapi_fatal_error", + ui_file_style::RED); +static cli_style_option warning_style ("amd_dbgapi_warning", + ui_file_style::YELLOW); /* BLACK + BOLD means dark gray. */ -static cli_style_option trace_style - ("amd_dbgapi_trace", ui_file_style::BLACK, ui_file_style::BOLD); +static cli_style_option trace_style ("amd_dbgapi_trace", ui_file_style::BLACK, + ui_file_style::BOLD); /* log_message callback. */ @@ -1776,8 +1770,10 @@ amd_dbgapi_log_message_callback (amd_dbgapi_log_level_t level, || level == AMD_DBGAPI_LOG_LEVEL_WARNING) { begin_line (); - ui_file_style style = (level == AMD_DBGAPI_LOG_LEVEL_FATAL_ERROR - ? fatal_error_style : warning_style).style (); + ui_file_style style + = (level == AMD_DBGAPI_LOG_LEVEL_FATAL_ERROR ? fatal_error_style + : warning_style) + .style (); gdb_printf (gdb_stderr, "%ps\n", styled_string (style, message)); return; } @@ -1820,8 +1816,7 @@ struct cmd_list_element *show_debug_amd_dbgapi_lib_list; /* Mapping from amd-dbgapi log level enum values to text. */ -static constexpr const char *debug_amd_dbgapi_lib_log_level_enums[] = -{ +static constexpr const char *debug_amd_dbgapi_lib_log_level_enums[] = { /* [AMD_DBGAPI_LOG_LEVEL_NONE] = */ "off", /* [AMD_DBGAPI_LOG_LEVEL_FATAL_ERROR] = */ "error", /* [AMD_DBGAPI_LOG_LEVEL_WARNING] = */ "warning", @@ -1841,8 +1836,7 @@ static const char *debug_amd_dbgapi_lib_log_level static amd_dbgapi_log_level_t get_debug_amd_dbgapi_lib_log_level () { - for (size_t pos = 0; - debug_amd_dbgapi_lib_log_level_enums[pos] != nullptr; + for (size_t pos = 0; debug_amd_dbgapi_lib_log_level_enums[pos] != nullptr; ++pos) if (debug_amd_dbgapi_lib_log_level == debug_amd_dbgapi_lib_log_level_enums[pos]) @@ -1868,7 +1862,7 @@ show_debug_amd_dbgapi_lib_log_level (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) { - gdb_printf (file, _("The amd-dbgapi library log level is %s.\n"), value); + gdb_printf (file, _ ("The amd-dbgapi library log level is %s.\n"), value); } /* If the amd-dbgapi library is not attached to any process, finalize and @@ -1888,12 +1882,12 @@ maybe_reset_amd_dbgapi () amd_dbgapi_status_t status = amd_dbgapi_finalize (); if (status != AMD_DBGAPI_STATUS_SUCCESS) - error (_("amd-dbgapi failed to finalize (%s)"), + error (_ ("amd-dbgapi failed to finalize (%s)"), get_status_string (status)); status = amd_dbgapi_initialize (&dbgapi_callbacks); if (status != AMD_DBGAPI_STATUS_SUCCESS) - error (_("amd-dbgapi failed to initialize (%s)"), + error (_ ("amd-dbgapi failed to initialize (%s)"), get_status_string (status)); } @@ -1907,60 +1901,57 @@ _initialize_amd_dbgapi_target () uint32_t major, minor, patch; amd_dbgapi_get_version (&major, &minor, &patch); if (major != AMD_DBGAPI_VERSION_MAJOR || minor < AMD_DBGAPI_VERSION_MINOR) - error (_("amd-dbgapi library version mismatch, got %d.%d.%d, need %d.%d+"), - major, minor, patch, AMD_DBGAPI_VERSION_MAJOR, - AMD_DBGAPI_VERSION_MINOR); + error ( + _ ("amd-dbgapi library version mismatch, got %d.%d.%d, need %d.%d+"), + major, minor, patch, AMD_DBGAPI_VERSION_MAJOR, AMD_DBGAPI_VERSION_MINOR); /* Initialize the AMD Debugger API. */ amd_dbgapi_status_t status = amd_dbgapi_initialize (&dbgapi_callbacks); if (status != AMD_DBGAPI_STATUS_SUCCESS) - error (_("amd-dbgapi failed to initialize (%s)"), + error (_ ("amd-dbgapi failed to initialize (%s)"), get_status_string (status)); /* Set the initial log level. */ amd_dbgapi_set_log_level (get_debug_amd_dbgapi_lib_log_level ()); /* Install observers. */ - gdb::observers::inferior_created.attach - (amd_dbgapi_target_inferior_created, - amd_dbgapi_target_inferior_created_observer_token, "amd-dbgapi"); - gdb::observers::inferior_exit.attach (amd_dbgapi_inferior_exited, "amd-dbgapi"); - gdb::observers::inferior_pre_detach.attach (amd_dbgapi_inferior_pre_detach, "amd-dbgapi"); + gdb::observers::inferior_created.attach ( + amd_dbgapi_target_inferior_created, + amd_dbgapi_target_inferior_created_observer_token, "amd-dbgapi"); + gdb::observers::inferior_exit.attach (amd_dbgapi_inferior_exited, + "amd-dbgapi"); + gdb::observers::inferior_pre_detach.attach (amd_dbgapi_inferior_pre_detach, + "amd-dbgapi"); add_basic_prefix_cmd ("amd-dbgapi-lib", no_class, - _("Generic command for setting amd-dbgapi library " - "debugging flags."), + _ ("Generic command for setting amd-dbgapi library " + "debugging flags."), &set_debug_amd_dbgapi_lib_list, 0, &setdebuglist); add_show_prefix_cmd ("amd-dbgapi-lib", no_class, - _("Generic command for showing amd-dbgapi library " - "debugging flags."), + _ ("Generic command for showing amd-dbgapi library " + "debugging flags."), &show_debug_amd_dbgapi_lib_list, 0, &showdebuglist); - add_setshow_enum_cmd ("log-level", class_maintenance, - debug_amd_dbgapi_lib_log_level_enums, - &debug_amd_dbgapi_lib_log_level, - _("Set the amd-dbgapi library log level."), - _("Show the amd-dbgapi library log level."), - _("off == no logging is enabled\n" - "error == fatal errors are reported\n" - "warning == fatal errors and warnings are reported\n" - "info == fatal errors, warnings, and info " - "messages are reported\n" - "trace == fatal errors, warnings, info, and " - "API tracing messages are reported\n" - "verbose == all messages are reported"), - set_debug_amd_dbgapi_lib_log_level, - show_debug_amd_dbgapi_lib_log_level, - &set_debug_amd_dbgapi_lib_list, - &show_debug_amd_dbgapi_lib_list); - - add_setshow_boolean_cmd ("amd-dbgapi", class_maintenance, - &debug_amd_dbgapi, - _("Set debugging of amd-dbgapi target."), - _("Show debugging of amd-dbgapi target."), - _("\ + add_setshow_enum_cmd ( + "log-level", class_maintenance, debug_amd_dbgapi_lib_log_level_enums, + &debug_amd_dbgapi_lib_log_level, + _ ("Set the amd-dbgapi library log level."), + _ ("Show the amd-dbgapi library log level."), + _ ("off == no logging is enabled\n" + "error == fatal errors are reported\n" + "warning == fatal errors and warnings are reported\n" + "info == fatal errors, warnings, and info " + "messages are reported\n" + "trace == fatal errors, warnings, info, and " + "API tracing messages are reported\n" + "verbose == all messages are reported"), + set_debug_amd_dbgapi_lib_log_level, show_debug_amd_dbgapi_lib_log_level, + &set_debug_amd_dbgapi_lib_list, &show_debug_amd_dbgapi_lib_list); + + add_setshow_boolean_cmd ("amd-dbgapi", class_maintenance, &debug_amd_dbgapi, + _ ("Set debugging of amd-dbgapi target."), + _ ("Show debugging of amd-dbgapi target."), _ ("\ When on, print debug messages relating to the amd-dbgapi target."), - nullptr, nullptr, - &setdebuglist, &showdebuglist); + nullptr, nullptr, &setdebuglist, &showdebuglist); } diff --git a/gdb/amd-dbgapi-target.h b/gdb/amd-dbgapi-target.h index beff2ad..170d4bd 100644 --- a/gdb/amd-dbgapi-target.h +++ b/gdb/amd-dbgapi-target.h @@ -29,7 +29,7 @@ struct inferior; namespace detail { -template +template using is_amd_dbgapi_handle = gdb::Or, std::is_same, @@ -52,20 +52,18 @@ using is_amd_dbgapi_handle /* Get the token of amd-dbgapi's inferior_created observer. */ const gdb::observers::token & - get_amd_dbgapi_target_inferior_created_observer_token (); +get_amd_dbgapi_target_inferior_created_observer_token (); /* Comparison operators for amd-dbgapi handle types. */ -template >> +template>> bool operator== (const T &lhs, const T &rhs) { return lhs.handle == rhs.handle; } -template >> +template>> bool operator!= (const T &lhs, const T &rhs) { diff --git a/gdb/amd64-bsd-nat.c b/gdb/amd64-bsd-nat.c index a5c416a..2085a09 100644 --- a/gdb/amd64-bsd-nat.c +++ b/gdb/amd64-bsd-nat.c @@ -34,7 +34,6 @@ #include "x86-bsd-nat.h" #include "inf-ptrace.h" #include "amd64-bsd-nat.h" - static PTRACE_TYPE_RET gdb_ptrace (PTRACE_TYPE_ARG1 request, ptid_t ptid, PTRACE_TYPE_ARG3 addr, @@ -65,7 +64,7 @@ amd64bsd_fetch_inferior_registers (struct regcache *regcache, int regnum) struct reg regs; if (gdb_ptrace (PT_GETREGS, ptid, (PTRACE_TYPE_ARG3) ®s, 0) == -1) - perror_with_name (_("Couldn't get registers")); + perror_with_name (_ ("Couldn't get registers")); amd64_supply_native_gregset (regcache, ®s, -1); if (regnum != -1) @@ -77,7 +76,7 @@ amd64bsd_fetch_inferior_registers (struct regcache *regcache, int regnum) struct fpreg fpregs; if (gdb_ptrace (PT_GETFPREGS, ptid, (PTRACE_TYPE_ARG3) &fpregs, 0) == -1) - perror_with_name (_("Couldn't get floating point status")); + perror_with_name (_ ("Couldn't get floating point status")); amd64_supply_fxsave (regcache, -1, &fpregs); } @@ -97,12 +96,12 @@ amd64bsd_store_inferior_registers (struct regcache *regcache, int regnum) struct reg regs; if (gdb_ptrace (PT_GETREGS, ptid, (PTRACE_TYPE_ARG3) ®s, 0) == -1) - perror_with_name (_("Couldn't get registers")); + perror_with_name (_ ("Couldn't get registers")); amd64_collect_native_gregset (regcache, ®s, regnum); if (gdb_ptrace (PT_SETREGS, ptid, (PTRACE_TYPE_ARG3) ®s, 0) == -1) - perror_with_name (_("Couldn't write registers")); + perror_with_name (_ ("Couldn't write registers")); if (regnum != -1) return; @@ -113,11 +112,11 @@ amd64bsd_store_inferior_registers (struct regcache *regcache, int regnum) struct fpreg fpregs; if (gdb_ptrace (PT_GETFPREGS, ptid, (PTRACE_TYPE_ARG3) &fpregs, 0) == -1) - perror_with_name (_("Couldn't get floating point status")); + perror_with_name (_ ("Couldn't get floating point status")); amd64_collect_fxsave (regcache, regnum, &fpregs); if (gdb_ptrace (PT_SETFPREGS, ptid, (PTRACE_TYPE_ARG3) &fpregs, 0) == -1) - perror_with_name (_("Couldn't write floating point status")); + perror_with_name (_ ("Couldn't write floating point status")); } } diff --git a/gdb/amd64-bsd-nat.h b/gdb/amd64-bsd-nat.h index 792268b..cf7f091 100644 --- a/gdb/amd64-bsd-nat.h +++ b/gdb/amd64-bsd-nat.h @@ -34,11 +34,16 @@ template class amd64_bsd_nat_target : public x86bsd_nat_target { public: + void fetch_registers (struct regcache *regcache, int regnum) override - { amd64bsd_fetch_inferior_registers (regcache, regnum); } + { + amd64bsd_fetch_inferior_registers (regcache, regnum); + } void store_registers (struct regcache *regcache, int regnum) override - { amd64bsd_store_inferior_registers (regcache, regnum); } + { + amd64bsd_store_inferior_registers (regcache, regnum); + } }; #endif /* i386-bsd-nat.h */ diff --git a/gdb/amd64-darwin-tdep.c b/gdb/amd64-darwin-tdep.c index a682cf4..56a989d 100644 --- a/gdb/amd64-darwin-tdep.c +++ b/gdb/amd64-darwin-tdep.c @@ -40,36 +40,29 @@ /* Offsets into the struct x86_thread_state64 where we'll find the saved regs. From and amd64-tdep.h. */ -int amd64_darwin_thread_state_reg_offset[] = -{ - 0 * 8, /* %rax */ - 1 * 8, /* %rbx */ - 2 * 8, /* %rcx */ - 3 * 8, /* %rdx */ - 5 * 8, /* %rsi */ - 4 * 8, /* %rdi */ - 6 * 8, /* %rbp */ - 7 * 8, /* %rsp */ - 8 * 8, /* %r8 ... */ - 9 * 8, - 10 * 8, - 11 * 8, - 12 * 8, - 13 * 8, - 14 * 8, - 15 * 8, /* ... %r15 */ - 16 * 8, /* %rip */ - 17 * 8, /* %rflags */ - 18 * 8, /* %cs */ - -1, /* %ss */ - -1, /* %ds */ - -1, /* %es */ - 19 * 8, /* %fs */ - 20 * 8 /* %gs */ +int amd64_darwin_thread_state_reg_offset[] = { + 0 * 8, /* %rax */ + 1 * 8, /* %rbx */ + 2 * 8, /* %rcx */ + 3 * 8, /* %rdx */ + 5 * 8, /* %rsi */ + 4 * 8, /* %rdi */ + 6 * 8, /* %rbp */ + 7 * 8, /* %rsp */ + 8 * 8, /* %r8 ... */ + 9 * 8, 10 * 8, 11 * 8, 12 * 8, 13 * 8, 14 * 8, 15 * 8, /* ... %r15 */ + 16 * 8, /* %rip */ + 17 * 8, /* %rflags */ + 18 * 8, /* %cs */ + -1, /* %ss */ + -1, /* %ds */ + -1, /* %es */ + 19 * 8, /* %fs */ + 20 * 8 /* %gs */ }; -const int amd64_darwin_thread_state_num_regs = - ARRAY_SIZE (amd64_darwin_thread_state_reg_offset); +const int amd64_darwin_thread_state_num_regs + = ARRAY_SIZE (amd64_darwin_thread_state_reg_offset); /* Assuming THIS_FRAME is a Darwin sigtramp routine, return the address of the associated sigcontext structure. */ @@ -117,9 +110,10 @@ x86_darwin_init_abi_64 (struct gdbarch_info info, struct gdbarch *gdbarch) } void _initialize_amd64_darwin_tdep (); + void _initialize_amd64_darwin_tdep () { - gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64, - GDB_OSABI_DARWIN, x86_darwin_init_abi_64); + gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64, GDB_OSABI_DARWIN, + x86_darwin_init_abi_64); } diff --git a/gdb/amd64-dicos-tdep.c b/gdb/amd64-dicos-tdep.c index bf51382..50f3caa 100644 --- a/gdb/amd64-dicos-tdep.c +++ b/gdb/amd64-dicos-tdep.c @@ -47,13 +47,13 @@ amd64_dicos_osabi_sniffer (bfd *abfd) } void _initialize_amd64_dicos_tdep (); + void _initialize_amd64_dicos_tdep () { gdbarch_register_osabi_sniffer (bfd_arch_i386, bfd_target_elf_flavour, amd64_dicos_osabi_sniffer); - gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64, - GDB_OSABI_DICOS, + gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64, GDB_OSABI_DICOS, amd64_dicos_init_abi); } diff --git a/gdb/amd64-fbsd-nat.c b/gdb/amd64-fbsd-nat.c index bae267f..464db88 100644 --- a/gdb/amd64-fbsd-nat.c +++ b/gdb/amd64-fbsd-nat.c @@ -39,6 +39,7 @@ class amd64_fbsd_nat_target final : public x86_fbsd_nat_target { public: + void fetch_registers (struct regcache *, int) override; void store_registers (struct regcache *, int) override; @@ -54,34 +55,21 @@ static size_t xsave_len; /* This is a layout of the amd64 'struct reg' but with i386 registers. */ -static const struct regcache_map_entry amd64_fbsd32_gregmap[] = -{ - { 8, REGCACHE_MAP_SKIP, 8 }, - { 1, I386_EDI_REGNUM, 8 }, - { 1, I386_ESI_REGNUM, 8 }, - { 1, I386_EBP_REGNUM, 8 }, - { 1, I386_EBX_REGNUM, 8 }, - { 1, I386_EDX_REGNUM, 8 }, - { 1, I386_ECX_REGNUM, 8 }, - { 1, I386_EAX_REGNUM, 8 }, - { 1, REGCACHE_MAP_SKIP, 4 }, /* trapno */ - { 1, I386_FS_REGNUM, 2 }, - { 1, I386_GS_REGNUM, 2 }, - { 1, REGCACHE_MAP_SKIP, 4 }, /* err */ - { 1, I386_ES_REGNUM, 2 }, - { 1, I386_DS_REGNUM, 2 }, - { 1, I386_EIP_REGNUM, 8 }, - { 1, I386_CS_REGNUM, 8 }, - { 1, I386_EFLAGS_REGNUM, 8 }, - { 1, I386_ESP_REGNUM, 0 }, - { 1, I386_SS_REGNUM, 8 }, - { 0 } -}; - -static const struct regset amd64_fbsd32_gregset = -{ - amd64_fbsd32_gregmap, regcache_supply_regset, regcache_collect_regset -}; +static const struct regcache_map_entry amd64_fbsd32_gregmap[] + = { { 8, REGCACHE_MAP_SKIP, 8 }, { 1, I386_EDI_REGNUM, 8 }, + { 1, I386_ESI_REGNUM, 8 }, { 1, I386_EBP_REGNUM, 8 }, + { 1, I386_EBX_REGNUM, 8 }, { 1, I386_EDX_REGNUM, 8 }, + { 1, I386_ECX_REGNUM, 8 }, { 1, I386_EAX_REGNUM, 8 }, + { 1, REGCACHE_MAP_SKIP, 4 }, /* trapno */ + { 1, I386_FS_REGNUM, 2 }, { 1, I386_GS_REGNUM, 2 }, + { 1, REGCACHE_MAP_SKIP, 4 }, /* err */ + { 1, I386_ES_REGNUM, 2 }, { 1, I386_DS_REGNUM, 2 }, + { 1, I386_EIP_REGNUM, 8 }, { 1, I386_CS_REGNUM, 8 }, + { 1, I386_EFLAGS_REGNUM, 8 }, { 1, I386_ESP_REGNUM, 0 }, + { 1, I386_SS_REGNUM, 8 }, { 0 } }; + +static const struct regset amd64_fbsd32_gregset + = { amd64_fbsd32_gregmap, regcache_supply_regset, regcache_collect_regset }; /* Return the regset to use for 'struct reg' for the GDBARCH. */ @@ -119,7 +107,7 @@ amd64_fbsd_nat_target::fetch_registers (struct regcache *regcache, int regnum) register_t base; if (ptrace (PT_GETFSBASE, pid, (PTRACE_TYPE_ARG3) &base, 0) == -1) - perror_with_name (_("Couldn't get segment register fs_base")); + perror_with_name (_ ("Couldn't get segment register fs_base")); regcache->raw_supply (tdep->fsbase_regnum, &base); if (regnum != -1) @@ -132,7 +120,7 @@ amd64_fbsd_nat_target::fetch_registers (struct regcache *regcache, int regnum) register_t base; if (ptrace (PT_GETGSBASE, pid, (PTRACE_TYPE_ARG3) &base, 0) == -1) - perror_with_name (_("Couldn't get segment register gs_base")); + perror_with_name (_ ("Couldn't get segment register gs_base")); regcache->raw_supply (tdep->fsbase_regnum + 1, &base); if (regnum != -1) @@ -140,7 +128,7 @@ amd64_fbsd_nat_target::fetch_registers (struct regcache *regcache, int regnum) } #endif - /* There is no amd64_fxsave_supplies or amd64_xsave_supplies. + /* There is no amd64_fxsave_supplies or amd64_xsave_supplies. Instead, the earlier register sets return early if the request was for a specific register that was already satisified to avoid fetching the FPU/XSAVE state unnecessarily. */ @@ -151,7 +139,7 @@ amd64_fbsd_nat_target::fetch_registers (struct regcache *regcache, int regnum) void *xstateregs = alloca (xsave_len); if (ptrace (PT_GETXSTATE, pid, (PTRACE_TYPE_ARG3) xstateregs, 0) == -1) - perror_with_name (_("Couldn't get extended state status")); + perror_with_name (_ ("Couldn't get extended state status")); amd64_supply_xsave (regcache, regnum, xstateregs); return; @@ -161,7 +149,7 @@ amd64_fbsd_nat_target::fetch_registers (struct regcache *regcache, int regnum) struct fpreg fpregs; if (ptrace (PT_GETFPREGS, pid, (PTRACE_TYPE_ARG3) &fpregs, 0) == -1) - perror_with_name (_("Couldn't get floating point status")); + perror_with_name (_ ("Couldn't get floating point status")); amd64_supply_fxsave (regcache, regnum, &fpregs); } @@ -196,7 +184,7 @@ amd64_fbsd_nat_target::store_registers (struct regcache *regcache, int regnum) regcache->raw_collect (tdep->fsbase_regnum, &base); if (ptrace (PT_SETFSBASE, pid, (PTRACE_TYPE_ARG3) &base, 0) == -1) - perror_with_name (_("Couldn't write segment register fs_base")); + perror_with_name (_ ("Couldn't write segment register fs_base")); if (regnum != -1) return; } @@ -211,13 +199,13 @@ amd64_fbsd_nat_target::store_registers (struct regcache *regcache, int regnum) regcache->raw_collect (tdep->fsbase_regnum + 1, &base); if (ptrace (PT_SETGSBASE, pid, (PTRACE_TYPE_ARG3) &base, 0) == -1) - perror_with_name (_("Couldn't write segment register gs_base")); + perror_with_name (_ ("Couldn't write segment register gs_base")); if (regnum != -1) return; } #endif - /* There is no amd64_fxsave_supplies or amd64_xsave_supplies. + /* There is no amd64_fxsave_supplies or amd64_xsave_supplies. Instead, the earlier register sets return early if the request was for a specific register that was already satisified to avoid fetching the FPU/XSAVE state unnecessarily. */ @@ -228,13 +216,13 @@ amd64_fbsd_nat_target::store_registers (struct regcache *regcache, int regnum) void *xstateregs = alloca (xsave_len); if (ptrace (PT_GETXSTATE, pid, (PTRACE_TYPE_ARG3) xstateregs, 0) == -1) - perror_with_name (_("Couldn't get extended state status")); + perror_with_name (_ ("Couldn't get extended state status")); amd64_collect_xsave (regcache, regnum, xstateregs, 0); - if (ptrace (PT_SETXSTATE, pid, (PTRACE_TYPE_ARG3) xstateregs, - xsave_len) == -1) - perror_with_name (_("Couldn't write extended state status")); + if (ptrace (PT_SETXSTATE, pid, (PTRACE_TYPE_ARG3) xstateregs, xsave_len) + == -1) + perror_with_name (_ ("Couldn't write extended state status")); return; } #endif @@ -242,12 +230,12 @@ amd64_fbsd_nat_target::store_registers (struct regcache *regcache, int regnum) struct fpreg fpregs; if (ptrace (PT_GETFPREGS, pid, (PTRACE_TYPE_ARG3) &fpregs, 0) == -1) - perror_with_name (_("Couldn't get floating point status")); + perror_with_name (_ ("Couldn't get floating point status")); amd64_collect_fxsave (regcache, regnum, &fpregs); if (ptrace (PT_SETFPREGS, pid, (PTRACE_TYPE_ARG3) &fpregs, 0) == -1) - perror_with_name (_("Couldn't write floating point status")); + perror_with_name (_ ("Couldn't write floating point status")); } /* Support for debugging kernel virtual memory images. */ @@ -296,7 +284,6 @@ amd64fbsd_supply_pcb (struct regcache *regcache, struct pcb *pcb) return 1; } - /* Implement the read_description method. */ @@ -310,9 +297,9 @@ amd64_fbsd_nat_target::read_description () struct reg regs; int is64; - if (ptrace (PT_GETREGS, inferior_ptid.pid (), - (PTRACE_TYPE_ARG3) ®s, 0) == -1) - perror_with_name (_("Couldn't get registers")); + if (ptrace (PT_GETREGS, inferior_ptid.pid (), (PTRACE_TYPE_ARG3) ®s, 0) + == -1) + perror_with_name (_ ("Couldn't get registers")); is64 = (regs.r_cs == GSEL (GUCODE_SEL, SEL_UPL)); #ifdef PT_GETXSTATE_INFO if (!xsave_probed) @@ -320,7 +307,8 @@ amd64_fbsd_nat_target::read_description () struct ptrace_xstate_info info; if (ptrace (PT_GETXSTATE_INFO, inferior_ptid.pid (), - (PTRACE_TYPE_ARG3) &info, sizeof (info)) == 0) + (PTRACE_TYPE_ARG3) &info, sizeof (info)) + == 0) { xsave_len = info.xsave_len; xcr0 = info.xsave_mask; @@ -343,6 +331,7 @@ amd64_fbsd_nat_target::read_description () } void _initialize_amd64fbsd_nat (); + void _initialize_amd64fbsd_nat () { diff --git a/gdb/amd64-fbsd-tdep.c b/gdb/amd64-fbsd-tdep.c index 2ddbceb..3e82685 100644 --- a/gdb/amd64-fbsd-tdep.c +++ b/gdb/amd64-fbsd-tdep.c @@ -35,105 +35,81 @@ /* The general-purpose regset consists of 22 64-bit slots, most of which contain individual registers, but a few contain multiple 16-bit segment registers. */ -#define AMD64_FBSD_SIZEOF_GREGSET (22 * 8) +#define AMD64_FBSD_SIZEOF_GREGSET (22 * 8) /* The segment base register set consists of 2 64-bit registers. */ -#define AMD64_FBSD_SIZEOF_SEGBASES_REGSET (2 * 8) +#define AMD64_FBSD_SIZEOF_SEGBASES_REGSET (2 * 8) /* Register maps. */ -static const struct regcache_map_entry amd64_fbsd_gregmap[] = -{ - { 1, AMD64_R15_REGNUM, 0 }, - { 1, AMD64_R14_REGNUM, 0 }, - { 1, AMD64_R13_REGNUM, 0 }, - { 1, AMD64_R12_REGNUM, 0 }, - { 1, AMD64_R11_REGNUM, 0 }, - { 1, AMD64_R10_REGNUM, 0 }, - { 1, AMD64_R9_REGNUM, 0 }, - { 1, AMD64_R8_REGNUM, 0 }, - { 1, AMD64_RDI_REGNUM, 0 }, - { 1, AMD64_RSI_REGNUM, 0 }, - { 1, AMD64_RBP_REGNUM, 0 }, - { 1, AMD64_RBX_REGNUM, 0 }, - { 1, AMD64_RDX_REGNUM, 0 }, - { 1, AMD64_RCX_REGNUM, 0 }, - { 1, AMD64_RAX_REGNUM, 0 }, - { 1, REGCACHE_MAP_SKIP, 4 }, /* trapno */ - { 1, AMD64_FS_REGNUM, 2 }, - { 1, AMD64_GS_REGNUM, 2 }, - { 1, REGCACHE_MAP_SKIP, 4 }, /* err */ - { 1, AMD64_ES_REGNUM, 2 }, - { 1, AMD64_DS_REGNUM, 2 }, - { 1, AMD64_RIP_REGNUM, 0 }, - { 1, AMD64_CS_REGNUM, 8 }, - { 1, AMD64_EFLAGS_REGNUM, 8 }, - { 1, AMD64_RSP_REGNUM, 0 }, - { 1, AMD64_SS_REGNUM, 8 }, - { 0 } -}; - -static const struct regcache_map_entry amd64_fbsd_segbases_regmap[] = -{ - { 1, AMD64_FSBASE_REGNUM, 0 }, - { 1, AMD64_GSBASE_REGNUM, 0 }, - { 0 } -}; +static const struct regcache_map_entry amd64_fbsd_gregmap[] + = { { 1, AMD64_R15_REGNUM, 0 }, { 1, AMD64_R14_REGNUM, 0 }, + { 1, AMD64_R13_REGNUM, 0 }, { 1, AMD64_R12_REGNUM, 0 }, + { 1, AMD64_R11_REGNUM, 0 }, { 1, AMD64_R10_REGNUM, 0 }, + { 1, AMD64_R9_REGNUM, 0 }, { 1, AMD64_R8_REGNUM, 0 }, + { 1, AMD64_RDI_REGNUM, 0 }, { 1, AMD64_RSI_REGNUM, 0 }, + { 1, AMD64_RBP_REGNUM, 0 }, { 1, AMD64_RBX_REGNUM, 0 }, + { 1, AMD64_RDX_REGNUM, 0 }, { 1, AMD64_RCX_REGNUM, 0 }, + { 1, AMD64_RAX_REGNUM, 0 }, { 1, REGCACHE_MAP_SKIP, 4 }, /* trapno */ + { 1, AMD64_FS_REGNUM, 2 }, { 1, AMD64_GS_REGNUM, 2 }, + { 1, REGCACHE_MAP_SKIP, 4 }, /* err */ + { 1, AMD64_ES_REGNUM, 2 }, { 1, AMD64_DS_REGNUM, 2 }, + { 1, AMD64_RIP_REGNUM, 0 }, { 1, AMD64_CS_REGNUM, 8 }, + { 1, AMD64_EFLAGS_REGNUM, 8 }, { 1, AMD64_RSP_REGNUM, 0 }, + { 1, AMD64_SS_REGNUM, 8 }, { 0 } }; + +static const struct regcache_map_entry amd64_fbsd_segbases_regmap[] + = { { 1, AMD64_FSBASE_REGNUM, 0 }, { 1, AMD64_GSBASE_REGNUM, 0 }, { 0 } }; /* This layout including fsbase and gsbase was adopted in FreeBSD 8.0. */ -static const struct regcache_map_entry amd64_fbsd_mcregmap[] = -{ - { 1, REGCACHE_MAP_SKIP, 8 }, /* mc_onstack */ - { 1, AMD64_RDI_REGNUM, 0 }, - { 1, AMD64_RSI_REGNUM, 0 }, - { 1, AMD64_RDX_REGNUM, 0 }, - { 1, AMD64_RCX_REGNUM, 0 }, - { 1, AMD64_R8_REGNUM, 0 }, - { 1, AMD64_R9_REGNUM, 0 }, - { 1, AMD64_RAX_REGNUM, 0 }, - { 1, AMD64_RBX_REGNUM, 0 }, - { 1, AMD64_RBP_REGNUM, 0 }, - { 1, AMD64_R10_REGNUM, 0 }, - { 1, AMD64_R11_REGNUM, 0 }, - { 1, AMD64_R12_REGNUM, 0 }, - { 1, AMD64_R13_REGNUM, 0 }, - { 1, AMD64_R14_REGNUM, 0 }, - { 1, AMD64_R15_REGNUM, 0 }, - { 1, REGCACHE_MAP_SKIP, 4 }, /* mc_trapno */ - { 1, AMD64_FS_REGNUM, 2 }, - { 1, AMD64_GS_REGNUM, 2 }, - { 1, REGCACHE_MAP_SKIP, 8 }, /* mc_addr */ - { 1, REGCACHE_MAP_SKIP, 4 }, /* mc_flags */ - { 1, AMD64_ES_REGNUM, 2 }, - { 1, AMD64_DS_REGNUM, 2 }, - { 1, REGCACHE_MAP_SKIP, 8 }, /* mc_err */ - { 1, AMD64_RIP_REGNUM, 0 }, - { 1, AMD64_CS_REGNUM, 8 }, - { 1, AMD64_EFLAGS_REGNUM, 8 }, - { 1, AMD64_RSP_REGNUM, 0 }, - { 1, AMD64_SS_REGNUM, 8 }, - { 1, REGCACHE_MAP_SKIP, 8 }, /* mc_len */ - { 1, REGCACHE_MAP_SKIP, 8 }, /* mc_fpformat */ - { 1, REGCACHE_MAP_SKIP, 8 }, /* mc_ownedfp */ - { 64, REGCACHE_MAP_SKIP, 8 }, /* mc_fpstate */ - { 1, AMD64_FSBASE_REGNUM, 0 }, - { 1, AMD64_GSBASE_REGNUM, 0 }, - { 0 } -}; +static const struct regcache_map_entry amd64_fbsd_mcregmap[] + = { { 1, REGCACHE_MAP_SKIP, 8 }, /* mc_onstack */ + { 1, AMD64_RDI_REGNUM, 0 }, + { 1, AMD64_RSI_REGNUM, 0 }, + { 1, AMD64_RDX_REGNUM, 0 }, + { 1, AMD64_RCX_REGNUM, 0 }, + { 1, AMD64_R8_REGNUM, 0 }, + { 1, AMD64_R9_REGNUM, 0 }, + { 1, AMD64_RAX_REGNUM, 0 }, + { 1, AMD64_RBX_REGNUM, 0 }, + { 1, AMD64_RBP_REGNUM, 0 }, + { 1, AMD64_R10_REGNUM, 0 }, + { 1, AMD64_R11_REGNUM, 0 }, + { 1, AMD64_R12_REGNUM, 0 }, + { 1, AMD64_R13_REGNUM, 0 }, + { 1, AMD64_R14_REGNUM, 0 }, + { 1, AMD64_R15_REGNUM, 0 }, + { 1, REGCACHE_MAP_SKIP, 4 }, /* mc_trapno */ + { 1, AMD64_FS_REGNUM, 2 }, + { 1, AMD64_GS_REGNUM, 2 }, + { 1, REGCACHE_MAP_SKIP, 8 }, /* mc_addr */ + { 1, REGCACHE_MAP_SKIP, 4 }, /* mc_flags */ + { 1, AMD64_ES_REGNUM, 2 }, + { 1, AMD64_DS_REGNUM, 2 }, + { 1, REGCACHE_MAP_SKIP, 8 }, /* mc_err */ + { 1, AMD64_RIP_REGNUM, 0 }, + { 1, AMD64_CS_REGNUM, 8 }, + { 1, AMD64_EFLAGS_REGNUM, 8 }, + { 1, AMD64_RSP_REGNUM, 0 }, + { 1, AMD64_SS_REGNUM, 8 }, + { 1, REGCACHE_MAP_SKIP, 8 }, /* mc_len */ + { 1, REGCACHE_MAP_SKIP, 8 }, /* mc_fpformat */ + { 1, REGCACHE_MAP_SKIP, 8 }, /* mc_ownedfp */ + { 64, REGCACHE_MAP_SKIP, 8 }, /* mc_fpstate */ + { 1, AMD64_FSBASE_REGNUM, 0 }, + { 1, AMD64_GSBASE_REGNUM, 0 }, + { 0 } }; /* Register set definitions. */ -const struct regset amd64_fbsd_gregset = -{ - amd64_fbsd_gregmap, regcache_supply_regset, regcache_collect_regset -}; +const struct regset amd64_fbsd_gregset + = { amd64_fbsd_gregmap, regcache_supply_regset, regcache_collect_regset }; -const struct regset amd64_fbsd_segbases_regset = -{ - amd64_fbsd_segbases_regmap, regcache_supply_regset, regcache_collect_regset -}; +const struct regset amd64_fbsd_segbases_regset + = { amd64_fbsd_segbases_regmap, regcache_supply_regset, + regcache_collect_regset }; /* Support for signal handlers. */ @@ -161,23 +137,20 @@ const struct regset amd64_fbsd_segbases_regset = as the floating point or XSAVE state. */ /* NB: There is an 8 byte padding hole between sf_ahu and sf_uc. */ -#define AMD64_SIGFRAME_UCONTEXT_OFFSET 16 -#define AMD64_UCONTEXT_MCONTEXT_OFFSET 16 -#define AMD64_SIZEOF_MCONTEXT_T 800 +#define AMD64_SIGFRAME_UCONTEXT_OFFSET 16 +#define AMD64_UCONTEXT_MCONTEXT_OFFSET 16 +#define AMD64_SIZEOF_MCONTEXT_T 800 /* Implement the "init" method of struct tramp_frame. */ static void amd64_fbsd_sigframe_init (const struct tramp_frame *self, frame_info_ptr this_frame, - struct trad_frame_cache *this_cache, - CORE_ADDR func) + struct trad_frame_cache *this_cache, CORE_ADDR func) { CORE_ADDR sp = get_frame_register_unsigned (this_frame, AMD64_RSP_REGNUM); CORE_ADDR mcontext_addr - = (sp - + AMD64_SIGFRAME_UCONTEXT_OFFSET - + AMD64_UCONTEXT_MCONTEXT_OFFSET); + = (sp + AMD64_SIGFRAME_UCONTEXT_OFFSET + AMD64_UCONTEXT_MCONTEXT_OFFSET); trad_frame_set_reg_regmap (this_cache, amd64_fbsd_mcregmap, mcontext_addr, AMD64_SIZEOF_MCONTEXT_T); @@ -191,38 +164,33 @@ amd64_fbsd_sigframe_init (const struct tramp_frame *self, trad_frame_set_id (this_cache, frame_id_build (sp, func)); } -static const struct tramp_frame amd64_fbsd_sigframe = -{ - SIGTRAMP_FRAME, - 1, - { - {0x48, ULONGEST_MAX}, /* lea SIGF_UC(%rsp),%rdi */ - {0x8d, ULONGEST_MAX}, - {0x7c, ULONGEST_MAX}, - {0x24, ULONGEST_MAX}, - {0x10, ULONGEST_MAX}, - {0x6a, ULONGEST_MAX}, /* pushq $0 */ - {0x00, ULONGEST_MAX}, - {0x48, ULONGEST_MAX}, /* movq $SYS_sigreturn,%rax */ - {0xc7, ULONGEST_MAX}, - {0xc0, ULONGEST_MAX}, - {0xa1, ULONGEST_MAX}, - {0x01, ULONGEST_MAX}, - {0x00, ULONGEST_MAX}, - {0x00, ULONGEST_MAX}, - {0x0f, ULONGEST_MAX}, /* syscall */ - {0x05, ULONGEST_MAX}, - {TRAMP_SENTINEL_INSN, ULONGEST_MAX} - }, - amd64_fbsd_sigframe_init -}; +static const struct tramp_frame amd64_fbsd_sigframe + = { SIGTRAMP_FRAME, + 1, + { { 0x48, ULONGEST_MAX }, /* lea SIGF_UC(%rsp),%rdi */ + { 0x8d, ULONGEST_MAX }, + { 0x7c, ULONGEST_MAX }, + { 0x24, ULONGEST_MAX }, + { 0x10, ULONGEST_MAX }, + { 0x6a, ULONGEST_MAX }, /* pushq $0 */ + { 0x00, ULONGEST_MAX }, + { 0x48, ULONGEST_MAX }, /* movq $SYS_sigreturn,%rax */ + { 0xc7, ULONGEST_MAX }, + { 0xc0, ULONGEST_MAX }, + { 0xa1, ULONGEST_MAX }, + { 0x01, ULONGEST_MAX }, + { 0x00, ULONGEST_MAX }, + { 0x00, ULONGEST_MAX }, + { 0x0f, ULONGEST_MAX }, /* syscall */ + { 0x05, ULONGEST_MAX }, + { TRAMP_SENTINEL_INSN, ULONGEST_MAX } }, + amd64_fbsd_sigframe_init }; /* Implement the core_read_description gdbarch method. */ static const struct target_desc * amd64fbsd_core_read_description (struct gdbarch *gdbarch, - struct target_ops *target, - bfd *abfd) + struct target_ops *target, bfd *abfd) { return amd64_target_description (i386fbsd_core_read_xcr0 (abfd), true); } @@ -241,18 +209,14 @@ amd64fbsd_supply_xstateregset (const struct regset *regset, static void amd64fbsd_collect_xstateregset (const struct regset *regset, - const struct regcache *regcache, - int regnum, void *xstateregs, size_t len) + const struct regcache *regcache, int regnum, + void *xstateregs, size_t len) { amd64_collect_xsave (regcache, regnum, xstateregs, 1); } -static const struct regset amd64fbsd_xstateregset = - { - NULL, - amd64fbsd_supply_xstateregset, - amd64fbsd_collect_xstateregset - }; +static const struct regset amd64fbsd_xstateregset + = { NULL, amd64fbsd_supply_xstateregset, amd64fbsd_collect_xstateregset }; /* Iterate over core file register note sections. */ @@ -271,8 +235,9 @@ amd64fbsd_iterate_over_regset_sections (struct gdbarch *gdbarch, cb (".reg-x86-segbases", AMD64_FBSD_SIZEOF_SEGBASES_REGSET, AMD64_FBSD_SIZEOF_SEGBASES_REGSET, &amd64_fbsd_segbases_regset, "segment bases", cb_data); - cb (".reg-xstate", X86_XSTATE_SIZE (tdep->xcr0), X86_XSTATE_SIZE (tdep->xcr0), - &amd64fbsd_xstateregset, "XSAVE extended state", cb_data); + cb (".reg-xstate", X86_XSTATE_SIZE (tdep->xcr0), + X86_XSTATE_SIZE (tdep->xcr0), &amd64fbsd_xstateregset, + "XSAVE extended state", cb_data); } /* Implement the get_thread_local_address gdbarch method. */ @@ -290,7 +255,7 @@ amd64fbsd_get_thread_local_address (struct gdbarch *gdbarch, ptid_t ptid, ULONGEST fsbase; if (regcache->cooked_read (AMD64_FSBASE_REGNUM, &fsbase) != REG_VALID) - error (_("Unable to fetch %%fsbase")); + error (_ ("Unable to fetch %%fsbase")); CORE_ADDR dtv_addr = fsbase + gdbarch_ptr_bit (gdbarch) / 8; return fbsd_get_thread_local_address (gdbarch, dtv_addr, lm_addr, offset); @@ -315,15 +280,14 @@ amd64fbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) tdep->xsave_xcr0_offset = I386_FBSD_XSAVE_XCR0_OFFSET; /* Iterate over core file register note sections. */ - set_gdbarch_iterate_over_regset_sections - (gdbarch, amd64fbsd_iterate_over_regset_sections); + set_gdbarch_iterate_over_regset_sections ( + gdbarch, amd64fbsd_iterate_over_regset_sections); - set_gdbarch_core_read_description (gdbarch, - amd64fbsd_core_read_description); + set_gdbarch_core_read_description (gdbarch, amd64fbsd_core_read_description); /* FreeBSD uses SVR4-style shared libraries. */ - set_solib_svr4_fetch_link_map_offsets - (gdbarch, svr4_lp64_fetch_link_map_offsets); + set_solib_svr4_fetch_link_map_offsets (gdbarch, + svr4_lp64_fetch_link_map_offsets); set_gdbarch_fetch_tls_load_module_address (gdbarch, svr4_fetch_objfile_link_map); @@ -332,9 +296,10 @@ amd64fbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) } void _initialize_amd64fbsd_tdep (); + void _initialize_amd64fbsd_tdep () { - gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64, - GDB_OSABI_FREEBSD, amd64fbsd_init_abi); + gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64, GDB_OSABI_FREEBSD, + amd64fbsd_init_abi); } diff --git a/gdb/amd64-linux-nat.c b/gdb/amd64-linux-nat.c index b5b0703..799d79d 100644 --- a/gdb/amd64-linux-nat.c +++ b/gdb/amd64-linux-nat.c @@ -42,7 +42,7 @@ /* This definition comes from prctl.h. Kernels older than 2.5.64 do not have it. */ #ifndef PTRACE_ARCH_PRCTL -#define PTRACE_ARCH_PRCTL 30 +#define PTRACE_ARCH_PRCTL 30 #endif struct amd64_linux_nat_target final : public x86_linux_nat_target @@ -51,8 +51,8 @@ struct amd64_linux_nat_target final : public x86_linux_nat_target void fetch_registers (struct regcache *, int) override; void store_registers (struct regcache *, int) override; - bool low_siginfo_fixup (siginfo_t *ptrace, gdb_byte *inf, int direction) - override; + bool low_siginfo_fixup (siginfo_t *ptrace, gdb_byte *inf, + int direction) override; }; static amd64_linux_nat_target the_amd64_linux_nat_target; @@ -66,28 +66,24 @@ static amd64_linux_nat_target the_amd64_linux_nat_target; little-endian we get away with that. */ /* From on GNU/Linux i386. */ -static int amd64_linux_gregset32_reg_offset[] = -{ - RAX * 8, RCX * 8, /* %eax, %ecx */ - RDX * 8, RBX * 8, /* %edx, %ebx */ - RSP * 8, RBP * 8, /* %esp, %ebp */ - RSI * 8, RDI * 8, /* %esi, %edi */ - RIP * 8, EFLAGS * 8, /* %eip, %eflags */ - CS * 8, SS * 8, /* %cs, %ss */ - DS * 8, ES * 8, /* %ds, %es */ - FS * 8, GS * 8, /* %fs, %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, /* MPX registers BND0 ... BND3. */ - -1, -1, /* MPX registers BNDCFGU, BNDSTATUS. */ - -1, -1, -1, -1, -1, -1, -1, -1, /* k0 ... k7 (AVX512) */ - -1, -1, -1, -1, -1, -1, -1, -1, /* zmm0 ... zmm7 (AVX512) */ - -1, /* PKEYS register PKRU */ - ORIG_RAX * 8 /* "orig_eax" */ +static int amd64_linux_gregset32_reg_offset[] = { + RAX * 8, RCX * 8, /* %eax, %ecx */ + RDX * 8, RBX * 8, /* %edx, %ebx */ + RSP * 8, RBP * 8, /* %esp, %ebp */ + RSI * 8, RDI * 8, /* %esi, %edi */ + RIP * 8, EFLAGS * 8, /* %eip, %eflags */ + CS * 8, SS * 8, /* %cs, %ss */ + DS * 8, ES * 8, /* %ds, %es */ + FS * 8, GS * 8, /* %fs, %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, /* MPX registers BND0 ... BND3. */ + -1, -1, /* MPX registers BNDCFGU, BNDSTATUS. */ + -1, -1, -1, -1, -1, -1, -1, -1, /* k0 ... k7 (AVX512) */ + -1, -1, -1, -1, -1, -1, -1, -1, /* zmm0 ... zmm7 (AVX512) */ + -1, /* PKEYS register PKRU */ + ORIG_RAX * 8 /* "orig_eax" */ }; - /* Transfering the general-purpose registers between GDB, inferiors and core files. */ @@ -149,7 +145,7 @@ amd64_linux_collect_native_gregset (const struct regcache *regcache, if (regnum == -1 || regnum == I386_EAX_REGNUM) { - void *ptr = ((gdb_byte *) gregs + void *ptr = ((gdb_byte *) gregs + amd64_linux_gregset32_reg_offset[I386_EAX_REGNUM]); *(int64_t *) ptr = *(int32_t *) ptr; @@ -171,8 +167,8 @@ supply_gregset (struct regcache *regcache, const elf_gregset_t *gregsetp) do this for all registers. */ void -fill_gregset (const struct regcache *regcache, - elf_gregset_t *gregsetp, int regnum) +fill_gregset (const struct regcache *regcache, elf_gregset_t *gregsetp, + int regnum) { amd64_linux_collect_native_gregset (regcache, gregsetp, regnum); } @@ -193,12 +189,11 @@ supply_fpregset (struct regcache *regcache, const elf_fpregset_t *fpregsetp) -1, do this for all registers. */ void -fill_fpregset (const struct regcache *regcache, - elf_fpregset_t *fpregsetp, int regnum) +fill_fpregset (const struct regcache *regcache, elf_fpregset_t *fpregsetp, + int regnum) { amd64_collect_fxsave (regcache, regnum, fpregsetp); } - /* Transferring arbitrary registers between GDB and inferior. */ @@ -222,7 +217,7 @@ amd64_linux_nat_target::fetch_registers (struct regcache *regcache, int regnum) elf_gregset_t regs; if (ptrace (PTRACE_GETREGS, tid, 0, (long) ®s) < 0) - perror_with_name (_("Couldn't get registers")); + perror_with_name (_ ("Couldn't get registers")); amd64_supply_native_gregset (regcache, ®s, -1); if (regnum != -1) @@ -246,16 +241,17 @@ amd64_linux_nat_target::fetch_registers (struct regcache *regcache, int regnum) memset (xstateregs, 0, sizeof (xstateregs)); iov.iov_base = xstateregs; iov.iov_len = sizeof (xstateregs); - if (ptrace (PTRACE_GETREGSET, tid, - (unsigned int) NT_X86_XSTATE, (long) &iov) < 0) - perror_with_name (_("Couldn't get extended state status")); + if (ptrace (PTRACE_GETREGSET, tid, (unsigned int) NT_X86_XSTATE, + (long) &iov) + < 0) + perror_with_name (_ ("Couldn't get extended state status")); amd64_supply_xsave (regcache, -1, xstateregs); } else { if (ptrace (PTRACE_GETFPREGS, tid, 0, (long) &fpregs) < 0) - perror_with_name (_("Couldn't get floating point status")); + perror_with_name (_ ("Couldn't get floating point status")); amd64_supply_fxsave (regcache, -1, &fpregs); } @@ -282,12 +278,12 @@ amd64_linux_nat_target::store_registers (struct regcache *regcache, int regnum) elf_gregset_t regs; if (ptrace (PTRACE_GETREGS, tid, 0, (long) ®s) < 0) - perror_with_name (_("Couldn't get registers")); + perror_with_name (_ ("Couldn't get registers")); amd64_linux_collect_native_gregset (regcache, ®s, regnum); if (ptrace (PTRACE_SETREGS, tid, 0, (long) ®s) < 0) - perror_with_name (_("Couldn't write registers")); + perror_with_name (_ ("Couldn't write registers")); if (regnum != -1) return; @@ -304,44 +300,45 @@ amd64_linux_nat_target::store_registers (struct regcache *regcache, int regnum) iov.iov_base = xstateregs; iov.iov_len = sizeof (xstateregs); - if (ptrace (PTRACE_GETREGSET, tid, - (unsigned int) NT_X86_XSTATE, (long) &iov) < 0) - perror_with_name (_("Couldn't get extended state status")); + if (ptrace (PTRACE_GETREGSET, tid, (unsigned int) NT_X86_XSTATE, + (long) &iov) + < 0) + perror_with_name (_ ("Couldn't get extended state status")); amd64_collect_xsave (regcache, regnum, xstateregs, 0); - if (ptrace (PTRACE_SETREGSET, tid, - (unsigned int) NT_X86_XSTATE, (long) &iov) < 0) - perror_with_name (_("Couldn't write extended state status")); + if (ptrace (PTRACE_SETREGSET, tid, (unsigned int) NT_X86_XSTATE, + (long) &iov) + < 0) + perror_with_name (_ ("Couldn't write extended state status")); } else { if (ptrace (PTRACE_GETFPREGS, tid, 0, (long) &fpregs) < 0) - perror_with_name (_("Couldn't get floating point status")); + perror_with_name (_ ("Couldn't get floating point status")); amd64_collect_fxsave (regcache, regnum, &fpregs); if (ptrace (PTRACE_SETFPREGS, tid, 0, (long) &fpregs) < 0) - perror_with_name (_("Couldn't write floating point status")); + perror_with_name (_ ("Couldn't write floating point status")); } } } - /* This function is called by libthread_db as part of its handling of a request for a thread's local storage address. */ ps_err_e -ps_get_thread_area (struct ps_prochandle *ph, - lwpid_t lwpid, int idx, void **base) +ps_get_thread_area (struct ps_prochandle *ph, lwpid_t lwpid, int idx, + void **base) { if (gdbarch_bfd_arch_info (ph->thread->inf->gdbarch)->bits_per_word == 32) { unsigned int base_addr; ps_err_e result; - result = x86_linux_get_thread_area (lwpid, (void *) (long) idx, - &base_addr); + result + = x86_linux_get_thread_area (lwpid, (void *) (long) idx, &base_addr); if (result == PS_OK) { /* Extend the value to 64 bits. Here it's assumed that @@ -352,7 +349,6 @@ ps_get_thread_area (struct ps_prochandle *ph, } else { - /* FIXME: ezannoni-2003-07-09 see comment above about include file order. We could be getting bogus values for these two. */ gdb_assert (FS < ELF_NGREG); @@ -360,41 +356,40 @@ ps_get_thread_area (struct ps_prochandle *ph, switch (idx) { case FS: - { - unsigned long fs; - errno = 0; - fs = ptrace (PTRACE_PEEKUSER, lwpid, - offsetof (struct user_regs_struct, fs_base), 0); - if (errno == 0) - { - *base = (void *) fs; - return PS_OK; - } - } + { + unsigned long fs; + errno = 0; + fs = ptrace (PTRACE_PEEKUSER, lwpid, + offsetof (struct user_regs_struct, fs_base), 0); + if (errno == 0) + { + *base = (void *) fs; + return PS_OK; + } + } break; case GS: - { - unsigned long gs; - errno = 0; - gs = ptrace (PTRACE_PEEKUSER, lwpid, - offsetof (struct user_regs_struct, gs_base), 0); - if (errno == 0) - { - *base = (void *) gs; - return PS_OK; - } - } + { + unsigned long gs; + errno = 0; + gs = ptrace (PTRACE_PEEKUSER, lwpid, + offsetof (struct user_regs_struct, gs_base), 0); + if (errno == 0) + { + *base = (void *) gs; + return PS_OK; + } + } break; - default: /* Should not happen. */ + default: /* Should not happen. */ return PS_BADADDR; } } - return PS_ERR; /* ptrace failed. */ + return PS_ERR; /* ptrace failed. */ } - /* Convert a ptrace/host siginfo object, into/from the siginfo in the layout of the inferiors' architecture. Returns true if any @@ -403,8 +398,7 @@ ps_get_thread_area (struct ps_prochandle *ph, INF. */ bool -amd64_linux_nat_target::low_siginfo_fixup (siginfo_t *ptrace, - gdb_byte *inf, +amd64_linux_nat_target::low_siginfo_fixup (siginfo_t *ptrace, gdb_byte *inf, int direction) { struct gdbarch *gdbarch = get_frame_arch (get_current_frame ()); @@ -412,8 +406,7 @@ amd64_linux_nat_target::low_siginfo_fixup (siginfo_t *ptrace, /* Is the inferior 32-bit? If so, then do fixup the siginfo object. */ if (gdbarch_bfd_arch_info (gdbarch)->bits_per_word == 32) - return amd64_linux_siginfo_fixup_common (ptrace, inf, direction, - FIXUP_32); + return amd64_linux_siginfo_fixup_common (ptrace, inf, direction, FIXUP_32); /* No fixup for native x32 GDB. */ else if (gdbarch_addr_bit (gdbarch) == 32 && sizeof (void *) == 8) return amd64_linux_siginfo_fixup_common (ptrace, inf, direction, @@ -423,6 +416,7 @@ amd64_linux_nat_target::low_siginfo_fixup (siginfo_t *ptrace, } void _initialize_amd64_linux_nat (); + void _initialize_amd64_linux_nat () { diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c index e918164..f3d8c68 100644 --- a/gdb/amd64-linux-tdep.c +++ b/gdb/amd64-linux-tdep.c @@ -53,74 +53,59 @@ format and GDB's register cache layout. */ /* From . */ -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 */ - 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. */ - -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, - -1, /* PKEYS register pkru */ +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 */ + 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. */ + -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, -1, /* PKEYS register pkru */ /* End of hardware registers */ - 21 * 8, 22 * 8, /* fs_base and gs_base. */ - 15 * 8 /* "orig_rax" */ + 21 * 8, 22 * 8, /* fs_base and gs_base. */ + 15 * 8 /* "orig_rax" */ }; - /* Support for signal handlers. */ -#define LINUX_SIGTRAMP_INSN0 0x48 /* mov $NNNNNNNN, %rax */ -#define LINUX_SIGTRAMP_OFFSET0 0 -#define LINUX_SIGTRAMP_INSN1 0x0f /* syscall */ -#define LINUX_SIGTRAMP_OFFSET1 7 +#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[] = -{ +static const gdb_byte amd64_linux_sigtramp_code[] = { /* 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[] = -{ +static const gdb_byte amd64_x32_linux_sigtramp_code[] = { /* mov $__NR_rt_sigreturn, %rax. */ LINUX_SIGTRAMP_INSN0, 0xc7, 0xc0, 0x01, 0x02, 0x00, 0x40, /* syscall */ @@ -219,11 +204,9 @@ amd64_linux_sigcontext_addr (frame_info_ptr this_frame) at it. */ return sp + AMD64_LINUX_UCONTEXT_SIGCONTEXT_OFFSET; } - static LONGEST -amd64_linux_get_syscall_number (struct gdbarch *gdbarch, - thread_info *thread) +amd64_linux_get_syscall_number (struct gdbarch *gdbarch, thread_info *thread) { struct regcache *regcache = get_thread_regcache (thread); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); @@ -242,50 +225,46 @@ amd64_linux_get_syscall_number (struct gdbarch *gdbarch, return ret; } - /* From . */ -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 */ +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 */ + -1, /* %cs */ + -1, /* %ss */ + -1, /* %ds */ + -1, /* %es */ + -1, /* %fs */ + -1 /* %gs */ }; static int amd64_linux_register_reggroup_p (struct gdbarch *gdbarch, int regnum, const struct reggroup *group) -{ - if (regnum == AMD64_LINUX_ORIG_RAX_REGNUM - || regnum == AMD64_FSBASE_REGNUM +{ + if (regnum == AMD64_LINUX_ORIG_RAX_REGNUM || regnum == AMD64_FSBASE_REGNUM || regnum == AMD64_GSBASE_REGNUM) - return (group == system_reggroup - || group == save_reggroup + return (group == system_reggroup || group == save_reggroup || group == restore_reggroup); return i386_register_reggroup_p (gdbarch, regnum, group); } @@ -367,1079 +346,1080 @@ 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; + 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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_pipe: + case amd64_x32_sys_pipe: + return gdb_sys_pipe; - case amd64_sys_pipe2: - return gdb_sys_pipe2; + case amd64_sys_pipe2: + return gdb_sys_pipe2; - case amd64_sys_getrandom: - return gdb_sys_getrandom; + case amd64_sys_getrandom: + return gdb_sys_getrandom; - case amd64_sys_select: - case amd64_x32_sys_select: - return gdb_sys_select; + 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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_prctl: + case amd64_x32_sys_prctl: + return gdb_sys_prctl; - case amd64_sys_arch_prctl: - case amd64_x32_sys_arch_prctl: - return gdb_sys_no_syscall; /* Note */ + case amd64_sys_arch_prctl: + case amd64_x32_sys_arch_prctl: + return gdb_sys_no_syscall; /* Note */ - case amd64_sys_adjtimex: - case amd64_x32_sys_adjtimex: - return gdb_sys_adjtimex; + 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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_quotactl: + case amd64_x32_sys_quotactl: + return gdb_sys_quotactl; - case amd64_sys_nfsservctl: - return gdb_sys_nfsservctl; + case amd64_sys_nfsservctl: + return gdb_sys_nfsservctl; - case amd64_sys_gettid: - case amd64_x32_sys_gettid: - return gdb_sys_gettid; + 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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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; + case amd64_sys_move_pages: + case amd64_x32_sys_move_pages: + return gdb_sys_move_pages; - default: - return gdb_sys_no_syscall; - } + default: + return gdb_sys_no_syscall; + } DIAGNOSTIC_POP } @@ -1453,12 +1433,12 @@ amd64_canonicalize_syscall (enum amd64_syscall syscall_number) 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 +#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) +amd64_linux_syscall_record_common ( + struct regcache *regcache, struct linux_record_tdep *linux_record_tdep_p) { int ret; ULONGEST syscall_native; @@ -1485,11 +1465,10 @@ amd64_linux_syscall_record_common (struct regcache *regcache, { CORE_ADDR addr; - regcache_raw_read_unsigned (regcache, - linux_record_tdep_p->arg2, + 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)) + if (record_full_arch_list_add_mem ( + addr, linux_record_tdep_p->size_ulong)) return -1; } goto record_regs; @@ -1503,8 +1482,8 @@ amd64_linux_syscall_record_common (struct regcache *regcache, if (syscall_gdb == gdb_sys_no_syscall) { gdb_printf (gdb_stderr, - _("Process record and replay target doesn't " - "support syscall number %s\n"), + _ ("Process record and replay target doesn't " + "support syscall number %s\n"), pulongest (syscall_native)); return -1; } @@ -1516,7 +1495,7 @@ amd64_linux_syscall_record_common (struct regcache *regcache, return ret; } - record_regs: +record_regs: /* Record the return value of the system call. */ if (record_full_arch_list_add_reg (regcache, AMD64_RCX_REGNUM)) return -1; @@ -1540,13 +1519,12 @@ amd64_x32_linux_syscall_record (struct regcache *regcache) &amd64_x32_linux_record_tdep); } -#define AMD64_LINUX_redzone 128 -#define AMD64_LINUX_xstate 512 +#define AMD64_LINUX_redzone 128 +#define AMD64_LINUX_xstate 512 #define AMD64_LINUX_frame_size 560 static int -amd64_linux_record_signal (struct gdbarch *gdbarch, - struct regcache *regcache, +amd64_linux_record_signal (struct gdbarch *gdbarch, struct regcache *regcache, enum gdb_signal signal) { ULONGEST rsp; @@ -1569,8 +1547,8 @@ amd64_linux_record_signal (struct gdbarch *gdbarch, 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)) + + AMD64_LINUX_xstate + + AMD64_LINUX_frame_size)) return -1; if (record_full_arch_list_add_end ()) @@ -1582,30 +1560,33 @@ amd64_linux_record_signal (struct gdbarch *gdbarch, const target_desc * amd64_linux_read_description (uint64_t xcr0_features_bit, bool is_x32) { - static target_desc *amd64_linux_tdescs \ - [2/*AVX*/][2/*MPX*/][2/*AVX512*/][2/*PKRU*/] = {}; - static target_desc *x32_linux_tdescs \ - [2/*AVX*/][2/*AVX512*/][2/*PKRU*/] = {}; + static target_desc + *amd64_linux_tdescs[2 /*AVX*/][2 /*MPX*/][2 /*AVX512*/][2 /*PKRU*/] + = {}; + static target_desc *x32_linux_tdescs[2 /*AVX*/][2 /*AVX512*/][2 /*PKRU*/] + = {}; 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] - [(xcr0_features_bit & X86_XSTATE_PKRU) ? 1 : 0]; + tdesc + = &x32_linux_tdescs[(xcr0_features_bit & X86_XSTATE_AVX) ? 1 : 0] + [(xcr0_features_bit & X86_XSTATE_AVX512) ? 1 : 0] + [(xcr0_features_bit & X86_XSTATE_PKRU) ? 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]; + 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) - *tdesc = amd64_create_target_description (xcr0_features_bit, is_x32, - true, true); + *tdesc = amd64_create_target_description (xcr0_features_bit, is_x32, true, + true); return *tdesc; } @@ -1614,8 +1595,7 @@ amd64_linux_read_description (uint64_t xcr0_features_bit, bool is_x32) static const struct target_desc * amd64_linux_core_read_description (struct gdbarch *gdbarch, - struct target_ops *target, - bfd *abfd) + struct target_ops *target, bfd *abfd) { /* Linux/x86-64. */ uint64_t xcr0 = i386_linux_core_read_xcr0 (abfd); @@ -1638,18 +1618,15 @@ amd64_linux_supply_xstateregset (const struct regset *regset, static void amd64_linux_collect_xstateregset (const struct regset *regset, - const struct regcache *regcache, - int regnum, void *xstateregs, size_t len) + 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 - }; +static const struct regset amd64_linux_xstateregset + = { NULL, amd64_linux_supply_xstateregset, + amd64_linux_collect_xstateregset }; /* Iterate over core file register note sections. */ @@ -1663,23 +1640,24 @@ amd64_linux_iterate_over_regset_sections (struct gdbarch *gdbarch, 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), - &amd64_linux_xstateregset, "XSAVE extended state", cb_data); + cb (".reg-xstate", X86_XSTATE_SIZE (tdep->xcr0), + X86_XSTATE_SIZE (tdep->xcr0), &amd64_linux_xstateregset, + "XSAVE extended state", cb_data); } /* 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 + /* 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 + /* xor %rax, %rax */ 0x48, 0x33, 0xc0, + /* ret */ 0xc3, + /* nop */ 0x90 }; /* The instruction sequence used in x86_64 machines for enabling a @@ -1710,7 +1688,7 @@ amd64_dtrace_probe_is_enabled (struct gdbarch *gdbarch, CORE_ADDR addr) 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); @@ -1744,8 +1722,7 @@ amd64_dtrace_disable_probe (struct gdbarch *gdbarch, CORE_ADDR addr) in gdbarch.h. */ static expr::operation_up -amd64_dtrace_parse_probe_argument (struct gdbarch *gdbarch, - int narg) +amd64_dtrace_parse_probe_argument (struct gdbarch *gdbarch, int narg) { /* DTrace probe arguments can be found on the ABI-defined places for regular arguments at the current PC. The probe abstraction @@ -1755,15 +1732,14 @@ amd64_dtrace_parse_probe_argument (struct gdbarch *gdbarch, 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. */ - }; + 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); return make_operation (regname); @@ -1771,30 +1747,31 @@ amd64_dtrace_parse_probe_argument (struct gdbarch *gdbarch, else { /* Additional arguments are passed on the stack. */ - const char *regname = user_reg_map_regnum_to_name (gdbarch, AMD64_RSP_REGNUM); + const char *regname + = user_reg_map_regnum_to_name (gdbarch, AMD64_RSP_REGNUM); /* Displacement. */ struct type *long_type = builtin_type (gdbarch)->builtin_long; - operation_up disp = make_operation (long_type, - narg - 6); + operation_up disp + = make_operation (long_type, narg - 6); /* Register: SP. */ operation_up reg = make_operation (regname); - operation_up add = make_operation (std::move (disp), - std::move (reg)); + operation_up add + = make_operation (std::move (disp), std::move (reg)); /* Cast to long. */ - operation_up cast = make_operation (std::move (add), - long_type); + operation_up cast + = make_operation (std::move (add), long_type); return make_operation (std::move (cast)); } } static void -amd64_linux_init_abi_common(struct gdbarch_info info, struct gdbarch *gdbarch, - int num_disp_step_buffers) +amd64_linux_init_abi_common (struct gdbarch_info info, struct gdbarch *gdbarch, + int num_disp_step_buffers) { i386_gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); @@ -1814,8 +1791,7 @@ amd64_linux_init_abi_common(struct gdbarch_info info, struct gdbarch *gdbarch, /* Functions for 'catch syscall'. */ set_xml_syscall_file_name (gdbarch, XML_SYSCALL_FILENAME_AMD64); - set_gdbarch_get_syscall_number (gdbarch, - amd64_linux_get_syscall_number); + set_gdbarch_get_syscall_number (gdbarch, amd64_linux_get_syscall_number); /* Enable TLS support. */ set_gdbarch_fetch_tls_load_module_address (gdbarch, @@ -1828,8 +1804,8 @@ amd64_linux_init_abi_common(struct gdbarch_info info, struct gdbarch *gdbarch, set_gdbarch_skip_solib_resolver (gdbarch, glibc_skip_solib_resolver); /* Iterate over core file register note sections. */ - set_gdbarch_iterate_over_regset_sections - (gdbarch, amd64_linux_iterate_over_regset_sections); + set_gdbarch_iterate_over_regset_sections ( + gdbarch, amd64_linux_iterate_over_regset_sections); set_gdbarch_core_read_description (gdbarch, amd64_linux_core_read_description); @@ -1873,8 +1849,7 @@ amd64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) return; valid_p = tdesc_numbered_register (feature, tdesc_data, - AMD64_LINUX_ORIG_RAX_REGNUM, - "orig_rax"); + AMD64_LINUX_ORIG_RAX_REGNUM, "orig_rax"); if (!valid_p) return; @@ -2050,11 +2025,12 @@ amd64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) tdep->i386_syscall_record = amd64_linux_syscall_record; /* GNU/Linux uses SVR4-style shared libraries. */ - set_solib_svr4_fetch_link_map_offsets - (gdbarch, linux_lp64_fetch_link_map_offsets); + set_solib_svr4_fetch_link_map_offsets (gdbarch, + linux_lp64_fetch_link_map_offsets); /* Register DTrace handlers. */ - set_gdbarch_dtrace_parse_probe_argument (gdbarch, amd64_dtrace_parse_probe_argument); + 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); @@ -2088,8 +2064,7 @@ amd64_x32_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) return; valid_p = tdesc_numbered_register (feature, tdesc_data, - AMD64_LINUX_ORIG_RAX_REGNUM, - "orig_rax"); + AMD64_LINUX_ORIG_RAX_REGNUM, "orig_rax"); if (!valid_p) return; @@ -2222,7 +2197,8 @@ amd64_x32_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) 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_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; @@ -2264,16 +2240,17 @@ amd64_x32_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) tdep->i386_syscall_record = amd64_x32_linux_syscall_record; /* GNU/Linux uses SVR4-style shared libraries. */ - set_solib_svr4_fetch_link_map_offsets - (gdbarch, linux_ilp32_fetch_link_map_offsets); + set_solib_svr4_fetch_link_map_offsets (gdbarch, + linux_ilp32_fetch_link_map_offsets); } void _initialize_amd64_linux_tdep (); + void _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); + 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); } diff --git a/gdb/amd64-linux-tdep.h b/gdb/amd64-linux-tdep.h index c253ae8..d93ac86 100644 --- a/gdb/amd64-linux-tdep.h +++ b/gdb/amd64-linux-tdep.h @@ -53,7 +53,8 @@ const target_desc *amd64_linux_read_description (uint64_t xcr0_features_bit, Used for process record/replay, these will be translated into a gdb-canonical set of syscall ids in linux-record.c. */ -enum amd64_syscall { +enum amd64_syscall +{ amd64_sys_read = 0, amd64_sys_write = 1, amd64_sys_open = 2, @@ -328,7 +329,8 @@ enum amd64_syscall { Used for process record/replay, these will be translated into a gdb-canonical set of syscall ids in linux-record.c. */ -enum amd64_x32_syscall { +enum amd64_x32_syscall +{ amd64_x32_syscall_bit = 0x40000000, amd64_x32_sys_read = (amd64_x32_syscall_bit + 0), amd64_x32_sys_write = (amd64_x32_syscall_bit + 1), diff --git a/gdb/amd64-nat.c b/gdb/amd64-nat.c index dfe1b5c..059dff9 100644 --- a/gdb/amd64-nat.c +++ b/gdb/amd64-nat.c @@ -80,13 +80,12 @@ amd64_native_gregset_supplies_p (struct gdbarch *gdbarch, int regnum) return (amd64_native_gregset_reg_offset (gdbarch, regnum) != -1); } - /* Supply register REGNUM, whose contents are stored in GREGS, to REGCACHE. If REGNUM is -1, supply all appropriate registers. */ void -amd64_supply_native_gregset (struct regcache *regcache, - const void *gregs, int regnum) +amd64_supply_native_gregset (struct regcache *regcache, const void *gregs, + int regnum) { const char *regs = (const char *) gregs; struct gdbarch *gdbarch = regcache->arch (); @@ -116,8 +115,8 @@ amd64_supply_native_gregset (struct regcache *regcache, registers. */ void -amd64_collect_native_gregset (const struct regcache *regcache, - void *gregs, int regnum) +amd64_collect_native_gregset (const struct regcache *regcache, void *gregs, + int regnum) { char *regs = (char *) gregs; struct gdbarch *gdbarch = regcache->arch (); diff --git a/gdb/amd64-netbsd-nat.c b/gdb/amd64-netbsd-nat.c index 14a762e..b93a9f5 100644 --- a/gdb/amd64-netbsd-nat.c +++ b/gdb/amd64-netbsd-nat.c @@ -34,29 +34,29 @@ little-endian we get away with that. */ /* From . */ -static int amd64nbsd32_r_reg_offset[] = -{ - 14 * 8, /* %eax */ - 3 * 8, /* %ecx */ - 2 * 8, /* %edx */ - 13 * 8, /* %ebx */ - 24 * 8, /* %esp */ - 12 * 8, /* %ebp */ - 1 * 8, /* %esi */ - 0 * 8, /* %edi */ - 21 * 8, /* %eip */ - 23 * 8, /* %eflags */ - 22 * 8, /* %cs */ - 25 * 8, /* %ss */ - 18 * 8, /* %ds */ - 17 * 8, /* %es */ - 16 * 8, /* %fs */ - 15 * 8 /* %gs */ +static int amd64nbsd32_r_reg_offset[] = { + 14 * 8, /* %eax */ + 3 * 8, /* %ecx */ + 2 * 8, /* %edx */ + 13 * 8, /* %ebx */ + 24 * 8, /* %esp */ + 12 * 8, /* %ebp */ + 1 * 8, /* %esi */ + 0 * 8, /* %edi */ + 21 * 8, /* %eip */ + 23 * 8, /* %eflags */ + 22 * 8, /* %cs */ + 25 * 8, /* %ss */ + 18 * 8, /* %ds */ + 17 * 8, /* %es */ + 16 * 8, /* %fs */ + 15 * 8 /* %gs */ }; static amd64_bsd_nat_target the_amd64_nbsd_nat_target; void _initialize_amd64nbsd_nat (); + void _initialize_amd64nbsd_nat () { diff --git a/gdb/amd64-netbsd-tdep.c b/gdb/amd64-netbsd-tdep.c index e5de499..c124a25 100644 --- a/gdb/amd64-netbsd-tdep.c +++ b/gdb/amd64-netbsd-tdep.c @@ -59,39 +59,32 @@ amd64nbsd_mcontext_addr (frame_info_ptr this_frame) /* The mcontext structure lives as offset 56 in `struct ucontext'. */ return addr + 56; } - + /* NetBSD 2.0 or later. */ /* Mapping between the general-purpose registers in `struct reg' format and GDB's register cache layout. */ /* From . */ -int amd64nbsd_r_reg_offset[] = -{ - 14 * 8, /* %rax */ - 13 * 8, /* %rbx */ - 3 * 8, /* %rcx */ - 2 * 8, /* %rdx */ - 1 * 8, /* %rsi */ - 0 * 8, /* %rdi */ - 12 * 8, /* %rbp */ - 24 * 8, /* %rsp */ - 4 * 8, /* %r8 .. */ - 5 * 8, - 6 * 8, - 7 * 8, - 8 * 8, - 9 * 8, - 10 * 8, - 11 * 8, /* ... %r15 */ - 21 * 8, /* %rip */ - 23 * 8, /* %eflags */ - 22 * 8, /* %cs */ - 25 * 8, /* %ss */ - 18 * 8, /* %ds */ - 17 * 8, /* %es */ - 16 * 8, /* %fs */ - 15 * 8 /* %gs */ +int amd64nbsd_r_reg_offset[] = { + 14 * 8, /* %rax */ + 13 * 8, /* %rbx */ + 3 * 8, /* %rcx */ + 2 * 8, /* %rdx */ + 1 * 8, /* %rsi */ + 0 * 8, /* %rdi */ + 12 * 8, /* %rbp */ + 24 * 8, /* %rsp */ + 4 * 8, /* %r8 .. */ + 5 * 8, 6 * 8, 7 * 8, 8 * 8, 9 * 8, 10 * 8, 11 * 8, /* ... %r15 */ + 21 * 8, /* %rip */ + 23 * 8, /* %eflags */ + 22 * 8, /* %cs */ + 25 * 8, /* %ss */ + 18 * 8, /* %ds */ + 17 * 8, /* %es */ + 16 * 8, /* %fs */ + 15 * 8 /* %gs */ }; static void @@ -117,17 +110,18 @@ amd64nbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) tdep->sc_num_regs = ARRAY_SIZE (amd64nbsd_r_reg_offset); /* NetBSD uses SVR4-style shared libraries. */ - set_solib_svr4_fetch_link_map_offsets - (gdbarch, svr4_lp64_fetch_link_map_offsets); + set_solib_svr4_fetch_link_map_offsets (gdbarch, + svr4_lp64_fetch_link_map_offsets); } void _initialize_amd64nbsd_tdep (); + void _initialize_amd64nbsd_tdep () { /* The NetBSD/amd64 native dependent code makes this assumption. */ gdb_assert (ARRAY_SIZE (amd64nbsd_r_reg_offset) == AMD64_NUM_GREGS); - gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64, - GDB_OSABI_NETBSD, amd64nbsd_init_abi); + gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64, GDB_OSABI_NETBSD, + amd64nbsd_init_abi); } diff --git a/gdb/amd64-obsd-nat.c b/gdb/amd64-obsd-nat.c index c053514..be9bdfd 100644 --- a/gdb/amd64-obsd-nat.c +++ b/gdb/amd64-obsd-nat.c @@ -36,26 +36,24 @@ little-endian we get away with that. */ /* From . */ -static int amd64obsd32_r_reg_offset[] = -{ - 14 * 8, /* %eax */ - 3 * 8, /* %ecx */ - 2 * 8, /* %edx */ - 13 * 8, /* %ebx */ - 15 * 8, /* %esp */ - 12 * 8, /* %ebp */ - 1 * 8, /* %esi */ - 0 * 8, /* %edi */ - 16 * 8, /* %eip */ - 17 * 8, /* %eflags */ - 18 * 8, /* %cs */ - 19 * 8, /* %ss */ - 20 * 8, /* %ds */ - 21 * 8, /* %es */ - 22 * 8, /* %fs */ - 23 * 8 /* %gs */ +static int amd64obsd32_r_reg_offset[] = { + 14 * 8, /* %eax */ + 3 * 8, /* %ecx */ + 2 * 8, /* %edx */ + 13 * 8, /* %ebx */ + 15 * 8, /* %esp */ + 12 * 8, /* %ebp */ + 1 * 8, /* %esi */ + 0 * 8, /* %edi */ + 16 * 8, /* %eip */ + 17 * 8, /* %eflags */ + 18 * 8, /* %cs */ + 19 * 8, /* %ss */ + 20 * 8, /* %ds */ + 21 * 8, /* %es */ + 22 * 8, /* %fs */ + 23 * 8 /* %gs */ }; - /* Support for debugging kernel virtual memory images. */ @@ -129,6 +127,7 @@ amd64obsd_supply_pcb (struct regcache *regcache, struct pcb *pcb) static amd64_bsd_nat_target the_amd64_obsd_nat_target; void _initialize_amd64obsd_nat (); + void _initialize_amd64obsd_nat () { diff --git a/gdb/amd64-obsd-tdep.c b/gdb/amd64-obsd-tdep.c index 624c8ce..f48d624 100644 --- a/gdb/amd64-obsd-tdep.c +++ b/gdb/amd64-obsd-tdep.c @@ -49,17 +49,13 @@ amd64obsd_sigtramp_p (frame_info_ptr this_frame) { CORE_ADDR pc = get_frame_pc (this_frame); CORE_ADDR start_pc = (pc & ~(amd64obsd_page_size - 1)); - const gdb_byte osigreturn[] = - { - 0x48, 0xc7, 0xc0, - 0x67, 0x00, 0x00, 0x00, /* movq $SYS_sigreturn, %rax */ - 0xcd, 0x80 /* int $0x80 */ + const gdb_byte osigreturn[] = { + 0x48, 0xc7, 0xc0, 0x67, 0x00, 0x00, 0x00, /* movq $SYS_sigreturn, %rax */ + 0xcd, 0x80 /* int $0x80 */ }; - const gdb_byte sigreturn[] = - { - 0x48, 0xc7, 0xc0, - 0x67, 0x00, 0x00, 0x00, /* movq $SYS_sigreturn, %rax */ - 0x0f, 0x05 /* syscall */ + const gdb_byte sigreturn[] = { + 0x48, 0xc7, 0xc0, 0x67, 0x00, 0x00, 0x00, /* movq $SYS_sigreturn, %rax */ + 0x0f, 0x05 /* syscall */ }; size_t buflen = (sizeof sigreturn) + 1; gdb_byte *buf; @@ -78,7 +74,7 @@ amd64obsd_sigtramp_p (frame_info_ptr this_frame) /* If we can't read the instructions at START_PC, return zero. */ buf = (gdb_byte *) alloca ((sizeof sigreturn) + 1); - if (!safe_frame_unwind_memory (this_frame, start_pc + 6, {buf, buflen})) + if (!safe_frame_unwind_memory (this_frame, start_pc + 6, { buf, buflen })) return 0; /* Check for sigreturn(2). Depending on how the assembler encoded @@ -120,106 +116,85 @@ amd64obsd_sigcontext_addr (frame_info_ptr this_frame) else return get_frame_register_unsigned (this_frame, AMD64_RSP_REGNUM); } - + /* OpenBSD 3.5 or later. */ /* Mapping between the general-purpose registers in `struct reg' format and GDB's register cache layout. */ /* From . */ -int amd64obsd_r_reg_offset[] = -{ - 14 * 8, /* %rax */ - 13 * 8, /* %rbx */ - 3 * 8, /* %rcx */ - 2 * 8, /* %rdx */ - 1 * 8, /* %rsi */ - 0 * 8, /* %rdi */ - 12 * 8, /* %rbp */ - 15 * 8, /* %rsp */ - 4 * 8, /* %r8 .. */ - 5 * 8, - 6 * 8, - 7 * 8, - 8 * 8, - 9 * 8, - 10 * 8, - 11 * 8, /* ... %r15 */ - 16 * 8, /* %rip */ - 17 * 8, /* %eflags */ - 18 * 8, /* %cs */ - 19 * 8, /* %ss */ - 20 * 8, /* %ds */ - 21 * 8, /* %es */ - 22 * 8, /* %fs */ - 23 * 8 /* %gs */ +int amd64obsd_r_reg_offset[] = { + 14 * 8, /* %rax */ + 13 * 8, /* %rbx */ + 3 * 8, /* %rcx */ + 2 * 8, /* %rdx */ + 1 * 8, /* %rsi */ + 0 * 8, /* %rdi */ + 12 * 8, /* %rbp */ + 15 * 8, /* %rsp */ + 4 * 8, /* %r8 .. */ + 5 * 8, 6 * 8, 7 * 8, 8 * 8, 9 * 8, 10 * 8, 11 * 8, /* ... %r15 */ + 16 * 8, /* %rip */ + 17 * 8, /* %eflags */ + 18 * 8, /* %cs */ + 19 * 8, /* %ss */ + 20 * 8, /* %ds */ + 21 * 8, /* %es */ + 22 * 8, /* %fs */ + 23 * 8 /* %gs */ }; /* From . */ -static int amd64obsd_sc_reg_offset[] = -{ - 14 * 8, /* %rax */ - 13 * 8, /* %rbx */ - 3 * 8, /* %rcx */ - 2 * 8, /* %rdx */ - 1 * 8, /* %rsi */ - 0 * 8, /* %rdi */ - 12 * 8, /* %rbp */ - 24 * 8, /* %rsp */ - 4 * 8, /* %r8 ... */ - 5 * 8, - 6 * 8, - 7 * 8, - 8 * 8, - 9 * 8, - 10 * 8, - 11 * 8, /* ... %r15 */ - 21 * 8, /* %rip */ - 23 * 8, /* %eflags */ - 22 * 8, /* %cs */ - 25 * 8, /* %ss */ - 18 * 8, /* %ds */ - 17 * 8, /* %es */ - 16 * 8, /* %fs */ - 15 * 8 /* %gs */ +static int amd64obsd_sc_reg_offset[] = { + 14 * 8, /* %rax */ + 13 * 8, /* %rbx */ + 3 * 8, /* %rcx */ + 2 * 8, /* %rdx */ + 1 * 8, /* %rsi */ + 0 * 8, /* %rdi */ + 12 * 8, /* %rbp */ + 24 * 8, /* %rsp */ + 4 * 8, /* %r8 ... */ + 5 * 8, 6 * 8, 7 * 8, 8 * 8, 9 * 8, 10 * 8, 11 * 8, /* ... %r15 */ + 21 * 8, /* %rip */ + 23 * 8, /* %eflags */ + 22 * 8, /* %cs */ + 25 * 8, /* %ss */ + 18 * 8, /* %ds */ + 17 * 8, /* %es */ + 16 * 8, /* %fs */ + 15 * 8 /* %gs */ }; /* From /usr/src/lib/libpthread/arch/amd64/uthread_machdep.c. */ -static int amd64obsd_uthread_reg_offset[] = -{ - 19 * 8, /* %rax */ - 16 * 8, /* %rbx */ - 18 * 8, /* %rcx */ - 17 * 8, /* %rdx */ - 14 * 8, /* %rsi */ - 13 * 8, /* %rdi */ - 15 * 8, /* %rbp */ - -1, /* %rsp */ - 12 * 8, /* %r8 ... */ - 11 * 8, - 10 * 8, - 9 * 8, - 8 * 8, - 7 * 8, - 6 * 8, - 5 * 8, /* ... %r15 */ - 20 * 8, /* %rip */ - 4 * 8, /* %eflags */ - 21 * 8, /* %cs */ - -1, /* %ss */ - 3 * 8, /* %ds */ - 2 * 8, /* %es */ - 1 * 8, /* %fs */ - 0 * 8 /* %gs */ +static int amd64obsd_uthread_reg_offset[] = { + 19 * 8, /* %rax */ + 16 * 8, /* %rbx */ + 18 * 8, /* %rcx */ + 17 * 8, /* %rdx */ + 14 * 8, /* %rsi */ + 13 * 8, /* %rdi */ + 15 * 8, /* %rbp */ + -1, /* %rsp */ + 12 * 8, /* %r8 ... */ + 11 * 8, 10 * 8, 9 * 8, 8 * 8, 7 * 8, 6 * 8, 5 * 8, /* ... %r15 */ + 20 * 8, /* %rip */ + 4 * 8, /* %eflags */ + 21 * 8, /* %cs */ + -1, /* %ss */ + 3 * 8, /* %ds */ + 2 * 8, /* %es */ + 1 * 8, /* %fs */ + 0 * 8 /* %gs */ }; /* Offset within the thread structure where we can find the saved stack pointer (%esp). */ -#define AMD64OBSD_UTHREAD_RSP_OFFSET 400 +#define AMD64OBSD_UTHREAD_RSP_OFFSET 400 static void -amd64obsd_supply_uthread (struct regcache *regcache, - int regnum, CORE_ADDR addr) +amd64obsd_supply_uthread (struct regcache *regcache, int regnum, + CORE_ADDR addr) { struct gdbarch *gdbarch = regcache->arch (); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); @@ -262,8 +237,8 @@ amd64obsd_supply_uthread (struct regcache *regcache, } static void -amd64obsd_collect_uthread (const struct regcache *regcache, - int regnum, CORE_ADDR addr) +amd64obsd_collect_uthread (const struct regcache *regcache, int regnum, + CORE_ADDR addr) { struct gdbarch *gdbarch = regcache->arch (); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); @@ -308,6 +283,7 @@ amd64obsd_collect_uthread (const struct regcache *regcache, } } } + /* Kernel debugging support. */ /* From . Easy since `struct trapframe' matches @@ -336,7 +312,7 @@ amd64obsd_trapframe_cache (frame_info_ptr this_frame, void **this_cache) find_pc_partial_function (func, &name, NULL, NULL); if (name && startswith (name, "Xintr")) - addr = sp + 8; /* It's an interrupt frame. */ + addr = sp + 8; /* It's an interrupt frame. */ else addr = sp; @@ -362,12 +338,12 @@ amd64obsd_trapframe_cache (frame_info_ptr this_frame, void **this_cache) } static void -amd64obsd_trapframe_this_id (frame_info_ptr this_frame, - void **this_cache, struct frame_id *this_id) +amd64obsd_trapframe_this_id (frame_info_ptr this_frame, void **this_cache, + struct frame_id *this_id) { - struct trad_frame_cache *cache = - amd64obsd_trapframe_cache (this_frame, this_cache); - + struct trad_frame_cache *cache + = amd64obsd_trapframe_cache (this_frame, this_cache); + trad_frame_get_id (cache, this_id); } @@ -375,8 +351,8 @@ static struct value * amd64obsd_trapframe_prev_register (frame_info_ptr this_frame, void **this_cache, int regnum) { - struct trad_frame_cache *cache = - amd64obsd_trapframe_cache (this_frame, this_cache); + struct trad_frame_cache *cache + = amd64obsd_trapframe_cache (this_frame, this_cache); return trad_frame_get_register (cache, this_frame, regnum); } @@ -396,14 +372,14 @@ amd64obsd_trapframe_sniffer (const struct frame_unwind *self, return 0; find_pc_partial_function (get_frame_pc (this_frame), &name, NULL, NULL); - return (name && ((strcmp (name, "calltrap") == 0) - || (strcmp (name, "osyscall1") == 0) - || (strcmp (name, "Xsyscall") == 0) - || (startswith (name, "Xintr")))); + return (name + && ((strcmp (name, "calltrap") == 0) + || (strcmp (name, "osyscall1") == 0) + || (strcmp (name, "Xsyscall") == 0) + || (startswith (name, "Xintr")))); } -static const struct frame_unwind amd64obsd_trapframe_unwind = -{ +static const struct frame_unwind amd64obsd_trapframe_unwind = { /* FIXME: kettenis/20051219: This really is more like an interrupt frame, but SIGTRAMP_FRAME would print , which really is not what we want here. */ @@ -415,7 +391,6 @@ static const struct frame_unwind amd64obsd_trapframe_unwind = NULL, amd64obsd_trapframe_sniffer }; - static void amd64obsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) @@ -443,20 +418,21 @@ amd64obsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) bsd_uthread_set_collect_uthread (gdbarch, amd64obsd_collect_uthread); /* OpenBSD uses SVR4-style shared libraries. */ - set_solib_svr4_fetch_link_map_offsets - (gdbarch, svr4_lp64_fetch_link_map_offsets); + set_solib_svr4_fetch_link_map_offsets (gdbarch, + svr4_lp64_fetch_link_map_offsets); /* Unwind kernel trap frames correctly. */ frame_unwind_prepend_unwinder (gdbarch, &amd64obsd_trapframe_unwind); } void _initialize_amd64obsd_tdep (); + void _initialize_amd64obsd_tdep () { /* The OpenBSD/amd64 native dependent code makes this assumption. */ gdb_assert (ARRAY_SIZE (amd64obsd_r_reg_offset) == AMD64_NUM_GREGS); - gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64, - GDB_OSABI_OPENBSD, amd64obsd_init_abi); + gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64, GDB_OSABI_OPENBSD, + amd64obsd_init_abi); } diff --git a/gdb/amd64-ravenscar-thread.c b/gdb/amd64-ravenscar-thread.c index 8b147d8..8a87fa4 100644 --- a/gdb/amd64-ravenscar-thread.c +++ b/gdb/amd64-ravenscar-thread.c @@ -41,8 +41,7 @@ R15 : System.Address; end record; */ -static const int register_layout[] = -{ +static const int register_layout[] = { /* RAX */ -1, /* RBX */ 3 * 8, /* RCX */ -1, diff --git a/gdb/amd64-sol2-tdep.c b/gdb/amd64-sol2-tdep.c index 97aecc7..cb732db 100644 --- a/gdb/amd64-sol2-tdep.c +++ b/gdb/amd64-sol2-tdep.c @@ -36,32 +36,25 @@ /* From . */ static int amd64_sol2_gregset_reg_offset[] = { - 14 * 8, /* %rax */ - 11 * 8, /* %rbx */ - 13 * 8, /* %rcx */ - 12 * 8, /* %rdx */ - 9 * 8, /* %rsi */ - 8 * 8, /* %rdi */ - 10 * 8, /* %rbp */ - 20 * 8, /* %rsp */ - 7 * 8, /* %r8 ... */ - 6 * 8, - 5 * 8, - 4 * 8, - 3 * 8, - 2 * 8, - 1 * 8, - 0 * 8, /* ... %r15 */ - 17 * 8, /* %rip */ - 19 * 8, /* %eflags */ - 18 * 8, /* %cs */ - 21 * 8, /* %ss */ - 25 * 8, /* %ds */ - 24 * 8, /* %es */ - 22 * 8, /* %fs */ - 23 * 8 /* %gs */ + 14 * 8, /* %rax */ + 11 * 8, /* %rbx */ + 13 * 8, /* %rcx */ + 12 * 8, /* %rdx */ + 9 * 8, /* %rsi */ + 8 * 8, /* %rdi */ + 10 * 8, /* %rbp */ + 20 * 8, /* %rsp */ + 7 * 8, /* %r8 ... */ + 6 * 8, 5 * 8, 4 * 8, 3 * 8, 2 * 8, 1 * 8, 0 * 8, /* ... %r15 */ + 17 * 8, /* %rip */ + 19 * 8, /* %eflags */ + 18 * 8, /* %cs */ + 21 * 8, /* %ss */ + 25 * 8, /* %ds */ + 24 * 8, /* %es */ + 22 * 8, /* %fs */ + 23 * 8 /* %gs */ }; - /* Solaris doesn't have a 'struct sigcontext', but it does have a 'mcontext_t' that contains the saved set of machine registers. */ @@ -97,14 +90,15 @@ amd64_sol2_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) tdep->sc_num_regs = tdep->gregset_num_regs; /* Solaris uses SVR4-style shared libraries. */ - set_solib_svr4_fetch_link_map_offsets - (gdbarch, svr4_lp64_fetch_link_map_offsets); + set_solib_svr4_fetch_link_map_offsets (gdbarch, + svr4_lp64_fetch_link_map_offsets); } void _initialize_amd64_sol2_tdep (); + void _initialize_amd64_sol2_tdep () { - gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64, - GDB_OSABI_SOLARIS, amd64_sol2_init_abi); + gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64, GDB_OSABI_SOLARIS, + amd64_sol2_init_abi); } diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c index 328e001..73b76ee 100644 --- a/gdb/amd64-tdep.c +++ b/gdb/amd64-tdep.c @@ -60,110 +60,121 @@ /* Register information. */ -static const char * const amd64_register_names[] = -{ - "rax", "rbx", "rcx", "rdx", "rsi", "rdi", "rbp", "rsp", +static const char *const amd64_register_names[] = { + "rax", + "rbx", + "rcx", + "rdx", + "rsi", + "rdi", + "rbp", + "rsp", /* %r8 is indeed register number 8. */ - "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", - "rip", "eflags", "cs", "ss", "ds", "es", "fs", "gs", + "r8", + "r9", + "r10", + "r11", + "r12", + "r13", + "r14", + "r15", + "rip", + "eflags", + "cs", + "ss", + "ds", + "es", + "fs", + "gs", /* %st0 is register number 24. */ - "st0", "st1", "st2", "st3", "st4", "st5", "st6", "st7", - "fctrl", "fstat", "ftag", "fiseg", "fioff", "foseg", "fooff", "fop", + "st0", + "st1", + "st2", + "st3", + "st4", + "st5", + "st6", + "st7", + "fctrl", + "fstat", + "ftag", + "fiseg", + "fioff", + "foseg", + "fooff", + "fop", /* %xmm0 is register number 40. */ - "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7", - "xmm8", "xmm9", "xmm10", "xmm11", "xmm12", "xmm13", "xmm14", "xmm15", + "xmm0", + "xmm1", + "xmm2", + "xmm3", + "xmm4", + "xmm5", + "xmm6", + "xmm7", + "xmm8", + "xmm9", + "xmm10", + "xmm11", + "xmm12", + "xmm13", + "xmm14", + "xmm15", "mxcsr", }; -static const char * const amd64_ymm_names[] = -{ - "ymm0", "ymm1", "ymm2", "ymm3", - "ymm4", "ymm5", "ymm6", "ymm7", - "ymm8", "ymm9", "ymm10", "ymm11", - "ymm12", "ymm13", "ymm14", "ymm15" -}; +static const char *const amd64_ymm_names[] + = { "ymm0", "ymm1", "ymm2", "ymm3", "ymm4", "ymm5", "ymm6", "ymm7", + "ymm8", "ymm9", "ymm10", "ymm11", "ymm12", "ymm13", "ymm14", "ymm15" }; -static const char * const amd64_ymm_avx512_names[] = -{ - "ymm16", "ymm17", "ymm18", "ymm19", - "ymm20", "ymm21", "ymm22", "ymm23", - "ymm24", "ymm25", "ymm26", "ymm27", - "ymm28", "ymm29", "ymm30", "ymm31" -}; +static const char *const amd64_ymm_avx512_names[] + = { "ymm16", "ymm17", "ymm18", "ymm19", "ymm20", "ymm21", "ymm22", "ymm23", + "ymm24", "ymm25", "ymm26", "ymm27", "ymm28", "ymm29", "ymm30", "ymm31" }; -static const char * const amd64_ymmh_names[] = -{ - "ymm0h", "ymm1h", "ymm2h", "ymm3h", - "ymm4h", "ymm5h", "ymm6h", "ymm7h", - "ymm8h", "ymm9h", "ymm10h", "ymm11h", - "ymm12h", "ymm13h", "ymm14h", "ymm15h" -}; +static const char *const amd64_ymmh_names[] + = { "ymm0h", "ymm1h", "ymm2h", "ymm3h", "ymm4h", "ymm5h", + "ymm6h", "ymm7h", "ymm8h", "ymm9h", "ymm10h", "ymm11h", + "ymm12h", "ymm13h", "ymm14h", "ymm15h" }; -static const char * const amd64_ymmh_avx512_names[] = -{ - "ymm16h", "ymm17h", "ymm18h", "ymm19h", - "ymm20h", "ymm21h", "ymm22h", "ymm23h", - "ymm24h", "ymm25h", "ymm26h", "ymm27h", - "ymm28h", "ymm29h", "ymm30h", "ymm31h" -}; +static const char *const amd64_ymmh_avx512_names[] + = { "ymm16h", "ymm17h", "ymm18h", "ymm19h", "ymm20h", "ymm21h", + "ymm22h", "ymm23h", "ymm24h", "ymm25h", "ymm26h", "ymm27h", + "ymm28h", "ymm29h", "ymm30h", "ymm31h" }; -static const char * const amd64_mpx_names[] = -{ - "bnd0raw", "bnd1raw", "bnd2raw", "bnd3raw", "bndcfgu", "bndstatus" -}; +static const char *const amd64_mpx_names[] + = { "bnd0raw", "bnd1raw", "bnd2raw", "bnd3raw", "bndcfgu", "bndstatus" }; -static const char * const amd64_k_names[] = -{ - "k0", "k1", "k2", "k3", - "k4", "k5", "k6", "k7" -}; +static const char *const amd64_k_names[] + = { "k0", "k1", "k2", "k3", "k4", "k5", "k6", "k7" }; -static const char * const amd64_zmmh_names[] = -{ - "zmm0h", "zmm1h", "zmm2h", "zmm3h", - "zmm4h", "zmm5h", "zmm6h", "zmm7h", - "zmm8h", "zmm9h", "zmm10h", "zmm11h", - "zmm12h", "zmm13h", "zmm14h", "zmm15h", - "zmm16h", "zmm17h", "zmm18h", "zmm19h", - "zmm20h", "zmm21h", "zmm22h", "zmm23h", - "zmm24h", "zmm25h", "zmm26h", "zmm27h", - "zmm28h", "zmm29h", "zmm30h", "zmm31h" -}; +static const char *const amd64_zmmh_names[] + = { "zmm0h", "zmm1h", "zmm2h", "zmm3h", "zmm4h", "zmm5h", "zmm6h", + "zmm7h", "zmm8h", "zmm9h", "zmm10h", "zmm11h", "zmm12h", "zmm13h", + "zmm14h", "zmm15h", "zmm16h", "zmm17h", "zmm18h", "zmm19h", "zmm20h", + "zmm21h", "zmm22h", "zmm23h", "zmm24h", "zmm25h", "zmm26h", "zmm27h", + "zmm28h", "zmm29h", "zmm30h", "zmm31h" }; -static const char * const amd64_zmm_names[] = -{ - "zmm0", "zmm1", "zmm2", "zmm3", - "zmm4", "zmm5", "zmm6", "zmm7", - "zmm8", "zmm9", "zmm10", "zmm11", - "zmm12", "zmm13", "zmm14", "zmm15", - "zmm16", "zmm17", "zmm18", "zmm19", - "zmm20", "zmm21", "zmm22", "zmm23", - "zmm24", "zmm25", "zmm26", "zmm27", - "zmm28", "zmm29", "zmm30", "zmm31" -}; +static const char *const amd64_zmm_names[] + = { "zmm0", "zmm1", "zmm2", "zmm3", "zmm4", "zmm5", "zmm6", "zmm7", + "zmm8", "zmm9", "zmm10", "zmm11", "zmm12", "zmm13", "zmm14", "zmm15", + "zmm16", "zmm17", "zmm18", "zmm19", "zmm20", "zmm21", "zmm22", "zmm23", + "zmm24", "zmm25", "zmm26", "zmm27", "zmm28", "zmm29", "zmm30", "zmm31" }; -static const char * const amd64_xmm_avx512_names[] = { - "xmm16", "xmm17", "xmm18", "xmm19", - "xmm20", "xmm21", "xmm22", "xmm23", - "xmm24", "xmm25", "xmm26", "xmm27", - "xmm28", "xmm29", "xmm30", "xmm31" -}; +static const char *const amd64_xmm_avx512_names[] + = { "xmm16", "xmm17", "xmm18", "xmm19", "xmm20", "xmm21", "xmm22", "xmm23", + "xmm24", "xmm25", "xmm26", "xmm27", "xmm28", "xmm29", "xmm30", "xmm31" }; -static const char * const amd64_pkeys_names[] = { - "pkru" -}; +static const char *const amd64_pkeys_names[] = { "pkru" }; /* DWARF Register Number Mapping as defined in the System V psABI, section 3.6. */ -static int amd64_dwarf_regmap[] = -{ +static int amd64_dwarf_regmap[] = { /* General Purpose Registers RAX, RDX, RCX, RBX, RSI, RDI. */ - AMD64_RAX_REGNUM, AMD64_RDX_REGNUM, - AMD64_RCX_REGNUM, AMD64_RBX_REGNUM, + AMD64_RAX_REGNUM, AMD64_RDX_REGNUM, AMD64_RCX_REGNUM, AMD64_RBX_REGNUM, AMD64_RSI_REGNUM, AMD64_RDI_REGNUM, /* Frame Pointer Register RBP. */ @@ -173,34 +184,31 @@ static int amd64_dwarf_regmap[] = AMD64_RSP_REGNUM, /* Extended Integer Registers 8 - 15. */ - AMD64_R8_REGNUM, /* %r8 */ - AMD64_R9_REGNUM, /* %r9 */ - AMD64_R10_REGNUM, /* %r10 */ - AMD64_R11_REGNUM, /* %r11 */ - AMD64_R12_REGNUM, /* %r12 */ - AMD64_R13_REGNUM, /* %r13 */ - AMD64_R14_REGNUM, /* %r14 */ - AMD64_R15_REGNUM, /* %r15 */ + AMD64_R8_REGNUM, /* %r8 */ + AMD64_R9_REGNUM, /* %r9 */ + AMD64_R10_REGNUM, /* %r10 */ + AMD64_R11_REGNUM, /* %r11 */ + AMD64_R12_REGNUM, /* %r12 */ + AMD64_R13_REGNUM, /* %r13 */ + AMD64_R14_REGNUM, /* %r14 */ + AMD64_R15_REGNUM, /* %r15 */ /* Return Address RA. Mapped to RIP. */ AMD64_RIP_REGNUM, /* SSE Registers 0 - 7. */ - AMD64_XMM0_REGNUM + 0, AMD64_XMM1_REGNUM, - AMD64_XMM0_REGNUM + 2, AMD64_XMM0_REGNUM + 3, - AMD64_XMM0_REGNUM + 4, AMD64_XMM0_REGNUM + 5, + AMD64_XMM0_REGNUM + 0, AMD64_XMM1_REGNUM, AMD64_XMM0_REGNUM + 2, + AMD64_XMM0_REGNUM + 3, AMD64_XMM0_REGNUM + 4, AMD64_XMM0_REGNUM + 5, AMD64_XMM0_REGNUM + 6, AMD64_XMM0_REGNUM + 7, /* Extended SSE Registers 8 - 15. */ - AMD64_XMM0_REGNUM + 8, AMD64_XMM0_REGNUM + 9, - AMD64_XMM0_REGNUM + 10, AMD64_XMM0_REGNUM + 11, - AMD64_XMM0_REGNUM + 12, AMD64_XMM0_REGNUM + 13, + AMD64_XMM0_REGNUM + 8, AMD64_XMM0_REGNUM + 9, AMD64_XMM0_REGNUM + 10, + AMD64_XMM0_REGNUM + 11, AMD64_XMM0_REGNUM + 12, AMD64_XMM0_REGNUM + 13, AMD64_XMM0_REGNUM + 14, AMD64_XMM0_REGNUM + 15, /* Floating Point Registers 0-7. */ - AMD64_ST0_REGNUM + 0, AMD64_ST0_REGNUM + 1, - AMD64_ST0_REGNUM + 2, AMD64_ST0_REGNUM + 3, - AMD64_ST0_REGNUM + 4, AMD64_ST0_REGNUM + 5, + AMD64_ST0_REGNUM + 0, AMD64_ST0_REGNUM + 1, AMD64_ST0_REGNUM + 2, + AMD64_ST0_REGNUM + 3, AMD64_ST0_REGNUM + 4, AMD64_ST0_REGNUM + 5, AMD64_ST0_REGNUM + 6, AMD64_ST0_REGNUM + 7, /* MMX Registers 0 - 7. @@ -213,33 +221,21 @@ static int amd64_dwarf_regmap[] = AMD64_EFLAGS_REGNUM, /* Selector Registers. */ - AMD64_ES_REGNUM, - AMD64_CS_REGNUM, - AMD64_SS_REGNUM, - AMD64_DS_REGNUM, - AMD64_FS_REGNUM, - AMD64_GS_REGNUM, - -1, - -1, + AMD64_ES_REGNUM, AMD64_CS_REGNUM, AMD64_SS_REGNUM, AMD64_DS_REGNUM, + AMD64_FS_REGNUM, AMD64_GS_REGNUM, -1, -1, /* Segment Base Address Registers. */ - -1, - -1, - -1, - -1, + -1, -1, -1, -1, /* Special Selector Registers. */ - -1, - -1, + -1, -1, /* Floating Point Control Registers. */ - AMD64_MXCSR_REGNUM, - AMD64_FCTRL_REGNUM, - AMD64_FSTAT_REGNUM + AMD64_MXCSR_REGNUM, AMD64_FCTRL_REGNUM, AMD64_FSTAT_REGNUM }; -static const int amd64_dwarf_regmap_len = - (sizeof (amd64_dwarf_regmap) / sizeof (amd64_dwarf_regmap[0])); +static const int amd64_dwarf_regmap_len + = (sizeof (amd64_dwarf_regmap) / sizeof (amd64_dwarf_regmap[0])); /* Convert DWARF register number REG to the appropriate register number used by GDB. */ @@ -254,8 +250,7 @@ amd64_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int reg) if (reg >= 0 && reg < amd64_dwarf_regmap_len) regnum = amd64_dwarf_regmap[reg]; - if (ymm0_regnum >= 0 - && i386_xmm_regnum_p (gdbarch, regnum)) + if (ymm0_regnum >= 0 && i386_xmm_regnum_p (gdbarch, regnum)) regnum += ymm0_regnum - I387_XMM0_REGNUM (tdep); return regnum; @@ -263,28 +258,27 @@ amd64_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int reg) /* Map architectural register numbers to gdb register numbers. */ -static const int amd64_arch_regmap[16] = -{ - AMD64_RAX_REGNUM, /* %rax */ - AMD64_RCX_REGNUM, /* %rcx */ - AMD64_RDX_REGNUM, /* %rdx */ - AMD64_RBX_REGNUM, /* %rbx */ - AMD64_RSP_REGNUM, /* %rsp */ - AMD64_RBP_REGNUM, /* %rbp */ - AMD64_RSI_REGNUM, /* %rsi */ - AMD64_RDI_REGNUM, /* %rdi */ - AMD64_R8_REGNUM, /* %r8 */ - AMD64_R9_REGNUM, /* %r9 */ - AMD64_R10_REGNUM, /* %r10 */ - AMD64_R11_REGNUM, /* %r11 */ - AMD64_R12_REGNUM, /* %r12 */ - AMD64_R13_REGNUM, /* %r13 */ - AMD64_R14_REGNUM, /* %r14 */ - AMD64_R15_REGNUM /* %r15 */ +static const int amd64_arch_regmap[16] = { + AMD64_RAX_REGNUM, /* %rax */ + AMD64_RCX_REGNUM, /* %rcx */ + AMD64_RDX_REGNUM, /* %rdx */ + AMD64_RBX_REGNUM, /* %rbx */ + AMD64_RSP_REGNUM, /* %rsp */ + AMD64_RBP_REGNUM, /* %rbp */ + AMD64_RSI_REGNUM, /* %rsi */ + AMD64_RDI_REGNUM, /* %rdi */ + AMD64_R8_REGNUM, /* %r8 */ + AMD64_R9_REGNUM, /* %r9 */ + AMD64_R10_REGNUM, /* %r10 */ + AMD64_R11_REGNUM, /* %r11 */ + AMD64_R12_REGNUM, /* %r12 */ + AMD64_R13_REGNUM, /* %r13 */ + AMD64_R14_REGNUM, /* %r14 */ + AMD64_R15_REGNUM /* %r15 */ }; -static const int amd64_arch_regmap_len = - (sizeof (amd64_arch_regmap) / sizeof (amd64_arch_regmap[0])); +static const int amd64_arch_regmap_len + = (sizeof (amd64_arch_regmap) / sizeof (amd64_arch_regmap[0])); /* Convert architectural register number REG to the appropriate register number used by GDB. */ @@ -299,32 +293,25 @@ amd64_arch_reg_to_regnum (int reg) /* Register names for byte pseudo-registers. */ -static const char * const amd64_byte_names[] = -{ - "al", "bl", "cl", "dl", "sil", "dil", "bpl", "spl", - "r8l", "r9l", "r10l", "r11l", "r12l", "r13l", "r14l", "r15l", - "ah", "bh", "ch", "dh" -}; +static const char *const amd64_byte_names[] + = { "al", "bl", "cl", "dl", "sil", "dil", "bpl", + "spl", "r8l", "r9l", "r10l", "r11l", "r12l", "r13l", + "r14l", "r15l", "ah", "bh", "ch", "dh" }; /* Number of lower byte registers. */ #define AMD64_NUM_LOWER_BYTE_REGS 16 /* Register names for word pseudo-registers. */ -static const char * const amd64_word_names[] = -{ - "ax", "bx", "cx", "dx", "si", "di", "bp", "", - "r8w", "r9w", "r10w", "r11w", "r12w", "r13w", "r14w", "r15w" -}; +static const char *const amd64_word_names[] + = { "ax", "bx", "cx", "dx", "si", "di", "bp", "", + "r8w", "r9w", "r10w", "r11w", "r12w", "r13w", "r14w", "r15w" }; /* Register names for dword pseudo-registers. */ -static const char * const amd64_dword_names[] = -{ - "eax", "ebx", "ecx", "edx", "esi", "edi", "ebp", "esp", - "r8d", "r9d", "r10d", "r11d", "r12d", "r13d", "r14d", "r15d", - "eip" -}; +static const char *const amd64_dword_names[] + = { "eax", "ebx", "ecx", "edx", "esi", "edi", "ebp", "esp", "r8d", + "r9d", "r10d", "r11d", "r12d", "r13d", "r14d", "r15d", "eip" }; /* Return the name of register REGNUM. */ @@ -350,8 +337,7 @@ amd64_pseudo_register_name (struct gdbarch *gdbarch, int regnum) static struct value * amd64_pseudo_register_read_value (struct gdbarch *gdbarch, - readable_regcache *regcache, - int regnum) + readable_regcache *regcache, int regnum) { i386_gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); @@ -375,8 +361,8 @@ amd64_pseudo_register_read_value (struct gdbarch *gdbarch, if (status == REG_VALID) memcpy (buf, raw_buf + 1, 1); else - mark_value_bytes_unavailable (result_value, 0, - value_type (result_value)->length ()); + mark_value_bytes_unavailable ( + result_value, 0, value_type (result_value)->length ()); } else { @@ -385,8 +371,8 @@ amd64_pseudo_register_read_value (struct gdbarch *gdbarch, if (status == REG_VALID) memcpy (buf, raw_buf, 1); else - mark_value_bytes_unavailable (result_value, 0, - value_type (result_value)->length ()); + mark_value_bytes_unavailable ( + result_value, 0, value_type (result_value)->length ()); } } else if (i386_dword_regnum_p (gdbarch, regnum)) @@ -410,8 +396,8 @@ amd64_pseudo_register_read_value (struct gdbarch *gdbarch, static void amd64_pseudo_register_write (struct gdbarch *gdbarch, - struct regcache *regcache, - int regnum, const gdb_byte *buf) + struct regcache *regcache, int regnum, + const gdb_byte *buf) { i386_gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); @@ -488,8 +474,6 @@ amd64_ax_pseudo_register_collect (struct gdbarch *gdbarch, return i386_ax_pseudo_register_collect (gdbarch, ax, regnum); } - - /* Register classes as defined in the psABI. */ enum amd64_reg_class @@ -540,15 +524,15 @@ amd64_merge_classes (enum amd64_reg_class class1, enum amd64_reg_class class2) return AMD64_SSE; } -static void amd64_classify (struct type *type, enum amd64_reg_class theclass[2]); +static void amd64_classify (struct type *type, + enum amd64_reg_class theclass[2]); /* Return true if TYPE is a structure or union with unaligned fields. */ static bool amd64_has_unaligned_fields (struct type *type) { - if (type->code () == TYPE_CODE_STRUCT - || type->code () == TYPE_CODE_UNION) + if (type->code () == TYPE_CODE_STRUCT || type->code () == TYPE_CODE_UNION) { for (int i = 0; i < type->num_fields (); i++) { @@ -558,8 +542,7 @@ amd64_has_unaligned_fields (struct type *type) empty structures), and bitfields (these are handled by the caller). */ if (field_is_static (&type->field (i)) - || (TYPE_FIELD_BITSIZE (type, i) == 0 - && subtype->length () == 0) + || (TYPE_FIELD_BITSIZE (type, i) == 0 && subtype->length () == 0) || TYPE_FIELD_PACKED (type, i)) continue; @@ -570,7 +553,7 @@ amd64_has_unaligned_fields (struct type *type) int align = type_align (subtype); if (align == 0) - error (_("could not determine alignment of type")); + error (_ ("could not determine alignment of type")); int bytepos = bitpos / 8; if (bytepos % align != 0) @@ -666,8 +649,7 @@ amd64_classify_aggregate (struct type *type, enum amd64_reg_class theclass[2]) loc_bitpos attributes, which will cause an assert to trigger within the unaligned field check. As classes with virtual bases are not trivially copyable, checking that first avoids this problem. */ - if (TYPE_HAS_DYNAMIC_LENGTH (type) - || type->length () > 16 + if (TYPE_HAS_DYNAMIC_LENGTH (type) || type->length () > 16 || !language_pass_by_reference (type).trivially_copyable || amd64_has_unaligned_fields (type)) { @@ -735,8 +717,8 @@ amd64_classify (struct type *type, enum amd64_reg_class theclass[2]) class. */ if ((code == TYPE_CODE_INT || code == TYPE_CODE_ENUM || code == TYPE_CODE_BOOL || code == TYPE_CODE_RANGE - || code == TYPE_CODE_CHAR - || code == TYPE_CODE_PTR || TYPE_IS_REFERENCE (type)) + || code == TYPE_CODE_CHAR || code == TYPE_CODE_PTR + || TYPE_IS_REFERENCE (type)) && (len == 1 || len == 2 || len == 4 || len == 8)) theclass[0] = AMD64_INTEGER; @@ -925,27 +907,24 @@ amd64_return_value (struct gdbarch *gdbarch, struct value *function, return RETURN_VALUE_REGISTER_CONVENTION; } - static CORE_ADDR -amd64_push_arguments (struct regcache *regcache, int nargs, struct value **args, - CORE_ADDR sp, function_call_return_method return_method) -{ - static int integer_regnum[] = - { - AMD64_RDI_REGNUM, /* %rdi */ - AMD64_RSI_REGNUM, /* %rsi */ - AMD64_RDX_REGNUM, /* %rdx */ - AMD64_RCX_REGNUM, /* %rcx */ - AMD64_R8_REGNUM, /* %r8 */ - AMD64_R9_REGNUM /* %r9 */ +amd64_push_arguments (struct regcache *regcache, int nargs, + struct value **args, CORE_ADDR sp, + function_call_return_method return_method) +{ + static int integer_regnum[] = { + AMD64_RDI_REGNUM, /* %rdi */ + AMD64_RSI_REGNUM, /* %rsi */ + AMD64_RDX_REGNUM, /* %rdx */ + AMD64_RCX_REGNUM, /* %rcx */ + AMD64_R8_REGNUM, /* %r8 */ + AMD64_R9_REGNUM /* %r9 */ }; - static int sse_regnum[] = - { + static int sse_regnum[] = { /* %xmm0 ... %xmm7 */ - AMD64_XMM0_REGNUM + 0, AMD64_XMM1_REGNUM, - AMD64_XMM0_REGNUM + 2, AMD64_XMM0_REGNUM + 3, - AMD64_XMM0_REGNUM + 4, AMD64_XMM0_REGNUM + 5, + AMD64_XMM0_REGNUM + 0, AMD64_XMM1_REGNUM, AMD64_XMM0_REGNUM + 2, + AMD64_XMM0_REGNUM + 3, AMD64_XMM0_REGNUM + 4, AMD64_XMM0_REGNUM + 5, AMD64_XMM0_REGNUM + 6, AMD64_XMM0_REGNUM + 7, }; struct value **stack_args = XALLOCAVEC (struct value *, nargs); @@ -957,7 +936,7 @@ amd64_push_arguments (struct regcache *regcache, int nargs, struct value **args, int i; /* Reserve a register for the "hidden" argument. */ -if (return_method == return_method_struct) + if (return_method == return_method_struct) integer_reg++; for (i = 0; i < nargs; i++) @@ -1059,13 +1038,13 @@ if (return_method == return_method_struct) containing ellipsis (...) in the declaration) %al is used as hidden argument to specify the number of SSE registers used. */ regcache_raw_write_unsigned (regcache, AMD64_RAX_REGNUM, sse_reg); - return sp; + return sp; } static CORE_ADDR amd64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, - struct regcache *regcache, CORE_ADDR bp_addr, - int nargs, struct value **args, CORE_ADDR sp, + struct regcache *regcache, CORE_ADDR bp_addr, int nargs, + struct value **args, CORE_ADDR sp, function_call_return_method return_method, CORE_ADDR struct_addr) { @@ -1103,7 +1082,7 @@ amd64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, return sp + 16; } - + /* Displaced instruction handling. */ /* A partially decoded instruction. @@ -1129,8 +1108,9 @@ struct amd64_displaced_step_copy_insn_closure : public displaced_step_copy_insn_closure { amd64_displaced_step_copy_insn_closure (int insn_buf_len) - : insn_buf (insn_buf_len, 0) - {} + : insn_buf (insn_buf_len, 0) + { + } /* For rip-relative insns, saved copy of the reg we use instead of %rip. */ int tmp_used = 0; @@ -1151,22 +1131,38 @@ struct amd64_displaced_step_copy_insn_closure static const unsigned char onebyte_has_modrm[256] = { /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */ /* ------------------------------- */ - /* 00 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 00 */ - /* 10 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 10 */ - /* 20 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 20 */ - /* 30 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 30 */ - /* 40 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 40 */ - /* 50 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 50 */ - /* 60 */ 0,0,1,1,0,0,0,0,0,1,0,1,0,0,0,0, /* 60 */ - /* 70 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 70 */ - /* 80 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 80 */ - /* 90 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 90 */ - /* a0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* a0 */ - /* b0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* b0 */ - /* c0 */ 1,1,0,0,1,1,1,1,0,0,0,0,0,0,0,0, /* c0 */ - /* d0 */ 1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1, /* d0 */ - /* e0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* e0 */ - /* f0 */ 0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,1 /* f0 */ + /* 00 */ 1, 1, 1, 1, 0, 0, 0, 0, 1, + 1, 1, 1, 0, 0, 0, 0, /* 00 */ + /* 10 */ 1, 1, 1, 1, 0, 0, 0, 0, 1, + 1, 1, 1, 0, 0, 0, 0, /* 10 */ + /* 20 */ 1, 1, 1, 1, 0, 0, 0, 0, 1, + 1, 1, 1, 0, 0, 0, 0, /* 20 */ + /* 30 */ 1, 1, 1, 1, 0, 0, 0, 0, 1, + 1, 1, 1, 0, 0, 0, 0, /* 30 */ + /* 40 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, /* 40 */ + /* 50 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, /* 50 */ + /* 60 */ 0, 0, 1, 1, 0, 0, 0, 0, 0, + 1, 0, 1, 0, 0, 0, 0, /* 60 */ + /* 70 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, /* 70 */ + /* 80 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, /* 80 */ + /* 90 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, /* 90 */ + /* a0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, /* a0 */ + /* b0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, /* b0 */ + /* c0 */ 1, 1, 0, 0, 1, 1, 1, 1, 0, + 0, 0, 0, 0, 0, 0, 0, /* c0 */ + /* d0 */ 1, 1, 1, 1, 0, 0, 0, 0, 1, + 1, 1, 1, 1, 1, 1, 1, /* d0 */ + /* e0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, /* e0 */ + /* f0 */ 0, 0, 0, 0, 0, 0, 1, 1, 0, + 0, 0, 0, 0, 0, 1, 1 /* f0 */ /* ------------------------------- */ /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */ }; @@ -1174,22 +1170,38 @@ static const unsigned char onebyte_has_modrm[256] = { static const unsigned char twobyte_has_modrm[256] = { /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */ /* ------------------------------- */ - /* 00 */ 1,1,1,1,0,0,0,0,0,0,0,0,0,1,0,1, /* 0f */ - /* 10 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 1f */ - /* 20 */ 1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1, /* 2f */ - /* 30 */ 0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0, /* 3f */ - /* 40 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 4f */ - /* 50 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 5f */ - /* 60 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 6f */ - /* 70 */ 1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1, /* 7f */ - /* 80 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 8f */ - /* 90 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 9f */ - /* a0 */ 0,0,0,1,1,1,1,1,0,0,0,1,1,1,1,1, /* af */ - /* b0 */ 1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1, /* bf */ - /* c0 */ 1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0, /* cf */ - /* d0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* df */ - /* e0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* ef */ - /* f0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0 /* ff */ + /* 00 */ 1, 1, 1, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, /* 0f */ + /* 10 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, /* 1f */ + /* 20 */ 1, 1, 1, 1, 1, 1, 1, 0, 1, + 1, 1, 1, 1, 1, 1, 1, /* 2f */ + /* 30 */ 0, 0, 0, 0, 0, 0, 0, 0, 1, + 0, 1, 0, 0, 0, 0, 0, /* 3f */ + /* 40 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, /* 4f */ + /* 50 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, /* 5f */ + /* 60 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, /* 6f */ + /* 70 */ 1, 1, 1, 1, 1, 1, 1, 0, 1, + 1, 1, 1, 1, 1, 1, 1, /* 7f */ + /* 80 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, /* 8f */ + /* 90 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, /* 9f */ + /* a0 */ 0, 0, 0, 1, 1, 1, 1, 1, 0, + 0, 0, 1, 1, 1, 1, 1, /* af */ + /* b0 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, + 0, 1, 1, 1, 1, 1, 1, /* bf */ + /* c0 */ 1, 1, 1, 1, 1, 1, 1, 1, 0, + 0, 0, 0, 0, 0, 0, 0, /* cf */ + /* d0 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, /* df */ + /* e0 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, /* ef */ + /* f0 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 0 /* ff */ /* ------------------------------- */ /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */ }; @@ -1296,8 +1308,10 @@ amd64_get_unused_input_int_reg (const struct amd64_insn *details) if (have_sib) { - int base = SIB_BASE_FIELD (details->raw_insn[details->modrm_offset + 1]); - int idx = SIB_INDEX_FIELD (details->raw_insn[details->modrm_offset + 1]); + int base + = SIB_BASE_FIELD (details->raw_insn[details->modrm_offset + 1]); + int idx + = SIB_INDEX_FIELD (details->raw_insn[details->modrm_offset + 1]); used_regs_mask |= 1 << base; used_regs_mask |= 1 << idx; } @@ -1316,12 +1330,12 @@ amd64_get_unused_input_int_reg (const struct amd64_insn *details) for (i = 0; i < 8; ++i) { - if (! (used_regs_mask & (1 << i))) + if (!(used_regs_mask & (1 << i))) return i; } /* We shouldn't get here. */ - internal_error (_("unable to find free reg")); + internal_error (_ ("unable to find free reg")); } } @@ -1410,8 +1424,8 @@ amd64_get_insn_details (gdb_byte *insn, struct amd64_insn *details) static void fixup_riprel (struct gdbarch *gdbarch, - amd64_displaced_step_copy_insn_closure *dsc, - CORE_ADDR from, CORE_ADDR to, struct regcache *regs) + amd64_displaced_step_copy_insn_closure *dsc, CORE_ADDR from, + CORE_ADDR to, struct regcache *regs) { const struct amd64_insn *insn_details = &dsc->insn_details; int modrm_offset = insn_details->modrm_offset; @@ -1486,16 +1500,15 @@ fixup_displaced_copy (struct gdbarch *gdbarch, } displaced_step_copy_insn_closure_up -amd64_displaced_step_copy_insn (struct gdbarch *gdbarch, - CORE_ADDR from, CORE_ADDR to, - struct regcache *regs) +amd64_displaced_step_copy_insn (struct gdbarch *gdbarch, CORE_ADDR from, + CORE_ADDR to, struct regcache *regs) { int len = gdbarch_max_insn_length (gdbarch); /* Extra space for sentinels so fixup_{riprel,displaced_copy} don't have to continually watch for running off the end of the buffer. */ int fixup_sentinel_space = len; - std::unique_ptr dsc - (new amd64_displaced_step_copy_insn_closure (len + fixup_sentinel_space)); + std::unique_ptr dsc ( + new amd64_displaced_step_copy_insn_closure (len + fixup_sentinel_space)); gdb_byte *buf = &dsc->insn_buf[0]; struct amd64_insn *details = &dsc->insn_details; @@ -1524,8 +1537,8 @@ amd64_displaced_step_copy_insn (struct gdbarch *gdbarch, write_memory (to, buf, len); - displaced_debug_printf ("copy %s->%s: %s", - paddress (gdbarch, from), paddress (gdbarch, to), + displaced_debug_printf ("copy %s->%s: %s", paddress (gdbarch, from), + paddress (gdbarch, to), displaced_step_dump_bytes (buf, len).c_str ()); /* This is a work around for a problem with g++ 4.8. */ @@ -1711,8 +1724,8 @@ amd64_displaced_step_fixup (struct gdbarch *gdbarch, if (dsc->tmp_used) { - displaced_debug_printf ("restoring reg %d to %s", - dsc->tmp_regno, paddress (gdbarch, dsc->tmp_save)); + displaced_debug_printf ("restoring reg %d to %s", dsc->tmp_regno, + paddress (gdbarch, dsc->tmp_save)); regcache_cooked_write_unsigned (regs, dsc->tmp_regno, dsc->tmp_save); } @@ -1728,9 +1741,8 @@ amd64_displaced_step_fixup (struct gdbarch *gdbarch, the displaced instruction; make it relative to the original insn. Well, signal handler returns don't need relocation either, but we use the value of %rip to recognize those; see below. */ - if (! amd64_absolute_jmp_p (insn_details) - && ! amd64_absolute_call_p (insn_details) - && ! amd64_ret_p (insn_details)) + if (!amd64_absolute_jmp_p (insn_details) + && !amd64_absolute_call_p (insn_details) && !amd64_ret_p (insn_details)) { ULONGEST orig_rip; int insn_len; @@ -1829,8 +1841,8 @@ append_insns (CORE_ADDR *to, ULONGEST len, const gdb_byte *buf) } static void -amd64_relocate_instruction (struct gdbarch *gdbarch, - CORE_ADDR *to, CORE_ADDR oldloc) +amd64_relocate_instruction (struct gdbarch *gdbarch, CORE_ADDR *to, + CORE_ADDR oldloc) { enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); int len = gdbarch_max_insn_length (gdbarch); @@ -1897,8 +1909,7 @@ amd64_relocate_instruction (struct gdbarch *gdbarch, push_buf[i++] = 0x44; push_buf[i++] = 0x24; push_buf[i++] = 0x04; - store_unsigned_integer (&push_buf[i], 4, byte_order, - ret_addr >> 32); + store_unsigned_integer (&push_buf[i], 4, byte_order, ret_addr >> 32); i += 4; } gdb_assert (i <= sizeof (push_buf)); @@ -1948,9 +1959,8 @@ amd64_relocate_instruction (struct gdbarch *gdbarch, append_insns (to, insn_length, buf); } - /* The maximum number of saved registers. This should include %rip. */ -#define AMD64_NUM_SAVED_REGS AMD64_NUM_GREGS +#define AMD64_NUM_SAVED_REGS AMD64_NUM_GREGS struct amd64_frame_cache { @@ -2049,9 +2059,7 @@ amd64_analyze_stack_align (CORE_ADDR pc, CORE_ADDR current_pc, /* Check caller-saved saved register. The first instruction has to be "leaq 8(%rsp), %reg". */ - if ((buf[0] & 0xfb) == 0x48 - && buf[1] == 0x8d - && buf[3] == 0x24 + if ((buf[0] & 0xfb) == 0x48 && buf[1] == 0x8d && buf[3] == 0x24 && buf[4] == 0x8) { /* MOD must be binary 10 and R/M must be binary 100. */ @@ -2074,8 +2082,7 @@ amd64_analyze_stack_align (CORE_ADDR pc, CORE_ADDR current_pc, reg = 0; if ((buf[0] & 0xf8) == 0x50) offset = 0; - else if ((buf[0] & 0xf6) == 0x40 - && (buf[1] & 0xf8) == 0x50) + else if ((buf[0] & 0xf6) == 0x40 && (buf[1] & 0xf8) == 0x50) { /* Check the REX.B bit. */ if ((buf[0] & 1) != 0) @@ -2092,16 +2099,14 @@ amd64_analyze_stack_align (CORE_ADDR pc, CORE_ADDR current_pc, offset++; /* The next instruction has to be "leaq 16(%rsp), %reg". */ - if ((buf[offset] & 0xfb) != 0x48 - || buf[offset + 1] != 0x8d - || buf[offset + 3] != 0x24 - || buf[offset + 4] != 0x10) + if ((buf[offset] & 0xfb) != 0x48 || buf[offset + 1] != 0x8d + || buf[offset + 3] != 0x24 || buf[offset + 4] != 0x10) return pc; /* MOD must be binary 10 and R/M must be binary 100. */ if ((buf[offset + 2] & 0xc7) != 0x44) return pc; - + /* REG has register number. */ r = (buf[offset + 2] >> 3) & 7; @@ -2121,8 +2126,7 @@ amd64_analyze_stack_align (CORE_ADDR pc, CORE_ADDR current_pc, return pc; /* The next instruction has to be "andq $-XXX, %rsp". */ - if (buf[offset] != 0x48 - || buf[offset + 2] != 0xe4 + if (buf[offset] != 0x48 || buf[offset + 2] != 0xe4 || (buf[offset + 1] != 0x81 && buf[offset + 1] != 0x83)) return pc; @@ -2133,8 +2137,7 @@ amd64_analyze_stack_align (CORE_ADDR pc, CORE_ADDR current_pc, r = 0; if (buf[offset] == 0xff) offset++; - else if ((buf[offset] & 0xf6) == 0x40 - && buf[offset + 1] == 0xff) + else if ((buf[offset] & 0xf6) == 0x40 && buf[offset + 1] == 0xff) { /* Check the REX.B bit. */ if ((buf[offset] & 0x1) != 0) @@ -2146,8 +2149,7 @@ amd64_analyze_stack_align (CORE_ADDR pc, CORE_ADDR current_pc, /* 8bit -8 is 0xf8. REG must be binary 110 and MOD must be binary 01. */ - if (buf[offset + 1] != 0xf8 - || (buf[offset] & 0xf8) != 0x70) + if (buf[offset + 1] != 0xf8 || (buf[offset] & 0xf8) != 0x70) return pc; /* R/M has register. */ @@ -2167,7 +2169,7 @@ amd64_analyze_stack_align (CORE_ADDR pc, CORE_ADDR current_pc, static CORE_ADDR amd64_x32_analyze_stack_align (CORE_ADDR pc, CORE_ADDR current_pc, - struct amd64_frame_cache *cache) + struct amd64_frame_cache *cache) { /* There are 2 code sequences to re-align stack before the frame gets set up: @@ -2222,8 +2224,7 @@ amd64_x32_analyze_stack_align (CORE_ADDR pc, CORE_ADDR current_pc, /* Check caller-saved saved register. The first instruction has to be "leaq 8(%rsp), %reg" or "leal 8(%rsp), %reg". */ if (((buf[offset] & 0xfb) == 0x48 || (buf[offset] & 0xfb) == 0x40) - && buf[offset + 1] == 0x8d - && buf[offset + 3] == 0x24 + && buf[offset + 1] == 0x8d && buf[offset + 3] == 0x24 && buf[offset + 4] == 0x8) { /* MOD must be binary 10 and R/M must be binary 100. */ @@ -2244,8 +2245,7 @@ amd64_x32_analyze_stack_align (CORE_ADDR pc, CORE_ADDR current_pc, /* Check callee-saved saved register. The first instruction has to be "pushq %reg". */ reg = 0; - if ((buf[offset] & 0xf6) == 0x40 - && (buf[offset + 1] & 0xf8) == 0x50) + if ((buf[offset] & 0xf6) == 0x40 && (buf[offset + 1] & 0xf8) == 0x50) { /* Check the REX.B bit. */ if ((buf[offset] & 1) != 0) @@ -2268,15 +2268,14 @@ amd64_x32_analyze_stack_align (CORE_ADDR pc, CORE_ADDR current_pc, /* The next instruction has to be "leaq 16(%rsp), %reg" or "leal 16(%rsp), %reg". */ if (((buf[offset] & 0xfb) != 0x48 && (buf[offset] & 0xfb) != 0x40) - || buf[offset + 1] != 0x8d - || buf[offset + 3] != 0x24 + || buf[offset + 1] != 0x8d || buf[offset + 3] != 0x24 || buf[offset + 4] != 0x10) return pc; /* MOD must be binary 10 and R/M must be binary 100. */ if ((buf[offset + 2] & 0xc7) != 0x44) return pc; - + /* REG has register number. */ r = (buf[offset + 2] >> 3) & 7; @@ -2315,8 +2314,7 @@ amd64_x32_analyze_stack_align (CORE_ADDR pc, CORE_ADDR current_pc, r = 0; if (buf[offset] == 0xff) offset++; - else if ((buf[offset] & 0xf6) == 0x40 - && buf[offset + 1] == 0xff) + else if ((buf[offset] & 0xf6) == 0x40 && buf[offset + 1] == 0xff) { /* Check the REX.B bit. */ if ((buf[offset] & 0x1) != 0) @@ -2328,8 +2326,7 @@ amd64_x32_analyze_stack_align (CORE_ADDR pc, CORE_ADDR current_pc, /* 8bit -8 is 0xf8. REG must be binary 110 and MOD must be binary 01. */ - if (buf[offset + 1] != 0xf8 - || (buf[offset] & 0xf8) != 0x70) + if (buf[offset + 1] != 0xf8 || (buf[offset] & 0xf8) != 0x70) return pc; /* R/M has register. */ @@ -2367,9 +2364,8 @@ amd64_x32_analyze_stack_align (CORE_ADDR pc, CORE_ADDR current_pc, %rbp. */ static CORE_ADDR -amd64_analyze_prologue (struct gdbarch *gdbarch, - CORE_ADDR pc, CORE_ADDR current_pc, - struct amd64_frame_cache *cache) +amd64_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, + CORE_ADDR current_pc, struct amd64_frame_cache *cache) { enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); /* The `endbr64` instruction. */ @@ -2408,7 +2404,7 @@ amd64_analyze_prologue (struct gdbarch *gdbarch, if (current_pc <= pc) return current_pc; - if (op == 0x55) /* pushq %rbp */ + if (op == 0x55) /* pushq %rbp */ { /* Take into account that we've executed the `pushq %rbp' that starts this instruction sequence. */ @@ -2478,8 +2474,8 @@ amd64_skip_xmm_prologue (CORE_ADDR pc, CORE_ADDR start_pc) start_pc_sal = find_pc_sect_line (start_pc, NULL, 0); if (start_pc_sal.symtab == NULL - || producer_is_gcc_ge_4 (start_pc_sal.symtab->compunit () - ->producer ()) < 6 + || producer_is_gcc_ge_4 (start_pc_sal.symtab->compunit ()->producer ()) + < 6 || start_pc_sal.pc != start_pc || pc >= start_pc_sal.end) return pc; @@ -2548,22 +2544,20 @@ amd64_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR start_pc) prologue and another one after. We trust clang and newer Intel compilers to emit usable line notes. */ if (post_prologue_pc - && (cust != NULL - && cust->producer () != nullptr + && (cust != NULL && cust->producer () != nullptr && (producer_is_llvm (cust->producer ()) - || producer_is_icc_ge_19 (cust->producer ())))) - return std::max (start_pc, post_prologue_pc); + || producer_is_icc_ge_19 (cust->producer ())))) + return std::max (start_pc, post_prologue_pc); } amd64_init_frame_cache (&cache); - pc = amd64_analyze_prologue (gdbarch, start_pc, 0xffffffffffffffffLL, - &cache); + pc + = amd64_analyze_prologue (gdbarch, start_pc, 0xffffffffffffffffLL, &cache); if (cache.frameless_p) return start_pc; return amd64_skip_xmm_prologue (pc, start_pc); } - /* Normal frames. */ @@ -2606,8 +2600,8 @@ amd64_frame_cache_1 (frame_info_ptr this_frame, else { get_frame_register (this_frame, AMD64_RSP_REGNUM, buf); - cache->base = extract_unsigned_integer (buf, 8, byte_order) - + cache->sp_offset; + cache->base + = extract_unsigned_integer (buf, 8, byte_order) + cache->sp_offset; } } else @@ -2661,11 +2655,9 @@ amd64_frame_cache (frame_info_ptr this_frame, void **this_cache) } static enum unwind_stop_reason -amd64_frame_unwind_stop_reason (frame_info_ptr this_frame, - void **this_cache) +amd64_frame_unwind_stop_reason (frame_info_ptr this_frame, void **this_cache) { - struct amd64_frame_cache *cache = - amd64_frame_cache (this_frame, this_cache); + struct amd64_frame_cache *cache = amd64_frame_cache (this_frame, this_cache); if (!cache->base_p) return UNWIND_UNAVAILABLE; @@ -2681,8 +2673,7 @@ static void amd64_frame_this_id (frame_info_ptr this_frame, void **this_cache, struct frame_id *this_id) { - struct amd64_frame_cache *cache = - amd64_frame_cache (this_frame, this_cache); + struct amd64_frame_cache *cache = amd64_frame_cache (this_frame, this_cache); if (!cache->base_p) (*this_id) = frame_id_build_unavailable_stack (cache->pc); @@ -2700,8 +2691,7 @@ amd64_frame_prev_register (frame_info_ptr this_frame, void **this_cache, int regnum) { struct gdbarch *gdbarch = get_frame_arch (this_frame); - struct amd64_frame_cache *cache = - amd64_frame_cache (this_frame, this_cache); + struct amd64_frame_cache *cache = amd64_frame_cache (this_frame, this_cache); gdb_assert (regnum >= 0); @@ -2715,23 +2705,20 @@ amd64_frame_prev_register (frame_info_ptr this_frame, void **this_cache, return frame_unwind_got_register (this_frame, regnum, regnum); } -static const struct frame_unwind amd64_frame_unwind = -{ - "amd64 prologue", - NORMAL_FRAME, - amd64_frame_unwind_stop_reason, - amd64_frame_this_id, - amd64_frame_prev_register, - NULL, - default_frame_sniffer -}; - +static const struct frame_unwind amd64_frame_unwind + = { "amd64 prologue", + NORMAL_FRAME, + amd64_frame_unwind_stop_reason, + amd64_frame_this_id, + amd64_frame_prev_register, + NULL, + default_frame_sniffer }; + /* Generate a bytecode expression to get the value of the saved PC. */ static void -amd64_gen_return_address (struct gdbarch *gdbarch, - struct agent_expr *ax, struct axs_value *value, - CORE_ADDR scope) +amd64_gen_return_address (struct gdbarch *gdbarch, struct agent_expr *ax, + struct axs_value *value, CORE_ADDR scope) { /* The following sequence assumes the traditional use of the base register. */ @@ -2741,7 +2728,6 @@ amd64_gen_return_address (struct gdbarch *gdbarch, value->type = register_type (gdbarch, AMD64_RIP_REGNUM); value->kind = axs_lvalue_memory; } - /* Signal trampolines. */ @@ -2793,8 +2779,8 @@ static enum unwind_stop_reason amd64_sigtramp_frame_unwind_stop_reason (frame_info_ptr this_frame, void **this_cache) { - struct amd64_frame_cache *cache = - amd64_sigtramp_frame_cache (this_frame, this_cache); + struct amd64_frame_cache *cache + = amd64_sigtramp_frame_cache (this_frame, this_cache); if (!cache->base_p) return UNWIND_UNAVAILABLE; @@ -2803,11 +2789,11 @@ amd64_sigtramp_frame_unwind_stop_reason (frame_info_ptr this_frame, } static void -amd64_sigtramp_frame_this_id (frame_info_ptr this_frame, - void **this_cache, struct frame_id *this_id) +amd64_sigtramp_frame_this_id (frame_info_ptr this_frame, void **this_cache, + struct frame_id *this_id) { - struct amd64_frame_cache *cache = - amd64_sigtramp_frame_cache (this_frame, this_cache); + struct amd64_frame_cache *cache + = amd64_sigtramp_frame_cache (this_frame, this_cache); if (!cache->base_p) (*this_id) = frame_id_build_unavailable_stack (get_frame_pc (this_frame)); @@ -2832,8 +2818,7 @@ amd64_sigtramp_frame_prev_register (frame_info_ptr this_frame, static int amd64_sigtramp_frame_sniffer (const struct frame_unwind *self, - frame_info_ptr this_frame, - void **this_cache) + frame_info_ptr this_frame, void **this_cache) { gdbarch *arch = get_frame_arch (this_frame); i386_gdbarch_tdep *tdep = gdbarch_tdep (arch); @@ -2861,34 +2846,26 @@ amd64_sigtramp_frame_sniffer (const struct frame_unwind *self, return 0; } -static const struct frame_unwind amd64_sigtramp_frame_unwind = -{ - "amd64 sigtramp", - SIGTRAMP_FRAME, - amd64_sigtramp_frame_unwind_stop_reason, - amd64_sigtramp_frame_this_id, - amd64_sigtramp_frame_prev_register, - NULL, - amd64_sigtramp_frame_sniffer -}; - +static const struct frame_unwind amd64_sigtramp_frame_unwind + = { "amd64 sigtramp", + SIGTRAMP_FRAME, + amd64_sigtramp_frame_unwind_stop_reason, + amd64_sigtramp_frame_this_id, + amd64_sigtramp_frame_prev_register, + NULL, + amd64_sigtramp_frame_sniffer }; static CORE_ADDR amd64_frame_base_address (frame_info_ptr this_frame, void **this_cache) { - struct amd64_frame_cache *cache = - amd64_frame_cache (this_frame, this_cache); + struct amd64_frame_cache *cache = amd64_frame_cache (this_frame, this_cache); return cache->base; } -static const struct frame_base amd64_frame_base = -{ - &amd64_frame_unwind, - amd64_frame_base_address, - amd64_frame_base_address, - amd64_frame_base_address -}; +static const struct frame_base amd64_frame_base + = { &amd64_frame_unwind, amd64_frame_base_address, amd64_frame_base_address, + amd64_frame_base_address }; /* Normal frames, but in a function epilogue. */ @@ -2909,9 +2886,9 @@ amd64_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc) return 0; if (target_read_memory (pc, &insn, 1)) - return 0; /* Can't read memory at pc. */ + return 0; /* Can't read memory at pc. */ - if (insn != 0xc3) /* 'ret' instruction. */ + if (insn != 0xc3) /* 'ret' instruction. */ return 0; return 1; @@ -2947,8 +2924,8 @@ amd64_epilogue_frame_cache (frame_info_ptr this_frame, void **this_cache) { /* Cache base will be %rsp plus cache->sp_offset (-8). */ get_frame_register (this_frame, AMD64_RSP_REGNUM, buf); - cache->base = extract_unsigned_integer (buf, 8, - byte_order) + cache->sp_offset; + cache->base + = extract_unsigned_integer (buf, 8, byte_order) + cache->sp_offset; /* Cache pc will be the frame func. */ cache->pc = get_frame_func (this_frame); @@ -2984,12 +2961,11 @@ amd64_epilogue_frame_unwind_stop_reason (frame_info_ptr this_frame, } static void -amd64_epilogue_frame_this_id (frame_info_ptr this_frame, - void **this_cache, +amd64_epilogue_frame_this_id (frame_info_ptr this_frame, void **this_cache, struct frame_id *this_id) { - struct amd64_frame_cache *cache = amd64_epilogue_frame_cache (this_frame, - this_cache); + struct amd64_frame_cache *cache + = amd64_epilogue_frame_cache (this_frame, this_cache); if (!cache->base_p) (*this_id) = frame_id_build_unavailable_stack (cache->pc); @@ -2997,16 +2973,14 @@ amd64_epilogue_frame_this_id (frame_info_ptr this_frame, (*this_id) = frame_id_build (cache->base + 16, cache->pc); } -static const struct frame_unwind amd64_epilogue_frame_unwind = -{ - "amd64 epilogue", - NORMAL_FRAME, - amd64_epilogue_frame_unwind_stop_reason, - amd64_epilogue_frame_this_id, - amd64_frame_prev_register, - NULL, - amd64_epilogue_frame_sniffer -}; +static const struct frame_unwind amd64_epilogue_frame_unwind + = { "amd64 epilogue", + NORMAL_FRAME, + amd64_epilogue_frame_unwind_stop_reason, + amd64_epilogue_frame_this_id, + amd64_frame_prev_register, + NULL, + amd64_epilogue_frame_sniffer }; static struct frame_id amd64_dummy_id (struct gdbarch *gdbarch, frame_info_ptr this_frame) @@ -3023,9 +2997,8 @@ amd64_dummy_id (struct gdbarch *gdbarch, frame_info_ptr this_frame) static CORE_ADDR amd64_frame_align (struct gdbarch *gdbarch, CORE_ADDR sp) { - return sp & -(CORE_ADDR)16; + return sp & -(CORE_ADDR) 16; } - /* Supply register REGNUM from the buffer specified by FPREGS and LEN in the floating-point register set REGSET to register cache @@ -3049,8 +3022,8 @@ amd64_supply_fpregset (const struct regset *regset, struct regcache *regcache, static void amd64_collect_fpregset (const struct regset *regset, - const struct regcache *regcache, - int regnum, void *fpregs, size_t len) + const struct regcache *regcache, int regnum, + void *fpregs, size_t len) { struct gdbarch *gdbarch = regcache->arch (); const i386_gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); @@ -3059,11 +3032,8 @@ amd64_collect_fpregset (const struct regset *regset, amd64_collect_fxsave (regcache, regnum, fpregs); } -const struct regset amd64_fpregset = - { - NULL, amd64_supply_fpregset, amd64_collect_fpregset - }; - +const struct regset amd64_fpregset + = { NULL, amd64_supply_fpregset, amd64_collect_fpregset }; /* Figure out where the longjmp will land. Slurp the jmp_buf out of %rdi. We expect its value to be a pointer to the jmp_buf structure @@ -3087,8 +3057,8 @@ amd64_get_longjmp_target (frame_info_ptr frame, CORE_ADDR *pc) return 0; get_frame_register (frame, AMD64_RDI_REGNUM, buf); - jb_addr= extract_typed_address - (buf, builtin_type (gdbarch)->builtin_data_ptr); + jb_addr + = extract_typed_address (buf, builtin_type (gdbarch)->builtin_data_ptr); if (target_read_memory (jb_addr + jb_pc_offset, buf, len)) return 0; @@ -3097,14 +3067,13 @@ amd64_get_longjmp_target (frame_info_ptr frame, CORE_ADDR *pc) return 1; } -static const int amd64_record_regmap[] = -{ - AMD64_RAX_REGNUM, AMD64_RCX_REGNUM, AMD64_RDX_REGNUM, AMD64_RBX_REGNUM, - AMD64_RSP_REGNUM, AMD64_RBP_REGNUM, AMD64_RSI_REGNUM, AMD64_RDI_REGNUM, - AMD64_R8_REGNUM, AMD64_R9_REGNUM, AMD64_R10_REGNUM, AMD64_R11_REGNUM, - AMD64_R12_REGNUM, AMD64_R13_REGNUM, AMD64_R14_REGNUM, AMD64_R15_REGNUM, - AMD64_RIP_REGNUM, AMD64_EFLAGS_REGNUM, AMD64_CS_REGNUM, AMD64_SS_REGNUM, - AMD64_DS_REGNUM, AMD64_ES_REGNUM, AMD64_FS_REGNUM, AMD64_GS_REGNUM +static const int amd64_record_regmap[] = { + AMD64_RAX_REGNUM, AMD64_RCX_REGNUM, AMD64_RDX_REGNUM, AMD64_RBX_REGNUM, + AMD64_RSP_REGNUM, AMD64_RBP_REGNUM, AMD64_RSI_REGNUM, AMD64_RDI_REGNUM, + AMD64_R8_REGNUM, AMD64_R9_REGNUM, AMD64_R10_REGNUM, AMD64_R11_REGNUM, + AMD64_R12_REGNUM, AMD64_R13_REGNUM, AMD64_R14_REGNUM, AMD64_R15_REGNUM, + AMD64_RIP_REGNUM, AMD64_EFLAGS_REGNUM, AMD64_CS_REGNUM, AMD64_SS_REGNUM, + AMD64_DS_REGNUM, AMD64_ES_REGNUM, AMD64_FS_REGNUM, AMD64_GS_REGNUM }; /* Implement the "in_indirect_branch_thunk" gdbarch function. */ @@ -3113,8 +3082,7 @@ static bool amd64_in_indirect_branch_thunk (struct gdbarch *gdbarch, CORE_ADDR pc) { return x86_in_indirect_branch_thunk (pc, amd64_register_names, - AMD64_RAX_REGNUM, - AMD64_RIP_REGNUM); + AMD64_RAX_REGNUM, AMD64_RIP_REGNUM); } void @@ -3125,17 +3093,17 @@ amd64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch, const struct target_desc *tdesc = info.target_desc; static const char *const stap_integer_prefixes[] = { "$", NULL }; static const char *const stap_register_prefixes[] = { "%", NULL }; - static const char *const stap_register_indirection_prefixes[] = { "(", - NULL }; - static const char *const stap_register_indirection_suffixes[] = { ")", - NULL }; + static const char *const stap_register_indirection_prefixes[] + = { "(", NULL }; + static const char *const stap_register_indirection_suffixes[] + = { ")", NULL }; /* AMD64 generally uses `fxsave' instead of `fsave' for saving its floating-point registers. */ tdep->sizeof_fpregset = I387_SIZEOF_FXSAVE; tdep->fpregset = &amd64_fpregset; - if (! tdesc_has_registers (tdesc)) + if (!tdesc_has_registers (tdesc)) tdesc = default_tdesc; tdep->tdesc = tdesc; @@ -3193,8 +3161,7 @@ amd64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch, set_gdbarch_pseudo_register_read_value (gdbarch, amd64_pseudo_register_read_value); - set_gdbarch_pseudo_register_write (gdbarch, - amd64_pseudo_register_write); + set_gdbarch_pseudo_register_write (gdbarch, amd64_pseudo_register_write); set_gdbarch_ax_pseudo_register_collect (gdbarch, amd64_ax_pseudo_register_collect); @@ -3217,10 +3184,10 @@ amd64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch, set_gdbarch_num_regs (gdbarch, AMD64_NUM_REGS); /* Register numbers of various important registers. */ - set_gdbarch_sp_regnum (gdbarch, AMD64_RSP_REGNUM); /* %rsp */ - set_gdbarch_pc_regnum (gdbarch, AMD64_RIP_REGNUM); /* %rip */ + set_gdbarch_sp_regnum (gdbarch, AMD64_RSP_REGNUM); /* %rsp */ + set_gdbarch_pc_regnum (gdbarch, AMD64_RIP_REGNUM); /* %rip */ set_gdbarch_ps_regnum (gdbarch, AMD64_EFLAGS_REGNUM); /* %eflags */ - set_gdbarch_fp0_regnum (gdbarch, AMD64_ST0_REGNUM); /* %st(0) */ + set_gdbarch_fp0_regnum (gdbarch, AMD64_ST0_REGNUM); /* %st(0) */ /* The "default" register numbering scheme for AMD64 is referred to as the "DWARF Register Number Mapping" in the System V psABI. @@ -3270,12 +3237,11 @@ amd64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch, /* SystemTap variables and functions. */ set_gdbarch_stap_integer_prefixes (gdbarch, stap_integer_prefixes); set_gdbarch_stap_register_prefixes (gdbarch, stap_register_prefixes); - set_gdbarch_stap_register_indirection_prefixes (gdbarch, - stap_register_indirection_prefixes); - set_gdbarch_stap_register_indirection_suffixes (gdbarch, - stap_register_indirection_suffixes); - set_gdbarch_stap_is_single_operand (gdbarch, - i386_stap_is_single_operand); + set_gdbarch_stap_register_indirection_prefixes ( + gdbarch, stap_register_indirection_prefixes); + set_gdbarch_stap_register_indirection_suffixes ( + gdbarch, stap_register_indirection_suffixes); + set_gdbarch_stap_is_single_operand (gdbarch, i386_stap_is_single_operand); set_gdbarch_stap_parse_special_token (gdbarch, i386_stap_parse_special_token); set_gdbarch_insn_is_call (gdbarch, amd64_insn_is_call); @@ -3293,8 +3259,8 @@ amd64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch, static void amd64_none_init_abi (gdbarch_info info, gdbarch *arch) { - amd64_init_abi (info, arch, amd64_target_description (X86_XSTATE_SSE_MASK, - true)); + amd64_init_abi (info, arch, + amd64_target_description (X86_XSTATE_SSE_MASK, true)); } static struct type * @@ -3304,10 +3270,10 @@ amd64_x32_pseudo_register_type (struct gdbarch *gdbarch, int regnum) switch (regnum - tdep->eax_regnum) { - case AMD64_RBP_REGNUM: /* %ebp */ - case AMD64_RSP_REGNUM: /* %esp */ + case AMD64_RBP_REGNUM: /* %ebp */ + case AMD64_RSP_REGNUM: /* %esp */ return builtin_type (gdbarch)->builtin_data_ptr; - case AMD64_RIP_REGNUM: /* %eip */ + case AMD64_RIP_REGNUM: /* %eip */ return builtin_type (gdbarch)->builtin_func_ptr; } @@ -3343,24 +3309,24 @@ amd64_x32_none_init_abi (gdbarch_info info, gdbarch *arch) const struct target_desc * amd64_target_description (uint64_t xcr0, bool segments) { - static target_desc *amd64_tdescs \ - [2/*AVX*/][2/*MPX*/][2/*AVX512*/][2/*PKRU*/][2/*segments*/] = {}; + static target_desc *amd64_tdescs[2 /*AVX*/][2 /*MPX*/][2 /*AVX512*/] + [2 /*PKRU*/][2 /*segments*/] + = {}; target_desc **tdesc; tdesc = &amd64_tdescs[(xcr0 & X86_XSTATE_AVX) ? 1 : 0] - [(xcr0 & X86_XSTATE_MPX) ? 1 : 0] - [(xcr0 & X86_XSTATE_AVX512) ? 1 : 0] - [(xcr0 & X86_XSTATE_PKRU) ? 1 : 0] - [segments ? 1 : 0]; + [(xcr0 & X86_XSTATE_MPX) ? 1 : 0] + [(xcr0 & X86_XSTATE_AVX512) ? 1 : 0] + [(xcr0 & X86_XSTATE_PKRU) ? 1 : 0][segments ? 1 : 0]; if (*tdesc == NULL) - *tdesc = amd64_create_target_description (xcr0, false, false, - segments); + *tdesc = amd64_create_target_description (xcr0, false, false, segments); return *tdesc; } void _initialize_amd64_tdep (); + void _initialize_amd64_tdep () { @@ -3369,7 +3335,6 @@ _initialize_amd64_tdep () gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x64_32, GDB_OSABI_NONE, amd64_x32_none_init_abi); } - /* The 64-bit FXSAVE format differs from the 32-bit format in the sense that the instruction pointer and data pointer are simply @@ -3384,16 +3349,14 @@ _initialize_amd64_tdep () reserved bits in *FXSAVE. */ void -amd64_supply_fxsave (struct regcache *regcache, int regnum, - const void *fxsave) +amd64_supply_fxsave (struct regcache *regcache, int regnum, const void *fxsave) { struct gdbarch *gdbarch = regcache->arch (); i386_gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); i387_supply_fxsave (regcache, regnum, fxsave); - if (fxsave - && gdbarch_bfd_arch_info (gdbarch)->bits_per_word == 64) + if (fxsave && gdbarch_bfd_arch_info (gdbarch)->bits_per_word == 64) { const gdb_byte *regs = (const gdb_byte *) fxsave; @@ -3407,16 +3370,14 @@ amd64_supply_fxsave (struct regcache *regcache, int regnum, /* Similar to amd64_supply_fxsave, but use XSAVE extended state. */ void -amd64_supply_xsave (struct regcache *regcache, int regnum, - const void *xsave) +amd64_supply_xsave (struct regcache *regcache, int regnum, const void *xsave) { struct gdbarch *gdbarch = regcache->arch (); i386_gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); i387_supply_xsave (regcache, regnum, xsave); - if (xsave - && gdbarch_bfd_arch_info (gdbarch)->bits_per_word == 64) + if (xsave && gdbarch_bfd_arch_info (gdbarch)->bits_per_word == 64) { const gdb_byte *regs = (const gdb_byte *) xsave; ULONGEST clear_bv; @@ -3463,8 +3424,8 @@ amd64_collect_fxsave (const struct regcache *regcache, int regnum, /* Similar to amd64_collect_fxsave, but use XSAVE extended state. */ void -amd64_collect_xsave (const struct regcache *regcache, int regnum, - void *xsave, int gcore) +amd64_collect_xsave (const struct regcache *regcache, int regnum, void *xsave, + int gcore) { struct gdbarch *gdbarch = regcache->arch (); i386_gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); @@ -3475,10 +3436,8 @@ amd64_collect_xsave (const struct regcache *regcache, int regnum, if (gdbarch_bfd_arch_info (gdbarch)->bits_per_word == 64) { if (regnum == -1 || regnum == I387_FISEG_REGNUM (tdep)) - regcache->raw_collect (I387_FISEG_REGNUM (tdep), - regs + 12); + regcache->raw_collect (I387_FISEG_REGNUM (tdep), regs + 12); if (regnum == -1 || regnum == I387_FOSEG_REGNUM (tdep)) - regcache->raw_collect (I387_FOSEG_REGNUM (tdep), - regs + 20); + regcache->raw_collect (I387_FOSEG_REGNUM (tdep), regs + 20); } } diff --git a/gdb/amd64-tdep.h b/gdb/amd64-tdep.h index 929b4b8..55b4c04 100644 --- a/gdb/amd64-tdep.h +++ b/gdb/amd64-tdep.h @@ -32,39 +32,39 @@ struct regcache; enum amd64_regnum { - AMD64_RAX_REGNUM, /* %rax */ - AMD64_RBX_REGNUM, /* %rbx */ - AMD64_RCX_REGNUM, /* %rcx */ - AMD64_RDX_REGNUM, /* %rdx */ - AMD64_RSI_REGNUM, /* %rsi */ - AMD64_RDI_REGNUM, /* %rdi */ - AMD64_RBP_REGNUM, /* %rbp */ - AMD64_RSP_REGNUM, /* %rsp */ - AMD64_R8_REGNUM, /* %r8 */ - AMD64_R9_REGNUM, /* %r9 */ - AMD64_R10_REGNUM, /* %r10 */ - AMD64_R11_REGNUM, /* %r11 */ - AMD64_R12_REGNUM, /* %r12 */ - AMD64_R13_REGNUM, /* %r13 */ - AMD64_R14_REGNUM, /* %r14 */ - AMD64_R15_REGNUM, /* %r15 */ - AMD64_RIP_REGNUM, /* %rip */ - AMD64_EFLAGS_REGNUM, /* %eflags */ - AMD64_CS_REGNUM, /* %cs */ - AMD64_SS_REGNUM, /* %ss */ - AMD64_DS_REGNUM, /* %ds */ - AMD64_ES_REGNUM, /* %es */ - AMD64_FS_REGNUM, /* %fs */ - AMD64_GS_REGNUM, /* %gs */ - AMD64_ST0_REGNUM = 24, /* %st0 */ - AMD64_ST1_REGNUM, /* %st1 */ + AMD64_RAX_REGNUM, /* %rax */ + AMD64_RBX_REGNUM, /* %rbx */ + AMD64_RCX_REGNUM, /* %rcx */ + AMD64_RDX_REGNUM, /* %rdx */ + AMD64_RSI_REGNUM, /* %rsi */ + AMD64_RDI_REGNUM, /* %rdi */ + AMD64_RBP_REGNUM, /* %rbp */ + AMD64_RSP_REGNUM, /* %rsp */ + AMD64_R8_REGNUM, /* %r8 */ + AMD64_R9_REGNUM, /* %r9 */ + AMD64_R10_REGNUM, /* %r10 */ + AMD64_R11_REGNUM, /* %r11 */ + AMD64_R12_REGNUM, /* %r12 */ + AMD64_R13_REGNUM, /* %r13 */ + AMD64_R14_REGNUM, /* %r14 */ + AMD64_R15_REGNUM, /* %r15 */ + AMD64_RIP_REGNUM, /* %rip */ + AMD64_EFLAGS_REGNUM, /* %eflags */ + AMD64_CS_REGNUM, /* %cs */ + AMD64_SS_REGNUM, /* %ss */ + AMD64_DS_REGNUM, /* %ds */ + AMD64_ES_REGNUM, /* %es */ + AMD64_FS_REGNUM, /* %fs */ + AMD64_GS_REGNUM, /* %gs */ + AMD64_ST0_REGNUM = 24, /* %st0 */ + AMD64_ST1_REGNUM, /* %st1 */ AMD64_FCTRL_REGNUM = AMD64_ST0_REGNUM + 8, AMD64_FSTAT_REGNUM = AMD64_ST0_REGNUM + 9, AMD64_FTAG_REGNUM = AMD64_ST0_REGNUM + 10, - AMD64_XMM0_REGNUM = 40, /* %xmm0 */ - AMD64_XMM1_REGNUM, /* %xmm1 */ + AMD64_XMM0_REGNUM = 40, /* %xmm0 */ + AMD64_XMM1_REGNUM, /* %xmm1 */ AMD64_MXCSR_REGNUM = AMD64_XMM0_REGNUM + 16, - AMD64_YMM0H_REGNUM, /* %ymm0h */ + AMD64_YMM0H_REGNUM, /* %ymm0h */ AMD64_YMM15H_REGNUM = AMD64_YMM0H_REGNUM + 15, AMD64_BND0R_REGNUM = AMD64_YMM15H_REGNUM + 1, AMD64_BND3R_REGNUM = AMD64_BND0R_REGNUM + 3, @@ -84,21 +84,20 @@ enum amd64_regnum }; /* Number of general purpose registers. */ -#define AMD64_NUM_GREGS 24 +#define AMD64_NUM_GREGS 24 -#define AMD64_NUM_REGS (AMD64_GSBASE_REGNUM + 1) +#define AMD64_NUM_REGS (AMD64_GSBASE_REGNUM + 1) -extern displaced_step_copy_insn_closure_up amd64_displaced_step_copy_insn - (struct gdbarch *gdbarch, CORE_ADDR from, CORE_ADDR to, - struct regcache *regs); -extern void amd64_displaced_step_fixup - (struct gdbarch *gdbarch, displaced_step_copy_insn_closure *closure, - CORE_ADDR from, CORE_ADDR to, struct regcache *regs); +extern displaced_step_copy_insn_closure_up +amd64_displaced_step_copy_insn (struct gdbarch *gdbarch, CORE_ADDR from, + CORE_ADDR to, struct regcache *regs); +extern void amd64_displaced_step_fixup ( + struct gdbarch *gdbarch, displaced_step_copy_insn_closure *closure, + CORE_ADDR from, CORE_ADDR to, struct regcache *regs); /* Initialize the ABI for amd64. Uses DEFAULT_TDESC as fallback tdesc, if INFO does not specify one. */ -extern void amd64_init_abi (struct gdbarch_info info, - struct gdbarch *gdbarch, +extern void amd64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch, const target_desc *default_tdesc); /* Initialize the ABI for x32. Uses DEFAULT_TDESC as fallback tdesc, @@ -129,9 +128,9 @@ extern void amd64_supply_xsave (struct regcache *regcache, int regnum, extern void amd64_collect_fxsave (const struct regcache *regcache, int regnum, void *fxsave); /* Similar to amd64_collect_fxsave, but use XSAVE extended state. */ -extern void amd64_collect_xsave (const struct regcache *regcache, - int regnum, void *xsave, int gcore); - +extern void amd64_collect_xsave (const struct regcache *regcache, int regnum, + void *xsave, int gcore); + /* Floating-point register set. */ extern const struct regset amd64_fpregset; diff --git a/gdb/amd64-windows-nat.c b/gdb/amd64-windows-nat.c index c99f909..c1dbcf4 100644 --- a/gdb/amd64-windows-nat.c +++ b/gdb/amd64-windows-nat.c @@ -23,68 +23,40 @@ #include #define context_offset(x) (offsetof (CONTEXT, x)) -const int amd64_mappings[] = -{ - context_offset (Rax), - context_offset (Rbx), - context_offset (Rcx), - context_offset (Rdx), - context_offset (Rsi), - context_offset (Rdi), - context_offset (Rbp), - context_offset (Rsp), - context_offset (R8), - context_offset (R9), - context_offset (R10), - context_offset (R11), - context_offset (R12), - context_offset (R13), - context_offset (R14), - context_offset (R15), - context_offset (Rip), - context_offset (EFlags), - context_offset (SegCs), - context_offset (SegSs), - context_offset (SegDs), - context_offset (SegEs), - context_offset (SegFs), - context_offset (SegGs), - context_offset (FloatSave.FloatRegisters[0]), - context_offset (FloatSave.FloatRegisters[1]), - context_offset (FloatSave.FloatRegisters[2]), - context_offset (FloatSave.FloatRegisters[3]), - context_offset (FloatSave.FloatRegisters[4]), - context_offset (FloatSave.FloatRegisters[5]), - context_offset (FloatSave.FloatRegisters[6]), - context_offset (FloatSave.FloatRegisters[7]), - context_offset (FloatSave.ControlWord), - context_offset (FloatSave.StatusWord), - context_offset (FloatSave.TagWord), - context_offset (FloatSave.ErrorSelector), - context_offset (FloatSave.ErrorOffset), - context_offset (FloatSave.DataSelector), - context_offset (FloatSave.DataOffset), - context_offset (FloatSave.ErrorSelector) - /* XMM0-7 */ , - context_offset (Xmm0), - context_offset (Xmm1), - context_offset (Xmm2), - context_offset (Xmm3), - context_offset (Xmm4), - context_offset (Xmm5), - context_offset (Xmm6), - context_offset (Xmm7), - context_offset (Xmm8), - context_offset (Xmm9), - context_offset (Xmm10), - context_offset (Xmm11), - context_offset (Xmm12), - context_offset (Xmm13), - context_offset (Xmm14), - context_offset (Xmm15), - /* MXCSR */ - context_offset (FloatSave.MxCsr) -}; +const int amd64_mappings[] + = { context_offset (Rax), context_offset (Rbx), context_offset (Rcx), + context_offset (Rdx), context_offset (Rsi), context_offset (Rdi), + context_offset (Rbp), context_offset (Rsp), context_offset (R8), + context_offset (R9), context_offset (R10), context_offset (R11), + context_offset (R12), context_offset (R13), context_offset (R14), + context_offset (R15), context_offset (Rip), context_offset (EFlags), + context_offset (SegCs), context_offset (SegSs), context_offset (SegDs), + context_offset (SegEs), context_offset (SegFs), context_offset (SegGs), + context_offset (FloatSave.FloatRegisters[0]), + context_offset (FloatSave.FloatRegisters[1]), + context_offset (FloatSave.FloatRegisters[2]), + context_offset (FloatSave.FloatRegisters[3]), + context_offset (FloatSave.FloatRegisters[4]), + context_offset (FloatSave.FloatRegisters[5]), + context_offset (FloatSave.FloatRegisters[6]), + context_offset (FloatSave.FloatRegisters[7]), + context_offset (FloatSave.ControlWord), + context_offset (FloatSave.StatusWord), + context_offset (FloatSave.TagWord), + context_offset (FloatSave.ErrorSelector), + context_offset (FloatSave.ErrorOffset), + context_offset (FloatSave.DataSelector), + context_offset (FloatSave.DataOffset), + context_offset (FloatSave.ErrorSelector) + /* XMM0-7 */, + context_offset (Xmm0), context_offset (Xmm1), context_offset (Xmm2), + context_offset (Xmm3), context_offset (Xmm4), context_offset (Xmm5), + context_offset (Xmm6), context_offset (Xmm7), context_offset (Xmm8), + context_offset (Xmm9), context_offset (Xmm10), context_offset (Xmm11), + context_offset (Xmm12), context_offset (Xmm13), context_offset (Xmm14), + context_offset (Xmm15), + /* MXCSR */ + context_offset (FloatSave.MxCsr) }; #undef context_offset /* segment_register_p_ftype implementation for amd64. */ @@ -96,6 +68,7 @@ amd64_windows_segment_register_p (int regnum) } void _initialize_amd64_windows_nat (); + void _initialize_amd64_windows_nat () { diff --git a/gdb/amd64-windows-tdep.c b/gdb/amd64-windows-tdep.c index 411a620..f581c6c 100644 --- a/gdb/amd64-windows-tdep.c +++ b/gdb/amd64-windows-tdep.c @@ -34,18 +34,16 @@ #include /* The registers used to pass integer arguments during a function call. */ -static int amd64_windows_dummy_call_integer_regs[] = -{ - AMD64_RCX_REGNUM, /* %rcx */ - AMD64_RDX_REGNUM, /* %rdx */ - AMD64_R8_REGNUM, /* %r8 */ - AMD64_R9_REGNUM /* %r9 */ +static int amd64_windows_dummy_call_integer_regs[] = { + AMD64_RCX_REGNUM, /* %rcx */ + AMD64_RDX_REGNUM, /* %rdx */ + AMD64_R8_REGNUM, /* %r8 */ + AMD64_R9_REGNUM /* %r9 */ }; /* This vector maps GDB's idea of a register's number into an offset into the Windows API CONTEXT structure. */ -static int amd64_windows_gregset_reg_offset[] = -{ +static int amd64_windows_gregset_reg_offset[] = { 120, /* Rax */ 144, /* Rbx */ 128, /* Rcx */ @@ -115,24 +113,22 @@ amd64_windows_passed_by_integer_register (struct type *type) { switch (type->code ()) { - case TYPE_CODE_INT: - case TYPE_CODE_ENUM: - case TYPE_CODE_BOOL: - case TYPE_CODE_RANGE: - case TYPE_CODE_CHAR: - case TYPE_CODE_PTR: - case TYPE_CODE_REF: - case TYPE_CODE_RVALUE_REF: - case TYPE_CODE_STRUCT: - case TYPE_CODE_UNION: - case TYPE_CODE_COMPLEX: - return (type->length () == 1 - || type->length () == 2 - || type->length () == 4 - || type->length () == 8); - - default: - return 0; + case TYPE_CODE_INT: + case TYPE_CODE_ENUM: + case TYPE_CODE_BOOL: + case TYPE_CODE_RANGE: + case TYPE_CODE_CHAR: + case TYPE_CODE_PTR: + case TYPE_CODE_REF: + case TYPE_CODE_RVALUE_REF: + case TYPE_CODE_STRUCT: + case TYPE_CODE_UNION: + case TYPE_CODE_COMPLEX: + return (type->length () == 1 || type->length () == 2 + || type->length () == 4 || type->length () == 8); + + default: + return 0; } } @@ -170,8 +166,8 @@ amd64_windows_passed_by_pointer (struct type *type) the value of each argument. SP is value of the Stack Pointer. */ static CORE_ADDR -amd64_windows_adjust_args_passed_by_pointer (struct value **args, - int nargs, CORE_ADDR sp) +amd64_windows_adjust_args_passed_by_pointer (struct value **args, int nargs, + CORE_ADDR sp) { int i; @@ -201,8 +197,8 @@ amd64_windows_adjust_args_passed_by_pointer (struct value **args, REGCACHE is the register cache. */ static void -amd64_windows_store_arg_in_reg (struct regcache *regcache, - struct value *arg, int regno) +amd64_windows_store_arg_in_reg (struct regcache *regcache, struct value *arg, + int regno) { struct type *type = value_type (arg); const gdb_byte *valbuf = value_contents (arg).data (); @@ -259,21 +255,21 @@ amd64_windows_push_arguments (struct regcache *regcache, int nargs, { if (amd64_windows_passed_by_integer_register (type)) { - amd64_windows_store_arg_in_reg - (regcache, args[i], - amd64_windows_dummy_call_integer_regs[reg_idx]); + amd64_windows_store_arg_in_reg ( + regcache, args[i], + amd64_windows_dummy_call_integer_regs[reg_idx]); on_stack_p = 0; reg_idx++; } else if (amd64_windows_passed_by_xmm_register (type)) { - amd64_windows_store_arg_in_reg - (regcache, args[i], AMD64_XMM0_REGNUM + reg_idx); + amd64_windows_store_arg_in_reg (regcache, args[i], + AMD64_XMM0_REGNUM + reg_idx); /* In case of varargs, these parameters must also be passed via the integer registers. */ - amd64_windows_store_arg_in_reg - (regcache, args[i], - amd64_windows_dummy_call_integer_regs[reg_idx]); + amd64_windows_store_arg_in_reg ( + regcache, args[i], + amd64_windows_dummy_call_integer_regs[reg_idx]); on_stack_p = 0; reg_idx++; } @@ -307,18 +303,17 @@ amd64_windows_push_arguments (struct regcache *regcache, int nargs, /* Implement the "push_dummy_call" gdbarch method. */ static CORE_ADDR -amd64_windows_push_dummy_call - (struct gdbarch *gdbarch, struct value *function, - struct regcache *regcache, CORE_ADDR bp_addr, - int nargs, struct value **args, CORE_ADDR sp, - function_call_return_method return_method, CORE_ADDR struct_addr) +amd64_windows_push_dummy_call (struct gdbarch *gdbarch, struct value *function, + struct regcache *regcache, CORE_ADDR bp_addr, + int nargs, struct value **args, CORE_ADDR sp, + function_call_return_method return_method, + CORE_ADDR struct_addr) { enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); gdb_byte buf[8]; /* Pass arguments. */ - sp = amd64_windows_push_arguments (regcache, nargs, args, sp, - return_method); + sp = amd64_windows_push_arguments (regcache, nargs, args, sp, return_method); /* Pass "hidden" argument". */ if (return_method == return_method_struct) @@ -355,7 +350,8 @@ amd64_windows_push_dummy_call static enum return_value_convention amd64_windows_return_value (struct gdbarch *gdbarch, struct value *function, struct type *type, struct regcache *regcache, - struct value **read_value, const gdb_byte *writebuf) + struct value **read_value, + const gdb_byte *writebuf) { int len = type->length (); int regnum = -1; @@ -364,31 +360,31 @@ amd64_windows_return_value (struct gdbarch *gdbarch, struct value *function, store the associated register number in REGNUM. */ switch (type->code ()) { - case TYPE_CODE_FLT: - /* floats, and doubles are returned via XMM0. */ - if (len == 4 || len == 8) - regnum = AMD64_XMM0_REGNUM; - break; - case TYPE_CODE_ARRAY: - /* __m128, __m128i and __m128d are returned via XMM0. */ - if (type->is_vector () && len == 16) - { - enum type_code code = type->target_type ()->code (); - if (code == TYPE_CODE_INT || code == TYPE_CODE_FLT) - { - regnum = AMD64_XMM0_REGNUM; - break; - } - } - /* fall through */ - default: - /* All other values that are 1, 2, 4 or 8 bytes long are returned + case TYPE_CODE_FLT: + /* floats, and doubles are returned via XMM0. */ + if (len == 4 || len == 8) + regnum = AMD64_XMM0_REGNUM; + break; + case TYPE_CODE_ARRAY: + /* __m128, __m128i and __m128d are returned via XMM0. */ + if (type->is_vector () && len == 16) + { + enum type_code code = type->target_type ()->code (); + if (code == TYPE_CODE_INT || code == TYPE_CODE_FLT) + { + regnum = AMD64_XMM0_REGNUM; + break; + } + } + /* fall through */ + default: + /* All other values that are 1, 2, 4 or 8 bytes long are returned via RAX. */ - if (len == 1 || len == 2 || len == 4 || len == 8) - regnum = AMD64_RAX_REGNUM; - else if (len == 16 && type->code () == TYPE_CODE_INT) - regnum = AMD64_XMM0_REGNUM; - break; + if (len == 1 || len == 2 || len == 4 || len == 8) + regnum = AMD64_RAX_REGNUM; + else if (len == 16 && type->code () == TYPE_CODE_INT) + regnum = AMD64_XMM0_REGNUM; + break; } if (regnum < 0) @@ -439,8 +435,7 @@ amd64_skip_main_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) call_dest = pc + 5 + extract_signed_integer (buf, 4, byte_order); s = lookup_minimal_symbol_by_pc (call_dest); - if (s.minsym != NULL - && s.minsym->linkage_name () != NULL + if (s.minsym != NULL && s.minsym->linkage_name () != NULL && strcmp (s.minsym->linkage_name (), "__main") == 0) pc += 5; } @@ -481,25 +476,11 @@ struct amd64_windows_frame_cache }; /* Convert a Windows register number to gdb. */ -static const enum amd64_regnum amd64_windows_w2gdb_regnum[] = -{ - AMD64_RAX_REGNUM, - AMD64_RCX_REGNUM, - AMD64_RDX_REGNUM, - AMD64_RBX_REGNUM, - AMD64_RSP_REGNUM, - AMD64_RBP_REGNUM, - AMD64_RSI_REGNUM, - AMD64_RDI_REGNUM, - AMD64_R8_REGNUM, - AMD64_R9_REGNUM, - AMD64_R10_REGNUM, - AMD64_R11_REGNUM, - AMD64_R12_REGNUM, - AMD64_R13_REGNUM, - AMD64_R14_REGNUM, - AMD64_R15_REGNUM -}; +static const enum amd64_regnum amd64_windows_w2gdb_regnum[] + = { AMD64_RAX_REGNUM, AMD64_RCX_REGNUM, AMD64_RDX_REGNUM, AMD64_RBX_REGNUM, + AMD64_RSP_REGNUM, AMD64_RBP_REGNUM, AMD64_RSI_REGNUM, AMD64_RDI_REGNUM, + AMD64_R8_REGNUM, AMD64_R9_REGNUM, AMD64_R10_REGNUM, AMD64_R11_REGNUM, + AMD64_R12_REGNUM, AMD64_R13_REGNUM, AMD64_R14_REGNUM, AMD64_R15_REGNUM }; /* Return TRUE iff PC is the range of the function corresponding to CACHE. */ @@ -635,8 +616,8 @@ amd64_windows_frame_decode_epilogue (frame_info_ptr this_frame, if (target_read_memory (pc + 1, imm16, 2) != 0) return -1; cache->prev_rip_addr = cur_sp; - cache->prev_sp = cur_sp - + extract_unsigned_integer (imm16, 4, byte_order); + cache->prev_sp + = cur_sp + extract_unsigned_integer (imm16, 4, byte_order); return 1; } @@ -733,15 +714,15 @@ amd64_windows_frame_decode_insns (frame_info_ptr this_frame, struct external_pex64_runtime_function d; if (target_read_memory (cache->image_base + (unwind_info & ~1), - (gdb_byte *) &d, sizeof (d)) != 0) + (gdb_byte *) &d, sizeof (d)) + != 0) return; cache->start_rva = extract_unsigned_integer (d.rva_BeginAddress, 4, byte_order); cache->end_rva = extract_unsigned_integer (d.rva_EndAddress, 4, byte_order); - unwind_info - = extract_unsigned_integer (d.rva_UnwindData, 4, byte_order); + unwind_info = extract_unsigned_integer (d.rva_UnwindData, 4, byte_order); } while (1) @@ -757,13 +738,14 @@ amd64_windows_frame_decode_insns (frame_info_ptr this_frame, /* Read and decode header. */ if (target_read_memory (cache->image_base + unwind_info, - (gdb_byte *) &ex_ui, sizeof (ex_ui)) != 0) + (gdb_byte *) &ex_ui, sizeof (ex_ui)) + != 0) return; frame_debug_printf ("%s: ver: %02x, plgsz: %02x, cnt: %02x, frame: %02x", - paddress (gdbarch, unwind_info), - ex_ui.Version_Flags, ex_ui.SizeOfPrologue, - ex_ui.CountOfCodes, ex_ui.FrameRegisterOffset); + paddress (gdbarch, unwind_info), ex_ui.Version_Flags, + ex_ui.SizeOfPrologue, ex_ui.CountOfCodes, + ex_ui.FrameRegisterOffset); /* Check version. */ if (PEX64_UWI_VERSION (ex_ui.Version_Flags) != 1 @@ -809,8 +791,9 @@ amd64_windows_frame_decode_insns (frame_info_ptr this_frame, /* Read opcodes. */ if (codes_count != 0 && target_read_memory (cache->image_base + unwind_info - + sizeof (ex_ui), - insns, codes_count * 2) != 0) + + sizeof (ex_ui), + insns, codes_count * 2) + != 0) return; end_insns = &insns[codes_count * 2]; @@ -854,8 +837,8 @@ amd64_windows_frame_decode_insns (frame_info_ptr this_frame, break; case UWOP_ALLOC_LARGE: if (PEX64_UNWCODE_INFO (p[1]) == 0) - cur_sp += - 8 * extract_unsigned_integer (p + 2, 2, byte_order); + cur_sp + += 8 * extract_unsigned_integer (p + 2, 2, byte_order); else if (PEX64_UNWCODE_INFO (p[1]) == 1) cur_sp += extract_unsigned_integer (p + 2, 4, byte_order); else @@ -865,28 +848,31 @@ amd64_windows_frame_decode_insns (frame_info_ptr this_frame, cur_sp += 8 + 8 * PEX64_UNWCODE_INFO (p[1]); break; case UWOP_SET_FPREG: - cur_sp = save_addr - - PEX64_UWI_FRAMEOFF (ex_ui.FrameRegisterOffset) * 16; + cur_sp + = save_addr + - PEX64_UWI_FRAMEOFF (ex_ui.FrameRegisterOffset) * 16; break; case UWOP_SAVE_NONVOL: reg = amd64_windows_w2gdb_regnum[PEX64_UNWCODE_INFO (p[1])]; - cache->prev_reg_addr[reg] = save_addr - + 8 * extract_unsigned_integer (p + 2, 2, byte_order); + cache->prev_reg_addr[reg] + = save_addr + + 8 * extract_unsigned_integer (p + 2, 2, byte_order); break; case UWOP_SAVE_NONVOL_FAR: reg = amd64_windows_w2gdb_regnum[PEX64_UNWCODE_INFO (p[1])]; - cache->prev_reg_addr[reg] = save_addr - + 8 * extract_unsigned_integer (p + 2, 4, byte_order); + cache->prev_reg_addr[reg] + = save_addr + + 8 * extract_unsigned_integer (p + 2, 4, byte_order); break; case UWOP_SAVE_XMM128: - cache->prev_xmm_addr[PEX64_UNWCODE_INFO (p[1])] = - save_addr - - 16 * extract_unsigned_integer (p + 2, 2, byte_order); + cache->prev_xmm_addr[PEX64_UNWCODE_INFO (p[1])] + = save_addr + - 16 * extract_unsigned_integer (p + 2, 2, byte_order); break; case UWOP_SAVE_XMM128_FAR: - cache->prev_xmm_addr[PEX64_UNWCODE_INFO (p[1])] = - save_addr - - 16 * extract_unsigned_integer (p + 2, 4, byte_order); + cache->prev_xmm_addr[PEX64_UNWCODE_INFO (p[1])] + = save_addr + - 16 * extract_unsigned_integer (p + 2, 4, byte_order); break; case UWOP_PUSH_MACHFRAME: if (PEX64_UNWCODE_INFO (p[1]) == 0) @@ -959,8 +945,8 @@ amd64_windows_frame_decode_insns (frame_info_ptr this_frame, first = 0; /* Stay aligned on word boundary. */ - chain_vma = cache->image_base + unwind_info - + sizeof (ex_ui) + ((codes_count + 1) & ~1) * 2; + chain_vma = cache->image_base + unwind_info + sizeof (ex_ui) + + ((codes_count + 1) & ~1) * 2; if (target_read_memory (chain_vma, (gdb_byte *) &d, sizeof (d)) != 0) return; @@ -968,12 +954,12 @@ amd64_windows_frame_decode_insns (frame_info_ptr this_frame, /* Decode begin/end. This may be different from .pdata index, as an unwind info may be shared by several functions (in particular if many functions have the same prolog and handler. */ - cache->start_rva = - extract_unsigned_integer (d.rva_BeginAddress, 4, byte_order); - cache->end_rva = - extract_unsigned_integer (d.rva_EndAddress, 4, byte_order); - unwind_info = - extract_unsigned_integer (d.rva_UnwindData, 4, byte_order); + cache->start_rva + = extract_unsigned_integer (d.rva_BeginAddress, 4, byte_order); + cache->end_rva + = extract_unsigned_integer (d.rva_EndAddress, 4, byte_order); + unwind_info + = extract_unsigned_integer (d.rva_UnwindData, 4, byte_order); frame_debug_printf ("next in chain: unwind_data=%s, start_rva=%s, " "end_rva=%s", @@ -1003,10 +989,8 @@ amd64_windows_frame_decode_insns (frame_info_ptr this_frame, static int amd64_windows_find_unwind_info (struct gdbarch *gdbarch, CORE_ADDR pc, - CORE_ADDR *unwind_info, - CORE_ADDR *image_base, - CORE_ADDR *start_rva, - CORE_ADDR *end_rva) + CORE_ADDR *unwind_info, CORE_ADDR *image_base, + CORE_ADDR *start_rva, CORE_ADDR *end_rva) { struct obj_section *sec; pe_data_type *pe; @@ -1044,7 +1028,8 @@ amd64_windows_find_unwind_info (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sa, ea; if (target_read_memory (base + dir->VirtualAddress + mid * sizeof (d), - (gdb_byte *) &d, sizeof (d)) != 0) + (gdb_byte *) &d, sizeof (d)) + != 0) return -1; sa = extract_unsigned_integer (d.rva_BeginAddress, 4, byte_order); @@ -1058,8 +1043,8 @@ amd64_windows_find_unwind_info (struct gdbarch *gdbarch, CORE_ADDR pc, /* Got it. */ *start_rva = sa; *end_rva = ea; - *unwind_info = - extract_unsigned_integer (d.rva_UnwindData, 4, byte_order); + *unwind_info + = extract_unsigned_integer (d.rva_UnwindData, 4, byte_order); break; } else @@ -1099,8 +1084,7 @@ amd64_windows_frame_cache (frame_info_ptr this_frame, void **this_cache) cache->pc = pc; if (amd64_windows_find_unwind_info (gdbarch, pc, &unwind_info, - &cache->image_base, - &cache->start_rva, + &cache->image_base, &cache->start_rva, &cache->end_rva)) return cache; @@ -1126,16 +1110,15 @@ amd64_windows_frame_prev_register (frame_info_ptr this_frame, void **this_cache, int regnum) { struct gdbarch *gdbarch = get_frame_arch (this_frame); - struct amd64_windows_frame_cache *cache = - amd64_windows_frame_cache (this_frame, this_cache); + struct amd64_windows_frame_cache *cache + = amd64_windows_frame_cache (this_frame, this_cache); CORE_ADDR prev; - frame_debug_printf ("%s for sp=%s", - gdbarch_register_name (gdbarch, regnum), + frame_debug_printf ("%s for sp=%s", gdbarch_register_name (gdbarch, regnum), paddress (gdbarch, cache->prev_sp)); if (regnum >= AMD64_XMM0_REGNUM && regnum <= AMD64_XMM0_REGNUM + 15) - prev = cache->prev_xmm_addr[regnum - AMD64_XMM0_REGNUM]; + prev = cache->prev_xmm_addr[regnum - AMD64_XMM0_REGNUM]; else if (regnum == AMD64_RSP_REGNUM) { prev = cache->prev_rsp_addr; @@ -1169,27 +1152,25 @@ amd64_windows_frame_prev_register (frame_info_ptr this_frame, static void amd64_windows_frame_this_id (frame_info_ptr this_frame, void **this_cache, - struct frame_id *this_id) + struct frame_id *this_id) { - struct amd64_windows_frame_cache *cache = - amd64_windows_frame_cache (this_frame, this_cache); + struct amd64_windows_frame_cache *cache + = amd64_windows_frame_cache (this_frame, this_cache); - *this_id = frame_id_build (cache->prev_sp, - cache->image_base + cache->start_rva); + *this_id + = frame_id_build (cache->prev_sp, cache->image_base + cache->start_rva); } /* Windows x64 SEH unwinder. */ -static const struct frame_unwind amd64_windows_frame_unwind = -{ - "amd64 windows", - NORMAL_FRAME, - default_frame_unwind_stop_reason, - &amd64_windows_frame_this_id, - &amd64_windows_frame_prev_register, - NULL, - default_frame_sniffer -}; +static const struct frame_unwind amd64_windows_frame_unwind + = { "amd64 windows", + NORMAL_FRAME, + default_frame_unwind_stop_reason, + &amd64_windows_frame_this_id, + &amd64_windows_frame_prev_register, + NULL, + default_frame_sniffer }; /* Implement the "skip_prologue" gdbarch method. */ @@ -1202,8 +1183,9 @@ amd64_windows_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) struct external_pex64_unwind_info ex_ui; /* Use prologue size from unwind info. */ - if (amd64_windows_find_unwind_info (gdbarch, pc, &unwind_info, - &image_base, &start_rva, &end_rva) == 0) + if (amd64_windows_find_unwind_info (gdbarch, pc, &unwind_info, &image_base, + &start_rva, &end_rva) + == 0) { if (unwind_info == 0) { @@ -1211,7 +1193,8 @@ amd64_windows_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) return pc; } else if (target_read_memory (image_base + unwind_info, - (gdb_byte *) &ex_ui, sizeof (ex_ui)) == 0 + (gdb_byte *) &ex_ui, sizeof (ex_ui)) + == 0 && PEX64_UWI_VERSION (ex_ui.Version_Flags) == 1) return std::max (pc, image_base + start_rva + ex_ui.SizeOfPrologue); } @@ -1244,22 +1227,19 @@ amd64_windows_skip_trampoline_code (frame_info_ptr frame, CORE_ADDR pc) if (pc && read_memory_unsigned_integer (pc, 2, byte_order) == 0x25ff) { /* Get opcode offset and see if we can find a reference in our data. */ - ULONGEST offset - = read_memory_unsigned_integer (pc + 2, 4, byte_order); + ULONGEST offset = read_memory_unsigned_integer (pc + 2, 4, byte_order); /* Get address of function pointer at end of pc. */ CORE_ADDR indirect_addr = pc + offset + 6; struct minimal_symbol *indsym - = (indirect_addr - ? lookup_minimal_symbol_by_pc (indirect_addr).minsym - : NULL); + = (indirect_addr ? lookup_minimal_symbol_by_pc (indirect_addr).minsym + : NULL); const char *symname = indsym ? indsym->linkage_name () : NULL; if (symname) { - if (startswith (symname, "__imp_") - || startswith (symname, "_imp_")) + if (startswith (symname, "__imp_") || startswith (symname, "_imp_")) destination = read_memory_unsigned_integer (indirect_addr, 8, byte_order); } @@ -1314,8 +1294,8 @@ amd64_windows_init_abi_common (gdbarch_info info, struct gdbarch *gdbarch) tdep->sizeof_fpregset = 0; /* Core file support. */ - set_gdbarch_core_xfer_shared_libraries - (gdbarch, windows_core_xfer_shared_libraries); + set_gdbarch_core_xfer_shared_libraries (gdbarch, + windows_core_xfer_shared_libraries); set_gdbarch_core_pid_to_str (gdbarch, windows_core_pid_to_str); set_gdbarch_auto_wide_charset (gdbarch, amd64_windows_auto_wide_charset); @@ -1375,6 +1355,7 @@ amd64_cygwin_core_osabi_sniffer (bfd *abfd) } void _initialize_amd64_windows_tdep (); + void _initialize_amd64_windows_tdep () { @@ -1389,5 +1370,4 @@ _initialize_amd64_windows_tdep () /* Cygwin uses elf core dumps. */ gdbarch_register_osabi_sniffer (bfd_arch_i386, bfd_target_elf_flavour, amd64_cygwin_core_osabi_sniffer); - } diff --git a/gdb/amdgpu-tdep.c b/gdb/amdgpu-tdep.c index fc5e243..ff35eb4 100644 --- a/gdb/amdgpu-tdep.c +++ b/gdb/amdgpu-tdep.c @@ -113,31 +113,32 @@ amdgpu_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int dwarf_reg) struct amd_dbgapi_register_type { enum class kind - { - INTEGER, - FLOAT, - DOUBLE, - VECTOR, - CODE_PTR, - FLAGS, - ENUM, - }; + { + INTEGER, + FLOAT, + DOUBLE, + VECTOR, + CODE_PTR, + FLAGS, + ENUM, + }; amd_dbgapi_register_type (kind kind, std::string lookup_name) - : m_kind (kind), m_lookup_name (std::move (lookup_name)) - {} + : m_kind (kind), + m_lookup_name (std::move (lookup_name)) + { + } virtual ~amd_dbgapi_register_type () = default; /* Return the type's kind. */ - kind kind () const - { return m_kind; } + kind kind () const { return m_kind; } /* Name to use for this type in the existing type map. */ - const std::string &lookup_name () const - { return m_lookup_name; } + const std::string &lookup_name () const { return m_lookup_name; } private: + enum kind m_kind; std::string m_lookup_name; }; @@ -147,20 +148,21 @@ using amd_dbgapi_register_type_up = std::unique_ptr; struct amd_dbgapi_register_type_integer : public amd_dbgapi_register_type { amd_dbgapi_register_type_integer (bool is_unsigned, unsigned int bit_size) - : amd_dbgapi_register_type - (kind::INTEGER, - string_printf ("%sint%d", is_unsigned ? "u" : "", bit_size)), + : amd_dbgapi_register_type (kind::INTEGER, + string_printf ("%sint%d", + is_unsigned ? "u" : "", + bit_size)), m_is_unsigned (is_unsigned), m_bit_size (bit_size) - {} + { + } - bool is_unsigned () const - { return m_is_unsigned; } + bool is_unsigned () const { return m_is_unsigned; } - unsigned int bit_size () const - { return m_bit_size; } + unsigned int bit_size () const { return m_bit_size; } private: + bool m_is_unsigned; unsigned int m_bit_size; }; @@ -169,40 +171,46 @@ struct amd_dbgapi_register_type_float : public amd_dbgapi_register_type { amd_dbgapi_register_type_float () : amd_dbgapi_register_type (kind::FLOAT, "float") - {} + { + } }; struct amd_dbgapi_register_type_double : public amd_dbgapi_register_type { amd_dbgapi_register_type_double () : amd_dbgapi_register_type (kind::DOUBLE, "double") - {} + { + } }; struct amd_dbgapi_register_type_vector : public amd_dbgapi_register_type { - amd_dbgapi_register_type_vector (const amd_dbgapi_register_type &element_type, - unsigned int count) + amd_dbgapi_register_type_vector ( + const amd_dbgapi_register_type &element_type, unsigned int count) : amd_dbgapi_register_type (kind::VECTOR, make_lookup_name (element_type, count)), m_element_type (element_type), m_count (count) - {} + { + } const amd_dbgapi_register_type &element_type () const - { return m_element_type; } + { + return m_element_type; + } - unsigned int count () const - { return m_count; } + unsigned int count () const { return m_count; } - static std::string make_lookup_name - (const amd_dbgapi_register_type &element_type, unsigned int count) + static std::string + make_lookup_name (const amd_dbgapi_register_type &element_type, + unsigned int count) { return string_printf ("%s[%d]", element_type.lookup_name ().c_str (), count); } private: + const amd_dbgapi_register_type &m_element_type; unsigned int m_count; }; @@ -211,7 +219,8 @@ struct amd_dbgapi_register_type_code_ptr : public amd_dbgapi_register_type { amd_dbgapi_register_type_code_ptr () : amd_dbgapi_register_type (kind::CODE_PTR, "void (*)()") - {} + { + } }; struct amd_dbgapi_register_type_flags : public amd_dbgapi_register_type @@ -232,33 +241,31 @@ struct amd_dbgapi_register_type_flags : public amd_dbgapi_register_type make_lookup_name (bit_size, name)), m_bit_size (bit_size), m_name (std::move (name)) - {} + { + } - unsigned int bit_size () const - { return m_bit_size; } + unsigned int bit_size () const { return m_bit_size; } void add_field (std::string name, unsigned int bit_pos_start, unsigned int bit_pos_end, const amd_dbgapi_register_type *type) { - m_fields.push_back (field {std::move (name), bit_pos_start, - bit_pos_end, type}); + m_fields.push_back (field { std::move (name), bit_pos_start, bit_pos_end, + type }); } - container_type::size_type size () const - { return m_fields.size (); } + container_type::size_type size () const { return m_fields.size (); } const field &operator[] (container_type::size_type pos) const - { return m_fields[pos]; } + { + return m_fields[pos]; + } - const_iterator_type begin () const - { return m_fields.begin (); } + const_iterator_type begin () const { return m_fields.begin (); } - const_iterator_type end () const - { return m_fields.end (); } + const_iterator_type end () const { return m_fields.end (); } - const std::string &name () const - { return m_name; } + const std::string &name () const { return m_name; } static std::string make_lookup_name (int bits, gdb::string_view name) { @@ -268,6 +275,7 @@ struct amd_dbgapi_register_type_flags : public amd_dbgapi_register_type } private: + unsigned int m_bit_size; container_type m_fields; std::string m_name; @@ -290,31 +298,30 @@ struct amd_dbgapi_register_type_enum : public amd_dbgapi_register_type amd_dbgapi_register_type_enum (gdb::string_view name) : amd_dbgapi_register_type (kind::ENUM, make_lookup_name (name)), m_name (name.data (), name.length ()) - {} + { + } - void set_bit_size (int bit_size) - { m_bit_size = bit_size; } + void set_bit_size (int bit_size) { m_bit_size = bit_size; } - unsigned int bit_size () const - { return m_bit_size; } + unsigned int bit_size () const { return m_bit_size; } void add_enumerator (std::string name, ULONGEST value) - { m_enumerators.push_back (enumerator {std::move (name), value}); } + { + m_enumerators.push_back (enumerator { std::move (name), value }); + } - container_type::size_type size () const - { return m_enumerators.size (); } + container_type::size_type size () const { return m_enumerators.size (); } const enumerator &operator[] (container_type::size_type pos) const - { return m_enumerators[pos]; } + { + return m_enumerators[pos]; + } - const_iterator_type begin () const - { return m_enumerators.begin (); } + const_iterator_type begin () const { return m_enumerators.begin (); } - const_iterator_type end () const - { return m_enumerators.end (); } + const_iterator_type end () const { return m_enumerators.end (); } - const std::string &name () const - { return m_name; } + const std::string &name () const { return m_name; } static std::string make_lookup_name (gdb::string_view name) { @@ -324,6 +331,7 @@ struct amd_dbgapi_register_type_enum : public amd_dbgapi_register_type } private: + unsigned int m_bit_size = 32; container_type m_enumerators; std::string m_name; @@ -344,7 +352,7 @@ try_strtoulst (gdb::string_view s) errno = 0; ULONGEST value = strtoulst (s.data (), nullptr, 0); if (errno != 0) - error (_("Failed to parse integer.")); + error (_ ("Failed to parse integer.")); return value; }; @@ -358,31 +366,29 @@ static const amd_dbgapi_register_type & parse_amd_dbgapi_register_type (gdb::string_view type_name, amd_dbgapi_register_type_map &type_map); - /* parse_amd_dbgapi_register_type helper for enum types. */ static void -parse_amd_dbgapi_register_type_enum_fields - (amd_dbgapi_register_type_enum &enum_type, gdb::string_view fields) +parse_amd_dbgapi_register_type_enum_fields ( + amd_dbgapi_register_type_enum &enum_type, gdb::string_view fields) { compiled_regex regex (/* name */ - "^(" IDENTIFIER ")" - WSOPT "=" WSOPT + "^(" IDENTIFIER ")" WSOPT "=" WSOPT /* value */ - "([0-9]+)" - WSOPT "(," WSOPT ")?", + "([0-9]+)" WSOPT "(," WSOPT ")?", REG_EXTENDED, - _("Error in AMDGPU enum register type regex")); + _ ("Error in AMDGPU enum register type regex")); regmatch_t matches[4]; while (!fields.empty ()) { int res = regex.exec (fields.data (), ARRAY_SIZE (matches), matches, 0); if (res == REG_NOMATCH) - error (_("Failed to parse enum fields")); + error (_ ("Failed to parse enum fields")); - auto sv_from_match = [fields] (const regmatch_t &m) - { return fields.substr (m.rm_so, m.rm_eo - m.rm_so); }; + auto sv_from_match = [fields] (const regmatch_t &m) { + return fields.substr (m.rm_so, m.rm_eo - m.rm_so); + }; gdb::string_view name = sv_from_match (matches[1]); gdb::string_view value_str = sv_from_match (matches[2]); @@ -400,34 +406,35 @@ parse_amd_dbgapi_register_type_enum_fields /* parse_amd_dbgapi_register_type helper for flags types. */ static void -parse_amd_dbgapi_register_type_flags_fields - (amd_dbgapi_register_type_flags &flags_type, - int bits, gdb::string_view name, gdb::string_view fields, - amd_dbgapi_register_type_map &type_map) +parse_amd_dbgapi_register_type_flags_fields ( + amd_dbgapi_register_type_flags &flags_type, int bits, gdb::string_view name, + gdb::string_view fields, amd_dbgapi_register_type_map &type_map) { gdb_assert (bits == 32 || bits == 64); std::string regex_str = string_printf (/* type */ - "^(bool|uint%d_t|enum" WS IDENTIFIER WSOPT "(\\{[^}]*})?)" - WS + "^(bool|uint%d_t|enum" WS IDENTIFIER WSOPT + "(\\{[^}]*})?)" WS /* name */ "(" IDENTIFIER ")" WSOPT /* bit position */ "@([0-9]+)(-[0-9]+)?" WSOPT ";" WSOPT, bits); - compiled_regex regex (regex_str.c_str (), REG_EXTENDED, - _("Error in AMDGPU register type flags fields regex")); + compiled_regex regex ( + regex_str.c_str (), REG_EXTENDED, + _ ("Error in AMDGPU register type flags fields regex")); regmatch_t matches[6]; while (!fields.empty ()) { int res = regex.exec (fields.data (), ARRAY_SIZE (matches), matches, 0); if (res == REG_NOMATCH) - error (_("Failed to parse flags type fields string")); + error (_ ("Failed to parse flags type fields string")); - auto sv_from_match = [fields] (const regmatch_t &m) - { return fields.substr (m.rm_so, m.rm_eo - m.rm_so); }; + auto sv_from_match = [fields] (const regmatch_t &m) { + return fields.substr (m.rm_so, m.rm_eo - m.rm_so); + }; gdb::string_view field_type_str = sv_from_match (matches[1]); gdb::string_view field_name = sv_from_match (matches[3]); @@ -435,19 +442,19 @@ parse_amd_dbgapi_register_type_flags_fields ULONGEST pos_begin = try_strtoulst (pos_begin_str); if (field_type_str == "bool") - flags_type.add_field (gdb::to_string (field_name), pos_begin, pos_begin, - nullptr); + flags_type.add_field (gdb::to_string (field_name), pos_begin, + pos_begin, nullptr); else { if (matches[5].rm_so == -1) - error (_("Missing end bit position")); + error (_ ("Missing end bit position")); gdb::string_view pos_end_str = sv_from_match (matches[5]); ULONGEST pos_end = try_strtoulst (pos_end_str.substr (1)); const amd_dbgapi_register_type &field_type = parse_amd_dbgapi_register_type (field_type_str, type_map); - flags_type.add_field (gdb::to_string (field_name), pos_begin, pos_end, - &field_type); + flags_type.add_field (gdb::to_string (field_name), pos_begin, + pos_end, &field_type); } fields = fields.substr (matches[0].rm_eo); @@ -469,7 +476,7 @@ parse_amd_dbgapi_register_type_scalar (gdb::string_view name, && kind != amd_dbgapi_register_type::kind::FLOAT && kind != amd_dbgapi_register_type::kind::DOUBLE && kind != amd_dbgapi_register_type::kind::CODE_PTR) - error (_("type mismatch")); + error (_ ("type mismatch")); return *it->second; } @@ -490,7 +497,7 @@ parse_amd_dbgapi_register_type_scalar (gdb::string_view name, else if (name == "void (*)()") type.reset (new amd_dbgapi_register_type_code_ptr ()); else - error (_("unknown type %s"), name_str.c_str ()); + error (_ ("unknown type %s"), name_str.c_str ()); auto insertion_pair = type_map.emplace (name, std::move (type)); return *insertion_pair.first->second; @@ -507,8 +514,9 @@ parse_amd_dbgapi_register_type (gdb::string_view type_str, amd_dbgapi_register_type_map &type_map) { size_t pos_open_bracket = type_str.find_last_of ('['); - auto sv_from_match = [type_str] (const regmatch_t &m) - { return type_str.substr (m.rm_so, m.rm_eo - m.rm_so); }; + auto sv_from_match = [type_str] (const regmatch_t &m) { + return type_str.substr (m.rm_so, m.rm_eo - m.rm_so); + }; if (pos_open_bracket != gdb::string_view::npos) { @@ -522,12 +530,13 @@ parse_amd_dbgapi_register_type (gdb::string_view type_str, gdb_assert (pos_close_bracket != gdb::string_view::npos); gdb::string_view count_str_view = type_str.substr (pos_open_bracket + 1, - pos_close_bracket - pos_open_bracket); + pos_close_bracket - pos_open_bracket); std::string count_str = gdb::to_string (count_str_view); unsigned int count = std::stoul (count_str); std::string lookup_name - = amd_dbgapi_register_type_vector::make_lookup_name (element_type, count); + = amd_dbgapi_register_type_vector::make_lookup_name (element_type, + count); auto existing_type_it = type_map.find (lookup_name); if (existing_type_it != type_map.end ()) { @@ -536,8 +545,8 @@ parse_amd_dbgapi_register_type (gdb::string_view type_str, return *existing_type_it->second; } - amd_dbgapi_register_type_up type - (new amd_dbgapi_register_type_vector (element_type, count)); + amd_dbgapi_register_type_up type ( + new amd_dbgapi_register_type_vector (element_type, count)); auto insertion_pair = type_map.emplace (type->lookup_name (), std::move (type)); return *insertion_pair.first->second; @@ -546,16 +555,16 @@ parse_amd_dbgapi_register_type (gdb::string_view type_str, if (type_str.find ("flags32_t") == 0 || type_str.find ("flags64_t") == 0) { /* Split 'type_str' into 4 tokens: "(type) (name) ({ (fields) })". */ - compiled_regex regex ("^(flags32_t|flags64_t)" - WS "(" IDENTIFIER ")" WSOPT - "(\\{" WSOPT "(.*)})?", + compiled_regex regex ("^(flags32_t|flags64_t)" WS "(" IDENTIFIER + ")" WSOPT "(\\{" WSOPT "(.*)})?", REG_EXTENDED, - _("Error in AMDGPU register type regex")); + _ ("Error in AMDGPU register type regex")); regmatch_t matches[5]; - int res = regex.exec (type_str.data (), ARRAY_SIZE (matches), matches, 0); + int res + = regex.exec (type_str.data (), ARRAY_SIZE (matches), matches, 0); if (res == REG_NOMATCH) - error (_("Failed to parse flags type string")); + error (_ ("Failed to parse flags type string")); gdb::string_view flags_keyword = sv_from_match (matches[1]); unsigned int bit_size = flags_keyword == "flags32_t" ? 32 : 64; @@ -568,12 +577,12 @@ parse_amd_dbgapi_register_type (gdb::string_view type_str, { /* No braces, lookup existing type. */ if (existing_type_it == type_map.end ()) - error (_("reference to unknown type %s."), + error (_ ("reference to unknown type %s."), gdb::to_string (name).c_str ()); if (existing_type_it->second->kind () != amd_dbgapi_register_type::kind::FLAGS) - error (_("type mismatch")); + error (_ ("type mismatch")); return *existing_type_it->second; } @@ -581,34 +590,37 @@ parse_amd_dbgapi_register_type (gdb::string_view type_str, { /* With braces, it's a definition. */ if (existing_type_it != type_map.end ()) - error (_("re-definition of type %s."), + error (_ ("re-definition of type %s."), gdb::to_string (name).c_str ()); - amd_dbgapi_register_type_flags_up flags_type - (new amd_dbgapi_register_type_flags (bit_size, name)); + amd_dbgapi_register_type_flags_up flags_type ( + new amd_dbgapi_register_type_flags (bit_size, name)); gdb::string_view fields_without_braces = sv_from_match (matches[4]); - parse_amd_dbgapi_register_type_flags_fields - (*flags_type, bit_size, name, fields_without_braces, type_map); + parse_amd_dbgapi_register_type_flags_fields (*flags_type, bit_size, + name, + fields_without_braces, + type_map); - auto insertion_pair - = type_map.emplace (flags_type->lookup_name (), - std::move (flags_type)); + auto insertion_pair = type_map.emplace (flags_type->lookup_name (), + std::move (flags_type)); return *insertion_pair.first->second; } } if (type_str.find ("enum") == 0) { - compiled_regex regex ("^enum" WS "(" IDENTIFIER ")" WSOPT "(\\{" WSOPT "([^}]*)})?", + compiled_regex regex ("^enum" WS "(" IDENTIFIER ")" WSOPT "(\\{" WSOPT + "([^}]*)})?", REG_EXTENDED, - _("Error in AMDGPU register type enum regex")); + _ ("Error in AMDGPU register type enum regex")); /* Split 'type_name' into 3 tokens: "(name) ( { (fields) } )". */ regmatch_t matches[4]; - int res = regex.exec (type_str.data (), ARRAY_SIZE (matches), matches, 0); + int res + = regex.exec (type_str.data (), ARRAY_SIZE (matches), matches, 0); if (res == REG_NOMATCH) - error (_("Failed to parse flags type string")); + error (_ ("Failed to parse flags type string")); gdb::string_view name = sv_from_match (matches[1]); @@ -620,12 +632,12 @@ parse_amd_dbgapi_register_type (gdb::string_view type_str, { /* No braces, lookup existing type. */ if (existing_type_it == type_map.end ()) - error (_("reference to unknown type %s"), + error (_ ("reference to unknown type %s"), gdb::to_string (name).c_str ()); if (existing_type_it->second->kind () != amd_dbgapi_register_type::kind::ENUM) - error (_("type mismatch")); + error (_ ("type mismatch")); return *existing_type_it->second; } @@ -633,19 +645,18 @@ parse_amd_dbgapi_register_type (gdb::string_view type_str, { /* With braces, it's a definition. */ if (existing_type_it != type_map.end ()) - error (_("re-definition of type %s"), + error (_ ("re-definition of type %s"), gdb::to_string (name).c_str ()); - amd_dbgapi_register_type_enum_up enum_type - (new amd_dbgapi_register_type_enum (name)); + amd_dbgapi_register_type_enum_up enum_type ( + new amd_dbgapi_register_type_enum (name)); gdb::string_view fields_without_braces = sv_from_match (matches[3]); - parse_amd_dbgapi_register_type_enum_fields - (*enum_type, fields_without_braces); + parse_amd_dbgapi_register_type_enum_fields (*enum_type, + fields_without_braces); - auto insertion_pair - = type_map.emplace (enum_type->lookup_name (), - std::move (enum_type)); + auto insertion_pair = type_map.emplace (enum_type->lookup_name (), + std::move (enum_type)); return *insertion_pair.first->second; } } @@ -722,12 +733,13 @@ amd_dbgapi_register_type_to_gdb_type (const amd_dbgapi_register_type &type, else { struct type *field_type - = amd_dbgapi_register_type_to_gdb_type (*field.type, gdbarch); + = amd_dbgapi_register_type_to_gdb_type (*field.type, + gdbarch); gdb_assert (field_type != nullptr); - append_flags_type_field - (gdb_type, field.bit_pos_start, - field.bit_pos_end - field.bit_pos_start + 1, - field_type, field.name.c_str ()); + append_flags_type_field (gdb_type, field.bit_pos_start, + field.bit_pos_end + - field.bit_pos_start + 1, + field_type, field.name.c_str ()); } } @@ -743,9 +755,8 @@ amd_dbgapi_register_type_to_gdb_type (const amd_dbgapi_register_type &type, enum_type.name ().c_str ()); gdb_type->set_num_fields (enum_type.size ()); - gdb_type->set_fields - ((struct field *) TYPE_ZALLOC (gdb_type, (sizeof (struct field) - * enum_type.size ()))); + gdb_type->set_fields ((struct field *) TYPE_ZALLOC ( + gdb_type, (sizeof (struct field) * enum_type.size ()))); gdb_type->set_is_unsigned (true); for (size_t i = 0; i < enum_type.size (); ++i) @@ -779,7 +790,7 @@ amdgpu_register_type (struct gdbarch *gdbarch, int regnum) AMD_DBGAPI_REGISTER_INFO_TYPE, sizeof (bytes), &bytes); if (status != AMD_DBGAPI_STATUS_SUCCESS) - error (_("Failed to get register type from amd-dbgapi")); + error (_ ("Failed to get register type from amd-dbgapi")); gdb::unique_xmalloc_ptr bytes_holder (bytes); amd_dbgapi_register_type_map type_map; @@ -824,7 +835,8 @@ static const gdb_byte * amdgpu_sw_breakpoint_from_kind (struct gdbarch *gdbarch, int kind, int *size) { *size = kind; - return get_amdgpu_gdbarch_tdep (gdbarch)->breakpoint_instruction_bytes.get (); + return get_amdgpu_gdbarch_tdep (gdbarch) + ->breakpoint_instruction_bytes.get (); } struct amdgpu_frame_cache @@ -933,8 +945,7 @@ print_insn_amdgpu (bfd_vma memaddr, struct disassemble_info *info) auto symbolizer = [] (amd_dbgapi_symbolizer_id_t symbolizer_id, amd_dbgapi_global_address_t address, - char **symbol_text) -> amd_dbgapi_status_t - { + char **symbol_text) -> amd_dbgapi_status_t { gdb_disassemble_info *disasm_info = reinterpret_cast (symbolizer_id); gdb_printing_disassembler *disasm @@ -949,21 +960,20 @@ print_insn_amdgpu (bfd_vma memaddr, struct disassemble_info *info) }; auto symbolizer_id = reinterpret_cast (di); char *instruction_text = nullptr; - status = amd_dbgapi_disassemble_instruction (architecture_id, memaddr, - &instruction_size, - buffer.data (), - &instruction_text, - symbolizer_id, - symbolizer); + status + = amd_dbgapi_disassemble_instruction (architecture_id, memaddr, + &instruction_size, buffer.data (), + &instruction_text, symbolizer_id, + symbolizer); if (status != AMD_DBGAPI_STATUS_SUCCESS) { size_t alignment; - status = amd_dbgapi_architecture_get_info - (architecture_id, - AMD_DBGAPI_ARCHITECTURE_INFO_MINIMUM_INSTRUCTION_ALIGNMENT, - sizeof (alignment), &alignment); + status = amd_dbgapi_architecture_get_info ( + architecture_id, + AMD_DBGAPI_ARCHITECTURE_INFO_MINIMUM_INSTRUCTION_ALIGNMENT, + sizeof (alignment), &alignment); if (status != AMD_DBGAPI_STATUS_SUCCESS) - error (_("amd_dbgapi_architecture_get_info failed")); + error (_ ("amd_dbgapi_architecture_get_info failed")); info->fprintf_func (di, ""); @@ -996,8 +1006,7 @@ amdgpu_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR start_pc) /* Clang always emits a line note before the prologue and another one after. We trust clang to emit usable line notes. */ - if (post_prologue_pc != 0 - && cust != nullptr + if (post_prologue_pc != 0 && cust != nullptr && cust->producer () != nullptr && producer_is_llvm (cust->producer ())) return std::max (start_pc, post_prologue_pc); @@ -1026,8 +1035,8 @@ amdgpu_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) return arches->gdbarch; /* Allocate space for the new architecture. */ - gdbarch_up gdbarch_u - (gdbarch_alloc (&info, gdbarch_tdep_up (new amdgpu_gdbarch_tdep))); + gdbarch_up gdbarch_u ( + gdbarch_alloc (&info, gdbarch_tdep_up (new amdgpu_gdbarch_tdep))); gdbarch *gdbarch = gdbarch_u.get (); amdgpu_gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); @@ -1061,11 +1070,10 @@ amdgpu_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) &architecture_id); if (status != AMD_DBGAPI_STATUS_SUCCESS) { - warning (_("Failed to get architecture from amd-dbgapi")); + warning (_ ("Failed to get architecture from amd-dbgapi")); return nullptr; } - /* Add register groups. */ size_t register_class_count; amd_dbgapi_register_class_id_t *register_class_ids; @@ -1074,7 +1082,7 @@ amdgpu_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) ®ister_class_ids); if (status != AMD_DBGAPI_STATUS_SUCCESS) { - warning (_("Failed to get register class list from amd-dbgapi")); + warning (_ ("Failed to get register class list from amd-dbgapi")); return nullptr; } @@ -1084,12 +1092,12 @@ amdgpu_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) for (size_t i = 0; i < register_class_count; ++i) { char *bytes; - status = amd_dbgapi_architecture_register_class_get_info - (register_class_ids[i], AMD_DBGAPI_REGISTER_CLASS_INFO_NAME, - sizeof (bytes), &bytes); + status = amd_dbgapi_architecture_register_class_get_info ( + register_class_ids[i], AMD_DBGAPI_REGISTER_CLASS_INFO_NAME, + sizeof (bytes), &bytes); if (status != AMD_DBGAPI_STATUS_SUCCESS) { - warning (_("Failed to get register class name from amd-dbgapi")); + warning (_ ("Failed to get register class name from amd-dbgapi")); return nullptr; } @@ -1105,24 +1113,24 @@ amdgpu_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) continue; /* Allocate the reggroup in the gdbarch. */ - reggroup_add - (gdbarch, reggroup_gdbarch_new (gdbarch, name.get (), USER_REGGROUP)); + reggroup_add (gdbarch, reggroup_gdbarch_new (gdbarch, name.get (), + USER_REGGROUP)); } /* Add registers. */ size_t register_count; amd_dbgapi_register_id_t *register_ids; - status = amd_dbgapi_architecture_register_list (architecture_id, - ®ister_count, - ®ister_ids); + status + = amd_dbgapi_architecture_register_list (architecture_id, ®ister_count, + ®ister_ids); if (status != AMD_DBGAPI_STATUS_SUCCESS) { - warning (_("Failed to get register list from amd-dbgapi")); + warning (_ ("Failed to get register list from amd-dbgapi")); return nullptr; } - gdb::unique_xmalloc_ptr register_ids_holder - (register_ids); + gdb::unique_xmalloc_ptr register_ids_holder ( + register_ids); tdep->register_ids.insert (tdep->register_ids.end (), ®ister_ids[0], ®ister_ids[register_count]); @@ -1138,7 +1146,7 @@ amdgpu_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) ®ister_properties) != AMD_DBGAPI_STATUS_SUCCESS) { - warning (_("Failed to get register properties from amd-dbgapi")); + warning (_ ("Failed to get register properties from amd-dbgapi")); return nullptr; } } @@ -1179,12 +1187,12 @@ amdgpu_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) } amd_dbgapi_register_id_t pc_register_id; - status = amd_dbgapi_architecture_get_info - (architecture_id, AMD_DBGAPI_ARCHITECTURE_INFO_PC_REGISTER, - sizeof (pc_register_id), &pc_register_id); + status = amd_dbgapi_architecture_get_info ( + architecture_id, AMD_DBGAPI_ARCHITECTURE_INFO_PC_REGISTER, + sizeof (pc_register_id), &pc_register_id); if (status != AMD_DBGAPI_STATUS_SUCCESS) { - warning (_("Failed to get PC register from amd-dbgapi")); + warning (_ ("Failed to get PC register from amd-dbgapi")); return nullptr; } @@ -1203,29 +1211,29 @@ amdgpu_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Disassembly. */ set_gdbarch_print_insn (gdbarch, print_insn_amdgpu); - /* Instructions. */ + /* Instructions. */ amd_dbgapi_size_t max_insn_length = 0; - status = amd_dbgapi_architecture_get_info - (architecture_id, AMD_DBGAPI_ARCHITECTURE_INFO_LARGEST_INSTRUCTION_SIZE, - sizeof (max_insn_length), &max_insn_length); + status = amd_dbgapi_architecture_get_info ( + architecture_id, AMD_DBGAPI_ARCHITECTURE_INFO_LARGEST_INSTRUCTION_SIZE, + sizeof (max_insn_length), &max_insn_length); if (status != AMD_DBGAPI_STATUS_SUCCESS) - error (_("amd_dbgapi_architecture_get_info failed")); + error (_ ("amd_dbgapi_architecture_get_info failed")); set_gdbarch_max_insn_length (gdbarch, max_insn_length); - status = amd_dbgapi_architecture_get_info - (architecture_id, AMD_DBGAPI_ARCHITECTURE_INFO_BREAKPOINT_INSTRUCTION_SIZE, - sizeof (tdep->breakpoint_instruction_size), - &tdep->breakpoint_instruction_size); + status = amd_dbgapi_architecture_get_info ( + architecture_id, AMD_DBGAPI_ARCHITECTURE_INFO_BREAKPOINT_INSTRUCTION_SIZE, + sizeof (tdep->breakpoint_instruction_size), + &tdep->breakpoint_instruction_size); if (status != AMD_DBGAPI_STATUS_SUCCESS) - error (_("amd_dbgapi_architecture_get_info failed")); + error (_ ("amd_dbgapi_architecture_get_info failed")); gdb_byte *breakpoint_instruction_bytes; - status = amd_dbgapi_architecture_get_info - (architecture_id, AMD_DBGAPI_ARCHITECTURE_INFO_BREAKPOINT_INSTRUCTION, - sizeof (breakpoint_instruction_bytes), &breakpoint_instruction_bytes); + status = amd_dbgapi_architecture_get_info ( + architecture_id, AMD_DBGAPI_ARCHITECTURE_INFO_BREAKPOINT_INSTRUCTION, + sizeof (breakpoint_instruction_bytes), &breakpoint_instruction_bytes); if (status != AMD_DBGAPI_STATUS_SUCCESS) - error (_("amd_dbgapi_architecture_get_info failed")); + error (_ ("amd_dbgapi_architecture_get_info failed")); tdep->breakpoint_instruction_bytes.reset (breakpoint_instruction_bytes); @@ -1235,12 +1243,12 @@ amdgpu_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) amdgpu_sw_breakpoint_from_kind); amd_dbgapi_size_t pc_adjust; - status = amd_dbgapi_architecture_get_info - (architecture_id, - AMD_DBGAPI_ARCHITECTURE_INFO_BREAKPOINT_INSTRUCTION_PC_ADJUST, - sizeof (pc_adjust), &pc_adjust); + status = amd_dbgapi_architecture_get_info ( + architecture_id, + AMD_DBGAPI_ARCHITECTURE_INFO_BREAKPOINT_INSTRUCTION_PC_ADJUST, + sizeof (pc_adjust), &pc_adjust); if (status != AMD_DBGAPI_STATUS_SUCCESS) - error (_("amd_dbgapi_architecture_get_info failed")); + error (_ ("amd_dbgapi_architecture_get_info failed")); set_gdbarch_decr_pc_after_break (gdbarch, pc_adjust); @@ -1255,8 +1263,7 @@ amdgpu_register_type_parse_test () { /* A type that exercises flags and enums, in particular looking up an existing enum type by name. */ - const char *flags_type_str = - "flags32_t mode { \ + const char *flags_type_str = "flags32_t mode { \ enum fp_round { \ NEAREST_EVEN = 0, \ PLUS_INF = 1, \ @@ -1302,27 +1309,27 @@ amdgpu_register_type_parse_test () /* Check the two "FP_ROUND" fields. */ auto check_fp_round_field - = [] (const char *name, const amd_dbgapi_register_type_flags::field &field) - { - gdb_assert (field.name == name); - gdb_assert (field.type->kind () - == amd_dbgapi_register_type::kind::ENUM); - - const auto &e - = static_cast (*field.type); - gdb_assert (e.size () == 4); - gdb_assert (e[0].name == "NEAREST_EVEN"); - gdb_assert (e[0].value == 0); - gdb_assert (e[3].name == "ZERO"); - gdb_assert (e[3].value == 3); - }; + = [] (const char *name, + const amd_dbgapi_register_type_flags::field &field) { + gdb_assert (field.name == name); + gdb_assert (field.type->kind () == amd_dbgapi_register_type::kind::ENUM); + + const auto &e + = static_cast (*field.type); + gdb_assert (e.size () == 4); + gdb_assert (e[0].name == "NEAREST_EVEN"); + gdb_assert (e[0].value == 0); + gdb_assert (e[3].name == "ZERO"); + gdb_assert (e[3].value == 3); + }; check_fp_round_field ("FP_ROUND.32", f[0]); check_fp_round_field ("FP_ROUND.64_16", f[1]); /* Check the "CSP" field. */ gdb_assert (f[22].name == "CSP"); - gdb_assert (f[22].type->kind () == amd_dbgapi_register_type::kind::INTEGER); + gdb_assert (f[22].type->kind () + == amd_dbgapi_register_type::kind::INTEGER); const auto &i = static_cast (*f[22].type); @@ -1339,7 +1346,8 @@ amdgpu_register_type_parse_test () gdb_assert (type.kind () == amd_dbgapi_register_type::kind::VECTOR); - const auto &v = static_cast (type); + const auto &v + = static_cast (type); gdb_assert (v.count () == 64); const auto &et = v.element_type (); diff --git a/gdb/amdgpu-tdep.h b/gdb/amdgpu-tdep.h index 24081eb..703ee8e 100644 --- a/gdb/amdgpu-tdep.h +++ b/gdb/amdgpu-tdep.h @@ -28,8 +28,7 @@ /* Provide std::unordered_map::Hash for amd_dbgapi_register_id_t. */ struct register_id_hash { - size_t - operator() (const amd_dbgapi_register_id_t ®ister_id) const + size_t operator() (const amd_dbgapi_register_id_t ®ister_id) const { return std::hash () (register_id.handle); } @@ -38,9 +37,8 @@ struct register_id_hash /* Provide std::unordered_map::Equal for amd_dbgapi_register_id_t. */ struct register_id_equal_to { - bool - operator() (const amd_dbgapi_register_id_t &lhs, - const amd_dbgapi_register_id_t &rhs) const + bool operator() (const amd_dbgapi_register_id_t &lhs, + const amd_dbgapi_register_id_t &rhs) const { return std::equal_to () (lhs.handle, rhs.handle); } diff --git a/gdb/annotate.c b/gdb/annotate.c index 60fe6cc..64a5ef0 100644 --- a/gdb/annotate.c +++ b/gdb/annotate.c @@ -29,7 +29,6 @@ #include "source.h" #include "objfiles.h" #include "source-cache.h" - /* Prototypes for local functions. */ @@ -37,7 +36,6 @@ static void print_value_flags (struct type *); static void breakpoint_changed (struct breakpoint *b); - void (*deprecated_annotate_signalled_hook) (void); void (*deprecated_annotate_signal_hook) (void); @@ -161,7 +159,7 @@ annotate_signal (void) if (annotation_level > 1) printf_unfiltered (("\n\032\032signal\n")); } - + void annotate_breakpoints_headers (void) { @@ -274,7 +272,7 @@ annotate_field_end (void) if (annotation_level == 2) printf_unfiltered (("\n\032\032field-end\n")); } - + void annotate_quit (void) { @@ -448,8 +446,7 @@ annotate_source_line (struct symtab *s, int line, int mid_statement, return false; annotate_source (s->fullname, line, (int) (*offsets)[line - 1], - mid_statement, s->compunit ()->objfile ()->arch (), - pc); + mid_statement, s->compunit ()->objfile ()->arch (), pc); /* Update the current symtab and line. */ symtab_and_line sal; @@ -464,13 +461,12 @@ annotate_source_line (struct symtab *s, int line, int mid_statement, return false; } - void annotate_frame_begin (int level, struct gdbarch *gdbarch, CORE_ADDR pc) { if (annotation_level > 1) - printf_unfiltered (("\n\032\032frame-begin %d %s\n"), - level, paddress (gdbarch, pc)); + printf_unfiltered (("\n\032\032frame-begin %d %s\n"), level, + paddress (gdbarch, pc)); } void @@ -563,7 +559,7 @@ annotate_frame_end (void) if (annotation_level == 2) printf_unfiltered (("\n\032\032frame-end\n")); } - + void annotate_array_section_begin (int idx, struct type *elttype) { @@ -624,6 +620,7 @@ breakpoint_changed (struct breakpoint *b) } void _initialize_annotate (); + void _initialize_annotate () { diff --git a/gdb/annotate.h b/gdb/annotate.h index 48fdb7a..94092ce 100644 --- a/gdb/annotate.h +++ b/gdb/annotate.h @@ -82,6 +82,7 @@ extern void annotate_arg_end (void); struct annotate_arg_emitter { annotate_arg_emitter () { annotate_arg_begin (); } + ~annotate_arg_emitter () { annotate_arg_end (); } DISABLE_COPY_AND_ASSIGN (annotate_arg_emitter); diff --git a/gdb/arc-linux-nat.c b/gdb/arc-linux-nat.c index d0333b5..cd2b0f1 100644 --- a/gdb/arc-linux-nat.c +++ b/gdb/arc-linux-nat.c @@ -54,13 +54,14 @@ /* Linux starting with 4.12 supports NT_ARC_V2 note type, which adds R30, R58 and R59 registers, which are specific to ARC HS and aren't available in ARC 700. */ -#if defined (NT_ARC_V2) && defined (__ARCHS__) +#if defined(NT_ARC_V2) && defined(__ARCHS__) #define ARC_HAS_V2_REGSET #endif class arc_linux_nat_target final : public linux_nat_target { public: + /* Add ARC register access methods. */ void fetch_registers (struct regcache *, int) override; void store_registers (struct regcache *, int) override; @@ -87,7 +88,7 @@ fetch_gregs (struct regcache *regcache, int regnum) iov.iov_len = sizeof (gdb_gregset_t); if (ptrace (PTRACE_GETREGSET, tid, NT_PRSTATUS, (void *) &iov) < 0) - perror_with_name (_("Couldn't get general registers")); + perror_with_name (_ ("Couldn't get general registers")); else arc_linux_supply_gregset (NULL, regcache, regnum, ®s, 0); } @@ -107,7 +108,7 @@ fetch_v2_regs (struct regcache *regcache, int regnum) iov.iov_len = ARC_LINUX_SIZEOF_V2_REGSET; if (ptrace (PTRACE_GETREGSET, tid, NT_ARC_V2, (void *) &iov) < 0) - perror_with_name (_("Couldn't get ARC HS registers")); + perror_with_name (_ ("Couldn't get ARC HS registers")); else arc_linux_supply_v2_regset (NULL, regcache, regnum, v2_buffer, 0); } @@ -126,13 +127,13 @@ store_gregs (const struct regcache *regcache, int regnum) iov.iov_len = sizeof (gdb_gregset_t); if (ptrace (PTRACE_GETREGSET, tid, NT_PRSTATUS, (void *) &iov) < 0) - perror_with_name (_("Couldn't get general registers")); + perror_with_name (_ ("Couldn't get general registers")); else { arc_linux_collect_gregset (NULL, regcache, regnum, regs, 0); if (ptrace (PTRACE_SETREGSET, tid, NT_PRSTATUS, (void *) &iov) < 0) - perror_with_name (_("Couldn't write general registers")); + perror_with_name (_ ("Couldn't write general registers")); } } @@ -150,13 +151,13 @@ store_v2_regs (const struct regcache *regcache, int regnum) iov.iov_len = ARC_LINUX_SIZEOF_V2_REGSET; if (ptrace (PTRACE_GETREGSET, tid, NT_ARC_V2, (void *) &iov) < 0) - perror_with_name (_("Couldn't get ARC HS registers")); + perror_with_name (_ ("Couldn't get ARC HS registers")); else { arc_linux_collect_v2_regset (NULL, regcache, regnum, v2_buffer, 0); if (ptrace (PTRACE_SETREGSET, tid, NT_ARC_V2, (void *) &iov) < 0) - perror_with_name (_("Couldn't write ARC HS registers")); + perror_with_name (_ ("Couldn't write ARC HS registers")); } } #endif @@ -167,16 +168,13 @@ store_v2_regs (const struct regcache *regcache, int regnum) void arc_linux_nat_target::fetch_registers (struct regcache *regcache, int regnum) { - if (regnum == -1 || regnum <= ARC_LAST_REGNUM) fetch_gregs (regcache, regnum); #ifdef ARC_HAS_V2_REGSET - if (regnum == -1 - || regnum == ARC_R30_REGNUM - || regnum == ARC_R58_REGNUM + if (regnum == -1 || regnum == ARC_R30_REGNUM || regnum == ARC_R58_REGNUM || regnum == ARC_R59_REGNUM) - fetch_v2_regs (regcache, regnum); + fetch_v2_regs (regcache, regnum); #endif } @@ -190,9 +188,7 @@ arc_linux_nat_target::store_registers (struct regcache *regcache, int regnum) store_gregs (regcache, regnum); #ifdef ARC_HAS_V2_REGSET - if (regnum == -1 - || regnum == ARC_R30_REGNUM - || regnum == ARC_R58_REGNUM + if (regnum == -1 || regnum == ARC_R30_REGNUM || regnum == ARC_R58_REGNUM || regnum == ARC_R59_REGNUM) store_v2_regs (regcache, regnum); #endif @@ -202,8 +198,8 @@ arc_linux_nat_target::store_registers (struct regcache *regcache, int regnum) This function is exported to proc-service.c */ void -fill_gregset (const struct regcache *regcache, - gdb_gregset_t *gregs, int regnum) +fill_gregset (const struct regcache *regcache, gdb_gregset_t *gregs, + int regnum) { arc_linux_collect_gregset (NULL, regcache, regnum, gregs, 0); } @@ -221,8 +217,8 @@ supply_gregset (struct regcache *regcache, const gdb_gregset_t *gregs) to proc-service.c. */ void -fill_fpregset (const struct regcache *regcache, - gdb_fpregset_t *fpregsetp, int regnum) +fill_fpregset (const struct regcache *regcache, gdb_fpregset_t *fpregsetp, + int regnum) { arc_linux_nat_debug_printf ("called"); } @@ -311,6 +307,7 @@ ps_get_thread_area (struct ps_prochandle *ph, lwpid_t lwpid, int idx, /* Suppress warning from -Wmissing-prototypes. */ void _initialize_arc_linux_nat (); + void _initialize_arc_linux_nat () { diff --git a/gdb/arc-linux-tdep.c b/gdb/arc-linux-tdep.c index 947c2a3..41ef92d 100644 --- a/gdb/arc-linux-tdep.c +++ b/gdb/arc-linux-tdep.c @@ -50,9 +50,8 @@ here as well. */ static const int arc_linux_sc_reg_offsets[] = { /* R0 - R12. */ - REGOFF (22), REGOFF (21), REGOFF (20), REGOFF (19), - REGOFF (18), REGOFF (17), REGOFF (16), REGOFF (15), - REGOFF (14), REGOFF (13), REGOFF (12), REGOFF (11), + REGOFF (22), REGOFF (21), REGOFF (20), REGOFF (19), REGOFF (18), REGOFF (17), + REGOFF (16), REGOFF (15), REGOFF (14), REGOFF (13), REGOFF (12), REGOFF (11), REGOFF (10), /* R13 - R25. */ @@ -62,12 +61,12 @@ static const int arc_linux_sc_reg_offsets[] = { ARC_OFFSET_NO_REGISTER, ARC_OFFSET_NO_REGISTER, ARC_OFFSET_NO_REGISTER, ARC_OFFSET_NO_REGISTER, - REGOFF (9), /* R26 (GP) */ - REGOFF (8), /* FP */ - REGOFF (23), /* SP */ - ARC_OFFSET_NO_REGISTER, /* ILINK */ - ARC_OFFSET_NO_REGISTER, /* R30 */ - REGOFF (7), /* BLINK */ + REGOFF (9), /* R26 (GP) */ + REGOFF (8), /* FP */ + REGOFF (23), /* SP */ + ARC_OFFSET_NO_REGISTER, /* ILINK */ + ARC_OFFSET_NO_REGISTER, /* R30 */ + REGOFF (7), /* BLINK */ /* R32 - R59. */ ARC_OFFSET_NO_REGISTER, ARC_OFFSET_NO_REGISTER, ARC_OFFSET_NO_REGISTER, @@ -81,16 +80,16 @@ static const int arc_linux_sc_reg_offsets[] = { ARC_OFFSET_NO_REGISTER, ARC_OFFSET_NO_REGISTER, ARC_OFFSET_NO_REGISTER, ARC_OFFSET_NO_REGISTER, - REGOFF (4), /* LP_COUNT */ - ARC_OFFSET_NO_REGISTER, /* RESERVED */ - ARC_OFFSET_NO_REGISTER, /* LIMM */ - ARC_OFFSET_NO_REGISTER, /* PCL */ + REGOFF (4), /* LP_COUNT */ + ARC_OFFSET_NO_REGISTER, /* RESERVED */ + ARC_OFFSET_NO_REGISTER, /* LIMM */ + ARC_OFFSET_NO_REGISTER, /* PCL */ - REGOFF (6), /* PC */ - REGOFF (5), /* STATUS32 */ - REGOFF (2), /* LP_START */ - REGOFF (3), /* LP_END */ - REGOFF (1), /* BTA */ + REGOFF (6), /* PC */ + REGOFF (5), /* STATUS32 */ + REGOFF (2), /* LP_START */ + REGOFF (3), /* LP_END */ + REGOFF (1), /* BTA */ }; /* arc_linux_core_reg_offsets[i] is the offset in the .reg section of GDB @@ -104,23 +103,21 @@ static const int arc_linux_sc_reg_offsets[] = { here as well. */ static const int arc_linux_core_reg_offsets[] = { /* R0 - R12. */ - REGOFF (22), REGOFF (21), REGOFF (20), REGOFF (19), - REGOFF (18), REGOFF (17), REGOFF (16), REGOFF (15), - REGOFF (14), REGOFF (13), REGOFF (12), REGOFF (11), + REGOFF (22), REGOFF (21), REGOFF (20), REGOFF (19), REGOFF (18), REGOFF (17), + REGOFF (16), REGOFF (15), REGOFF (14), REGOFF (13), REGOFF (12), REGOFF (11), REGOFF (10), /* R13 - R25. */ - REGOFF (37), REGOFF (36), REGOFF (35), REGOFF (34), - REGOFF (33), REGOFF (32), REGOFF (31), REGOFF (30), - REGOFF (29), REGOFF (28), REGOFF (27), REGOFF (26), + REGOFF (37), REGOFF (36), REGOFF (35), REGOFF (34), REGOFF (33), REGOFF (32), + REGOFF (31), REGOFF (30), REGOFF (29), REGOFF (28), REGOFF (27), REGOFF (26), REGOFF (25), - REGOFF (9), /* R26 (GP) */ - REGOFF (8), /* FP */ - REGOFF (23), /* SP */ - ARC_OFFSET_NO_REGISTER, /* ILINK */ - ARC_OFFSET_NO_REGISTER, /* R30 */ - REGOFF (7), /* BLINK */ + REGOFF (9), /* R26 (GP) */ + REGOFF (8), /* FP */ + REGOFF (23), /* SP */ + ARC_OFFSET_NO_REGISTER, /* ILINK */ + ARC_OFFSET_NO_REGISTER, /* R30 */ + REGOFF (7), /* BLINK */ /* R32 - R59. */ ARC_OFFSET_NO_REGISTER, ARC_OFFSET_NO_REGISTER, ARC_OFFSET_NO_REGISTER, @@ -134,17 +131,17 @@ static const int arc_linux_core_reg_offsets[] = { ARC_OFFSET_NO_REGISTER, ARC_OFFSET_NO_REGISTER, ARC_OFFSET_NO_REGISTER, ARC_OFFSET_NO_REGISTER, - REGOFF (4), /* LP_COUNT */ - ARC_OFFSET_NO_REGISTER, /* RESERVED */ - ARC_OFFSET_NO_REGISTER, /* LIMM */ - ARC_OFFSET_NO_REGISTER, /* PCL */ - - REGOFF (39), /* PC */ - REGOFF (5), /* STATUS32 */ - REGOFF (2), /* LP_START */ - REGOFF (3), /* LP_END */ - REGOFF (1), /* BTA */ - REGOFF (6) /* ERET */ + REGOFF (4), /* LP_COUNT */ + ARC_OFFSET_NO_REGISTER, /* RESERVED */ + ARC_OFFSET_NO_REGISTER, /* LIMM */ + ARC_OFFSET_NO_REGISTER, /* PCL */ + + REGOFF (39), /* PC */ + REGOFF (5), /* STATUS32 */ + REGOFF (2), /* LP_START */ + REGOFF (3), /* LP_END */ + REGOFF (1), /* BTA */ + REGOFF (6) /* ERET */ }; /* Is THIS_FRAME a sigtramp function - the function that returns from @@ -164,15 +161,15 @@ arc_linux_is_sigtramp (frame_info_ptr this_frame) struct gdbarch *gdbarch = get_frame_arch (this_frame); CORE_ADDR pc = get_frame_pc (this_frame); - arc_linux_debug_printf ("pc=%s", paddress(gdbarch, pc)); + arc_linux_debug_printf ("pc=%s", paddress (gdbarch, pc)); static const gdb_byte insns_be_hs[] = { - 0x20, 0x8a, 0x12, 0xc2, /* mov r8,nr_rt_sigreturn */ - 0x78, 0x1e /* trap_s 0 */ + 0x20, 0x8a, 0x12, 0xc2, /* mov r8,nr_rt_sigreturn */ + 0x78, 0x1e /* trap_s 0 */ }; static const gdb_byte insns_be_700[] = { - 0x20, 0x8a, 0x12, 0xc2, /* mov r8,nr_rt_sigreturn */ - 0x22, 0x6f, 0x00, 0x3f /* swi */ + 0x20, 0x8a, 0x12, 0xc2, /* mov r8,nr_rt_sigreturn */ + 0x22, 0x6f, 0x00, 0x3f /* swi */ }; gdb_byte arc_sigtramp_insns[sizeof (insns_be_700)]; @@ -198,14 +195,14 @@ arc_linux_is_sigtramp (frame_info_ptr this_frame) 4-byte instruction or 2-byte. */ gdb_assert ((insns_sz % 2) == 0); for (int i = 0; i < insns_sz; i += 2) - std::swap (arc_sigtramp_insns[i], arc_sigtramp_insns[i+1]); + std::swap (arc_sigtramp_insns[i], arc_sigtramp_insns[i + 1]); } gdb_byte buf[insns_sz]; /* Read the memory at the PC. Since we are stopped, any breakpoint must have been removed. */ - if (!safe_frame_unwind_memory (this_frame, pc, {buf, insns_sz})) + if (!safe_frame_unwind_memory (this_frame, pc, { buf, insns_sz })) { /* Failed to unwind frame. */ return FALSE; @@ -216,7 +213,7 @@ arc_linux_is_sigtramp (frame_info_ptr this_frame) return TRUE; /* No - look one instruction earlier in the code... */ - if (!safe_frame_unwind_memory (this_frame, pc - 4, {buf, insns_sz})) + if (!safe_frame_unwind_memory (this_frame, pc - 4, { buf, insns_sz })) { /* Failed to unwind frame. */ return FALSE; @@ -310,7 +307,7 @@ arc_linux_cannot_store_register (struct gdbarch *gdbarch, int regnum) static const gdb_byte arc_linux_trap_s_be[] = { 0x78, 0x3e }; static const gdb_byte arc_linux_trap_s_le[] = { 0x3e, 0x78 }; -static const int trap_size = 2; /* Number of bytes to insert "trap". */ +static const int trap_size = 2; /* Number of bytes to insert "trap". */ /* Implement the "breakpoint_kind_from_pc" gdbarch method. */ @@ -323,14 +320,14 @@ arc_linux_breakpoint_kind_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr) /* Implement the "sw_breakpoint_from_kind" gdbarch method. */ static const gdb_byte * -arc_linux_sw_breakpoint_from_kind (struct gdbarch *gdbarch, - int kind, int *size) +arc_linux_sw_breakpoint_from_kind (struct gdbarch *gdbarch, int kind, + int *size) { gdb_assert (kind == trap_size); *size = kind; return ((gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG) - ? arc_linux_trap_s_be - : arc_linux_trap_s_le); + ? arc_linux_trap_s_be + : arc_linux_trap_s_le); } /* Check for an atomic sequence of instructions beginning with an @@ -358,7 +355,7 @@ arc_linux_sw_breakpoint_from_kind (struct gdbarch *gdbarch, static std::vector handle_atomic_sequence (arc_instruction insn, disassemble_info *di) { - const int atomic_seq_len = 24; /* Instruction sequence length. */ + const int atomic_seq_len = 24; /* Instruction sequence length. */ std::vector next_pcs; /* Sanity check. */ @@ -373,27 +370,27 @@ handle_atomic_sequence (arc_instruction insn, disassemble_info *di) for (int insn_count = 0; insn_count < atomic_seq_len; ++insn_count) { - arc_insn_decode (arc_insn_get_linear_next_pc (insn), - di, arc_delayed_print_insn, &insn); + arc_insn_decode (arc_insn_get_linear_next_pc (insn), di, + arc_delayed_print_insn, &insn); if (insn.insn_class == BRCC) - { - /* If more than one conditional branch is found, this is not + { + /* If more than one conditional branch is found, this is not the pattern we are interested in. */ - if (found_bc) + if (found_bc) break; found_bc = true; continue; - } + } /* This is almost a happy ending. */ if (insn.insn_class == SCOND) - { + { /* SCOND should match the LLOCK's data size. */ if (insn.data_size_mode == llock_data_size_mode) is_pattern_valid = true; break; - } + } } if (is_pattern_valid) @@ -546,8 +543,8 @@ supply_register (struct regcache *regcache, int regnum, const gdb_byte *buf) void arc_linux_supply_gregset (const struct regset *regset, - struct regcache *regcache, - int regnum, const void *gregs, size_t size) + struct regcache *regcache, int regnum, + const void *gregs, size_t size) { gdb_static_assert (ARC_LAST_REGNUM < ARRAY_SIZE (arc_linux_core_reg_offsets)); @@ -609,8 +606,8 @@ collect_register (const struct regcache *regcache, struct gdbarch *gdbarch, void arc_linux_collect_gregset (const struct regset *regset, - const struct regcache *regcache, - int regnum, void *gregs, size_t size) + const struct regcache *regcache, int regnum, + void *gregs, size_t size) { gdb_static_assert (ARC_LAST_REGNUM < ARRAY_SIZE (arc_linux_core_reg_offsets)); @@ -680,12 +677,10 @@ arc_linux_iterate_over_regset_sections (struct gdbarch *gdbarch, static const struct target_desc * arc_linux_core_read_description (struct gdbarch *gdbarch, - struct target_ops *target, - bfd *abfd) + struct target_ops *target, bfd *abfd) { arc_arch_features features - = arc_arch_features_create (abfd, - gdbarch_bfd_arch_info (gdbarch)->mach); + = arc_arch_features_create (abfd, gdbarch_bfd_arch_info (gdbarch)->mach); return arc_lookup_target_description (features); } @@ -727,8 +722,8 @@ arc_linux_init_osabi (struct gdbarch_info info, struct gdbarch *gdbarch) set_gdbarch_software_single_step (gdbarch, arc_linux_software_single_step); set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target); set_gdbarch_skip_solib_resolver (gdbarch, arc_linux_skip_solib_resolver); - set_gdbarch_iterate_over_regset_sections - (gdbarch, arc_linux_iterate_over_regset_sections); + set_gdbarch_iterate_over_regset_sections ( + gdbarch, arc_linux_iterate_over_regset_sections); set_gdbarch_core_read_description (gdbarch, arc_linux_core_read_description); /* GNU/Linux uses SVR4-style shared libraries, with 32-bit ints, longs diff --git a/gdb/arc-linux-tdep.h b/gdb/arc-linux-tdep.h index a7f510a..99ab1ee 100644 --- a/gdb/arc-linux-tdep.h +++ b/gdb/arc-linux-tdep.h @@ -40,13 +40,13 @@ void arc_linux_supply_v2_regset (const struct regset *regset, /* Writes registers from the regcache into the NT_PRSTATUS data array. */ void arc_linux_collect_gregset (const struct regset *regset, - const struct regcache *regcache, - int regnum, void *gregs, size_t size); + const struct regcache *regcache, int regnum, + void *gregs, size_t size); /* Writes registers from the regcache into the NT_ARC_V2 data array. */ void arc_linux_collect_v2_regset (const struct regset *regset, - const struct regcache *regcache, - int regnum, void *v2_regs, size_t size); + const struct regcache *regcache, int regnum, + void *v2_regs, size_t size); #endif /* ARC_LINUX_TDEP_H */ diff --git a/gdb/arc-newlib-tdep.c b/gdb/arc-newlib-tdep.c index ee203a0..0488341 100644 --- a/gdb/arc-newlib-tdep.c +++ b/gdb/arc-newlib-tdep.c @@ -60,6 +60,7 @@ arc_newlib_osabi_sniffer (bfd *abfd) } void _initialize_arc_newlib_tdep (); + void _initialize_arc_newlib_tdep () { diff --git a/gdb/arc-tdep.c b/gdb/arc-tdep.c index c232eb9..c8e69c0 100644 --- a/gdb/arc-tdep.c +++ b/gdb/arc-tdep.c @@ -138,165 +138,153 @@ static const char *ARC_AUX_FEATURE_NAME = "org.gnu.gdb.arc.aux"; /* ARCv1 (ARC600, ARC601, ARC700) general core registers feature set. See also arc_update_acc_reg_names() for "accl/acch" names. */ -static struct arc_register_feature arc_v1_core_reg_feature = -{ - ARC_CORE_FEATURE_NAME, - { - { ARC_R0_REGNUM + 0, { "r0" }, true }, - { ARC_R0_REGNUM + 1, { "r1" }, true }, - { ARC_R0_REGNUM + 2, { "r2" }, true }, - { ARC_R0_REGNUM + 3, { "r3" }, true }, - { ARC_R0_REGNUM + 4, { "r4" }, false }, - { ARC_R0_REGNUM + 5, { "r5" }, false }, - { ARC_R0_REGNUM + 6, { "r6" }, false }, - { ARC_R0_REGNUM + 7, { "r7" }, false }, - { ARC_R0_REGNUM + 8, { "r8" }, false }, - { ARC_R0_REGNUM + 9, { "r9" }, false }, - { ARC_R0_REGNUM + 10, { "r10" }, true }, - { ARC_R0_REGNUM + 11, { "r11" }, true }, - { ARC_R0_REGNUM + 12, { "r12" }, true }, - { ARC_R0_REGNUM + 13, { "r13" }, true }, - { ARC_R0_REGNUM + 14, { "r14" }, true }, - { ARC_R0_REGNUM + 15, { "r15" }, true }, - { ARC_R0_REGNUM + 16, { "r16" }, false }, - { ARC_R0_REGNUM + 17, { "r17" }, false }, - { ARC_R0_REGNUM + 18, { "r18" }, false }, - { ARC_R0_REGNUM + 19, { "r19" }, false }, - { ARC_R0_REGNUM + 20, { "r20" }, false }, - { ARC_R0_REGNUM + 21, { "r21" }, false }, - { ARC_R0_REGNUM + 22, { "r22" }, false }, - { ARC_R0_REGNUM + 23, { "r23" }, false }, - { ARC_R0_REGNUM + 24, { "r24" }, false }, - { ARC_R0_REGNUM + 25, { "r25" }, false }, - { ARC_R0_REGNUM + 26, { "gp" }, true }, - { ARC_R0_REGNUM + 27, { "fp" }, true }, - { ARC_R0_REGNUM + 28, { "sp" }, true }, - { ARC_R0_REGNUM + 29, { "ilink1" }, false }, - { ARC_R0_REGNUM + 30, { "ilink2" }, false }, - { ARC_R0_REGNUM + 31, { "blink" }, true }, - { ARC_R0_REGNUM + 32, { "r32" }, false }, - { ARC_R0_REGNUM + 33, { "r33" }, false }, - { ARC_R0_REGNUM + 34, { "r34" }, false }, - { ARC_R0_REGNUM + 35, { "r35" }, false }, - { ARC_R0_REGNUM + 36, { "r36" }, false }, - { ARC_R0_REGNUM + 37, { "r37" }, false }, - { ARC_R0_REGNUM + 38, { "r38" }, false }, - { ARC_R0_REGNUM + 39, { "r39" }, false }, - { ARC_R0_REGNUM + 40, { "r40" }, false }, - { ARC_R0_REGNUM + 41, { "r41" }, false }, - { ARC_R0_REGNUM + 42, { "r42" }, false }, - { ARC_R0_REGNUM + 43, { "r43" }, false }, - { ARC_R0_REGNUM + 44, { "r44" }, false }, - { ARC_R0_REGNUM + 45, { "r45" }, false }, - { ARC_R0_REGNUM + 46, { "r46" }, false }, - { ARC_R0_REGNUM + 47, { "r47" }, false }, - { ARC_R0_REGNUM + 48, { "r48" }, false }, - { ARC_R0_REGNUM + 49, { "r49" }, false }, - { ARC_R0_REGNUM + 50, { "r50" }, false }, - { ARC_R0_REGNUM + 51, { "r51" }, false }, - { ARC_R0_REGNUM + 52, { "r52" }, false }, - { ARC_R0_REGNUM + 53, { "r53" }, false }, - { ARC_R0_REGNUM + 54, { "r54" }, false }, - { ARC_R0_REGNUM + 55, { "r55" }, false }, - { ARC_R0_REGNUM + 56, { "r56" }, false }, - { ARC_R0_REGNUM + 57, { "r57" }, false }, - { ARC_R0_REGNUM + 58, { "r58", "accl" }, false }, - { ARC_R0_REGNUM + 59, { "r59", "acch" }, false }, - { ARC_R0_REGNUM + 60, { "lp_count" }, false }, - { ARC_R0_REGNUM + 61, { "reserved" }, false }, - { ARC_R0_REGNUM + 62, { "limm" }, false }, - { ARC_R0_REGNUM + 63, { "pcl" }, true } - } -}; +static struct arc_register_feature arc_v1_core_reg_feature + = { ARC_CORE_FEATURE_NAME, + { { ARC_R0_REGNUM + 0, { "r0" }, true }, + { ARC_R0_REGNUM + 1, { "r1" }, true }, + { ARC_R0_REGNUM + 2, { "r2" }, true }, + { ARC_R0_REGNUM + 3, { "r3" }, true }, + { ARC_R0_REGNUM + 4, { "r4" }, false }, + { ARC_R0_REGNUM + 5, { "r5" }, false }, + { ARC_R0_REGNUM + 6, { "r6" }, false }, + { ARC_R0_REGNUM + 7, { "r7" }, false }, + { ARC_R0_REGNUM + 8, { "r8" }, false }, + { ARC_R0_REGNUM + 9, { "r9" }, false }, + { ARC_R0_REGNUM + 10, { "r10" }, true }, + { ARC_R0_REGNUM + 11, { "r11" }, true }, + { ARC_R0_REGNUM + 12, { "r12" }, true }, + { ARC_R0_REGNUM + 13, { "r13" }, true }, + { ARC_R0_REGNUM + 14, { "r14" }, true }, + { ARC_R0_REGNUM + 15, { "r15" }, true }, + { ARC_R0_REGNUM + 16, { "r16" }, false }, + { ARC_R0_REGNUM + 17, { "r17" }, false }, + { ARC_R0_REGNUM + 18, { "r18" }, false }, + { ARC_R0_REGNUM + 19, { "r19" }, false }, + { ARC_R0_REGNUM + 20, { "r20" }, false }, + { ARC_R0_REGNUM + 21, { "r21" }, false }, + { ARC_R0_REGNUM + 22, { "r22" }, false }, + { ARC_R0_REGNUM + 23, { "r23" }, false }, + { ARC_R0_REGNUM + 24, { "r24" }, false }, + { ARC_R0_REGNUM + 25, { "r25" }, false }, + { ARC_R0_REGNUM + 26, { "gp" }, true }, + { ARC_R0_REGNUM + 27, { "fp" }, true }, + { ARC_R0_REGNUM + 28, { "sp" }, true }, + { ARC_R0_REGNUM + 29, { "ilink1" }, false }, + { ARC_R0_REGNUM + 30, { "ilink2" }, false }, + { ARC_R0_REGNUM + 31, { "blink" }, true }, + { ARC_R0_REGNUM + 32, { "r32" }, false }, + { ARC_R0_REGNUM + 33, { "r33" }, false }, + { ARC_R0_REGNUM + 34, { "r34" }, false }, + { ARC_R0_REGNUM + 35, { "r35" }, false }, + { ARC_R0_REGNUM + 36, { "r36" }, false }, + { ARC_R0_REGNUM + 37, { "r37" }, false }, + { ARC_R0_REGNUM + 38, { "r38" }, false }, + { ARC_R0_REGNUM + 39, { "r39" }, false }, + { ARC_R0_REGNUM + 40, { "r40" }, false }, + { ARC_R0_REGNUM + 41, { "r41" }, false }, + { ARC_R0_REGNUM + 42, { "r42" }, false }, + { ARC_R0_REGNUM + 43, { "r43" }, false }, + { ARC_R0_REGNUM + 44, { "r44" }, false }, + { ARC_R0_REGNUM + 45, { "r45" }, false }, + { ARC_R0_REGNUM + 46, { "r46" }, false }, + { ARC_R0_REGNUM + 47, { "r47" }, false }, + { ARC_R0_REGNUM + 48, { "r48" }, false }, + { ARC_R0_REGNUM + 49, { "r49" }, false }, + { ARC_R0_REGNUM + 50, { "r50" }, false }, + { ARC_R0_REGNUM + 51, { "r51" }, false }, + { ARC_R0_REGNUM + 52, { "r52" }, false }, + { ARC_R0_REGNUM + 53, { "r53" }, false }, + { ARC_R0_REGNUM + 54, { "r54" }, false }, + { ARC_R0_REGNUM + 55, { "r55" }, false }, + { ARC_R0_REGNUM + 56, { "r56" }, false }, + { ARC_R0_REGNUM + 57, { "r57" }, false }, + { ARC_R0_REGNUM + 58, { "r58", "accl" }, false }, + { ARC_R0_REGNUM + 59, { "r59", "acch" }, false }, + { ARC_R0_REGNUM + 60, { "lp_count" }, false }, + { ARC_R0_REGNUM + 61, { "reserved" }, false }, + { ARC_R0_REGNUM + 62, { "limm" }, false }, + { ARC_R0_REGNUM + 63, { "pcl" }, true } } }; /* ARCv2 (ARCHS) general core registers feature set. See also arc_update_acc_reg_names() for "accl/acch" names. */ -static struct arc_register_feature arc_v2_core_reg_feature = -{ - ARC_CORE_FEATURE_NAME, - { - { ARC_R0_REGNUM + 0, { "r0" }, true }, - { ARC_R0_REGNUM + 1, { "r1" }, true }, - { ARC_R0_REGNUM + 2, { "r2" }, true }, - { ARC_R0_REGNUM + 3, { "r3" }, true }, - { ARC_R0_REGNUM + 4, { "r4" }, false }, - { ARC_R0_REGNUM + 5, { "r5" }, false }, - { ARC_R0_REGNUM + 6, { "r6" }, false }, - { ARC_R0_REGNUM + 7, { "r7" }, false }, - { ARC_R0_REGNUM + 8, { "r8" }, false }, - { ARC_R0_REGNUM + 9, { "r9" }, false }, - { ARC_R0_REGNUM + 10, { "r10" }, true }, - { ARC_R0_REGNUM + 11, { "r11" }, true }, - { ARC_R0_REGNUM + 12, { "r12" }, true }, - { ARC_R0_REGNUM + 13, { "r13" }, true }, - { ARC_R0_REGNUM + 14, { "r14" }, true }, - { ARC_R0_REGNUM + 15, { "r15" }, true }, - { ARC_R0_REGNUM + 16, { "r16" }, false }, - { ARC_R0_REGNUM + 17, { "r17" }, false }, - { ARC_R0_REGNUM + 18, { "r18" }, false }, - { ARC_R0_REGNUM + 19, { "r19" }, false }, - { ARC_R0_REGNUM + 20, { "r20" }, false }, - { ARC_R0_REGNUM + 21, { "r21" }, false }, - { ARC_R0_REGNUM + 22, { "r22" }, false }, - { ARC_R0_REGNUM + 23, { "r23" }, false }, - { ARC_R0_REGNUM + 24, { "r24" }, false }, - { ARC_R0_REGNUM + 25, { "r25" }, false }, - { ARC_R0_REGNUM + 26, { "gp" }, true }, - { ARC_R0_REGNUM + 27, { "fp" }, true }, - { ARC_R0_REGNUM + 28, { "sp" }, true }, - { ARC_R0_REGNUM + 29, { "ilink" }, false }, - { ARC_R0_REGNUM + 30, { "r30" }, true }, - { ARC_R0_REGNUM + 31, { "blink" }, true }, - { ARC_R0_REGNUM + 32, { "r32" }, false }, - { ARC_R0_REGNUM + 33, { "r33" }, false }, - { ARC_R0_REGNUM + 34, { "r34" }, false }, - { ARC_R0_REGNUM + 35, { "r35" }, false }, - { ARC_R0_REGNUM + 36, { "r36" }, false }, - { ARC_R0_REGNUM + 37, { "r37" }, false }, - { ARC_R0_REGNUM + 38, { "r38" }, false }, - { ARC_R0_REGNUM + 39, { "r39" }, false }, - { ARC_R0_REGNUM + 40, { "r40" }, false }, - { ARC_R0_REGNUM + 41, { "r41" }, false }, - { ARC_R0_REGNUM + 42, { "r42" }, false }, - { ARC_R0_REGNUM + 43, { "r43" }, false }, - { ARC_R0_REGNUM + 44, { "r44" }, false }, - { ARC_R0_REGNUM + 45, { "r45" }, false }, - { ARC_R0_REGNUM + 46, { "r46" }, false }, - { ARC_R0_REGNUM + 47, { "r47" }, false }, - { ARC_R0_REGNUM + 48, { "r48" }, false }, - { ARC_R0_REGNUM + 49, { "r49" }, false }, - { ARC_R0_REGNUM + 50, { "r50" }, false }, - { ARC_R0_REGNUM + 51, { "r51" }, false }, - { ARC_R0_REGNUM + 52, { "r52" }, false }, - { ARC_R0_REGNUM + 53, { "r53" }, false }, - { ARC_R0_REGNUM + 54, { "r54" }, false }, - { ARC_R0_REGNUM + 55, { "r55" }, false }, - { ARC_R0_REGNUM + 56, { "r56" }, false }, - { ARC_R0_REGNUM + 57, { "r57" }, false }, - { ARC_R0_REGNUM + 58, { "r58", "accl" }, false }, - { ARC_R0_REGNUM + 59, { "r59", "acch" }, false }, - { ARC_R0_REGNUM + 60, { "lp_count" }, false }, - { ARC_R0_REGNUM + 61, { "reserved" }, false }, - { ARC_R0_REGNUM + 62, { "limm" }, false }, - { ARC_R0_REGNUM + 63, { "pcl" }, true } - } -}; +static struct arc_register_feature arc_v2_core_reg_feature + = { ARC_CORE_FEATURE_NAME, + { { ARC_R0_REGNUM + 0, { "r0" }, true }, + { ARC_R0_REGNUM + 1, { "r1" }, true }, + { ARC_R0_REGNUM + 2, { "r2" }, true }, + { ARC_R0_REGNUM + 3, { "r3" }, true }, + { ARC_R0_REGNUM + 4, { "r4" }, false }, + { ARC_R0_REGNUM + 5, { "r5" }, false }, + { ARC_R0_REGNUM + 6, { "r6" }, false }, + { ARC_R0_REGNUM + 7, { "r7" }, false }, + { ARC_R0_REGNUM + 8, { "r8" }, false }, + { ARC_R0_REGNUM + 9, { "r9" }, false }, + { ARC_R0_REGNUM + 10, { "r10" }, true }, + { ARC_R0_REGNUM + 11, { "r11" }, true }, + { ARC_R0_REGNUM + 12, { "r12" }, true }, + { ARC_R0_REGNUM + 13, { "r13" }, true }, + { ARC_R0_REGNUM + 14, { "r14" }, true }, + { ARC_R0_REGNUM + 15, { "r15" }, true }, + { ARC_R0_REGNUM + 16, { "r16" }, false }, + { ARC_R0_REGNUM + 17, { "r17" }, false }, + { ARC_R0_REGNUM + 18, { "r18" }, false }, + { ARC_R0_REGNUM + 19, { "r19" }, false }, + { ARC_R0_REGNUM + 20, { "r20" }, false }, + { ARC_R0_REGNUM + 21, { "r21" }, false }, + { ARC_R0_REGNUM + 22, { "r22" }, false }, + { ARC_R0_REGNUM + 23, { "r23" }, false }, + { ARC_R0_REGNUM + 24, { "r24" }, false }, + { ARC_R0_REGNUM + 25, { "r25" }, false }, + { ARC_R0_REGNUM + 26, { "gp" }, true }, + { ARC_R0_REGNUM + 27, { "fp" }, true }, + { ARC_R0_REGNUM + 28, { "sp" }, true }, + { ARC_R0_REGNUM + 29, { "ilink" }, false }, + { ARC_R0_REGNUM + 30, { "r30" }, true }, + { ARC_R0_REGNUM + 31, { "blink" }, true }, + { ARC_R0_REGNUM + 32, { "r32" }, false }, + { ARC_R0_REGNUM + 33, { "r33" }, false }, + { ARC_R0_REGNUM + 34, { "r34" }, false }, + { ARC_R0_REGNUM + 35, { "r35" }, false }, + { ARC_R0_REGNUM + 36, { "r36" }, false }, + { ARC_R0_REGNUM + 37, { "r37" }, false }, + { ARC_R0_REGNUM + 38, { "r38" }, false }, + { ARC_R0_REGNUM + 39, { "r39" }, false }, + { ARC_R0_REGNUM + 40, { "r40" }, false }, + { ARC_R0_REGNUM + 41, { "r41" }, false }, + { ARC_R0_REGNUM + 42, { "r42" }, false }, + { ARC_R0_REGNUM + 43, { "r43" }, false }, + { ARC_R0_REGNUM + 44, { "r44" }, false }, + { ARC_R0_REGNUM + 45, { "r45" }, false }, + { ARC_R0_REGNUM + 46, { "r46" }, false }, + { ARC_R0_REGNUM + 47, { "r47" }, false }, + { ARC_R0_REGNUM + 48, { "r48" }, false }, + { ARC_R0_REGNUM + 49, { "r49" }, false }, + { ARC_R0_REGNUM + 50, { "r50" }, false }, + { ARC_R0_REGNUM + 51, { "r51" }, false }, + { ARC_R0_REGNUM + 52, { "r52" }, false }, + { ARC_R0_REGNUM + 53, { "r53" }, false }, + { ARC_R0_REGNUM + 54, { "r54" }, false }, + { ARC_R0_REGNUM + 55, { "r55" }, false }, + { ARC_R0_REGNUM + 56, { "r56" }, false }, + { ARC_R0_REGNUM + 57, { "r57" }, false }, + { ARC_R0_REGNUM + 58, { "r58", "accl" }, false }, + { ARC_R0_REGNUM + 59, { "r59", "acch" }, false }, + { ARC_R0_REGNUM + 60, { "lp_count" }, false }, + { ARC_R0_REGNUM + 61, { "reserved" }, false }, + { ARC_R0_REGNUM + 62, { "limm" }, false }, + { ARC_R0_REGNUM + 63, { "pcl" }, true } } }; /* The common auxiliary registers feature set. The REGNUM field must match the ARC_REGNUM enum in arc-tdep.h. */ -static const struct arc_register_feature arc_common_aux_reg_feature = -{ - ARC_AUX_FEATURE_NAME, - { - { ARC_FIRST_AUX_REGNUM + 0, { "pc" }, true }, - { ARC_FIRST_AUX_REGNUM + 1, { "status32" }, true }, - { ARC_FIRST_AUX_REGNUM + 2, { "lp_start" }, false }, - { ARC_FIRST_AUX_REGNUM + 3, { "lp_end" }, false }, - { ARC_FIRST_AUX_REGNUM + 4, { "bta" }, false } - } -}; +static const struct arc_register_feature arc_common_aux_reg_feature + = { ARC_AUX_FEATURE_NAME, + { { ARC_FIRST_AUX_REGNUM + 0, { "pc" }, true }, + { ARC_FIRST_AUX_REGNUM + 1, { "status32" }, true }, + { ARC_FIRST_AUX_REGNUM + 2, { "lp_start" }, false }, + { ARC_FIRST_AUX_REGNUM + 3, { "lp_end" }, false }, + { ARC_FIRST_AUX_REGNUM + 4, { "bta" }, false } } }; static char *arc_disassembler_options = NULL; @@ -324,8 +312,7 @@ arc_insn_get_operand_value (const struct arc_instruction &insn, struct regcache *regcache = get_current_regcache (); ULONGEST value; regcache_cooked_read_unsigned (regcache, - insn.operands[operand_num].value, - &value); + insn.operands[operand_num].value, &value); return value; } } @@ -352,8 +339,7 @@ arc_insn_get_operand_value_signed (const struct arc_instruction &insn, /* Value in instruction is a register number. */ struct regcache *regcache = get_current_regcache (); LONGEST value; - regcache_cooked_read_signed (regcache, - insn.operands[operand_num].value, + regcache_cooked_read_signed (regcache, insn.operands[operand_num].value, &value); return value; } @@ -441,8 +427,7 @@ arc_insn_get_branch_target (const struct arc_instruction &insn) } else if (insn.insn_class == EI) { - gdb_printf (gdb_stderr, - "EI_S instruction is not supported by the GDB."); + gdb_printf (gdb_stderr, "EI_S instruction is not supported by the GDB."); return 0; } /* LEAVE_S: PC = BLINK. */ @@ -602,8 +587,7 @@ arc_write_pc (struct regcache *regcache, CORE_ADDR new_pc) { struct gdbarch *gdbarch = regcache->arch (); - arc_debug_printf ("Writing PC, new value=%s", - paddress (gdbarch, new_pc)); + arc_debug_printf ("Writing PC, new value=%s", paddress (gdbarch, new_pc)); regcache_cooked_write_unsigned (regcache, gdbarch_pc_regnum (gdbarch), new_pc); @@ -650,8 +634,8 @@ arc_write_pc (struct regcache *regcache, CORE_ADDR new_pc) virtual FP. */ static void -arc_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc, - int *reg_ptr, LONGEST *offset_ptr) +arc_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc, int *reg_ptr, + LONGEST *offset_ptr) { *reg_ptr = gdbarch_sp_regnum (gdbarch); *offset_ptr = 0; @@ -780,9 +764,8 @@ arc_push_dummy_call (struct gdbarch *gdbarch, struct value *function, unsigned int space = align_up (len, 4); memcpy (data, value_contents (args[i]).data (), (size_t) len); - arc_debug_printf ("copying arg %d, val 0x%08x, len %d to mem", - i, *((int *) value_contents (args[i]).data ()), - len); + arc_debug_printf ("copying arg %d, val 0x%08x, len %d to mem", i, + *((int *) value_contents (args[i]).data ()), len); data += space; } @@ -916,8 +899,8 @@ arc_extract_return_value (struct gdbarch *gdbarch, struct type *type, /* Get the return value from one register. */ regcache_cooked_read_unsigned (regcache, ARC_R0_REGNUM, &val); - store_unsigned_integer (valbuf, (int) len, - gdbarch_byte_order (gdbarch), val); + store_unsigned_integer (valbuf, (int) len, gdbarch_byte_order (gdbarch), + val); arc_debug_printf ("returning 0x%s", phex (val, ARC_REGISTER_SIZE)); } @@ -935,15 +918,13 @@ arc_extract_return_value (struct gdbarch *gdbarch, struct type *type, (int) len - ARC_REGISTER_SIZE, gdbarch_byte_order (gdbarch), high); - arc_debug_printf ("returning 0x%s%s", - phex (high, ARC_REGISTER_SIZE), + arc_debug_printf ("returning 0x%s%s", phex (high, ARC_REGISTER_SIZE), phex (low, ARC_REGISTER_SIZE)); } else - error (_("arc: extract_return_value: type length %u too large"), len); + error (_ ("arc: extract_return_value: type length %u too large"), len); } - /* Store the return value of a function into the registers/memory used to return it, according to the convention used by the ABI. @@ -986,12 +967,11 @@ arc_store_return_value (struct gdbarch *gdbarch, struct type *type, regcache_cooked_write_unsigned (regcache, ARC_R0_REGNUM, low); regcache_cooked_write_unsigned (regcache, ARC_R1_REGNUM, high); - arc_debug_printf ("storing 0x%s%s", - phex (high, ARC_REGISTER_SIZE), + arc_debug_printf ("storing 0x%s%s", phex (high, ARC_REGISTER_SIZE), phex (low, ARC_REGISTER_SIZE)); } else - error (_("arc_store_return_value: type length too large.")); + error (_ ("arc_store_return_value: type length too large.")); } /* Implement the "get_longjmp_target" gdbarch method. */ @@ -1005,7 +985,8 @@ arc_get_longjmp_target (frame_info_ptr frame, CORE_ADDR *pc) arc_gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); int pc_offset = tdep->jb_pc * ARC_REGISTER_SIZE; gdb_byte buf[ARC_REGISTER_SIZE]; - CORE_ADDR jb_addr = get_frame_register_unsigned (frame, ARC_FIRST_ARG_REGNUM); + CORE_ADDR jb_addr + = get_frame_register_unsigned (frame, ARC_FIRST_ARG_REGNUM); if (target_read_memory (jb_addr + pc_offset, buf, ARC_REGISTER_SIZE)) return 0; /* Failed to read from memory. */ @@ -1052,9 +1033,8 @@ arc_return_value (struct gdbarch *gdbarch, struct value *function, arc_extract_return_value (gdbarch, valtype, regcache, readbuf); } - return (is_struct_return - ? RETURN_VALUE_STRUCT_CONVENTION - : RETURN_VALUE_REGISTER_CONVENTION); + return (is_struct_return ? RETURN_VALUE_STRUCT_CONVENTION + : RETURN_VALUE_REGISTER_CONVENTION); } /* Return the base address of the frame. For ARC, the base address is the @@ -1070,7 +1050,8 @@ arc_frame_base_address (frame_info_ptr this_frame, void **prologue_cache) either a register or a constant. */ static pv_t -arc_pv_get_operand (pv_t *regs, const struct arc_instruction &insn, int operand) +arc_pv_get_operand (pv_t *regs, const struct arc_instruction &insn, + int operand) { if (insn.operands[operand].kind == ARC_OPERAND_KIND_REG) return regs[insn.operands[operand].value]; @@ -1083,8 +1064,9 @@ arc_pv_get_operand (pv_t *regs, const struct arc_instruction &insn, int operand) be updated. */ static bool -arc_is_in_prologue (struct gdbarch *gdbarch, const struct arc_instruction &insn, - pv_t *regs, struct pv_area *stack) +arc_is_in_prologue (struct gdbarch *gdbarch, + const struct arc_instruction &insn, pv_t *regs, + struct pv_area *stack) { /* It might be that currently analyzed address doesn't contain an instruction, hence INSN is not valid. It likely means that address points @@ -1240,20 +1222,20 @@ arc_is_in_prologue (struct gdbarch *gdbarch, const struct arc_instruction &insn, bool is_fp_saved; if (insn.operands_count > 1) - is_fp_saved = (insn.operands[1].value == ARC_FP_REGNUM); + is_fp_saved = (insn.operands[1].value == ARC_FP_REGNUM); else is_fp_saved = false; bool is_blink_saved; if (insn.operands_count > 1) - is_blink_saved = (insn.operands[insn.operands_count - 1].value - == ARC_BLINK_REGNUM); + is_blink_saved + = (insn.operands[insn.operands_count - 1].value == ARC_BLINK_REGNUM); else is_blink_saved = false; /* Amount of bytes to be allocated to store specified registers. */ - CORE_ADDR st_size = ((regs_saved + is_fp_saved + is_blink_saved) - * ARC_REGISTER_SIZE); + CORE_ADDR st_size + = ((regs_saved + is_fp_saved + is_blink_saved) * ARC_REGISTER_SIZE); pv_t new_sp = pv_add_constant (regs[ARC_SP_REGNUM], -st_size); /* Assume that if the last register (closest to new SP) can be written, @@ -1280,8 +1262,7 @@ arc_is_in_prologue (struct gdbarch *gdbarch, const struct arc_instruction &insn, if (is_blink_saved) { addr = pv_add_constant (addr, -ARC_REGISTER_SIZE); - stack->store (addr, ARC_REGISTER_SIZE, - regs[ARC_BLINK_REGNUM]); + stack->store (addr, ARC_REGISTER_SIZE, regs[ARC_BLINK_REGNUM]); } gdb_assert (pv_is_identical (addr, new_sp)); @@ -1439,8 +1420,9 @@ arc_analyze_prologue (struct gdbarch *gdbarch, const CORE_ADDR entrypoint, limit will be rarely reached. */ const static int MAX_PROLOGUE_LENGTH - = 4 * (ARC_R25_REGNUM - ARC_R13_REGNUM + 1 + 2 + 1 + 6 - + ARC_LAST_ARG_REGNUM - ARC_FIRST_ARG_REGNUM + 1); + = 4 + * (ARC_R25_REGNUM - ARC_R13_REGNUM + 1 + 2 + 1 + 6 + ARC_LAST_ARG_REGNUM + - ARC_FIRST_ARG_REGNUM + 1); /* Implement the "skip_prologue" gdbarch method. @@ -1460,8 +1442,7 @@ arc_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) if (find_pc_partial_function (pc, &func_name, &func_addr, NULL)) { /* Found a function. */ - CORE_ADDR postprologue_pc - = skip_prologue_using_sal (gdbarch, func_addr); + CORE_ADDR postprologue_pc = skip_prologue_using_sal (gdbarch, func_addr); if (postprologue_pc != 0) return std::max (pc, postprologue_pc); @@ -1597,15 +1578,13 @@ arc_sw_breakpoint_from_kind (struct gdbarch *gdbarch, int kind, int *size) if (kind == sizeof (arc_brk_le)) { - return ((gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG) - ? arc_brk_be - : arc_brk_le); + return ((gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG) ? arc_brk_be + : arc_brk_le); } else { - return ((gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG) - ? arc_brk_s_be - : arc_brk_s_le); + return ((gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG) ? arc_brk_s_be + : arc_brk_s_le); } } @@ -1635,7 +1614,7 @@ arc_print_frame_cache (struct gdbarch *gdbarch, const char *message, arc_debug_printf ("saved register %s at %s %s", gdbarch_register_name (gdbarch, i), (addresses_known) ? "address" : "offset", - paddress (gdbarch, cache->saved_regs[i].addr ())); + paddress (gdbarch, cache->saved_regs[i].addr ())); } } @@ -1687,8 +1666,8 @@ arc_make_frame_cache (frame_info_ptr this_frame) if (arc_debug) arc_print_frame_cache (gdbarch, "after prologue", cache, false); - CORE_ADDR unwound_fb = get_frame_register_unsigned (this_frame, - cache->frame_base_reg); + CORE_ADDR unwound_fb + = get_frame_register_unsigned (this_frame, cache->frame_base_reg); if (unwound_fb == 0) return cache; cache->prev_sp = unwound_fb + cache->frame_base_offset; @@ -1745,8 +1724,8 @@ arc_frame_this_id (frame_info_ptr this_frame, void **this_cache, */ CORE_ADDR code_addr = get_frame_func (this_frame); if (code_addr == 0) - code_addr = get_frame_register_unsigned (this_frame, - gdbarch_pc_regnum (gdbarch)); + code_addr + = get_frame_register_unsigned (this_frame, gdbarch_pc_regnum (gdbarch)); *this_id = frame_id_build (stack_addr, code_addr); } @@ -1754,8 +1733,8 @@ arc_frame_this_id (frame_info_ptr this_frame, void **this_cache, /* Implement the "prev_register" frame_unwind method. */ static struct value * -arc_frame_prev_register (frame_info_ptr this_frame, - void **this_cache, int regnum) +arc_frame_prev_register (frame_info_ptr this_frame, void **this_cache, + int regnum) { if (*this_cache == NULL) *this_cache = arc_make_frame_cache (this_frame); @@ -1813,7 +1792,8 @@ arc_make_sigtramp_frame_cache (frame_info_ptr this_frame) arc_gdbarch_tdep *tdep = gdbarch_tdep (arch); /* Allocate new frame cache instance and space for saved register info. */ - struct arc_frame_cache *cache = FRAME_OBSTACK_ZALLOC (struct arc_frame_cache); + struct arc_frame_cache *cache + = FRAME_OBSTACK_ZALLOC (struct arc_frame_cache); cache->saved_regs = trad_frame_alloc_saved_regs (this_frame); /* Get the stack pointer and use it as the frame base. */ @@ -1844,8 +1824,8 @@ arc_make_sigtramp_frame_cache (frame_info_ptr this_frame) frames. */ static void -arc_sigtramp_frame_this_id (frame_info_ptr this_frame, - void **this_cache, struct frame_id *this_id) +arc_sigtramp_frame_this_id (frame_info_ptr this_frame, void **this_cache, + struct frame_id *this_id) { arc_debug_printf ("called"); @@ -1863,8 +1843,8 @@ arc_sigtramp_frame_this_id (frame_info_ptr this_frame, /* Get a register from a signal handler frame. */ static struct value * -arc_sigtramp_frame_prev_register (frame_info_ptr this_frame, - void **this_cache, int regnum) +arc_sigtramp_frame_prev_register (frame_info_ptr this_frame, void **this_cache, + int regnum) { arc_debug_printf ("regnum = %d", regnum); @@ -1881,8 +1861,7 @@ arc_sigtramp_frame_prev_register (frame_info_ptr this_frame, static int arc_sigtramp_frame_sniffer (const struct frame_unwind *self, - frame_info_ptr this_frame, - void **this_cache) + frame_info_ptr this_frame, void **this_cache) { arc_debug_printf ("called"); @@ -1899,41 +1878,35 @@ arc_sigtramp_frame_sniffer (const struct frame_unwind *self, the fallback unwinder, we use the default frame sniffer, which always accepts the frame. */ -static const struct frame_unwind arc_frame_unwind = { - "arc prologue", - NORMAL_FRAME, - default_frame_unwind_stop_reason, - arc_frame_this_id, - arc_frame_prev_register, - NULL, - default_frame_sniffer, - NULL, - NULL -}; +static const struct frame_unwind arc_frame_unwind + = { "arc prologue", + NORMAL_FRAME, + default_frame_unwind_stop_reason, + arc_frame_this_id, + arc_frame_prev_register, + NULL, + default_frame_sniffer, + NULL, + NULL }; /* Structure defining the ARC signal frame unwind functions. Custom sniffer is used, because this frame must be accepted only in the right context. */ -static const struct frame_unwind arc_sigtramp_frame_unwind = { - "arc sigtramp", - SIGTRAMP_FRAME, - default_frame_unwind_stop_reason, - arc_sigtramp_frame_this_id, - arc_sigtramp_frame_prev_register, - NULL, - arc_sigtramp_frame_sniffer, - NULL, - NULL -}; - - -static const struct frame_base arc_normal_base = { - &arc_frame_unwind, - arc_frame_base_address, - arc_frame_base_address, - arc_frame_base_address -}; +static const struct frame_unwind arc_sigtramp_frame_unwind + = { "arc sigtramp", + SIGTRAMP_FRAME, + default_frame_unwind_stop_reason, + arc_sigtramp_frame_this_id, + arc_sigtramp_frame_prev_register, + NULL, + arc_sigtramp_frame_sniffer, + NULL, + NULL }; + +static const struct frame_base arc_normal_base + = { &arc_frame_unwind, arc_frame_base_address, arc_frame_base_address, + arc_frame_base_address }; static enum arc_isa mach_type_to_arc_isa (const unsigned long mach) @@ -1947,7 +1920,7 @@ mach_type_to_arc_isa (const unsigned long mach) case bfd_mach_arc_arcv2: return ARC_ISA_ARCV2; default: - internal_error (_("unknown machine id %lu"), mach); + internal_error (_ ("unknown machine id %lu"), mach); } } @@ -1972,7 +1945,7 @@ arc_arch_features_create (const bfd *abfd, const unsigned long mach) else if (eclass == ELFCLASS64) reg_size = 8; else - internal_error (_("unknown ELF header class %d"), eclass); + internal_error (_ ("unknown ELF header class %d"), eclass); } /* MACH from a bfd_arch_info struct is used here. It should be a safe @@ -1997,8 +1970,8 @@ find_obsolete_core_names (const struct target_desc *tdesc) feat = tdesc_find_feature (tdesc, ARC_CORE_V2_OBSOLETE_FEATURE_NAME); if (feat == nullptr) - feat = tdesc_find_feature - (tdesc, ARC_CORE_V2_REDUCED_OBSOLETE_FEATURE_NAME); + feat + = tdesc_find_feature (tdesc, ARC_CORE_V2_REDUCED_OBSOLETE_FEATURE_NAME); return feat; } @@ -2024,8 +1997,8 @@ determine_core_reg_feature_set (const unsigned long mach) case ARC_ISA_ARCV2: return &arc_v2_core_reg_feature; default: - gdb_assert_not_reached - ("Unknown machine type to determine the core feature set."); + gdb_assert_not_reached ( + "Unknown machine type to determine the core feature set."); } } @@ -2051,10 +2024,8 @@ determine_aux_reg_feature_set () static void arc_update_acc_reg_names (const int byte_order) { - const char *r58_alias - = byte_order == BFD_ENDIAN_LITTLE ? "accl" : "acch"; - const char *r59_alias - = byte_order == BFD_ENDIAN_LITTLE ? "acch" : "accl"; + const char *r58_alias = byte_order == BFD_ENDIAN_LITTLE ? "accl" : "acch"; + const char *r59_alias = byte_order == BFD_ENDIAN_LITTLE ? "acch" : "accl"; /* Subscript 1 must be OK because those registers have 2 names. */ arc_v1_core_reg_feature.registers[ARC_R58_REGNUM].names[1] = r58_alias; @@ -2089,16 +2060,16 @@ arc_check_tdesc_feature (struct tdesc_arch_data *tdesc_data, if (!found && reg.required_p) { std::ostringstream reg_names; - for (std::size_t i = 0; i < reg.names.size(); ++i) + for (std::size_t i = 0; i < reg.names.size (); ++i) { if (i == 0) reg_names << "'" << reg.names[0] << "'"; else reg_names << " or '" << reg.names[0] << "'"; } - arc_print (_("Error: Cannot find required register(s) %s " - "in feature '%s'.\n"), reg_names.str ().c_str (), - feature->name.c_str ()); + arc_print (_ ("Error: Cannot find required register(s) %s " + "in feature '%s'.\n"), + reg_names.str ().c_str (), feature->name.c_str ()); return false; } } @@ -2122,15 +2093,16 @@ arc_check_for_hw_loops (const struct target_desc *tdesc, return false; bool hw_loop_p = false; - const auto lp_start_name = - aux_regset->registers[ARC_LP_START_REGNUM - ARC_FIRST_AUX_REGNUM].names[0]; - const auto lp_end_name = - aux_regset->registers[ARC_LP_END_REGNUM - ARC_FIRST_AUX_REGNUM].names[0]; + const auto lp_start_name + = aux_regset->registers[ARC_LP_START_REGNUM - ARC_FIRST_AUX_REGNUM] + .names[0]; + const auto lp_end_name + = aux_regset->registers[ARC_LP_END_REGNUM - ARC_FIRST_AUX_REGNUM].names[0]; - hw_loop_p = tdesc_numbered_register (feature_aux, data, - ARC_LP_START_REGNUM, lp_start_name); - hw_loop_p &= tdesc_numbered_register (feature_aux, data, - ARC_LP_END_REGNUM, lp_end_name); + hw_loop_p = tdesc_numbered_register (feature_aux, data, ARC_LP_START_REGNUM, + lp_start_name); + hw_loop_p &= tdesc_numbered_register (feature_aux, data, ARC_LP_END_REGNUM, + lp_end_name); return hw_loop_p; } @@ -2151,8 +2123,7 @@ arc_tdesc_init (struct gdbarch_info info, const struct target_desc **tdesc, if (!tdesc_has_registers (tdesc_loc)) { arc_arch_features features - = arc_arch_features_create (info.abfd, - info.bfd_arch_info->mach); + = arc_arch_features_create (info.abfd, info.bfd_arch_info->mach); tdesc_loc = arc_lookup_target_description (features); } gdb_assert (tdesc_loc != nullptr); @@ -2172,15 +2143,17 @@ arc_tdesc_init (struct gdbarch_info info, const struct target_desc **tdesc, if (feature_core == nullptr) { - arc_print (_("Error: Cannot find required feature '%s' in supplied " - "target description.\n"), ARC_CORE_FEATURE_NAME); + arc_print (_ ("Error: Cannot find required feature '%s' in supplied " + "target description.\n"), + ARC_CORE_FEATURE_NAME); return false; } if (feature_aux == nullptr) { - arc_print (_("Error: Cannot find required feature '%s' in supplied " - "target description.\n"), ARC_AUX_FEATURE_NAME); + arc_print (_ ("Error: Cannot find required feature '%s' in supplied " + "target description.\n"), + ARC_AUX_FEATURE_NAME); return false; } @@ -2193,12 +2166,10 @@ arc_tdesc_init (struct gdbarch_info info, const struct target_desc **tdesc, arc_update_acc_reg_names (info.byte_order); - bool valid_p = arc_check_tdesc_feature (tdesc_data_loc.get (), - feature_core, + bool valid_p = arc_check_tdesc_feature (tdesc_data_loc.get (), feature_core, arc_core_reg_feature); - valid_p &= arc_check_tdesc_feature (tdesc_data_loc.get (), - feature_aux, + valid_p &= arc_check_tdesc_feature (tdesc_data_loc.get (), feature_aux, arc_aux_reg_feature); if (!valid_p) @@ -2288,7 +2259,7 @@ arc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_sp_regnum (gdbarch, ARC_SP_REGNUM); set_gdbarch_pc_regnum (gdbarch, ARC_PC_REGNUM); set_gdbarch_ps_regnum (gdbarch, ARC_STATUS32_REGNUM); - set_gdbarch_fp0_regnum (gdbarch, -1); /* No FPU registers. */ + set_gdbarch_fp0_regnum (gdbarch, -1); /* No FPU registers. */ set_gdbarch_push_dummy_call (gdbarch, arc_push_dummy_call); set_gdbarch_push_dummy_code (gdbarch, arc_push_dummy_code); @@ -2422,8 +2393,7 @@ arc_dump_tdep (struct gdbarch *gdbarch, struct ui_file *file) host_address_to_string (tdep->sigcontext_addr)); gdb_printf (file, "arc_dump_tdep: sc_reg_offset = <%s>\n", host_address_to_string (tdep->sc_reg_offset)); - gdb_printf (file, "arc_dump_tdep: sc_num_regs = %d\n", - tdep->sc_num_regs); + gdb_printf (file, "arc_dump_tdep: sc_num_regs = %d\n", tdep->sc_num_regs); } /* This command accepts single argument - address of instruction to @@ -2447,6 +2417,7 @@ dump_arc_instruction_command (const char *args, int from_tty) } void _initialize_arc_tdep (); + void _initialize_arc_tdep () { @@ -2455,22 +2426,20 @@ _initialize_arc_tdep () /* Register ARC-specific commands with gdb. */ /* Add root prefix command for "maintenance print arc" commands. */ - add_basic_prefix_cmd ("arc", class_maintenance, - _("ARC-specific maintenance commands for printing GDB " - "internal state."), - &maintenance_print_arc_list, - 0, &maintenanceprintlist); - - add_cmd ("arc-instruction", class_maintenance, - dump_arc_instruction_command, - _("Dump arc_instruction structure for specified address."), + add_basic_prefix_cmd ( + "arc", class_maintenance, + _ ("ARC-specific maintenance commands for printing GDB " + "internal state."), + &maintenance_print_arc_list, 0, &maintenanceprintlist); + + add_cmd ("arc-instruction", class_maintenance, dump_arc_instruction_command, + _ ("Dump arc_instruction structure for specified address."), &maintenance_print_arc_list); /* Debug internals for ARC GDB. */ - add_setshow_boolean_cmd ("arc", class_maintenance, - &arc_debug, - _("Set ARC specific debugging."), - _("Show ARC specific debugging."), - _("When set, ARC specific debugging is enabled."), + add_setshow_boolean_cmd ("arc", class_maintenance, &arc_debug, + _ ("Set ARC specific debugging."), + _ ("Show ARC specific debugging."), + _ ("When set, ARC specific debugging is enabled."), NULL, NULL, &setdebuglist, &showdebuglist); } diff --git a/gdb/arc-tdep.h b/gdb/arc-tdep.h index edbd8c8..6f47b1c 100644 --- a/gdb/arc-tdep.h +++ b/gdb/arc-tdep.h @@ -33,74 +33,74 @@ saved in function prologue. */ enum arc_regnum - { - /* Core registers. */ - ARC_R0_REGNUM = 0, - ARC_R1_REGNUM = 1, - ARC_R4_REGNUM = 4, - ARC_R7_REGNUM = 7, - ARC_R9_REGNUM = 9, - ARC_R13_REGNUM = 13, - ARC_R16_REGNUM = 16, - ARC_R25_REGNUM = 25, - /* Global data pointer. */ - ARC_GP_REGNUM, - /* Frame pointer. */ - ARC_FP_REGNUM, - /* Stack pointer. */ - ARC_SP_REGNUM, - /* Return address from interrupt. */ - ARC_ILINK_REGNUM, - ARC_R30_REGNUM, - /* Return address from function. */ - ARC_BLINK_REGNUM, - /* Accumulator registers. */ - ARC_R58_REGNUM = 58, - ARC_R59_REGNUM, - /* Zero-delay loop counter. */ - ARC_LP_COUNT_REGNUM = 60, - /* Reserved register number. There should never be a register with such +{ + /* Core registers. */ + ARC_R0_REGNUM = 0, + ARC_R1_REGNUM = 1, + ARC_R4_REGNUM = 4, + ARC_R7_REGNUM = 7, + ARC_R9_REGNUM = 9, + ARC_R13_REGNUM = 13, + ARC_R16_REGNUM = 16, + ARC_R25_REGNUM = 25, + /* Global data pointer. */ + ARC_GP_REGNUM, + /* Frame pointer. */ + ARC_FP_REGNUM, + /* Stack pointer. */ + ARC_SP_REGNUM, + /* Return address from interrupt. */ + ARC_ILINK_REGNUM, + ARC_R30_REGNUM, + /* Return address from function. */ + ARC_BLINK_REGNUM, + /* Accumulator registers. */ + ARC_R58_REGNUM = 58, + ARC_R59_REGNUM, + /* Zero-delay loop counter. */ + ARC_LP_COUNT_REGNUM = 60, + /* Reserved register number. There should never be a register with such number, this name is needed only for a sanity check in arc_cannot_(fetch|store)_register. */ - ARC_RESERVED_REGNUM, - /* Long-immediate value. This is not a physical register - if instruction + ARC_RESERVED_REGNUM, + /* Long-immediate value. This is not a physical register - if instruction has register 62 as an operand, then this operand is a literal value stored in the instruction memory right after the instruction itself. This value is required in this enumeration as an architectural number for instruction analysis. */ - ARC_LIMM_REGNUM, - /* Program counter, aligned to 4-bytes, read-only. */ - ARC_PCL_REGNUM, - ARC_LAST_CORE_REGNUM = ARC_PCL_REGNUM, - - /* AUX registers. */ - /* Actual program counter. */ - ARC_PC_REGNUM, - ARC_FIRST_AUX_REGNUM = ARC_PC_REGNUM, - /* Status register. */ - ARC_STATUS32_REGNUM, - /* Zero-delay loop start instruction. */ - ARC_LP_START_REGNUM, - /* Zero-delay loop next-after-last instruction. */ - ARC_LP_END_REGNUM, - /* Branch target address. */ - ARC_BTA_REGNUM, - /* Exception return address. */ - ARC_ERET_REGNUM, - ARC_LAST_AUX_REGNUM = ARC_ERET_REGNUM, - ARC_LAST_REGNUM = ARC_LAST_AUX_REGNUM, - - /* Additional ABI constants. */ - ARC_FIRST_ARG_REGNUM = ARC_R0_REGNUM, - ARC_LAST_ARG_REGNUM = ARC_R7_REGNUM, - ARC_FIRST_CALLEE_SAVED_REGNUM = ARC_R13_REGNUM, - ARC_LAST_CALLEE_SAVED_REGNUM = ARC_R25_REGNUM, - }; + ARC_LIMM_REGNUM, + /* Program counter, aligned to 4-bytes, read-only. */ + ARC_PCL_REGNUM, + ARC_LAST_CORE_REGNUM = ARC_PCL_REGNUM, + + /* AUX registers. */ + /* Actual program counter. */ + ARC_PC_REGNUM, + ARC_FIRST_AUX_REGNUM = ARC_PC_REGNUM, + /* Status register. */ + ARC_STATUS32_REGNUM, + /* Zero-delay loop start instruction. */ + ARC_LP_START_REGNUM, + /* Zero-delay loop next-after-last instruction. */ + ARC_LP_END_REGNUM, + /* Branch target address. */ + ARC_BTA_REGNUM, + /* Exception return address. */ + ARC_ERET_REGNUM, + ARC_LAST_AUX_REGNUM = ARC_ERET_REGNUM, + ARC_LAST_REGNUM = ARC_LAST_AUX_REGNUM, + + /* Additional ABI constants. */ + ARC_FIRST_ARG_REGNUM = ARC_R0_REGNUM, + ARC_LAST_ARG_REGNUM = ARC_R7_REGNUM, + ARC_FIRST_CALLEE_SAVED_REGNUM = ARC_R13_REGNUM, + ARC_LAST_CALLEE_SAVED_REGNUM = ARC_R25_REGNUM, +}; /* Number of bytes in ARC register. All ARC registers are considered 32-bit. Those registers, which are actually shorter has zero-on-read for extra bits. Longer registers are represented as pairs of 32-bit registers. */ -#define ARC_REGISTER_SIZE 4 +#define ARC_REGISTER_SIZE 4 /* STATUS32 register: hardware loops disabled bit. */ #define ARC_STATUS32_L_MASK (1 << 12) @@ -169,13 +169,13 @@ arc_mach_is_arcv2 (struct gdbarch *gdbarch) number as "ARCv2". */ static inline bool -arc_arch_is_hs (const struct bfd_arch_info* arch) +arc_arch_is_hs (const struct bfd_arch_info *arch) { return startswith (arch->printable_name, "HS"); } static inline bool -arc_arch_is_em (const struct bfd_arch_info* arch) +arc_arch_is_em (const struct bfd_arch_info *arch) { return startswith (arch->printable_name, "EM"); } diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c index 6177682..59924ae 100644 --- a/gdb/arch-utils.c +++ b/gdb/arch-utils.c @@ -21,7 +21,7 @@ #include "arch-utils.h" #include "gdbcmd.h" -#include "inferior.h" /* enum CALL_DUMMY_LOCATION et al. */ +#include "inferior.h" /* enum CALL_DUMMY_LOCATION et al. */ #include "infrun.h" #include "regcache.h" #include "sim-regno.h" @@ -96,8 +96,8 @@ default_remove_non_address_bits (struct gdbarch *gdbarch, CORE_ADDR pointer) std::string default_memtag_to_string (struct gdbarch *gdbarch, struct value *tag) { - error (_("This architecture has no method to convert a memory tag to" - " a string.")); + error (_ ("This architecture has no method to convert a memory tag to" + " a string.")); } /* See arch-utils.h */ @@ -152,8 +152,8 @@ generic_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc) } int -generic_in_solib_return_trampoline (struct gdbarch *gdbarch, - CORE_ADDR pc, const char *name) +generic_in_solib_return_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, + const char *name) { return 0; } @@ -165,8 +165,7 @@ generic_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc) } int -default_code_of_frame_writable (struct gdbarch *gdbarch, - frame_info_ptr frame) +default_code_of_frame_writable (struct gdbarch *gdbarch, frame_info_ptr frame) { return 1; } @@ -256,10 +255,8 @@ cannot_register_not (struct gdbarch *gdbarch, int regnum) cooked or raw. */ void -legacy_virtual_frame_pointer (struct gdbarch *gdbarch, - CORE_ADDR pc, - int *frame_regnum, - LONGEST *frame_offset) +legacy_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc, + int *frame_regnum, LONGEST *frame_offset) { /* FIXME: cagney/2002-09-13: This code is used when identifying the frame pointer of the current PC. It is assuming that a single @@ -267,17 +264,15 @@ legacy_virtual_frame_pointer (struct gdbarch *gdbarch, instead generate a byte code expression as that would work better with things like Dwarf2's CFI. */ if (gdbarch_deprecated_fp_regnum (gdbarch) >= 0 - && gdbarch_deprecated_fp_regnum (gdbarch) - < gdbarch_num_regs (gdbarch)) + && gdbarch_deprecated_fp_regnum (gdbarch) < gdbarch_num_regs (gdbarch)) *frame_regnum = gdbarch_deprecated_fp_regnum (gdbarch); else if (gdbarch_sp_regnum (gdbarch) >= 0 - && gdbarch_sp_regnum (gdbarch) - < gdbarch_num_regs (gdbarch)) + && gdbarch_sp_regnum (gdbarch) < gdbarch_num_regs (gdbarch)) *frame_regnum = gdbarch_sp_regnum (gdbarch); else /* Should this be an internal error? I guess so, it is reflecting an architectural limitation in the current design. */ - internal_error (_("No virtual frame pointer available")); + internal_error (_ ("No virtual frame pointer available")); *frame_offset = 0; } @@ -286,8 +281,8 @@ legacy_virtual_frame_pointer (struct gdbarch *gdbarch, If no suitable type is found, return NULL. */ const struct floatformat ** -default_floatformat_for_type (struct gdbarch *gdbarch, - const char *name, int len) +default_floatformat_for_type (struct gdbarch *gdbarch, const char *name, + int len) { const struct floatformat **format = NULL; @@ -315,7 +310,7 @@ default_floatformat_for_type (struct gdbarch *gdbarch, return format; } - + int generic_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type) @@ -337,8 +332,7 @@ generic_instruction_nullified (struct gdbarch *gdbarch, } int -default_remote_register_number (struct gdbarch *gdbarch, - int regno) +default_remote_register_number (struct gdbarch *gdbarch, int regno) { return regno; } @@ -351,7 +345,6 @@ default_vsyscall_range (struct gdbarch *gdbarch, struct mem_range *range) return 0; } - /* Functions to manipulate the endianness of the target. */ static enum bfd_endian target_byte_order_user = BFD_ENDIAN_UNKNOWN; @@ -359,8 +352,7 @@ static enum bfd_endian target_byte_order_user = BFD_ENDIAN_UNKNOWN; static const char endian_big[] = "big"; static const char endian_little[] = "little"; static const char endian_auto[] = "auto"; -static const char *const endian_enum[] = -{ +static const char *const endian_enum[] = { endian_big, endian_little, endian_auto, @@ -382,18 +374,15 @@ show_endian (struct ui_file *file, int from_tty, struct cmd_list_element *c, { if (target_byte_order_user == BFD_ENDIAN_UNKNOWN) if (gdbarch_byte_order (get_current_arch ()) == BFD_ENDIAN_BIG) - gdb_printf (file, _("The target endianness is set automatically " - "(currently big endian).\n")); + gdb_printf (file, _ ("The target endianness is set automatically " + "(currently big endian).\n")); else - gdb_printf (file, _("The target endianness is set automatically " - "(currently little endian).\n")); + gdb_printf (file, _ ("The target endianness is set automatically " + "(currently little endian).\n")); + else if (target_byte_order_user == BFD_ENDIAN_BIG) + gdb_printf (file, _ ("The target is set to big endian.\n")); else - if (target_byte_order_user == BFD_ENDIAN_BIG) - gdb_printf (file, - _("The target is set to big endian.\n")); - else - gdb_printf (file, - _("The target is set to little endian.\n")); + gdb_printf (file, _ ("The target is set to little endian.\n")); } static void @@ -404,29 +393,29 @@ set_endian (const char *ignore_args, int from_tty, struct cmd_list_element *c) if (set_endian_string == endian_auto) { target_byte_order_user = BFD_ENDIAN_UNKNOWN; - if (! gdbarch_update_p (info)) - internal_error (_("set_endian: architecture update failed")); + if (!gdbarch_update_p (info)) + internal_error (_ ("set_endian: architecture update failed")); } else if (set_endian_string == endian_little) { info.byte_order = BFD_ENDIAN_LITTLE; - if (! gdbarch_update_p (info)) + if (!gdbarch_update_p (info)) gdb_printf (gdb_stderr, - _("Little endian target not supported by GDB\n")); + _ ("Little endian target not supported by GDB\n")); else target_byte_order_user = BFD_ENDIAN_LITTLE; } else if (set_endian_string == endian_big) { info.byte_order = BFD_ENDIAN_BIG; - if (! gdbarch_update_p (info)) + if (!gdbarch_update_p (info)) gdb_printf (gdb_stderr, - _("Big endian target not supported by GDB\n")); + _ ("Big endian target not supported by GDB\n")); else target_byte_order_user = BFD_ENDIAN_BIG; } else - internal_error (_("set_endian: bad value")); + internal_error (_ ("set_endian: bad value")); show_endian (gdb_stdout, from_tty, NULL, NULL); } @@ -485,8 +474,8 @@ choose_architecture_for_target (const struct target_desc *target_desc, if (tdesc_compatible_p (target_desc, selected)) return from_target; - warning (_("Selected architecture %s is not compatible " - "with reported target architecture %s"), + warning (_ ("Selected architecture %s is not compatible " + "with reported target architecture %s"), selected->printable_name, from_target->printable_name); return selected; } @@ -509,15 +498,19 @@ choose_architecture_for_target (const struct target_desc *target_desc, /* We have no idea which one is better. This is a bug, but not a critical problem; warn the user. */ - warning (_("Selected architecture %s is ambiguous with " - "reported target architecture %s"), + warning (_ ("Selected architecture %s is ambiguous with " + "reported target architecture %s"), selected->printable_name, from_target->printable_name); return selected; } /* Functions to manipulate the architecture of the target. */ -enum set_arch { set_arch_auto, set_arch_manual }; +enum set_arch +{ + set_arch_auto, + set_arch_manual +}; static const struct bfd_arch_info *target_architecture_user; @@ -540,21 +533,21 @@ show_architecture (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) { if (target_architecture_user == NULL) - gdb_printf (file, _("The target architecture is set to " - "\"auto\" (currently \"%s\").\n"), + gdb_printf (file, + _ ("The target architecture is set to " + "\"auto\" (currently \"%s\").\n"), gdbarch_bfd_arch_info (get_current_arch ())->printable_name); else - gdb_printf (file, _("The target architecture is set to \"%s\".\n"), + gdb_printf (file, _ ("The target architecture is set to \"%s\".\n"), set_architecture_string); } - /* Called if the user enters ``set architecture'' with or without an argument. */ static void -set_architecture (const char *ignore_args, - int from_tty, struct cmd_list_element *c) +set_architecture (const char *ignore_args, int from_tty, + struct cmd_list_element *c) { struct gdbarch_info info; @@ -562,18 +555,17 @@ set_architecture (const char *ignore_args, { target_architecture_user = NULL; if (!gdbarch_update_p (info)) - internal_error (_("could not select an architecture automatically")); + internal_error (_ ("could not select an architecture automatically")); } else { info.bfd_arch_info = bfd_scan_arch (set_architecture_string); if (info.bfd_arch_info == NULL) - internal_error (_("set_architecture: bfd_scan_arch failed")); + internal_error (_ ("set_architecture: bfd_scan_arch failed")); if (gdbarch_update_p (info)) target_architecture_user = info.bfd_arch_info; else - gdb_printf (gdb_stderr, - _("Architecture `%s' not recognized.\n"), + gdb_printf (gdb_stderr, _ ("Architecture `%s' not recognized.\n"), set_architecture_string); } show_architecture (gdb_stdout, from_tty, NULL, NULL); @@ -603,7 +595,7 @@ gdbarch_update_p (struct gdbarch_info info) { if (gdbarch_debug) gdb_printf (gdb_stdlog, "gdbarch_update_p: " - "Architecture not found\n"); + "Architecture not found\n"); return 0; } @@ -612,7 +604,8 @@ gdbarch_update_p (struct gdbarch_info info) if (new_gdbarch == target_gdbarch ()) { if (gdbarch_debug) - gdb_printf (gdb_stdlog, "gdbarch_update_p: " + gdb_printf (gdb_stdlog, + "gdbarch_update_p: " "Architecture %s (%s) unchanged\n", host_address_to_string (new_gdbarch), gdbarch_bfd_arch_info (new_gdbarch)->printable_name); @@ -621,7 +614,8 @@ gdbarch_update_p (struct gdbarch_info info) /* It's a new architecture, swap it in. */ if (gdbarch_debug) - gdb_printf (gdb_stdlog, "gdbarch_update_p: " + gdb_printf (gdb_stdlog, + "gdbarch_update_p: " "New architecture %s (%s) selected\n", host_address_to_string (new_gdbarch), gdbarch_bfd_arch_info (new_gdbarch)->printable_name); @@ -656,7 +650,7 @@ set_gdbarch_from_file (bfd *abfd) gdbarch = gdbarch_find_by_info (info); if (gdbarch == NULL) - error (_("Architecture of file not recognized.")); + error (_ ("Architecture of file not recognized.")); set_target_gdbarch (gdbarch); } @@ -688,7 +682,7 @@ void initialize_current_architecture (void) { arches = gdbarch_printable_names (); - + /* Find a default architecture. */ if (default_bfd_arch == NULL) { @@ -703,19 +697,18 @@ initialize_current_architecture (void) } if (chosen == NULL) - internal_error (_("initialize_current_architecture: No arch")); + internal_error (_ ("initialize_current_architecture: No arch")); default_bfd_arch = bfd_scan_arch (chosen); if (default_bfd_arch == NULL) - internal_error (_("initialize_current_architecture: Arch not found")); + internal_error (_ ("initialize_current_architecture: Arch not found")); } gdbarch_info info; info.bfd_arch_info = default_bfd_arch; /* Take several guesses at a byte order. */ - if (default_byte_order == BFD_ENDIAN_UNKNOWN - && default_bfd_vec != NULL) + if (default_byte_order == BFD_ENDIAN_UNKNOWN && default_bfd_vec != NULL) { /* Extract BFD's default vector's byte order. */ switch (default_bfd_vec->byteorder) @@ -735,9 +728,7 @@ initialize_current_architecture (void) /* look for ``*el-*'' in the target name. */ const char *chp; chp = strchr (target_name, '-'); - if (chp != NULL - && chp - 2 >= target_name - && startswith (chp - 2, "el")) + if (chp != NULL && chp - 2 >= target_name && startswith (chp - 2, "el")) default_byte_order = BFD_ENDIAN_LITTLE; } if (default_byte_order == BFD_ENDIAN_UNKNOWN) @@ -749,9 +740,9 @@ initialize_current_architecture (void) info.byte_order = default_byte_order; info.byte_order_for_code = info.byte_order; - if (! gdbarch_update_p (info)) - internal_error (_("initialize_current_architecture: Selection of " - "initial architecture failed")); + if (!gdbarch_update_p (info)) + internal_error (_ ("initialize_current_architecture: Selection of " + "initial architecture failed")); /* Create the ``set architecture'' command appending ``auto'' to the list of architectures. */ @@ -760,13 +751,10 @@ initialize_current_architecture (void) set_architecture_string = "auto"; arches.push_back (set_architecture_string); arches.push_back (nullptr); - set_show_commands architecture_cmds - = add_setshow_enum_cmd ("architecture", class_support, - arches.data (), &set_architecture_string, - _("Set architecture of target."), - _("Show architecture of target."), NULL, - set_architecture, show_architecture, - &setlist, &showlist); + set_show_commands architecture_cmds = add_setshow_enum_cmd ( + "architecture", class_support, arches.data (), &set_architecture_string, + _ ("Set architecture of target."), _ ("Show architecture of target."), + NULL, set_architecture, show_architecture, &setlist, &showlist); add_alias_cmd ("processor", architecture_cmds.set, class_support, 1, &setlist); } @@ -780,19 +768,17 @@ void gdbarch_info_fill (struct gdbarch_info *info) { /* "(gdb) set architecture ...". */ - if (info->bfd_arch_info == NULL - && target_architecture_user) + if (info->bfd_arch_info == NULL && target_architecture_user) info->bfd_arch_info = target_architecture_user; /* From the file. */ - if (info->bfd_arch_info == NULL - && info->abfd != NULL + if (info->bfd_arch_info == NULL && info->abfd != NULL && bfd_get_arch (info->abfd) != bfd_arch_unknown && bfd_get_arch (info->abfd) != bfd_arch_obscure) info->bfd_arch_info = bfd_get_arch_info (info->abfd); /* From the target. */ if (info->target_desc != NULL) - info->bfd_arch_info = choose_architecture_for_target - (info->target_desc, info->bfd_arch_info); + info->bfd_arch_info = choose_architecture_for_target (info->target_desc, + info->bfd_arch_info); /* From the default. */ if (info->bfd_arch_info == NULL) info->bfd_arch_info = default_bfd_arch; @@ -802,11 +788,10 @@ gdbarch_info_fill (struct gdbarch_info *info) && target_byte_order_user != BFD_ENDIAN_UNKNOWN) info->byte_order = target_byte_order_user; /* From the INFO struct. */ - if (info->byte_order == BFD_ENDIAN_UNKNOWN - && info->abfd != NULL) - info->byte_order = (bfd_big_endian (info->abfd) ? BFD_ENDIAN_BIG + if (info->byte_order == BFD_ENDIAN_UNKNOWN && info->abfd != NULL) + info->byte_order = (bfd_big_endian (info->abfd) ? BFD_ENDIAN_BIG : bfd_little_endian (info->abfd) ? BFD_ENDIAN_LITTLE - : BFD_ENDIAN_UNKNOWN); + : BFD_ENDIAN_UNKNOWN); /* From the default. */ if (info->byte_order == BFD_ENDIAN_UNKNOWN) info->byte_order = default_byte_order; @@ -822,7 +807,7 @@ gdbarch_info_fill (struct gdbarch_info *info) if (info->osabi == GDB_OSABI_UNKNOWN && info->target_desc != NULL) info->osabi = tdesc_osabi (info->target_desc); - /* From the configured default. */ + /* From the configured default. */ #ifdef GDB_OSABI_DEFAULT if (info->osabi == GDB_OSABI_UNKNOWN) info->osabi = GDB_OSABI_DEFAULT; @@ -878,6 +863,7 @@ default_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, return gdbarch_sw_breakpoint_from_kind (gdbarch, kind, lenptr); } + int default_breakpoint_kind_from_current_state (struct gdbarch *gdbarch, struct regcache *regcache, @@ -886,13 +872,11 @@ default_breakpoint_kind_from_current_state (struct gdbarch *gdbarch, return gdbarch_breakpoint_kind_from_pc (gdbarch, pcptr); } - void -default_gen_return_address (struct gdbarch *gdbarch, - struct agent_expr *ax, struct axs_value *value, - CORE_ADDR scope) +default_gen_return_address (struct gdbarch *gdbarch, struct agent_expr *ax, + struct axs_value *value, CORE_ADDR scope) { - error (_("This architecture has no method to collect a return address.")); + error (_ ("This architecture has no method to collect a return address.")); } int @@ -905,17 +889,20 @@ default_return_in_first_hidden_param_p (struct gdbarch *gdbarch, return !(language_pass_by_reference (type).trivially_copyable); } -int default_insn_is_call (struct gdbarch *gdbarch, CORE_ADDR addr) +int +default_insn_is_call (struct gdbarch *gdbarch, CORE_ADDR addr) { return 0; } -int default_insn_is_ret (struct gdbarch *gdbarch, CORE_ADDR addr) +int +default_insn_is_ret (struct gdbarch *gdbarch, CORE_ADDR addr) { return 0; } -int default_insn_is_jump (struct gdbarch *gdbarch, CORE_ADDR addr) +int +default_insn_is_jump (struct gdbarch *gdbarch, CORE_ADDR addr) { return 0; } @@ -923,11 +910,11 @@ int default_insn_is_jump (struct gdbarch *gdbarch, CORE_ADDR addr) /* See arch-utils.h. */ bool -default_program_breakpoint_here_p (struct gdbarch *gdbarch, - CORE_ADDR address) +default_program_breakpoint_here_p (struct gdbarch *gdbarch, CORE_ADDR address) { int len; - const gdb_byte *bpoint = gdbarch_breakpoint_from_pc (gdbarch, &address, &len); + const gdb_byte *bpoint + = gdbarch_breakpoint_from_pc (gdbarch, &address, &len); /* Software breakpoints unsupported? */ if (bpoint == nullptr) @@ -967,7 +954,8 @@ default_skip_permanent_breakpoint (struct regcache *regcache) CORE_ADDR default_infcall_mmap (CORE_ADDR size, unsigned prot) { - error (_("This target does not support inferior memory allocation by mmap.")); + error ( + _ ("This target does not support inferior memory allocation by mmap.")); } void @@ -983,8 +971,8 @@ std::string default_gcc_target_options (struct gdbarch *gdbarch) { return string_printf ("-m%d%s", gdbarch_ptr_bit (gdbarch), - (gdbarch_ptr_bit (gdbarch) == 64 - ? " -mcmodel=large" : "")); + (gdbarch_ptr_bit (gdbarch) == 64 ? " -mcmodel=large" + : "")); } /* gdbarch gnu_triplet_regexp method. */ @@ -1008,8 +996,7 @@ default_addressable_memory_unit_size (struct gdbarch *gdbarch) void default_guess_tracepoint_registers (struct gdbarch *gdbarch, - struct regcache *regcache, - CORE_ADDR addr) + struct regcache *regcache, CORE_ADDR addr) { int pc_regno = gdbarch_pc_regnum (gdbarch); gdb_byte *regs; @@ -1034,8 +1021,9 @@ default_print_insn (bfd_vma memaddr, disassemble_info *info) { disassembler_ftype disassemble_fn; - disassemble_fn = disassembler (info->arch, info->endian == BFD_ENDIAN_BIG, - info->mach, current_program_space->exec_bfd ()); + disassemble_fn + = disassembler (info->arch, info->endian == BFD_ENDIAN_BIG, info->mach, + current_program_space->exec_bfd ()); gdb_assert (disassemble_fn != NULL); return (*disassemble_fn) (memaddr, info); @@ -1053,7 +1041,8 @@ gdbarch_skip_prologue_noexcept (gdbarch *gdbarch, CORE_ADDR pc) noexcept new_pc = gdbarch_skip_prologue (gdbarch, pc); } catch (const gdb_exception &ex) - {} + { + } return new_pc; } @@ -1084,11 +1073,10 @@ default_get_pc_address_flags (frame_info_ptr frame, CORE_ADDR pc) /* See arch-utils.h. */ void -default_read_core_file_mappings - (struct gdbarch *gdbarch, - struct bfd *cbfd, - read_core_file_mappings_pre_loop_ftype pre_loop_cb, - read_core_file_mappings_loop_ftype loop_cb) +default_read_core_file_mappings ( + struct gdbarch *gdbarch, struct bfd *cbfd, + read_core_file_mappings_pre_loop_ftype pre_loop_cb, + read_core_file_mappings_loop_ftype loop_cb) { } @@ -1104,11 +1092,12 @@ default_get_return_buf_addr (struct type *val_type, frame_info_ptr cur_frame) #define GDBARCH_DEBUG 0 #endif unsigned int gdbarch_debug = GDBARCH_DEBUG; + static void show_gdbarch_debug (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) { - gdb_printf (file, _("Architecture debugging is %s.\n"), value); + gdb_printf (file, _ ("Architecture debugging is %s.\n"), value); } static const char * @@ -1169,10 +1158,10 @@ pstring_list (const char *const *list) #include "gdbarch.c" enum return_value_convention -default_gdbarch_return_value - (struct gdbarch *gdbarch, struct value *function, struct type *valtype, - struct regcache *regcache, struct value **read_value, - const gdb_byte *writebuf) +default_gdbarch_return_value (struct gdbarch *gdbarch, struct value *function, + struct type *valtype, struct regcache *regcache, + struct value **read_value, + const gdb_byte *writebuf) { gdb_byte *readbuf = nullptr; @@ -1182,11 +1171,12 @@ default_gdbarch_return_value readbuf = value_contents_raw (*read_value).data (); } - return gdbarch->return_value (gdbarch, function, valtype, regcache, - readbuf, writebuf); + return gdbarch->return_value (gdbarch, function, valtype, regcache, readbuf, + writebuf); } -obstack *gdbarch_obstack (gdbarch *arch) +obstack * +gdbarch_obstack (gdbarch *arch) { return &arch->obstack; } @@ -1199,7 +1189,6 @@ gdbarch_obstack_strdup (struct gdbarch *arch, const char *string) return obstack_strdup (&arch->obstack, string); } - /* Free a gdbarch struct. This should never happen in normal operation --- once you've created a gdbarch, you keep it around. However, if an architecture's init function encounters an error @@ -1251,14 +1240,13 @@ gdbarch_printable_names () architectures. */ std::vector arches; - for (gdbarch_registration *rego = gdbarch_registry; - rego != nullptr; + for (gdbarch_registration *rego = gdbarch_registry; rego != nullptr; rego = rego->next) { const struct bfd_arch_info *ap = bfd_lookup_arch (rego->bfd_architecture, 0); if (ap == nullptr) - internal_error (_("gdbarch_architecture_names: multi-arch unknown")); + internal_error (_ ("gdbarch_architecture_names: multi-arch unknown")); do { if (rego->supports_arch_info == nullptr @@ -1272,11 +1260,9 @@ gdbarch_printable_names () return arches; } - void gdbarch_register (enum bfd_architecture bfd_architecture, - gdbarch_init_ftype *init, - gdbarch_dump_tdep_ftype *dump_tdep, + gdbarch_init_ftype *init, gdbarch_dump_tdep_ftype *dump_tdep, gdbarch_supports_arch_info_ftype *supports_arch_info) { struct gdbarch_registration **curr; @@ -1286,25 +1272,22 @@ gdbarch_register (enum bfd_architecture bfd_architecture, bfd_arch_info = bfd_lookup_arch (bfd_architecture, 0); if (bfd_arch_info == NULL) { - internal_error (_("gdbarch: Attempt to register " - "unknown architecture (%d)"), + internal_error (_ ("gdbarch: Attempt to register " + "unknown architecture (%d)"), bfd_architecture); } /* Check that we haven't seen this architecture before. */ - for (curr = &gdbarch_registry; - (*curr) != NULL; - curr = &(*curr)->next) + for (curr = &gdbarch_registry; (*curr) != NULL; curr = &(*curr)->next) { if (bfd_architecture == (*curr)->bfd_architecture) - internal_error (_("gdbarch: Duplicate registration " - "of architecture (%s)"), + internal_error (_ ("gdbarch: Duplicate registration " + "of architecture (%s)"), bfd_arch_info->printable_name); } /* log it */ if (gdbarch_debug) gdb_printf (gdb_stdlog, "gdbarch_register (%s, %s)\n", - bfd_arch_info->printable_name, - host_address_to_string (init)); + bfd_arch_info->printable_name, host_address_to_string (init)); /* Append it */ (*curr) = XNEW (struct gdbarch_registration); (*curr)->bfd_architecture = bfd_architecture; @@ -1336,7 +1319,6 @@ gdbarch_list_lookup_by_info (struct gdbarch_list *arches, return NULL; } - /* Find an architecture that matches the specified INFO. Create a new architecture if needed. Return that new architecture. */ @@ -1356,36 +1338,31 @@ gdbarch_find_by_info (struct gdbarch_info info) if (gdbarch_debug) { - gdb_printf (gdb_stdlog, - "gdbarch_find_by_info: info.bfd_arch_info %s\n", + gdb_printf (gdb_stdlog, "gdbarch_find_by_info: info.bfd_arch_info %s\n", (info.bfd_arch_info != nullptr - ? info.bfd_arch_info->printable_name - : "(null)")); + ? info.bfd_arch_info->printable_name + : "(null)")); gdb_printf (gdb_stdlog, "gdbarch_find_by_info: info.byte_order %d (%s)\n", info.byte_order, - (info.byte_order == BFD_ENDIAN_BIG ? "big" + (info.byte_order == BFD_ENDIAN_BIG ? "big" : info.byte_order == BFD_ENDIAN_LITTLE ? "little" - : "default")); - gdb_printf (gdb_stdlog, - "gdbarch_find_by_info: info.osabi %d (%s)\n", + : "default")); + gdb_printf (gdb_stdlog, "gdbarch_find_by_info: info.osabi %d (%s)\n", info.osabi, gdbarch_osabi_name (info.osabi)); - gdb_printf (gdb_stdlog, - "gdbarch_find_by_info: info.abfd %s\n", + gdb_printf (gdb_stdlog, "gdbarch_find_by_info: info.abfd %s\n", host_address_to_string (info.abfd)); } /* Find the tdep code that knows about this architecture. */ - for (rego = gdbarch_registry; - rego != nullptr; - rego = rego->next) + for (rego = gdbarch_registry; rego != nullptr; rego = rego->next) if (rego->bfd_architecture == info.bfd_arch_info->arch) break; if (rego == nullptr) { if (gdbarch_debug) gdb_printf (gdb_stdlog, "gdbarch_find_by_info: " - "No matching architecture\n"); + "No matching architecture\n"); return nullptr; } @@ -1398,7 +1375,7 @@ gdbarch_find_by_info (struct gdbarch_info info) { if (gdbarch_debug) gdb_printf (gdb_stdlog, "gdbarch_find_by_info: " - "Target rejected architecture\n"); + "Target rejected architecture\n"); return nullptr; } @@ -1410,14 +1387,16 @@ gdbarch_find_by_info (struct gdbarch_info info) struct gdbarch_list **list; struct gdbarch_list *self; if (gdbarch_debug) - gdb_printf (gdb_stdlog, "gdbarch_find_by_info: " + gdb_printf (gdb_stdlog, + "gdbarch_find_by_info: " "Previous architecture %s (%s) selected\n", host_address_to_string (new_gdbarch), new_gdbarch->bfd_arch_info->printable_name); /* Find the existing arch in the list. */ for (list = ®o->arches; (*list) != nullptr && (*list)->gdbarch != new_gdbarch; - list = &(*list)->next); + list = &(*list)->next) + ; /* It had better be in the list of architectures. */ gdb_assert ((*list) != nullptr && (*list)->gdbarch == new_gdbarch); /* Unlink SELF. */ @@ -1432,7 +1411,8 @@ gdbarch_find_by_info (struct gdbarch_info info) /* It's a new architecture. */ if (gdbarch_debug) - gdb_printf (gdb_stdlog, "gdbarch_find_by_info: " + gdb_printf (gdb_stdlog, + "gdbarch_find_by_info: " "New architecture %s (%s) selected\n", host_address_to_string (new_gdbarch), new_gdbarch->bfd_arch_info->printable_name); @@ -1479,20 +1459,20 @@ target_gdbarch (void) } void _initialize_gdbarch_utils (); + void _initialize_gdbarch_utils () { - add_setshow_enum_cmd ("endian", class_support, - endian_enum, &set_endian_string, - _("Set endianness of target."), - _("Show endianness of target."), - NULL, set_endian, show_endian, - &setlist, &showlist); - add_setshow_zuinteger_cmd ("arch", class_maintenance, &gdbarch_debug, _("\ -Set architecture debugging."), _("\ -Show architecture debugging."), _("\ + add_setshow_enum_cmd ("endian", class_support, endian_enum, + &set_endian_string, _ ("Set endianness of target."), + _ ("Show endianness of target."), NULL, set_endian, + show_endian, &setlist, &showlist); + add_setshow_zuinteger_cmd ("arch", class_maintenance, &gdbarch_debug, _ ("\ +Set architecture debugging."), + _ ("\ +Show architecture debugging."), + _ ("\ When non-zero, architecture debugging is enabled."), - NULL, - show_gdbarch_debug, - &setdebuglist, &showdebuglist); + NULL, show_gdbarch_debug, &setdebuglist, + &showdebuglist); } diff --git a/gdb/arch-utils.h b/gdb/arch-utils.h index 56690f0..fef1979 100644 --- a/gdb/arch-utils.h +++ b/gdb/arch-utils.h @@ -28,36 +28,33 @@ struct type; struct gdbarch_info; struct dwarf2_frame_state; -template +template struct bp_manipulation { - static int - kind_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr) + static int kind_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr) { return bp_size; } - static const gdb_byte * - bp_from_kind (struct gdbarch *gdbarch, int kind, int *size) + static const gdb_byte *bp_from_kind (struct gdbarch *gdbarch, int kind, + int *size) { *size = kind; return break_insn; } }; -template +template struct bp_manipulation_endian { - static int - kind_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr) + static int kind_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr) { return bp_size; } - static const gdb_byte * - bp_from_kind (struct gdbarch *gdbarch, int kind, int *size) + static const gdb_byte *bp_from_kind (struct gdbarch *gdbarch, int kind, + int *size) { *size = kind; if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG) @@ -70,9 +67,9 @@ struct bp_manipulation_endian #define BP_MANIPULATION(BREAK_INSN) \ bp_manipulation -#define BP_MANIPULATION_ENDIAN(BREAK_INSN_LITTLE, BREAK_INSN_BIG) \ - bp_manipulation_endian +#define BP_MANIPULATION_ENDIAN(BREAK_INSN_LITTLE, BREAK_INSN_BIG) \ + bp_manipulation_endian /* Default implementation of gdbarch_displaced_hw_singlestep. */ extern bool default_displaced_step_hw_singlestep (struct gdbarch *); @@ -89,7 +86,8 @@ extern int core_addr_greaterthan (CORE_ADDR lhs, CORE_ADDR rhs); /* Identity functions on a CORE_ADDR. Just return the "addr". */ extern CORE_ADDR core_addr_identity (struct gdbarch *gdbarch, CORE_ADDR addr); -extern gdbarch_convert_from_func_ptr_addr_ftype convert_from_func_ptr_addr_identity; +extern gdbarch_convert_from_func_ptr_addr_ftype + convert_from_func_ptr_addr_identity; /* No-op conversion of reg to regnum. */ @@ -129,8 +127,8 @@ extern gdbarch_virtual_frame_pointer_ftype legacy_virtual_frame_pointer; /* Default implementation of gdbarch_floatformat_for_type. */ extern const struct floatformat ** - default_floatformat_for_type (struct gdbarch *gdbarch, - const char *name, int len); +default_floatformat_for_type (struct gdbarch *gdbarch, const char *name, + int len); /* Default implementation of gdbarch_remove_non_address_bits. */ CORE_ADDR default_remove_non_address_bits (struct gdbarch *gdbarch, @@ -145,18 +143,16 @@ bool default_tagged_address_p (struct gdbarch *gdbarch, struct value *address); /* Default implementation of gdbarch_memtag_matches_p. */ extern bool default_memtag_matches_p (struct gdbarch *gdbarch, - struct value *address); + struct value *address); /* Default implementation of gdbarch_set_memtags. */ -bool default_set_memtags (struct gdbarch *gdbarch, - struct value *address, size_t length, - const gdb::byte_vector &tags, +bool default_set_memtags (struct gdbarch *gdbarch, struct value *address, + size_t length, const gdb::byte_vector &tags, memtag_type tag_type); /* Default implementation of gdbarch_get_memtag. */ struct value *default_get_memtag (struct gdbarch *gdbarch, - struct value *address, - memtag_type tag_type); + struct value *address, memtag_type tag_type); extern CORE_ADDR generic_skip_trampoline_code (frame_info_ptr frame, CORE_ADDR pc); @@ -183,8 +179,7 @@ extern int default_stabs_argument_has_addr (struct gdbarch *gdbarch, extern int generic_instruction_nullified (struct gdbarch *gdbarch, struct regcache *regcache); -int default_remote_register_number (struct gdbarch *gdbarch, - int regno); +int default_remote_register_number (struct gdbarch *gdbarch, int regno); /* For compatibility with older architectures, returns (LEGACY_SIM_REGNO_IGNORE) when the register doesn't have a valid @@ -227,9 +222,8 @@ extern const gdb_byte *default_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr); -extern int default_breakpoint_kind_from_current_state (struct gdbarch *gdbarch, - struct regcache *regcache, - CORE_ADDR *pcptr); +extern int default_breakpoint_kind_from_current_state ( + struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR *pcptr); extern void default_gen_return_address (struct gdbarch *gdbarch, struct agent_expr *ax, @@ -252,7 +246,8 @@ extern bool default_program_breakpoint_here_p (struct gdbarch *gdbarch, /* Do-nothing version of vsyscall_range. Returns false. */ -extern int default_vsyscall_range (struct gdbarch *gdbarch, struct mem_range *range); +extern int default_vsyscall_range (struct gdbarch *gdbarch, + struct mem_range *range); /* Default way to advance the PC to the next instruction in order to skip a permanent breakpoint. Increments the PC by the size of a @@ -263,9 +258,9 @@ extern void default_skip_permanent_breakpoint (struct regcache *regcache); /* Symbols for gdbarch_infcall_mmap; their Linux PROT_* system definitions would be dependent on compilation host. */ -#define GDB_MMAP_PROT_READ 0x1 /* Page can be read. */ -#define GDB_MMAP_PROT_WRITE 0x2 /* Page can be written. */ -#define GDB_MMAP_PROT_EXEC 0x4 /* Page can be executed. */ +#define GDB_MMAP_PROT_READ 0x1 /* Page can be read. */ +#define GDB_MMAP_PROT_WRITE 0x2 /* Page can be written. */ +#define GDB_MMAP_PROT_EXEC 0x4 /* Page can be executed. */ extern CORE_ADDR default_infcall_mmap (CORE_ADDR size, unsigned prot); extern void default_infcall_munmap (CORE_ADDR addr, CORE_ADDR size); @@ -287,8 +282,7 @@ extern CORE_ADDR gdbarch_skip_prologue_noexcept (gdbarch *gdbarch, /* Default implementation of gdbarch_in_indirect_branch_thunk that returns false. */ -extern bool default_in_indirect_branch_thunk (gdbarch *gdbarch, - CORE_ADDR pc); +extern bool default_in_indirect_branch_thunk (gdbarch *gdbarch, CORE_ADDR pc); /* Default implementation of gdbarch type_align method. */ extern ULONGEST default_type_align (struct gdbarch *gdbarch, @@ -299,19 +293,19 @@ extern std::string default_get_pc_address_flags (frame_info_ptr frame, CORE_ADDR pc); /* Default implementation of gdbarch read_core_file_mappings method. */ -extern void default_read_core_file_mappings - (struct gdbarch *gdbarch, - struct bfd *cbfd, - read_core_file_mappings_pre_loop_ftype pre_loop_cb, - read_core_file_mappings_loop_ftype loop_cb); +extern void default_read_core_file_mappings ( + struct gdbarch *gdbarch, struct bfd *cbfd, + read_core_file_mappings_pre_loop_ftype pre_loop_cb, + read_core_file_mappings_loop_ftype loop_cb); /* Default implementation of gdbarch default_get_return_buf_addr method. */ extern CORE_ADDR default_get_return_buf_addr (struct type *val_typegdbarch, frame_info_ptr cur_frame); -extern enum return_value_convention default_gdbarch_return_value - (struct gdbarch *gdbarch, struct value *function, struct type *valtype, - struct regcache *regcache, struct value **read_value, - const gdb_byte *writebuf); +extern enum return_value_convention +default_gdbarch_return_value (struct gdbarch *gdbarch, struct value *function, + struct type *valtype, struct regcache *regcache, + struct value **read_value, + const gdb_byte *writebuf); #endif /* ARCH_UTILS_H */ diff --git a/gdb/arch/aarch64-insn.c b/gdb/arch/aarch64-insn.c index 54874df..016f9d6 100644 --- a/gdb/arch/aarch64-insn.c +++ b/gdb/arch/aarch64-insn.c @@ -47,8 +47,8 @@ decode_masked_match (uint32_t insn, uint32_t mask, uint32_t pattern) Return 1 if the opcodes matches and is decoded, otherwise 0. */ int -aarch64_decode_adr (CORE_ADDR addr, uint32_t insn, int *is_adrp, - unsigned *rd, int32_t *offset) +aarch64_decode_adr (CORE_ADDR addr, uint32_t insn, int *is_adrp, unsigned *rd, + int32_t *offset) { /* adr 0ii1 0000 iiii iiii iiii iiii iiir rrrr */ /* adrp 1ii1 0000 iiii iiii iiii iiii iiir rrrr */ @@ -71,7 +71,7 @@ aarch64_decode_adr (CORE_ADDR addr, uint32_t insn, int *is_adrp, aarch64_debug_printf ("decode: 0x%s 0x%x %s x%u, #?", core_addr_to_string_nz (addr), insn, - *is_adrp ? "adrp" : "adr", *rd); + *is_adrp ? "adrp" : "adr", *rd); return 1; } return 0; @@ -88,8 +88,7 @@ aarch64_decode_adr (CORE_ADDR addr, uint32_t insn, int *is_adrp, Return 1 if the opcodes matches and is decoded, otherwise 0. */ int -aarch64_decode_b (CORE_ADDR addr, uint32_t insn, int *is_bl, - int32_t *offset) +aarch64_decode_b (CORE_ADDR addr, uint32_t insn, int *is_bl, int32_t *offset) { /* b 0001 01ii iiii iiii iiii iiii iiii iiii */ /* bl 1001 01ii iiii iiii iiii iiii iiii iiii */ @@ -190,8 +189,8 @@ aarch64_decode_cb (CORE_ADDR addr, uint32_t insn, int *is64, int *is_cbnz, Return 1 if the opcodes matches and is decoded, otherwise 0. */ int -aarch64_decode_tb (CORE_ADDR addr, uint32_t insn, int *is_tbnz, - unsigned *bit, unsigned *rt, int32_t *imm) +aarch64_decode_tb (CORE_ADDR addr, uint32_t insn, int *is_tbnz, unsigned *bit, + unsigned *rt, int32_t *imm) { /* tbz b011 0110 bbbb biii iiii iiii iiir rrrr */ /* tbnz B011 0111 bbbb biii iiii iiii iiir rrrr */ @@ -250,8 +249,7 @@ aarch64_decode_ldr_literal (CORE_ADDR addr, uint32_t insn, int *is_w, if (aarch64_debug) debug_printf ("decode: %s 0x%x %s %s%u, #?\n", core_addr_to_string_nz (addr), insn, - *is_w ? "ldrsw" : "ldr", - *is64 ? "x" : "w", *rt); + *is_w ? "ldrsw" : "ldr", *is64 ? "x" : "w", *rt); return 1; } @@ -335,9 +333,9 @@ aarch64_emit_load_store (uint32_t *buf, uint32_t size, op = ENCODE (1, 1, 24); return aarch64_emit_insn (buf, opcode | ENCODE (size, 2, 30) | op - | ENCODE (operand.index >> 3, 12, 10) - | ENCODE (rn.num, 5, 5) - | ENCODE (rt.num, 5, 0)); + | ENCODE (operand.index >> 3, 12, 10) + | ENCODE (rn.num, 5, 5) + | ENCODE (rt.num, 5, 0)); } case MEMORY_OPERAND_POSTINDEX: { @@ -346,9 +344,10 @@ aarch64_emit_load_store (uint32_t *buf, uint32_t size, op = ENCODE (0, 1, 24); return aarch64_emit_insn (buf, opcode | ENCODE (size, 2, 30) | op - | post_index | ENCODE (operand.index, 9, 12) - | ENCODE (rn.num, 5, 5) - | ENCODE (rt.num, 5, 0)); + | post_index + | ENCODE (operand.index, 9, 12) + | ENCODE (rn.num, 5, 5) + | ENCODE (rt.num, 5, 0)); } case MEMORY_OPERAND_PREINDEX: { @@ -357,9 +356,10 @@ aarch64_emit_load_store (uint32_t *buf, uint32_t size, op = ENCODE (0, 1, 24); return aarch64_emit_insn (buf, opcode | ENCODE (size, 2, 30) | op - | pre_index | ENCODE (operand.index, 9, 12) - | ENCODE (rn.num, 5, 5) - | ENCODE (rt.num, 5, 0)); + | pre_index + | ENCODE (operand.index, 9, 12) + | ENCODE (rn.num, 5, 5) + | ENCODE (rt.num, 5, 0)); } default: return 0; diff --git a/gdb/arch/aarch64-insn.h b/gdb/arch/aarch64-insn.h index 7560da9..e80bcfd 100644 --- a/gdb/arch/aarch64-insn.h +++ b/gdb/arch/aarch64-insn.h @@ -32,15 +32,15 @@ extern bool aarch64_debug; #define submask(x) ((1L << ((x) + 1)) - 1) /* Extract the bitfield from OBJ starting at bit ST and ending at bit FN. */ -#define bits(obj,st,fn) (((obj) >> (st)) & submask ((fn) - (st))) +#define bits(obj, st, fn) (((obj) >> (st)) & submask ((fn) - (st))) /* Extract bit ST from OBJ. */ -#define bit(obj,st) (((obj) >> (st)) & 1) +#define bit(obj, st) (((obj) >> (st)) & 1) /* Extract the signed bitfield from OBJ starting at bit ST and ending at bit FN. The result is sign-extended. */ -#define sbits(obj,st,fn) \ - ((long) (bits(obj,st,fn) | ((long) bit(obj,fn) * ~ submask (fn - st)))) +#define sbits(obj, st, fn) \ + ((long) (bits (obj, st, fn) | ((long) bit (obj, fn) * ~submask (fn - st)))) /* Prologue analyzer helper macros. */ @@ -59,80 +59,80 @@ enum aarch64_opcodes /* CBNZ s011 0101 iiii iiii iiii iiii iiir rrrr */ /* TBZ b011 0110 bbbb biii iiii iiii iiir rrrr */ /* TBNZ b011 0111 bbbb biii iiii iiii iiir rrrr */ - B = 0x14000000, - BL = 0x80000000 | B, - BCOND = 0x40000000 | B, - CBZ = 0x20000000 | B, - CBNZ = 0x21000000 | B, - TBZ = 0x36000000 | B, - TBNZ = 0x37000000 | B, + B = 0x14000000, + BL = 0x80000000 | B, + BCOND = 0x40000000 | B, + CBZ = 0x20000000 | B, + CBNZ = 0x21000000 | B, + TBZ = 0x36000000 | B, + TBNZ = 0x37000000 | B, /* BR 1101 0110 0001 1111 0000 00rr rrr0 0000 */ /* BLR 1101 0110 0011 1111 0000 00rr rrr0 0000 */ - BR = 0xd61f0000, - BLR = 0xd63f0000, + BR = 0xd61f0000, + BLR = 0xd63f0000, /* RET 1101 0110 0101 1111 0000 00rr rrr0 0000 */ - RET = 0xd65f0000, + RET = 0xd65f0000, /* STP s010 100o o0ii iiii irrr rrrr rrrr rrrr */ /* LDP s010 100o o1ii iiii irrr rrrr rrrr rrrr */ /* STP (SIMD&VFP) ss10 110o o0ii iiii irrr rrrr rrrr rrrr */ /* LDP (SIMD&VFP) ss10 110o o1ii iiii irrr rrrr rrrr rrrr */ - STP = 0x28000000, - LDP = 0x28400000, - STP_SIMD_VFP = 0x04000000 | STP, - LDP_SIMD_VFP = 0x04000000 | LDP, + STP = 0x28000000, + LDP = 0x28400000, + STP_SIMD_VFP = 0x04000000 | STP, + LDP_SIMD_VFP = 0x04000000 | LDP, /* STR ss11 100o 00xi iiii iiii xxrr rrrr rrrr */ /* LDR ss11 100o 01xi iiii iiii xxrr rrrr rrrr */ /* LDRSW 1011 100o 10xi iiii iiii xxrr rrrr rrrr */ - STR = 0x38000000, - LDR = 0x00400000 | STR, - LDRSW = 0x80800000 | STR, + STR = 0x38000000, + LDR = 0x00400000 | STR, + LDRSW = 0x80800000 | STR, /* LDAXR ss00 1000 0101 1111 1111 11rr rrrr rrrr */ - LDAXR = 0x085ffc00, + LDAXR = 0x085ffc00, /* STXR ss00 1000 000r rrrr 0111 11rr rrrr rrrr */ - STXR = 0x08007c00, + STXR = 0x08007c00, /* STLR ss00 1000 1001 1111 1111 11rr rrrr rrrr */ - STLR = 0x089ffc00, + STLR = 0x089ffc00, /* MOV s101 0010 1xxi iiii iiii iiii iiir rrrr */ /* MOVK s111 0010 1xxi iiii iiii iiii iiir rrrr */ - MOV = 0x52800000, - MOVK = 0x20000000 | MOV, + MOV = 0x52800000, + MOVK = 0x20000000 | MOV, /* ADD s00o ooo1 xxxx xxxx xxxx xxxx xxxx xxxx */ /* SUB s10o ooo1 xxxx xxxx xxxx xxxx xxxx xxxx */ /* SUBS s11o ooo1 xxxx xxxx xxxx xxxx xxxx xxxx */ - ADD = 0x01000000, - SUB = 0x40000000 | ADD, - SUBS = 0x20000000 | SUB, + ADD = 0x01000000, + SUB = 0x40000000 | ADD, + SUBS = 0x20000000 | SUB, /* AND s000 1010 xx0x xxxx xxxx xxxx xxxx xxxx */ /* ORR s010 1010 xx0x xxxx xxxx xxxx xxxx xxxx */ /* ORN s010 1010 xx1x xxxx xxxx xxxx xxxx xxxx */ /* EOR s100 1010 xx0x xxxx xxxx xxxx xxxx xxxx */ - AND = 0x0a000000, - ORR = 0x20000000 | AND, - ORN = 0x00200000 | ORR, - EOR = 0x40000000 | AND, + AND = 0x0a000000, + ORR = 0x20000000 | AND, + ORN = 0x00200000 | ORR, + EOR = 0x40000000 | AND, /* LSLV s001 1010 110r rrrr 0010 00rr rrrr rrrr */ /* LSRV s001 1010 110r rrrr 0010 01rr rrrr rrrr */ /* ASRV s001 1010 110r rrrr 0010 10rr rrrr rrrr */ - LSLV = 0x1ac02000, - LSRV = 0x00000400 | LSLV, - ASRV = 0x00000800 | LSLV, + LSLV = 0x1ac02000, + LSRV = 0x00000400 | LSLV, + ASRV = 0x00000800 | LSLV, /* SBFM s001 0011 0nii iiii iiii iirr rrrr rrrr */ - SBFM = 0x13000000, + SBFM = 0x13000000, /* UBFM s101 0011 0nii iiii iiii iirr rrrr rrrr */ - UBFM = 0x40000000 | SBFM, + UBFM = 0x40000000 | SBFM, /* CSINC s001 1010 100r rrrr cccc 01rr rrrr rrrr */ - CSINC = 0x9a800400, + CSINC = 0x9a800400, /* MUL s001 1011 000r rrrr 0111 11rr rrrr rrrr */ - MUL = 0x1b007c00, + MUL = 0x1b007c00, /* MSR (register) 1101 0101 0001 oooo oooo oooo ooor rrrr */ /* MRS 1101 0101 0011 oooo oooo oooo ooor rrrr */ - MSR = 0xd5100000, - MRS = 0x00200000 | MSR, + MSR = 0xd5100000, + MRS = 0x00200000 | MSR, /* HINT 1101 0101 0000 0011 0010 oooo ooo1 1111 */ - HINT = 0xd503201f, - SEVL = (5 << 5) | HINT, - WFE = (2 << 5) | HINT, - NOP = (0 << 5) | HINT, + HINT = 0xd503201f, + SEVL = (5 << 5) | HINT, + WFE = (2 << 5) | HINT, + NOP = (0 << 5) | HINT, }; /* List of useful masks. */ @@ -191,8 +191,8 @@ int aarch64_decode_b (CORE_ADDR addr, uint32_t insn, int *is_bl, int aarch64_decode_bcond (CORE_ADDR addr, uint32_t insn, unsigned *cond, int32_t *offset); -int aarch64_decode_cb (CORE_ADDR addr, uint32_t insn, int *is64, - int *is_cbnz, unsigned *rn, int32_t *offset); +int aarch64_decode_cb (CORE_ADDR addr, uint32_t insn, int *is64, int *is_cbnz, + unsigned *rn, int32_t *offset); int aarch64_decode_tb (CORE_ADDR addr, uint32_t insn, int *is_tbnz, unsigned *bit, unsigned *rt, int32_t *imm); @@ -221,18 +221,16 @@ struct aarch64_insn_visitor struct aarch64_insn_data *data); /* Visit instruction CBZ/CBNZ Rn, OFFSET. */ - void (*cb) (const int32_t offset, const int is_cbnz, - const unsigned rn, int is64, - struct aarch64_insn_data *data); + void (*cb) (const int32_t offset, const int is_cbnz, const unsigned rn, + int is64, struct aarch64_insn_data *data); /* Visit instruction TBZ/TBNZ Rt, #BIT, OFFSET. */ - void (*tb) (const int32_t offset, int is_tbnz, - const unsigned rt, unsigned bit, - struct aarch64_insn_data *data); + void (*tb) (const int32_t offset, int is_tbnz, const unsigned rt, + unsigned bit, struct aarch64_insn_data *data); /* Visit instruction ADR/ADRP Rd, OFFSET. */ - void (*adr) (const int32_t offset, const unsigned rd, - const int is_adrp, struct aarch64_insn_data *data); + void (*adr) (const int32_t offset, const unsigned rd, const int is_adrp, + struct aarch64_insn_data *data); /* Visit instruction LDR/LDRSW Rt, OFFSET. */ void (*ldr_literal) (const int32_t offset, const int is_sw, @@ -247,7 +245,7 @@ void aarch64_relocate_instruction (uint32_t insn, const struct aarch64_insn_visitor *visitor, struct aarch64_insn_data *data); -#define can_encode_int32(val, bits) \ +#define can_encode_int32(val, bits) \ (((val) >> (bits)) == 0 || ((val) >> (bits)) == -1) /* Write a B or BL instruction into *BUF. @@ -272,10 +270,9 @@ void aarch64_relocate_instruction (uint32_t insn, byte-addressed but should be 4 bytes aligned. It has a limited range of +/- 1MB (19 bits << 2). */ -#define emit_bcond(buf, cond, offset) \ - aarch64_emit_insn (buf, \ - BCOND | ENCODE ((offset) >> 2, 19, 5) \ - | ENCODE ((cond), 4, 0)) +#define emit_bcond(buf, cond, offset) \ + aarch64_emit_insn (buf, BCOND | ENCODE ((offset) >> 2, 19, 5) \ + | ENCODE ((cond), 4, 0)) /* Write a CBZ or CBNZ instruction into *BUF. @@ -288,12 +285,11 @@ void aarch64_relocate_instruction (uint32_t insn, byte-addressed but should be 4 bytes aligned. It has a limited range of +/- 1MB (19 bits << 2). */ -#define emit_cb(buf, is_cbnz, rt, offset) \ - aarch64_emit_insn (buf, \ - ((is_cbnz) ? CBNZ : CBZ) \ - | ENCODE (rt.is64, 1, 31) /* sf */ \ - | ENCODE (offset >> 2, 19, 5) /* imm19 */ \ - | ENCODE (rt.num, 5, 0)) +#define emit_cb(buf, is_cbnz, rt, offset) \ + aarch64_emit_insn (buf, ((is_cbnz) ? CBNZ : CBZ) \ + | ENCODE (rt.is64, 1, 31) /* sf */ \ + | ENCODE (offset >> 2, 19, 5) /* imm19 */ \ + | ENCODE (rt.num, 5, 0)) /* Write a LDR instruction into *BUF. @@ -320,10 +316,9 @@ void aarch64_relocate_instruction (uint32_t insn, OFFSET is the immediate to add to the base address. It is limited to 0 .. 16380 range (12 bits << 2). */ -#define emit_ldrsw(buf, rt, rn, operand) \ +#define emit_ldrsw(buf, rt, rn, operand) \ aarch64_emit_load_store (buf, 3, LDRSW, rt, rn, operand) - /* Write a TBZ or TBNZ instruction into *BUF. TBZ rt, #bit, #offset @@ -336,13 +331,12 @@ void aarch64_relocate_instruction (uint32_t insn, byte-addressed but should be 4 bytes aligned. It has a limited range of +/- 32KB (14 bits << 2). */ -#define emit_tb(buf, is_tbnz, bit, rt, offset) \ - aarch64_emit_insn (buf, \ - ((is_tbnz) ? TBNZ: TBZ) \ - | ENCODE (bit >> 5, 1, 31) /* b5 */ \ - | ENCODE (bit, 5, 19) /* b40 */ \ - | ENCODE (offset >> 2, 14, 5) /* imm14 */ \ - | ENCODE (rt.num, 5, 0)) +#define emit_tb(buf, is_tbnz, bit, rt, offset) \ + aarch64_emit_insn (buf, ((is_tbnz) ? TBNZ : TBZ) \ + | ENCODE (bit >> 5, 1, 31) /* b5 */ \ + | ENCODE (bit, 5, 19) /* b40 */ \ + | ENCODE (offset >> 2, 14, 5) /* imm14 */ \ + | ENCODE (rt.num, 5, 0)) /* Write a NOP instruction into *BUF. */ diff --git a/gdb/arch/aarch64-mte-linux.h b/gdb/arch/aarch64-mte-linux.h index e862b0b..38a2dbc 100644 --- a/gdb/arch/aarch64-mte-linux.h +++ b/gdb/arch/aarch64-mte-linux.h @@ -24,7 +24,7 @@ /* Feature check for Memory Tagging Extension. */ #ifndef HWCAP2_MTE -#define HWCAP2_MTE (1 << 18) +#define HWCAP2_MTE (1 << 18) #endif /* The MTE regset consists of a single 64-bit register. */ @@ -38,8 +38,8 @@ /* Memory tagging definitions. */ #ifndef SEGV_MTEAERR -# define SEGV_MTEAERR 8 -# define SEGV_MTESERR 9 +#define SEGV_MTEAERR 8 +#define SEGV_MTESERR 9 #endif /* Memory tag types for AArch64. */ diff --git a/gdb/arch/aarch64.h b/gdb/arch/aarch64.h index de4461e..8dc767b 100644 --- a/gdb/arch/aarch64.h +++ b/gdb/arch/aarch64.h @@ -38,38 +38,37 @@ struct aarch64_features uint8_t tls = 0; }; -inline bool operator==(const aarch64_features &lhs, const aarch64_features &rhs) +inline bool +operator== (const aarch64_features &lhs, const aarch64_features &rhs) { - return lhs.vq == rhs.vq - && lhs.pauth == rhs.pauth - && lhs.mte == rhs.mte - && lhs.tls == rhs.tls; + return lhs.vq == rhs.vq && lhs.pauth == rhs.pauth && lhs.mte == rhs.mte + && lhs.tls == rhs.tls; } namespace std { - template<> - struct hash +template<> +struct hash +{ + std::size_t operator() (const aarch64_features &features) const noexcept { - std::size_t operator()(const aarch64_features &features) const noexcept - { - std::size_t h; - - h = features.vq; - h = h << 1 | features.pauth; - h = h << 1 | features.mte; - /* Shift by two bits for now. We may need to increase this in the future + std::size_t h; + + h = features.vq; + h = h << 1 | features.pauth; + h = h << 1 | features.mte; + /* Shift by two bits for now. We may need to increase this in the future if more TLS registers get added. */ - h = h << 2 | features.tls; - return h; - } - }; -} + h = h << 2 | features.tls; + return h; + } +}; +} // namespace std /* Create the aarch64 target description. */ target_desc * - aarch64_create_target_description (const aarch64_features &features); +aarch64_create_target_description (const aarch64_features &features); /* Given a pointer value POINTER and a MASK of non-address bits, remove the non-address bits from the pointer and sign-extend the result if required. @@ -87,23 +86,23 @@ aarch64_mask_from_pac_registers (const CORE_ADDR cmask, const CORE_ADDR dmask); registers become pseudo registers. */ enum aarch64_regnum { - AARCH64_X0_REGNUM, /* First integer register. */ - AARCH64_FP_REGNUM = AARCH64_X0_REGNUM + 29, /* Frame register, if used. */ - AARCH64_LR_REGNUM = AARCH64_X0_REGNUM + 30, /* Return address. */ - AARCH64_SP_REGNUM, /* Stack pointer. */ - AARCH64_PC_REGNUM, /* Program counter. */ - AARCH64_CPSR_REGNUM, /* Current Program Status Register. */ - AARCH64_V0_REGNUM, /* First fp/vec register. */ - AARCH64_V31_REGNUM = AARCH64_V0_REGNUM + 31, /* Last fp/vec register. */ - AARCH64_SVE_Z0_REGNUM = AARCH64_V0_REGNUM, /* First SVE Z register. */ - AARCH64_SVE_Z31_REGNUM = AARCH64_V31_REGNUM, /* Last SVE Z register. */ - AARCH64_FPSR_REGNUM, /* Floating Point Status Register. */ - AARCH64_FPCR_REGNUM, /* Floating Point Control Register. */ - AARCH64_SVE_P0_REGNUM, /* First SVE predicate register. */ - AARCH64_SVE_P15_REGNUM = AARCH64_SVE_P0_REGNUM + 15, /* Last SVE predicate + AARCH64_X0_REGNUM, /* First integer register. */ + AARCH64_FP_REGNUM = AARCH64_X0_REGNUM + 29, /* Frame register, if used. */ + AARCH64_LR_REGNUM = AARCH64_X0_REGNUM + 30, /* Return address. */ + AARCH64_SP_REGNUM, /* Stack pointer. */ + AARCH64_PC_REGNUM, /* Program counter. */ + AARCH64_CPSR_REGNUM, /* Current Program Status Register. */ + AARCH64_V0_REGNUM, /* First fp/vec register. */ + AARCH64_V31_REGNUM = AARCH64_V0_REGNUM + 31, /* Last fp/vec register. */ + AARCH64_SVE_Z0_REGNUM = AARCH64_V0_REGNUM, /* First SVE Z register. */ + AARCH64_SVE_Z31_REGNUM = AARCH64_V31_REGNUM, /* Last SVE Z register. */ + AARCH64_FPSR_REGNUM, /* Floating Point Status Register. */ + AARCH64_FPCR_REGNUM, /* Floating Point Control Register. */ + AARCH64_SVE_P0_REGNUM, /* First SVE predicate register. */ + AARCH64_SVE_P15_REGNUM = AARCH64_SVE_P0_REGNUM + 15, /* Last SVE predicate register. */ - AARCH64_SVE_FFR_REGNUM, /* SVE First Fault Register. */ - AARCH64_SVE_VG_REGNUM, /* SVE Vector Granule. */ + AARCH64_SVE_FFR_REGNUM, /* SVE First Fault Register. */ + AARCH64_SVE_VG_REGNUM, /* SVE Vector Granule. */ /* Other useful registers. */ AARCH64_LAST_X_ARG_REGNUM = AARCH64_X0_REGNUM + 7, @@ -113,14 +112,14 @@ enum aarch64_regnum /* Sizes of various AArch64 registers. */ #define AARCH64_TLS_REGISTER_SIZE 8 -#define V_REGISTER_SIZE 16 +#define V_REGISTER_SIZE 16 /* PAC-related constants. */ /* Bit 55 is used to select between a kernel-space and user-space address. */ -#define VA_RANGE_SELECT_BIT_MASK 0x80000000000000ULL +#define VA_RANGE_SELECT_BIT_MASK 0x80000000000000ULL /* Mask with 1's in bits 55~63, used to remove the top byte of pointers (Top Byte Ignore). */ -#define AARCH64_TOP_BITS_MASK 0xff80000000000000ULL +#define AARCH64_TOP_BITS_MASK 0xff80000000000000ULL /* Pseudo register base numbers. */ #define AARCH64_Q0_REGNUM 0 @@ -150,19 +149,18 @@ enum aarch64_regnum VG : Vector Granule. The number of 64bit chunks in an SVE Z register. */ -#define sve_vg_from_vl(vl) ((vl) / 8) -#define sve_vl_from_vg(vg) ((vg) * 8) +#define sve_vg_from_vl(vl) ((vl) / 8) +#define sve_vl_from_vg(vg) ((vg) *8) #ifndef sve_vq_from_vl -#define sve_vq_from_vl(vl) ((vl) / 0x10) +#define sve_vq_from_vl(vl) ((vl) / 0x10) #endif #ifndef sve_vl_from_vq -#define sve_vl_from_vq(vq) ((vq) * 0x10) +#define sve_vl_from_vq(vq) ((vq) *0x10) #endif -#define sve_vq_from_vg(vg) (sve_vq_from_vl (sve_vl_from_vg (vg))) -#define sve_vg_from_vq(vq) (sve_vg_from_vl (sve_vl_from_vq (vq))) - +#define sve_vq_from_vg(vg) (sve_vq_from_vl (sve_vl_from_vg (vg))) +#define sve_vg_from_vq(vq) (sve_vg_from_vl (sve_vl_from_vq (vq))) /* Maximum supported VQ value. Increase if required. */ -#define AARCH64_MAX_SVE_VQ 16 +#define AARCH64_MAX_SVE_VQ 16 #endif /* ARCH_AARCH64_H */ diff --git a/gdb/arch/arc.c b/gdb/arch/arc.c index 56e46d0..cc2c991 100644 --- a/gdb/arch/arc.c +++ b/gdb/arch/arc.c @@ -15,7 +15,6 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ - #include "gdbsupport/common-defs.h" #include "arc.h" #include @@ -46,14 +45,14 @@ arc_create_target_description (const struct arc_arch_features &features) /* Architecture names here must match the ones in ARCH_INFO_STRUCT in bfd/cpu-arc.c. */ if (features.isa == ARC_ISA_ARCV1 && features.reg_size == 4) - arch_name = "arc:ARC700"; + arch_name = "arc:ARC700"; else if (features.isa == ARC_ISA_ARCV2 && features.reg_size == 4) - arch_name = "arc:ARCv2"; + arch_name = "arc:ARCv2"; else { - std::string msg = string_printf - ("Cannot determine architecture: ISA=%d; bitness=%d", - features.isa, 8 * features.reg_size); + std::string msg + = string_printf ("Cannot determine architecture: ISA=%d; bitness=%d", + features.isa, 8 * features.reg_size); gdb_assert_not_reached ("%s", msg.c_str ()); } @@ -73,8 +72,9 @@ arc_create_target_description (const struct arc_arch_features &features) regnum = create_feature_arc_v2_aux (tdesc.get (), regnum); break; default: - std::string msg = string_printf - ("Cannot choose target description XML: %d", features.isa); + std::string msg + = string_printf ("Cannot choose target description XML: %d", + features.isa); gdb_assert_not_reached ("%s", msg.c_str ()); } @@ -86,8 +86,7 @@ arc_create_target_description (const struct arc_arch_features &features) /* Wrapper used by std::unordered_map to generate hash for features set. */ struct arc_arch_features_hasher { - std::size_t - operator() (const arc_arch_features &features) const noexcept + std::size_t operator() (const arc_arch_features &features) const noexcept { return features.hash (); } @@ -95,9 +94,9 @@ struct arc_arch_features_hasher /* Cache of previously created target descriptions, indexed by the hash of the features set used to create them. */ -static std::unordered_map arc_tdesc_cache; +static std::unordered_map + arc_tdesc_cache; /* See arch/arc.h. */ @@ -113,7 +112,6 @@ arc_lookup_target_description (const struct arc_arch_features &features) target_desc_up tdesc = arc_create_target_description (features); - /* Add to the cache, and return a pointer borrowed from the target_desc_up. This is safe as the cache (and the pointers contained within it) are not deleted until GDB exits. */ diff --git a/gdb/arch/arc.h b/gdb/arch/arc.h index 38dbd0f..dd75a6a 100644 --- a/gdb/arch/arc.h +++ b/gdb/arch/arc.h @@ -23,15 +23,17 @@ /* Supported ARC ISAs. */ enum arc_isa { - ARC_ISA_ARCV1 = 1, /* a.k.a. ARCompact (ARC600, ARC700) */ - ARC_ISA_ARCV2 /* such as ARC EM and ARC HS */ + ARC_ISA_ARCV1 = 1, /* a.k.a. ARCompact (ARC600, ARC700) */ + ARC_ISA_ARCV2 /* such as ARC EM and ARC HS */ }; struct arc_arch_features { arc_arch_features (int reg_size, arc_isa isa) - : reg_size (reg_size), isa (isa) - {} + : reg_size (reg_size), + isa (isa) + { + } /* Register size in bytes. Possible values are 4, and 8. A 0 indicates an uninitialised value. */ @@ -70,18 +72,17 @@ struct arc_arch_features The only external client of this must be the gdbserver which manipulates the returned data. */ -target_desc_up arc_create_target_description - (const struct arc_arch_features &features); +target_desc_up +arc_create_target_description (const struct arc_arch_features &features); #else /* Lookup the cache for a target description matching the FEATURES. If nothing is found, then create one and return it. */ -const target_desc *arc_lookup_target_description - (const struct arc_arch_features &features); +const target_desc * +arc_lookup_target_description (const struct arc_arch_features &features); #endif /* GDBSERVER */ - #endif /* ARCH_ARC_H */ diff --git a/gdb/arch/arm-get-next-pcs.c b/gdb/arch/arm-get-next-pcs.c index dcbb5a5..b548570 100644 --- a/gdb/arch/arm-get-next-pcs.c +++ b/gdb/arch/arm-get-next-pcs.c @@ -28,10 +28,8 @@ void arm_get_next_pcs_ctor (struct arm_get_next_pcs *self, - struct arm_get_next_pcs_ops *ops, - int byte_order, - int byte_order_for_code, - int has_thumb2_breakpoint, + struct arm_get_next_pcs_ops *ops, int byte_order, + int byte_order_for_code, int has_thumb2_breakpoint, struct regcache *regcache) { self->ops = ops; @@ -50,7 +48,7 @@ static std::vector thumb_deal_with_atomic_sequence_raw (struct arm_get_next_pcs *self) { int byte_order_for_code = self->byte_order_for_code; - CORE_ADDR breaks[2] = {CORE_ADDR_MAX, CORE_ADDR_MAX}; + CORE_ADDR breaks[2] = { CORE_ADDR_MAX, CORE_ADDR_MAX }; CORE_ADDR pc = regcache_read_pc (self->regcache); CORE_ADDR loc = pc; unsigned short insn1, insn2; @@ -84,7 +82,7 @@ thumb_deal_with_atomic_sequence_raw (struct arm_get_next_pcs *self) instructions. */ for (insn_count = 0; insn_count < atomic_sequence_length; ++insn_count) { - insn1 = self->ops->read_mem_uint (loc, 2,byte_order_for_code); + insn1 = self->ops->read_mem_uint (loc, 2, byte_order_for_code); loc += 2; if (thumb_insn_size (insn1) != 4) @@ -118,8 +116,7 @@ thumb_deal_with_atomic_sequence_raw (struct arm_get_next_pcs *self) /* Assume that there is at most one conditional branch in the atomic sequence. If a conditional branch is found, put a breakpoint in its destination address. */ - if ((insn1 & 0xf800) == 0xf000 - && (insn2 & 0xd000) == 0x8000 + if ((insn1 & 0xf800) == 0xf000 && (insn2 & 0xd000) == 0x8000 && (insn1 & 0x0380) != 0x0380) { int sign, j1, j2, imm1, imm2; @@ -166,8 +163,7 @@ thumb_deal_with_atomic_sequence_raw (struct arm_get_next_pcs *self) /* Check for duplicated breakpoints. Check also for a breakpoint placed (branch instruction's destination) anywhere in sequence. */ if (last_breakpoint - && (breaks[1] == breaks[0] - || (breaks[1] >= pc && breaks[1] < loc))) + && (breaks[1] == breaks[0] || (breaks[1] >= pc && breaks[1] < loc))) last_breakpoint = 0; std::vector next_pcs; @@ -188,7 +184,7 @@ static std::vector arm_deal_with_atomic_sequence_raw (struct arm_get_next_pcs *self) { int byte_order_for_code = self->byte_order_for_code; - CORE_ADDR breaks[2] = {CORE_ADDR_MAX, CORE_ADDR_MAX}; + CORE_ADDR breaks[2] = { CORE_ADDR_MAX, CORE_ADDR_MAX }; CORE_ADDR pc = regcache_read_pc (self->regcache); CORE_ADDR loc = pc; unsigned int insn; @@ -248,8 +244,7 @@ arm_deal_with_atomic_sequence_raw (struct arm_get_next_pcs *self) /* Check for duplicated breakpoints. Check also for a breakpoint placed (branch instruction's destination) anywhere in sequence. */ if (last_breakpoint - && (breaks[1] == breaks[0] - || (breaks[1] >= pc && breaks[1] < loc))) + && (breaks[1] == breaks[0] || (breaks[1] >= pc && breaks[1] < loc))) last_breakpoint = 0; std::vector next_pcs; @@ -269,9 +264,9 @@ thumb_get_next_pcs_raw (struct arm_get_next_pcs *self) int byte_order = self->byte_order; int byte_order_for_code = self->byte_order_for_code; CORE_ADDR pc = regcache_read_pc (self->regcache); - unsigned long pc_val = ((unsigned long) pc) + 4; /* PC after prefetch */ + unsigned long pc_val = ((unsigned long) pc) + 4; /* PC after prefetch */ unsigned short inst1; - CORE_ADDR nextpc = pc + 2; /* Default is next instruction. */ + CORE_ADDR nextpc = pc + 2; /* Default is next instruction. */ ULONGEST status, itstate; struct regcache *regcache = self->regcache; std::vector next_pcs; @@ -310,9 +305,9 @@ thumb_get_next_pcs_raw (struct arm_get_next_pcs *self) itstate = inst1 & 0x00ff; pc += thumb_insn_size (inst1); - while (itstate != 0 && ! condition_true (itstate >> 4, status)) + while (itstate != 0 && !condition_true (itstate >> 4, status)) { - inst1 = self->ops->read_mem_uint (pc, 2,byte_order_for_code); + inst1 = self->ops->read_mem_uint (pc, 2, byte_order_for_code); pc += thumb_insn_size (inst1); itstate = thumb_advance_itstate (itstate); } @@ -323,15 +318,16 @@ thumb_get_next_pcs_raw (struct arm_get_next_pcs *self) else if (itstate != 0) { /* We are in a conditional block. Check the condition. */ - if (! condition_true (itstate >> 4, status)) + if (!condition_true (itstate >> 4, status)) { /* Advance to the next executed instruction. */ pc += thumb_insn_size (inst1); itstate = thumb_advance_itstate (itstate); - while (itstate != 0 && ! condition_true (itstate >> 4, status)) + while (itstate != 0 && !condition_true (itstate >> 4, status)) { - inst1 = self->ops->read_mem_uint (pc, 2, byte_order_for_code); + inst1 + = self->ops->read_mem_uint (pc, 2, byte_order_for_code); pc += thumb_insn_size (inst1); itstate = thumb_advance_itstate (itstate); @@ -374,7 +370,8 @@ thumb_get_next_pcs_raw (struct arm_get_next_pcs *self) the instruction after the IT block. */ do { - inst1 = self->ops->read_mem_uint (pc, 2, byte_order_for_code); + inst1 + = self->ops->read_mem_uint (pc, 2, byte_order_for_code); pc += thumb_insn_size (inst1); itstate = thumb_advance_itstate (itstate); } @@ -391,7 +388,7 @@ thumb_get_next_pcs_raw (struct arm_get_next_pcs *self) /* We are in a conditional block. Check the condition. */ int cond = itstate >> 4; - if (! condition_true (cond, status)) + if (!condition_true (cond, status)) { /* Advance to the next instruction. All the 32-bit instructions share a common prefix. */ @@ -403,7 +400,7 @@ thumb_get_next_pcs_raw (struct arm_get_next_pcs *self) /* Otherwise, handle the instruction normally. */ } - if ((inst1 & 0xff00) == 0xbd00) /* pop {rlist, pc} */ + if ((inst1 & 0xff00) == 0xbd00) /* pop {rlist, pc} */ { CORE_ADDR sp; @@ -414,17 +411,17 @@ thumb_get_next_pcs_raw (struct arm_get_next_pcs *self) sp = regcache_raw_get_unsigned (regcache, ARM_SP_REGNUM); nextpc = self->ops->read_mem_uint (sp + offset, 4, byte_order); } - else if ((inst1 & 0xf000) == 0xd000) /* conditional branch */ + else if ((inst1 & 0xf000) == 0xd000) /* conditional branch */ { unsigned long cond = bits (inst1, 8, 11); - if (cond == 0x0f) /* 0x0f = SWI */ + if (cond == 0x0f) /* 0x0f = SWI */ { nextpc = self->ops->syscall_next_pc (self); } else if (cond != 0x0f && condition_true (cond, status)) nextpc = pc_val + (sbits (inst1, 0, 7) << 1); } - else if ((inst1 & 0xf800) == 0xe000) /* unconditional branch */ + else if ((inst1 & 0xf800) == 0xe000) /* unconditional branch */ { nextpc = pc_val + (sbits (inst1, 0, 10) << 1); } @@ -522,7 +519,7 @@ thumb_get_next_pcs_raw (struct arm_get_next_pcs *self) if (load_pc) { CORE_ADDR addr = regcache_raw_get_unsigned (regcache, rn); - nextpc = self->ops->read_mem_uint (addr + offset, 4, byte_order); + nextpc = self->ops->read_mem_uint (addr + offset, 4, byte_order); } } else if ((inst1 & 0xffef) == 0xea4f && (inst2 & 0xfff0) == 0x0f00) @@ -569,8 +566,7 @@ thumb_get_next_pcs_raw (struct arm_get_next_pcs *self) load_pc = 0; if (load_pc) - nextpc - = self->ops->read_mem_uint (base, 4, byte_order); + nextpc = self->ops->read_mem_uint (base, 4, byte_order); } else if ((inst1 & 0xfff0) == 0xe8d0 && (inst2 & 0xfff0) == 0xf000) { @@ -579,12 +575,13 @@ thumb_get_next_pcs_raw (struct arm_get_next_pcs *self) tbl_reg = bits (inst1, 0, 3); if (tbl_reg == 0x0f) - table = pc + 4; /* Regcache copy of PC isn't right yet. */ + table = pc + 4; /* Regcache copy of PC isn't right yet. */ else table = regcache_raw_get_unsigned (regcache, tbl_reg); offset = regcache_raw_get_unsigned (regcache, bits (inst2, 0, 3)); - length = 2 * self->ops->read_mem_uint (table + offset, 1, byte_order); + length + = 2 * self->ops->read_mem_uint (table + offset, 1, byte_order); nextpc = pc_val + length; } else if ((inst1 & 0xfff0) == 0xe8d0 && (inst2 & 0xfff0) == 0xf010) @@ -594,23 +591,25 @@ thumb_get_next_pcs_raw (struct arm_get_next_pcs *self) tbl_reg = bits (inst1, 0, 3); if (tbl_reg == 0x0f) - table = pc + 4; /* Regcache copy of PC isn't right yet. */ + table = pc + 4; /* Regcache copy of PC isn't right yet. */ else table = regcache_raw_get_unsigned (regcache, tbl_reg); - offset = 2 * regcache_raw_get_unsigned (regcache, bits (inst2, 0, 3)); - length = 2 * self->ops->read_mem_uint (table + offset, 2, byte_order); + offset + = 2 * regcache_raw_get_unsigned (regcache, bits (inst2, 0, 3)); + length + = 2 * self->ops->read_mem_uint (table + offset, 2, byte_order); nextpc = pc_val + length; } } - else if ((inst1 & 0xff00) == 0x4700) /* bx REG, blx REG */ + else if ((inst1 & 0xff00) == 0x4700) /* bx REG, blx REG */ { if (bits (inst1, 3, 6) == 0x0f) nextpc = UNMAKE_THUMB_ADDR (pc_val); else nextpc = regcache_raw_get_unsigned (regcache, bits (inst1, 3, 6)); } - else if ((inst1 & 0xff87) == 0x4687) /* mov pc, REG */ + else if ((inst1 & 0xff87) == 0x4687) /* mov pc, REG */ { if (bits (inst1, 3, 6) == 0x0f) nextpc = pc_val; @@ -661,7 +660,7 @@ arm_get_next_pcs_raw (struct arm_get_next_pcs *self) this_instr = self->ops->read_mem_uint (pc, 4, byte_order_for_code); status = regcache_raw_get_unsigned (regcache, ARM_PS_REGNUM); - nextpc = (CORE_ADDR) (pc_val + 4); /* Default case */ + nextpc = (CORE_ADDR) (pc_val + 4); /* Default case */ if (bits (this_instr, 28, 31) == INST_NV) switch (bits (this_instr, 24, 27)) @@ -680,7 +679,7 @@ arm_get_next_pcs_raw (struct arm_get_next_pcs *self) case 0xe: /* Coprocessor register transfer. */ if (bits (this_instr, 12, 15) == 15) - error (_("Invalid update to pc in instruction")); + error (_ ("Invalid update to pc in instruction")); break; } else if (condition_true (bits (this_instr, 28, 31), status)) @@ -688,7 +687,7 @@ arm_get_next_pcs_raw (struct arm_get_next_pcs *self) switch (bits (this_instr, 24, 27)) { case 0x0: - case 0x1: /* data processing */ + case 0x1: /* data processing */ case 0x2: case 0x3: { @@ -700,8 +699,8 @@ arm_get_next_pcs_raw (struct arm_get_next_pcs *self) break; if (bits (this_instr, 22, 25) == 0 - && bits (this_instr, 4, 7) == 9) /* multiply */ - error (_("Invalid update to pc in instruction")); + && bits (this_instr, 4, 7) == 9) /* multiply */ + error (_ ("Invalid update to pc in instruction")); /* BX , BLX */ if (bits (this_instr, 4, 27) == 0x12fff1 @@ -709,8 +708,8 @@ arm_get_next_pcs_raw (struct arm_get_next_pcs *self) { rn = bits (this_instr, 0, 3); nextpc = ((rn == ARM_PC_REGNUM) - ? (pc_val + 8) - : regcache_raw_get_unsigned (regcache, rn)); + ? (pc_val + 8) + : regcache_raw_get_unsigned (regcache, rn)); next_pcs.push_back (nextpc); return next_pcs; @@ -720,84 +719,84 @@ arm_get_next_pcs_raw (struct arm_get_next_pcs *self) c = (status & FLAG_C) ? 1 : 0; rn = bits (this_instr, 16, 19); operand1 = ((rn == ARM_PC_REGNUM) - ? (pc_val + 8) - : regcache_raw_get_unsigned (regcache, rn)); + ? (pc_val + 8) + : regcache_raw_get_unsigned (regcache, rn)); if (bit (this_instr, 25)) { unsigned long immval = bits (this_instr, 0, 7); unsigned long rotate = 2 * bits (this_instr, 8, 11); operand2 = ((immval >> rotate) | (immval << (32 - rotate))) - & 0xffffffff; + & 0xffffffff; } - else /* operand 2 is a shifted register. */ - operand2 = shifted_reg_val (regcache, this_instr, c, - pc_val, status); + else /* operand 2 is a shifted register. */ + operand2 + = shifted_reg_val (regcache, this_instr, c, pc_val, status); switch (bits (this_instr, 21, 24)) { - case 0x0: /*and */ + case 0x0: /*and */ result = operand1 & operand2; break; - case 0x1: /*eor */ + case 0x1: /*eor */ result = operand1 ^ operand2; break; - case 0x2: /*sub */ + case 0x2: /*sub */ result = operand1 - operand2; break; - case 0x3: /*rsb */ + case 0x3: /*rsb */ result = operand2 - operand1; break; - case 0x4: /*add */ + case 0x4: /*add */ result = operand1 + operand2; break; - case 0x5: /*adc */ + case 0x5: /*adc */ result = operand1 + operand2 + c; break; - case 0x6: /*sbc */ + case 0x6: /*sbc */ result = operand1 - operand2 + c; break; - case 0x7: /*rsc */ + case 0x7: /*rsc */ result = operand2 - operand1 + c; break; case 0x8: case 0x9: case 0xa: - case 0xb: /* tst, teq, cmp, cmn */ + case 0xb: /* tst, teq, cmp, cmn */ result = (unsigned long) nextpc; break; - case 0xc: /*orr */ + case 0xc: /*orr */ result = operand1 | operand2; break; - case 0xd: /*mov */ + case 0xd: /*mov */ /* Always step into a function. */ result = operand2; break; - case 0xe: /*bic */ + case 0xe: /*bic */ result = operand1 & ~operand2; break; - case 0xf: /*mvn */ + case 0xf: /*mvn */ result = ~operand2; break; } - nextpc = self->ops->addr_bits_remove (self, result); + nextpc = self->ops->addr_bits_remove (self, result); break; } case 0x4: - case 0x5: /* data transfer */ + case 0x5: /* data transfer */ case 0x6: case 0x7: if (bits (this_instr, 25, 27) == 0x3 && bit (this_instr, 4) == 1) @@ -817,23 +816,23 @@ arm_get_next_pcs_raw (struct arm_get_next_pcs *self) unsigned long base; if (bit (this_instr, 22)) - error (_("Invalid update to pc in instruction")); + error (_ ("Invalid update to pc in instruction")); /* byte write to PC */ rn = bits (this_instr, 16, 19); base = ((rn == ARM_PC_REGNUM) - ? (pc_val + 8) - : regcache_raw_get_unsigned (regcache, rn)); + ? (pc_val + 8) + : regcache_raw_get_unsigned (regcache, rn)); if (bit (this_instr, 24)) { /* pre-indexed */ int c = (status & FLAG_C) ? 1 : 0; - unsigned long offset = - (bit (this_instr, 25) - ? shifted_reg_val (regcache, this_instr, c, - pc_val, status) - : bits (this_instr, 0, 11)); + unsigned long offset + = (bit (this_instr, 25) + ? shifted_reg_val (regcache, this_instr, c, + pc_val, status) + : bits (this_instr, 0, 11)); if (bit (this_instr, 23)) base += offset; @@ -848,7 +847,7 @@ arm_get_next_pcs_raw (struct arm_get_next_pcs *self) break; case 0x8: - case 0x9: /* block transfer */ + case 0x9: /* block transfer */ if (bit (this_instr, 20)) { /* LDM */ @@ -866,21 +865,22 @@ arm_get_next_pcs_raw (struct arm_get_next_pcs *self) /* up */ unsigned long reglist = bits (this_instr, 0, 14); offset = count_one_bits_l (reglist) * 4; - if (bit (this_instr, 24)) /* pre */ + if (bit (this_instr, 24)) /* pre */ offset += 4; } else if (bit (this_instr, 24)) offset = -4; rn_val_offset = rn_val + offset; - nextpc = (CORE_ADDR) self->ops->read_mem_uint (rn_val_offset, - 4, byte_order); + nextpc + = (CORE_ADDR) self->ops->read_mem_uint (rn_val_offset, 4, + byte_order); } } break; - case 0xb: /* branch & link */ - case 0xa: /* branch */ + case 0xb: /* branch & link */ + case 0xa: /* branch */ { nextpc = BranchDest (pc, this_instr); break; @@ -888,16 +888,16 @@ arm_get_next_pcs_raw (struct arm_get_next_pcs *self) case 0xc: case 0xd: - case 0xe: /* coproc ops */ + case 0xe: /* coproc ops */ break; - case 0xf: /* SWI */ + case 0xf: /* SWI */ { nextpc = self->ops->syscall_next_pc (self); } break; default: - error (_("Bad bit-field extraction")); + error (_ ("Bad bit-field extraction")); return next_pcs; } } diff --git a/gdb/arch/arm-get-next-pcs.h b/gdb/arch/arm-get-next-pcs.h index e6bb8d8..583046e 100644 --- a/gdb/arch/arm-get-next-pcs.h +++ b/gdb/arch/arm-get-next-pcs.h @@ -55,10 +55,8 @@ struct arm_get_next_pcs /* Initialize arm_get_next_pcs. */ void arm_get_next_pcs_ctor (struct arm_get_next_pcs *self, - struct arm_get_next_pcs_ops *ops, - int byte_order, - int byte_order_for_code, - int has_thumb2_breakpoint, + struct arm_get_next_pcs_ops *ops, int byte_order, + int byte_order_for_code, int has_thumb2_breakpoint, struct regcache *regcache); /* Find the next possible PCs after the current instruction executes. */ diff --git a/gdb/arch/arm-linux.c b/gdb/arch/arm-linux.c index bafbc52..5fbf2a3 100644 --- a/gdb/arch/arm-linux.c +++ b/gdb/arch/arm-linux.c @@ -26,10 +26,8 @@ /* Calculate the offset from stack pointer of the pc register on the stack in the case of a sigreturn or sigreturn_rt syscall. */ int -arm_linux_sigreturn_next_pc_offset (unsigned long sp, - unsigned long sp_data, - unsigned long svc_number, - int is_sigreturn) +arm_linux_sigreturn_next_pc_offset (unsigned long sp, unsigned long sp_data, + unsigned long svc_number, int is_sigreturn) { /* Offset of R0 register. */ int r0_offset = 0; @@ -62,8 +60,7 @@ arm_linux_sigreturn_next_pc_offset (unsigned long sp, for arm-linux. */ CORE_ADDR -arm_linux_get_next_pcs_fixup (struct arm_get_next_pcs *self, - CORE_ADDR nextpc) +arm_linux_get_next_pcs_fixup (struct arm_get_next_pcs *self, CORE_ADDR nextpc) { /* The Linux kernel offers some user-mode helpers in a high page. We can not read this page (as of 2.6.23), and even if we could then we @@ -119,7 +116,7 @@ arm_linux_get_next_pcs_fixup (struct arm_get_next_pcs *self, } else { - if (bits (insn, 24, 27) == 0xb /* BL