Compare commits

...

1 Commits

Author SHA1 Message Date
Simon Marchi
0fb7ea580d gdb, gdbserver, gdbsupport: fix leading space vs tabs issues
Many spots incorrectly use only spaces for indentation (for example,
there are a lot of spots in ada-lang.c).  I've always found it awkward
when I needed to edit one of these spots: do I keep the original wrong
indentation, or do I fix it?  What if the lines around it are also
wrong, do I fix them too?  I probably don't want to fix them in the same
patch, to avoid adding noise to my patch.

So I propose to fix as much as possible once and for all (hopefully).

One typical counter argument for this is that it makes code archeology
more difficult, because git-blame will show this commit as the last
change for these lines.  My counter counter argument is: when
git-blaming, you often need to do "blame the file at the parent commit"
anyway, to go past some other refactor that touched the line you are
interested in, but is not the change you are looking for.  So you
already need a somewhat efficient way to do this.

Using some interactive tool, rather than plain git-blame, makes this
trivial.  For example, I use "tig blame <file>", where going back past
the commit that changed the currently selected line is one keystroke.
It looks like Magit in Emacs does it too (though I've never used it).
Web viewers of Github and Gitlab do it too.  My point is that it won't
really make archeology more difficult.

The other typical counter argument is that it will cause conflicts with
existing patches.  That's true... but it's a one time cost, and those
are not conflicts that are difficult to resolve.  I have also tried "git
rebase --ignore-whitespace", it seems to work well.  Although that will
re-introduce the faulty indentation, so one needs to take care of fixing
the indentation in the patch after that (which is easy).

gdb/ChangeLog:

	* aarch64-linux-tdep.c: Fix indentation.
	* aarch64-ravenscar-thread.c: Fix indentation.
	* aarch64-tdep.c: Fix indentation.
	* aarch64-tdep.h: Fix indentation.
	* ada-lang.c: Fix indentation.
	* ada-lang.h: Fix indentation.
	* ada-tasks.c: Fix indentation.
	* ada-typeprint.c: Fix indentation.
	* ada-valprint.c: Fix indentation.
	* ada-varobj.c: Fix indentation.
	* addrmap.c: Fix indentation.
	* addrmap.h: Fix indentation.
	* agent.c: Fix indentation.
	* aix-thread.c: Fix indentation.
	* alpha-bsd-nat.c: Fix indentation.
	* alpha-linux-tdep.c: Fix indentation.
	* alpha-mdebug-tdep.c: Fix indentation.
	* alpha-nbsd-tdep.c: Fix indentation.
	* alpha-obsd-tdep.c: Fix indentation.
	* alpha-tdep.c: Fix indentation.
	* amd64-bsd-nat.c: Fix indentation.
	* amd64-darwin-tdep.c: Fix indentation.
	* amd64-linux-nat.c: Fix indentation.
	* amd64-linux-tdep.c: Fix indentation.
	* amd64-nat.c: Fix indentation.
	* amd64-obsd-tdep.c: Fix indentation.
	* amd64-tdep.c: Fix indentation.
	* amd64-windows-tdep.c: Fix indentation.
	* annotate.c: Fix indentation.
	* arc-tdep.c: Fix indentation.
	* arch-utils.c: Fix indentation.
	* arch/arm-get-next-pcs.c: Fix indentation.
	* arch/arm.c: Fix indentation.
	* arm-linux-nat.c: Fix indentation.
	* arm-linux-tdep.c: Fix indentation.
	* arm-nbsd-tdep.c: Fix indentation.
	* arm-pikeos-tdep.c: Fix indentation.
	* arm-tdep.c: Fix indentation.
	* arm-tdep.h: Fix indentation.
	* arm-wince-tdep.c: Fix indentation.
	* auto-load.c: Fix indentation.
	* auxv.c: Fix indentation.
	* avr-tdep.c: Fix indentation.
	* ax-gdb.c: Fix indentation.
	* ax-general.c: Fix indentation.
	* bfin-linux-tdep.c: Fix indentation.
	* block.c: Fix indentation.
	* block.h: Fix indentation.
	* blockframe.c: Fix indentation.
	* bpf-tdep.c: Fix indentation.
	* break-catch-sig.c: Fix indentation.
	* break-catch-syscall.c: Fix indentation.
	* break-catch-throw.c: Fix indentation.
	* breakpoint.c: Fix indentation.
	* breakpoint.h: Fix indentation.
	* bsd-uthread.c: Fix indentation.
	* btrace.c: Fix indentation.
	* build-id.c: Fix indentation.
	* buildsym-legacy.h: Fix indentation.
	* buildsym.c: Fix indentation.
	* c-typeprint.c: Fix indentation.
	* c-valprint.c: Fix indentation.
	* c-varobj.c: Fix indentation.
	* charset.c: Fix indentation.
	* cli/cli-cmds.c: Fix indentation.
	* cli/cli-decode.c: Fix indentation.
	* cli/cli-decode.h: Fix indentation.
	* cli/cli-script.c: Fix indentation.
	* cli/cli-setshow.c: Fix indentation.
	* coff-pe-read.c: Fix indentation.
	* coffread.c: Fix indentation.
	* compile/compile-cplus-types.c: Fix indentation.
	* compile/compile-object-load.c: Fix indentation.
	* compile/compile-object-run.c: Fix indentation.
	* completer.c: Fix indentation.
	* corefile.c: Fix indentation.
	* corelow.c: Fix indentation.
	* cp-abi.h: Fix indentation.
	* cp-namespace.c: Fix indentation.
	* cp-support.c: Fix indentation.
	* cp-valprint.c: Fix indentation.
	* cris-linux-tdep.c: Fix indentation.
	* cris-tdep.c: Fix indentation.
	* darwin-nat-info.c: Fix indentation.
	* darwin-nat.c: Fix indentation.
	* darwin-nat.h: Fix indentation.
	* dbxread.c: Fix indentation.
	* dcache.c: Fix indentation.
	* disasm.c: Fix indentation.
	* dtrace-probe.c: Fix indentation.
	* dwarf2/abbrev.c: Fix indentation.
	* dwarf2/attribute.c: Fix indentation.
	* dwarf2/expr.c: Fix indentation.
	* dwarf2/frame.c: Fix indentation.
	* dwarf2/index-cache.c: Fix indentation.
	* dwarf2/index-write.c: Fix indentation.
	* dwarf2/line-header.c: Fix indentation.
	* dwarf2/loc.c: Fix indentation.
	* dwarf2/macro.c: Fix indentation.
	* dwarf2/read.c: Fix indentation.
	* dwarf2/read.h: Fix indentation.
	* elfread.c: Fix indentation.
	* eval.c: Fix indentation.
	* event-top.c: Fix indentation.
	* exec.c: Fix indentation.
	* exec.h: Fix indentation.
	* expprint.c: Fix indentation.
	* f-lang.c: Fix indentation.
	* f-typeprint.c: Fix indentation.
	* f-valprint.c: Fix indentation.
	* fbsd-nat.c: Fix indentation.
	* fbsd-tdep.c: Fix indentation.
	* findvar.c: Fix indentation.
	* fork-child.c: Fix indentation.
	* frame-unwind.c: Fix indentation.
	* frame-unwind.h: Fix indentation.
	* frame.c: Fix indentation.
	* frv-linux-tdep.c: Fix indentation.
	* frv-tdep.c: Fix indentation.
	* frv-tdep.h: Fix indentation.
	* ft32-tdep.c: Fix indentation.
	* gcore.c: Fix indentation.
	* gdb_bfd.c: Fix indentation.
	* gdbarch.sh: Fix indentation.
	* gdbarch.c: Re-generate
	* gdbarch.h: Re-generate.
	* gdbcore.h: Fix indentation.
	* gdbthread.h: Fix indentation.
	* gdbtypes.c: Fix indentation.
	* gdbtypes.h: Fix indentation.
	* glibc-tdep.c: Fix indentation.
	* gnu-nat.c: Fix indentation.
	* gnu-nat.h: Fix indentation.
	* gnu-v2-abi.c: Fix indentation.
	* gnu-v3-abi.c: Fix indentation.
	* go32-nat.c: Fix indentation.
	* guile/guile-internal.h: Fix indentation.
	* guile/scm-cmd.c: Fix indentation.
	* guile/scm-frame.c: Fix indentation.
	* guile/scm-iterator.c: Fix indentation.
	* guile/scm-math.c: Fix indentation.
	* guile/scm-ports.c: Fix indentation.
	* guile/scm-pretty-print.c: Fix indentation.
	* guile/scm-value.c: Fix indentation.
	* h8300-tdep.c: Fix indentation.
	* hppa-linux-nat.c: Fix indentation.
	* hppa-linux-tdep.c: Fix indentation.
	* hppa-nbsd-nat.c: Fix indentation.
	* hppa-nbsd-tdep.c: Fix indentation.
	* hppa-obsd-nat.c: Fix indentation.
	* hppa-tdep.c: Fix indentation.
	* hppa-tdep.h: Fix indentation.
	* i386-bsd-nat.c: Fix indentation.
	* i386-darwin-nat.c: Fix indentation.
	* i386-darwin-tdep.c: Fix indentation.
	* i386-dicos-tdep.c: Fix indentation.
	* i386-gnu-nat.c: Fix indentation.
	* i386-linux-nat.c: Fix indentation.
	* i386-linux-tdep.c: Fix indentation.
	* i386-nto-tdep.c: Fix indentation.
	* i386-obsd-tdep.c: Fix indentation.
	* i386-sol2-nat.c: Fix indentation.
	* i386-tdep.c: Fix indentation.
	* i386-tdep.h: Fix indentation.
	* i386-windows-tdep.c: Fix indentation.
	* i387-tdep.c: Fix indentation.
	* i387-tdep.h: Fix indentation.
	* ia64-libunwind-tdep.c: Fix indentation.
	* ia64-libunwind-tdep.h: Fix indentation.
	* ia64-linux-nat.c: Fix indentation.
	* ia64-linux-tdep.c: Fix indentation.
	* ia64-tdep.c: Fix indentation.
	* ia64-tdep.h: Fix indentation.
	* ia64-vms-tdep.c: Fix indentation.
	* infcall.c: Fix indentation.
	* infcmd.c: Fix indentation.
	* inferior.c: Fix indentation.
	* infrun.c: Fix indentation.
	* iq2000-tdep.c: Fix indentation.
	* language.c: Fix indentation.
	* linespec.c: Fix indentation.
	* linux-fork.c: Fix indentation.
	* linux-nat.c: Fix indentation.
	* linux-tdep.c: Fix indentation.
	* linux-thread-db.c: Fix indentation.
	* lm32-tdep.c: Fix indentation.
	* m2-lang.c: Fix indentation.
	* m2-typeprint.c: Fix indentation.
	* m2-valprint.c: Fix indentation.
	* m32c-tdep.c: Fix indentation.
	* m32r-linux-tdep.c: Fix indentation.
	* m32r-tdep.c: Fix indentation.
	* m68hc11-tdep.c: Fix indentation.
	* m68k-bsd-nat.c: Fix indentation.
	* m68k-linux-nat.c: Fix indentation.
	* m68k-linux-tdep.c: Fix indentation.
	* m68k-tdep.c: Fix indentation.
	* machoread.c: Fix indentation.
	* macrocmd.c: Fix indentation.
	* macroexp.c: Fix indentation.
	* macroscope.c: Fix indentation.
	* macrotab.c: Fix indentation.
	* macrotab.h: Fix indentation.
	* main.c: Fix indentation.
	* mdebugread.c: Fix indentation.
	* mep-tdep.c: Fix indentation.
	* mi/mi-cmd-catch.c: Fix indentation.
	* mi/mi-cmd-disas.c: Fix indentation.
	* mi/mi-cmd-env.c: Fix indentation.
	* mi/mi-cmd-stack.c: Fix indentation.
	* mi/mi-cmd-var.c: Fix indentation.
	* mi/mi-cmds.c: Fix indentation.
	* mi/mi-main.c: Fix indentation.
	* mi/mi-parse.c: Fix indentation.
	* microblaze-tdep.c: Fix indentation.
	* minidebug.c: Fix indentation.
	* minsyms.c: Fix indentation.
	* mips-linux-nat.c: Fix indentation.
	* mips-linux-tdep.c: Fix indentation.
	* mips-nbsd-tdep.c: Fix indentation.
	* mips-tdep.c: Fix indentation.
	* mn10300-linux-tdep.c: Fix indentation.
	* mn10300-tdep.c: Fix indentation.
	* moxie-tdep.c: Fix indentation.
	* msp430-tdep.c: Fix indentation.
	* namespace.h: Fix indentation.
	* nat/fork-inferior.c: Fix indentation.
	* nat/gdb_ptrace.h: Fix indentation.
	* nat/linux-namespaces.c: Fix indentation.
	* nat/linux-osdata.c: Fix indentation.
	* nat/netbsd-nat.c: Fix indentation.
	* nat/x86-dregs.c: Fix indentation.
	* nbsd-nat.c: Fix indentation.
	* nbsd-tdep.c: Fix indentation.
	* nios2-linux-tdep.c: Fix indentation.
	* nios2-tdep.c: Fix indentation.
	* nto-procfs.c: Fix indentation.
	* nto-tdep.c: Fix indentation.
	* objfiles.c: Fix indentation.
	* objfiles.h: Fix indentation.
	* opencl-lang.c: Fix indentation.
	* or1k-tdep.c: Fix indentation.
	* osabi.c: Fix indentation.
	* osabi.h: Fix indentation.
	* osdata.c: Fix indentation.
	* p-lang.c: Fix indentation.
	* p-typeprint.c: Fix indentation.
	* p-valprint.c: Fix indentation.
	* parse.c: Fix indentation.
	* ppc-linux-nat.c: Fix indentation.
	* ppc-linux-tdep.c: Fix indentation.
	* ppc-nbsd-nat.c: Fix indentation.
	* ppc-nbsd-tdep.c: Fix indentation.
	* ppc-obsd-nat.c: Fix indentation.
	* ppc-ravenscar-thread.c: Fix indentation.
	* ppc-sysv-tdep.c: Fix indentation.
	* ppc64-tdep.c: Fix indentation.
	* printcmd.c: Fix indentation.
	* proc-api.c: Fix indentation.
	* producer.c: Fix indentation.
	* producer.h: Fix indentation.
	* prologue-value.c: Fix indentation.
	* prologue-value.h: Fix indentation.
	* psymtab.c: Fix indentation.
	* python/py-arch.c: Fix indentation.
	* python/py-bpevent.c: Fix indentation.
	* python/py-event.c: Fix indentation.
	* python/py-event.h: Fix indentation.
	* python/py-finishbreakpoint.c: Fix indentation.
	* python/py-frame.c: Fix indentation.
	* python/py-framefilter.c: Fix indentation.
	* python/py-inferior.c: Fix indentation.
	* python/py-infthread.c: Fix indentation.
	* python/py-objfile.c: Fix indentation.
	* python/py-prettyprint.c: Fix indentation.
	* python/py-registers.c: Fix indentation.
	* python/py-signalevent.c: Fix indentation.
	* python/py-stopevent.c: Fix indentation.
	* python/py-stopevent.h: Fix indentation.
	* python/py-threadevent.c: Fix indentation.
	* python/py-tui.c: Fix indentation.
	* python/py-unwind.c: Fix indentation.
	* python/py-value.c: Fix indentation.
	* python/py-xmethods.c: Fix indentation.
	* python/python-internal.h: Fix indentation.
	* python/python.c: Fix indentation.
	* ravenscar-thread.c: Fix indentation.
	* record-btrace.c: Fix indentation.
	* record-full.c: Fix indentation.
	* record.c: Fix indentation.
	* reggroups.c: Fix indentation.
	* regset.h: Fix indentation.
	* remote-fileio.c: Fix indentation.
	* remote.c: Fix indentation.
	* reverse.c: Fix indentation.
	* riscv-linux-tdep.c: Fix indentation.
	* riscv-ravenscar-thread.c: Fix indentation.
	* riscv-tdep.c: Fix indentation.
	* rl78-tdep.c: Fix indentation.
	* rs6000-aix-tdep.c: Fix indentation.
	* rs6000-lynx178-tdep.c: Fix indentation.
	* rs6000-nat.c: Fix indentation.
	* rs6000-tdep.c: Fix indentation.
	* rust-lang.c: Fix indentation.
	* rx-tdep.c: Fix indentation.
	* s12z-tdep.c: Fix indentation.
	* s390-linux-tdep.c: Fix indentation.
	* score-tdep.c: Fix indentation.
	* ser-base.c: Fix indentation.
	* ser-mingw.c: Fix indentation.
	* ser-uds.c: Fix indentation.
	* ser-unix.c: Fix indentation.
	* serial.c: Fix indentation.
	* sh-linux-tdep.c: Fix indentation.
	* sh-nbsd-tdep.c: Fix indentation.
	* sh-tdep.c: Fix indentation.
	* skip.c: Fix indentation.
	* sol-thread.c: Fix indentation.
	* solib-aix.c: Fix indentation.
	* solib-darwin.c: Fix indentation.
	* solib-frv.c: Fix indentation.
	* solib-svr4.c: Fix indentation.
	* solib.c: Fix indentation.
	* source.c: Fix indentation.
	* sparc-linux-tdep.c: Fix indentation.
	* sparc-nbsd-tdep.c: Fix indentation.
	* sparc-obsd-tdep.c: Fix indentation.
	* sparc-ravenscar-thread.c: Fix indentation.
	* sparc-tdep.c: Fix indentation.
	* sparc64-linux-tdep.c: Fix indentation.
	* sparc64-nbsd-tdep.c: Fix indentation.
	* sparc64-obsd-tdep.c: Fix indentation.
	* sparc64-tdep.c: Fix indentation.
	* stabsread.c: Fix indentation.
	* stack.c: Fix indentation.
	* stap-probe.c: Fix indentation.
	* stubs/ia64vms-stub.c: Fix indentation.
	* stubs/m32r-stub.c: Fix indentation.
	* stubs/m68k-stub.c: Fix indentation.
	* stubs/sh-stub.c: Fix indentation.
	* stubs/sparc-stub.c: Fix indentation.
	* symfile-mem.c: Fix indentation.
	* symfile.c: Fix indentation.
	* symfile.h: Fix indentation.
	* symmisc.c: Fix indentation.
	* symtab.c: Fix indentation.
	* symtab.h: Fix indentation.
	* target-float.c: Fix indentation.
	* target.c: Fix indentation.
	* target.h: Fix indentation.
	* tic6x-tdep.c: Fix indentation.
	* tilegx-linux-tdep.c: Fix indentation.
	* tilegx-tdep.c: Fix indentation.
	* top.c: Fix indentation.
	* tracefile-tfile.c: Fix indentation.
	* tracepoint.c: Fix indentation.
	* tui/tui-disasm.c: Fix indentation.
	* tui/tui-io.c: Fix indentation.
	* tui/tui-regs.c: Fix indentation.
	* tui/tui-stack.c: Fix indentation.
	* tui/tui-win.c: Fix indentation.
	* tui/tui-winsource.c: Fix indentation.
	* tui/tui.c: Fix indentation.
	* typeprint.c: Fix indentation.
	* ui-out.h: Fix indentation.
	* unittests/copy_bitwise-selftests.c: Fix indentation.
	* unittests/memory-map-selftests.c: Fix indentation.
	* utils.c: Fix indentation.
	* v850-tdep.c: Fix indentation.
	* valarith.c: Fix indentation.
	* valops.c: Fix indentation.
	* valprint.c: Fix indentation.
	* valprint.h: Fix indentation.
	* value.c: Fix indentation.
	* value.h: Fix indentation.
	* varobj.c: Fix indentation.
	* vax-tdep.c: Fix indentation.
	* windows-nat.c: Fix indentation.
	* windows-tdep.c: Fix indentation.
	* xcoffread.c: Fix indentation.
	* xml-syscall.c: Fix indentation.
	* xml-tdesc.c: Fix indentation.
	* xstormy16-tdep.c: Fix indentation.
	* xtensa-config.c: Fix indentation.
	* xtensa-linux-nat.c: Fix indentation.
	* xtensa-linux-tdep.c: Fix indentation.
	* xtensa-tdep.c: Fix indentation.

gdbserver/ChangeLog:

	* ax.cc: Fix indentation.
	* dll.cc: Fix indentation.
	* inferiors.h: Fix indentation.
	* linux-low.cc: Fix indentation.
	* linux-nios2-low.cc: Fix indentation.
	* linux-ppc-ipa.cc: Fix indentation.
	* linux-ppc-low.cc: Fix indentation.
	* linux-x86-low.cc: Fix indentation.
	* linux-xtensa-low.cc: Fix indentation.
	* regcache.cc: Fix indentation.
	* server.cc: Fix indentation.
	* tracepoint.cc: Fix indentation.

gdbsupport/ChangeLog:

	* common-exceptions.h: Fix indentation.
	* event-loop.cc: Fix indentation.
	* fileio.cc: Fix indentation.
	* filestuff.cc: Fix indentation.
	* gdb-dlfcn.cc: Fix indentation.
	* gdb_string_view.h: Fix indentation.
	* job-control.cc: Fix indentation.
	* signals.cc: Fix indentation.

Change-Id: I4bad7ae6be0fbe14168b8ebafb98ffe14964a695
2020-10-26 12:27:18 -04:00
417 changed files with 14125 additions and 14125 deletions

View File

@@ -1452,7 +1452,7 @@ aarch64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
/* Enable TLS support. */ /* Enable TLS support. */
set_gdbarch_fetch_tls_load_module_address (gdbarch, set_gdbarch_fetch_tls_load_module_address (gdbarch,
svr4_fetch_objfile_link_map); svr4_fetch_objfile_link_map);
/* Shared library handling. */ /* Shared library handling. */
set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target); set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target);

View File

@@ -81,7 +81,7 @@ struct ravenscar_reg_info
static void static void
supply_register_at_address (struct regcache *regcache, int regnum, supply_register_at_address (struct regcache *regcache, int regnum,
CORE_ADDR register_addr) CORE_ADDR register_addr)
{ {
struct gdbarch *gdbarch = regcache->arch (); struct gdbarch *gdbarch = regcache->arch ();
int buf_size = register_size (gdbarch, regnum); int buf_size = register_size (gdbarch, regnum);
@@ -125,12 +125,12 @@ aarch64_ravenscar_generic_fetch_registers
for (current_regnum = 0; current_regnum < num_regs; current_regnum++) for (current_regnum = 0; current_regnum < num_regs; current_regnum++)
{ {
if (register_in_thread_descriptor_p (reg_info, current_regnum)) if (register_in_thread_descriptor_p (reg_info, current_regnum))
{ {
current_address = thread_descriptor_address current_address = thread_descriptor_address
+ reg_info->context_offsets[current_regnum]; + reg_info->context_offsets[current_regnum];
supply_register_at_address (regcache, current_regnum, supply_register_at_address (regcache, current_regnum,
current_address); current_address);
} }
} }
} }
@@ -155,8 +155,8 @@ aarch64_ravenscar_generic_store_registers
regcache->raw_collect (regnum, buf); regcache->raw_collect (regnum, buf);
write_memory (register_address, write_memory (register_address,
buf, buf,
buf_size); buf_size);
} }
/* The ravenscar_reg_info for most Aarch64 targets. */ /* The ravenscar_reg_info for most Aarch64 targets. */

View File

@@ -210,7 +210,7 @@ struct aarch64_prologue_cache
static void static void
show_aarch64_debug (struct ui_file *file, int from_tty, show_aarch64_debug (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
{ {
fprintf_filtered (file, _("AArch64 debugging is %s.\n"), value); fprintf_filtered (file, _("AArch64 debugging is %s.\n"), value);
} }
@@ -1093,17 +1093,17 @@ aarch64_prologue_prev_register (struct frame_info *this_frame,
identified by the next frame's stack pointer at the time of the identified by the next frame's stack pointer at the time of the
call. The value was already reconstructed into PREV_SP. */ call. The value was already reconstructed into PREV_SP. */
/* /*
+----------+ ^ +----------+ ^
| saved lr | | | saved lr | |
+->| saved fp |--+ +->| saved fp |--+
| | | | | |
| | | <- Previous SP | | | <- Previous SP
| +----------+ | +----------+
| | saved lr | | | saved lr |
+--| saved fp |<- FP +--| saved fp |<- FP
| | | |
| |<- SP | |<- SP
+----------+ */ +----------+ */
if (prev_regnum == AARCH64_SP_REGNUM) if (prev_regnum == AARCH64_SP_REGNUM)
return frame_unwind_got_constant (this_frame, prev_regnum, return frame_unwind_got_constant (this_frame, prev_regnum,
cache->prev_sp); cache->prev_sp);
@@ -2288,8 +2288,8 @@ aarch64_extract_return_value (struct type *type, struct regcache *regs,
else else
{ {
/* For a structure or union the behaviour is as if the value had /* For a structure or union the behaviour is as if the value had
been stored to word-aligned memory and then loaded into been stored to word-aligned memory and then loaded into
registers with 64-bit load instruction(s). */ registers with 64-bit load instruction(s). */
int len = TYPE_LENGTH (type); int len = TYPE_LENGTH (type);
int regno = AARCH64_X0_REGNUM; int regno = AARCH64_X0_REGNUM;
bfd_byte buf[X_REGISTER_SIZE]; bfd_byte buf[X_REGISTER_SIZE];
@@ -2327,7 +2327,7 @@ aarch64_return_in_memory (struct gdbarch *gdbarch, struct type *type)
if (TYPE_LENGTH (type) > 16) if (TYPE_LENGTH (type) > 16)
{ {
/* PCS B.6 Aggregates larger than 16 bytes are passed by /* PCS B.6 Aggregates larger than 16 bytes are passed by
invisible reference. */ invisible reference. */
return 1; return 1;
} }
@@ -3639,29 +3639,29 @@ When on, AArch64 specific debugging is enabled."),
/* AArch64 process record-replay related structures, defines etc. */ /* AArch64 process record-replay related structures, defines etc. */
#define REG_ALLOC(REGS, LENGTH, RECORD_BUF) \ #define REG_ALLOC(REGS, LENGTH, RECORD_BUF) \
do \ do \
{ \ { \
unsigned int reg_len = LENGTH; \ unsigned int reg_len = LENGTH; \
if (reg_len) \ if (reg_len) \
{ \ { \
REGS = XNEWVEC (uint32_t, reg_len); \ REGS = XNEWVEC (uint32_t, reg_len); \
memcpy(&REGS[0], &RECORD_BUF[0], sizeof(uint32_t)*LENGTH); \ memcpy(&REGS[0], &RECORD_BUF[0], sizeof(uint32_t)*LENGTH); \
} \ } \
} \ } \
while (0) while (0)
#define MEM_ALLOC(MEMS, LENGTH, RECORD_BUF) \ #define MEM_ALLOC(MEMS, LENGTH, RECORD_BUF) \
do \ do \
{ \ { \
unsigned int mem_len = LENGTH; \ unsigned int mem_len = LENGTH; \
if (mem_len) \ if (mem_len) \
{ \ { \
MEMS = XNEWVEC (struct aarch64_mem_r, mem_len); \ MEMS = XNEWVEC (struct aarch64_mem_r, mem_len); \
memcpy(&MEMS->len, &RECORD_BUF[0], \ memcpy(&MEMS->len, &RECORD_BUF[0], \
sizeof(struct aarch64_mem_r) * LENGTH); \ sizeof(struct aarch64_mem_r) * LENGTH); \
} \ } \
} \ } \
while (0) while (0)
/* AArch64 record/replay structures and enumerations. */ /* AArch64 record/replay structures and enumerations. */
@@ -3919,46 +3919,46 @@ aarch64_record_asimd_load_store (insn_decode_record *aarch64_insn_r)
uint8_t sindex, scale, selem, esize, replicate = 0; uint8_t sindex, scale, selem, esize, replicate = 0;
scale = opcode_bits >> 2; scale = opcode_bits >> 2;
selem = ((opcode_bits & 0x02) | selem = ((opcode_bits & 0x02) |
bit (aarch64_insn_r->aarch64_insn, 21)) + 1; bit (aarch64_insn_r->aarch64_insn, 21)) + 1;
switch (scale) switch (scale)
{ {
case 1: case 1:
if (size_bits & 0x01) if (size_bits & 0x01)
return AARCH64_RECORD_UNKNOWN; return AARCH64_RECORD_UNKNOWN;
break; break;
case 2: case 2:
if ((size_bits >> 1) & 0x01) if ((size_bits >> 1) & 0x01)
return AARCH64_RECORD_UNKNOWN; return AARCH64_RECORD_UNKNOWN;
if (size_bits & 0x01) if (size_bits & 0x01)
{ {
if (!((opcode_bits >> 1) & 0x01)) if (!((opcode_bits >> 1) & 0x01))
scale = 3; scale = 3;
else else
return AARCH64_RECORD_UNKNOWN; return AARCH64_RECORD_UNKNOWN;
} }
break; break;
case 3: case 3:
if (bit (aarch64_insn_r->aarch64_insn, 22) && !(opcode_bits & 0x01)) if (bit (aarch64_insn_r->aarch64_insn, 22) && !(opcode_bits & 0x01))
{ {
scale = size_bits; scale = size_bits;
replicate = 1; replicate = 1;
break; break;
} }
else else
return AARCH64_RECORD_UNKNOWN; return AARCH64_RECORD_UNKNOWN;
default: default:
break; break;
} }
esize = 8 << scale; esize = 8 << scale;
if (replicate) if (replicate)
for (sindex = 0; sindex < selem; sindex++) for (sindex = 0; sindex < selem; sindex++)
{ {
record_buf[reg_index++] = reg_rt + AARCH64_V0_REGNUM; record_buf[reg_index++] = reg_rt + AARCH64_V0_REGNUM;
reg_rt = (reg_rt + 1) % 32; reg_rt = (reg_rt + 1) % 32;
} }
else else
{ {
for (sindex = 0; sindex < selem; sindex++) for (sindex = 0; sindex < selem; sindex++)
{ {
if (bit (aarch64_insn_r->aarch64_insn, 22)) if (bit (aarch64_insn_r->aarch64_insn, 22))
record_buf[reg_index++] = reg_rt + AARCH64_V0_REGNUM; record_buf[reg_index++] = reg_rt + AARCH64_V0_REGNUM;
@@ -3970,7 +3970,7 @@ aarch64_record_asimd_load_store (insn_decode_record *aarch64_insn_r)
addr_offset = addr_offset + (esize / 8); addr_offset = addr_offset + (esize / 8);
reg_rt = (reg_rt + 1) % 32; reg_rt = (reg_rt + 1) % 32;
} }
} }
} }
/* Load/store multiple structure. */ /* Load/store multiple structure. */
else else
@@ -3980,69 +3980,69 @@ aarch64_record_asimd_load_store (insn_decode_record *aarch64_insn_r)
esize = 8 << size_bits; esize = 8 << size_bits;
if (bit (aarch64_insn_r->aarch64_insn, 30)) if (bit (aarch64_insn_r->aarch64_insn, 30))
elements = 128 / esize; elements = 128 / esize;
else else
elements = 64 / esize; elements = 64 / esize;
switch (opcode_bits) switch (opcode_bits)
{ {
/*LD/ST4 (4 Registers). */ /*LD/ST4 (4 Registers). */
case 0: case 0:
rpt = 1; rpt = 1;
selem = 4; selem = 4;
break; break;
/*LD/ST1 (4 Registers). */ /*LD/ST1 (4 Registers). */
case 2: case 2:
rpt = 4; rpt = 4;
selem = 1; selem = 1;
break; break;
/*LD/ST3 (3 Registers). */ /*LD/ST3 (3 Registers). */
case 4: case 4:
rpt = 1; rpt = 1;
selem = 3; selem = 3;
break; break;
/*LD/ST1 (3 Registers). */ /*LD/ST1 (3 Registers). */
case 6: case 6:
rpt = 3; rpt = 3;
selem = 1; selem = 1;
break; break;
/*LD/ST1 (1 Register). */ /*LD/ST1 (1 Register). */
case 7: case 7:
rpt = 1; rpt = 1;
selem = 1; selem = 1;
break; break;
/*LD/ST2 (2 Registers). */ /*LD/ST2 (2 Registers). */
case 8: case 8:
rpt = 1; rpt = 1;
selem = 2; selem = 2;
break; break;
/*LD/ST1 (2 Registers). */ /*LD/ST1 (2 Registers). */
case 10: case 10:
rpt = 2; rpt = 2;
selem = 1; selem = 1;
break; break;
default: default:
return AARCH64_RECORD_UNSUPPORTED; return AARCH64_RECORD_UNSUPPORTED;
break; break;
} }
for (rindex = 0; rindex < rpt; rindex++) for (rindex = 0; rindex < rpt; rindex++)
for (eindex = 0; eindex < elements; eindex++) for (eindex = 0; eindex < elements; eindex++)
{ {
uint8_t reg_tt, sindex; uint8_t reg_tt, sindex;
reg_tt = (reg_rt + rindex) % 32; reg_tt = (reg_rt + rindex) % 32;
for (sindex = 0; sindex < selem; sindex++) for (sindex = 0; sindex < selem; sindex++)
{ {
if (bit (aarch64_insn_r->aarch64_insn, 22)) if (bit (aarch64_insn_r->aarch64_insn, 22))
record_buf[reg_index++] = reg_tt + AARCH64_V0_REGNUM; record_buf[reg_index++] = reg_tt + AARCH64_V0_REGNUM;
else else
{ {
record_buf_mem[mem_index++] = esize / 8; record_buf_mem[mem_index++] = esize / 8;
record_buf_mem[mem_index++] = address + addr_offset; record_buf_mem[mem_index++] = address + addr_offset;
} }
addr_offset = addr_offset + (esize / 8); addr_offset = addr_offset + (esize / 8);
reg_tt = (reg_tt + 1) % 32; reg_tt = (reg_tt + 1) % 32;
} }
} }
} }
if (bit (aarch64_insn_r->aarch64_insn, 23)) if (bit (aarch64_insn_r->aarch64_insn, 23))
@@ -4051,9 +4051,9 @@ aarch64_record_asimd_load_store (insn_decode_record *aarch64_insn_r)
aarch64_insn_r->reg_rec_count = reg_index; aarch64_insn_r->reg_rec_count = reg_index;
aarch64_insn_r->mem_rec_count = mem_index / 2; aarch64_insn_r->mem_rec_count = mem_index / 2;
MEM_ALLOC (aarch64_insn_r->aarch64_mems, aarch64_insn_r->mem_rec_count, MEM_ALLOC (aarch64_insn_r->aarch64_mems, aarch64_insn_r->mem_rec_count,
record_buf_mem); record_buf_mem);
REG_ALLOC (aarch64_insn_r->aarch64_regs, aarch64_insn_r->reg_rec_count, REG_ALLOC (aarch64_insn_r->aarch64_regs, aarch64_insn_r->reg_rec_count,
record_buf); record_buf);
return AARCH64_RECORD_SUCCESS; return AARCH64_RECORD_SUCCESS;
} }
@@ -4124,9 +4124,9 @@ aarch64_record_load_store (insn_decode_record *aarch64_insn_r)
if (record_debug) if (record_debug)
debug_printf ("Process record: load register (literal)\n"); debug_printf ("Process record: load register (literal)\n");
if (vector_flag) if (vector_flag)
record_buf[0] = reg_rt + AARCH64_V0_REGNUM; record_buf[0] = reg_rt + AARCH64_V0_REGNUM;
else else
record_buf[0] = reg_rt; record_buf[0] = reg_rt;
aarch64_insn_r->reg_rec_count = 1; aarch64_insn_r->reg_rec_count = 1;
} }
/* All types of load/store pair instructions decoding. */ /* All types of load/store pair instructions decoding. */
@@ -4136,46 +4136,46 @@ aarch64_record_load_store (insn_decode_record *aarch64_insn_r)
debug_printf ("Process record: load/store pair\n"); debug_printf ("Process record: load/store pair\n");
if (ld_flag) if (ld_flag)
{ {
if (vector_flag) if (vector_flag)
{ {
record_buf[0] = reg_rt + AARCH64_V0_REGNUM; record_buf[0] = reg_rt + AARCH64_V0_REGNUM;
record_buf[1] = reg_rt2 + AARCH64_V0_REGNUM; record_buf[1] = reg_rt2 + AARCH64_V0_REGNUM;
} }
else else
{ {
record_buf[0] = reg_rt; record_buf[0] = reg_rt;
record_buf[1] = reg_rt2; record_buf[1] = reg_rt2;
} }
aarch64_insn_r->reg_rec_count = 2; aarch64_insn_r->reg_rec_count = 2;
} }
else else
{ {
uint16_t imm7_off; uint16_t imm7_off;
imm7_off = bits (aarch64_insn_r->aarch64_insn, 15, 21); imm7_off = bits (aarch64_insn_r->aarch64_insn, 15, 21);
if (!vector_flag) if (!vector_flag)
size_bits = size_bits >> 1; size_bits = size_bits >> 1;
datasize = 8 << (2 + size_bits); datasize = 8 << (2 + size_bits);
offset = (imm7_off & 0x40) ? (~imm7_off & 0x007f) + 1 : imm7_off; offset = (imm7_off & 0x40) ? (~imm7_off & 0x007f) + 1 : imm7_off;
offset = offset << (2 + size_bits); offset = offset << (2 + size_bits);
regcache_raw_read_unsigned (aarch64_insn_r->regcache, reg_rn, regcache_raw_read_unsigned (aarch64_insn_r->regcache, reg_rn,
&address); &address);
if (!((insn_bits24_27 & 0x0b) == 0x08 && insn_bit23)) if (!((insn_bits24_27 & 0x0b) == 0x08 && insn_bit23))
{ {
if (imm7_off & 0x40) if (imm7_off & 0x40)
address = address - offset; address = address - offset;
else else
address = address + offset; address = address + offset;
} }
record_buf_mem[0] = datasize / 8; record_buf_mem[0] = datasize / 8;
record_buf_mem[1] = address; record_buf_mem[1] = address;
record_buf_mem[2] = datasize / 8; record_buf_mem[2] = datasize / 8;
record_buf_mem[3] = address + (datasize / 8); record_buf_mem[3] = address + (datasize / 8);
aarch64_insn_r->mem_rec_count = 2; aarch64_insn_r->mem_rec_count = 2;
} }
if (bit (aarch64_insn_r->aarch64_insn, 23)) if (bit (aarch64_insn_r->aarch64_insn, 23))
record_buf[aarch64_insn_r->reg_rec_count++] = reg_rn; record_buf[aarch64_insn_r->reg_rec_count++] = reg_rn;
} }
/* Load/store register (unsigned immediate) instructions. */ /* Load/store register (unsigned immediate) instructions. */
else if ((insn_bits24_27 & 0x0b) == 0x09 && insn_bits28_29 == 0x03) else if ((insn_bits24_27 & 0x0b) == 0x09 && insn_bits28_29 == 0x03)
@@ -4217,26 +4217,26 @@ aarch64_record_load_store (insn_decode_record *aarch64_insn_r)
} }
if (!ld_flag) if (!ld_flag)
{ {
offset = bits (aarch64_insn_r->aarch64_insn, 10, 21); offset = bits (aarch64_insn_r->aarch64_insn, 10, 21);
datasize = 8 << size_bits; datasize = 8 << size_bits;
regcache_raw_read_unsigned (aarch64_insn_r->regcache, reg_rn, regcache_raw_read_unsigned (aarch64_insn_r->regcache, reg_rn,
&address); &address);
offset = offset << size_bits; offset = offset << size_bits;
address = address + offset; address = address + offset;
record_buf_mem[0] = datasize >> 3; record_buf_mem[0] = datasize >> 3;
record_buf_mem[1] = address; record_buf_mem[1] = address;
aarch64_insn_r->mem_rec_count = 1; aarch64_insn_r->mem_rec_count = 1;
} }
else else
{ {
if (vector_flag) if (vector_flag)
record_buf[0] = reg_rt + AARCH64_V0_REGNUM; record_buf[0] = reg_rt + AARCH64_V0_REGNUM;
else else
record_buf[0] = reg_rt; record_buf[0] = reg_rt;
aarch64_insn_r->reg_rec_count = 1; aarch64_insn_r->reg_rec_count = 1;
} }
} }
/* Load/store register (register offset) instructions. */ /* Load/store register (register offset) instructions. */
else if ((insn_bits24_27 & 0x0b) == 0x08 && insn_bits28_29 == 0x03 else if ((insn_bits24_27 & 0x0b) == 0x08 && insn_bits28_29 == 0x03
@@ -4246,42 +4246,42 @@ aarch64_record_load_store (insn_decode_record *aarch64_insn_r)
debug_printf ("Process record: load/store (register offset)\n"); debug_printf ("Process record: load/store (register offset)\n");
opc = bits (aarch64_insn_r->aarch64_insn, 22, 23); opc = bits (aarch64_insn_r->aarch64_insn, 22, 23);
if (!(opc >> 1)) if (!(opc >> 1))
if (opc & 0x01) if (opc & 0x01)
ld_flag = 0x01; ld_flag = 0x01;
else else
ld_flag = 0x0; ld_flag = 0x0;
else else
if (size_bits != 0x03) if (size_bits != 0x03)
ld_flag = 0x01; ld_flag = 0x01;
else else
return AARCH64_RECORD_UNKNOWN; return AARCH64_RECORD_UNKNOWN;
if (!ld_flag) if (!ld_flag)
{ {
ULONGEST reg_rm_val; ULONGEST reg_rm_val;
regcache_raw_read_unsigned (aarch64_insn_r->regcache, regcache_raw_read_unsigned (aarch64_insn_r->regcache,
bits (aarch64_insn_r->aarch64_insn, 16, 20), &reg_rm_val); bits (aarch64_insn_r->aarch64_insn, 16, 20), &reg_rm_val);
if (bit (aarch64_insn_r->aarch64_insn, 12)) if (bit (aarch64_insn_r->aarch64_insn, 12))
offset = reg_rm_val << size_bits; offset = reg_rm_val << size_bits;
else else
offset = reg_rm_val; offset = reg_rm_val;
datasize = 8 << size_bits; datasize = 8 << size_bits;
regcache_raw_read_unsigned (aarch64_insn_r->regcache, reg_rn, regcache_raw_read_unsigned (aarch64_insn_r->regcache, reg_rn,
&address); &address);
address = address + offset; address = address + offset;
record_buf_mem[0] = datasize >> 3; record_buf_mem[0] = datasize >> 3;
record_buf_mem[1] = address; record_buf_mem[1] = address;
aarch64_insn_r->mem_rec_count = 1; aarch64_insn_r->mem_rec_count = 1;
} }
else else
{ {
if (vector_flag) if (vector_flag)
record_buf[0] = reg_rt + AARCH64_V0_REGNUM; record_buf[0] = reg_rt + AARCH64_V0_REGNUM;
else else
record_buf[0] = reg_rt; record_buf[0] = reg_rt;
aarch64_insn_r->reg_rec_count = 1; aarch64_insn_r->reg_rec_count = 1;
} }
} }
/* Load/store register (immediate and unprivileged) instructions. */ /* Load/store register (immediate and unprivileged) instructions. */
else if ((insn_bits24_27 & 0x0b) == 0x08 && insn_bits28_29 == 0x03 else if ((insn_bits24_27 & 0x0b) == 0x08 && insn_bits28_29 == 0x03
@@ -4294,54 +4294,54 @@ aarch64_record_load_store (insn_decode_record *aarch64_insn_r)
} }
opc = bits (aarch64_insn_r->aarch64_insn, 22, 23); opc = bits (aarch64_insn_r->aarch64_insn, 22, 23);
if (!(opc >> 1)) if (!(opc >> 1))
if (opc & 0x01) if (opc & 0x01)
ld_flag = 0x01; ld_flag = 0x01;
else else
ld_flag = 0x0; ld_flag = 0x0;
else else
if (size_bits != 0x03) if (size_bits != 0x03)
ld_flag = 0x01; ld_flag = 0x01;
else else
return AARCH64_RECORD_UNKNOWN; return AARCH64_RECORD_UNKNOWN;
if (!ld_flag) if (!ld_flag)
{ {
uint16_t imm9_off; uint16_t imm9_off;
imm9_off = bits (aarch64_insn_r->aarch64_insn, 12, 20); 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; datasize = 8 << size_bits;
regcache_raw_read_unsigned (aarch64_insn_r->regcache, reg_rn, regcache_raw_read_unsigned (aarch64_insn_r->regcache, reg_rn,
&address); &address);
if (insn_bits10_11 != 0x01) if (insn_bits10_11 != 0x01)
{ {
if (imm9_off & 0x0100) if (imm9_off & 0x0100)
address = address - offset; address = address - offset;
else else
address = address + offset; address = address + offset;
} }
record_buf_mem[0] = datasize >> 3; record_buf_mem[0] = datasize >> 3;
record_buf_mem[1] = address; record_buf_mem[1] = address;
aarch64_insn_r->mem_rec_count = 1; aarch64_insn_r->mem_rec_count = 1;
} }
else else
{ {
if (vector_flag) if (vector_flag)
record_buf[0] = reg_rt + AARCH64_V0_REGNUM; record_buf[0] = reg_rt + AARCH64_V0_REGNUM;
else else
record_buf[0] = reg_rt; record_buf[0] = reg_rt;
aarch64_insn_r->reg_rec_count = 1; aarch64_insn_r->reg_rec_count = 1;
} }
if (insn_bits10_11 == 0x01 || insn_bits10_11 == 0x03) if (insn_bits10_11 == 0x01 || insn_bits10_11 == 0x03)
record_buf[aarch64_insn_r->reg_rec_count++] = reg_rn; record_buf[aarch64_insn_r->reg_rec_count++] = reg_rn;
} }
/* Advanced SIMD load/store instructions. */ /* Advanced SIMD load/store instructions. */
else else
return aarch64_record_asimd_load_store (aarch64_insn_r); return aarch64_record_asimd_load_store (aarch64_insn_r);
MEM_ALLOC (aarch64_insn_r->aarch64_mems, aarch64_insn_r->mem_rec_count, MEM_ALLOC (aarch64_insn_r->aarch64_mems, aarch64_insn_r->mem_rec_count,
record_buf_mem); record_buf_mem);
REG_ALLOC (aarch64_insn_r->aarch64_regs, aarch64_insn_r->reg_rec_count, REG_ALLOC (aarch64_insn_r->aarch64_regs, aarch64_insn_r->reg_rec_count,
record_buf); record_buf);
return AARCH64_RECORD_SUCCESS; return AARCH64_RECORD_SUCCESS;
} }
@@ -4390,7 +4390,7 @@ aarch64_record_data_proc_simd_fp (insn_decode_record *aarch64_insn_r)
record_buf[0] = AARCH64_CPSR_REGNUM; record_buf[0] = AARCH64_CPSR_REGNUM;
} }
/* Floating point - data processing (2-source) and /* Floating point - data processing (2-source) and
conditional select instructions. */ conditional select instructions. */
else if (insn_bits10_11 == 0x02 || insn_bits10_11 == 0x03) else if (insn_bits10_11 == 0x02 || insn_bits10_11 == 0x03)
{ {
if (record_debug) if (record_debug)
@@ -4447,10 +4447,10 @@ aarch64_record_data_proc_simd_fp (insn_decode_record *aarch64_insn_r)
} }
else else
return AARCH64_RECORD_UNKNOWN; return AARCH64_RECORD_UNKNOWN;
} }
else else
return AARCH64_RECORD_UNKNOWN; return AARCH64_RECORD_UNKNOWN;
} }
else else
return AARCH64_RECORD_UNKNOWN; return AARCH64_RECORD_UNKNOWN;
} }

View File

@@ -105,7 +105,7 @@ struct gdbarch_tdep
const target_desc *aarch64_read_description (uint64_t vq, bool pauth_p); const target_desc *aarch64_read_description (uint64_t vq, bool pauth_p);
extern int aarch64_process_record (struct gdbarch *gdbarch, extern int aarch64_process_record (struct gdbarch *gdbarch,
struct regcache *regcache, CORE_ADDR addr); struct regcache *regcache, CORE_ADDR addr);
displaced_step_closure_up displaced_step_closure_up
aarch64_displaced_step_copy_insn (struct gdbarch *gdbarch, aarch64_displaced_step_copy_insn (struct gdbarch *gdbarch,

View File

@@ -208,7 +208,7 @@ primary : primary '(' arglist ')'
write_exp_elt_opcode (pstate, OP_FUNCALL); write_exp_elt_opcode (pstate, OP_FUNCALL);
write_exp_elt_longcst (pstate, $3); write_exp_elt_longcst (pstate, $3);
write_exp_elt_opcode (pstate, OP_FUNCALL); write_exp_elt_opcode (pstate, OP_FUNCALL);
} }
| var_or_type '(' arglist ')' | var_or_type '(' arglist ')'
{ {
if ($1 != NULL) if ($1 != NULL)
@@ -248,7 +248,7 @@ primary :
{ write_exp_elt_opcode (pstate, TERNOP_SLICE); } { write_exp_elt_opcode (pstate, TERNOP_SLICE); }
| var_or_type '(' simple_exp DOTDOT simple_exp ')' | var_or_type '(' simple_exp DOTDOT simple_exp ')'
{ if ($1 == NULL) { if ($1 == NULL)
write_exp_elt_opcode (pstate, TERNOP_SLICE); write_exp_elt_opcode (pstate, TERNOP_SLICE);
else else
error (_("Cannot slice a type")); error (_("Cannot slice a type"));
} }
@@ -280,7 +280,7 @@ primary : DOLLAR_VARIABLE /* Various GDB extensions */
; ;
primary : aggregate primary : aggregate
; ;
simple_exp : primary simple_exp : primary
; ;
@@ -380,7 +380,7 @@ relation : simple_exp LEQ simple_exp
relation : simple_exp IN simple_exp DOTDOT simple_exp relation : simple_exp IN simple_exp DOTDOT simple_exp
{ write_exp_elt_opcode (pstate, TERNOP_IN_RANGE); } { write_exp_elt_opcode (pstate, TERNOP_IN_RANGE); }
| simple_exp IN primary TICK_RANGE tick_arglist | simple_exp IN primary TICK_RANGE tick_arglist
{ write_exp_elt_opcode (pstate, BINOP_IN_BOUNDS); { write_exp_elt_opcode (pstate, BINOP_IN_BOUNDS);
write_exp_elt_longcst (pstate, (LONGEST) $5); write_exp_elt_longcst (pstate, (LONGEST) $5);
write_exp_elt_opcode (pstate, BINOP_IN_BOUNDS); write_exp_elt_opcode (pstate, BINOP_IN_BOUNDS);
@@ -390,27 +390,27 @@ relation : simple_exp IN simple_exp DOTDOT simple_exp
if ($3 == NULL) if ($3 == NULL)
error (_("Right operand of 'in' must be type")); error (_("Right operand of 'in' must be type"));
write_exp_elt_opcode (pstate, UNOP_IN_RANGE); write_exp_elt_opcode (pstate, UNOP_IN_RANGE);
write_exp_elt_type (pstate, $3); write_exp_elt_type (pstate, $3);
write_exp_elt_opcode (pstate, UNOP_IN_RANGE); write_exp_elt_opcode (pstate, UNOP_IN_RANGE);
} }
| simple_exp NOT IN simple_exp DOTDOT simple_exp | simple_exp NOT IN simple_exp DOTDOT simple_exp
{ write_exp_elt_opcode (pstate, TERNOP_IN_RANGE); { write_exp_elt_opcode (pstate, TERNOP_IN_RANGE);
write_exp_elt_opcode (pstate, UNOP_LOGICAL_NOT); write_exp_elt_opcode (pstate, UNOP_LOGICAL_NOT);
} }
| simple_exp NOT IN primary TICK_RANGE tick_arglist | simple_exp NOT IN primary TICK_RANGE tick_arglist
{ write_exp_elt_opcode (pstate, BINOP_IN_BOUNDS); { write_exp_elt_opcode (pstate, BINOP_IN_BOUNDS);
write_exp_elt_longcst (pstate, (LONGEST) $6); write_exp_elt_longcst (pstate, (LONGEST) $6);
write_exp_elt_opcode (pstate, BINOP_IN_BOUNDS); write_exp_elt_opcode (pstate, BINOP_IN_BOUNDS);
write_exp_elt_opcode (pstate, UNOP_LOGICAL_NOT); write_exp_elt_opcode (pstate, UNOP_LOGICAL_NOT);
} }
| simple_exp NOT IN var_or_type %prec TICK_ACCESS | simple_exp NOT IN var_or_type %prec TICK_ACCESS
{ {
if ($4 == NULL) if ($4 == NULL)
error (_("Right operand of 'in' must be type")); error (_("Right operand of 'in' must be type"));
write_exp_elt_opcode (pstate, UNOP_IN_RANGE); write_exp_elt_opcode (pstate, UNOP_IN_RANGE);
write_exp_elt_type (pstate, $4); write_exp_elt_type (pstate, $4);
write_exp_elt_opcode (pstate, UNOP_IN_RANGE); write_exp_elt_opcode (pstate, UNOP_IN_RANGE);
write_exp_elt_opcode (pstate, UNOP_LOGICAL_NOT); write_exp_elt_opcode (pstate, UNOP_LOGICAL_NOT);
} }
; ;
@@ -446,7 +446,7 @@ and_then_exp :
{ write_exp_elt_opcode (pstate, BINOP_LOGICAL_AND); } { write_exp_elt_opcode (pstate, BINOP_LOGICAL_AND); }
| and_then_exp _AND_ THEN relation | and_then_exp _AND_ THEN relation
{ write_exp_elt_opcode (pstate, BINOP_LOGICAL_AND); } { write_exp_elt_opcode (pstate, BINOP_LOGICAL_AND); }
; ;
or_exp : or_exp :
relation OR relation relation OR relation
@@ -460,13 +460,13 @@ or_else_exp :
{ write_exp_elt_opcode (pstate, BINOP_LOGICAL_OR); } { write_exp_elt_opcode (pstate, BINOP_LOGICAL_OR); }
| or_else_exp OR ELSE relation | or_else_exp OR ELSE relation
{ write_exp_elt_opcode (pstate, BINOP_LOGICAL_OR); } { write_exp_elt_opcode (pstate, BINOP_LOGICAL_OR); }
; ;
xor_exp : relation XOR relation xor_exp : relation XOR relation
{ write_exp_elt_opcode (pstate, BINOP_BITWISE_XOR); } { write_exp_elt_opcode (pstate, BINOP_BITWISE_XOR); }
| xor_exp XOR relation | xor_exp XOR relation
{ write_exp_elt_opcode (pstate, BINOP_BITWISE_XOR); } { write_exp_elt_opcode (pstate, BINOP_BITWISE_XOR); }
; ;
/* Primaries can denote types (OP_TYPE). In cases such as /* Primaries can denote types (OP_TYPE). In cases such as
primary TICK_ADDRESS, where a type would be invalid, it will be primary TICK_ADDRESS, where a type would be invalid, it will be
@@ -494,13 +494,13 @@ primary : primary TICK_ACCESS
| primary TICK_LENGTH tick_arglist | primary TICK_LENGTH tick_arglist
{ write_int (pstate, $3, type_int (pstate)); { write_int (pstate, $3, type_int (pstate));
write_exp_elt_opcode (pstate, OP_ATR_LENGTH); } write_exp_elt_opcode (pstate, OP_ATR_LENGTH); }
| primary TICK_SIZE | primary TICK_SIZE
{ write_exp_elt_opcode (pstate, OP_ATR_SIZE); } { write_exp_elt_opcode (pstate, OP_ATR_SIZE); }
| primary TICK_TAG | primary TICK_TAG
{ write_exp_elt_opcode (pstate, OP_ATR_TAG); } { write_exp_elt_opcode (pstate, OP_ATR_TAG); }
| opt_type_prefix TICK_MIN '(' exp ',' exp ')' | opt_type_prefix TICK_MIN '(' exp ',' exp ')'
{ write_exp_elt_opcode (pstate, OP_ATR_MIN); } { write_exp_elt_opcode (pstate, OP_ATR_MIN); }
| opt_type_prefix TICK_MAX '(' exp ',' exp ')' | opt_type_prefix TICK_MAX '(' exp ',' exp ')'
{ write_exp_elt_opcode (pstate, OP_ATR_MAX); } { write_exp_elt_opcode (pstate, OP_ATR_MAX); }
| opt_type_prefix TICK_POS '(' exp ')' | opt_type_prefix TICK_POS '(' exp ')'
{ write_exp_elt_opcode (pstate, OP_ATR_POS); } { write_exp_elt_opcode (pstate, OP_ATR_POS); }
@@ -517,7 +517,7 @@ tick_arglist : %prec '('
; ;
type_prefix : type_prefix :
var_or_type var_or_type
{ {
if ($1 == NULL) if ($1 == NULL)
error (_("Prefix must be type")); error (_("Prefix must be type"));
@@ -541,7 +541,7 @@ primary : INT
; ;
primary : CHARLIT primary : CHARLIT
{ write_int (pstate, { write_int (pstate,
convert_char_literal (type_qualifier, $1.val), convert_char_literal (type_qualifier, $1.val),
(type_qualifier == NULL) (type_qualifier == NULL)
? $1.type : type_qualifier); ? $1.type : type_qualifier);
@@ -568,7 +568,7 @@ primary : STRING
primary : TRUEKEYWORD primary : TRUEKEYWORD
{ write_int (pstate, 1, type_boolean (pstate)); } { write_int (pstate, 1, type_boolean (pstate)); }
| FALSEKEYWORD | FALSEKEYWORD
{ write_int (pstate, 0, type_boolean (pstate)); } { write_int (pstate, 0, type_boolean (pstate)); }
; ;
@@ -579,7 +579,7 @@ primary : NEW NAME
var_or_type: NAME %prec VAR var_or_type: NAME %prec VAR
{ $$ = write_var_or_type (pstate, NULL, $1); } { $$ = write_var_or_type (pstate, NULL, $1); }
| block NAME %prec VAR | block NAME %prec VAR
{ $$ = write_var_or_type (pstate, $1, $2); } { $$ = write_var_or_type (pstate, $1, $2); }
| NAME TICK_ACCESS | NAME TICK_ACCESS
{ {
$$ = write_var_or_type (pstate, NULL, $1); $$ = write_var_or_type (pstate, NULL, $1);
@@ -611,7 +611,7 @@ aggregate :
write_exp_elt_opcode (pstate, OP_AGGREGATE); write_exp_elt_opcode (pstate, OP_AGGREGATE);
write_exp_elt_longcst (pstate, $2); write_exp_elt_longcst (pstate, $2);
write_exp_elt_opcode (pstate, OP_AGGREGATE); write_exp_elt_opcode (pstate, OP_AGGREGATE);
} }
; ;
aggregate_component_list : aggregate_component_list :
@@ -658,7 +658,7 @@ component_group :
write_exp_elt_opcode (pstate, OP_CHOICES); write_exp_elt_opcode (pstate, OP_CHOICES);
write_exp_elt_longcst (pstate, $1); write_exp_elt_longcst (pstate, $1);
write_exp_elt_opcode (pstate, OP_CHOICES); write_exp_elt_opcode (pstate, OP_CHOICES);
} }
; ;
/* We use this somewhat obscure definition in order to handle NAME => and /* We use this somewhat obscure definition in order to handle NAME => and
@@ -679,10 +679,10 @@ component_associations :
} }
exp { $$ = 1; } exp { $$ = 1; }
| NAME '|' | NAME '|'
{ write_name_assoc (pstate, $1); } { write_name_assoc (pstate, $1); }
component_associations { $$ = $4 + 1; } component_associations { $$ = $4 + 1; }
| simple_exp '|' | simple_exp '|'
component_associations { $$ = $3 + 1; } component_associations { $$ = $3 + 1; }
| simple_exp DOTDOT simple_exp '|' | simple_exp DOTDOT simple_exp '|'
{ write_exp_elt_opcode (pstate, OP_DISCRETE_RANGE); } { write_exp_elt_opcode (pstate, OP_DISCRETE_RANGE); }
component_associations { $$ = $6 + 1; } component_associations { $$ = $6 + 1; }
@@ -851,9 +851,9 @@ write_object_renaming (struct parser_state *par_state,
switch (*renaming_expr) { switch (*renaming_expr) {
case 'A': case 'A':
renaming_expr += 1; renaming_expr += 1;
write_exp_elt_opcode (par_state, UNOP_IND); write_exp_elt_opcode (par_state, UNOP_IND);
break; break;
case 'L': case 'L':
slice_state = LOWER_BOUND; slice_state = LOWER_BOUND;
/* FALLTHROUGH */ /* FALLTHROUGH */
@@ -1124,7 +1124,7 @@ write_ambiguous_var (struct parser_state *par_state,
static int static int
ada_nget_field_index (const struct type *type, const char *field_name0, ada_nget_field_index (const struct type *type, const char *field_name0,
int field_name_len, int maybe_missing) int field_name_len, int maybe_missing)
{ {
char *field_name = (char *) alloca ((field_name_len + 1) * sizeof (char)); char *field_name = (char *) alloca ((field_name_len + 1) * sizeof (char));
@@ -1162,7 +1162,7 @@ get_symbol_field_type (struct symbol *sym, char *encoded_field_name)
fieldno = ada_get_field_index (type, field_name, 1); fieldno = ada_get_field_index (type, field_name, 1);
if (fieldno >= 0) if (fieldno >= 0)
return type->field (fieldno).type (); return type->field (fieldno).type ();
subfield_name = field_name; subfield_name = field_name;
while (*subfield_name != '\0' && *subfield_name != '.' while (*subfield_name != '\0' && *subfield_name != '.'
@@ -1170,12 +1170,12 @@ get_symbol_field_type (struct symbol *sym, char *encoded_field_name)
subfield_name += 1; subfield_name += 1;
if (subfield_name[0] == '\0') if (subfield_name[0] == '\0')
return NULL; return NULL;
fieldno = ada_nget_field_index (type, field_name, fieldno = ada_nget_field_index (type, field_name,
subfield_name - field_name, 1); subfield_name - field_name, 1);
if (fieldno < 0) if (fieldno < 0)
return NULL; return NULL;
type = type->field (fieldno).type (); type = type->field (fieldno).type ();
field_name = subfield_name; field_name = subfield_name;
@@ -1248,7 +1248,7 @@ write_var_or_type (struct parser_state *par_state,
case ADA_EXCEPTION_RENAMING: case ADA_EXCEPTION_RENAMING:
case ADA_SUBPROGRAM_RENAMING: case ADA_SUBPROGRAM_RENAMING:
{ {
int alloc_len = renaming_len + name_len - tail_index + 1; int alloc_len = renaming_len + name_len - tail_index + 1;
char *new_name char *new_name
= (char *) obstack_alloc (&temp_parse_space, alloc_len); = (char *) obstack_alloc (&temp_parse_space, alloc_len);
strncpy (new_name, renaming, renaming_len); strncpy (new_name, renaming, renaming_len);
@@ -1269,21 +1269,21 @@ write_var_or_type (struct parser_state *par_state,
if (type_sym != NULL) if (type_sym != NULL)
{ {
struct type *field_type; struct type *field_type;
if (tail_index == name_len) if (tail_index == name_len)
return SYMBOL_TYPE (type_sym); return SYMBOL_TYPE (type_sym);
/* We have some extraneous characters after the type name. /* We have some extraneous characters after the type name.
If this is an expression "TYPE_NAME.FIELD0.[...].FIELDN", If this is an expression "TYPE_NAME.FIELD0.[...].FIELDN",
then try to get the type of FIELDN. */ then try to get the type of FIELDN. */
field_type field_type
= get_symbol_field_type (type_sym, encoded_name + tail_index); = get_symbol_field_type (type_sym, encoded_name + tail_index);
if (field_type != NULL) if (field_type != NULL)
return field_type; return field_type;
else else
error (_("Invalid attempt to select from type: \"%s\"."), error (_("Invalid attempt to select from type: \"%s\"."),
name0.ptr); name0.ptr);
} }
else if (tail_index == name_len && nsyms == 0) else if (tail_index == name_len && nsyms == 0)
{ {

File diff suppressed because it is too large Load Diff

View File

@@ -85,17 +85,17 @@ enum ada_renaming_category
ADA_NOT_RENAMING, ADA_NOT_RENAMING,
/* For symbols declared /* For symbols declared
Foo : TYPE renamed OBJECT; */ Foo : TYPE renamed OBJECT; */
ADA_OBJECT_RENAMING, ADA_OBJECT_RENAMING,
/* For symbols declared /* For symbols declared
Foo : exception renames EXCEPTION; */ Foo : exception renames EXCEPTION; */
ADA_EXCEPTION_RENAMING, ADA_EXCEPTION_RENAMING,
/* For packages declared /* For packages declared
package Foo renames PACKAGE; */ package Foo renames PACKAGE; */
ADA_PACKAGE_RENAMING, ADA_PACKAGE_RENAMING,
/* For subprograms declared /* For subprograms declared
SUBPROGRAM_SPEC renames SUBPROGRAM; SUBPROGRAM_SPEC renames SUBPROGRAM;
(Currently not used). */ (Currently not used). */
ADA_SUBPROGRAM_RENAMING ADA_SUBPROGRAM_RENAMING
}; };
@@ -152,14 +152,14 @@ struct ada_task_info
extern void ada_ensure_varsize_limit (const struct type *type); extern void ada_ensure_varsize_limit (const struct type *type);
extern int ada_get_field_index (const struct type *type, extern int ada_get_field_index (const struct type *type,
const char *field_name, const char *field_name,
int maybe_missing); 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, extern void ada_print_type (struct type *, const char *, struct ui_file *, int,
int, const struct type_print_options *); int, const struct type_print_options *);
extern void ada_print_typedef (struct type *type, struct symbol *new_symbol, extern void ada_print_typedef (struct type *type, struct symbol *new_symbol,
struct ui_file *stream); struct ui_file *stream);
@@ -172,7 +172,7 @@ extern void ada_value_print_inner (struct value *, struct ui_file *, int,
extern void ada_value_print (struct value *, struct ui_file *, extern void ada_value_print (struct value *, struct ui_file *,
const struct value_print_options *); 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); extern void ada_emit_char (int, struct type *, struct ui_file *, int, int);
@@ -183,12 +183,12 @@ extern void ada_printstr (struct ui_file *, struct type *, const gdb_byte *,
const struct value_print_options *); const struct value_print_options *);
struct value *ada_convert_actual (struct value *actual, struct value *ada_convert_actual (struct value *actual,
struct type *formal_type0); struct type *formal_type0);
extern bool ada_is_access_to_unconstrained_array (struct type *type); extern bool ada_is_access_to_unconstrained_array (struct type *type);
extern struct value *ada_value_subscript (struct value *, int, extern struct value *ada_value_subscript (struct value *, int,
struct value **); struct value **);
extern void ada_fixup_array_indexes_type (struct type *index_desc_type); extern void ada_fixup_array_indexes_type (struct type *index_desc_type);
@@ -219,7 +219,7 @@ extern const char *ada_decode_symbol (const struct general_symbol_info *);
extern std::string ada_decode (const char*); extern std::string ada_decode (const char*);
extern int ada_lookup_symbol_list (const char *, const struct block *, extern int ada_lookup_symbol_list (const char *, const struct block *,
domain_enum, domain_enum,
std::vector<struct block_symbol> *); std::vector<struct block_symbol> *);
extern struct block_symbol ada_lookup_symbol (const char *, extern struct block_symbol ada_lookup_symbol (const char *,
@@ -247,8 +247,8 @@ extern int ada_is_constrained_packed_array_type (struct type *);
extern struct value *ada_value_primitive_packed_val (struct value *, extern struct value *ada_value_primitive_packed_val (struct value *,
const gdb_byte *, const gdb_byte *,
long, int, int, long, int, int,
struct type *); struct type *);
extern struct type *ada_coerce_to_simple_array_type (struct type *); extern struct type *ada_coerce_to_simple_array_type (struct type *);
@@ -293,7 +293,7 @@ extern int ada_which_variant_applies (struct type *, struct value *);
extern struct type *ada_to_fixed_type (struct type *, const gdb_byte *, extern struct type *ada_to_fixed_type (struct type *, const gdb_byte *,
CORE_ADDR, struct value *, CORE_ADDR, struct value *,
int check_tag); int check_tag);
extern struct value *ada_to_fixed_value (struct value *val); extern struct value *ada_to_fixed_value (struct value *val);
@@ -308,7 +308,7 @@ extern int ada_name_prefix_len (const char *);
extern const char *ada_type_name (struct type *); extern const char *ada_type_name (struct type *);
extern struct type *ada_find_parallel_type (struct type *, extern struct type *ada_find_parallel_type (struct type *,
const char *suffix); const char *suffix);
extern bool get_int_var_value (const char *, LONGEST &value); extern bool get_int_var_value (const char *, LONGEST &value);

View File

@@ -203,9 +203,9 @@ struct ada_tasks_inferior_data
the list of Ada tasks. The value of this field influences the list of Ada tasks. The value of this field influences
the interpretation of the known_tasks_addr field below: the interpretation of the known_tasks_addr field below:
- ADA_TASKS_UNKNOWN: The value of known_tasks_addr hasn't - ADA_TASKS_UNKNOWN: The value of known_tasks_addr hasn't
been determined yet; been determined yet;
- ADA_TASKS_NOT_FOUND: The program probably does not use tasking - ADA_TASKS_NOT_FOUND: The program probably does not use tasking
and the known_tasks_addr is irrelevant; and the known_tasks_addr is irrelevant;
- ADA_TASKS_ARRAY: The known_tasks is an array; - ADA_TASKS_ARRAY: The known_tasks is an array;
- ADA_TASKS_LIST: The known_tasks is a list. */ - ADA_TASKS_LIST: The known_tasks is a list. */
enum ada_known_tasks_kind known_tasks_kind = ADA_TASKS_UNKNOWN; enum ada_known_tasks_kind known_tasks_kind = ADA_TASKS_UNKNOWN;
@@ -324,7 +324,7 @@ get_task_number_from_id (CORE_ADDR task_id, struct inferior *inf)
for (int i = 0; i < data->task_list.size (); i++) for (int i = 0; i < data->task_list.size (); i++)
{ {
if (data->task_list[i].task_id == task_id) if (data->task_list[i].task_id == task_id)
return i + 1; return i + 1;
} }
/* Task not found. Return 0. */ /* Task not found. Return 0. */
@@ -386,7 +386,7 @@ iterate_over_live_ada_tasks (ada_task_list_iterator_ftype iterator)
for (ada_task_info &task : data->task_list) for (ada_task_info &task : data->task_list)
{ {
if (!ada_task_is_alive (&task)) if (!ada_task_is_alive (&task))
continue; continue;
iterator (&task); iterator (&task);
} }
} }
@@ -432,9 +432,9 @@ read_fat_string_value (char *dest, struct value *val, int max_len)
bounds_type = type->field (bounds_fieldno).type (); bounds_type = type->field (bounds_fieldno).type ();
if (bounds_type->code () == TYPE_CODE_PTR) if (bounds_type->code () == TYPE_CODE_PTR)
bounds_type = TYPE_TARGET_TYPE (bounds_type); bounds_type = TYPE_TARGET_TYPE (bounds_type);
if (bounds_type->code () != TYPE_CODE_STRUCT) 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); upper_bound_fieldno = ada_get_field_index (bounds_type, "UB0", 0);
initialize_fieldnos = 0; initialize_fieldnos = 0;
@@ -502,20 +502,20 @@ ada_get_tcb_types_info (void)
if (atcb_sym == NULL || atcb_sym->type == NULL) if (atcb_sym == NULL || atcb_sym->type == NULL)
{ {
/* In Ravenscar run-time libs, the ATCB does not have a dynamic /* In Ravenscar run-time libs, the ATCB does not have a dynamic
size, so the symbol name differs. */ size, so the symbol name differs. */
atcb_sym = lookup_symbol_in_language (atcb_name_fixed, NULL, atcb_sym = lookup_symbol_in_language (atcb_name_fixed, NULL,
STRUCT_DOMAIN, language_c, STRUCT_DOMAIN, language_c,
NULL).symbol; NULL).symbol;
if (atcb_sym == NULL || atcb_sym->type == NULL) 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; type = atcb_sym->type;
} }
else else
{ {
/* Get a static representation of the type record /* Get a static representation of the type record
Ada_Task_Control_Block. */ Ada_Task_Control_Block. */
type = atcb_sym->type; type = atcb_sym->type;
type = ada_template_to_fixed_record_type_1 (type, NULL, 0, NULL, 0); type = ada_template_to_fixed_record_type_1 (type, NULL, 0, NULL, 0);
} }
@@ -547,7 +547,7 @@ ada_get_tcb_types_info (void)
fieldnos.image = ada_get_field_index (common_type, "task_image", 1); 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.image_len = ada_get_field_index (common_type, "task_image_len", 1);
fieldnos.activation_link = ada_get_field_index (common_type, fieldnos.activation_link = ada_get_field_index (common_type,
"activation_link", 1); "activation_link", 1);
fieldnos.call = ada_get_field_index (common_type, "call", 1); fieldnos.call = ada_get_field_index (common_type, "call", 1);
fieldnos.ll = ada_get_field_index (common_type, "ll", 0); fieldnos.ll = ada_get_field_index (common_type, "ll", 0);
fieldnos.base_cpu = ada_get_field_index (common_type, "base_cpu", 0); fieldnos.base_cpu = ada_get_field_index (common_type, "base_cpu", 0);
@@ -658,10 +658,10 @@ read_atcb (CORE_ADDR task_id, struct ada_task_info *task_info)
if (pspace_data->atcb_fieldno.image_len == -1) if (pspace_data->atcb_fieldno.image_len == -1)
{ {
if (pspace_data->atcb_fieldno.image >= 0) if (pspace_data->atcb_fieldno.image >= 0)
read_fat_string_value (task_info->name, read_fat_string_value (task_info->name,
value_field (common_value, value_field (common_value,
pspace_data->atcb_fieldno.image), pspace_data->atcb_fieldno.image),
sizeof (task_info->name) - 1); sizeof (task_info->name) - 1);
else else
{ {
struct bound_minimal_symbol msym; struct bound_minimal_symbol msym;
@@ -697,7 +697,7 @@ read_atcb (CORE_ADDR task_id, struct ada_task_info *task_info)
pspace_data->atcb_fieldno.image_len)); pspace_data->atcb_fieldno.image_len));
value_as_string (task_info->name, value_as_string (task_info->name,
value_field (common_value, value_field (common_value,
pspace_data->atcb_fieldno.image), pspace_data->atcb_fieldno.image),
len); len);
} }
@@ -727,22 +727,22 @@ read_atcb (CORE_ADDR task_id, struct ada_task_info *task_info)
&& pspace_data->atcb_fieldno.entry_calls > 0) && pspace_data->atcb_fieldno.entry_calls > 0)
{ {
/* Let My_ATCB be the Ada task control block of a task calling the /* 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 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. */ in My_ATCB.Entry_Calls (My_ATCB.ATC_Nesting_Level).Called_Task. */
atc_nesting_level_value = atc_nesting_level_value =
value_field (tcb_value, pspace_data->atcb_fieldno.atc_nesting_level); value_field (tcb_value, pspace_data->atcb_fieldno.atc_nesting_level);
entry_calls_value = entry_calls_value =
ada_coerce_to_simple_array_ptr ada_coerce_to_simple_array_ptr
(value_field (tcb_value, pspace_data->atcb_fieldno.entry_calls)); (value_field (tcb_value, pspace_data->atcb_fieldno.entry_calls));
entry_calls_value_element = entry_calls_value_element =
value_subscript (entry_calls_value, value_subscript (entry_calls_value,
value_as_long (atc_nesting_level_value)); value_as_long (atc_nesting_level_value));
called_task_fieldno = called_task_fieldno =
ada_get_field_index (value_type (entry_calls_value_element), ada_get_field_index (value_type (entry_calls_value_element),
"called_task", 0); "called_task", 0);
task_info->called_task = task_info->called_task =
value_as_address (value_field (entry_calls_value_element, value_as_address (value_field (entry_calls_value_element,
called_task_fieldno)); called_task_fieldno));
} }
/* If the ATCB contains some information about RV callers, then /* If the ATCB contains some information about RV callers, then
@@ -751,21 +751,21 @@ read_atcb (CORE_ADDR task_id, struct ada_task_info *task_info)
if (pspace_data->atcb_fieldno.call >= 0) if (pspace_data->atcb_fieldno.call >= 0)
{ {
/* Get the ID of the caller task from Common_ATCB.Call.all.Self. /* Get the ID of the caller task from Common_ATCB.Call.all.Self.
If Common_ATCB.Call is null, then there is no caller. */ If Common_ATCB.Call is null, then there is no caller. */
const CORE_ADDR call = const CORE_ADDR call =
value_as_address (value_field (common_value, value_as_address (value_field (common_value,
pspace_data->atcb_fieldno.call)); pspace_data->atcb_fieldno.call));
struct value *call_val; struct value *call_val;
if (call != 0) if (call != 0)
{ {
call_val = call_val =
value_from_contents_and_address (pspace_data->atcb_call_type, value_from_contents_and_address (pspace_data->atcb_call_type,
NULL, call); NULL, call);
task_info->caller_task = task_info->caller_task =
value_as_address value_as_address
(value_field (call_val, pspace_data->atcb_fieldno.call_self)); (value_field (call_val, pspace_data->atcb_fieldno.call_self));
} }
} }
task_info->base_cpu task_info->base_cpu
@@ -811,11 +811,11 @@ read_known_tasks_array (struct ada_tasks_inferior_data *data)
for (i = 0; i < data->known_tasks_length; i++) for (i = 0; i < data->known_tasks_length; i++)
{ {
CORE_ADDR task_id = CORE_ADDR task_id =
extract_typed_address (known_tasks + i * target_ptr_byte, extract_typed_address (known_tasks + i * target_ptr_byte,
data->known_tasks_element); data->known_tasks_element);
if (task_id != 0) if (task_id != 0)
add_ada_task (task_id, current_inferior ()); add_ada_task (task_id, current_inferior ());
} }
return true; return true;
@@ -853,7 +853,7 @@ read_known_tasks_list (struct ada_tasks_inferior_data *data)
common_value = value_field (tcb_value, pspace_data->atcb_fieldno.common); common_value = value_field (tcb_value, pspace_data->atcb_fieldno.common);
task_id = value_as_address task_id = value_as_address
(value_field (common_value, (value_field (common_value,
pspace_data->atcb_fieldno.activation_link)); pspace_data->atcb_fieldno.activation_link));
} }
return true; return true;
@@ -1108,12 +1108,12 @@ print_ada_task_info (struct ui_out *uiout,
to one task only, and this is not the task, skip to one task only, and this is not the task, skip
to the next one. */ to the next one. */
if (taskno_arg && taskno != taskno_arg) if (taskno_arg && taskno != taskno_arg)
continue; continue;
ui_out_emit_tuple tuple_emitter (uiout, NULL); ui_out_emit_tuple tuple_emitter (uiout, NULL);
/* Print a star if this task is the current task (or the task /* Print a star if this task is the current task (or the task
currently selected). */ currently selected). */
if (task_info->ptid == inferior_ptid) if (task_info->ptid == inferior_ptid)
uiout->field_string ("current", "*"); uiout->field_string ("current", "*");
else else
@@ -1128,7 +1128,7 @@ print_ada_task_info (struct ui_out *uiout,
/* Print the associated Thread ID. */ /* Print the associated Thread ID. */
if (uiout->is_mi_like_p ()) if (uiout->is_mi_like_p ())
{ {
thread_info *thread = (ada_task_is_alive (task_info) thread_info *thread = (ada_task_is_alive (task_info)
? find_thread_ptid (inf, task_info->ptid) ? find_thread_ptid (inf, task_info->ptid)
: nullptr); : nullptr);
@@ -1145,9 +1145,9 @@ print_ada_task_info (struct ui_out *uiout,
/* Print the ID of the parent task. */ /* Print the ID of the parent task. */
parent_id = get_task_number_from_id (task_info->parent, inf); parent_id = get_task_number_from_id (task_info->parent, inf);
if (parent_id) if (parent_id)
uiout->field_signed ("parent-id", parent_id); uiout->field_signed ("parent-id", parent_id);
else else
uiout->field_skip ("parent-id"); uiout->field_skip ("parent-id");
/* Print the base priority of the task. */ /* Print the base priority of the task. */
uiout->field_signed ("priority", task_info->priority); uiout->field_signed ("priority", task_info->priority);
@@ -1168,7 +1168,7 @@ print_ada_task_info (struct ui_out *uiout,
/* Finally, print the task name, without quotes around it, as mi like /* Finally, print the task name, without quotes around it, as mi like
is not expecting quotes, and in non mi-like no need for quotes is not expecting quotes, and in non mi-like no need for quotes
as there is a specific column for the name. */ as there is a specific column for the name. */
uiout->field_fmt ("name", uiout->field_fmt ("name",
(task_info->name[0] != '\0' (task_info->name[0] != '\0'
? ui_file_style () ? ui_file_style ()
@@ -1201,7 +1201,7 @@ info_task (struct ui_out *uiout, const char *taskno_str, struct inferior *inf)
if (taskno <= 0 || taskno > data->task_list.size ()) if (taskno <= 0 || taskno > data->task_list.size ())
error (_("Task ID %d not known. Use the \"info tasks\" command to\n" error (_("Task ID %d not known. Use the \"info tasks\" command to\n"
"see the IDs of currently known tasks"), taskno); "see the IDs of currently known tasks"), taskno);
task_info = &data->task_list[taskno - 1]; task_info = &data->task_list[taskno - 1];
/* Print the Ada task ID. */ /* Print the Ada task ID. */
@@ -1231,7 +1231,7 @@ info_task (struct ui_out *uiout, const char *taskno_str, struct inferior *inf)
printf_filtered (_("Parent: %d"), parent_taskno); printf_filtered (_("Parent: %d"), parent_taskno);
if (parent->name[0] != '\0') if (parent->name[0] != '\0')
printf_filtered (" (%s)", parent->name); printf_filtered (" (%s)", parent->name);
printf_filtered ("\n"); printf_filtered ("\n");
} }
else else
@@ -1246,25 +1246,25 @@ info_task (struct ui_out *uiout, const char *taskno_str, struct inferior *inf)
if (task_info->caller_task) if (task_info->caller_task)
{ {
target_taskno = get_task_number_from_id (task_info->caller_task, inf); target_taskno = get_task_number_from_id (task_info->caller_task, inf);
printf_filtered (_("State: Accepting rendezvous with %d"), printf_filtered (_("State: Accepting rendezvous with %d"),
target_taskno); target_taskno);
} }
else if (task_info->called_task) else if (task_info->called_task)
{ {
target_taskno = get_task_number_from_id (task_info->called_task, inf); target_taskno = get_task_number_from_id (task_info->called_task, inf);
printf_filtered (_("State: Waiting on task %d's entry"), printf_filtered (_("State: Waiting on task %d's entry"),
target_taskno); target_taskno);
} }
else else
printf_filtered (_("State: %s"), _(long_task_states[task_info->state])); printf_filtered (_("State: %s"), _(long_task_states[task_info->state]));
if (target_taskno) if (target_taskno)
{ {
ada_task_info *target_task_info = &data->task_list[target_taskno - 1]; ada_task_info *target_task_info = &data->task_list[target_taskno - 1];
if (target_task_info->name[0] != '\0') if (target_task_info->name[0] != '\0')
printf_filtered (" (%s)", target_task_info->name); printf_filtered (" (%s)", target_task_info->name);
} }
printf_filtered ("\n"); printf_filtered ("\n");
@@ -1321,7 +1321,7 @@ task_command_1 (const char *taskno_str, int from_tty, struct inferior *inf)
if (taskno <= 0 || taskno > data->task_list.size ()) if (taskno <= 0 || taskno > data->task_list.size ())
error (_("Task ID %d not known. Use the \"info tasks\" command to\n" error (_("Task ID %d not known. Use the \"info tasks\" command to\n"
"see the IDs of currently known tasks"), taskno); "see the IDs of currently known tasks"), taskno);
task_info = &data->task_list[taskno - 1]; task_info = &data->task_list[taskno - 1];
if (!ada_task_is_alive (task_info)) if (!ada_task_is_alive (task_info))
@@ -1348,15 +1348,15 @@ task_command_1 (const char *taskno_str, int from_tty, struct inferior *inf)
thread_info *tp = find_thread_ptid (inf, task_info->ptid); thread_info *tp = find_thread_ptid (inf, task_info->ptid);
if (tp == NULL) if (tp == NULL)
error (_("Unable to compute thread ID for task %s.\n" error (_("Unable to compute thread ID for task %s.\n"
"Cannot switch to this task."), "Cannot switch to this task."),
task_to_str (taskno, task_info).c_str ()); task_to_str (taskno, task_info).c_str ());
switch_to_thread (tp); switch_to_thread (tp);
ada_find_printable_frame (get_selected_frame (NULL)); ada_find_printable_frame (get_selected_frame (NULL));
printf_filtered (_("[Switching to task %s]\n"), printf_filtered (_("[Switching to task %s]\n"),
task_to_str (taskno, task_info).c_str ()); task_to_str (taskno, task_info).c_str ());
print_stack_frame (get_selected_frame (NULL), print_stack_frame (get_selected_frame (NULL),
frame_relative_level (get_selected_frame (NULL)), frame_relative_level (get_selected_frame (NULL)),
SRC_AND_LOC, 1); SRC_AND_LOC, 1);
} }
@@ -1435,7 +1435,7 @@ ada_tasks_new_objfile_observer (struct objfile *objfile)
/* All objfiles are being cleared, so we should clear all /* All objfiles are being cleared, so we should clear all
our caches for all program spaces. */ our caches for all program spaces. */
for (struct program_space *pspace : program_spaces) for (struct program_space *pspace : program_spaces)
ada_tasks_invalidate_pspace_data (pspace); ada_tasks_invalidate_pspace_data (pspace);
} }
else else
{ {
@@ -1465,9 +1465,9 @@ _initialize_tasks ()
/* Some new commands provided by this module. */ /* Some new commands provided by this module. */
add_info ("tasks", info_tasks_command, add_info ("tasks", info_tasks_command,
_("Provide information about all known Ada tasks.")); _("Provide information about all known Ada tasks."));
add_cmd ("task", class_run, task_command, add_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."), Without argument, this command simply prints the current task ID."),
&cmdlist); &cmdlist);
} }

View File

@@ -198,16 +198,16 @@ print_range_bound (struct type *type, const char *bounds, int *n,
if (ada_scan_number (bounds, *n, &B, n)) if (ada_scan_number (bounds, *n, &B, n))
{ {
/* STABS decodes all range types which bounds are 0 .. -1 as /* STABS decodes all range types which bounds are 0 .. -1 as
unsigned integers (ie. the type code is TYPE_CODE_INT, not unsigned integers (ie. the type code is TYPE_CODE_INT, not
TYPE_CODE_RANGE). Unfortunately, ada_print_scalar() relies TYPE_CODE_RANGE). Unfortunately, ada_print_scalar() relies
on the unsigned flag to determine whether the bound should on the unsigned flag to determine whether the bound should
be printed as a signed or an unsigned value. This causes be printed as a signed or an unsigned value. This causes
the upper bound of the 0 .. -1 range types to be printed as the upper bound of the 0 .. -1 range types to be printed as
a very large unsigned number instead of -1. a very large unsigned number instead of -1.
To workaround this stabs deficiency, we replace the TYPE by NULL To workaround this stabs deficiency, we replace the TYPE by NULL
to indicate default output when we detect that the bound is negative, to indicate default output when we detect that the bound is negative,
and the type is a TYPE_CODE_INT. The bound is negative when and the type is a TYPE_CODE_INT. The bound is negative when
'm' is the last character of the number scanned in BOUNDS. */ 'm' is the last character of the number scanned in BOUNDS. */
if (bounds[*n - 1] == 'm' && type->code () == TYPE_CODE_INT) if (bounds[*n - 1] == 'm' && type->code () == TYPE_CODE_INT)
type = NULL; type = NULL;
ada_print_scalar (type, B, stream); ada_print_scalar (type, B, stream);
@@ -1071,7 +1071,7 @@ ada_print_type (struct type *type0, const char *varstring,
void void
ada_print_typedef (struct type *type, struct symbol *new_symbol, ada_print_typedef (struct type *type, struct symbol *new_symbol,
struct ui_file *stream) struct ui_file *stream)
{ {
type = ada_check_typedef (type); type = ada_check_typedef (type);
ada_print_type (type, "", stream, 0, 0, &type_print_raw_options); ada_print_type (type, "", stream, 0, 0, &type_print_raw_options);

View File

@@ -76,10 +76,10 @@ print_optional_low_bound (struct ui_file *stream, struct type *type,
while (index_type->code () == TYPE_CODE_RANGE) while (index_type->code () == TYPE_CODE_RANGE)
{ {
/* We need to know what the base type is, in order to do the /* We need to know what the base type is, in order to do the
appropriate check below. Otherwise, if this is a subrange appropriate check below. Otherwise, if this is a subrange
of an enumerated type, where the underlying value of the of an enumerated type, where the underlying value of the
first element is typically 0, we might test the low bound first element is typically 0, we might test the low bound
against the wrong value. */ against the wrong value. */
index_type = TYPE_TARGET_TYPE (index_type); index_type = TYPE_TARGET_TYPE (index_type);
} }
@@ -140,10 +140,10 @@ val_print_packed_array_elements (struct type *type, const gdb_byte *valaddr,
len = 1; len = 1;
else if (low > high) else if (low > high)
{ {
/* The array length should normally be HIGH_POS - LOW_POS + 1. /* The array length should normally be HIGH_POS - LOW_POS + 1.
But in Ada we allow LOW_POS to be greater than HIGH_POS for But in Ada we allow LOW_POS to be greater than HIGH_POS for
empty arrays. In that situation, the array length is just zero, empty arrays. In that situation, the array length is just zero,
not negative! */ not negative! */
len = 0; len = 0;
} }
else else
@@ -291,7 +291,7 @@ char_at (const gdb_byte *string, int i, int type_len,
return string[i]; return string[i];
else else
return (int) extract_unsigned_integer (string + type_len * i, return (int) extract_unsigned_integer (string + type_len * i,
type_len, byte_order); type_len, byte_order);
} }
/* Print a floating-point value of type TYPE, pointed to in GDB by /* Print a floating-point value of type TYPE, pointed to in GDB by
@@ -462,7 +462,7 @@ printstr (struct ui_file *stream, struct type *elttype, const gdb_byte *string,
for (i = 0; i < length && things_printed < options->print_max; i += 1) for (i = 0; i < length && things_printed < options->print_max; i += 1)
{ {
/* Position of the character we are examining /* Position of the character we are examining
to see whether it is repeated. */ to see whether it is repeated. */
unsigned int rep1; unsigned int rep1;
/* Number of repetitions we have detected so far. */ /* Number of repetitions we have detected so far. */
unsigned int reps; unsigned int reps;
@@ -1126,7 +1126,7 @@ ada_value_print (struct value *val0, struct ui_file *stream,
if (type->code () == TYPE_CODE_PTR) if (type->code () == TYPE_CODE_PTR)
{ {
/* Hack: don't print (char *) for char strings. Their /* Hack: don't print (char *) for char strings. Their
type is indicated by the quoted string anyway. */ type is indicated by the quoted string anyway. */
if (TYPE_LENGTH (TYPE_TARGET_TYPE (type)) != sizeof (char) if (TYPE_LENGTH (TYPE_TARGET_TYPE (type)) != sizeof (char)
|| TYPE_TARGET_TYPE (type)->code () != TYPE_CODE_INT || TYPE_TARGET_TYPE (type)->code () != TYPE_CODE_INT
|| TYPE_TARGET_TYPE (type)->is_unsigned ()) || TYPE_TARGET_TYPE (type)->is_unsigned ())
@@ -1142,7 +1142,7 @@ ada_value_print (struct value *val0, struct ui_file *stream,
access type (this is encoded by the compiler as a typedef to access type (this is encoded by the compiler as a typedef to
a fat pointer - hence the check against TYPE_CODE_TYPEDEF). */ a fat pointer - hence the check against TYPE_CODE_TYPEDEF). */
if (type->code () == TYPE_CODE_TYPEDEF) if (type->code () == TYPE_CODE_TYPEDEF)
{ {
fprintf_filtered (stream, "("); fprintf_filtered (stream, "(");
type_print (type, "", stream, -1); type_print (type, "", stream, -1);
fprintf_filtered (stream, ") "); fprintf_filtered (stream, ") ");

View File

@@ -208,7 +208,7 @@ ada_varobj_adjust_for_child_access (struct value **value,
the (value, type) couple. */ the (value, type) couple. */
if ((*type)->code () == TYPE_CODE_PTR if ((*type)->code () == TYPE_CODE_PTR
&& (TYPE_TARGET_TYPE (*type)->code () == TYPE_CODE_STRUCT && (TYPE_TARGET_TYPE (*type)->code () == TYPE_CODE_STRUCT
|| TYPE_TARGET_TYPE (*type)->code () == TYPE_CODE_UNION) || TYPE_TARGET_TYPE (*type)->code () == TYPE_CODE_UNION)
&& *value != nullptr && *value != nullptr
&& value_as_address (*value) != 0 && value_as_address (*value) != 0
&& !ada_is_array_descriptor_type (TYPE_TARGET_TYPE (*type)) && !ada_is_array_descriptor_type (TYPE_TARGET_TYPE (*type))

View File

@@ -35,11 +35,11 @@ gdb_static_assert (sizeof (splay_tree_value) >= sizeof (void *));
struct addrmap_funcs struct addrmap_funcs
{ {
void (*set_empty) (struct addrmap *self, void (*set_empty) (struct addrmap *self,
CORE_ADDR start, CORE_ADDR end_inclusive, CORE_ADDR start, CORE_ADDR end_inclusive,
void *obj); void *obj);
void *(*find) (struct addrmap *self, CORE_ADDR addr); void *(*find) (struct addrmap *self, CORE_ADDR addr);
struct addrmap *(*create_fixed) (struct addrmap *self, struct addrmap *(*create_fixed) (struct addrmap *self,
struct obstack *obstack); struct obstack *obstack);
void (*relocate) (struct addrmap *self, CORE_ADDR offset); void (*relocate) (struct addrmap *self, CORE_ADDR offset);
int (*foreach) (struct addrmap *self, addrmap_foreach_fn fn, void *data); int (*foreach) (struct addrmap *self, addrmap_foreach_fn fn, void *data);
}; };
@@ -53,8 +53,8 @@ struct addrmap
void void
addrmap_set_empty (struct addrmap *map, addrmap_set_empty (struct addrmap *map,
CORE_ADDR start, CORE_ADDR end_inclusive, CORE_ADDR start, CORE_ADDR end_inclusive,
void *obj) void *obj)
{ {
map->funcs->set_empty (map, start, end_inclusive, obj); map->funcs->set_empty (map, start, end_inclusive, obj);
} }
@@ -119,12 +119,12 @@ struct addrmap_fixed
static void static void
addrmap_fixed_set_empty (struct addrmap *self, addrmap_fixed_set_empty (struct addrmap *self,
CORE_ADDR start, CORE_ADDR end_inclusive, CORE_ADDR start, CORE_ADDR end_inclusive,
void *obj) void *obj)
{ {
internal_error (__FILE__, __LINE__, internal_error (__FILE__, __LINE__,
"addrmap_fixed_set_empty: " "addrmap_fixed_set_empty: "
"fixed addrmaps can't be changed\n"); "fixed addrmaps can't be changed\n");
} }
@@ -138,23 +138,23 @@ addrmap_fixed_find (struct addrmap *self, CORE_ADDR addr)
while (bottom < top) while (bottom < top)
{ {
/* This needs to round towards top, or else when top = bottom + /* This needs to round towards top, or else when top = bottom +
1 (i.e., two entries are under consideration), then mid == 1 (i.e., two entries are under consideration), then mid ==
bottom, and then we may not narrow the range when (mid->addr bottom, and then we may not narrow the range when (mid->addr
< addr). */ < addr). */
struct addrmap_transition *mid = top - (top - bottom) / 2; struct addrmap_transition *mid = top - (top - bottom) / 2;
if (mid->addr == addr) if (mid->addr == addr)
{ {
bottom = mid; bottom = mid;
break; break;
} }
else if (mid->addr < addr) else if (mid->addr < addr)
/* We don't eliminate mid itself here, since each transition /* We don't eliminate mid itself here, since each transition
covers all subsequent addresses until the next. This is why covers all subsequent addresses until the next. This is why
we must round up in computing the midpoint. */ we must round up in computing the midpoint. */
bottom = mid; bottom = mid;
else else
top = mid - 1; top = mid - 1;
} }
return bottom->value; return bottom->value;
@@ -165,8 +165,8 @@ static struct addrmap *
addrmap_fixed_create_fixed (struct addrmap *self, struct obstack *obstack) addrmap_fixed_create_fixed (struct addrmap *self, struct obstack *obstack)
{ {
internal_error (__FILE__, __LINE__, internal_error (__FILE__, __LINE__,
_("addrmap_create_fixed is not implemented yet " _("addrmap_create_fixed is not implemented yet "
"for fixed addrmaps")); "for fixed addrmaps"));
} }
@@ -311,8 +311,8 @@ addrmap_splay_tree_insert (struct addrmap_mutable *map,
CORE_ADDR key, void *value) CORE_ADDR key, void *value)
{ {
splay_tree_insert (map->tree, splay_tree_insert (map->tree,
allocate_key (map, key), allocate_key (map, key),
(splay_tree_value) value); (splay_tree_value) value);
} }
@@ -329,15 +329,15 @@ force_transition (struct addrmap_mutable *self, CORE_ADDR addr)
{ {
n = addrmap_splay_tree_predecessor (self, addr); n = addrmap_splay_tree_predecessor (self, addr);
addrmap_splay_tree_insert (self, addr, addrmap_splay_tree_insert (self, addr,
n ? addrmap_node_value (n) : NULL); n ? addrmap_node_value (n) : NULL);
} }
} }
static void static void
addrmap_mutable_set_empty (struct addrmap *self, addrmap_mutable_set_empty (struct addrmap *self,
CORE_ADDR start, CORE_ADDR end_inclusive, CORE_ADDR start, CORE_ADDR end_inclusive,
void *obj) void *obj)
{ {
struct addrmap_mutable *map = (struct addrmap_mutable *) self; struct addrmap_mutable *map = (struct addrmap_mutable *) self;
splay_tree_node n, next; splay_tree_node n, next;
@@ -366,7 +366,7 @@ addrmap_mutable_set_empty (struct addrmap *self,
n = addrmap_splay_tree_successor (map, addrmap_node_key (n))) n = addrmap_splay_tree_successor (map, addrmap_node_key (n)))
{ {
if (! addrmap_node_value (n)) if (! addrmap_node_value (n))
addrmap_node_set_value (n, obj); addrmap_node_set_value (n, obj);
} }
/* Walk the area again, removing transitions from any value to /* Walk the area again, removing transitions from any value to
@@ -376,14 +376,14 @@ addrmap_mutable_set_empty (struct addrmap *self,
prior_value = n ? addrmap_node_value (n) : NULL; prior_value = n ? addrmap_node_value (n) : NULL;
for (n = addrmap_splay_tree_lookup (map, start), gdb_assert (n); for (n = addrmap_splay_tree_lookup (map, start), gdb_assert (n);
n && (end_inclusive == CORE_ADDR_MAX n && (end_inclusive == CORE_ADDR_MAX
|| addrmap_node_key (n) <= end_inclusive + 1); || addrmap_node_key (n) <= end_inclusive + 1);
n = next) n = next)
{ {
next = addrmap_splay_tree_successor (map, addrmap_node_key (n)); next = addrmap_splay_tree_successor (map, addrmap_node_key (n));
if (addrmap_node_value (n) == prior_value) if (addrmap_node_value (n) == prior_value)
addrmap_splay_tree_remove (map, addrmap_node_key (n)); addrmap_splay_tree_remove (map, addrmap_node_key (n));
else else
prior_value = addrmap_node_value (n); prior_value = addrmap_node_value (n);
} }
} }
@@ -393,8 +393,8 @@ addrmap_mutable_find (struct addrmap *self, CORE_ADDR addr)
{ {
/* Not needed yet. */ /* Not needed yet. */
internal_error (__FILE__, __LINE__, internal_error (__FILE__, __LINE__,
_("addrmap_find is not implemented yet " _("addrmap_find is not implemented yet "
"for mutable addrmaps")); "for mutable addrmaps"));
} }
@@ -466,8 +466,8 @@ addrmap_mutable_relocate (struct addrmap *self, CORE_ADDR offset)
{ {
/* Not needed yet. */ /* Not needed yet. */
internal_error (__FILE__, __LINE__, internal_error (__FILE__, __LINE__,
_("addrmap_relocate is not implemented yet " _("addrmap_relocate is not implemented yet "
"for mutable addrmaps")); "for mutable addrmaps"));
} }
@@ -584,11 +584,11 @@ addrmap_create_mutable (struct obstack *obstack)
map->free_nodes = NULL; map->free_nodes = NULL;
map->tree = splay_tree_new_with_allocator (splay_compare_CORE_ADDR_ptr, map->tree = splay_tree_new_with_allocator (splay_compare_CORE_ADDR_ptr,
NULL, /* no delete key */ NULL, /* no delete key */
NULL, /* no delete value */ NULL, /* no delete value */
splay_obstack_alloc, splay_obstack_alloc,
splay_obstack_free, splay_obstack_free,
map); map);
return (struct addrmap *) map; return (struct addrmap *) map;
} }

View File

@@ -76,8 +76,8 @@ struct addrmap *addrmap_create_mutable (struct obstack *obstack);
implemented efficiently, but doesn't reveal too much of the implemented efficiently, but doesn't reveal too much of the
representation. */ representation. */
void addrmap_set_empty (struct addrmap *map, void addrmap_set_empty (struct addrmap *map,
CORE_ADDR start, CORE_ADDR end_inclusive, CORE_ADDR start, CORE_ADDR end_inclusive,
void *obj); void *obj);
/* Return the object associated with ADDR in MAP. */ /* Return the object associated with ADDR in MAP. */
void *addrmap_find (struct addrmap *map, CORE_ADDR addr); void *addrmap_find (struct addrmap *map, CORE_ADDR addr);
@@ -85,7 +85,7 @@ void *addrmap_find (struct addrmap *map, CORE_ADDR addr);
/* Create a fixed address map which is a copy of the mutable address /* Create a fixed address map which is a copy of the mutable address
map ORIGINAL. Allocate entries in OBSTACK. */ map ORIGINAL. Allocate entries in OBSTACK. */
struct addrmap *addrmap_create_fixed (struct addrmap *original, struct addrmap *addrmap_create_fixed (struct addrmap *original,
struct obstack *obstack); struct obstack *obstack);
/* Relocate all the addresses in MAP by OFFSET. (This can be applied /* Relocate all the addresses in MAP by OFFSET. (This can be applied
to either mutable or immutable maps.) */ to either mutable or immutable maps.) */

View File

@@ -52,7 +52,7 @@ set_can_use_agent (const char *args, int from_tty, struct cmd_list_element *c)
if (can_use && !agent_loaded_p ()) if (can_use && !agent_loaded_p ())
{ {
/* Since the setting was off, we may not have observed the objfiles and /* Since the setting was off, we may not have observed the objfiles and
therefore not looked up the required symbols. Do so now. */ therefore not looked up the required symbols. Do so now. */
for (objfile *objfile : current_program_space->objfiles ()) for (objfile *objfile : current_program_space->objfiles ())
if (agent_look_up_symbols (objfile) == 0) if (agent_look_up_symbols (objfile) == 0)
break; break;

View File

@@ -397,7 +397,7 @@ pdc_read_regs (pthdb_user_t user,
if (debug_aix_thread) if (debug_aix_thread)
fprintf_unfiltered (gdb_stdlog, "pdc_read_regs tid=%d flags=%s\n", fprintf_unfiltered (gdb_stdlog, "pdc_read_regs tid=%d flags=%s\n",
(int) tid, hex_string (flags)); (int) tid, hex_string (flags));
/* General-purpose registers. */ /* General-purpose registers. */
if (flags & PTHDB_FLAG_GPRS) if (flags & PTHDB_FLAG_GPRS)
@@ -463,7 +463,7 @@ pdc_write_regs (pthdb_user_t user,
if (debug_aix_thread) if (debug_aix_thread)
fprintf_unfiltered (gdb_stdlog, "pdc_write_regs tid=%d flags=%s\n", fprintf_unfiltered (gdb_stdlog, "pdc_write_regs tid=%d flags=%s\n",
(int) tid, hex_string (flags)); (int) tid, hex_string (flags));
/* General-purpose registers. */ /* General-purpose registers. */
if (flags & PTHDB_FLAG_GPRS) if (flags & PTHDB_FLAG_GPRS)
@@ -549,7 +549,7 @@ pdc_alloc (pthdb_user_t user, size_t len, void **bufp)
{ {
if (debug_aix_thread) if (debug_aix_thread)
fprintf_unfiltered (gdb_stdlog, fprintf_unfiltered (gdb_stdlog,
"pdc_alloc (user = %ld, len = %ld, bufp = 0x%lx)\n", "pdc_alloc (user = %ld, len = %ld, bufp = 0x%lx)\n",
user, len, (long) bufp); user, len, (long) bufp);
*bufp = xmalloc (len); *bufp = xmalloc (len);
if (debug_aix_thread) if (debug_aix_thread)
@@ -589,7 +589,7 @@ pdc_dealloc (pthdb_user_t user, void *buf)
if (debug_aix_thread) if (debug_aix_thread)
fprintf_unfiltered (gdb_stdlog, fprintf_unfiltered (gdb_stdlog,
"pdc_free (user = %ld, buf = 0x%lx)\n", user, "pdc_free (user = %ld, buf = 0x%lx)\n", user,
(long) buf); (long) buf);
xfree (buf); xfree (buf);
return PDC_SUCCESS; return PDC_SUCCESS;
} }
@@ -709,7 +709,7 @@ get_signaled_thread (void)
while (1) while (1)
{ {
if (getthrds (inferior_ptid.pid (), &thrinf, if (getthrds (inferior_ptid.pid (), &thrinf,
sizeof (thrinf), &ktid, 1) != 1) sizeof (thrinf), &ktid, 1) != 1)
break; break;
if (thrinf.ti_cursig == SIGTRAP) if (thrinf.ti_cursig == SIGTRAP)
@@ -1231,7 +1231,7 @@ fetch_regs_user_thread (struct regcache *regcache, pthdb_pthread_t pdtid)
status = pthdb_pthread_context (pd_session, pdtid, &ctx); status = pthdb_pthread_context (pd_session, pdtid, &ctx);
if (status != PTHDB_SUCCESS) if (status != PTHDB_SUCCESS)
error (_("aix-thread: fetch_registers: pthdb_pthread_context returned %s"), error (_("aix-thread: fetch_registers: pthdb_pthread_context returned %s"),
pd_status2str (status)); pd_status2str (status));
/* General-purpose registers. */ /* General-purpose registers. */
@@ -1292,7 +1292,7 @@ fetch_regs_kernel_thread (struct regcache *regcache, int regno,
/* General-purpose registers. */ /* General-purpose registers. */
if (regno == -1 if (regno == -1
|| (tdep->ppc_gp0_regnum <= regno || (tdep->ppc_gp0_regnum <= regno
&& regno < tdep->ppc_gp0_regnum + ppc_num_gprs)) && regno < tdep->ppc_gp0_regnum + ppc_num_gprs))
{ {
if (arch64) if (arch64)
{ {
@@ -1314,8 +1314,8 @@ fetch_regs_kernel_thread (struct regcache *regcache, int regno,
if (ppc_floating_point_unit_p (gdbarch) if (ppc_floating_point_unit_p (gdbarch)
&& (regno == -1 && (regno == -1
|| (regno >= tdep->ppc_fp0_regnum || (regno >= tdep->ppc_fp0_regnum
&& regno < tdep->ppc_fp0_regnum + ppc_num_fprs))) && regno < tdep->ppc_fp0_regnum + ppc_num_fprs)))
{ {
if (!ptrace32 (PTT_READ_FPRS, tid, (uintptr_t) fprs, 0, NULL)) if (!ptrace32 (PTT_READ_FPRS, tid, (uintptr_t) fprs, 0, NULL))
memset (fprs, 0, sizeof (fprs)); memset (fprs, 0, sizeof (fprs));
@@ -1514,7 +1514,7 @@ store_regs_user_thread (const struct regcache *regcache, pthdb_pthread_t pdtid)
status = pthdb_pthread_context (pd_session, pdtid, &ctx); status = pthdb_pthread_context (pd_session, pdtid, &ctx);
if (status != PTHDB_SUCCESS) if (status != PTHDB_SUCCESS)
error (_("aix-thread: store_registers: pthdb_pthread_context returned %s"), error (_("aix-thread: store_registers: pthdb_pthread_context returned %s"),
pd_status2str (status)); pd_status2str (status));
/* Collect general-purpose register values from the regcache. */ /* Collect general-purpose register values from the regcache. */
@@ -1573,7 +1573,7 @@ store_regs_user_thread (const struct regcache *regcache, pthdb_pthread_t pdtid)
if (status != PTHDB_SUCCESS) if (status != PTHDB_SUCCESS)
error (_("aix-thread: store_registers: " error (_("aix-thread: store_registers: "
"pthdb_pthread_setcontext returned %s"), "pthdb_pthread_setcontext returned %s"),
pd_status2str (status)); pd_status2str (status));
} }
/* Store register REGNO if != -1 or all registers otherwise into /* Store register REGNO if != -1 or all registers otherwise into
@@ -1599,12 +1599,12 @@ store_regs_kernel_thread (const struct regcache *regcache, int regno,
if (debug_aix_thread) if (debug_aix_thread)
fprintf_unfiltered (gdb_stdlog, fprintf_unfiltered (gdb_stdlog,
"store_regs_kernel_thread tid=%lx regno=%d\n", "store_regs_kernel_thread tid=%lx regno=%d\n",
(long) tid, regno); (long) tid, regno);
/* General-purpose registers. */ /* General-purpose registers. */
if (regno == -1 if (regno == -1
|| (tdep->ppc_gp0_regnum <= regno || (tdep->ppc_gp0_regnum <= regno
&& regno < tdep->ppc_gp0_regnum + ppc_num_fprs)) && regno < tdep->ppc_gp0_regnum + ppc_num_fprs))
{ {
if (arch64) if (arch64)
{ {
@@ -1626,8 +1626,8 @@ store_regs_kernel_thread (const struct regcache *regcache, int regno,
if (ppc_floating_point_unit_p (gdbarch) if (ppc_floating_point_unit_p (gdbarch)
&& (regno == -1 && (regno == -1
|| (regno >= tdep->ppc_fp0_regnum || (regno >= tdep->ppc_fp0_regnum
&& regno < tdep->ppc_fp0_regnum + ppc_num_fprs))) && regno < tdep->ppc_fp0_regnum + ppc_num_fprs)))
{ {
/* Pre-fetch: some regs may not be in the cache. */ /* Pre-fetch: some regs may not be in the cache. */
ptrace32 (PTT_READ_FPRS, tid, (uintptr_t) fprs, 0, NULL); ptrace32 (PTT_READ_FPRS, tid, (uintptr_t) fprs, 0, NULL);

View File

@@ -95,14 +95,14 @@ alpha_bsd_nat_target::store_registers (struct regcache *regcache, int regno)
{ {
struct reg gregs; struct reg gregs;
if (ptrace (PT_GETREGS, regcache->ptid ().pid (), if (ptrace (PT_GETREGS, regcache->ptid ().pid (),
(PTRACE_TYPE_ARG3) &gregs, lwp) == -1) (PTRACE_TYPE_ARG3) &gregs, lwp) == -1)
perror_with_name (_("Couldn't get registers")); perror_with_name (_("Couldn't get registers"));
alphabsd_fill_reg (regcache, (char *) &gregs, regno); alphabsd_fill_reg (regcache, (char *) &gregs, regno);
if (ptrace (PT_SETREGS, regcache->ptid ().pid (), if (ptrace (PT_SETREGS, regcache->ptid ().pid (),
(PTRACE_TYPE_ARG3) &gregs, lwp) == -1) (PTRACE_TYPE_ARG3) &gregs, lwp) == -1)
perror_with_name (_("Couldn't write registers")); perror_with_name (_("Couldn't write registers"));
if (regno != -1) if (regno != -1)
return; return;

View File

@@ -64,11 +64,11 @@ enum
This is somewhat complicated in that: This is somewhat complicated in that:
(1) the expansion of the "mov" assembler macro has changed over (1) the expansion of the "mov" assembler macro has changed over
time, from "bis src,src,dst" to "bis zero,src,dst", time, from "bis src,src,dst" to "bis zero,src,dst",
(2) the kernel has changed from using "addq" to "lda" to load the (2) the kernel has changed from using "addq" to "lda" to load the
syscall number, syscall number,
(3) there is a "normal" sigreturn and an "rt" sigreturn which (3) there is a "normal" sigreturn and an "rt" sigreturn which
has a different stack layout. */ has a different stack layout. */
static long static long
alpha_linux_sigtramp_offset_1 (struct gdbarch *gdbarch, CORE_ADDR pc) alpha_linux_sigtramp_offset_1 (struct gdbarch *gdbarch, CORE_ADDR pc)
@@ -144,7 +144,7 @@ alpha_linux_sigcontext_addr (struct frame_info *this_frame)
struct rt_sigframe { struct rt_sigframe {
struct siginfo info; struct siginfo info;
struct ucontext uc; struct ucontext uc;
}; };
offsetof (struct rt_sigframe, uc.uc_mcontext); */ offsetof (struct rt_sigframe, uc.uc_mcontext); */
@@ -378,7 +378,7 @@ alpha_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
/* Enable TLS support. */ /* Enable TLS support. */
set_gdbarch_fetch_tls_load_module_address (gdbarch, set_gdbarch_fetch_tls_load_module_address (gdbarch,
svr4_fetch_objfile_link_map); svr4_fetch_objfile_link_map);
set_gdbarch_iterate_over_regset_sections set_gdbarch_iterate_over_regset_sections
(gdbarch, alpha_linux_iterate_over_regset_sections); (gdbarch, alpha_linux_iterate_over_regset_sections);
@@ -394,5 +394,5 @@ void
_initialize_alpha_linux_tdep () _initialize_alpha_linux_tdep ()
{ {
gdbarch_register_osabi (bfd_arch_alpha, 0, GDB_OSABI_LINUX, gdbarch_register_osabi (bfd_arch_alpha, 0, GDB_OSABI_LINUX,
alpha_linux_init_abi); alpha_linux_init_abi);
} }

View File

@@ -34,10 +34,10 @@
/* *INDENT-OFF* */ /* *INDENT-OFF* */
/* Layout of a stack frame on the alpha: /* Layout of a stack frame on the alpha:
| | | |
pdr members: | 7th ... nth arg, | pdr members: | 7th ... nth arg, |
| `pushed' by caller. | | `pushed' by caller. |
| | | |
----------------|-------------------------------|<-- old_sp == vfp ----------------|-------------------------------|<-- old_sp == vfp
^ ^ ^ ^ | | ^ ^ ^ ^ | |
| | | | | | | | | | | |
@@ -72,7 +72,7 @@
| | called procedure. | | | called procedure. |
v | | v | |
-------------|-------------------------------|<-- sp -------------|-------------------------------|<-- sp
| | | |
*/ */
/* *INDENT-ON* */ /* *INDENT-ON* */
@@ -117,7 +117,7 @@ find_proc_desc (CORE_ADDR pc)
proc_desc = (struct mdebug_extra_func_info *) SYMBOL_VALUE_BYTES (sym); proc_desc = (struct mdebug_extra_func_info *) SYMBOL_VALUE_BYTES (sym);
/* Correct incorrect setjmp procedure descriptor from the library /* Correct incorrect setjmp procedure descriptor from the library
to make backtrace through setjmp work. */ to make backtrace through setjmp work. */
if (proc_desc->pdr.pcreg == 0 if (proc_desc->pdr.pcreg == 0
&& strcmp (sh_name, "setjmp") == 0) && strcmp (sh_name, "setjmp") == 0)
{ {
@@ -154,7 +154,7 @@ alpha_mdebug_after_prologue (CORE_ADDR pc,
if (proc_desc) if (proc_desc)
{ {
/* If function is frameless, then we need to do it the hard way. I /* If function is frameless, then we need to do it the hard way. I
strongly suspect that frameless always means prologueless... */ strongly suspect that frameless always means prologueless... */
if (alpha_mdebug_frameless (proc_desc)) if (alpha_mdebug_frameless (proc_desc))
return 0; return 0;
} }
@@ -308,8 +308,8 @@ alpha_mdebug_max_frame_size_exceeded (struct mdebug_extra_func_info *proc_desc)
static int static int
alpha_mdebug_frame_sniffer (const struct frame_unwind *self, alpha_mdebug_frame_sniffer (const struct frame_unwind *self,
struct frame_info *this_frame, struct frame_info *this_frame,
void **this_cache) void **this_cache)
{ {
CORE_ADDR pc = get_frame_address_in_block (this_frame); CORE_ADDR pc = get_frame_address_in_block (this_frame);
struct mdebug_extra_func_info *proc_desc; struct mdebug_extra_func_info *proc_desc;

View File

@@ -248,7 +248,7 @@ alphanbsd_sigcontext_addr (struct frame_info *frame)
static void static void
alphanbsd_init_abi (struct gdbarch_info info, alphanbsd_init_abi (struct gdbarch_info info,
struct gdbarch *gdbarch) struct gdbarch *gdbarch)
{ {
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
@@ -288,5 +288,5 @@ _initialize_alphanbsd_tdep ()
traditional a.out-style core dump format before NetBSD 1.6, but traditional a.out-style core dump format before NetBSD 1.6, but
we don't support those. */ we don't support those. */
gdbarch_register_osabi (bfd_arch_alpha, 0, GDB_OSABI_NETBSD, gdbarch_register_osabi (bfd_arch_alpha, 0, GDB_OSABI_NETBSD,
alphanbsd_init_abi); alphanbsd_init_abi);
} }

View File

@@ -131,5 +131,5 @@ void
_initialize_alphaobsd_tdep () _initialize_alphaobsd_tdep ()
{ {
gdbarch_register_osabi (bfd_arch_alpha, 0, GDB_OSABI_OPENBSD, gdbarch_register_osabi (bfd_arch_alpha, 0, GDB_OSABI_OPENBSD,
alphaobsd_init_abi); alphaobsd_init_abi);
} }

View File

@@ -116,7 +116,7 @@ static int
alpha_cannot_store_register (struct gdbarch *gdbarch, int regno) alpha_cannot_store_register (struct gdbarch *gdbarch, int regno)
{ {
return (regno == ALPHA_ZERO_REGNUM return (regno == ALPHA_ZERO_REGNUM
|| strlen (alpha_register_name (gdbarch, regno)) == 0); || strlen (alpha_register_name (gdbarch, regno)) == 0);
} }
static struct type * static struct type *
@@ -974,7 +974,7 @@ alpha_sigtramp_frame_prev_register (struct frame_info *this_frame,
addr = alpha_sigtramp_register_address (get_frame_arch (this_frame), addr = alpha_sigtramp_register_address (get_frame_arch (this_frame),
info->sigcontext_addr, regnum); info->sigcontext_addr, regnum);
if (addr != 0) if (addr != 0)
return frame_unwind_got_memory (this_frame, regnum, addr); return frame_unwind_got_memory (this_frame, regnum, addr);
} }
/* This extra register may actually be in the sigcontext, but our /* This extra register may actually be in the sigcontext, but our
@@ -986,8 +986,8 @@ alpha_sigtramp_frame_prev_register (struct frame_info *this_frame,
static int static int
alpha_sigtramp_frame_sniffer (const struct frame_unwind *self, alpha_sigtramp_frame_sniffer (const struct frame_unwind *self,
struct frame_info *this_frame, struct frame_info *this_frame,
void **this_prologue_cache) void **this_prologue_cache)
{ {
struct gdbarch *gdbarch = get_frame_arch (this_frame); struct gdbarch *gdbarch = get_frame_arch (this_frame);
CORE_ADDR pc = get_frame_pc (this_frame); CORE_ADDR pc = get_frame_pc (this_frame);
@@ -1137,16 +1137,16 @@ alpha_heuristic_analyze_probing_loop (struct gdbarch *gdbarch, CORE_ADDR *pc,
/* The following pattern is recognized as a probing loop: /* The following pattern is recognized as a probing loop:
lda REG_INDEX,NB_OF_ITERATIONS lda REG_INDEX,NB_OF_ITERATIONS
lda REG_PROBE,<immediate>(sp) lda REG_PROBE,<immediate>(sp)
LOOP_START: LOOP_START:
stq zero,<immediate>(REG_PROBE) stq zero,<immediate>(REG_PROBE)
subq REG_INDEX,0x1,REG_INDEX subq REG_INDEX,0x1,REG_INDEX
lda REG_PROBE,<immediate>(REG_PROBE) lda REG_PROBE,<immediate>(REG_PROBE)
bne REG_INDEX, LOOP_START bne REG_INDEX, LOOP_START
lda sp,<immediate>(REG_PROBE) lda sp,<immediate>(REG_PROBE)
If anything different is found, the function returns without If anything different is found, the function returns without
changing PC and FRAME_SIZE. Otherwise, PC will point immediately changing PC and FRAME_SIZE. Otherwise, PC will point immediately
@@ -1282,15 +1282,15 @@ alpha_heuristic_frame_unwind_cache (struct frame_info *this_frame,
{ {
reg = (word & 0x03e00000) >> 21; reg = (word & 0x03e00000) >> 21;
/* Ignore this instruction if we have already encountered /* Ignore this instruction if we have already encountered
an instruction saving the same register earlier in the an instruction saving the same register earlier in the
function code. The current instruction does not tell function code. The current instruction does not tell
us where the original value upon function entry is saved. us where the original value upon function entry is saved.
All it says is that the function we are scanning reused All it says is that the function we are scanning reused
that register for some computation of its own, and is now that register for some computation of its own, and is now
saving its result. */ saving its result. */
if (trad_frame_addr_p(info->saved_regs, reg)) if (trad_frame_addr_p(info->saved_regs, reg))
continue; continue;
if (reg == 31) if (reg == 31)
continue; continue;
@@ -1601,7 +1601,7 @@ alpha_next_pc (struct regcache *regcache, CORE_ADDR pc)
|| op == 0x34) /* BSR */ || op == 0x34) /* BSR */
{ {
branch_taken: branch_taken:
offset = (insn & 0x001fffff); offset = (insn & 0x001fffff);
if (offset & 0x00100000) if (offset & 0x00100000)
offset |= 0xffe00000; offset |= 0xffe00000;
offset *= ALPHA_INSN_SIZE; offset *= ALPHA_INSN_SIZE;
@@ -1611,14 +1611,14 @@ alpha_next_pc (struct regcache *regcache, CORE_ADDR pc)
/* Need to determine if branch is taken; read RA. */ /* Need to determine if branch is taken; read RA. */
regno = (insn >> 21) & 0x1f; regno = (insn >> 21) & 0x1f;
switch (op) switch (op)
{ {
case 0x31: /* FBEQ */ case 0x31: /* FBEQ */
case 0x36: /* FBGE */ case 0x36: /* FBGE */
case 0x37: /* FBGT */ case 0x37: /* FBGT */
case 0x33: /* FBLE */ case 0x33: /* FBLE */
case 0x32: /* FBLT */ case 0x32: /* FBLT */
case 0x35: /* FBNE */ case 0x35: /* FBNE */
regno += gdbarch_fp0_regnum (gdbarch); regno += gdbarch_fp0_regnum (gdbarch);
} }
rav = regcache_raw_get_signed (regcache, regno); rav = regcache_raw_get_signed (regcache, regno);
@@ -1658,32 +1658,32 @@ alpha_next_pc (struct regcache *regcache, CORE_ADDR pc)
goto branch_taken; goto branch_taken;
break; break;
/* Floating point branches. */ /* Floating point branches. */
case 0x31: /* FBEQ */ case 0x31: /* FBEQ */
if (fp_register_zero_p (rav)) if (fp_register_zero_p (rav))
goto branch_taken; goto branch_taken;
break; break;
case 0x36: /* FBGE */ case 0x36: /* FBGE */
if (fp_register_sign_bit (rav) == 0 || fp_register_zero_p (rav)) if (fp_register_sign_bit (rav) == 0 || fp_register_zero_p (rav))
goto branch_taken; goto branch_taken;
break; break;
case 0x37: /* FBGT */ case 0x37: /* FBGT */
if (fp_register_sign_bit (rav) == 0 && ! fp_register_zero_p (rav)) if (fp_register_sign_bit (rav) == 0 && ! fp_register_zero_p (rav))
goto branch_taken; goto branch_taken;
break; break;
case 0x33: /* FBLE */ case 0x33: /* FBLE */
if (fp_register_sign_bit (rav) == 1 || fp_register_zero_p (rav)) if (fp_register_sign_bit (rav) == 1 || fp_register_zero_p (rav))
goto branch_taken; goto branch_taken;
break; break;
case 0x32: /* FBLT */ case 0x32: /* FBLT */
if (fp_register_sign_bit (rav) == 1 && ! fp_register_zero_p (rav)) if (fp_register_sign_bit (rav) == 1 && ! fp_register_zero_p (rav))
goto branch_taken; goto branch_taken;
break; break;
case 0x35: /* FBNE */ case 0x35: /* FBNE */
if (! fp_register_zero_p (rav)) if (! fp_register_zero_p (rav))
goto branch_taken; goto branch_taken;
break; break;
} }
} }

View File

@@ -144,12 +144,12 @@ amd64bsd_store_inferior_registers (struct regcache *regcache, int regnum)
struct reg regs; struct reg regs;
if (gdb_ptrace (PT_GETREGS, ptid, (PTRACE_TYPE_ARG3) &regs, 0) == -1) if (gdb_ptrace (PT_GETREGS, ptid, (PTRACE_TYPE_ARG3) &regs, 0) == -1)
perror_with_name (_("Couldn't get registers")); perror_with_name (_("Couldn't get registers"));
amd64_collect_native_gregset (regcache, &regs, regnum); amd64_collect_native_gregset (regcache, &regs, regnum);
if (gdb_ptrace (PT_SETREGS, ptid, (PTRACE_TYPE_ARG3) &regs, 0) == -1) if (gdb_ptrace (PT_SETREGS, ptid, (PTRACE_TYPE_ARG3) &regs, 0) == -1)
perror_with_name (_("Couldn't write registers")); perror_with_name (_("Couldn't write registers"));
if (regnum != -1) if (regnum != -1)
return; return;

View File

@@ -121,5 +121,5 @@ void
_initialize_amd64_darwin_tdep () _initialize_amd64_darwin_tdep ()
{ {
gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64, gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64,
GDB_OSABI_DARWIN, x86_darwin_init_abi_64); GDB_OSABI_DARWIN, x86_darwin_init_abi_64);
} }

View File

@@ -99,7 +99,7 @@ static int amd64_linux_gregset32_reg_offset[] =
static void static void
amd64_linux_collect_native_gregset (const struct regcache *regcache, amd64_linux_collect_native_gregset (const struct regcache *regcache,
void *gregs, int regnum) void *gregs, int regnum)
{ {
amd64_collect_native_gregset (regcache, gregs, regnum); amd64_collect_native_gregset (regcache, gregs, regnum);
@@ -333,7 +333,7 @@ amd64_linux_nat_target::store_registers (struct regcache *regcache, int regnum)
ps_err_e ps_err_e
ps_get_thread_area (struct ps_prochandle *ph, ps_get_thread_area (struct ps_prochandle *ph,
lwpid_t lwpid, int idx, void **base) lwpid_t lwpid, int idx, void **base)
{ {
if (gdbarch_bfd_arch_info (ph->thread->inf->gdbarch)->bits_per_word == 32) if (gdbarch_bfd_arch_info (ph->thread->inf->gdbarch)->bits_per_word == 32)
{ {

View File

@@ -284,8 +284,8 @@ amd64_linux_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
|| regnum == AMD64_FSBASE_REGNUM || regnum == AMD64_FSBASE_REGNUM
|| regnum == AMD64_GSBASE_REGNUM) || regnum == AMD64_GSBASE_REGNUM)
return (group == system_reggroup return (group == system_reggroup
|| group == save_reggroup || group == save_reggroup
|| group == restore_reggroup); || group == restore_reggroup);
return i386_register_reggroup_p (gdbarch, regnum, group); return i386_register_reggroup_p (gdbarch, regnum, group);
} }
@@ -1464,7 +1464,7 @@ amd64_linux_syscall_record_common (struct regcache *regcache,
case amd64_sys_rt_sigreturn: case amd64_sys_rt_sigreturn:
case amd64_x32_sys_rt_sigreturn: case amd64_x32_sys_rt_sigreturn:
if (amd64_all_but_ip_registers_record (regcache)) if (amd64_all_but_ip_registers_record (regcache))
return -1; return -1;
return 0; return 0;
break; break;
@@ -1496,16 +1496,16 @@ amd64_linux_syscall_record_common (struct regcache *regcache,
if (syscall_gdb == gdb_sys_no_syscall) if (syscall_gdb == gdb_sys_no_syscall)
{ {
printf_unfiltered (_("Process record and replay target doesn't " printf_unfiltered (_("Process record and replay target doesn't "
"support syscall number %s\n"), "support syscall number %s\n"),
pulongest (syscall_native)); pulongest (syscall_native));
return -1; return -1;
} }
else else
{ {
ret = record_linux_system_call (syscall_gdb, regcache, ret = record_linux_system_call (syscall_gdb, regcache,
linux_record_tdep_p); linux_record_tdep_p);
if (ret) if (ret)
return ret; return ret;
} }
record_regs: record_regs:
@@ -1538,8 +1538,8 @@ amd64_x32_linux_syscall_record (struct regcache *regcache)
static int static int
amd64_linux_record_signal (struct gdbarch *gdbarch, amd64_linux_record_signal (struct gdbarch *gdbarch,
struct regcache *regcache, struct regcache *regcache,
enum gdb_signal signal) enum gdb_signal signal)
{ {
ULONGEST rsp; ULONGEST rsp;
@@ -1561,8 +1561,8 @@ amd64_linux_record_signal (struct gdbarch *gdbarch,
sp -= sizeof (struct rt_sigframe); */ sp -= sizeof (struct rt_sigframe); */
rsp -= AMD64_LINUX_frame_size; rsp -= AMD64_LINUX_frame_size;
if (record_full_arch_list_add_mem (rsp, AMD64_LINUX_redzone if (record_full_arch_list_add_mem (rsp, AMD64_LINUX_redzone
+ AMD64_LINUX_xstate + AMD64_LINUX_xstate
+ AMD64_LINUX_frame_size)) + AMD64_LINUX_frame_size))
return -1; return -1;
if (record_full_arch_list_add_end ()) if (record_full_arch_list_add_end ())
@@ -1816,11 +1816,11 @@ amd64_linux_init_abi_common(struct gdbarch_info info, struct gdbarch *gdbarch)
/* Functions for 'catch syscall'. */ /* Functions for 'catch syscall'. */
set_xml_syscall_file_name (gdbarch, XML_SYSCALL_FILENAME_AMD64); set_xml_syscall_file_name (gdbarch, XML_SYSCALL_FILENAME_AMD64);
set_gdbarch_get_syscall_number (gdbarch, set_gdbarch_get_syscall_number (gdbarch,
amd64_linux_get_syscall_number); amd64_linux_get_syscall_number);
/* Enable TLS support. */ /* Enable TLS support. */
set_gdbarch_fetch_tls_load_module_address (gdbarch, set_gdbarch_fetch_tls_load_module_address (gdbarch,
svr4_fetch_objfile_link_map); svr4_fetch_objfile_link_map);
/* GNU/Linux uses SVR4-style shared libraries. */ /* GNU/Linux uses SVR4-style shared libraries. */
set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target); set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target);
@@ -1837,10 +1837,10 @@ amd64_linux_init_abi_common(struct gdbarch_info info, struct gdbarch *gdbarch)
/* Displaced stepping. */ /* Displaced stepping. */
set_gdbarch_displaced_step_copy_insn (gdbarch, set_gdbarch_displaced_step_copy_insn (gdbarch,
amd64_displaced_step_copy_insn); amd64_displaced_step_copy_insn);
set_gdbarch_displaced_step_fixup (gdbarch, amd64_displaced_step_fixup); set_gdbarch_displaced_step_fixup (gdbarch, amd64_displaced_step_fixup);
set_gdbarch_displaced_step_location (gdbarch, set_gdbarch_displaced_step_location (gdbarch,
linux_displaced_step_location); linux_displaced_step_location);
set_gdbarch_process_record (gdbarch, i386_process_record); set_gdbarch_process_record (gdbarch, i386_process_record);
set_gdbarch_process_record_signal (gdbarch, amd64_linux_record_signal); set_gdbarch_process_record_signal (gdbarch, amd64_linux_record_signal);

View File

@@ -129,7 +129,7 @@ amd64_collect_native_gregset (const struct regcache *regcache,
num_regs = amd64_native_gregset32_num_regs; num_regs = amd64_native_gregset32_num_regs;
/* Make sure %eax, %ebx, %ecx, %edx, %esi, %edi, %ebp, %esp and /* Make sure %eax, %ebx, %ecx, %edx, %esi, %edi, %ebp, %esp and
%eip get zero-extended to 64 bits. */ %eip get zero-extended to 64 bits. */
for (i = 0; i <= I386_EIP_REGNUM; i++) for (i = 0; i <= I386_EIP_REGNUM; i++)
{ {
if (regnum == -1 || regnum == i) if (regnum == -1 || regnum == i)

View File

@@ -106,11 +106,11 @@ amd64obsd_sigcontext_addr (struct frame_info *this_frame)
/* The %rsp register points at `struct sigcontext' upon entry of a /* The %rsp register points at `struct sigcontext' upon entry of a
signal trampoline. The relevant part of the trampoline is signal trampoline. The relevant part of the trampoline is
call *%rax call *%rax
movq %rsp, %rdi movq %rsp, %rdi
pushq %rdi pushq %rdi
movq $SYS_sigreturn,%rax movq $SYS_sigreturn,%rax
int $0x80 int $0x80
(see /usr/src/sys/arch/amd64/amd64/locore.S). The `pushq' (see /usr/src/sys/arch/amd64/amd64/locore.S). The `pushq'
instruction clobbers %rsp, but its value is saved in `%rdi'. */ instruction clobbers %rsp, but its value is saved in `%rdi'. */
@@ -238,7 +238,7 @@ amd64obsd_supply_uthread (struct regcache *regcache,
sp = read_memory_unsigned_integer (sp_addr, 8, byte_order); sp = read_memory_unsigned_integer (sp_addr, 8, byte_order);
/* Adjust the stack pointer such that it looks as if we just /* Adjust the stack pointer such that it looks as if we just
returned from _thread_machdep_switch. */ returned from _thread_machdep_switch. */
offset = amd64obsd_uthread_reg_offset[AMD64_RIP_REGNUM] + 8; offset = amd64obsd_uthread_reg_offset[AMD64_RIP_REGNUM] + 8;
store_unsigned_integer (buf, 8, byte_order, sp + offset); store_unsigned_integer (buf, 8, byte_order, sp + offset);
regcache->raw_supply (AMD64_RSP_REGNUM, buf); regcache->raw_supply (AMD64_RSP_REGNUM, buf);
@@ -250,7 +250,7 @@ amd64obsd_supply_uthread (struct regcache *regcache,
&& (regnum == -1 || regnum == i)) && (regnum == -1 || regnum == i))
{ {
/* Fetch stack pointer from thread structure (if we didn't /* Fetch stack pointer from thread structure (if we didn't
do so already). */ do so already). */
if (sp == 0) if (sp == 0)
sp = read_memory_unsigned_integer (sp_addr, 8, byte_order); sp = read_memory_unsigned_integer (sp_addr, 8, byte_order);
@@ -279,7 +279,7 @@ amd64obsd_collect_uthread (const struct regcache *regcache,
int offset; int offset;
/* Calculate the stack pointer (frame pointer) that will be /* Calculate the stack pointer (frame pointer) that will be
stored into the thread structure. */ stored into the thread structure. */
offset = amd64obsd_uthread_reg_offset[AMD64_RIP_REGNUM] + 8; offset = amd64obsd_uthread_reg_offset[AMD64_RIP_REGNUM] + 8;
regcache->raw_collect (AMD64_RSP_REGNUM, buf); regcache->raw_collect (AMD64_RSP_REGNUM, buf);
sp = extract_unsigned_integer (buf, 8, byte_order) - offset; sp = extract_unsigned_integer (buf, 8, byte_order) - offset;
@@ -288,7 +288,7 @@ amd64obsd_collect_uthread (const struct regcache *regcache,
write_memory_unsigned_integer (sp_addr, 8, byte_order, sp); write_memory_unsigned_integer (sp_addr, 8, byte_order, sp);
/* The stack pointer was (potentially) modified. Make sure we /* The stack pointer was (potentially) modified. Make sure we
build a proper stack frame. */ build a proper stack frame. */
regnum = -1; regnum = -1;
} }
@@ -298,7 +298,7 @@ amd64obsd_collect_uthread (const struct regcache *regcache,
&& (regnum == -1 || regnum == i)) && (regnum == -1 || regnum == i))
{ {
/* Fetch stack pointer from thread structure (if we didn't /* Fetch stack pointer from thread structure (if we didn't
calculate it already). */ calculate it already). */
if (sp == 0) if (sp == 0)
sp = read_memory_unsigned_integer (sp_addr, 8, byte_order); sp = read_memory_unsigned_integer (sp_addr, 8, byte_order);

View File

@@ -652,7 +652,7 @@ static void
amd64_classify_aggregate (struct type *type, enum amd64_reg_class theclass[2]) amd64_classify_aggregate (struct type *type, enum amd64_reg_class theclass[2])
{ {
/* 1. If the size of an object is larger than two eightbytes, or it has /* 1. If the size of an object is larger than two eightbytes, or it has
unaligned fields, it has class memory. */ unaligned fields, it has class memory. */
if (TYPE_LENGTH (type) > 16 || amd64_has_unaligned_fields (type)) if (TYPE_LENGTH (type) > 16 || amd64_has_unaligned_fields (type))
{ {
theclass[0] = theclass[1] = AMD64_MEMORY; theclass[0] = theclass[1] = AMD64_MEMORY;
@@ -663,9 +663,9 @@ amd64_classify_aggregate (struct type *type, enum amd64_reg_class theclass[2])
theclass[0] = theclass[1] = AMD64_NO_CLASS; theclass[0] = theclass[1] = AMD64_NO_CLASS;
/* 3. Each field of an object is classified recursively so that /* 3. Each field of an object is classified recursively so that
always two fields are considered. The resulting class is always two fields are considered. The resulting class is
calculated according to the classes of the fields in the calculated according to the classes of the fields in the
eightbyte: */ eightbyte: */
if (type->code () == TYPE_CODE_ARRAY) if (type->code () == TYPE_CODE_ARRAY)
{ {
@@ -798,8 +798,8 @@ amd64_return_value (struct gdbarch *gdbarch, struct value *function,
if (theclass[0] == AMD64_MEMORY) if (theclass[0] == AMD64_MEMORY)
{ {
/* As indicated by the comment above, the ABI guarantees that we /* As indicated by the comment above, the ABI guarantees that we
can always find the return value just after the function has can always find the return value just after the function has
returned. */ returned. */
if (readbuf) if (readbuf)
{ {
@@ -813,7 +813,7 @@ amd64_return_value (struct gdbarch *gdbarch, struct value *function,
} }
/* 8. If the class is COMPLEX_X87, the real part of the value is /* 8. If the class is COMPLEX_X87, the real part of the value is
returned in %st0 and the imaginary part in %st1. */ returned in %st0 and the imaginary part in %st1. */
if (theclass[0] == AMD64_COMPLEX_X87) if (theclass[0] == AMD64_COMPLEX_X87)
{ {
if (readbuf) if (readbuf)
@@ -854,7 +854,7 @@ amd64_return_value (struct gdbarch *gdbarch, struct value *function,
case AMD64_SSE: case AMD64_SSE:
/* 4. If the class is SSE, the next available SSE register /* 4. If the class is SSE, the next available SSE register
of the sequence %xmm0, %xmm1 is used. */ of the sequence %xmm0, %xmm1 is used. */
regnum = sse_regnum[sse_reg++]; regnum = sse_regnum[sse_reg++];
break; break;
@@ -868,7 +868,7 @@ amd64_return_value (struct gdbarch *gdbarch, struct value *function,
case AMD64_X87: case AMD64_X87:
/* 6. If the class is X87, the value is returned on the X87 /* 6. If the class is X87, the value is returned on the X87
stack in %st0 as 80-bit x87 number. */ stack in %st0 as 80-bit x87 number. */
regnum = AMD64_ST0_REGNUM; regnum = AMD64_ST0_REGNUM;
if (writebuf) if (writebuf)
i387_return_value (gdbarch, regcache); i387_return_value (gdbarch, regcache);
@@ -876,7 +876,7 @@ amd64_return_value (struct gdbarch *gdbarch, struct value *function,
case AMD64_X87UP: case AMD64_X87UP:
/* 7. If the class is X87UP, the value is returned together /* 7. If the class is X87UP, the value is returned together
with the previous X87 value in %st0. */ with the previous X87 value in %st0. */
gdb_assert (i > 0 && theclass[0] == AMD64_X87); gdb_assert (i > 0 && theclass[0] == AMD64_X87);
regnum = AMD64_ST0_REGNUM; regnum = AMD64_ST0_REGNUM;
offset = 8; offset = 8;
@@ -950,7 +950,7 @@ if (return_method == return_method_struct)
amd64_classify (type, theclass); amd64_classify (type, theclass);
/* Calculate the number of integer and SSE registers needed for /* Calculate the number of integer and SSE registers needed for
this argument. */ this argument. */
for (j = 0; j < 2; j++) for (j = 0; j < 2; j++)
{ {
if (theclass[j] == AMD64_INTEGER) if (theclass[j] == AMD64_INTEGER)
@@ -960,7 +960,7 @@ if (return_method == return_method_struct)
} }
/* Check whether enough registers are available, and if the /* Check whether enough registers are available, and if the
argument should be passed in registers at all. */ argument should be passed in registers at all. */
if (integer_reg + needed_integer_regs > ARRAY_SIZE (integer_regnum) if (integer_reg + needed_integer_regs > ARRAY_SIZE (integer_regnum)
|| sse_reg + needed_sse_regs > ARRAY_SIZE (sse_regnum) || sse_reg + needed_sse_regs > ARRAY_SIZE (sse_regnum)
|| (needed_integer_regs == 0 && needed_sse_regs == 0)) || (needed_integer_regs == 0 && needed_sse_regs == 0))
@@ -2414,13 +2414,13 @@ amd64_analyze_prologue (struct gdbarch *gdbarch,
if (op == 0x55) /* pushq %rbp */ if (op == 0x55) /* pushq %rbp */
{ {
/* Take into account that we've executed the `pushq %rbp' that /* Take into account that we've executed the `pushq %rbp' that
starts this instruction sequence. */ starts this instruction sequence. */
cache->saved_regs[AMD64_RBP_REGNUM] = 0; cache->saved_regs[AMD64_RBP_REGNUM] = 0;
cache->sp_offset += 8; cache->sp_offset += 8;
/* If that's all, return now. */ /* If that's all, return now. */
if (current_pc <= pc + 1) if (current_pc <= pc + 1)
return current_pc; return current_pc;
read_code (pc + 1, buf, 3); read_code (pc + 1, buf, 3);
@@ -2506,7 +2506,7 @@ amd64_skip_xmm_prologue (CORE_ADDR pc, CORE_ADDR start_pc)
{ {
/* 0x0f 0x29 0b??000101 movaps %xmmreg?,-0x??(%rbp) */ /* 0x0f 0x29 0b??000101 movaps %xmmreg?,-0x??(%rbp) */
if (buf[offset] != 0x0f || buf[offset + 1] != 0x29 if (buf[offset] != 0x0f || buf[offset + 1] != 0x29
|| (buf[offset + 2] & 0x3f) != (xmmreg << 3 | 0x5)) || (buf[offset + 2] & 0x3f) != (xmmreg << 3 | 0x5))
return pc; return pc;
/* 0b01?????? */ /* 0b01?????? */
@@ -2548,13 +2548,13 @@ amd64_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR start_pc)
struct compunit_symtab *cust = find_pc_compunit_symtab (func_addr); struct compunit_symtab *cust = find_pc_compunit_symtab (func_addr);
/* LLVM backend (Clang/Flang) always emits a line note before the /* LLVM backend (Clang/Flang) always emits a line note before the
prologue and another one after. We trust clang to emit usable prologue and another one after. We trust clang to emit usable
line notes. */ line notes. */
if (post_prologue_pc if (post_prologue_pc
&& (cust != NULL && (cust != NULL
&& COMPUNIT_PRODUCER (cust) != NULL && COMPUNIT_PRODUCER (cust) != NULL
&& producer_is_llvm (COMPUNIT_PRODUCER (cust)))) && producer_is_llvm (COMPUNIT_PRODUCER (cust))))
return std::max (start_pc, post_prologue_pc); return std::max (start_pc, post_prologue_pc);
} }
amd64_init_frame_cache (&cache); amd64_init_frame_cache (&cache);

View File

@@ -144,7 +144,7 @@ amd64_windows_passed_by_xmm_register (struct type *type)
{ {
return ((type->code () == TYPE_CODE_FLT return ((type->code () == TYPE_CODE_FLT
|| type->code () == TYPE_CODE_DECFLOAT) || type->code () == TYPE_CODE_DECFLOAT)
&& (TYPE_LENGTH (type) == 4 || TYPE_LENGTH (type) == 8)); && (TYPE_LENGTH (type) == 4 || TYPE_LENGTH (type) == 8));
} }
/* Return non-zero iff an argument of the given TYPE should be passed /* Return non-zero iff an argument of the given TYPE should be passed
@@ -268,7 +268,7 @@ amd64_windows_push_arguments (struct regcache *regcache, int nargs,
else if (amd64_windows_passed_by_xmm_register (type)) else if (amd64_windows_passed_by_xmm_register (type))
{ {
amd64_windows_store_arg_in_reg amd64_windows_store_arg_in_reg
(regcache, args[i], AMD64_XMM0_REGNUM + reg_idx); (regcache, args[i], AMD64_XMM0_REGNUM + reg_idx);
/* In case of varargs, these parameters must also be /* In case of varargs, these parameters must also be
passed via the integer registers. */ passed via the integer registers. */
amd64_windows_store_arg_in_reg amd64_windows_store_arg_in_reg
@@ -324,7 +324,7 @@ amd64_windows_push_dummy_call
if (return_method == return_method_struct) if (return_method == return_method_struct)
{ {
/* The "hidden" argument is passed throught the first argument /* The "hidden" argument is passed throught the first argument
register. */ register. */
const int arg_regnum = amd64_windows_dummy_call_integer_regs[0]; const int arg_regnum = amd64_windows_dummy_call_integer_regs[0];
store_unsigned_integer (buf, 8, byte_order, struct_addr); store_unsigned_integer (buf, 8, byte_order, struct_addr);
@@ -367,8 +367,8 @@ amd64_windows_return_value (struct gdbarch *gdbarch, struct value *function,
case TYPE_CODE_FLT: case TYPE_CODE_FLT:
/* floats, and doubles are returned via XMM0. */ /* floats, and doubles are returned via XMM0. */
if (len == 4 || len == 8) if (len == 4 || len == 8)
regnum = AMD64_XMM0_REGNUM; regnum = AMD64_XMM0_REGNUM;
break; break;
case TYPE_CODE_ARRAY: case TYPE_CODE_ARRAY:
/* __m128, __m128i and __m128d are returned via XMM0. */ /* __m128, __m128i and __m128d are returned via XMM0. */
if (type->is_vector () && len == 16) if (type->is_vector () && len == 16)
@@ -382,20 +382,20 @@ amd64_windows_return_value (struct gdbarch *gdbarch, struct value *function,
} }
/* fall through */ /* fall through */
default: default:
/* All other values that are 1, 2, 4 or 8 bytes long are returned /* All other values that are 1, 2, 4 or 8 bytes long are returned
via RAX. */ via RAX. */
if (len == 1 || len == 2 || len == 4 || len == 8) if (len == 1 || len == 2 || len == 4 || len == 8)
regnum = AMD64_RAX_REGNUM; regnum = AMD64_RAX_REGNUM;
else if (len == 16 && type->code () == TYPE_CODE_INT) else if (len == 16 && type->code () == TYPE_CODE_INT)
regnum = AMD64_XMM0_REGNUM; regnum = AMD64_XMM0_REGNUM;
break; break;
} }
if (regnum < 0) if (regnum < 0)
{ {
/* RAX contains the address where the return value has been stored. */ /* RAX contains the address where the return value has been stored. */
if (readbuf) if (readbuf)
{ {
ULONGEST addr; ULONGEST addr;
regcache_raw_read_unsigned (regcache, AMD64_RAX_REGNUM, &addr); regcache_raw_read_unsigned (regcache, AMD64_RAX_REGNUM, &addr);
@@ -1389,9 +1389,9 @@ void
_initialize_amd64_windows_tdep () _initialize_amd64_windows_tdep ()
{ {
gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64, GDB_OSABI_WINDOWS, gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64, GDB_OSABI_WINDOWS,
amd64_windows_init_abi); amd64_windows_init_abi);
gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64, GDB_OSABI_CYGWIN, gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64, GDB_OSABI_CYGWIN,
amd64_cygwin_init_abi); amd64_cygwin_init_abi);
gdbarch_register_osabi_sniffer (bfd_arch_i386, bfd_target_coff_flavour, gdbarch_register_osabi_sniffer (bfd_arch_i386, bfd_target_coff_flavour,
amd64_windows_osabi_sniffer); amd64_windows_osabi_sniffer);

View File

@@ -238,8 +238,8 @@ annotate_thread_exited (struct thread_info *t, int silent)
if (annotation_level > 1) if (annotation_level > 1)
{ {
printf_filtered(("\n\032\032thread-exited," printf_filtered(("\n\032\032thread-exited,"
"id=\"%d\",group-id=\"i%d\"\n"), "id=\"%d\",group-id=\"i%d\"\n"),
t->global_num, t->inf->num); t->global_num, t->inf->num);
} }
} }

View File

@@ -675,35 +675,35 @@ arc_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc,
The stack grows downward, so SP points below FP in memory; SP always The stack grows downward, so SP points below FP in memory; SP always
points to the last used word on the stack, not the first one. points to the last used word on the stack, not the first one.
| | | | | |
| arg word N | | caller's | arg word N | | caller's
| : | | frame | : | | frame
| arg word 10 | | | arg word 10 | |
| arg word 9 | | | arg word 9 | |
old SP ---> +-----------------------+ --+ old SP ---> +-----------------------+ --+
| | | | | |
| callee-saved | | | callee-saved | |
| registers | | | registers | |
| including fp, blink | | | including fp, blink | |
| | | callee's | | | callee's
new FP ---> +-----------------------+ | frame new FP ---> +-----------------------+ | frame
| | | | | |
| local | | | local | |
| variables | | | variables | |
| | | | | |
| register | | | register | |
| spill area | | | spill area | |
| | | | | |
| outgoing args | | | outgoing args | |
| | | | | |
new SP ---> +-----------------------+ --+ new SP ---> +-----------------------+ --+
| | | |
| unused | | unused |
| | | |
| |
| |
V V
downwards downwards
The list of arguments to be passed to a function is considered to be a The list of arguments to be passed to a function is considered to be a
sequence of _N_ words (as though all the parameters were stored in order in sequence of _N_ words (as though all the parameters were stored in order in
@@ -1958,7 +1958,7 @@ determine_core_reg_feature_set (const unsigned long mach)
return &arc_v2_core_reg_feature; return &arc_v2_core_reg_feature;
default: default:
gdb_assert_not_reached gdb_assert_not_reached
("Unknown machine type to determine the core feature set."); ("Unknown machine type to determine the core feature set.");
} }
} }
@@ -1974,8 +1974,8 @@ determine_aux_reg_feature_set ()
/* Update accumulator register names (ACCH/ACCL) for r58 and r59 in the /* Update accumulator register names (ACCH/ACCL) for r58 and r59 in the
register sets. The endianness determines the assignment: register sets. The endianness determines the assignment:
,------.------. ,------.------.
| acch | accl | | acch | accl |
,----|------+------| ,----|------+------|
| LE | r59 | r58 | | LE | r59 | r58 |
| BE | r58 | r59 | | BE | r58 | r59 |
@@ -2139,7 +2139,7 @@ arc_tdesc_init (struct gdbarch_info info, const struct target_desc **tdesc,
if (!valid_p) if (!valid_p)
{ {
if (arc_debug) if (arc_debug)
debug_printf ("arc: Target description is not valid\n"); debug_printf ("arc: Target description is not valid\n");
return false; return false;
} }

View File

@@ -211,7 +211,7 @@ legacy_virtual_frame_pointer (struct gdbarch *gdbarch,
*frame_regnum = gdbarch_deprecated_fp_regnum (gdbarch); *frame_regnum = gdbarch_deprecated_fp_regnum (gdbarch);
else if (gdbarch_sp_regnum (gdbarch) >= 0 else if (gdbarch_sp_regnum (gdbarch) >= 0
&& gdbarch_sp_regnum (gdbarch) && gdbarch_sp_regnum (gdbarch)
< gdbarch_num_regs (gdbarch)) < gdbarch_num_regs (gdbarch))
*frame_regnum = gdbarch_sp_regnum (gdbarch); *frame_regnum = gdbarch_sp_regnum (gdbarch);
else else
/* Should this be an internal error? I guess so, it is reflecting /* Should this be an internal error? I guess so, it is reflecting
@@ -1039,11 +1039,11 @@ default_get_pc_address_flags (frame_info *frame, CORE_ADDR pc)
/* See arch-utils.h. */ /* See arch-utils.h. */
void void
default_read_core_file_mappings (struct gdbarch *gdbarch, default_read_core_file_mappings (struct gdbarch *gdbarch,
struct bfd *cbfd, struct bfd *cbfd,
gdb::function_view<void (ULONGEST count)> gdb::function_view<void (ULONGEST count)>
pre_loop_cb, pre_loop_cb,
gdb::function_view<void (int num, gdb::function_view<void (int num,
ULONGEST start, ULONGEST start,
ULONGEST end, ULONGEST end,
ULONGEST file_ofs, ULONGEST file_ofs,
const char *filename, const char *filename,

View File

@@ -77,7 +77,7 @@ thumb_deal_with_atomic_sequence_raw (struct arm_get_next_pcs *self)
loc += 2; loc += 2;
if (!((insn1 & 0xfff0) == 0xe850 if (!((insn1 & 0xfff0) == 0xe850
|| ((insn1 & 0xfff0) == 0xe8d0 && (insn2 & 0x00c0) == 0x0040))) || ((insn1 & 0xfff0) == 0xe8d0 && (insn2 & 0x00c0) == 0x0040)))
return {}; return {};
/* Assume that no atomic sequence is longer than "atomic_sequence_length" /* Assume that no atomic sequence is longer than "atomic_sequence_length"
@@ -215,20 +215,20 @@ arm_deal_with_atomic_sequence_raw (struct arm_get_next_pcs *self)
loc += 4; loc += 4;
/* Assume that there is at most one conditional branch in the atomic /* Assume that there is at most one conditional branch in the atomic
sequence. If a conditional branch is found, put a breakpoint in sequence. If a conditional branch is found, put a breakpoint in
its destination address. */ its destination address. */
if (bits (insn, 24, 27) == 0xa) if (bits (insn, 24, 27) == 0xa)
{ {
if (last_breakpoint > 0) if (last_breakpoint > 0)
return {}; /* More than one conditional branch found, fallback return {}; /* More than one conditional branch found, fallback
to the standard single-step code. */ to the standard single-step code. */
breaks[1] = BranchDest (loc - 4, insn); breaks[1] = BranchDest (loc - 4, insn);
last_breakpoint++; last_breakpoint++;
} }
/* We do not support atomic sequences that use any *other* instructions /* We do not support atomic sequences that use any *other* instructions
but conditional branches to change the PC. Fall back to standard but conditional branches to change the PC. Fall back to standard
code to avoid losing control of execution. */ code to avoid losing control of execution. */
else if (arm_instruction_changes_pc (insn)) else if (arm_instruction_changes_pc (insn))
return {}; return {};
@@ -408,7 +408,7 @@ thumb_get_next_pcs_raw (struct arm_get_next_pcs *self)
CORE_ADDR sp; CORE_ADDR sp;
/* Fetch the saved PC from the stack. It's stored above /* Fetch the saved PC from the stack. It's stored above
all of the other registers. */ all of the other registers. */
unsigned long offset unsigned long offset
= count_one_bits (bits (inst1, 0, 7)) * ARM_INT_REGISTER_SIZE; = count_one_bits (bits (inst1, 0, 7)) * ARM_INT_REGISTER_SIZE;
sp = regcache_raw_get_unsigned (regcache, ARM_SP_REGNUM); sp = regcache_raw_get_unsigned (regcache, ARM_SP_REGNUM);
@@ -679,7 +679,7 @@ arm_get_next_pcs_raw (struct arm_get_next_pcs *self)
case 0xd: case 0xd:
case 0xe: case 0xe:
/* Coprocessor register transfer. */ /* Coprocessor register transfer. */
if (bits (this_instr, 12, 15) == 15) if (bits (this_instr, 12, 15) == 15)
error (_("Invalid update to pc in instruction")); error (_("Invalid update to pc in instruction"));
break; break;
} }

View File

@@ -119,7 +119,7 @@ arm_instruction_changes_pc (uint32_t this_instr)
case 0xd: case 0xd:
case 0xe: case 0xe:
/* Coprocessor register transfer. */ /* Coprocessor register transfer. */
if (bits (this_instr, 12, 15) == 15) if (bits (this_instr, 12, 15) == 15)
error (_("Invalid update to pc in instruction")); error (_("Invalid update to pc in instruction"));
return 0; return 0;
default: default:

View File

@@ -515,7 +515,7 @@ supply_fpregset (struct regcache *regcache, const gdb_fpregset_t *fpregsetp)
ps_err_e ps_err_e
ps_get_thread_area (struct ps_prochandle *ph, ps_get_thread_area (struct ps_prochandle *ph,
lwpid_t lwpid, int idx, void **base) lwpid_t lwpid, int idx, void **base)
{ {
if (ptrace (PTRACE_GET_THREAD_AREA, lwpid, NULL, base) != 0) if (ptrace (PTRACE_GET_THREAD_AREA, lwpid, NULL, base) != 0)
return PS_ERR; return PS_ERR;
@@ -619,18 +619,18 @@ arm_linux_get_hwbp_cap (void)
info.bp_count = (gdb_byte)(val & 0xff); info.bp_count = (gdb_byte)(val & 0xff);
if (info.wp_count > MAX_WPTS) if (info.wp_count > MAX_WPTS)
{ {
warning (_("arm-linux-gdb supports %d hardware watchpoints but target \ warning (_("arm-linux-gdb supports %d hardware watchpoints but target \
supports %d"), MAX_WPTS, info.wp_count); supports %d"), MAX_WPTS, info.wp_count);
info.wp_count = MAX_WPTS; info.wp_count = MAX_WPTS;
} }
if (info.bp_count > MAX_BPTS) if (info.bp_count > MAX_BPTS)
{ {
warning (_("arm-linux-gdb supports %d hardware breakpoints but target \ warning (_("arm-linux-gdb supports %d hardware breakpoints but target \
supports %d"), MAX_BPTS, info.bp_count); supports %d"), MAX_BPTS, info.bp_count);
info.bp_count = MAX_BPTS; info.bp_count = MAX_BPTS;
} }
available = (info.arch != 0); available = (info.arch != 0);
} }
} }
@@ -717,7 +717,7 @@ struct arm_linux_hw_breakpoint
The Linux vector is indexed as follows: The Linux vector is indexed as follows:
-((i << 1) + 2): Control register for watchpoint i. -((i << 1) + 2): Control register for watchpoint i.
-((i << 1) + 1): Address register for watchpoint i. -((i << 1) + 1): Address register for watchpoint i.
0: Information register. 0: Information register.
((i << 1) + 1): Address register for breakpoint i. ((i << 1) + 1): Address register for breakpoint i.
((i << 1) + 2): Control register for breakpoint i. ((i << 1) + 2): Control register for breakpoint i.
@@ -963,7 +963,7 @@ update_registers_callback (struct lwp_info *lwp, int watch, int index)
=1) BPT for thread TID. */ =1) BPT for thread TID. */
static void static void
arm_linux_insert_hw_breakpoint1 (const struct arm_linux_hw_breakpoint* bpt, arm_linux_insert_hw_breakpoint1 (const struct arm_linux_hw_breakpoint* bpt,
int watchpoint) int watchpoint)
{ {
int pid; int pid;
ptid_t pid_ptid; ptid_t pid_ptid;
@@ -987,14 +987,14 @@ arm_linux_insert_hw_breakpoint1 (const struct arm_linux_hw_breakpoint* bpt,
for (i = 0; i < count; ++i) for (i = 0; i < count; ++i)
if (!arm_hwbp_control_is_enabled (bpts[i].control)) if (!arm_hwbp_control_is_enabled (bpts[i].control))
{ {
bpts[i] = *bpt; bpts[i] = *bpt;
iterate_over_lwps (pid_ptid, iterate_over_lwps (pid_ptid,
[=] (struct lwp_info *info) [=] (struct lwp_info *info)
{ {
return update_registers_callback (info, watchpoint, return update_registers_callback (info, watchpoint,
i); i);
}); });
break; break;
} }
gdb_assert (i != count); gdb_assert (i != count);
@@ -1004,7 +1004,7 @@ arm_linux_insert_hw_breakpoint1 (const struct arm_linux_hw_breakpoint* bpt,
(WATCHPOINT = 1) BPT for thread TID. */ (WATCHPOINT = 1) BPT for thread TID. */
static void static void
arm_linux_remove_hw_breakpoint1 (const struct arm_linux_hw_breakpoint *bpt, arm_linux_remove_hw_breakpoint1 (const struct arm_linux_hw_breakpoint *bpt,
int watchpoint) int watchpoint)
{ {
int pid; int pid;
gdb_byte count, i; gdb_byte count, i;
@@ -1028,14 +1028,14 @@ arm_linux_remove_hw_breakpoint1 (const struct arm_linux_hw_breakpoint *bpt,
for (i = 0; i < count; ++i) for (i = 0; i < count; ++i)
if (arm_linux_hw_breakpoint_equal (bpt, bpts + i)) if (arm_linux_hw_breakpoint_equal (bpt, bpts + i))
{ {
bpts[i].control = arm_hwbp_control_disable (bpts[i].control); bpts[i].control = arm_hwbp_control_disable (bpts[i].control);
iterate_over_lwps (pid_ptid, iterate_over_lwps (pid_ptid,
[=] (struct lwp_info *info) [=] (struct lwp_info *info)
{ {
return update_registers_callback (info, watchpoint, return update_registers_callback (info, watchpoint,
i); i);
}); });
break; break;
} }
gdb_assert (i != count); gdb_assert (i != count);
@@ -1241,35 +1241,35 @@ arm_linux_nat_target::low_prepare_to_resume (struct lwp_info *lwp)
for (i = 0; i < arm_linux_get_hw_breakpoint_count (); i++) for (i = 0; i < arm_linux_get_hw_breakpoint_count (); i++)
if (arm_lwp_info->bpts_changed[i]) if (arm_lwp_info->bpts_changed[i])
{ {
errno = 0; errno = 0;
if (arm_hwbp_control_is_enabled (bpts[i].control)) if (arm_hwbp_control_is_enabled (bpts[i].control))
if (ptrace (PTRACE_SETHBPREGS, pid, if (ptrace (PTRACE_SETHBPREGS, pid,
(PTRACE_TYPE_ARG3) ((i << 1) + 1), &bpts[i].address) < 0) (PTRACE_TYPE_ARG3) ((i << 1) + 1), &bpts[i].address) < 0)
perror_with_name (_("Unexpected error setting breakpoint")); perror_with_name (_("Unexpected error setting breakpoint"));
if (bpts[i].control != 0) if (bpts[i].control != 0)
if (ptrace (PTRACE_SETHBPREGS, pid, if (ptrace (PTRACE_SETHBPREGS, pid,
(PTRACE_TYPE_ARG3) ((i << 1) + 2), &bpts[i].control) < 0) (PTRACE_TYPE_ARG3) ((i << 1) + 2), &bpts[i].control) < 0)
perror_with_name (_("Unexpected error setting breakpoint")); perror_with_name (_("Unexpected error setting breakpoint"));
arm_lwp_info->bpts_changed[i] = 0; arm_lwp_info->bpts_changed[i] = 0;
} }
for (i = 0; i < arm_linux_get_hw_watchpoint_count (); i++) for (i = 0; i < arm_linux_get_hw_watchpoint_count (); i++)
if (arm_lwp_info->wpts_changed[i]) if (arm_lwp_info->wpts_changed[i])
{ {
errno = 0; errno = 0;
if (arm_hwbp_control_is_enabled (wpts[i].control)) if (arm_hwbp_control_is_enabled (wpts[i].control))
if (ptrace (PTRACE_SETHBPREGS, pid, if (ptrace (PTRACE_SETHBPREGS, pid,
(PTRACE_TYPE_ARG3) -((i << 1) + 1), &wpts[i].address) < 0) (PTRACE_TYPE_ARG3) -((i << 1) + 1), &wpts[i].address) < 0)
perror_with_name (_("Unexpected error setting watchpoint")); perror_with_name (_("Unexpected error setting watchpoint"));
if (wpts[i].control != 0) if (wpts[i].control != 0)
if (ptrace (PTRACE_SETHBPREGS, pid, if (ptrace (PTRACE_SETHBPREGS, pid,
(PTRACE_TYPE_ARG3) -((i << 1) + 2), &wpts[i].control) < 0) (PTRACE_TYPE_ARG3) -((i << 1) + 2), &wpts[i].control) < 0)
perror_with_name (_("Unexpected error setting watchpoint")); perror_with_name (_("Unexpected error setting watchpoint"));
arm_lwp_info->wpts_changed[i] = 0; arm_lwp_info->wpts_changed[i] = 0;
} }
} }

View File

@@ -728,15 +728,15 @@ arm_linux_iterate_over_regset_sections (struct gdbarch *gdbarch,
static const struct target_desc * static const struct target_desc *
arm_linux_core_read_description (struct gdbarch *gdbarch, arm_linux_core_read_description (struct gdbarch *gdbarch,
struct target_ops *target, struct target_ops *target,
bfd *abfd) bfd *abfd)
{ {
CORE_ADDR arm_hwcap = linux_get_hwcap (target); CORE_ADDR arm_hwcap = linux_get_hwcap (target);
if (arm_hwcap & HWCAP_VFP) if (arm_hwcap & HWCAP_VFP)
{ {
/* NEON implies VFPv3-D32 or no-VFP unit. Say that we only support /* NEON implies VFPv3-D32 or no-VFP unit. Say that we only support
Neon with VFPv3-D32. */ Neon with VFPv3-D32. */
if (arm_hwcap & HWCAP_NEON) if (arm_hwcap & HWCAP_NEON)
return aarch32_read_description (); return aarch32_read_description ();
else if ((arm_hwcap & (HWCAP_VFPv3 | HWCAP_VFPv3D16)) == HWCAP_VFPv3) else if ((arm_hwcap & (HWCAP_VFPv3 | HWCAP_VFPv3D16)) == HWCAP_VFPv3)
@@ -850,12 +850,12 @@ arm_linux_get_syscall_number (struct gdbarch *gdbarch,
if (svc_operand) if (svc_operand)
{ {
/* OABI */ /* OABI */
svc_number = svc_operand - 0x900000; svc_number = svc_operand - 0x900000;
} }
else else
{ {
/* EABI */ /* EABI */
regcache_cooked_read_unsigned (regs, 7, &svc_number); regcache_cooked_read_unsigned (regs, 7, &svc_number);
} }
} }
@@ -962,9 +962,9 @@ arm_linux_cleanup_svc (struct gdbarch *gdbarch,
fprintf_unfiltered (gdb_stdlog, "displaced: PC is apparently %.8lx after " fprintf_unfiltered (gdb_stdlog, "displaced: PC is apparently %.8lx after "
"SVC step ", (unsigned long) apparent_pc); "SVC step ", (unsigned long) apparent_pc);
if (within_scratch) if (within_scratch)
fprintf_unfiltered (gdb_stdlog, "(within scratch space)\n"); fprintf_unfiltered (gdb_stdlog, "(within scratch space)\n");
else else
fprintf_unfiltered (gdb_stdlog, "(outside scratch space)\n"); fprintf_unfiltered (gdb_stdlog, "(outside scratch space)\n");
} }
if (within_scratch) if (within_scratch)
@@ -1037,7 +1037,7 @@ arm_linux_copy_svc (struct gdbarch *gdbarch, struct regcache *regs,
location, else nothing. location, else nothing.
Insn: unmodified svc. Insn: unmodified svc.
Cleanup: if pc lands in scratch space, pc <- insn_addr + insn_size Cleanup: if pc lands in scratch space, pc <- insn_addr + insn_size
else leave pc alone. */ else leave pc alone. */
dsc->cleanup = &arm_linux_cleanup_svc; dsc->cleanup = &arm_linux_cleanup_svc;
@@ -1086,7 +1086,7 @@ arm_catch_kernel_helper_return (struct gdbarch *gdbarch, CORE_ADDR from,
dsc->wrote_to_pc = 1; dsc->wrote_to_pc = 1;
/* Preparation: tmp[0] <- r14 /* Preparation: tmp[0] <- r14
r14 <- <scratch space>+4 r14 <- <scratch space>+4
*(<scratch space>+8) <- from *(<scratch space>+8) <- from
Insn: ldr pc, [r14, #4] Insn: ldr pc, [r14, #4]
Cleanup: r14 <- tmp[0], pc <- tmp[0]. */ Cleanup: r14 <- tmp[0], pc <- tmp[0]. */
@@ -1116,7 +1116,7 @@ arm_linux_displaced_step_copy_insn (struct gdbarch *gdbarch,
if (from > 0xffff0000) if (from > 0xffff0000)
{ {
if (debug_displaced) if (debug_displaced)
fprintf_unfiltered (gdb_stdlog, "displaced: detected kernel helper " fprintf_unfiltered (gdb_stdlog, "displaced: detected kernel helper "
"at %.8lx\n", (unsigned long) from); "at %.8lx\n", (unsigned long) from);
arm_catch_kernel_helper_return (gdbarch, from, to, regs, dsc.get ()); arm_catch_kernel_helper_return (gdbarch, from, to, regs, dsc.get ());
@@ -1644,7 +1644,7 @@ arm_all_but_pc_registers_record (struct regcache *regcache)
for (i = 0; i < ARM_PC_REGNUM; i++) for (i = 0; i < ARM_PC_REGNUM; i++)
{ {
if (record_full_arch_list_add_reg (regcache, ARM_A1_REGNUM + i)) if (record_full_arch_list_add_reg (regcache, ARM_A1_REGNUM + i))
return -1; return -1;
} }
if (record_full_arch_list_add_reg (regcache, ARM_PS_REGNUM)) if (record_full_arch_list_add_reg (regcache, ARM_PS_REGNUM))
@@ -1666,8 +1666,8 @@ arm_linux_syscall_record (struct regcache *regcache, unsigned long svc_number)
if (syscall_gdb == gdb_sys_no_syscall) if (syscall_gdb == gdb_sys_no_syscall)
{ {
printf_unfiltered (_("Process record and replay target doesn't " printf_unfiltered (_("Process record and replay target doesn't "
"support syscall number %s\n"), "support syscall number %s\n"),
plongest (svc_number)); plongest (svc_number));
return -1; return -1;
} }
@@ -1680,7 +1680,7 @@ arm_linux_syscall_record (struct regcache *regcache, unsigned long svc_number)
} }
ret = record_linux_system_call (syscall_gdb, regcache, ret = record_linux_system_call (syscall_gdb, regcache,
&arm_linux_record_tdep); &arm_linux_record_tdep);
if (ret != 0) if (ret != 0)
return ret; return ret;
@@ -1772,7 +1772,7 @@ arm_linux_init_abi (struct gdbarch_info info,
default: default:
internal_error internal_error
(__FILE__, __LINE__, (__FILE__, __LINE__,
_("arm_linux_init_abi: Floating point model not supported")); _("arm_linux_init_abi: Floating point model not supported"));
break; break;
} }
tdep->jb_elt_size = ARM_LINUX_JB_ELEMENT_SIZE; tdep->jb_elt_size = ARM_LINUX_JB_ELEMENT_SIZE;
@@ -1789,7 +1789,7 @@ arm_linux_init_abi (struct gdbarch_info info,
/* Enable TLS support. */ /* Enable TLS support. */
set_gdbarch_fetch_tls_load_module_address (gdbarch, set_gdbarch_fetch_tls_load_module_address (gdbarch,
svr4_fetch_objfile_link_map); svr4_fetch_objfile_link_map);
tramp_frame_prepend_unwinder (gdbarch, tramp_frame_prepend_unwinder (gdbarch,
&arm_linux_sigreturn_tramp_frame); &arm_linux_sigreturn_tramp_frame);

View File

@@ -167,5 +167,5 @@ void
_initialize_arm_netbsd_tdep () _initialize_arm_netbsd_tdep ()
{ {
gdbarch_register_osabi (bfd_arch_arm, 0, GDB_OSABI_NETBSD, gdbarch_register_osabi (bfd_arch_arm, 0, GDB_OSABI_NETBSD,
arm_netbsd_elf_init_abi); arm_netbsd_elf_init_abi);
} }

View File

@@ -87,7 +87,7 @@ _initialize_arm_pikeos_tdep ()
{ {
/* Register the sniffer for the PikeOS targets. */ /* Register the sniffer for the PikeOS targets. */
gdbarch_register_osabi_sniffer (bfd_arch_arm, bfd_target_elf_flavour, gdbarch_register_osabi_sniffer (bfd_arch_arm, bfd_target_elf_flavour,
arm_pikeos_osabi_sniffer); arm_pikeos_osabi_sniffer);
gdbarch_register_osabi (bfd_arch_arm, 0, GDB_OSABI_PIKEOS, gdbarch_register_osabi (bfd_arch_arm, 0, GDB_OSABI_PIKEOS,
arm_pikeos_init_abi); arm_pikeos_init_abi);
} }

File diff suppressed because it is too large Load Diff

View File

@@ -194,7 +194,7 @@ struct arm_displaced_step_closure : public displaced_step_closure
struct struct
{ {
/* If non-NULL, override generic SVC handling (e.g. for a particular /* If non-NULL, override generic SVC handling (e.g. for a particular
OS). */ OS). */
int (*copy_svc_os) (struct gdbarch *gdbarch, struct regcache *regs, int (*copy_svc_os) (struct gdbarch *gdbarch, struct regcache *regs,
arm_displaced_step_closure *dsc); arm_displaced_step_closure *dsc);
} svc; } svc;
@@ -273,7 +273,7 @@ extern int arm_psr_thumb_bit (struct gdbarch *);
extern int arm_pc_is_thumb (struct gdbarch *, CORE_ADDR); extern int arm_pc_is_thumb (struct gdbarch *, CORE_ADDR);
extern int arm_process_record (struct gdbarch *gdbarch, extern int arm_process_record (struct gdbarch *gdbarch,
struct regcache *regcache, CORE_ADDR addr); struct regcache *regcache, CORE_ADDR addr);
/* Functions exported from arm-bsd-tdep.h. */ /* Functions exported from arm-bsd-tdep.h. */
/* Return the appropriate register set for the core section identified /* Return the appropriate register set for the core section identified

View File

@@ -159,8 +159,8 @@ void
_initialize_arm_wince_tdep () _initialize_arm_wince_tdep ()
{ {
gdbarch_register_osabi_sniffer (bfd_arch_arm, bfd_target_coff_flavour, gdbarch_register_osabi_sniffer (bfd_arch_arm, bfd_target_coff_flavour,
arm_wince_osabi_sniffer); arm_wince_osabi_sniffer);
gdbarch_register_osabi (bfd_arch_arm, 0, GDB_OSABI_WINCE, gdbarch_register_osabi (bfd_arch_arm, 0, GDB_OSABI_WINCE,
arm_wince_init_abi); arm_wince_init_abi);
} }

View File

@@ -364,7 +364,7 @@ filename_is_in_pattern_1 (char *filename, char *pattern)
for (;;) for (;;)
{ {
/* Trim trailing slashes ("/"). PATTERN also has slashes trimmed the /* Trim trailing slashes ("/"). PATTERN also has slashes trimmed the
same way so they will match. */ same way so they will match. */
while (filename_len && IS_DIR_SEPARATOR (filename[filename_len - 1])) while (filename_len && IS_DIR_SEPARATOR (filename[filename_len - 1]))
filename_len--; filename_len--;
filename[filename_len] = '\0'; filename[filename_len] = '\0';

View File

@@ -192,8 +192,8 @@ ld_so_xfer_auxv (gdb_byte *readbuf,
len -= block; len -= block;
/* Check terminal AT_NULL. This function is being called /* Check terminal AT_NULL. This function is being called
indefinitely being extended its READBUF until it returns EOF indefinitely being extended its READBUF until it returns EOF
(0). */ (0). */
while (block >= auxv_pair_size) while (block >= auxv_pair_size)
{ {

View File

@@ -382,12 +382,12 @@ static void
avr_write_pc (struct regcache *regcache, CORE_ADDR val) avr_write_pc (struct regcache *regcache, CORE_ADDR val)
{ {
regcache_cooked_write_unsigned (regcache, AVR_PC_REGNUM, regcache_cooked_write_unsigned (regcache, AVR_PC_REGNUM,
avr_convert_iaddr_to_raw (val)); avr_convert_iaddr_to_raw (val));
} }
static enum register_status static enum register_status
avr_pseudo_register_read (struct gdbarch *gdbarch, readable_regcache *regcache, avr_pseudo_register_read (struct gdbarch *gdbarch, readable_regcache *regcache,
int regnum, gdb_byte *buf) int regnum, gdb_byte *buf)
{ {
ULONGEST val; ULONGEST val;
enum register_status status; enum register_status status;
@@ -408,7 +408,7 @@ avr_pseudo_register_read (struct gdbarch *gdbarch, readable_regcache *regcache,
static void static void
avr_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, avr_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
int regnum, const gdb_byte *buf) int regnum, const gdb_byte *buf)
{ {
ULONGEST val; ULONGEST val;
@@ -433,87 +433,87 @@ avr_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
This information is stored in the avr_unwind_cache structure. This information is stored in the avr_unwind_cache structure.
Some devices lack the sbiw instruction, so on those replace this: Some devices lack the sbiw instruction, so on those replace this:
sbiw r28, XX sbiw r28, XX
with this: with this:
subi r28,lo8(XX) subi r28,lo8(XX)
sbci r29,hi8(XX) sbci r29,hi8(XX)
A typical AVR function prologue with a frame pointer might look like this: A typical AVR function prologue with a frame pointer might look like this:
push rXX ; saved regs push rXX ; saved regs
... ...
push r28 push r28
push r29 push r29
in r28,__SP_L__ in r28,__SP_L__
in r29,__SP_H__ in r29,__SP_H__
sbiw r28,<LOCALS_SIZE> sbiw r28,<LOCALS_SIZE>
in __tmp_reg__,__SREG__ in __tmp_reg__,__SREG__
cli cli
out __SP_H__,r29 out __SP_H__,r29
out __SREG__,__tmp_reg__ out __SREG__,__tmp_reg__
out __SP_L__,r28 out __SP_L__,r28
A typical AVR function prologue without a frame pointer might look like A typical AVR function prologue without a frame pointer might look like
this: this:
push rXX ; saved regs push rXX ; saved regs
... ...
A main function prologue looks like this: A main function prologue looks like this:
ldi r28,lo8(<RAM_ADDR> - <LOCALS_SIZE>) ldi r28,lo8(<RAM_ADDR> - <LOCALS_SIZE>)
ldi r29,hi8(<RAM_ADDR> - <LOCALS_SIZE>) ldi r29,hi8(<RAM_ADDR> - <LOCALS_SIZE>)
out __SP_H__,r29 out __SP_H__,r29
out __SP_L__,r28 out __SP_L__,r28
A signal handler prologue looks like this: A signal handler prologue looks like this:
push __zero_reg__ push __zero_reg__
push __tmp_reg__ push __tmp_reg__
in __tmp_reg__, __SREG__ in __tmp_reg__, __SREG__
push __tmp_reg__ push __tmp_reg__
clr __zero_reg__ clr __zero_reg__
push rXX ; save registers r18:r27, r30:r31 push rXX ; save registers r18:r27, r30:r31
... ...
push r28 ; save frame pointer push r28 ; save frame pointer
push r29 push r29
in r28, __SP_L__ in r28, __SP_L__
in r29, __SP_H__ in r29, __SP_H__
sbiw r28, <LOCALS_SIZE> sbiw r28, <LOCALS_SIZE>
out __SP_H__, r29 out __SP_H__, r29
out __SP_L__, r28 out __SP_L__, r28
A interrupt handler prologue looks like this: A interrupt handler prologue looks like this:
sei sei
push __zero_reg__ push __zero_reg__
push __tmp_reg__ push __tmp_reg__
in __tmp_reg__, __SREG__ in __tmp_reg__, __SREG__
push __tmp_reg__ push __tmp_reg__
clr __zero_reg__ clr __zero_reg__
push rXX ; save registers r18:r27, r30:r31 push rXX ; save registers r18:r27, r30:r31
... ...
push r28 ; save frame pointer push r28 ; save frame pointer
push r29 push r29
in r28, __SP_L__ in r28, __SP_L__
in r29, __SP_H__ in r29, __SP_H__
sbiw r28, <LOCALS_SIZE> sbiw r28, <LOCALS_SIZE>
cli cli
out __SP_H__, r29 out __SP_H__, r29
sei sei
out __SP_L__, r28 out __SP_L__, r28
A `-mcall-prologues' prologue looks like this (Note that the megas use a A `-mcall-prologues' prologue looks like this (Note that the megas use a
jmp instead of a rjmp, thus the prologue is one word larger since jmp is a jmp instead of a rjmp, thus the prologue is one word larger since jmp is a
32 bit insn and rjmp is a 16 bit insn): 32 bit insn and rjmp is a 16 bit insn):
ldi r26,lo8(<LOCALS_SIZE>) ldi r26,lo8(<LOCALS_SIZE>)
ldi r27,hi8(<LOCALS_SIZE>) ldi r27,hi8(<LOCALS_SIZE>)
ldi r30,pm_lo8(.L_foo_body) ldi r30,pm_lo8(.L_foo_body)
ldi r31,pm_hi8(.L_foo_body) ldi r31,pm_hi8(.L_foo_body)
rjmp __prologue_saves__+RRR rjmp __prologue_saves__+RRR
.L_foo_body: */ .L_foo_body: */
/* Not really part of a prologue, but still need to scan for it, is when a /* Not really part of a prologue, but still need to scan for it, is when a
function prologue moves values passed via registers as arguments to new function prologue moves values passed via registers as arguments to new
registers. In this case, all local variables live in registers, so there registers. In this case, all local variables live in registers, so there
may be some register saves. This is what it looks like: may be some register saves. This is what it looks like:
movw rMM, rNN movw rMM, rNN
... ...
There could be multiple movw's. If the target doesn't have a movw insn, it There could be multiple movw's. If the target doesn't have a movw insn, it
will use two mov insns. This could be done after any of the above prologue will use two mov insns. This could be done after any of the above prologue
@@ -569,9 +569,9 @@ avr_scan_prologue (struct gdbarch *gdbarch, CORE_ADDR pc_beg, CORE_ADDR pc_end,
if (vpc + 4 + sizeof (img) < len if (vpc + 4 + sizeof (img) < len
&& memcmp (prologue + vpc + 4, img, sizeof (img)) == 0) && memcmp (prologue + vpc + 4, img, sizeof (img)) == 0)
{ {
info->prologue_type = AVR_PROLOGUE_MAIN; info->prologue_type = AVR_PROLOGUE_MAIN;
info->base = locals; info->base = locals;
return pc_beg + 4; return pc_beg + 4;
} }
} }
} }
@@ -627,46 +627,46 @@ avr_scan_prologue (struct gdbarch *gdbarch, CORE_ADDR pc_beg, CORE_ADDR pc_end,
insn = extract_unsigned_integer (&prologue[vpc + 8], 2, byte_order); insn = extract_unsigned_integer (&prologue[vpc + 8], 2, byte_order);
/* rjmp __prologue_saves__+RRR */ /* rjmp __prologue_saves__+RRR */
if ((insn & 0xf000) == 0xc000) if ((insn & 0xf000) == 0xc000)
{ {
/* Extract PC relative offset from RJMP */ /* Extract PC relative offset from RJMP */
i = (insn & 0xfff) | (insn & 0x800 ? (-1 ^ 0xfff) : 0); i = (insn & 0xfff) | (insn & 0x800 ? (-1 ^ 0xfff) : 0);
/* Convert offset to byte addressable mode */ /* Convert offset to byte addressable mode */
i *= 2; i *= 2;
/* Destination address */ /* Destination address */
i += pc_beg + 10; i += pc_beg + 10;
if (body_addr != (pc_beg + 10)/2) if (body_addr != (pc_beg + 10)/2)
break; break;
pc_offset += 2; pc_offset += 2;
} }
else if ((insn & 0xfe0e) == 0x940c) else if ((insn & 0xfe0e) == 0x940c)
{ {
/* Extract absolute PC address from JMP */ /* Extract absolute PC address from JMP */
i = (((insn & 0x1) | ((insn & 0x1f0) >> 3) << 16) i = (((insn & 0x1) | ((insn & 0x1f0) >> 3) << 16)
| (extract_unsigned_integer (&prologue[vpc + 10], 2, byte_order) | (extract_unsigned_integer (&prologue[vpc + 10], 2, byte_order)
& 0xffff)); & 0xffff));
/* Convert address to byte addressable mode */ /* Convert address to byte addressable mode */
i *= 2; i *= 2;
if (body_addr != (pc_beg + 12)/2) if (body_addr != (pc_beg + 12)/2)
break; break;
pc_offset += 4; pc_offset += 4;
} }
else else
break; break;
/* Resolve offset (in words) from __prologue_saves__ symbol. /* Resolve offset (in words) from __prologue_saves__ symbol.
Which is a pushes count in `-mcall-prologues' mode */ Which is a pushes count in `-mcall-prologues' mode */
num_pushes = AVR_MAX_PUSHES - (i - BMSYMBOL_VALUE_ADDRESS (msymbol)) / 2; num_pushes = AVR_MAX_PUSHES - (i - BMSYMBOL_VALUE_ADDRESS (msymbol)) / 2;
if (num_pushes > AVR_MAX_PUSHES) if (num_pushes > AVR_MAX_PUSHES)
{ {
fprintf_unfiltered (gdb_stderr, _("Num pushes too large: %d\n"), fprintf_unfiltered (gdb_stderr, _("Num pushes too large: %d\n"),
num_pushes); num_pushes);
num_pushes = 0; num_pushes = 0;
} }
if (num_pushes) if (num_pushes)
{ {
@@ -705,22 +705,22 @@ avr_scan_prologue (struct gdbarch *gdbarch, CORE_ADDR pc_beg, CORE_ADDR pc_end,
if (len >= sizeof (img) if (len >= sizeof (img)
&& memcmp (prologue, img, sizeof (img)) == 0) && memcmp (prologue, img, sizeof (img)) == 0)
{ {
info->prologue_type = AVR_PROLOGUE_INTR; info->prologue_type = AVR_PROLOGUE_INTR;
vpc += sizeof (img); vpc += sizeof (img);
info->saved_regs[AVR_SREG_REGNUM].addr = 3; info->saved_regs[AVR_SREG_REGNUM].addr = 3;
info->saved_regs[0].addr = 2; info->saved_regs[0].addr = 2;
info->saved_regs[1].addr = 1; info->saved_regs[1].addr = 1;
info->size += 3; info->size += 3;
} }
else if (len >= sizeof (img) - 2 else if (len >= sizeof (img) - 2
&& memcmp (img + 2, prologue, sizeof (img) - 2) == 0) && memcmp (img + 2, prologue, sizeof (img) - 2) == 0)
{ {
info->prologue_type = AVR_PROLOGUE_SIG; info->prologue_type = AVR_PROLOGUE_SIG;
vpc += sizeof (img) - 2; vpc += sizeof (img) - 2;
info->saved_regs[AVR_SREG_REGNUM].addr = 3; info->saved_regs[AVR_SREG_REGNUM].addr = 3;
info->saved_regs[0].addr = 2; info->saved_regs[0].addr = 2;
info->saved_regs[1].addr = 1; info->saved_regs[1].addr = 1;
info->size += 2; info->size += 2;
} }
} }
@@ -750,17 +750,17 @@ avr_scan_prologue (struct gdbarch *gdbarch, CORE_ADDR pc_beg, CORE_ADDR pc_end,
{ {
insn = extract_unsigned_integer (&prologue[vpc], 2, byte_order); insn = extract_unsigned_integer (&prologue[vpc], 2, byte_order);
if (insn == 0xd000) /* rcall .+0 */ if (insn == 0xd000) /* rcall .+0 */
{ {
info->size += gdbarch_tdep (gdbarch)->call_length; info->size += gdbarch_tdep (gdbarch)->call_length;
vpc += 2; vpc += 2;
} }
else if (insn == 0x920f || insn == 0x921f) /* push r0 or push r1 */ else if (insn == 0x920f || insn == 0x921f) /* push r0 or push r1 */
{ {
info->size += 1; info->size += 1;
vpc += 2; vpc += 2;
} }
else else
break; break;
} }
/* Second stage of the prologue scanning. /* Second stage of the prologue scanning.
@@ -786,7 +786,7 @@ avr_scan_prologue (struct gdbarch *gdbarch, CORE_ADDR pc_beg, CORE_ADDR pc_end,
/* Third stage of the prologue scanning. (Really two stages). /* Third stage of the prologue scanning. (Really two stages).
Scan for: Scan for:
sbiw r28,XX or subi r28,lo8(XX) sbiw r28,XX or subi r28,lo8(XX)
sbci r29,hi8(XX) sbci r29,hi8(XX)
in __tmp_reg__,__SREG__ in __tmp_reg__,__SREG__
cli cli
out __SP_H__,r29 out __SP_H__,r29
@@ -816,10 +816,10 @@ avr_scan_prologue (struct gdbarch *gdbarch, CORE_ADDR pc_beg, CORE_ADDR pc_end,
insn = extract_unsigned_integer (&prologue[vpc], 2, byte_order); insn = extract_unsigned_integer (&prologue[vpc], 2, byte_order);
if ((insn & 0xff30) == 0x9720) /* sbiw r28,XXX */ if ((insn & 0xff30) == 0x9720) /* sbiw r28,XXX */
{ {
locals_size = (insn & 0xf) | ((insn & 0xc0) >> 2); locals_size = (insn & 0xf) | ((insn & 0xc0) >> 2);
vpc += 2; vpc += 2;
} }
else if ((insn & 0xf0f0) == 0x50c0) /* subi r28,lo8(XX) */ else if ((insn & 0xf0f0) == 0x50c0) /* subi r28,lo8(XX) */
{ {
locals_size = (insn & 0xf) | ((insn & 0xf00) >> 4); locals_size = (insn & 0xf) | ((insn & 0xf00) >> 4);
@@ -829,28 +829,28 @@ avr_scan_prologue (struct gdbarch *gdbarch, CORE_ADDR pc_beg, CORE_ADDR pc_end,
locals_size += ((insn & 0xf) | ((insn & 0xf00) >> 4)) << 8; locals_size += ((insn & 0xf) | ((insn & 0xf00) >> 4)) << 8;
} }
else else
return pc_beg + vpc; return pc_beg + vpc;
/* Scan the last part of the prologue. May not be present for interrupt /* Scan the last part of the prologue. May not be present for interrupt
or signal handler functions, which is why we set the prologue type or signal handler functions, which is why we set the prologue type
when we saw the beginning of the prologue previously. */ when we saw the beginning of the prologue previously. */
if (vpc + sizeof (img_sig) < len if (vpc + sizeof (img_sig) < len
&& memcmp (prologue + vpc, img_sig, sizeof (img_sig)) == 0) && memcmp (prologue + vpc, img_sig, sizeof (img_sig)) == 0)
{ {
vpc += sizeof (img_sig); vpc += sizeof (img_sig);
} }
else if (vpc + sizeof (img_int) < len else if (vpc + sizeof (img_int) < len
&& memcmp (prologue + vpc, img_int, sizeof (img_int)) == 0) && memcmp (prologue + vpc, img_int, sizeof (img_int)) == 0)
{ {
vpc += sizeof (img_int); vpc += sizeof (img_int);
} }
if (vpc + sizeof (img) < len if (vpc + sizeof (img) < len
&& memcmp (prologue + vpc, img, sizeof (img)) == 0) && memcmp (prologue + vpc, img, sizeof (img)) == 0)
{ {
info->prologue_type = AVR_PROLOGUE_NORMAL; info->prologue_type = AVR_PROLOGUE_NORMAL;
vpc += sizeof (img); vpc += sizeof (img);
} }
info->size += locals_size; info->size += locals_size;
@@ -864,11 +864,11 @@ avr_scan_prologue (struct gdbarch *gdbarch, CORE_ADDR pc_beg, CORE_ADDR pc_end,
{ {
insn = extract_unsigned_integer (&prologue[vpc], 2, byte_order); insn = extract_unsigned_integer (&prologue[vpc], 2, byte_order);
if ((insn & 0xff00) == 0x0100) /* movw rXX, rYY */ if ((insn & 0xff00) == 0x0100) /* movw rXX, rYY */
continue; continue;
else if ((insn & 0xfc00) == 0x2c00) /* mov rXX, rYY */ else if ((insn & 0xfc00) == 0x2c00) /* mov rXX, rYY */
continue; continue;
else else
break; break;
} }
return pc_beg + vpc; return pc_beg + vpc;
@@ -977,7 +977,7 @@ avr_return_value (struct gdbarch *gdbarch, struct value *function,
static struct avr_unwind_cache * static struct avr_unwind_cache *
avr_frame_unwind_cache (struct frame_info *this_frame, avr_frame_unwind_cache (struct frame_info *this_frame,
void **this_prologue_cache) void **this_prologue_cache)
{ {
CORE_ADDR start_pc, current_pc; CORE_ADDR start_pc, current_pc;
ULONGEST prev_sp; ULONGEST prev_sp;
@@ -1009,20 +1009,20 @@ avr_frame_unwind_cache (struct frame_info *this_frame,
ULONGEST high_base; /* High byte of FP */ ULONGEST high_base; /* High byte of FP */
/* The SP was moved to the FP. This indicates that a new frame /* The SP was moved to the FP. This indicates that a new frame
was created. Get THIS frame's FP value by unwinding it from was created. Get THIS frame's FP value by unwinding it from
the next frame. */ the next frame. */
this_base = get_frame_register_unsigned (this_frame, AVR_FP_REGNUM); this_base = get_frame_register_unsigned (this_frame, AVR_FP_REGNUM);
high_base = get_frame_register_unsigned (this_frame, AVR_FP_REGNUM + 1); high_base = get_frame_register_unsigned (this_frame, AVR_FP_REGNUM + 1);
this_base += (high_base << 8); this_base += (high_base << 8);
/* The FP points at the last saved register. Adjust the FP back /* The FP points at the last saved register. Adjust the FP back
to before the first saved register giving the SP. */ to before the first saved register giving the SP. */
prev_sp = this_base + info->size; prev_sp = this_base + info->size;
} }
else else
{ {
/* Assume that the FP is this frame's SP but with that pushed /* Assume that the FP is this frame's SP but with that pushed
stack space added back. */ stack space added back. */
this_base = get_frame_register_unsigned (this_frame, AVR_SP_REGNUM); this_base = get_frame_register_unsigned (this_frame, AVR_SP_REGNUM);
prev_sp = this_base + info->size; prev_sp = this_base + info->size;
} }
@@ -1050,7 +1050,7 @@ avr_frame_unwind_cache (struct frame_info *this_frame,
value. */ value. */
tdep = gdbarch_tdep (gdbarch); tdep = gdbarch_tdep (gdbarch);
trad_frame_set_value (info->saved_regs, AVR_SP_REGNUM, trad_frame_set_value (info->saved_regs, AVR_SP_REGNUM,
info->prev_sp - 1 + tdep->call_length); info->prev_sp - 1 + tdep->call_length);
return info; return info;
} }
@@ -1080,8 +1080,8 @@ avr_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
static void static void
avr_frame_this_id (struct frame_info *this_frame, avr_frame_this_id (struct frame_info *this_frame,
void **this_prologue_cache, void **this_prologue_cache,
struct frame_id *this_id) struct frame_id *this_id)
{ {
struct avr_unwind_cache *info struct avr_unwind_cache *info
= avr_frame_unwind_cache (this_frame, this_prologue_cache); = avr_frame_unwind_cache (this_frame, this_prologue_cache);
@@ -1113,7 +1113,7 @@ avr_frame_prev_register (struct frame_info *this_frame,
if (regnum == AVR_PC_REGNUM || regnum == AVR_PSEUDO_PC_REGNUM) if (regnum == AVR_PC_REGNUM || regnum == AVR_PSEUDO_PC_REGNUM)
{ {
if (trad_frame_addr_p (info->saved_regs, AVR_PC_REGNUM)) if (trad_frame_addr_p (info->saved_regs, AVR_PC_REGNUM))
{ {
/* Reading the return PC from the PC register is slightly /* Reading the return PC from the PC register is slightly
abnormal. register_size(AVR_PC_REGNUM) says it is 4 bytes, abnormal. register_size(AVR_PC_REGNUM) says it is 4 bytes,
but in reality, only two bytes (3 in upcoming mega256) are but in reality, only two bytes (3 in upcoming mega256) are
@@ -1133,18 +1133,18 @@ avr_frame_prev_register (struct frame_info *this_frame,
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
read_memory (info->saved_regs[AVR_PC_REGNUM].addr, read_memory (info->saved_regs[AVR_PC_REGNUM].addr,
buf, tdep->call_length); buf, tdep->call_length);
/* Extract the PC read from memory as a big-endian. */ /* Extract the PC read from memory as a big-endian. */
pc = 0; pc = 0;
for (i = 0; i < tdep->call_length; i++) for (i = 0; i < tdep->call_length; i++)
pc = (pc << 8) | buf[i]; pc = (pc << 8) | buf[i];
if (regnum == AVR_PC_REGNUM) if (regnum == AVR_PC_REGNUM)
pc <<= 1; pc <<= 1;
return frame_unwind_got_constant (this_frame, regnum, pc); return frame_unwind_got_constant (this_frame, regnum, pc);
} }
return frame_unwind_got_optimized (this_frame, regnum); return frame_unwind_got_optimized (this_frame, regnum);
} }
@@ -1264,8 +1264,8 @@ pop_stack_item (struct stack_item *si)
static CORE_ADDR static CORE_ADDR
avr_push_dummy_call (struct gdbarch *gdbarch, struct value *function, avr_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
struct regcache *regcache, CORE_ADDR bp_addr, 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, function_call_return_method return_method,
CORE_ADDR struct_addr) CORE_ADDR struct_addr)
{ {
@@ -1279,13 +1279,13 @@ avr_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
if (return_method == return_method_struct) if (return_method == return_method_struct)
{ {
regcache_cooked_write_unsigned regcache_cooked_write_unsigned
(regcache, regnum--, (struct_addr >> 8) & 0xff); (regcache, regnum--, (struct_addr >> 8) & 0xff);
regcache_cooked_write_unsigned regcache_cooked_write_unsigned
(regcache, regnum--, struct_addr & 0xff); (regcache, regnum--, struct_addr & 0xff);
/* SP being post decremented, we need to reserve one byte so that the /* SP being post decremented, we need to reserve one byte so that the
return address won't overwrite the result (or vice-versa). */ return address won't overwrite the result (or vice-versa). */
if (sp == struct_addr) if (sp == struct_addr)
sp--; sp--;
} }
for (i = 0; i < nargs; i++) for (i = 0; i < nargs; i++)
@@ -1298,30 +1298,30 @@ avr_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
int len = TYPE_LENGTH (type); int len = TYPE_LENGTH (type);
/* Calculate the potential last register needed. /* Calculate the potential last register needed.
E.g. For length 2, registers regnum and regnum-1 (say 25 and 24) E.g. For length 2, registers regnum and regnum-1 (say 25 and 24)
shall be used. So, last needed register will be regnum-1(24). */ shall be used. So, last needed register will be regnum-1(24). */
last_regnum = regnum - (len + (len & 1)) + 1; last_regnum = regnum - (len + (len & 1)) + 1;
/* If there are registers available, use them. Once we start putting /* If there are registers available, use them. Once we start putting
stuff on the stack, all subsequent args go on stack. */ stuff on the stack, all subsequent args go on stack. */
if ((si == NULL) && (last_regnum >= AVR_LAST_ARG_REGNUM)) if ((si == NULL) && (last_regnum >= AVR_LAST_ARG_REGNUM))
{ {
/* Skip a register for odd length args. */ /* Skip a register for odd length args. */
if (len & 1) if (len & 1)
regnum--; regnum--;
/* Write MSB of argument into register and subsequent bytes in /* Write MSB of argument into register and subsequent bytes in
decreasing register numbers. */ decreasing register numbers. */
for (j = 0; j < len; j++) for (j = 0; j < len; j++)
regcache_cooked_write_unsigned regcache_cooked_write_unsigned
(regcache, regnum--, contents[len - j - 1]); (regcache, regnum--, contents[len - j - 1]);
} }
/* No registers available, push the args onto the stack. */ /* No registers available, push the args onto the stack. */
else else
{ {
/* From here on, we don't care about regnum. */ /* From here on, we don't care about regnum. */
si = push_stack_item (si, contents, len); si = push_stack_item (si, contents, len);
} }
} }
/* Push args onto the stack. */ /* Push args onto the stack. */
@@ -1591,18 +1591,18 @@ avr_io_reg_read_command (const char *args, int from_tty)
/* how many registers this round? */ /* how many registers this round? */
int j = step; int j = step;
if ((i+j) >= nreg) if ((i+j) >= nreg)
j = nreg - i; /* last block is less than 8 registers */ j = nreg - i; /* last block is less than 8 registers */
snprintf (query, sizeof (query) - 1, "avr.io_reg:%x,%x", i, j); snprintf (query, sizeof (query) - 1, "avr.io_reg:%x,%x", i, j);
buf = target_read_alloc (current_top_target (), TARGET_OBJECT_AVR, query); buf = target_read_alloc (current_top_target (), TARGET_OBJECT_AVR, query);
if (!buf) if (!buf)
{ {
fprintf_unfiltered (gdb_stderr, fprintf_unfiltered (gdb_stderr,
_("ERR: error reading avr.io_reg:%x,%x\n"), _("ERR: error reading avr.io_reg:%x,%x\n"),
i, j); i, j);
return; return;
} }
const char *p = (const char *) buf->data (); const char *p = (const char *) buf->data ();
for (int k = i; k < (i + j); k++) for (int k = i; k < (i + j); k++)

View File

@@ -327,8 +327,8 @@ gen_trace_static_fields (struct agent_expr *ax,
{ {
case axs_lvalue_memory: case axs_lvalue_memory:
{ {
/* Initialize the TYPE_LENGTH if it is a typedef. */ /* Initialize the TYPE_LENGTH if it is a typedef. */
check_typedef (value.type); check_typedef (value.type);
ax_const_l (ax, TYPE_LENGTH (value.type)); ax_const_l (ax, TYPE_LENGTH (value.type));
ax_simple (ax, aop_trace); ax_simple (ax, aop_trace);
} }
@@ -396,10 +396,10 @@ gen_traced_pop (struct agent_expr *ax, struct axs_value *value)
else else
{ {
/* There's no point in trying to use a trace_quick bytecode /* There's no point in trying to use a trace_quick bytecode
here, since "trace_quick SIZE pop" is three bytes, whereas here, since "trace_quick SIZE pop" is three bytes, whereas
"const8 SIZE trace" is also three bytes, does the same "const8 SIZE trace" is also three bytes, does the same
thing, and the simplest code which generates that will also thing, and the simplest code which generates that will also
work correctly for objects with large sizes. */ work correctly for objects with large sizes. */
ax_const_l (ax, TYPE_LENGTH (value->type)); ax_const_l (ax, TYPE_LENGTH (value->type));
ax_simple (ax, aop_trace); ax_simple (ax, aop_trace);
} }
@@ -487,7 +487,7 @@ gen_fetch (struct agent_expr *ax, struct type *type)
case TYPE_CODE_CHAR: case TYPE_CODE_CHAR:
case TYPE_CODE_BOOL: case TYPE_CODE_BOOL:
/* It's a scalar value, so we know how to dereference it. How /* It's a scalar value, so we know how to dereference it. How
many bytes long is it? */ many bytes long is it? */
switch (TYPE_LENGTH (type)) switch (TYPE_LENGTH (type))
{ {
case 8 / TARGET_CHAR_BIT: case 8 / TARGET_CHAR_BIT:
@@ -685,16 +685,16 @@ gen_var_ref (struct agent_expr *ax, struct axs_value *value, struct symbol *var)
case LOC_REGISTER: case LOC_REGISTER:
/* Don't generate any code at all; in the process of treating /* Don't generate any code at all; in the process of treating
this as an lvalue or rvalue, the caller will generate the this as an lvalue or rvalue, the caller will generate the
right code. */ right code. */
value->kind = axs_lvalue_register; value->kind = axs_lvalue_register;
value->u.reg value->u.reg
= SYMBOL_REGISTER_OPS (var)->register_number (var, ax->gdbarch); = SYMBOL_REGISTER_OPS (var)->register_number (var, ax->gdbarch);
break; break;
/* A lot like LOC_REF_ARG, but the pointer lives directly in a /* A lot like LOC_REF_ARG, but the pointer lives directly in a
register, not on the stack. Simpler than LOC_REGISTER register, not on the stack. Simpler than LOC_REGISTER
because it's just like any other case where the thing because it's just like any other case where the thing
has a real address. */ has a real address. */
case LOC_REGPARM_ADDR: case LOC_REGPARM_ADDR:
ax_reg (ax, ax_reg (ax,
@@ -794,10 +794,10 @@ require_rvalue (struct agent_expr *ax, struct axs_value *value)
case axs_lvalue_register: case axs_lvalue_register:
/* There's nothing on the stack, but value->u.reg is the /* There's nothing on the stack, but value->u.reg is the
register number containing the value. register number containing the value.
When we add floating-point support, this is going to have to When we add floating-point support, this is going to have to
change. What about SPARC register pairs, for example? */ change. What about SPARC register pairs, for example? */
ax_reg (ax, value->u.reg); ax_reg (ax, value->u.reg);
gen_extend (ax, value->type); gen_extend (ax, value->type);
break; break;
@@ -840,7 +840,7 @@ gen_usual_unary (struct agent_expr *ax, struct axs_value *value)
break; break;
/* Arrays get converted to a pointer to their first element, and /* Arrays get converted to a pointer to their first element, and
are no longer an lvalue. */ are no longer an lvalue. */
case TYPE_CODE_ARRAY: case TYPE_CODE_ARRAY:
{ {
struct type *elements = TYPE_TARGET_TYPE (value->type); struct type *elements = TYPE_TARGET_TYPE (value->type);
@@ -853,7 +853,7 @@ gen_usual_unary (struct agent_expr *ax, struct axs_value *value)
break; break;
/* Don't try to convert structures and unions to rvalues. Let the /* Don't try to convert structures and unions to rvalues. Let the
consumer signal an error. */ consumer signal an error. */
case TYPE_CODE_STRUCT: case TYPE_CODE_STRUCT:
case TYPE_CODE_UNION: case TYPE_CODE_UNION:
return; return;
@@ -947,10 +947,10 @@ gen_usual_arithmetic (struct agent_expr *ax, struct axs_value *value1,
&& value2->type->code () == TYPE_CODE_INT) && value2->type->code () == TYPE_CODE_INT)
{ {
/* The ANSI integral promotions seem to work this way: Order the /* The ANSI integral promotions seem to work this way: Order the
integer types by size, and then by signedness: an n-bit integer types by size, and then by signedness: an n-bit
unsigned type is considered "wider" than an n-bit signed unsigned type is considered "wider" than an n-bit signed
type. Promote to the "wider" of the two types, and always type. Promote to the "wider" of the two types, and always
promote at least to int. */ promote at least to int. */
struct type *target = max_type (builtin_type (ax->gdbarch)->builtin_int, struct type *target = max_type (builtin_type (ax->gdbarch)->builtin_int,
max_type (value1->type, value2->type)); max_type (value1->type, value2->type));
@@ -958,8 +958,8 @@ gen_usual_arithmetic (struct agent_expr *ax, struct axs_value *value1,
gen_conversion (ax, value2->type, target); gen_conversion (ax, value2->type, target);
/* Deal with value1, not on the top of the stack. Don't /* Deal with value1, not on the top of the stack. Don't
generate the `swap' instructions if we're not actually going generate the `swap' instructions if we're not actually going
to do anything. */ to do anything. */
if (is_nontrivial_conversion (value1->type, target)) if (is_nontrivial_conversion (value1->type, target))
{ {
ax_simple (ax, aop_swap); ax_simple (ax, aop_swap);
@@ -1009,7 +1009,7 @@ gen_cast (struct agent_expr *ax, struct axs_value *value, struct type *type)
case TYPE_CODE_REF: case TYPE_CODE_REF:
case TYPE_CODE_RVALUE_REF: case TYPE_CODE_RVALUE_REF:
/* It's implementation-defined, and I'll bet this is what GCC /* It's implementation-defined, and I'll bet this is what GCC
does. */ does. */
break; break;
case TYPE_CODE_ARRAY: case TYPE_CODE_ARRAY:
@@ -1021,10 +1021,10 @@ gen_cast (struct agent_expr *ax, struct axs_value *value, struct type *type)
case TYPE_CODE_ENUM: case TYPE_CODE_ENUM:
case TYPE_CODE_BOOL: case TYPE_CODE_BOOL:
/* We don't have to worry about the size of the value, because /* We don't have to worry about the size of the value, because
all our integral values are fully sign-extended, and when all our integral values are fully sign-extended, and when
casting pointers we can do anything we like. Is there any casting pointers we can do anything we like. Is there any
way for us to know what GCC actually does with a cast like way for us to know what GCC actually does with a cast like
this? */ this? */
break; break;
case TYPE_CODE_INT: case TYPE_CODE_INT:
@@ -1033,9 +1033,9 @@ gen_cast (struct agent_expr *ax, struct axs_value *value, struct type *type)
case TYPE_CODE_VOID: case TYPE_CODE_VOID:
/* We could pop the value, and rely on everyone else to check /* We could pop the value, and rely on everyone else to check
the type and notice that this value doesn't occupy a stack the type and notice that this value doesn't occupy a stack
slot. But for now, leave the value on the stack, and slot. But for now, leave the value on the stack, and
preserve the "value == stack element" assumption. */ preserve the "value == stack element" assumption. */
break; break;
default: default:
@@ -1321,7 +1321,7 @@ gen_bitfield_ref (struct agent_expr *ax, struct axs_value *value,
int op_size = 8 << op; int op_size = 8 << op;
/* The stack at this point, from bottom to top, contains zero or /* The stack at this point, from bottom to top, contains zero or
more fragments, then the address. */ more fragments, then the address. */
/* Does this fetch fit within the bitfield? */ /* Does this fetch fit within the bitfield? */
if (offset + op_size <= bound_end) if (offset + op_size <= bound_end)
@@ -1725,7 +1725,7 @@ gen_repeat (struct expression *exp, union exp_element **pc,
all we need to do is frob the type of the lvalue. */ all we need to do is frob the type of the lvalue. */
{ {
/* FIXME-type-allocation: need a way to free this type when we are /* FIXME-type-allocation: need a way to free this type when we are
done with it. */ done with it. */
struct type *array struct type *array
= lookup_array_range_type (value1.type, 0, length - 1); = lookup_array_range_type (value1.type, 0, length - 1);
@@ -1976,17 +1976,17 @@ gen_expr (struct expression *exp, union exp_element **pc,
break; break;
/* Note that we need to be a little subtle about generating code /* Note that we need to be a little subtle about generating code
for comma. In C, we can do some optimizations here because for comma. In C, we can do some optimizations here because
we know the left operand is only being evaluated for effect. we know the left operand is only being evaluated for effect.
However, if the tracing kludge is in effect, then we always However, if the tracing kludge is in effect, then we always
need to evaluate the left hand side fully, so that all the need to evaluate the left hand side fully, so that all the
variables it mentions get traced. */ variables it mentions get traced. */
case BINOP_COMMA: case BINOP_COMMA:
(*pc)++; (*pc)++;
gen_expr (exp, pc, ax, &value1); gen_expr (exp, pc, ax, &value1);
/* Don't just dispose of the left operand. We might be tracing, /* Don't just dispose of the left operand. We might be tracing,
in which case we want to emit code to trace it if it's an in which case we want to emit code to trace it if it's an
lvalue. */ lvalue. */
gen_traced_pop (ax, &value1); gen_traced_pop (ax, &value1);
gen_expr (exp, pc, ax, value); gen_expr (exp, pc, ax, value);
/* It's the consumer's responsibility to trace the right operand. */ /* It's the consumer's responsibility to trace the right operand. */
@@ -2194,8 +2194,8 @@ gen_expr (struct expression *exp, union exp_element **pc,
case UNOP_SIZEOF: case UNOP_SIZEOF:
(*pc)++; (*pc)++;
/* Notice that gen_sizeof handles its own operand, unlike most /* Notice that gen_sizeof handles its own operand, unlike most
of the other unary operator functions. This is because we of the other unary operator functions. This is because we
have to throw away the code we generate. */ have to throw away the code we generate. */
gen_sizeof (exp, pc, ax, value, gen_sizeof (exp, pc, ax, value,
builtin_type (ax->gdbarch)->builtin_int); builtin_type (ax->gdbarch)->builtin_int);
break; break;
@@ -2583,7 +2583,7 @@ agent_eval_command_one (const char *exp, int eval, CORE_ADDR pc)
if (!eval) if (!eval)
{ {
if (*exp == '/') if (*exp == '/')
exp = decode_agent_options (exp, &trace_string); exp = decode_agent_options (exp, &trace_string);
} }
agent_expr_up agent; agent_expr_up agent;
@@ -2640,7 +2640,7 @@ agent_command_1 (const char *exp, int eval)
NULL, NULL); NULL, NULL);
exp = skip_spaces (exp); exp = skip_spaces (exp);
if (exp[0] == ',') if (exp[0] == ',')
{ {
exp++; exp++;
exp = skip_spaces (exp); exp = skip_spaces (exp);
} }

View File

@@ -244,7 +244,7 @@ ax_const_l (struct agent_expr *x, LONGEST l)
LONGEST lim = ((LONGEST) 1) << (size - 1); LONGEST lim = ((LONGEST) 1) << (size - 1);
if (-lim <= l && l <= lim - 1) if (-lim <= l && l <= lim - 1)
break; break;
} }
/* Emit the right opcode... */ /* Emit the right opcode... */
@@ -292,7 +292,7 @@ ax_reg (struct agent_expr *x, int reg)
/* Make sure the register number is in range. */ /* Make sure the register number is in range. */
if (reg < 0 || reg > 0xffff) if (reg < 0 || reg > 0xffff)
error (_("GDB bug: ax-general.c (ax_reg): " error (_("GDB bug: ax-general.c (ax_reg): "
"register number out of range")); "register number out of range"));
grow_expr (x, 3); grow_expr (x, 3);
x->buf[x->len] = aop_reg; x->buf[x->len] = aop_reg;
@@ -446,18 +446,18 @@ ax_reg_mask (struct agent_expr *ax, int reg)
/* Grow the bit mask if necessary. */ /* Grow the bit mask if necessary. */
if (byte >= ax->reg_mask_len) if (byte >= ax->reg_mask_len)
{ {
/* It's not appropriate to double here. This isn't a /* It's not appropriate to double here. This isn't a
string buffer. */ string buffer. */
int new_len = byte + 1; int new_len = byte + 1;
unsigned char *new_reg_mask unsigned char *new_reg_mask
= XRESIZEVEC (unsigned char, ax->reg_mask, new_len); = XRESIZEVEC (unsigned char, ax->reg_mask, new_len);
memset (new_reg_mask + ax->reg_mask_len, 0, memset (new_reg_mask + ax->reg_mask_len, 0,
(new_len - ax->reg_mask_len) * sizeof (ax->reg_mask[0])); (new_len - ax->reg_mask_len) * sizeof (ax->reg_mask[0]));
ax->reg_mask_len = new_len; ax->reg_mask_len = new_len;
ax->reg_mask = new_reg_mask; ax->reg_mask = new_reg_mask;
} }
ax->reg_mask[byte] |= 1 << (reg % 8); ax->reg_mask[byte] |= 1 << (reg % 8);
} }
@@ -517,8 +517,8 @@ ax_reqs (struct agent_expr *ax)
} }
/* If this instruction is a forward jump target, does the /* If this instruction is a forward jump target, does the
current stack height match the stack height at the jump current stack height match the stack height at the jump
source? */ source? */
if (targets[i] && (heights[i] != height)) if (targets[i] && (heights[i] != height))
{ {
ax->flaw = agent_flaw_height_mismatch; ax->flaw = agent_flaw_height_mismatch;
@@ -539,8 +539,8 @@ ax_reqs (struct agent_expr *ax)
ax->max_data_size = op->data_size; ax->max_data_size = op->data_size;
/* For jump instructions, check that the target is a valid /* For jump instructions, check that the target is a valid
offset. If it is, record the fact that that location is a offset. If it is, record the fact that that location is a
jump target, and record the height we expect there. */ jump target, and record the height we expect there. */
if (aop_goto == op - aop_map if (aop_goto == op - aop_map
|| aop_if_goto == op - aop_map) || aop_if_goto == op - aop_map)
{ {
@@ -552,7 +552,7 @@ ax_reqs (struct agent_expr *ax)
} }
/* Do we have any information about what the stack height /* Do we have any information about what the stack height
should be at the target? */ should be at the target? */
if (targets[target] || boundary[target]) if (targets[target] || boundary[target])
{ {
if (heights[target] != height) if (heights[target] != height)
@@ -562,13 +562,13 @@ ax_reqs (struct agent_expr *ax)
} }
} }
/* Record the target, along with the stack height we expect. */ /* Record the target, along with the stack height we expect. */
targets[target] = 1; targets[target] = 1;
heights[target] = height; heights[target] = height;
} }
/* For unconditional jumps with a successor, check that the /* For unconditional jumps with a successor, check that the
successor is a target, and pick up its stack height. */ successor is a target, and pick up its stack height. */
if (aop_goto == op - aop_map if (aop_goto == op - aop_map
&& i + 3 < ax->len) && i + 3 < ax->len)
{ {

View File

@@ -158,7 +158,7 @@ bfin_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
/* Functions for 'catch syscall'. */ /* Functions for 'catch syscall'. */
set_xml_syscall_file_name (gdbarch, "syscalls/bfin-linux.xml"); set_xml_syscall_file_name (gdbarch, "syscalls/bfin-linux.xml");
set_gdbarch_get_syscall_number (gdbarch, set_gdbarch_get_syscall_number (gdbarch,
bfin_linux_get_syscall_number); bfin_linux_get_syscall_number);
} }
void _initialize_bfin_linux_tdep (); void _initialize_bfin_linux_tdep ();
@@ -166,5 +166,5 @@ void
_initialize_bfin_linux_tdep () _initialize_bfin_linux_tdep ()
{ {
gdbarch_register_osabi (bfd_arch_bfin, 0, GDB_OSABI_LINUX, gdbarch_register_osabi (bfd_arch_bfin, 0, GDB_OSABI_LINUX,
bfin_linux_init_abi); bfin_linux_init_abi);
} }

View File

@@ -79,9 +79,9 @@ contained_in (const struct block *a, const struct block *b,
if (a == b) if (a == b)
return true; return true;
/* If A is a function block, then A cannot be contained in B, /* If A is a function block, then A cannot be contained in B,
except if A was inlined. */ except if A was inlined. */
if (!allow_nested && BLOCK_FUNCTION (a) != NULL && !block_inlined_p (a)) if (!allow_nested && BLOCK_FUNCTION (a) != NULL && !block_inlined_p (a))
return false; return false;
a = BLOCK_SUPERBLOCK (a); a = BLOCK_SUPERBLOCK (a);
} }
while (a != NULL); while (a != NULL);
@@ -879,14 +879,14 @@ block_find_non_opaque_type_preferred (struct symbol *sym, void *data)
struct blockranges * struct blockranges *
make_blockranges (struct objfile *objfile, make_blockranges (struct objfile *objfile,
const std::vector<blockrange> &rangevec) const std::vector<blockrange> &rangevec)
{ {
struct blockranges *blr; struct blockranges *blr;
size_t n = rangevec.size(); size_t n = rangevec.size();
blr = (struct blockranges *) blr = (struct blockranges *)
obstack_alloc (&objfile->objfile_obstack, obstack_alloc (&objfile->objfile_obstack,
sizeof (struct blockranges) sizeof (struct blockranges)
+ (n - 1) * sizeof (struct blockrange)); + (n - 1) * sizeof (struct blockrange));
blr->nranges = n; blr->nranges = n;

View File

@@ -392,7 +392,7 @@ extern int block_find_non_opaque_type (struct symbol *sym, void *data);
struct symbol *with_opaque = NULL; struct symbol *with_opaque = NULL;
struct symbol *sym struct symbol *sym
= block_find_symbol (block, name, domain, = block_find_symbol (block, name, domain,
block_find_non_opaque_type_preferred, &with_opaque); block_find_non_opaque_type_preferred, &with_opaque);
At this point if SYM is non-NULL then a non-opaque type has been found. At this point if SYM is non-NULL then a non-opaque type has been found.
Otherwise, if WITH_OPAQUE is non-NULL then an opaque type has been found. Otherwise, if WITH_OPAQUE is non-NULL then an opaque type has been found.
@@ -423,6 +423,6 @@ extern int block_find_non_opaque_type_preferred (struct symbol *sym,
/* Given a vector of pairs, allocate and build an obstack allocated /* Given a vector of pairs, allocate and build an obstack allocated
blockranges struct for a block. */ blockranges struct for a block. */
struct blockranges *make_blockranges (struct objfile *objfile, struct blockranges *make_blockranges (struct objfile *objfile,
const std::vector<blockrange> &rangevec); const std::vector<blockrange> &rangevec);
#endif /* BLOCK_H */ #endif /* BLOCK_H */

View File

@@ -285,7 +285,7 @@ find_pc_partial_function_sym (CORE_ADDR pc,
{ {
int i; int i;
for (i = 0; i < BLOCK_NRANGES (b); i++) for (i = 0; i < BLOCK_NRANGES (b); i++)
{ {
if (BLOCK_RANGE_START (b, i) <= mapped_pc if (BLOCK_RANGE_START (b, i) <= mapped_pc
&& mapped_pc < BLOCK_RANGE_END (b, i)) && mapped_pc < BLOCK_RANGE_END (b, i))
{ {
@@ -395,24 +395,24 @@ find_function_entry_range_from_pc (CORE_ADDR pc, const char **name,
CORE_ADDR entry_pc = BLOCK_ENTRY_PC (block); CORE_ADDR entry_pc = BLOCK_ENTRY_PC (block);
for (int i = 0; i < BLOCK_NRANGES (block); i++) for (int i = 0; i < BLOCK_NRANGES (block); i++)
{ {
if (BLOCK_RANGE_START (block, i) <= entry_pc if (BLOCK_RANGE_START (block, i) <= entry_pc
&& entry_pc < BLOCK_RANGE_END (block, i)) && entry_pc < BLOCK_RANGE_END (block, i))
{ {
if (address != nullptr) if (address != nullptr)
*address = BLOCK_RANGE_START (block, i); *address = BLOCK_RANGE_START (block, i);
if (endaddr != nullptr) if (endaddr != nullptr)
*endaddr = BLOCK_RANGE_END (block, i); *endaddr = BLOCK_RANGE_END (block, i);
return status; return status;
} }
} }
/* It's an internal error if we exit the above loop without finding /* It's an internal error if we exit the above loop without finding
the range. */ the range. */
internal_error (__FILE__, __LINE__, internal_error (__FILE__, __LINE__,
_("Entry block not found in find_function_entry_range_from_pc")); _("Entry block not found in find_function_entry_range_from_pc"));
} }
return status; return status;

View File

@@ -73,7 +73,7 @@ static unsigned int bpf_debug_flag = 0;
static void static void
show_bpf_debug (struct ui_file *file, int from_tty, show_bpf_debug (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
{ {
fprintf_filtered (file, _("Debugging of BPF is %s.\n"), value); fprintf_filtered (file, _("Debugging of BPF is %s.\n"), value);
} }

View File

@@ -228,7 +228,7 @@ signal_catchpoint_print_one (struct breakpoint *b,
bool first = true; bool first = true;
for (gdb_signal iter : c->signals_to_be_caught) for (gdb_signal iter : c->signals_to_be_caught)
{ {
const char *name = signal_to_name_or_int (iter); const char *name = signal_to_name_or_int (iter);
if (!first) if (!first)
@@ -236,7 +236,7 @@ signal_catchpoint_print_one (struct breakpoint *b,
first = false; first = false;
text += name; text += name;
} }
uiout->field_string ("what", text.c_str ()); uiout->field_string ("what", text.c_str ());
} }
else else
@@ -260,16 +260,16 @@ signal_catchpoint_print_mention (struct breakpoint *b)
if (!c->signals_to_be_caught.empty ()) if (!c->signals_to_be_caught.empty ())
{ {
if (c->signals_to_be_caught.size () > 1) if (c->signals_to_be_caught.size () > 1)
printf_filtered (_("Catchpoint %d (signals"), b->number); printf_filtered (_("Catchpoint %d (signals"), b->number);
else else
printf_filtered (_("Catchpoint %d (signal"), b->number); printf_filtered (_("Catchpoint %d (signal"), b->number);
for (gdb_signal iter : c->signals_to_be_caught) for (gdb_signal iter : c->signals_to_be_caught)
{ {
const char *name = signal_to_name_or_int (iter); const char *name = signal_to_name_or_int (iter);
printf_filtered (" %s", name); printf_filtered (" %s", name);
} }
printf_filtered (")"); printf_filtered (")");
} }
else if (c->catch_all) else if (c->catch_all)

View File

@@ -126,8 +126,8 @@ remove_catch_syscall (struct bp_location *bl, enum remove_bp_reason reason)
if (iter >= inf_data->syscalls_counts.size ()) if (iter >= inf_data->syscalls_counts.size ())
/* Shouldn't happen. */ /* Shouldn't happen. */
continue; continue;
--inf_data->syscalls_counts[iter]; --inf_data->syscalls_counts[iter];
} }
} }
return target_set_syscall_catchpoint (inferior_ptid.pid (), return target_set_syscall_catchpoint (inferior_ptid.pid (),
@@ -252,20 +252,20 @@ print_one_catch_syscall (struct breakpoint *b,
char *text = xstrprintf ("%s", ""); char *text = xstrprintf ("%s", "");
for (int iter : c->syscalls_to_be_caught) for (int iter : c->syscalls_to_be_caught)
{ {
char *previous_text = text; char *previous_text = text;
struct syscall s; struct syscall s;
get_syscall_by_number (gdbarch, iter, &s); get_syscall_by_number (gdbarch, iter, &s);
if (s.name != NULL) if (s.name != NULL)
text = xstrprintf ("%s%s, ", text, s.name); text = xstrprintf ("%s%s, ", text, s.name);
else else
text = xstrprintf ("%s%d, ", text, iter); text = xstrprintf ("%s%d, ", text, iter);
/* We have to xfree previous_text because xstrprintf dynamically /* We have to xfree previous_text because xstrprintf dynamically
allocates new space for text on every call. */ allocates new space for text on every call. */
xfree (previous_text); xfree (previous_text);
} }
/* Remove the last comma. */ /* Remove the last comma. */
text[strlen (text) - 2] = '\0'; text[strlen (text) - 2] = '\0';
uiout->field_string ("what", text); uiout->field_string ("what", text);
@@ -292,25 +292,25 @@ print_mention_catch_syscall (struct breakpoint *b)
if (!c->syscalls_to_be_caught.empty ()) if (!c->syscalls_to_be_caught.empty ())
{ {
if (c->syscalls_to_be_caught.size () > 1) if (c->syscalls_to_be_caught.size () > 1)
printf_filtered (_("Catchpoint %d (syscalls"), b->number); printf_filtered (_("Catchpoint %d (syscalls"), b->number);
else else
printf_filtered (_("Catchpoint %d (syscall"), b->number); printf_filtered (_("Catchpoint %d (syscall"), b->number);
for (int iter : c->syscalls_to_be_caught) for (int iter : c->syscalls_to_be_caught)
{ {
struct syscall s; struct syscall s;
get_syscall_by_number (gdbarch, iter, &s); get_syscall_by_number (gdbarch, iter, &s);
if (s.name != NULL) if (s.name != NULL)
printf_filtered (" '%s' [%d]", s.name, s.number); printf_filtered (" '%s' [%d]", s.name, s.number);
else else
printf_filtered (" %d", s.number); printf_filtered (" %d", s.number);
} }
printf_filtered (")"); printf_filtered (")");
} }
else else
printf_filtered (_("Catchpoint %d (any syscall)"), printf_filtered (_("Catchpoint %d (any syscall)"),
b->number); b->number);
} }
/* Implement the "print_recreate" breakpoint_ops method for syscall /* Implement the "print_recreate" breakpoint_ops method for syscall
@@ -352,7 +352,7 @@ syscall_catchpoint_p (struct breakpoint *b)
static void static void
create_syscall_event_catchpoint (int tempflag, std::vector<int> &&filter, create_syscall_event_catchpoint (int tempflag, std::vector<int> &&filter,
const struct breakpoint_ops *ops) const struct breakpoint_ops *ops)
{ {
struct gdbarch *gdbarch = get_current_arch (); struct gdbarch *gdbarch = get_current_arch ();
@@ -524,7 +524,7 @@ catching_syscall_number (int syscall_number)
static void static void
catch_syscall_completer (struct cmd_list_element *cmd, catch_syscall_completer (struct cmd_list_element *cmd,
completion_tracker &tracker, completion_tracker &tracker,
const char *text, const char *word) const char *text, const char *word)
{ {
struct gdbarch *gdbarch = get_current_arch (); struct gdbarch *gdbarch = get_current_arch ();
gdb::unique_xmalloc_ptr<const char *> group_list; gdb::unique_xmalloc_ptr<const char *> group_list;

View File

@@ -544,19 +544,19 @@ _initialize_break_catch_throw ()
add_catch_command ("catch", _("\ add_catch_command ("catch", _("\
Catch an exception, when caught."), Catch an exception, when caught."),
catch_catch_command, catch_catch_command,
NULL, NULL,
CATCH_PERMANENT, CATCH_PERMANENT,
CATCH_TEMPORARY); CATCH_TEMPORARY);
add_catch_command ("throw", _("\ add_catch_command ("throw", _("\
Catch an exception, when thrown."), Catch an exception, when thrown."),
catch_throw_command, catch_throw_command,
NULL, NULL,
CATCH_PERMANENT, CATCH_PERMANENT,
CATCH_TEMPORARY); CATCH_TEMPORARY);
add_catch_command ("rethrow", _("\ add_catch_command ("rethrow", _("\
Catch an exception, when rethrown."), Catch an exception, when rethrown."),
catch_rethrow_command, catch_rethrow_command,
NULL, NULL,
CATCH_PERMANENT, CATCH_PERMANENT,
CATCH_TEMPORARY); CATCH_TEMPORARY);

View File

@@ -135,7 +135,7 @@ static void breakpoint_adjustment_warning (CORE_ADDR, CORE_ADDR, int, int);
static CORE_ADDR adjust_breakpoint_address (struct gdbarch *gdbarch, static CORE_ADDR adjust_breakpoint_address (struct gdbarch *gdbarch,
CORE_ADDR bpaddr, CORE_ADDR bpaddr,
enum bptype bptype); enum bptype bptype);
static void describe_other_breakpoints (struct gdbarch *, static void describe_other_breakpoints (struct gdbarch *,
struct program_space *, CORE_ADDR, struct program_space *, CORE_ADDR,
@@ -1088,8 +1088,8 @@ validate_commands_for_breakpoint (struct breakpoint *b,
struct command_line *while_stepping = 0; struct command_line *while_stepping = 0;
/* Reset the while-stepping step count. The previous commands /* Reset the while-stepping step count. The previous commands
might have included a while-stepping action, while the new might have included a while-stepping action, while the new
ones might not. */ ones might not. */
t->step_count = 0; t->step_count = 0;
/* We need to verify that each top-level element of commands is /* We need to verify that each top-level element of commands is
@@ -1719,10 +1719,10 @@ update_watchpoint (struct watchpoint *b, int reparse)
return; return;
/* Save the current frame's ID so we can restore it after /* Save the current frame's ID so we can restore it after
evaluating the watchpoint expression on its own frame. */ evaluating the watchpoint expression on its own frame. */
/* FIXME drow/2003-09-09: It would be nice if evaluate_expression /* FIXME drow/2003-09-09: It would be nice if evaluate_expression
took a frame parameter, so that we didn't have to change the took a frame parameter, so that we didn't have to change the
selected frame. */ selected frame. */
frame_saved = 1; frame_saved = 1;
saved_frame_id = get_frame_id (get_selected_frame (NULL)); saved_frame_id = get_frame_id (get_selected_frame (NULL));
@@ -2572,17 +2572,17 @@ insert_bp_location (struct bp_location *bl,
{ {
/* Yes. This overlay section is mapped into memory. */ /* Yes. This overlay section is mapped into memory. */
try try
{ {
int val; int val;
val = bl->owner->ops->insert_location (bl); val = bl->owner->ops->insert_location (bl);
if (val) if (val)
bp_excpt = gdb_exception {RETURN_ERROR, GENERIC_ERROR}; bp_excpt = gdb_exception {RETURN_ERROR, GENERIC_ERROR};
} }
catch (gdb_exception &e) catch (gdb_exception &e)
{ {
bp_excpt = std::move (e); bp_excpt = std::move (e);
} }
} }
else else
{ {
@@ -2635,12 +2635,12 @@ insert_bp_location (struct bp_location *bl,
{ {
*hw_breakpoint_error = 1; *hw_breakpoint_error = 1;
*hw_bp_error_explained_already = bp_excpt.message != NULL; *hw_bp_error_explained_already = bp_excpt.message != NULL;
fprintf_unfiltered (tmp_error_stream, fprintf_unfiltered (tmp_error_stream,
"Cannot insert hardware breakpoint %d%s", "Cannot insert hardware breakpoint %d%s",
bl->owner->number, bl->owner->number,
bp_excpt.message ? ":" : ".\n"); bp_excpt.message ? ":" : ".\n");
if (bp_excpt.message != NULL) if (bp_excpt.message != NULL)
fprintf_unfiltered (tmp_error_stream, "%s.\n", fprintf_unfiltered (tmp_error_stream, "%s.\n",
bp_excpt.what ()); bp_excpt.what ());
} }
else else
@@ -2982,7 +2982,7 @@ insert_breakpoint_locations (void)
if (error_flag) if (error_flag)
{ {
/* If a hardware breakpoint or watchpoint was inserted, add a /* If a hardware breakpoint or watchpoint was inserted, add a
message about possibly exhausted resources. */ message about possibly exhausted resources. */
if (hw_breakpoint_error && !hw_bp_error_explained_already) if (hw_breakpoint_error && !hw_bp_error_explained_already)
{ {
tmp_error_stream.printf ("Could not insert hardware breakpoints:\n\ tmp_error_stream.printf ("Could not insert hardware breakpoints:\n\
@@ -3191,21 +3191,21 @@ create_overlay_event_breakpoint (void)
addr = BMSYMBOL_VALUE_ADDRESS (bp_objfile_data->overlay_msym); addr = BMSYMBOL_VALUE_ADDRESS (bp_objfile_data->overlay_msym);
b = create_internal_breakpoint (objfile->arch (), addr, b = create_internal_breakpoint (objfile->arch (), addr,
bp_overlay_event, bp_overlay_event,
&internal_breakpoint_ops); &internal_breakpoint_ops);
initialize_explicit_location (&explicit_loc); initialize_explicit_location (&explicit_loc);
explicit_loc.function_name = ASTRDUP (func_name); explicit_loc.function_name = ASTRDUP (func_name);
b->location = new_explicit_location (&explicit_loc); b->location = new_explicit_location (&explicit_loc);
if (overlay_debugging == ovly_auto) if (overlay_debugging == ovly_auto)
{ {
b->enable_state = bp_enabled; b->enable_state = bp_enabled;
overlay_events_enabled = 1; overlay_events_enabled = 1;
} }
else else
{ {
b->enable_state = bp_disabled; b->enable_state = bp_disabled;
overlay_events_enabled = 0; overlay_events_enabled = 0;
} }
} }
} }
@@ -3530,11 +3530,11 @@ update_breakpoints_after_exec (void)
if (b->type == bp_catchpoint) if (b->type == bp_catchpoint)
{ {
/* For now, none of the bp_catchpoint breakpoints need to /* For now, none of the bp_catchpoint breakpoints need to
do anything at this point. In the future, if some of do anything at this point. In the future, if some of
the catchpoints need to something, we will need to add the catchpoints need to something, we will need to add
a new method, and call this method from here. */ a new method, and call this method from here. */
continue; continue;
} }
/* bp_finish is a special case. The only way we ought to be able /* bp_finish is a special case. The only way we ought to be able
@@ -3749,8 +3749,8 @@ remove_breakpoint_1 (struct bp_location *bl, enum remove_bp_reason reason)
bl->owner->number); bl->owner->number);
} }
else if (bl->owner->type == bp_catchpoint else if (bl->owner->type == bp_catchpoint
&& breakpoint_enabled (bl->owner) && breakpoint_enabled (bl->owner)
&& !bl->duplicate) && !bl->duplicate)
{ {
gdb_assert (bl->owner->ops != NULL gdb_assert (bl->owner->ops != NULL
&& bl->owner->ops->remove_location != NULL); && bl->owner->ops->remove_location != NULL);
@@ -4348,14 +4348,14 @@ bpstat_do_actions_1 (bpstat *bsp)
/* Take ownership of the BSP's command tree, if it has one. /* Take ownership of the BSP's command tree, if it has one.
The command tree could legitimately contain commands like The command tree could legitimately contain commands like
'step' and 'next', which call clear_proceed_status, which 'step' and 'next', which call clear_proceed_status, which
frees stop_bpstat's command tree. To make sure this doesn't frees stop_bpstat's command tree. To make sure this doesn't
free the tree we're executing out from under us, we need to free the tree we're executing out from under us, we need to
take ownership of the tree ourselves. Since a given bpstat's take ownership of the tree ourselves. Since a given bpstat's
commands are only executed once, we don't need to copy it; we commands are only executed once, we don't need to copy it; we
can clear the pointer in the bpstat, and make sure we free can clear the pointer in the bpstat, and make sure we free
the tree when we're done. */ the tree when we're done. */
counted_command_line ccmd = bs->commands; counted_command_line ccmd = bs->commands;
bs->commands = NULL; bs->commands = NULL;
if (ccmd != NULL) if (ccmd != NULL)
@@ -4503,7 +4503,7 @@ print_bp_stop_message (bpstat bs)
case print_it_done: case print_it_done:
/* We still want to print the frame, but we already printed the /* We still want to print the frame, but we already printed the
relevant messages. */ relevant messages. */
return PRINT_SRC_AND_LOC; return PRINT_SRC_AND_LOC;
break; break;
@@ -4835,9 +4835,9 @@ watchpoint_check (bpstat bs)
if (within_current_scope) if (within_current_scope)
{ {
/* We use value_{,free_to_}mark because it could be a *long* /* We use value_{,free_to_}mark because it could be a *long*
time before we return to the command level and call time before we return to the command level and call
free_all_values. We can't call free_all_values because we free_all_values. We can't call free_all_values because we
might be in the middle of evaluating a function call. */ might be in the middle of evaluating a function call. */
int pc = 0; int pc = 0;
struct value *mark; struct value *mark;
@@ -4880,13 +4880,13 @@ watchpoint_check (bpstat bs)
else else
{ {
/* This seems like the only logical thing to do because /* This seems like the only logical thing to do because
if we temporarily ignored the watchpoint, then when if we temporarily ignored the watchpoint, then when
we reenter the block in which it is valid it contains we reenter the block in which it is valid it contains
garbage (in the case of a function, it may have two garbage (in the case of a function, it may have two
garbage values, one before and one after the prologue). garbage values, one before and one after the prologue).
So we can't even detect the first assignment to it and So we can't even detect the first assignment to it and
watch after that (since the garbage may or may not equal watch after that (since the garbage may or may not equal
the first value assigned). */ the first value assigned). */
/* We print all the stop information in /* We print all the stop information in
breakpoint_ops->print_it, but in this case, by the time we breakpoint_ops->print_it, but in this case, by the time we
call breakpoint_ops->print_it this bp will be deleted call breakpoint_ops->print_it this bp will be deleted
@@ -4894,7 +4894,7 @@ watchpoint_check (bpstat bs)
here. */ here. */
SWITCH_THRU_ALL_UIS () SWITCH_THRU_ALL_UIS ()
{ {
struct ui_out *uiout = current_uiout; struct ui_out *uiout = current_uiout;
if (uiout->is_mi_like_p ()) if (uiout->is_mi_like_p ())
@@ -6074,7 +6074,7 @@ print_one_breakpoint_location (struct breakpoint *b,
inf_nums.push_back (inf->num); inf_nums.push_back (inf->num);
} }
/* For backward compatibility, don't display inferiors in CLI unless /* For backward compatibility, don't display inferiors in CLI unless
there are several. Always display for MI. */ there are several. Always display for MI. */
if (allflag if (allflag
|| (!gdbarch_has_global_breakpoints (target_gdbarch ()) || (!gdbarch_has_global_breakpoints (target_gdbarch ())
@@ -6113,7 +6113,7 @@ print_one_breakpoint_location (struct breakpoint *b,
annotate_field (6); annotate_field (6);
uiout->text ("\tstop only in stack frame at "); uiout->text ("\tstop only in stack frame at ");
/* FIXME: cagney/2002-12-01: Shouldn't be poking around inside /* FIXME: cagney/2002-12-01: Shouldn't be poking around inside
the frame ID. */ the frame ID. */
uiout->field_core_addr ("frame", uiout->field_core_addr ("frame",
b->gdbarch, b->frame_id.stack_addr); b->gdbarch, b->frame_id.stack_addr);
uiout->text ("\n"); uiout->text ("\n");
@@ -6625,7 +6625,7 @@ describe_other_breakpoints (struct gdbarch *gdbarch,
ALL_BREAKPOINTS (b) ALL_BREAKPOINTS (b)
others += (user_breakpoint_p (b) others += (user_breakpoint_p (b)
&& breakpoint_has_pc (b, pspace, pc, section)); && breakpoint_has_pc (b, pspace, pc, section));
if (others > 0) if (others > 0)
{ {
if (others == 1) if (others == 1)
@@ -6839,7 +6839,7 @@ breakpoint_locations_match (struct bp_location *loc1,
static void static void
breakpoint_adjustment_warning (CORE_ADDR from_addr, CORE_ADDR to_addr, breakpoint_adjustment_warning (CORE_ADDR from_addr, CORE_ADDR to_addr,
int bnum, int have_bnum) int bnum, int have_bnum)
{ {
/* The longest string possibly returned by hex_string_custom /* The longest string possibly returned by hex_string_custom
is 50 chars. These must be at least that big for safety. */ is 50 chars. These must be at least that big for safety. */
@@ -6850,7 +6850,7 @@ breakpoint_adjustment_warning (CORE_ADDR from_addr, CORE_ADDR to_addr,
strcpy (astr2, hex_string_custom ((unsigned long) to_addr, 8)); strcpy (astr2, hex_string_custom ((unsigned long) to_addr, 8));
if (have_bnum) if (have_bnum)
warning (_("Breakpoint %d address previously adjusted from %s to %s."), warning (_("Breakpoint %d address previously adjusted from %s to %s."),
bnum, astr1, astr2); bnum, astr1, astr2);
else else
warning (_("Breakpoint address adjusted from %s to %s."), astr1, astr2); warning (_("Breakpoint address adjusted from %s to %s."), astr1, astr2);
} }
@@ -6871,7 +6871,7 @@ adjust_breakpoint_address (struct gdbarch *gdbarch,
|| bptype == bp_catchpoint) || bptype == bp_catchpoint)
{ {
/* Watchpoints and the various bp_catch_* eventpoints should not /* Watchpoints and the various bp_catch_* eventpoints should not
have their addresses modified. */ have their addresses modified. */
return bpaddr; return bpaddr;
} }
else if (bptype == bp_single_step) else if (bptype == bp_single_step)
@@ -6898,7 +6898,7 @@ adjust_breakpoint_address (struct gdbarch *gdbarch,
adjusted_bpaddr = address_significant (gdbarch, adjusted_bpaddr); adjusted_bpaddr = address_significant (gdbarch, adjusted_bpaddr);
/* An adjusted breakpoint address can significantly alter /* An adjusted breakpoint address can significantly alter
a user's expectations. Print a warning if an adjustment a user's expectations. Print a warning if an adjustment
is required. */ is required. */
if (adjusted_bpaddr != bpaddr) if (adjusted_bpaddr != bpaddr)
breakpoint_adjustment_warning (bpaddr, adjusted_bpaddr, 0, 0); breakpoint_adjustment_warning (bpaddr, adjusted_bpaddr, 0, 0);
@@ -7095,7 +7095,7 @@ set_breakpoint_location_function (struct bp_location *loc)
mess more complicated breakpoints with multiple locations. */ mess more complicated breakpoints with multiple locations. */
b->type = bp_gnu_ifunc_resolver; b->type = bp_gnu_ifunc_resolver;
/* Remember the resolver's address for use by the return /* Remember the resolver's address for use by the return
breakpoint. */ breakpoint. */
loc->related_address = loc->address; loc->related_address = loc->address;
} }
} }
@@ -8133,7 +8133,7 @@ install_breakpoint (int internal, std::unique_ptr<breakpoint> &&arg, int update_
static void static void
create_fork_vfork_event_catchpoint (struct gdbarch *gdbarch, create_fork_vfork_event_catchpoint (struct gdbarch *gdbarch,
bool temp, const char *cond_string, bool temp, const char *cond_string,
const struct breakpoint_ops *ops) const struct breakpoint_ops *ops)
{ {
std::unique_ptr<fork_catchpoint> c (new fork_catchpoint ()); std::unique_ptr<fork_catchpoint> c (new fork_catchpoint ());
@@ -8839,7 +8839,7 @@ init_breakpoint_sal (struct breakpoint *b, struct gdbarch *gdbarch,
loc->cond = parse_exp_1 (&arg, loc->address, loc->cond = parse_exp_1 (&arg, loc->address,
block_for_pc (loc->address), 0); block_for_pc (loc->address), 0);
if (*arg) if (*arg)
error (_("Garbage '%s' follows condition"), arg); error (_("Garbage '%s' follows condition"), arg);
} }
/* Dynamic printf requires and uses additional arguments on the /* Dynamic printf requires and uses additional arguments on the
@@ -9256,7 +9256,7 @@ create_breakpoint (struct gdbarch *gdbarch,
exception_print (gdb_stderr, e); exception_print (gdb_stderr, e);
/* If pending breakpoint support is auto query and the user /* If pending breakpoint support is auto query and the user
selects no, then simply return the error code. */ selects no, then simply return the error code. */
if (pending_break_support == AUTO_BOOLEAN_AUTO if (pending_break_support == AUTO_BOOLEAN_AUTO
&& !nquery (_("Make %s pending on future shared library load? "), && !nquery (_("Make %s pending on future shared library load? "),
@@ -9300,7 +9300,7 @@ create_breakpoint (struct gdbarch *gdbarch,
gdb::unique_xmalloc_ptr<char> extra_string_copy; gdb::unique_xmalloc_ptr<char> extra_string_copy;
if (parse_extra) if (parse_extra)
{ {
char *rest; char *rest;
char *cond; char *cond;
@@ -9315,9 +9315,9 @@ create_breakpoint (struct gdbarch *gdbarch,
&cond, &thread, &task, &rest); &cond, &thread, &task, &rest);
cond_string_copy.reset (cond); cond_string_copy.reset (cond);
extra_string_copy.reset (rest); extra_string_copy.reset (rest);
} }
else else
{ {
if (type_wanted != bp_dprintf if (type_wanted != bp_dprintf
&& extra_string != NULL && *extra_string != '\0') && extra_string != NULL && *extra_string != '\0')
error (_("Garbage '%s' at end of location"), extra_string); error (_("Garbage '%s' at end of location"), extra_string);
@@ -9328,7 +9328,7 @@ create_breakpoint (struct gdbarch *gdbarch,
/* Create a private copy of any extra string. */ /* Create a private copy of any extra string. */
if (extra_string) if (extra_string)
extra_string_copy.reset (xstrdup (extra_string)); extra_string_copy.reset (xstrdup (extra_string));
} }
ops->create_breakpoints_sal (gdbarch, &canonical, ops->create_breakpoints_sal (gdbarch, &canonical,
std::move (cond_string_copy), std::move (cond_string_copy),
@@ -9361,7 +9361,7 @@ create_breakpoint (struct gdbarch *gdbarch,
b->condition_not_parsed = 1; b->condition_not_parsed = 1;
b->enable_state = enabled ? bp_enabled : bp_disabled; b->enable_state = enabled ? bp_enabled : bp_disabled;
if ((type_wanted != bp_breakpoint if ((type_wanted != bp_breakpoint
&& type_wanted != bp_hardware_breakpoint) || thread != -1) && type_wanted != bp_hardware_breakpoint) || thread != -1)
b->pspace = current_program_space; b->pspace = current_program_space;
install_breakpoint (internal, std::move (b), 0); install_breakpoint (internal, std::move (b), 0);
@@ -9426,7 +9426,7 @@ resolve_sal_pc (struct symtab_and_line *sal)
sal->pc = pc; sal->pc = pc;
/* If this SAL corresponds to a breakpoint inserted using a line /* If this SAL corresponds to a breakpoint inserted using a line
number, then skip the function prologue if necessary. */ number, then skip the function prologue if necessary. */
if (sal->explicit_line) if (sal->explicit_line)
skip_prologue_sal (sal); skip_prologue_sal (sal);
} }
@@ -9451,9 +9451,9 @@ resolve_sal_pc (struct symtab_and_line *sal)
else else
{ {
/* It really is worthwhile to have the section, so we'll /* It really is worthwhile to have the section, so we'll
just have to look harder. This case can be executed just have to look harder. This case can be executed
if we have line numbers but no functions (as can if we have line numbers but no functions (as can
happen in assembly source). */ happen in assembly source). */
scoped_restore_current_pspace_and_thread restore_pspace_thread; scoped_restore_current_pspace_and_thread restore_pspace_thread;
switch_to_program_space_and_thread (sal->pspace); switch_to_program_space_and_thread (sal->pspace);
@@ -9511,8 +9511,8 @@ stopin_command (const char *arg, int from_tty)
int hasColon = 0; int hasColon = 0;
/* Look for a ':'. If this is a line number specification, then /* Look for a ':'. If this is a line number specification, then
say it is bad, otherwise, it should be an address or say it is bad, otherwise, it should be an address or
function/method name. */ function/method name. */
while (*argptr && !hasColon) while (*argptr && !hasColon)
{ {
hasColon = (*argptr == ':'); hasColon = (*argptr == ':');
@@ -9544,7 +9544,7 @@ stopat_command (const char *arg, int from_tty)
int hasColon = 0; int hasColon = 0;
/* Look for a ':'. If there is a '::' then get out, otherwise /* Look for a ':'. If there is a '::' then get out, otherwise
it is probably a line number. */ it is probably a line number. */
while (*argptr && !hasColon) while (*argptr && !hasColon)
{ {
hasColon = (*argptr == ':'); hasColon = (*argptr == ':');
@@ -10309,7 +10309,7 @@ remove_masked_watchpoint (struct bp_location *bl, enum remove_bp_reason reason)
struct watchpoint *w = (struct watchpoint *) bl->owner; struct watchpoint *w = (struct watchpoint *) bl->owner;
return target_remove_mask_watchpoint (bl->address, w->hw_wp_mask, return target_remove_mask_watchpoint (bl->address, w->hw_wp_mask,
bl->watchpoint_type); bl->watchpoint_type);
} }
/* Implement the "resources_needed" breakpoint_ops method for /* Implement the "resources_needed" breakpoint_ops method for
@@ -10476,7 +10476,7 @@ is_masked_watchpoint (const struct breakpoint *b)
} }
/* accessflag: hw_write: watch write, /* accessflag: hw_write: watch write,
hw_read: watch read, hw_read: watch read,
hw_access: watch access (read or write) */ hw_access: watch access (read or write) */
static void static void
watch_command_1 (const char *arg, int accessflag, int from_tty, watch_command_1 (const char *arg, int accessflag, int from_tty,
@@ -10842,7 +10842,7 @@ can_use_hardware_watchpoint (const std::vector<value_ref_ptr> &vals)
else else
{ {
/* Ahh, memory we actually used! Check if we can cover /* Ahh, memory we actually used! Check if we can cover
it with hardware watchpoints. */ it with hardware watchpoints. */
struct type *vtype = check_typedef (value_type (v)); struct type *vtype = check_typedef (value_type (v));
/* We only watch structs and arrays if user asked for it /* We only watch structs and arrays if user asked for it
@@ -11167,12 +11167,12 @@ catch_fork_command_1 (const char *arg, int from_tty,
case catch_fork_temporary: case catch_fork_temporary:
case catch_fork_permanent: case catch_fork_permanent:
create_fork_vfork_event_catchpoint (gdbarch, temp, cond_string, create_fork_vfork_event_catchpoint (gdbarch, temp, cond_string,
&catch_fork_breakpoint_ops); &catch_fork_breakpoint_ops);
break; break;
case catch_vfork_temporary: case catch_vfork_temporary:
case catch_vfork_permanent: case catch_vfork_permanent:
create_fork_vfork_event_catchpoint (gdbarch, temp, cond_string, create_fork_vfork_event_catchpoint (gdbarch, temp, cond_string,
&catch_vfork_breakpoint_ops); &catch_vfork_breakpoint_ops);
break; break;
default: default:
error (_("unsupported or unknown fork kind; cannot catch it")); error (_("unsupported or unknown fork kind; cannot catch it"));
@@ -11229,13 +11229,13 @@ init_ada_exception_breakpoint (struct breakpoint *b,
describe_other_breakpoints (loc_gdbarch, describe_other_breakpoints (loc_gdbarch,
sal.pspace, sal.pc, sal.section, -1); sal.pspace, sal.pc, sal.section, -1);
/* FIXME: brobecker/2006-12-28: Actually, re-implement a special /* FIXME: brobecker/2006-12-28: Actually, re-implement a special
version for exception catchpoints, because two catchpoints version for exception catchpoints, because two catchpoints
used for different exception names will use the same address. used for different exception names will use the same address.
In this case, a "breakpoint ... also set at..." warning is In this case, a "breakpoint ... also set at..." warning is
unproductive. Besides, the warning phrasing is also a bit unproductive. Besides, the warning phrasing is also a bit
inappropriate, we should use the word catchpoint, and tell inappropriate, we should use the word catchpoint, and tell
the user what type of catchpoint it is. The above is good the user what type of catchpoint it is. The above is good
enough for now, though. */ enough for now, though. */
} }
init_raw_breakpoint (b, gdbarch, sal, bp_catchpoint, ops); init_raw_breakpoint (b, gdbarch, sal, bp_catchpoint, ops);
@@ -11330,16 +11330,16 @@ clear_command (const char *arg, int from_tty)
const char *sal_fullname; const char *sal_fullname;
/* If exact pc given, clear bpts at that pc. /* If exact pc given, clear bpts at that pc.
If line given (pc == 0), clear all bpts on specified line. If line given (pc == 0), clear all bpts on specified line.
If defaulting, clear all bpts on default line If defaulting, clear all bpts on default line
or at default pc. or at default pc.
defaulting sal.pc != 0 tests to do defaulting sal.pc != 0 tests to do
0 1 pc 0 1 pc
1 1 pc _and_ line 1 1 pc _and_ line
0 0 line 0 0 line
1 0 <can't happen> */ 1 0 <can't happen> */
sal_fullname = (sal.symtab == NULL sal_fullname = (sal.symtab == NULL
? NULL : symtab_to_fullname (sal.symtab)); ? NULL : symtab_to_fullname (sal.symtab));
@@ -12568,7 +12568,7 @@ internal_bkpt_re_set (struct breakpoint *b)
break; break;
/* This breakpoint is special, it's set up when the inferior /* This breakpoint is special, it's set up when the inferior
starts and we really don't want to touch it. */ starts and we really don't want to touch it. */
case bp_shlib_event: case bp_shlib_event:
/* Like bp_shlib_event, this breakpoint type is special. Once /* Like bp_shlib_event, this breakpoint type is special. Once
@@ -13197,8 +13197,8 @@ delete_command (const char *arg, int from_tty)
int breaks_to_delete = 0; int breaks_to_delete = 0;
/* Delete all breakpoints if no argument. Do not delete /* Delete all breakpoints if no argument. Do not delete
internal breakpoints, these have to be deleted with an internal breakpoints, these have to be deleted with an
explicit breakpoint number argument. */ explicit breakpoint number argument. */
ALL_BREAKPOINTS (b) ALL_BREAKPOINTS (b)
if (user_breakpoint_p (b)) if (user_breakpoint_p (b))
{ {
@@ -14754,8 +14754,8 @@ delete_trace_command (const char *arg, int from_tty)
int breaks_to_delete = 0; int breaks_to_delete = 0;
/* Delete all breakpoints if no argument. /* Delete all breakpoints if no argument.
Do not delete internal or call-dummy breakpoints, these Do not delete internal or call-dummy breakpoints, these
have to be deleted with an explicit breakpoint number have to be deleted with an explicit breakpoint number
argument. */ argument. */
ALL_TRACEPOINTS (b) ALL_TRACEPOINTS (b)
if (is_tracepoint (b) && user_breakpoint_p (b)) if (is_tracepoint (b) && user_breakpoint_p (b))
@@ -15672,17 +15672,17 @@ Set temporary catchpoints to catch events."),
add_catch_command ("fork", _("Catch calls to fork."), add_catch_command ("fork", _("Catch calls to fork."),
catch_fork_command_1, catch_fork_command_1,
NULL, NULL,
(void *) (uintptr_t) catch_fork_permanent, (void *) (uintptr_t) catch_fork_permanent,
(void *) (uintptr_t) catch_fork_temporary); (void *) (uintptr_t) catch_fork_temporary);
add_catch_command ("vfork", _("Catch calls to vfork."), add_catch_command ("vfork", _("Catch calls to vfork."),
catch_fork_command_1, catch_fork_command_1,
NULL, NULL,
(void *) (uintptr_t) catch_vfork_permanent, (void *) (uintptr_t) catch_vfork_permanent,
(void *) (uintptr_t) catch_vfork_temporary); (void *) (uintptr_t) catch_vfork_temporary);
add_catch_command ("exec", _("Catch calls to exec."), add_catch_command ("exec", _("Catch calls to exec."),
catch_exec_command_1, catch_exec_command_1,
NULL, NULL,
CATCH_PERMANENT, CATCH_PERMANENT,
CATCH_TEMPORARY); CATCH_TEMPORARY);
add_catch_command ("load", _("Catch loads of shared libraries.\n\ add_catch_command ("load", _("Catch loads of shared libraries.\n\
@@ -15923,7 +15923,7 @@ where START-LOCATION and END-LOCATION can be one of the following:\n\
LINENUM, for that line in the current file,\n\ LINENUM, for that line in the current file,\n\
FILE:LINENUM, for that line in that file,\n\ FILE:LINENUM, for that line in that file,\n\
+OFFSET, for that number of lines after the current line\n\ +OFFSET, for that number of lines after the current line\n\
or the start of the range\n\ or the start of the range\n\
FUNCTION, for the first line in that function,\n\ FUNCTION, for the first line in that function,\n\
FILE:FUNCTION, to distinguish among like-named static functions.\n\ FILE:FUNCTION, to distinguish among like-named static functions.\n\
*ADDRESS, for the instruction at that address.\n\ *ADDRESS, for the instruction at that address.\n\

View File

@@ -1536,7 +1536,7 @@ extern void breakpoint_set_task (struct breakpoint *b, int task);
extern void mark_breakpoints_out (void); extern void mark_breakpoints_out (void);
extern struct breakpoint *create_jit_event_breakpoint (struct gdbarch *, extern struct breakpoint *create_jit_event_breakpoint (struct gdbarch *,
CORE_ADDR); CORE_ADDR);
extern struct breakpoint *create_solib_event_breakpoint (struct gdbarch *, extern struct breakpoint *create_solib_event_breakpoint (struct gdbarch *,
CORE_ADDR); CORE_ADDR);

View File

@@ -370,7 +370,7 @@ bsd_uthread_target::store_registers (struct regcache *regcache, int regnum)
else else
{ {
/* Updating the thread that is currently running; pass the /* Updating the thread that is currently running; pass the
request to the layer beneath. */ request to the layer beneath. */
beneath ()->store_registers (regcache, regnum); beneath ()->store_registers (regcache, regnum);
} }
} }
@@ -401,9 +401,9 @@ bsd_uthread_target::wait (ptid_t ptid, struct target_waitstatus *status,
gdb_byte buf[4]; gdb_byte buf[4];
/* FIXME: For executables linked statically with the threads /* FIXME: For executables linked statically with the threads
library, we end up here before the program has actually been library, we end up here before the program has actually been
executed. In that case ADDR will be garbage since it has executed. In that case ADDR will be garbage since it has
been read from the wrong virtual memory image. */ been read from the wrong virtual memory image. */
if (target_read_memory (addr, buf, 4) == 0) if (target_read_memory (addr, buf, 4) == 0)
{ {
ULONGEST magic = extract_unsigned_integer (buf, 4, byte_order); ULONGEST magic = extract_unsigned_integer (buf, 4, byte_order);

View File

@@ -62,7 +62,7 @@ static void btrace_add_pc (struct thread_info *tp);
do \ do \
{ \ { \
if (record_debug != 0) \ if (record_debug != 0) \
fprintf_unfiltered (gdb_stdlog, \ fprintf_unfiltered (gdb_stdlog, \
"[btrace] " msg "\n", ##args); \ "[btrace] " msg "\n", ##args); \
} \ } \
while (0) while (0)

View File

@@ -57,7 +57,7 @@ build_id_verify (bfd *abfd, size_t check_len, const bfd_byte *check)
warning (_("File \"%s\" has no build-id, file skipped"), warning (_("File \"%s\" has no build-id, file skipped"),
bfd_get_filename (abfd)); bfd_get_filename (abfd));
else if (found->size != check_len else if (found->size != check_len
|| memcmp (found->data, check, found->size) != 0) || memcmp (found->data, check, found->size) != 0)
warning (_("File \"%s\" has a different build-id, file skipped"), warning (_("File \"%s\" has a different build-id, file skipped"),
bfd_get_filename (abfd)); bfd_get_filename (abfd));
else else
@@ -140,7 +140,7 @@ build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id,
/* Compute where the file named after the build-id would be. /* Compute where the file named after the build-id would be.
If debugdir is "/usr/lib/debug" and the build-id is abcdef, this will If debugdir is "/usr/lib/debug" and the build-id is abcdef, this will
give "/usr/lib/debug/.build-id/ab/cdef.debug". */ give "/usr/lib/debug/.build-id/ab/cdef.debug". */
std::string link = debugdir.get (); std::string link = debugdir.get ();
link += "/.build-id/"; link += "/.build-id/";
@@ -161,12 +161,12 @@ build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id,
return debug_bfd; return debug_bfd;
/* Try to look under the sysroot as well. If the sysroot is /* Try to look under the sysroot as well. If the sysroot is
"/the/sysroot", it will give "/the/sysroot", it will give
"/the/sysroot/usr/lib/debug/.build-id/ab/cdef.debug". "/the/sysroot/usr/lib/debug/.build-id/ab/cdef.debug".
Don't do it if the sysroot is the target system ("target:"). It Don't do it if the sysroot is the target system ("target:"). It
could work in theory, but the lrealpath in build_id_to_debug_bfd_1 could work in theory, but the lrealpath in build_id_to_debug_bfd_1
only works with local paths. */ only works with local paths. */
if (strcmp (gdb_sysroot, TARGET_SYSROOT_PREFIX) != 0) if (strcmp (gdb_sysroot, TARGET_SYSROOT_PREFIX) != 0)
{ {
link = gdb_sysroot + link; link = gdb_sysroot + link;

View File

@@ -63,7 +63,7 @@ extern struct block *finish_block (struct symbol *symbol,
CORE_ADDR end); CORE_ADDR end);
extern void record_block_range (struct block *, extern void record_block_range (struct block *,
CORE_ADDR start, CORE_ADDR end_inclusive); CORE_ADDR start, CORE_ADDR end_inclusive);
extern void start_subfile (const char *name); extern void start_subfile (const char *name);

View File

@@ -621,15 +621,15 @@ buildsym_compunit::patch_subfile_names (struct subfile *subfile,
set_last_source_file (name); set_last_source_file (name);
/* Default the source language to whatever can be deduced from /* Default the source language to whatever can be deduced from
the filename. If nothing can be deduced (such as for a C/C++ the filename. If nothing can be deduced (such as for a C/C++
include file with a ".h" extension), then inherit whatever include file with a ".h" extension), then inherit whatever
language the previous subfile had. This kludgery is language the previous subfile had. This kludgery is
necessary because there is no standard way in some object necessary because there is no standard way in some object
formats to record the source language. Also, when symtabs formats to record the source language. Also, when symtabs
are allocated we try to deduce a language then as well, but are allocated we try to deduce a language then as well, but
it is too late for us to use that information while reading it is too late for us to use that information while reading
symbols, since symtabs aren't allocated until after all the symbols, since symtabs aren't allocated until after all the
symbols have been processed for a given source file. */ symbols have been processed for a given source file. */
subfile->language = deduce_language_from_filename (subfile->name); subfile->language = deduce_language_from_filename (subfile->name);
if (subfile->language == language_unknown if (subfile->language == language_unknown

View File

@@ -976,19 +976,19 @@ exp : NSSTRING /* ObjC NextStep NSString constant
/* C++. */ /* C++. */
exp : TRUEKEYWORD exp : TRUEKEYWORD
{ write_exp_elt_opcode (pstate, OP_LONG); { write_exp_elt_opcode (pstate, OP_LONG);
write_exp_elt_type (pstate, write_exp_elt_type (pstate,
parse_type (pstate)->builtin_bool); parse_type (pstate)->builtin_bool);
write_exp_elt_longcst (pstate, (LONGEST) 1); write_exp_elt_longcst (pstate, (LONGEST) 1);
write_exp_elt_opcode (pstate, OP_LONG); } write_exp_elt_opcode (pstate, OP_LONG); }
; ;
exp : FALSEKEYWORD exp : FALSEKEYWORD
{ write_exp_elt_opcode (pstate, OP_LONG); { write_exp_elt_opcode (pstate, OP_LONG);
write_exp_elt_type (pstate, write_exp_elt_type (pstate,
parse_type (pstate)->builtin_bool); parse_type (pstate)->builtin_bool);
write_exp_elt_longcst (pstate, (LONGEST) 0); write_exp_elt_longcst (pstate, (LONGEST) 0);
write_exp_elt_opcode (pstate, OP_LONG); } write_exp_elt_opcode (pstate, OP_LONG); }
; ;
/* end of C++. */ /* end of C++. */
@@ -1159,7 +1159,7 @@ variable: name_not_typename
else if ($1.is_a_field_of_this) else if ($1.is_a_field_of_this)
{ {
/* C++: it hangs off of `this'. Must /* C++: it hangs off of `this'. Must
not inadvertently convert from a method call not inadvertently convert from a method call
to data ref. */ to data ref. */
pstate->block_tracker->update (sym); pstate->block_tracker->update (sym);
write_exp_elt_opcode (pstate, OP_THIS); write_exp_elt_opcode (pstate, OP_THIS);
@@ -1528,9 +1528,9 @@ typebase
$2.length); $2.length);
$$ = NULL; $$ = NULL;
} }
/* It appears that this rule for templates is never /* It appears that this rule for templates is never
reduced; template recognition happens by lookahead reduced; template recognition happens by lookahead
in the token processing code in yylex. */ in the token processing code in yylex. */
| TEMPLATE name '<' type '>' | TEMPLATE name '<' type '>'
{ $$ = lookup_template_type { $$ = lookup_template_type
(copy_name($2).c_str (), $4, (copy_name($2).c_str (), $4,
@@ -1973,7 +1973,7 @@ parse_number (struct parser_state *par_state,
if (!parse_float (p, len, if (!parse_float (p, len,
putithere->typed_val_float.type, putithere->typed_val_float.type,
putithere->typed_val_float.val)) putithere->typed_val_float.val))
return ERROR; return ERROR;
if (imaginary_p) if (imaginary_p)
putithere->typed_val_float.type putithere->typed_val_float.type
@@ -2631,7 +2631,7 @@ lex_one_token (struct parser_state *par_state, bool *is_quoted_name)
= macro_expand_next (&pstate->lexptr, *expression_macro_scope); = macro_expand_next (&pstate->lexptr, *expression_macro_scope);
if (expanded != nullptr) if (expanded != nullptr)
scan_macro_expansion (expanded.get ()); scan_macro_expansion (expanded.get ());
} }
pstate->prev_lexptr = pstate->lexptr; pstate->prev_lexptr = pstate->lexptr;
@@ -2671,16 +2671,16 @@ lex_one_token (struct parser_state *par_state, bool *is_quoted_name)
{ {
case 0: case 0:
/* If we were just scanning the result of a macro expansion, /* If we were just scanning the result of a macro expansion,
then we need to resume scanning the original text. then we need to resume scanning the original text.
If we're parsing for field name completion, and the previous If we're parsing for field name completion, and the previous
token allows such completion, return a COMPLETE token. token allows such completion, return a COMPLETE token.
Otherwise, we were already scanning the original text, and Otherwise, we were already scanning the original text, and
we're really done. */ we're really done. */
if (scanning_macro_expansion ()) if (scanning_macro_expansion ())
{ {
finished_macro_expansion (); finished_macro_expansion ();
goto retry; goto retry;
} }
else if (saw_name_at_eof) else if (saw_name_at_eof)
{ {
saw_name_at_eof = 0; saw_name_at_eof = 0;
@@ -2689,7 +2689,7 @@ lex_one_token (struct parser_state *par_state, bool *is_quoted_name)
else if (par_state->parse_completion && saw_structop) else if (par_state->parse_completion && saw_structop)
return COMPLETE; return COMPLETE;
else else
return 0; return 0;
case ' ': case ' ':
case '\t': case '\t':
@@ -2716,8 +2716,8 @@ lex_one_token (struct parser_state *par_state, bool *is_quoted_name)
case ',': case ',':
if (pstate->comma_terminates if (pstate->comma_terminates
&& paren_depth == 0 && paren_depth == 0
&& ! scanning_macro_expansion ()) && ! scanning_macro_expansion ())
return 0; return 0;
pstate->lexptr++; pstate->lexptr++;
return c; return c;
@@ -2786,7 +2786,7 @@ lex_one_token (struct parser_state *par_state, bool *is_quoted_name)
} }
toktype = parse_number (par_state, tokstart, p - tokstart, toktype = parse_number (par_state, tokstart, p - tokstart,
got_dot | got_e | got_p, &yylval); got_dot | got_e | got_p, &yylval);
if (toktype == ERROR) if (toktype == ERROR)
{ {
char *err_copy = (char *) alloca (p - tokstart + 1); char *err_copy = (char *) alloca (p - tokstart + 1);
@@ -2969,7 +2969,7 @@ lex_one_token (struct parser_state *par_state, bool *is_quoted_name)
pstate->expression_context_block, pstate->expression_context_block,
VAR_DOMAIN, VAR_DOMAIN,
(par_state->language ()->la_language (par_state->language ()->la_language
== language_cplus ? &is_a_field_of_this == language_cplus ? &is_a_field_of_this
: NULL)).symbol : NULL)).symbol
!= NULL) != NULL)
{ {

View File

@@ -151,7 +151,7 @@ c_print_type_1 (struct type *type,
fputs_styled (varstring, variable_name_style.style (), stream); fputs_styled (varstring, variable_name_style.style (), stream);
/* For demangled function names, we have the arglist as part of /* For demangled function names, we have the arglist as part of
the name, so don't print an additional pair of ()'s. */ the name, so don't print an additional pair of ()'s. */
if (local_name == NULL) if (local_name == NULL)
{ {
demangled_args = strchr (varstring, '(') != NULL; demangled_args = strchr (varstring, '(') != NULL;
@@ -466,7 +466,7 @@ c_type_print_varspec_prefix (struct type *type,
case TYPE_CODE_NAMESPACE: case TYPE_CODE_NAMESPACE:
case TYPE_CODE_DECFLOAT: case TYPE_CODE_DECFLOAT:
/* These types need no prefix. They are listed here so that /* These types need no prefix. They are listed here so that
gcc -Wall will reveal any types that haven't been handled. */ gcc -Wall will reveal any types that haven't been handled. */
break; break;
default: default:
error (_("type not handled in c_type_print_varspec_prefix()")); error (_("type not handled in c_type_print_varspec_prefix()"));
@@ -845,8 +845,8 @@ c_type_print_varspec_suffix (struct type *type,
case TYPE_CODE_NAMESPACE: case TYPE_CODE_NAMESPACE:
case TYPE_CODE_DECFLOAT: case TYPE_CODE_DECFLOAT:
/* These types do not need a suffix. They are listed so that /* These types do not need a suffix. They are listed so that
gcc -Wall will report types that may not have been gcc -Wall will report types that may not have been
considered. */ considered. */
break; break;
default: default:
error (_("type not handled in c_type_print_varspec_suffix()")); error (_("type not handled in c_type_print_varspec_suffix()"));
@@ -1553,10 +1553,10 @@ c_type_print_base_1 (struct type *type, struct ui_file *stream,
if (TYPE_DECLARED_CLASS (type)) if (TYPE_DECLARED_CLASS (type))
fprintf_filtered (stream, "class "); fprintf_filtered (stream, "class ");
/* Print the tag name if it exists. /* Print the tag name if it exists.
The aCC compiler emits a spurious The aCC compiler emits a spurious
"{unnamed struct}"/"{unnamed union}"/"{unnamed enum}" "{unnamed struct}"/"{unnamed union}"/"{unnamed enum}"
tag for unnamed struct/union/enum's, which we don't tag for unnamed struct/union/enum's, which we don't
want to print. */ want to print. */
if (type->name () != NULL if (type->name () != NULL
&& !startswith (type->name (), "{unnamed")) && !startswith (type->name (), "{unnamed"))
{ {
@@ -1690,9 +1690,9 @@ c_type_print_base_1 (struct type *type, struct ui_file *stream,
default: default:
/* Handle types not explicitly handled by the other cases, such /* Handle types not explicitly handled by the other cases, such
as fundamental types. For these, just print whatever the as fundamental types. For these, just print whatever the
type name is, as recorded in the type itself. If there is no type name is, as recorded in the type itself. If there is no
type name, then complain. */ type name, then complain. */
if (type->name () != NULL) if (type->name () != NULL)
{ {
c_type_print_modifier (type, stream, 0, 1, language); c_type_print_modifier (type, stream, 0, 1, language);

View File

@@ -493,9 +493,9 @@ c_value_print (struct value *val, struct ui_file *stream,
struct type *original_type = value_type (val); struct type *original_type = value_type (val);
/* Hack: remove (char *) for char strings. Their /* Hack: remove (char *) for char strings. Their
type is indicated by the quoted string anyway. type is indicated by the quoted string anyway.
(Don't use c_textual_element_type here; quoted strings (Don't use c_textual_element_type here; quoted strings
are always exactly (char *), (wchar_t *), or the like. */ are always exactly (char *), (wchar_t *), or the like. */
if (original_type->code () == TYPE_CODE_PTR if (original_type->code () == TYPE_CODE_PTR
&& original_type->name () == NULL && original_type->name () == NULL
&& TYPE_TARGET_TYPE (original_type)->name () != NULL && TYPE_TARGET_TYPE (original_type)->name () != NULL

View File

@@ -120,10 +120,10 @@ adjust_value_for_child_access (struct value **value,
enclosing_type = value_actual_type (*value, 1, &real_type_found); enclosing_type = value_actual_type (*value, 1, &real_type_found);
if (real_type_found) if (real_type_found)
{ {
*type = enclosing_type; *type = enclosing_type;
*value = value_cast (enclosing_type, *value); *value = value_cast (enclosing_type, *value);
} }
} }
} }
@@ -210,10 +210,10 @@ c_number_of_children (const struct varobj *var)
have one child, except for function ptrs, which have no children, have one child, except for function ptrs, which have no children,
and except for void*, as we don't know what to show. and except for void*, as we don't know what to show.
We can show char* so we allow it to be dereferenced. If you decide We can show char* so we allow it to be dereferenced. If you decide
to test for it, please mind that a little magic is necessary to to test for it, please mind that a little magic is necessary to
properly identify it: char* has TYPE_CODE == TYPE_CODE_INT and properly identify it: char* has TYPE_CODE == TYPE_CODE_INT and
TYPE_NAME == "char". */ TYPE_NAME == "char". */
if (target->code () == TYPE_CODE_FUNC if (target->code () == TYPE_CODE_FUNC
|| target->code () == TYPE_CODE_VOID) || target->code () == TYPE_CODE_VOID)
children = 0; children = 0;
@@ -572,11 +572,11 @@ cplus_number_of_children (const struct varobj *var)
/* It is necessary to access a real type (via RTTI). */ /* It is necessary to access a real type (via RTTI). */
if (opts.objectprint) if (opts.objectprint)
{ {
value = var->value.get (); value = var->value.get ();
lookup_actual_type = (TYPE_IS_REFERENCE (var->type) lookup_actual_type = (TYPE_IS_REFERENCE (var->type)
|| var->type->code () == TYPE_CODE_PTR); || var->type->code () == TYPE_CODE_PTR);
} }
adjust_value_for_child_access (&value, &type, NULL, lookup_actual_type); adjust_value_for_child_access (&value, &type, NULL, lookup_actual_type);
if (((type->code ()) == TYPE_CODE_STRUCT) if (((type->code ()) == TYPE_CODE_STRUCT)
@@ -607,13 +607,13 @@ cplus_number_of_children (const struct varobj *var)
/* It is necessary to access a real type (via RTTI). */ /* It is necessary to access a real type (via RTTI). */
if (opts.objectprint) if (opts.objectprint)
{ {
const struct varobj *parent = var->parent; const struct varobj *parent = var->parent;
value = parent->value.get (); value = parent->value.get ();
lookup_actual_type = (TYPE_IS_REFERENCE (parent->type) lookup_actual_type = (TYPE_IS_REFERENCE (parent->type)
|| parent->type->code () == TYPE_CODE_PTR); || parent->type->code () == TYPE_CODE_PTR);
} }
adjust_value_for_child_access (&value, &type, NULL, lookup_actual_type); adjust_value_for_child_access (&value, &type, NULL, lookup_actual_type);
cplus_class_num_children (type, kids); cplus_class_num_children (type, kids);
@@ -817,10 +817,10 @@ cplus_describe_child (const struct varobj *parent, int index,
/* Cast the parent to the base' type. Note that in gdb, /* Cast the parent to the base' type. Note that in gdb,
expression like expression like
(Base1)d (Base1)d
will create an lvalue, for all appearences, so we don't will create an lvalue, for all appearences, so we don't
need to use more fancy: need to use more fancy:
*(Base1*)(&d) *(Base1*)(&d)
construct. construct.
When we are in the scope of the base class or of one When we are in the scope of the base class or of one

View File

@@ -247,7 +247,7 @@ show_target_charset_name (struct ui_file *file, int from_tty,
if (!strcmp (value, "auto")) if (!strcmp (value, "auto"))
fprintf_filtered (file, fprintf_filtered (file,
_("The target character set is \"auto; " _("The target character set is \"auto; "
"currently %s\".\n"), "currently %s\".\n"),
gdbarch_auto_charset (get_current_arch ())); gdbarch_auto_charset (get_current_arch ()));
else else
fprintf_filtered (file, _("The target character set is \"%s\".\n"), fprintf_filtered (file, _("The target character set is \"%s\".\n"),
@@ -264,7 +264,7 @@ show_target_wide_charset_name (struct ui_file *file,
if (!strcmp (value, "auto")) if (!strcmp (value, "auto"))
fprintf_filtered (file, fprintf_filtered (file,
_("The target wide character set is \"auto; " _("The target wide character set is \"auto; "
"currently %s\".\n"), "currently %s\".\n"),
gdbarch_auto_wide_charset (get_current_arch ())); gdbarch_auto_wide_charset (get_current_arch ()));
else else
fprintf_filtered (file, _("The target wide character set is \"%s\".\n"), fprintf_filtered (file, _("The target wide character set is \"%s\".\n"),

View File

@@ -488,7 +488,7 @@ pwd_command (const char *args, int from_tty)
if (cwd == NULL) if (cwd == NULL)
error (_("Error finding name of working directory: %s"), error (_("Error finding name of working directory: %s"),
safe_strerror (errno)); safe_strerror (errno));
if (strcmp (cwd.get (), current_directory) != 0) if (strcmp (cwd.get (), current_directory) != 0)
printf_unfiltered (_("Working directory %ps\n (canonically %ps).\n"), printf_unfiltered (_("Working directory %ps\n (canonically %ps).\n"),
@@ -532,7 +532,7 @@ cd_command (const char *dir, int from_tty)
if (IS_DIR_SEPARATOR (dir[len - 1])) if (IS_DIR_SEPARATOR (dir[len - 1]))
{ {
/* Remove the trailing slash unless this is a root directory /* Remove the trailing slash unless this is a root directory
(including a drive letter on non-Unix systems). */ (including a drive letter on non-Unix systems). */
if (!(len == 1) /* "/" */ if (!(len == 1) /* "/" */
#ifdef HAVE_DOS_BASED_FILE_SYSTEM #ifdef HAVE_DOS_BASED_FILE_SYSTEM
&& !(len == 3 && dir[1] == ':') /* "d:/" */ && !(len == 3 && dir[1] == ':') /* "d:/" */
@@ -571,7 +571,7 @@ cd_command (const char *dir, int from_tty)
if (found_real_path) if (found_real_path)
{ {
/* Search backwards for the directory just before the "/.." /* Search backwards for the directory just before the "/.."
and obliterate it and the "/..". */ and obliterate it and the "/..". */
char *q = p; char *q = p;
while (q != current_directory && !IS_DIR_SEPARATOR (q[-1])) while (q != current_directory && !IS_DIR_SEPARATOR (q[-1]))
@@ -716,7 +716,7 @@ source_script_with_search (const char *file, int from_tty, int search_path)
if (!opened) if (!opened)
{ {
/* The script wasn't found, or was otherwise inaccessible. /* The script wasn't found, or was otherwise inaccessible.
If the source command was invoked interactively, throw an If the source command was invoked interactively, throw an
error. Otherwise (e.g. if it was invoked by a script), error. Otherwise (e.g. if it was invoked by a script),
just emit a warning, rather than cause an error. */ just emit a warning, rather than cause an error. */
if (from_tty) if (from_tty)
@@ -971,40 +971,40 @@ edit_command (const char *arg, int from_tty)
sal = sals[0]; sal = sals[0];
if (*arg1) if (*arg1)
error (_("Junk at end of line specification.")); error (_("Junk at end of line specification."));
/* If line was specified by address, first print exactly which /* If line was specified by address, first print exactly which
line, and which file. In this case, sal.symtab == 0 means line, and which file. In this case, sal.symtab == 0 means
address is outside of all known source files, not that user address is outside of all known source files, not that user
failed to give a filename. */ failed to give a filename. */
if (*arg == '*') if (*arg == '*')
{ {
struct gdbarch *gdbarch; struct gdbarch *gdbarch;
if (sal.symtab == 0) if (sal.symtab == 0)
error (_("No source file for address %s."), error (_("No source file for address %s."),
paddress (get_current_arch (), sal.pc)); paddress (get_current_arch (), sal.pc));
gdbarch = SYMTAB_OBJFILE (sal.symtab)->arch (); gdbarch = SYMTAB_OBJFILE (sal.symtab)->arch ();
sym = find_pc_function (sal.pc); sym = find_pc_function (sal.pc);
if (sym) if (sym)
printf_filtered ("%s is in %s (%s:%d).\n", printf_filtered ("%s is in %s (%s:%d).\n",
paddress (gdbarch, sal.pc), paddress (gdbarch, sal.pc),
sym->print_name (), sym->print_name (),
symtab_to_filename_for_display (sal.symtab), symtab_to_filename_for_display (sal.symtab),
sal.line); sal.line);
else else
printf_filtered ("%s is at %s:%d.\n", printf_filtered ("%s is at %s:%d.\n",
paddress (gdbarch, sal.pc), paddress (gdbarch, sal.pc),
symtab_to_filename_for_display (sal.symtab), symtab_to_filename_for_display (sal.symtab),
sal.line); sal.line);
} }
/* If what was given does not imply a symtab, it must be an /* If what was given does not imply a symtab, it must be an
undebuggable symbol which means no source code. */ undebuggable symbol which means no source code. */
if (sal.symtab == 0) if (sal.symtab == 0)
error (_("No line number known for %s."), arg); error (_("No line number known for %s."), arg);
} }
if ((editor = getenv ("EDITOR")) == NULL) if ((editor = getenv ("EDITOR")) == NULL)
@@ -1110,7 +1110,7 @@ pipe_command (const char *arg, int from_tty)
if (exit_status < 0) if (exit_status < 0)
error (_("shell command \"%s\" failed: %s"), shell_command, error (_("shell command \"%s\" failed: %s"), shell_command,
safe_strerror (errno)); safe_strerror (errno));
exit_status_set_internal_vars (exit_status); exit_status_set_internal_vars (exit_status);
} }
@@ -1400,7 +1400,7 @@ print_disassembly (struct gdbarch *gdbarch, const char *name,
printf_filtered (_("for function %ps:\n"), printf_filtered (_("for function %ps:\n"),
styled_string (function_name_style.style (), name)); styled_string (function_name_style.style (), name));
if (block == nullptr || BLOCK_CONTIGUOUS_P (block)) if (block == nullptr || BLOCK_CONTIGUOUS_P (block))
{ {
if (name == NULL) if (name == NULL)
printf_filtered (_("from %ps to %ps:\n"), printf_filtered (_("from %ps to %ps:\n"),
styled_string (address_style.style (), styled_string (address_style.style (),
@@ -1412,7 +1412,7 @@ print_disassembly (struct gdbarch *gdbarch, const char *name,
gdb_disassembly (gdbarch, current_uiout, flags, -1, low, high); gdb_disassembly (gdbarch, current_uiout, flags, -1, low, high);
} }
else else
{ {
for (int i = 0; i < BLOCK_NRANGES (block); i++) for (int i = 0; i < BLOCK_NRANGES (block); i++)
{ {
CORE_ADDR range_low = BLOCK_RANGE_START (block, i); CORE_ADDR range_low = BLOCK_RANGE_START (block, i);

View File

@@ -354,11 +354,11 @@ update_prefix_field_of_prefixed_commands (struct cmd_list_element *c)
/* We must recursively update the prefix field to cover /* We must recursively update the prefix field to cover
e.g. 'info auto-load libthread-db' where the creation e.g. 'info auto-load libthread-db' where the creation
order was: order was:
libthread-db libthread-db
auto-load auto-load
info info
In such a case, when 'auto-load' was created by do_add_cmd, In such a case, when 'auto-load' was created by do_add_cmd,
the 'libthread-db' prefix field could not be updated, as the the 'libthread-db' prefix field could not be updated, as the
'auto-load' command was not yet reachable by 'auto-load' command was not yet reachable by
lookup_cmd_for_prefixlist (list, cmdlist) lookup_cmd_for_prefixlist (list, cmdlist)
that searches from the top level 'cmdlist'. */ that searches from the top level 'cmdlist'. */
@@ -450,7 +450,7 @@ add_show_prefix_cmd (const char *name, enum command_class theclass,
struct cmd_list_element * struct cmd_list_element *
add_prefix_cmd_suppress_notification add_prefix_cmd_suppress_notification
(const char *name, enum command_class theclass, (const char *name, enum command_class theclass,
cmd_const_cfunc_ftype *fun, cmd_const_cfunc_ftype *fun,
const char *doc, struct cmd_list_element **prefixlist, const char *doc, struct cmd_list_element **prefixlist,
const char *prefixname, int allow_unknown, const char *prefixname, int allow_unknown,
@@ -1260,16 +1260,16 @@ help_cmd (const char *command, struct ui_file *stream)
if (c->hook_pre || c->hook_post) if (c->hook_pre || c->hook_post)
fprintf_filtered (stream, fprintf_filtered (stream,
"\nThis command has a hook (or hooks) defined:\n"); "\nThis command has a hook (or hooks) defined:\n");
if (c->hook_pre) if (c->hook_pre)
fprintf_filtered (stream, fprintf_filtered (stream,
"\tThis command is run after : %s (pre hook)\n", "\tThis command is run after : %s (pre hook)\n",
c->hook_pre->name); c->hook_pre->name);
if (c->hook_post) if (c->hook_post)
fprintf_filtered (stream, fprintf_filtered (stream,
"\tThis command is run before : %s (post hook)\n", "\tThis command is run before : %s (post hook)\n",
c->hook_post->name); c->hook_post->name);
} }
/* /*
@@ -1352,7 +1352,7 @@ help_all (struct ui_file *stream)
for (c = cmdlist; c; c = c->next) for (c = cmdlist; c; c = c->next)
{ {
if (c->abbrev_flag) if (c->abbrev_flag)
continue; continue;
/* If this is a class name, print all of the commands in the /* If this is a class name, print all of the commands in the
class. */ class. */
@@ -1370,7 +1370,7 @@ help_all (struct ui_file *stream)
for (c = cmdlist; c; c = c->next) for (c = cmdlist; c; c = c->next)
{ {
if (c->abbrev_flag) if (c->abbrev_flag)
continue; continue;
if (c->theclass == no_class) if (c->theclass == no_class)
{ {
@@ -1496,7 +1496,7 @@ help_cmd_list (struct cmd_list_element *list, enum command_class theclass,
|| (theclass == c->theclass && c->func != NULL)) || (theclass == c->theclass && c->func != NULL))
{ {
/* show C when /* show C when
- showing all commands - showing all commands
- showing all classes and C is a help class - showing all classes and C is a help class
- showing commands of THECLASS and C is not the help class */ - showing commands of THECLASS and C is not the help class */
@@ -1748,9 +1748,9 @@ lookup_cmd_1 (const char **text, struct cmd_list_element *clist,
if (result_list != nullptr) if (result_list != nullptr)
if (!*result_list) if (!*result_list)
/* This used to say *result_list = *found->prefixlist. /* This used to say *result_list = *found->prefixlist.
If that was correct, need to modify the documentation If that was correct, need to modify the documentation
at the top of this function to clarify what is at the top of this function to clarify what is
supposed to be going on. */ supposed to be going on. */
*result_list = found; *result_list = found;
/* For ambiguous commands, do not return any default_args args. */ /* For ambiguous commands, do not return any default_args args. */
if (default_args != nullptr) if (default_args != nullptr)
@@ -1840,7 +1840,7 @@ lookup_cmd (const char **line, struct cmd_list_element *list,
else if (c == CMD_LIST_AMBIGUOUS) else if (c == CMD_LIST_AMBIGUOUS)
{ {
/* Ambigous. Local values should be off prefixlist or called /* Ambigous. Local values should be off prefixlist or called
values. */ values. */
int local_allow_unknown = (last_list ? last_list->allow_unknown : int local_allow_unknown = (last_list ? last_list->allow_unknown :
allow_unknown); allow_unknown);
const char *local_cmdtype = last_list ? last_list->prefixname : cmdtype; const char *local_cmdtype = last_list ? last_list->prefixname : cmdtype;
@@ -1890,10 +1890,10 @@ lookup_cmd (const char **line, struct cmd_list_element *list,
else else
{ {
if (c->type == set_cmd && **line != '\0' && !isspace (**line)) if (c->type == set_cmd && **line != '\0' && !isspace (**line))
error (_("Argument must be preceded by space.")); error (_("Argument must be preceded by space."));
/* We've got something. It may still not be what the caller /* We've got something. It may still not be what the caller
wants (if this command *needs* a subcommand). */ wants (if this command *needs* a subcommand). */
while (**line == ' ' || **line == '\t') while (**line == ' ' || **line == '\t')
(*line)++; (*line)++;

View File

@@ -89,7 +89,7 @@ struct cmd_list_element
/* The user needs to be warned that this is a deprecated command. /* The user needs to be warned that this is a deprecated command.
The user should only be warned the first time a command is The user should only be warned the first time a command is
used. */ used. */
unsigned int deprecated_warn_user : 1; unsigned int deprecated_warn_user : 1;
/* When functions are deprecated at compile time (this is the way /* When functions are deprecated at compile time (this is the way

View File

@@ -210,7 +210,7 @@ print_command_lines (struct ui_out *uiout, struct command_line *cmd,
} }
/* loop_continue to jump to the start of a while loop, print it /* loop_continue to jump to the start of a while loop, print it
and continue. */ and continue. */
if (list->control_type == continue_control) if (list->control_type == continue_control)
{ {
uiout->field_string (NULL, "loop_continue"); uiout->field_string (NULL, "loop_continue");
@@ -544,7 +544,7 @@ execute_control_command_1 (struct command_line *cmd, int from_tty)
print_command_trace ("loop_continue"); print_command_trace ("loop_continue");
/* Return for "continue", and "break" so we can either /* Return for "continue", and "break" so we can either
continue the loop at the top, or break out. */ continue the loop at the top, or break out. */
ret = cmd->control_type; ret = cmd->control_type;
break; break;
@@ -552,7 +552,7 @@ execute_control_command_1 (struct command_line *cmd, int from_tty)
print_command_trace ("loop_break"); print_command_trace ("loop_break");
/* Return for "continue", and "break" so we can either /* Return for "continue", and "break" so we can either
continue the loop at the top, or break out. */ continue the loop at the top, or break out. */
ret = cmd->control_type; ret = cmd->control_type;
break; break;
@@ -1147,7 +1147,7 @@ recurse_read_control_structure (gdb::function_view<const char * ()> read_next_li
child_tail = next; child_tail = next;
/* If the latest line is another control structure, then recurse /* If the latest line is another control structure, then recurse
on it. */ on it. */
if (multi_line_command_p (next->control_type)) if (multi_line_command_p (next->control_type))
{ {
control_level++; control_level++;
@@ -1485,20 +1485,20 @@ do_define_command (const char *comname, int from_tty,
if (hookc) if (hookc)
{ {
switch (hook_type) switch (hook_type)
{ {
case CMD_PRE_HOOK: case CMD_PRE_HOOK:
hookc->hook_pre = newc; /* Target gets hooked. */ hookc->hook_pre = newc; /* Target gets hooked. */
newc->hookee_pre = hookc; /* We are marked as hooking target cmd. */ newc->hookee_pre = hookc; /* We are marked as hooking target cmd. */
break; break;
case CMD_POST_HOOK: case CMD_POST_HOOK:
hookc->hook_post = newc; /* Target gets hooked. */ hookc->hook_post = newc; /* Target gets hooked. */
newc->hookee_post = hookc; /* We are marked as hooking newc->hookee_post = hookc; /* We are marked as hooking
target cmd. */ target cmd. */
break; break;
default: default:
/* Should never come here as hookc would be 0. */ /* Should never come here as hookc would be 0. */
internal_error (__FILE__, __LINE__, _("bad switch")); internal_error (__FILE__, __LINE__, _("bad switch"));
} }
} }
} }

View File

@@ -743,7 +743,7 @@ cmd_show_list (struct cmd_list_element *list, int from_tty)
/* We skip show command aliases to avoid showing duplicated values. */ /* We skip show command aliases to avoid showing duplicated values. */
/* If we find a prefix, run its list, prefixing our output by its /* If we find a prefix, run its list, prefixing our output by its
prefix (with "show " skipped). */ prefix (with "show " skipped). */
if (list->prefixlist && list->cmd_pointer == nullptr) if (list->prefixlist && list->cmd_pointer == nullptr)
{ {
ui_out_emit_tuple optionlist_emitter (uiout, "optionlist"); ui_out_emit_tuple optionlist_emitter (uiout, "optionlist");

View File

@@ -133,7 +133,7 @@ get_section_vmas (bfd *abfd, asection *sectp, void *context)
if (sectix != PE_SECTION_INDEX_INVALID) if (sectix != PE_SECTION_INDEX_INVALID)
{ {
/* Data within the section start at rva_start in the pe and at /* Data within the section start at rva_start in the pe and at
bfd_get_section_vma() within memory. Store the offset. */ bfd_get_section_vma() within memory. Store the offset. */
sections[sectix].vma_offset sections[sectix].vma_offset
= bfd_section_vma (sectp) - sections[sectix].rva_start; = bfd_section_vma (sectp) - sections[sectix].rva_start;
@@ -549,7 +549,7 @@ read_pe_exported_syms (minimal_symbol_reader &reader,
/* Pointer to the function address vector. */ /* Pointer to the function address vector. */
/* This is relative to ordinal value. */ /* This is relative to ordinal value. */
unsigned long func_rva = pe_as32 (erva + exp_funcbase + unsigned long func_rva = pe_as32 (erva + exp_funcbase +
ordinal * 4); ordinal * 4);
/* Find this symbol's section in our own array. */ /* Find this symbol's section in our own array. */
int sectix = 0; int sectix = 0;

View File

@@ -241,7 +241,7 @@ coff_locate_sections (bfd *abfd, asection *sectp, void *csip)
const char *s; const char *s;
/* We can have multiple .stab sections if linked with /* We can have multiple .stab sections if linked with
--split-by-reloc. */ --split-by-reloc. */
for (s = name + sizeof ".stab" - 1; *s != '\0'; s++) for (s = name + sizeof ".stab" - 1; *s != '\0'; s++)
if (!isdigit (*s)) if (!isdigit (*s))
break; break;
@@ -610,10 +610,10 @@ coff_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
bfd_map_over_sections (abfd, find_linenos, (void *) info); bfd_map_over_sections (abfd, find_linenos, (void *) info);
val = init_lineno (abfd, info->min_lineno_offset, val = init_lineno (abfd, info->min_lineno_offset,
info->max_lineno_offset - info->min_lineno_offset, info->max_lineno_offset - info->min_lineno_offset,
&linetab_storage); &linetab_storage);
if (val < 0) if (val < 0)
error (_("\"%s\": error reading line numbers."), filename); error (_("\"%s\": error reading line numbers."), filename);
} }
/* Now read the string table, all at once. */ /* Now read the string table, all at once. */
@@ -659,7 +659,7 @@ coff_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
int lead = bfd_get_symbol_leading_char (objfile->obfd); int lead = bfd_get_symbol_leading_char (objfile->obfd);
struct bound_minimal_symbol found; struct bound_minimal_symbol found;
if (lead != '\0' && *name1 == lead) if (lead != '\0' && *name1 == lead)
name1 += 1; name1 += 1;
found = lookup_minimal_symbol (name1, NULL, objfile); found = lookup_minimal_symbol (name1, NULL, objfile);
@@ -688,7 +688,7 @@ coff_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
} }
/* FIXME: dubious. Why can't we use something normal like /* FIXME: dubious. Why can't we use something normal like
bfd_get_section_contents? */ bfd_get_section_contents? */
bfd_seek (abfd, abfd->where, 0); bfd_seek (abfd, abfd->where, 0);
stabstrsize = bfd_section_size (info->stabstrsect); stabstrsize = bfd_section_size (info->stabstrsect);
@@ -1039,7 +1039,7 @@ coff_symtab_read (minimal_symbol_reader &reader,
/* Value contains address of first non-init type /* Value contains address of first non-init type
code. */ code. */
/* main_aux.x_sym.x_misc.x_lnsz.x_lnno /* main_aux.x_sym.x_misc.x_lnsz.x_lnno
contains line number of '{' }. */ contains line number of '{' }. */
if (cs->c_naux != 1) if (cs->c_naux != 1)
complaint (_("`.bf' symbol %d has no aux entry"), complaint (_("`.bf' symbol %d has no aux entry"),
cs->c_symnum); cs->c_symnum);
@@ -1047,7 +1047,7 @@ coff_symtab_read (minimal_symbol_reader &reader,
fcn_first_line_addr = cs->c_value; fcn_first_line_addr = cs->c_value;
/* Might want to check that locals are 0 and /* Might want to check that locals are 0 and
context_stack_depth is zero, and complain if not. */ context_stack_depth is zero, and complain if not. */
depth = 0; depth = 0;
newobj = push_context (depth, fcn_start_addr); newobj = push_context (depth, fcn_start_addr);
@@ -1061,9 +1061,9 @@ coff_symtab_read (minimal_symbol_reader &reader,
if (!within_function) if (!within_function)
error (_("Bad coff function information.")); error (_("Bad coff function information."));
/* The value of .ef is the address of epilogue code; /* The value of .ef is the address of epilogue code;
not useful for gdb. */ not useful for gdb. */
/* { main_aux.x_sym.x_misc.x_lnsz.x_lnno /* { main_aux.x_sym.x_misc.x_lnsz.x_lnno
contains number of lines to '}' */ contains number of lines to '}' */
if (outermost_context_p ()) if (outermost_context_p ())
{ /* We attempted to pop an empty context stack. */ { /* We attempted to pop an empty context stack. */
@@ -1095,12 +1095,12 @@ coff_symtab_read (minimal_symbol_reader &reader,
fcn_last_line = main_aux.x_sym.x_misc.x_lnsz.x_lnno; fcn_last_line = main_aux.x_sym.x_misc.x_lnsz.x_lnno;
} }
/* fcn_first_line is the line number of the opening '{'. /* fcn_first_line is the line number of the opening '{'.
Do not record it - because it would affect gdb's idea Do not record it - because it would affect gdb's idea
of the line number of the first statement of the of the line number of the first statement of the
function - except for one-line functions, for which function - except for one-line functions, for which
it is also the line number of all the statements and it is also the line number of all the statements and
of the closing '}', and for which we do not have any of the closing '}', and for which we do not have any
other statement-line-number. */ other statement-line-number. */
if (fcn_last_line == 1) if (fcn_last_line == 1)
record_line (get_current_subfile (), fcn_first_line, record_line (get_current_subfile (), fcn_first_line,
gdbarch_addr_bits_remove (gdbarch, gdbarch_addr_bits_remove (gdbarch,
@@ -1214,7 +1214,7 @@ read_one_sym (struct coff_symbol *cs,
sym->n_type, sym->n_sclass, sym->n_type, sym->n_sclass,
0, cs->c_naux, (char *) aux); 0, cs->c_naux, (char *) aux);
/* If more than one aux entry, read past it (only the first aux /* If more than one aux entry, read past it (only the first aux
is important). */ is important). */
for (i = 1; i < cs->c_naux; i++) for (i = 1; i < cs->c_naux; i++)
{ {
bytes = bfd_bread (temp_aux, local_auxesz, nlist_bfd_global); bytes = bfd_bread (temp_aux, local_auxesz, nlist_bfd_global);
@@ -1317,7 +1317,7 @@ getsymname (struct internal_syment *symbol_entry)
if (symbol_entry->_n._n_n._n_zeroes == 0) if (symbol_entry->_n._n_n._n_zeroes == 0)
{ {
/* FIXME: Probably should be detecting corrupt symbol files by /* FIXME: Probably should be detecting corrupt symbol files by
seeing whether offset points to within the stringtab. */ seeing whether offset points to within the stringtab. */
result = stringtab + symbol_entry->_n._n_n._n_offset; result = stringtab + symbol_entry->_n._n_n._n_offset;
} }
else else
@@ -1486,9 +1486,9 @@ patch_opaque_types (struct symtab *s)
ALL_BLOCK_SYMBOLS (b, iter, real_sym) ALL_BLOCK_SYMBOLS (b, iter, real_sym)
{ {
/* Find completed typedefs to use to fix opaque ones. /* Find completed typedefs to use to fix opaque ones.
Remove syms from the chain when their types are stored, Remove syms from the chain when their types are stored,
but search the whole chain, as there may be several syms but search the whole chain, as there may be several syms
from different files with the same name. */ from different files with the same name. */
if (SYMBOL_CLASS (real_sym) == LOC_TYPEDEF if (SYMBOL_CLASS (real_sym) == LOC_TYPEDEF
&& SYMBOL_DOMAIN (real_sym) == VAR_DOMAIN && SYMBOL_DOMAIN (real_sym) == VAR_DOMAIN
&& SYMBOL_TYPE (real_sym)->code () == TYPE_CODE_PTR && SYMBOL_TYPE (real_sym)->code () == TYPE_CODE_PTR

View File

@@ -383,7 +383,7 @@ compile_cplus_instance::new_scope (const char *type_name, struct type *type)
{ {
scope_component comp scope_component comp
= { = {
decl_name (type->name ()).get (), decl_name (type->name ()).get (),
lookup_symbol (type->name (), block (), VAR_DOMAIN, nullptr) lookup_symbol (type->name (), block (), VAR_DOMAIN, nullptr)
}; };
scope.push_back (comp); scope.push_back (comp);

View File

@@ -208,7 +208,7 @@ link_callbacks_multiple_definition (struct bfd_link_info *link_info,
static void static void
link_callbacks_warning (struct bfd_link_info *link_info, const char *xwarning, link_callbacks_warning (struct bfd_link_info *link_info, const char *xwarning,
const char *symbol, bfd *abfd, asection *section, const char *symbol, bfd *abfd, asection *section,
bfd_vma address) bfd_vma address)
{ {
warning (_("Compiled module \"%s\" section \"%s\": warning: %s"), warning (_("Compiled module \"%s\" section \"%s\": warning: %s"),
@@ -621,7 +621,7 @@ compile_object_load (const compile_file_names &file_names,
gdb_bfd_ref_ptr abfd (gdb_bfd_open (filename.get (), gnutarget)); gdb_bfd_ref_ptr abfd (gdb_bfd_open (filename.get (), gnutarget));
if (abfd == NULL) if (abfd == NULL)
error (_("\"%s\": could not open as compiled module: %s"), error (_("\"%s\": could not open as compiled module: %s"),
filename.get (), bfd_errmsg (bfd_get_error ())); filename.get (), bfd_errmsg (bfd_get_error ()));
if (!bfd_check_format_matches (abfd.get (), bfd_object, &matching)) if (!bfd_check_format_matches (abfd.get (), bfd_object, &matching))
error (_("\"%s\": not in loadable format: %s"), error (_("\"%s\": not in loadable format: %s"),

View File

@@ -228,7 +228,7 @@ filename_completer (struct cmd_list_element *ignore,
will loop indefinitely. */ will loop indefinitely. */
subsequent_name = 1; subsequent_name = 1;
/* Like emacs, don't complete on old versions. Especially /* Like emacs, don't complete on old versions. Especially
useful in the "source" command. */ useful in the "source" command. */
const char *p = p_rl.get (); const char *p = p_rl.get ();
if (p[strlen (p) - 1] == '~') if (p[strlen (p) - 1] == '~')
continue; continue;
@@ -2650,8 +2650,8 @@ gdb_printable_part (char *pathname)
else if (temp[1] == '\0') else if (temp[1] == '\0')
{ {
for (x = temp - 1; x > pathname; x--) for (x = temp - 1; x > pathname; x--)
if (*x == '/') if (*x == '/')
break; break;
return ((*x == '/') ? x + 1 : pathname); return ((*x == '/') ? x + 1 : pathname);
} }
else else
@@ -2753,15 +2753,15 @@ gdb_fnprint (const char *to_print, int prefix_bytes,
while (*s) while (*s)
{ {
if (CTRL_CHAR (*s)) if (CTRL_CHAR (*s))
{ {
displayer->putch (displayer, '^'); displayer->putch (displayer, '^');
displayer->putch (displayer, UNCTRL (*s)); displayer->putch (displayer, UNCTRL (*s));
printed_len += 2; printed_len += 2;
s++; s++;
#if defined (HANDLE_MULTIBYTE) #if defined (HANDLE_MULTIBYTE)
memset (&ps, 0, sizeof (mbstate_t)); memset (&ps, 0, sizeof (mbstate_t));
#endif #endif
} }
else if (*s == RUBOUT) else if (*s == RUBOUT)
{ {
displayer->putch (displayer, '^'); displayer->putch (displayer, '^');

View File

@@ -88,8 +88,8 @@ specify_exec_file_hook (void (*hook) (const char *))
} }
/* Grow the hook array by one and add the new hook to the end. /* Grow the hook array by one and add the new hook to the end.
Yes, it's inefficient to grow it by one each time but since Yes, it's inefficient to grow it by one each time but since
this is hardly ever called it's not a big deal. */ this is hardly ever called it's not a big deal. */
exec_file_hook_count++; exec_file_hook_count++;
new_array = (hook_type *) new_array = (hook_type *)
xrealloc (exec_file_extra_hooks, xrealloc (exec_file_extra_hooks,

View File

@@ -199,7 +199,7 @@ core_target::build_file_mappings ()
/* read_core_file_mappings will invoke this lambda for each mapping /* read_core_file_mappings will invoke this lambda for each mapping
that it finds. */ that it finds. */
[&] (int num, ULONGEST start, ULONGEST end, ULONGEST file_ofs, [&] (int num, ULONGEST start, ULONGEST end, ULONGEST file_ofs,
const char *filename, const void *other) const char *filename, const void *other)
{ {
/* Architecture-specific read_core_mapping methods are expected to /* Architecture-specific read_core_mapping methods are expected to
weed out non-file-backed mappings. */ weed out non-file-backed mappings. */
@@ -226,7 +226,7 @@ core_target::build_file_mappings ()
} }
bfd = bfd_map[filename] = bfd_openr (expanded_fname.get (), bfd = bfd_map[filename] = bfd_openr (expanded_fname.get (),
"binary"); "binary");
if (bfd == nullptr || !bfd_check_format (bfd, bfd_object)) if (bfd == nullptr || !bfd_check_format (bfd, bfd_object))
{ {
@@ -292,7 +292,7 @@ core_target::close ()
exit_inferior_silent (current_inferior ()); exit_inferior_silent (current_inferior ());
/* Clear out solib state while the bfd is still open. See /* Clear out solib state while the bfd is still open. See
comments in clear_solib in solib.c. */ comments in clear_solib in solib.c. */
clear_solib (); clear_solib ();
current_program_space->cbfd.reset (nullptr); current_program_space->cbfd.reset (nullptr);
@@ -440,8 +440,8 @@ core_target_open (const char *arg, int from_tty)
{ {
/* Do it after the err msg */ /* Do it after the err msg */
/* FIXME: should be checking for errors from bfd_close (for one /* FIXME: should be checking for errors from bfd_close (for one
thing, on error it does not free all the storage associated thing, on error it does not free all the storage associated
with the bfd). */ with the bfd). */
error (_("\"%s\" is not a core dump: %s"), error (_("\"%s\" is not a core dump: %s"),
filename.get (), bfd_errmsg (bfd_get_error ())); filename.get (), bfd_errmsg (bfd_get_error ()));
} }
@@ -765,7 +765,7 @@ core_target::xfer_memory_via_mappings (gdb_byte *readbuf,
for (const auto &mr : m_core_unavailable_mappings) for (const auto &mr : m_core_unavailable_mappings)
{ {
if (address_in_mem_range (memaddr, &mr)) if (address_in_mem_range (memaddr, &mr))
{ {
if (!address_in_mem_range (memend, &mr)) if (!address_in_mem_range (memend, &mr))
len = mr.start + mr.length - memaddr; len = mr.start + mr.length - memaddr;
@@ -1172,7 +1172,7 @@ _initialize_corelow ()
{ {
add_target (core_target_info, core_target_open, filename_completer); add_target (core_target_info, core_target_open, filename_completer);
add_cmd ("core-file-backed-mappings", class_maintenance, add_cmd ("core-file-backed-mappings", class_maintenance,
maintenance_print_core_file_backed_mappings, maintenance_print_core_file_backed_mappings,
_("Print core file's file-backed mappings."), _("Print core file's file-backed mappings."),
&maintenanceprintlist); &maintenanceprintlist);
} }

View File

@@ -135,7 +135,7 @@ extern struct value *value_virtual_fn_field (struct value **valuep,
FULL, TOP, and USING_ENC can each be zero, in which case we don't FULL, TOP, and USING_ENC can each be zero, in which case we don't
provide the corresponding piece of information. */ provide the corresponding piece of information. */
extern struct type *value_rtti_type (struct value *value, extern struct type *value_rtti_type (struct value *value,
int *full, LONGEST *top, int *full, LONGEST *top,
int *using_enc); int *using_enc);
/* Compute the offset of the baseclass which is the INDEXth baseclass /* Compute the offset of the baseclass which is the INDEXth baseclass

View File

@@ -1337,8 +1337,8 @@ cpname_state::parse_number (const char *p, int len, int parsed_float,
char c; char c;
/* The GDB lexer checks the result of scanf at this point. Not doing /* The GDB lexer checks the result of scanf at this point. Not doing
this leaves our error checking slightly weaker but only for invalid this leaves our error checking slightly weaker but only for invalid
data. */ data. */
/* See if it has `f' or `l' suffix (float or long double). */ /* See if it has `f' or `l' suffix (float or long double). */
@@ -1696,7 +1696,7 @@ yylex (YYSTYPE *lvalp, cpname_state *state)
} }
toktype = state->parse_number (tokstart, p - tokstart, got_dot|got_e, toktype = state->parse_number (tokstart, p - tokstart, got_dot|got_e,
lvalp); lvalp);
if (toktype == ERROR) if (toktype == ERROR)
{ {
char *err_copy = (char *) alloca (p - tokstart + 1); char *err_copy = (char *) alloca (p - tokstart + 1);
@@ -1804,7 +1804,7 @@ yylex (YYSTYPE *lvalp, cpname_state *state)
{ {
case 16: case 16:
if (strncmp (tokstart, "reinterpret_cast", 16) == 0) if (strncmp (tokstart, "reinterpret_cast", 16) == 0)
return REINTERPRET_CAST; return REINTERPRET_CAST;
break; break;
case 12: case 12:
if (strncmp (tokstart, "construction vtable for ", 24) == 0) if (strncmp (tokstart, "construction vtable for ", 24) == 0)
@@ -1813,11 +1813,11 @@ yylex (YYSTYPE *lvalp, cpname_state *state)
return CONSTRUCTION_VTABLE; return CONSTRUCTION_VTABLE;
} }
if (strncmp (tokstart, "dynamic_cast", 12) == 0) if (strncmp (tokstart, "dynamic_cast", 12) == 0)
return DYNAMIC_CAST; return DYNAMIC_CAST;
break; break;
case 11: case 11:
if (strncmp (tokstart, "static_cast", 11) == 0) if (strncmp (tokstart, "static_cast", 11) == 0)
return STATIC_CAST; return STATIC_CAST;
break; break;
case 9: case 9:
HANDLE_SPECIAL ("covariant return thunk to ", DEMANGLE_COMPONENT_COVARIANT_THUNK); HANDLE_SPECIAL ("covariant return thunk to ", DEMANGLE_COMPONENT_COVARIANT_THUNK);

View File

@@ -359,7 +359,7 @@ cp_lookup_symbol_in_namespace (const char *the_namespace, const char *name,
namespace A { namespace A {
using namespace X; using namespace X;
namespace B { namespace B {
using namespace Y; using namespace Y;
} }
} }
@@ -404,14 +404,14 @@ cp_lookup_symbol_via_imports (const char *scope,
len = strlen (current->import_dest); len = strlen (current->import_dest);
directive_match = (search_parents directive_match = (search_parents
? (startswith (scope, current->import_dest) ? (startswith (scope, current->import_dest)
&& (len == 0 && (len == 0
|| scope[len] == ':' || scope[len] == ':'
|| scope[len] == '\0')) || scope[len] == '\0'))
: strcmp (scope, current->import_dest) == 0); : strcmp (scope, current->import_dest) == 0);
/* If the import destination is the current scope or one of its /* If the import destination is the current scope or one of its
ancestors then it is applicable. */ ancestors then it is applicable. */
if (directive_match && !current->searched) if (directive_match && !current->searched)
{ {
/* Mark this import as searched so that the recursive call /* Mark this import as searched so that the recursive call
@@ -628,9 +628,9 @@ cp_lookup_symbol_via_all_imports (const char *scope, const char *name,
struct block_symbol struct block_symbol
cp_lookup_symbol_namespace (const char *scope, cp_lookup_symbol_namespace (const char *scope,
const char *name, const char *name,
const struct block *block, const struct block *block,
const domain_enum domain) const domain_enum domain)
{ {
struct block_symbol sym; struct block_symbol sym;

View File

@@ -735,8 +735,8 @@ cp_class_name_from_physname (const char *physname)
case DEMANGLE_COMPONENT_RESTRICT_THIS: case DEMANGLE_COMPONENT_RESTRICT_THIS:
case DEMANGLE_COMPONENT_VOLATILE_THIS: case DEMANGLE_COMPONENT_VOLATILE_THIS:
case DEMANGLE_COMPONENT_VENDOR_TYPE_QUAL: case DEMANGLE_COMPONENT_VENDOR_TYPE_QUAL:
ret_comp = d_left (ret_comp); ret_comp = d_left (ret_comp);
break; break;
default: default:
done = 1; done = 1;
break; break;
@@ -763,8 +763,8 @@ cp_class_name_from_physname (const char *physname)
case DEMANGLE_COMPONENT_QUAL_NAME: case DEMANGLE_COMPONENT_QUAL_NAME:
case DEMANGLE_COMPONENT_LOCAL_NAME: case DEMANGLE_COMPONENT_LOCAL_NAME:
prev_comp = cur_comp; prev_comp = cur_comp;
cur_comp = d_right (cur_comp); cur_comp = d_right (cur_comp);
break; break;
case DEMANGLE_COMPONENT_TEMPLATE: case DEMANGLE_COMPONENT_TEMPLATE:
case DEMANGLE_COMPONENT_NAME: case DEMANGLE_COMPONENT_NAME:
case DEMANGLE_COMPONENT_CTOR: case DEMANGLE_COMPONENT_CTOR:
@@ -811,11 +811,11 @@ unqualified_name_from_comp (struct demangle_component *comp)
{ {
case DEMANGLE_COMPONENT_QUAL_NAME: case DEMANGLE_COMPONENT_QUAL_NAME:
case DEMANGLE_COMPONENT_LOCAL_NAME: case DEMANGLE_COMPONENT_LOCAL_NAME:
ret_comp = d_right (ret_comp); ret_comp = d_right (ret_comp);
break; break;
case DEMANGLE_COMPONENT_TYPED_NAME: case DEMANGLE_COMPONENT_TYPED_NAME:
ret_comp = d_left (ret_comp); ret_comp = d_left (ret_comp);
break; break;
case DEMANGLE_COMPONENT_TEMPLATE: case DEMANGLE_COMPONENT_TEMPLATE:
gdb_assert (last_template == NULL); gdb_assert (last_template == NULL);
last_template = ret_comp; last_template = ret_comp;
@@ -828,8 +828,8 @@ unqualified_name_from_comp (struct demangle_component *comp)
case DEMANGLE_COMPONENT_RESTRICT_THIS: case DEMANGLE_COMPONENT_RESTRICT_THIS:
case DEMANGLE_COMPONENT_VOLATILE_THIS: case DEMANGLE_COMPONENT_VOLATILE_THIS:
case DEMANGLE_COMPONENT_VENDOR_TYPE_QUAL: case DEMANGLE_COMPONENT_VENDOR_TYPE_QUAL:
ret_comp = d_left (ret_comp); ret_comp = d_left (ret_comp);
break; break;
case DEMANGLE_COMPONENT_NAME: case DEMANGLE_COMPONENT_NAME:
case DEMANGLE_COMPONENT_CTOR: case DEMANGLE_COMPONENT_CTOR:
case DEMANGLE_COMPONENT_DTOR: case DEMANGLE_COMPONENT_DTOR:
@@ -936,8 +936,8 @@ cp_remove_params_1 (const char *demangled_name, bool require_params)
case DEMANGLE_COMPONENT_RESTRICT_THIS: case DEMANGLE_COMPONENT_RESTRICT_THIS:
case DEMANGLE_COMPONENT_VOLATILE_THIS: case DEMANGLE_COMPONENT_VOLATILE_THIS:
case DEMANGLE_COMPONENT_VENDOR_TYPE_QUAL: case DEMANGLE_COMPONENT_VENDOR_TYPE_QUAL:
ret_comp = d_left (ret_comp); ret_comp = d_left (ret_comp);
break; break;
default: default:
done = true; done = true;
break; break;
@@ -1337,8 +1337,8 @@ add_symbol_overload_list_adl_namespace (struct type *type,
while (type->code () == TYPE_CODE_PTR while (type->code () == TYPE_CODE_PTR
|| TYPE_IS_REFERENCE (type) || TYPE_IS_REFERENCE (type)
|| type->code () == TYPE_CODE_ARRAY || type->code () == TYPE_CODE_ARRAY
|| type->code () == TYPE_CODE_TYPEDEF) || type->code () == TYPE_CODE_TYPEDEF)
{ {
if (type->code () == TYPE_CODE_TYPEDEF) if (type->code () == TYPE_CODE_TYPEDEF)
type = check_typedef (type); type = check_typedef (type);
@@ -1415,12 +1415,12 @@ add_symbol_overload_list_using (const char *func_name,
if (current->searched) if (current->searched)
continue; continue;
/* If this is a namespace alias or imported declaration ignore /* If this is a namespace alias or imported declaration ignore
it. */ it. */
if (current->alias != NULL || current->declaration != NULL) if (current->alias != NULL || current->declaration != NULL)
continue; continue;
if (strcmp (the_namespace, current->import_dest) == 0) if (strcmp (the_namespace, current->import_dest) == 0)
{ {
/* Mark this import as searched so that the recursive call /* Mark this import as searched so that the recursive call
does not search it again. */ does not search it again. */
@@ -1628,7 +1628,7 @@ gdb_demangle (const char *name, int options)
if (catch_demangler_crashes) if (catch_demangler_crashes)
{ {
/* The signal handler may keep the signal blocked when we longjmp out /* The signal handler may keep the signal blocked when we longjmp out
of it. If we have sigprocmask, we can use it to unblock the signal of it. If we have sigprocmask, we can use it to unblock the signal
afterwards and we can avoid the performance overhead of saving the afterwards and we can avoid the performance overhead of saving the
signal mask just in case the signal gets triggered. Otherwise, just signal mask just in case the signal gets triggered. Otherwise, just
tell sigsetjmp to save the mask. */ tell sigsetjmp to save the mask. */
@@ -1647,7 +1647,7 @@ gdb_demangle (const char *name, int options)
if (catch_demangler_crashes) if (catch_demangler_crashes)
{ {
if (crash_signal != 0) if (crash_signal != 0)
{ {
#ifdef HAVE_SIGPROCMASK #ifdef HAVE_SIGPROCMASK
/* If we got the signal, SIGSEGV may still be blocked; restore it. */ /* If we got the signal, SIGSEGV may still be blocked; restore it. */
sigset_t segv_sig_set; sigset_t segv_sig_set;
@@ -1659,15 +1659,15 @@ gdb_demangle (const char *name, int options)
/* If there was a failure, we can't report it here, because /* If there was a failure, we can't report it here, because
we might be in a background thread. Instead, arrange for we might be in a background thread. Instead, arrange for
the reporting to happen on the main thread. */ the reporting to happen on the main thread. */
std::string copy = name; std::string copy = name;
run_on_main_thread ([=] () run_on_main_thread ([=] ()
{ {
report_failed_demangle (copy.c_str (), core_dump_allowed, report_failed_demangle (copy.c_str (), core_dump_allowed,
crash_signal); crash_signal);
}); });
result = NULL; result = NULL;
} }
} }
#endif #endif

View File

@@ -84,7 +84,7 @@ cp_is_vtbl_member (struct type *type)
|| type->code () == TYPE_CODE_PTR) /* if using thunks */ || type->code () == TYPE_CODE_PTR) /* if using thunks */
{ {
/* Virtual functions tables are full of pointers /* Virtual functions tables are full of pointers
to virtual functions. */ to virtual functions. */
return cp_is_vtbl_ptr_type (type); return cp_is_vtbl_ptr_type (type);
} }
} }
@@ -262,7 +262,7 @@ cp_print_value_fields (struct value *val, struct ui_file *stream,
struct value *v; struct value *v;
/* Bitfields require special handling, especially due to /* Bitfields require special handling, especially due to
byte order problems. */ byte order problems. */
if (TYPE_FIELD_IGNORE (type, i)) if (TYPE_FIELD_IGNORE (type, i))
{ {
fputs_styled ("<optimized out or zero length>", fputs_styled ("<optimized out or zero length>",
@@ -342,7 +342,7 @@ cp_print_value_fields (struct value *val, struct ui_file *stream,
if (dont_print_statmem == 0) if (dont_print_statmem == 0)
{ {
size_t obstack_final_size = size_t obstack_final_size =
obstack_object_size (&dont_print_statmem_obstack); obstack_object_size (&dont_print_statmem_obstack);
if (obstack_final_size > statmem_obstack_initial_size) if (obstack_final_size > statmem_obstack_initial_size)
{ {
@@ -400,8 +400,8 @@ cp_print_value (struct value *val, struct ui_file *stream,
if (dont_print_vb == 0) if (dont_print_vb == 0)
{ {
/* If we're at top level, carve out a completely fresh chunk of /* If we're at top level, carve out a completely fresh chunk of
the obstack and use that until this particular invocation the obstack and use that until this particular invocation
returns. */ returns. */
/* Bump up the high-water mark. Now alpha is omega. */ /* Bump up the high-water mark. Now alpha is omega. */
obstack_finish (&dont_print_vb_obstack); obstack_finish (&dont_print_vb_obstack);
} }
@@ -483,7 +483,7 @@ cp_print_value (struct value *val, struct ui_file *stream,
} }
fputs_filtered ("<", stream); fputs_filtered ("<", stream);
/* Not sure what the best notation is in the case where there is /* Not sure what the best notation is in the case where there is
no baseclass name. */ no baseclass name. */
fputs_filtered (basename ? basename : "", stream); fputs_filtered (basename ? basename : "", stream);
fputs_filtered ("> = ", stream); fputs_filtered ("> = ", stream);
@@ -531,10 +531,10 @@ cp_print_value (struct value *val, struct ui_file *stream,
if (dont_print_vb == 0) if (dont_print_vb == 0)
{ {
/* Free the space used to deal with the printing /* Free the space used to deal with the printing
of this type from top level. */ of this type from top level. */
obstack_free (&dont_print_vb_obstack, last_dont_print); obstack_free (&dont_print_vb_obstack, last_dont_print);
/* Reset watermark so that we can continue protecting /* Reset watermark so that we can continue protecting
ourselves from whatever we were protecting ourselves. */ ourselves from whatever we were protecting ourselves. */
dont_print_vb_obstack = tmp_obstack; dont_print_vb_obstack = tmp_obstack;
} }
} }

View File

@@ -40,7 +40,7 @@ cris_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
if (tdep->cris_version == 32) if (tdep->cris_version == 32)
/* Threaded debugging is only supported on CRISv32 for now. */ /* Threaded debugging is only supported on CRISv32 for now. */
set_gdbarch_fetch_tls_load_module_address (gdbarch, set_gdbarch_fetch_tls_load_module_address (gdbarch,
svr4_fetch_objfile_link_map); svr4_fetch_objfile_link_map);
set_solib_svr4_fetch_link_map_offsets (gdbarch, set_solib_svr4_fetch_link_map_offsets (gdbarch,
svr4_ilp32_fetch_link_map_offsets); svr4_ilp32_fetch_link_map_offsets);

File diff suppressed because it is too large Load Diff

View File

@@ -511,7 +511,7 @@ PrimaryExpression:
{ write_dollar_variable (pstate, $1); } { write_dollar_variable (pstate, $1); }
| NAME_OR_INT | NAME_OR_INT
{ YYSTYPE val; { YYSTYPE val;
parse_number (pstate, $1.ptr, $1.length, 0, &val); parse_number (pstate, $1.ptr, $1.length, 0, &val);
write_exp_elt_opcode (pstate, OP_LONG); write_exp_elt_opcode (pstate, OP_LONG);
write_exp_elt_type (pstate, val.typed_val_int.type); write_exp_elt_type (pstate, val.typed_val_int.type);
write_exp_elt_longcst (pstate, write_exp_elt_longcst (pstate,
@@ -793,7 +793,7 @@ parse_number (struct parser_state *ps, const char *p,
if (base > 10 && c >= 'a' && c <= 'f') if (base > 10 && c >= 'a' && c <= 'f')
{ {
if (found_suffix) if (found_suffix)
return ERROR; return ERROR;
n += i = c - 'a' + 10; n += i = c - 'a' + 10;
} }
else if (c == 'l' && long_p == 0) else if (c == 'l' && long_p == 0)
@@ -1080,7 +1080,7 @@ lex_one_token (struct parser_state *par_state)
else if (saw_structop) else if (saw_structop)
return COMPLETE; return COMPLETE;
else else
return 0; return 0;
case ' ': case ' ':
case '\t': case '\t':
@@ -1269,9 +1269,9 @@ lex_one_token (struct parser_state *par_state)
const char *p = tokstart + namelen + 1; const char *p = tokstart + namelen + 1;
while (*p == ' ' || *p == '\t') while (*p == ' ' || *p == '\t')
p++; p++;
if (*p >= '0' && *p <= '9') if (*p >= '0' && *p <= '9')
return 0; return 0;
} }
pstate->lexptr += namelen; pstate->lexptr += namelen;
@@ -1488,7 +1488,7 @@ yylex (void)
if (next.token == IDENTIFIER && last_was_dot) if (next.token == IDENTIFIER && last_was_dot)
{ {
/* Update the partial name we are constructing. */ /* Update the partial name we are constructing. */
obstack_grow_str (&name_obstack, "."); obstack_grow_str (&name_obstack, ".");
obstack_grow (&name_obstack, next.value.sval.ptr, obstack_grow (&name_obstack, next.value.sval.ptr,
next.value.sval.length); next.value.sval.length);
@@ -1568,7 +1568,7 @@ yylex (void)
if (context_type != NULL) if (context_type != NULL)
{ {
/* We don't want to put a leading "." into the name. */ /* We don't want to put a leading "." into the name. */
obstack_grow_str (&name_obstack, "."); obstack_grow_str (&name_obstack, ".");
} }
obstack_grow (&name_obstack, next.value.sval.ptr, obstack_grow (&name_obstack, next.value.sval.ptr,
next.value.sval.length); next.value.sval.length);

View File

@@ -90,20 +90,20 @@ info_mach_tasks_command (const char *args, int from_tty)
mach_port_t taskPort; mach_port_t taskPort;
result = result =
task_by_unix_pid (mach_task_self (), procInfo[index].kp_proc.p_pid, task_by_unix_pid (mach_task_self (), procInfo[index].kp_proc.p_pid,
&taskPort); &taskPort);
if (KERN_SUCCESS == result) if (KERN_SUCCESS == result)
{ {
printf_unfiltered (_(" %s is %d has task %#x\n"), printf_unfiltered (_(" %s is %d has task %#x\n"),
procInfo[index].kp_proc.p_comm, procInfo[index].kp_proc.p_comm,
procInfo[index].kp_proc.p_pid, taskPort); procInfo[index].kp_proc.p_pid, taskPort);
} }
else else
{ {
printf_unfiltered (_(" %s is %d unknown task port\n"), printf_unfiltered (_(" %s is %d unknown task port\n"),
procInfo[index].kp_proc.p_comm, procInfo[index].kp_proc.p_comm,
procInfo[index].kp_proc.p_pid); procInfo[index].kp_proc.p_pid);
} }
} }
xfree (procInfo); xfree (procInfo);
@@ -156,8 +156,8 @@ info_mach_task_command (const char *args, int from_tty)
printf_unfiltered (_("TASK_BASIC_INFO for 0x%x:\n"), task); printf_unfiltered (_("TASK_BASIC_INFO for 0x%x:\n"), task);
info_count = TASK_BASIC_INFO_COUNT; info_count = TASK_BASIC_INFO_COUNT;
result = task_info (task, result = task_info (task,
TASK_BASIC_INFO, TASK_BASIC_INFO,
(task_info_t) & task_info_data.basic, &info_count); (task_info_t) & task_info_data.basic, &info_count);
MACH_CHECK_ERROR (result); MACH_CHECK_ERROR (result);
PRINT_FIELD (&task_info_data.basic, suspend_count); PRINT_FIELD (&task_info_data.basic, suspend_count);
@@ -168,8 +168,8 @@ info_mach_task_command (const char *args, int from_tty)
printf_unfiltered (_("\nTASK_EVENTS_INFO:\n")); printf_unfiltered (_("\nTASK_EVENTS_INFO:\n"));
info_count = TASK_EVENTS_INFO_COUNT; info_count = TASK_EVENTS_INFO_COUNT;
result = task_info (task, result = task_info (task,
TASK_EVENTS_INFO, TASK_EVENTS_INFO,
(task_info_t) & task_info_data.events, &info_count); (task_info_t) & task_info_data.events, &info_count);
MACH_CHECK_ERROR (result); MACH_CHECK_ERROR (result);
PRINT_FIELD (&task_info_data.events, faults); PRINT_FIELD (&task_info_data.events, faults);
@@ -184,9 +184,9 @@ info_mach_task_command (const char *args, int from_tty)
printf_unfiltered (_("\nTASK_THREAD_TIMES_INFO:\n")); printf_unfiltered (_("\nTASK_THREAD_TIMES_INFO:\n"));
info_count = TASK_THREAD_TIMES_INFO_COUNT; info_count = TASK_THREAD_TIMES_INFO_COUNT;
result = task_info (task, result = task_info (task,
TASK_THREAD_TIMES_INFO, TASK_THREAD_TIMES_INFO,
(task_info_t) & task_info_data.thread_times, (task_info_t) & task_info_data.thread_times,
&info_count); &info_count);
MACH_CHECK_ERROR (result); MACH_CHECK_ERROR (result);
PRINT_TV_FIELD (&task_info_data.thread_times, user_time); PRINT_TV_FIELD (&task_info_data.thread_times, user_time);
PRINT_TV_FIELD (&task_info_data.thread_times, system_time); PRINT_TV_FIELD (&task_info_data.thread_times, system_time);
@@ -293,9 +293,9 @@ info_mach_ports_command (const char *args, int from_tty)
} }
vm_deallocate (task_self (), (vm_address_t) names, vm_deallocate (task_self (), (vm_address_t) names,
(name_count * sizeof (mach_port_t))); (name_count * sizeof (mach_port_t)));
vm_deallocate (task_self (), (vm_address_t) types, vm_deallocate (task_self (), (vm_address_t) types,
(type_count * sizeof (mach_port_type_t))); (type_count * sizeof (mach_port_type_t)));
} }
@@ -311,7 +311,7 @@ darwin_debug_port_info (task_t task, mach_port_t port)
MACH_CHECK_ERROR (kret); MACH_CHECK_ERROR (kret);
printf_unfiltered (_("Port 0x%lx in task 0x%lx:\n"), (unsigned long) port, printf_unfiltered (_("Port 0x%lx in task 0x%lx:\n"), (unsigned long) port,
(unsigned long) task); (unsigned long) task);
printf_unfiltered (_(" port set: 0x%x\n"), status.mps_pset); printf_unfiltered (_(" port set: 0x%x\n"), status.mps_pset);
printf_unfiltered (_(" seqno: 0x%x\n"), status.mps_seqno); printf_unfiltered (_(" seqno: 0x%x\n"), status.mps_seqno);
printf_unfiltered (_(" mscount: 0x%x\n"), status.mps_mscount); printf_unfiltered (_(" mscount: 0x%x\n"), status.mps_mscount);
@@ -360,7 +360,7 @@ info_mach_threads_command (const char *args, int from_tty)
} }
vm_deallocate (task_self (), (vm_address_t) threads, vm_deallocate (task_self (), (vm_address_t) threads,
(thread_count * sizeof (thread_t))); (thread_count * sizeof (thread_t)));
} }
static void static void
@@ -543,65 +543,65 @@ darwin_debug_regions (task_t task, mach_vm_address_t address, int max)
/* Check to see if address space has wrapped around. */ /* Check to see if address space has wrapped around. */
if (address == 0) if (address == 0)
print = done = 1; print = done = 1;
if (!done) if (!done)
{ {
count = VM_REGION_BASIC_INFO_COUNT_64; count = VM_REGION_BASIC_INFO_COUNT_64;
kret = kret =
mach_vm_region (task, &address, &size, VM_REGION_BASIC_INFO_64, mach_vm_region (task, &address, &size, VM_REGION_BASIC_INFO_64,
(vm_region_info_t) &info, &count, &object_name); (vm_region_info_t) &info, &count, &object_name);
if (kret != KERN_SUCCESS) if (kret != KERN_SUCCESS)
{ {
size = 0; size = 0;
print = done = 1; print = done = 1;
} }
} }
if (address != prev_address + prev_size) if (address != prev_address + prev_size)
print = 1; print = 1;
if ((info.protection != prev_info.protection) if ((info.protection != prev_info.protection)
|| (info.max_protection != prev_info.max_protection) || (info.max_protection != prev_info.max_protection)
|| (info.inheritance != prev_info.inheritance) || (info.inheritance != prev_info.inheritance)
|| (info.shared != prev_info.reserved) || (info.shared != prev_info.reserved)
|| (info.reserved != prev_info.reserved)) || (info.reserved != prev_info.reserved))
print = 1; print = 1;
if (print) if (print)
{ {
printf_filtered (_("%s-%s %s/%s %s %s %s"), printf_filtered (_("%s-%s %s/%s %s %s %s"),
paddress (target_gdbarch (), prev_address), paddress (target_gdbarch (), prev_address),
paddress (target_gdbarch (), prev_address + prev_size), paddress (target_gdbarch (), prev_address + prev_size),
unparse_protection (prev_info.protection), unparse_protection (prev_info.protection),
unparse_protection (prev_info.max_protection), unparse_protection (prev_info.max_protection),
unparse_inheritance (prev_info.inheritance), unparse_inheritance (prev_info.inheritance),
prev_info.shared ? _("shrd") : _("priv"), prev_info.shared ? _("shrd") : _("priv"),
prev_info.reserved ? _("reserved") : _("not-rsvd")); prev_info.reserved ? _("reserved") : _("not-rsvd"));
if (nsubregions > 1) if (nsubregions > 1)
printf_filtered (_(" (%d sub-rgn)"), nsubregions); printf_filtered (_(" (%d sub-rgn)"), nsubregions);
printf_filtered (_("\n")); printf_filtered (_("\n"));
prev_address = address; prev_address = address;
prev_size = size; prev_size = size;
memcpy (&prev_info, &info, sizeof (vm_region_basic_info_data_64_t)); memcpy (&prev_info, &info, sizeof (vm_region_basic_info_data_64_t));
nsubregions = 1; nsubregions = 1;
num_printed++; num_printed++;
} }
else else
{ {
prev_size += size; prev_size += size;
nsubregions++; nsubregions++;
} }
if ((max > 0) && (num_printed >= max)) if ((max > 0) && (num_printed >= max))
done = 1; done = 1;
if (done) if (done)
break; break;
} }
} }
@@ -843,25 +843,25 @@ void
_initialize_darwin_info_commands () _initialize_darwin_info_commands ()
{ {
add_info ("mach-tasks", info_mach_tasks_command, add_info ("mach-tasks", info_mach_tasks_command,
_("Get list of tasks in system.")); _("Get list of tasks in system."));
add_info ("mach-ports", info_mach_ports_command, add_info ("mach-ports", info_mach_ports_command,
_("Get list of ports in a task.")); _("Get list of ports in a task."));
add_info ("mach-port", info_mach_port_command, add_info ("mach-port", info_mach_port_command,
_("Get info on a specific port.")); _("Get info on a specific port."));
add_info ("mach-task", info_mach_task_command, add_info ("mach-task", info_mach_task_command,
_("Get info on a specific task.")); _("Get info on a specific task."));
add_info ("mach-threads", info_mach_threads_command, add_info ("mach-threads", info_mach_threads_command,
_("Get list of threads in a task.")); _("Get list of threads in a task."));
add_info ("mach-thread", info_mach_thread_command, add_info ("mach-thread", info_mach_thread_command,
_("Get info on a specific thread.")); _("Get info on a specific thread."));
add_info ("mach-regions", info_mach_regions_command, add_info ("mach-regions", info_mach_regions_command,
_("Get information on all mach region for the task.")); _("Get information on all mach region for the task."));
add_info ("mach-regions-rec", info_mach_regions_recurse_command, add_info ("mach-regions-rec", info_mach_regions_recurse_command,
_("Get information on all mach sub region for the task.")); _("Get information on all mach sub region for the task."));
add_info ("mach-region", info_mach_region_command, add_info ("mach-region", info_mach_region_command,
_("Get information on mach region at given address.")); _("Get information on mach region at given address."));
add_info ("mach-exceptions", info_mach_exceptions_command, add_info ("mach-exceptions", info_mach_exceptions_command,
_("Disp mach exceptions.")); _("Disp mach exceptions."));
} }

View File

@@ -176,7 +176,7 @@ inferior_debug (int level, const char *fmt, ...)
void void
mach_check_error (kern_return_t ret, const char *file, mach_check_error (kern_return_t ret, const char *file,
unsigned int line, const char *func) unsigned int line, const char *func)
{ {
if (ret == KERN_SUCCESS) if (ret == KERN_SUCCESS)
return; return;
@@ -241,8 +241,8 @@ darwin_ptrace (const char *name,
ret = 0; ret = 0;
inferior_debug (4, _("ptrace (%s, %d, 0x%lx, %d): %d (%s)\n"), inferior_debug (4, _("ptrace (%s, %d, 0x%lx, %d): %d (%s)\n"),
name, pid, (unsigned long) arg3, arg4, ret, name, pid, (unsigned long) arg3, arg4, ret,
(ret != 0) ? safe_strerror (errno) : _("no error")); (ret != 0) ? safe_strerror (errno) : _("no error"));
return ret; return ret;
} }
@@ -940,19 +940,19 @@ darwin_nat_target::resume (ptid_t ptid, int step, enum gdb_signal signal)
darwin_suspend_inferior (inf); darwin_suspend_inferior (inf);
if (tid == 0) if (tid == 0)
darwin_resume_inferior_threads (inf, step, nsignal); darwin_resume_inferior_threads (inf, step, nsignal);
else else
{ {
darwin_thread_t *thread; darwin_thread_t *thread;
/* Suspend threads of the task. */ /* Suspend threads of the task. */
darwin_suspend_inferior_threads (inf); darwin_suspend_inferior_threads (inf);
/* Resume the selected thread. */ /* Resume the selected thread. */
thread = darwin_find_thread (inf, tid); thread = darwin_find_thread (inf, tid);
gdb_assert (thread); gdb_assert (thread);
darwin_resume_thread (inf, thread, step, nsignal); darwin_resume_thread (inf, thread, step, nsignal);
} }
/* Resume the task. */ /* Resume the task. */
darwin_resume_inferior (inf); darwin_resume_inferior (inf);
@@ -1432,10 +1432,10 @@ darwin_restore_exception_ports (darwin_inferior *inf)
for (i = 0; i < inf->exception_info.count; i++) for (i = 0; i < inf->exception_info.count; i++)
{ {
kret = task_set_exception_ports kret = task_set_exception_ports
(inf->task, inf->exception_info.masks[i], inf->exception_info.ports[i], (inf->task, inf->exception_info.masks[i], inf->exception_info.ports[i],
inf->exception_info.behaviors[i], inf->exception_info.flavors[i]); inf->exception_info.behaviors[i], inf->exception_info.flavors[i]);
if (kret != KERN_SUCCESS) if (kret != KERN_SUCCESS)
return kret; return kret;
} }
return KERN_SUCCESS; return KERN_SUCCESS;
@@ -1508,21 +1508,21 @@ darwin_nat_target::kill ()
if (res == 0) if (res == 0)
{ {
/* On MacOS version Sierra, the darwin_restore_exception_ports call /* On MacOS version Sierra, the darwin_restore_exception_ports call
does not work as expected. does not work as expected.
When the kill function is called, the SIGKILL signal is received When the kill function is called, the SIGKILL signal is received
by gdb whereas it should have been received by the kernel since by gdb whereas it should have been received by the kernel since
the exception ports have been restored. the exception ports have been restored.
This behavior is not the expected one thus gdb does not reply to This behavior is not the expected one thus gdb does not reply to
the received SIGKILL message. This situation leads to a "busy" the received SIGKILL message. This situation leads to a "busy"
resource from the kernel point of view and the inferior is never resource from the kernel point of view and the inferior is never
released, causing it to remain as a zombie process, even after released, causing it to remain as a zombie process, even after
GDB exits. GDB exits.
To work around this, we mark all the threads of the inferior as To work around this, we mark all the threads of the inferior as
signaled thus darwin_decode_message function knows that the kill signaled thus darwin_decode_message function knows that the kill
signal was sent by gdb and will take the appropriate action signal was sent by gdb and will take the appropriate action
(cancel signal and reply to the signal message). */ (cancel signal and reply to the signal message). */
for (darwin_thread_t *thread : priv->threads) for (darwin_thread_t *thread : priv->threads)
thread->signaled = 1; thread->signaled = 1;
darwin_resume_inferior (inf); darwin_resume_inferior (inf);
@@ -1775,7 +1775,7 @@ darwin_execvp (const char *file, char * const argv[], char * const env[])
if (res != 0) if (res != 0)
{ {
fprintf_unfiltered fprintf_unfiltered
(gdb_stderr, "Cannot initialize attribute for posix_spawn\n"); (gdb_stderr, "Cannot initialize attribute for posix_spawn\n");
return; return;
} }
@@ -1813,7 +1813,7 @@ may_have_sip ()
{ {
unsigned long ver = strtoul (str, NULL, 10); unsigned long ver = strtoul (str, NULL, 10);
if (ver >= 16) if (ver >= 16)
return true; return true;
} }
return false; return false;
} }
@@ -2024,7 +2024,7 @@ darwin_nat_target::attach (const char *args, int from_tty)
if (pid == 0 || ::kill (pid, 0) < 0) if (pid == 0 || ::kill (pid, 0) < 0)
error (_("Can't attach to process %d: %s (%d)"), error (_("Can't attach to process %d: %s (%d)"),
pid, safe_strerror (errno), errno); pid, safe_strerror (errno), errno);
inf = current_inferior (); inf = current_inferior ();
inferior_appeared (inf, pid); inferior_appeared (inf, pid);
@@ -2327,10 +2327,10 @@ darwin_nat_target::xfer_partial (enum target_object object, const char *annex,
#ifdef TASK_DYLD_INFO_COUNT #ifdef TASK_DYLD_INFO_COUNT
case TARGET_OBJECT_DARWIN_DYLD_INFO: case TARGET_OBJECT_DARWIN_DYLD_INFO:
if (writebuf != NULL || readbuf == NULL) if (writebuf != NULL || readbuf == NULL)
{ {
/* Support only read. */ /* Support only read. */
return TARGET_XFER_E_IO; return TARGET_XFER_E_IO;
} }
return darwin_read_dyld_info (priv->task, offset, readbuf, len, return darwin_read_dyld_info (priv->task, offset, readbuf, len,
xfered_len); xfered_len);
#endif #endif
@@ -2434,7 +2434,7 @@ darwin_nat_target::get_ada_task_ptid (long lwp, long thread)
} }
vm_deallocate (gdb_task, (vm_address_t) names, vm_deallocate (gdb_task, (vm_address_t) names,
names_count * sizeof (mach_port_t)); names_count * sizeof (mach_port_t));
if (res) if (res)
return ptid_t (current_inferior ()->pid, 0, res); return ptid_t (current_inferior ()->pid, 0, res);

View File

@@ -117,7 +117,7 @@ private:
ptid_t wait_1 (ptid_t, struct target_waitstatus *); ptid_t wait_1 (ptid_t, struct target_waitstatus *);
void check_new_threads (inferior *inf); void check_new_threads (inferior *inf);
int decode_exception_message (mach_msg_header_t *hdr, int decode_exception_message (mach_msg_header_t *hdr,
inferior **pinf, inferior **pinf,
darwin_thread_t **pthread); darwin_thread_t **pthread);
ptid_t decode_message (mach_msg_header_t *hdr, ptid_t decode_message (mach_msg_header_t *hdr,
darwin_thread_t **pthread, darwin_thread_t **pthread,

View File

@@ -461,8 +461,8 @@ record_minimal_symbol (minimal_symbol_reader &reader,
break; break;
case N_SETV: case N_SETV:
/* I don't think this type actually exists; since a N_SETV is the result /* I don't think this type actually exists; since a N_SETV is the result
of going over many .o files, it doesn't make sense to have one of going over many .o files, it doesn't make sense to have one
file local. */ file local. */
ms_type = mst_file_data; ms_type = mst_file_data;
section = SECT_OFF_DATA (objfile); section = SECT_OFF_DATA (objfile);
break; break;
@@ -478,9 +478,9 @@ record_minimal_symbol (minimal_symbol_reader &reader,
ms_type = mst_file_data; ms_type = mst_file_data;
/* Check for __DYNAMIC, which is used by Sun shared libraries. /* Check for __DYNAMIC, which is used by Sun shared libraries.
Record it as global even if it's local, not global, so Record it as global even if it's local, not global, so
lookup_minimal_symbol can find it. We don't check symbol_leading_char lookup_minimal_symbol can find it. We don't check symbol_leading_char
because for SunOS4 it always is '_'. */ because for SunOS4 it always is '_'. */
if (name[8] == 'C' && strcmp ("__DYNAMIC", name) == 0) if (name[8] == 'C' && strcmp ("__DYNAMIC", name) == 0)
ms_type = mst_data; ms_type = mst_data;
@@ -630,8 +630,8 @@ dbx_symfile_init (struct objfile *objfile)
if (STRING_TABLE_OFFSET == 0) if (STRING_TABLE_OFFSET == 0)
{ {
/* It appears that with the existing bfd code, STRING_TABLE_OFFSET /* It appears that with the existing bfd code, STRING_TABLE_OFFSET
will never be zero, even when there is no string table. This will never be zero, even when there is no string table. This
would appear to be a bug in bfd. */ would appear to be a bug in bfd. */
DBX_STRINGTAB_SIZE (objfile) = 0; DBX_STRINGTAB_SIZE (objfile) = 0;
DBX_STRINGTAB (objfile) = NULL; DBX_STRINGTAB (objfile) = NULL;
} }
@@ -765,7 +765,7 @@ fill_symbuf (bfd *sym_bfd)
{ {
nbytes = sizeof (symbuf); nbytes = sizeof (symbuf);
if (nbytes > symbuf_left) if (nbytes > symbuf_left)
nbytes = symbuf_left; nbytes = symbuf_left;
memcpy (symbuf, stabs_data + symbuf_read, nbytes); memcpy (symbuf, stabs_data + symbuf_read, nbytes);
} }
else if (symbuf_sections == NULL) else if (symbuf_sections == NULL)
@@ -913,8 +913,8 @@ find_stab_function (const char *namestring, const char *filename,
if (msym.minsym == NULL) if (msym.minsym == NULL)
{ {
/* Sun Fortran appends an underscore to the minimal symbol name, /* Sun Fortran appends an underscore to the minimal symbol name,
try again with an appended underscore if the minimal symbol try again with an appended underscore if the minimal symbol
was not found. */ was not found. */
p[n] = '_'; p[n] = '_';
p[n + 1] = 0; p[n + 1] = 0;
msym = lookup_minimal_symbol (p, filename, objfile); msym = lookup_minimal_symbol (p, filename, objfile);
@@ -1069,15 +1069,15 @@ read_dbx_symtab (minimal_symbol_reader &reader, struct objfile *objfile)
OBJSTAT (objfile, n_stabs++); OBJSTAT (objfile, n_stabs++);
/* Ok. There is a lot of code duplicated in the rest of this /* Ok. There is a lot of code duplicated in the rest of this
switch statement (for efficiency reasons). Since I don't switch statement (for efficiency reasons). Since I don't
like duplicating code, I will do my penance here, and like duplicating code, I will do my penance here, and
describe the code which is duplicated: describe the code which is duplicated:
*) The assignment to namestring. *) The assignment to namestring.
*) The call to strchr. *) The call to strchr.
*) The addition of a partial symbol the two partial *) The addition of a partial symbol the two partial
symbol lists. This last is a large section of code, so symbol lists. This last is a large section of code, so
I've imbedded it in the following macro. */ I've imbedded it in the following macro. */
switch (nlist.n_type) switch (nlist.n_type)
{ {
@@ -1278,8 +1278,8 @@ read_dbx_symtab (minimal_symbol_reader &reader, struct objfile *objfile)
{ {
/* Save the directory name SOs locally, then save it into /* Save the directory name SOs locally, then save it into
the psymtab when it's created below. */ the psymtab when it's created below. */
dirname_nso = namestring; dirname_nso = namestring;
continue; continue;
} }
/* Some other compilers (C++ ones in particular) emit useless /* Some other compilers (C++ ones in particular) emit useless
@@ -1996,9 +1996,9 @@ dbx_end_psymtab (struct objfile *objfile, legacy_psymtab *pst,
else else
{ {
/* If we know our own starting text address, then walk through all other /* If we know our own starting text address, then walk through all other
psymtabs for this objfile, and if any didn't know their ending text psymtabs for this objfile, and if any didn't know their ending text
address, set it to our starting address. Take care to not set our address, set it to our starting address. Take care to not set our
own ending address to our starting address. */ own ending address to our starting address. */
for (partial_symtab *p1 : objfile->psymtabs ()) for (partial_symtab *p1 : objfile->psymtabs ())
if (!p1->text_high_valid && p1->text_low_valid && p1 != pst) if (!p1->text_high_valid && p1->text_low_valid && p1 != pst)
@@ -2031,7 +2031,7 @@ dbx_end_psymtab (struct objfile *objfile, legacy_psymtab *pst,
LDSYMLEN (subpst) = 0; LDSYMLEN (subpst) = 0;
/* We could save slight bits of space by only making one of these, /* We could save slight bits of space by only making one of these,
shared by the entire set of include files. FIXME-someday. */ shared by the entire set of include files. FIXME-someday. */
subpst->dependencies = subpst->dependencies =
objfile->partial_symtabs->allocate_dependencies (1); objfile->partial_symtabs->allocate_dependencies (1);
subpst->dependencies[0] = pst; subpst->dependencies[0] = pst;
@@ -2048,10 +2048,10 @@ dbx_end_psymtab (struct objfile *objfile, legacy_psymtab *pst,
{ {
/* Throw away this psymtab, it's empty. */ /* Throw away this psymtab, it's empty. */
/* Empty psymtabs happen as a result of header files which don't have /* Empty psymtabs happen as a result of header files which don't have
any symbols in them. There can be a lot of them. But this check any symbols in them. There can be a lot of them. But this check
is wrong, in that a psymtab with N_SLINE entries but nothing else is wrong, in that a psymtab with N_SLINE entries but nothing else
is not empty, but we don't realize that. Fixing that without slowing is not empty, but we don't realize that. Fixing that without slowing
things down might be tricky. */ things down might be tricky. */
objfile->partial_symtabs->discard_psymtab (pst); objfile->partial_symtabs->discard_psymtab (pst);
@@ -2113,7 +2113,7 @@ dbx_read_symtab (legacy_psymtab *self, struct objfile *objfile)
} }
/* Match with global symbols. This only needs to be done once, /* Match with global symbols. This only needs to be done once,
after all of the symtabs and dependencies have been read in. */ after all of the symtabs and dependencies have been read in. */
scan_file_globals (objfile); scan_file_globals (objfile);
} }
} }
@@ -2185,8 +2185,8 @@ read_ofile_symtab (struct objfile *objfile, legacy_psymtab *pst)
else else
{ {
/* The N_SO starting this symtab is the first symbol, so we /* The N_SO starting this symtab is the first symbol, so we
better not check the symbol before it. I'm not this can better not check the symbol before it. I'm not this can
happen, but it doesn't hurt to check for it. */ happen, but it doesn't hurt to check for it. */
stabs_seek (sym_offset); stabs_seek (sym_offset);
processing_gcc_compilation = 0; processing_gcc_compilation = 0;
} }
@@ -2234,7 +2234,7 @@ read_ofile_symtab (struct objfile *objfile, legacy_psymtab *pst)
PST_LANGUAGE (pst)); PST_LANGUAGE (pst));
} }
/* We skip checking for a new .o or -l file; that should never /* We skip checking for a new .o or -l file; that should never
happen in this routine. */ happen in this routine. */
else if (type == N_TEXT) else if (type == N_TEXT)
{ {
/* I don't think this code will ever be executed, because /* I don't think this code will ever be executed, because
@@ -2365,9 +2365,9 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name,
if (get_last_source_file () == NULL && type != (unsigned char) N_SO) if (get_last_source_file () == NULL && type != (unsigned char) N_SO)
{ {
/* Ignore any symbols which appear before an N_SO symbol. /* Ignore any symbols which appear before an N_SO symbol.
Currently no one puts symbols there, but we should deal Currently no one puts symbols there, but we should deal
gracefully with the case. A complain()t might be in order, gracefully with the case. A complain()t might be in order,
but this should not be an error (). */ but this should not be an error (). */
return; return;
} }
@@ -2430,7 +2430,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name,
case N_LBRAC: case N_LBRAC:
/* This "symbol" just indicates the start of an inner lexical /* This "symbol" just indicates the start of an inner lexical
context within a function. */ context within a function. */
/* Ignore extra outermost context from SunPRO cc and acc. */ /* Ignore extra outermost context from SunPRO cc and acc. */
if (n_opt_found && desc == 1) if (n_opt_found && desc == 1)
@@ -2443,7 +2443,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name,
case N_RBRAC: case N_RBRAC:
/* This "symbol" just indicates the end of an inner lexical /* This "symbol" just indicates the end of an inner lexical
context that was started with N_LBRAC. */ context that was started with N_LBRAC. */
/* Ignore extra outermost context from SunPRO cc and acc. */ /* Ignore extra outermost context from SunPRO cc and acc. */
if (n_opt_found && desc == 1) if (n_opt_found && desc == 1)
@@ -2509,15 +2509,15 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name,
case N_FN: case N_FN:
case N_FN_SEQ: case N_FN_SEQ:
/* This kind of symbol indicates the start of an object file. /* This kind of symbol indicates the start of an object file.
Relocate for dynamic loading. */ Relocate for dynamic loading. */
valu += section_offsets[SECT_OFF_TEXT (objfile)]; valu += section_offsets[SECT_OFF_TEXT (objfile)];
break; break;
case N_SO: case N_SO:
/* This type of symbol indicates the start of data for one /* This type of symbol indicates the start of data for one
source file. Finish the symbol table of the previous source source file. Finish the symbol table of the previous source
file (if any) and start accumulating a new symbol table. file (if any) and start accumulating a new symbol table.
Relocate for dynamic loading. */ Relocate for dynamic loading. */
valu += section_offsets[SECT_OFF_TEXT (objfile)]; valu += section_offsets[SECT_OFF_TEXT (objfile)];
n_opt_found = 0; n_opt_found = 0;
@@ -2538,7 +2538,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name,
} }
/* Null name means this just marks the end of text for this .o /* Null name means this just marks the end of text for this .o
file. Don't start a new symtab in this case. */ file. Don't start a new symtab in this case. */
if (*name == '\000') if (*name == '\000')
break; break;
@@ -2551,9 +2551,9 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name,
case N_SOL: case N_SOL:
/* This type of symbol indicates the start of data for a /* This type of symbol indicates the start of data for a
sub-source-file, one whose contents were copied or included sub-source-file, one whose contents were copied or included
in the compilation of the main source file (whose name was in the compilation of the main source file (whose name was
given in the N_SO symbol). Relocate for dynamic loading. */ given in the N_SO symbol). Relocate for dynamic loading. */
valu += section_offsets[SECT_OFF_TEXT (objfile)]; valu += section_offsets[SECT_OFF_TEXT (objfile)];
start_subfile (name); start_subfile (name);
break; break;
@@ -2574,11 +2574,11 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name,
case N_SLINE: case N_SLINE:
/* This type of "symbol" really just records one line-number -- /* This type of "symbol" really just records one line-number --
core-address correspondence. Enter it in the line list for core-address correspondence. Enter it in the line list for
this symbol table. */ this symbol table. */
/* Relocate for dynamic loading and for ELF acc /* Relocate for dynamic loading and for ELF acc
function-relative symbols. */ function-relative symbols. */
valu += function_start_offset; valu += function_start_offset;
/* GCC 2.95.3 emits the first N_SLINE stab somewhere in the /* GCC 2.95.3 emits the first N_SLINE stab somewhere in the
@@ -2618,22 +2618,22 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name,
break; break;
/* The following symbol types need to have the appropriate /* The following symbol types need to have the appropriate
offset added to their value; then we process symbol offset added to their value; then we process symbol
definitions in the name. */ definitions in the name. */
case N_STSYM: /* Static symbol in data segment. */ case N_STSYM: /* Static symbol in data segment. */
case N_LCSYM: /* Static symbol in BSS segment. */ case N_LCSYM: /* Static symbol in BSS segment. */
case N_ROSYM: /* Static symbol in read-only data segment. */ case N_ROSYM: /* Static symbol in read-only data segment. */
/* HORRID HACK DEPT. However, it's Sun's furgin' fault. /* HORRID HACK DEPT. However, it's Sun's furgin' fault.
Solaris 2's stabs-in-elf makes *most* symbols relative but Solaris 2's stabs-in-elf makes *most* symbols relative but
leaves a few absolute (at least for Solaris 2.1 and version leaves a few absolute (at least for Solaris 2.1 and version
2.0.1 of the SunPRO compiler). N_STSYM and friends sit on 2.0.1 of the SunPRO compiler). N_STSYM and friends sit on
the fence. .stab "foo:S...",N_STSYM is absolute (ld the fence. .stab "foo:S...",N_STSYM is absolute (ld
relocates it) .stab "foo:V...",N_STSYM is relative (section relocates it) .stab "foo:V...",N_STSYM is relative (section
base subtracted). This leaves us no choice but to search for base subtracted). This leaves us no choice but to search for
the 'S' or 'V'... (or pass the whole section_offsets stuff the 'S' or 'V'... (or pass the whole section_offsets stuff
down ONE MORE function call level, which we really don't want down ONE MORE function call level, which we really don't want
to do). */ to do). */
{ {
const char *p; const char *p;
@@ -2659,7 +2659,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name,
} }
} }
/* Since it's not the kludge case, re-dispatch to the right /* Since it's not the kludge case, re-dispatch to the right
handler. */ handler. */
switch (type) switch (type)
{ {
case N_STSYM: case N_STSYM:
@@ -2695,8 +2695,8 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name,
goto define_a_symbol; goto define_a_symbol;
/* The following symbol types we don't know how to process. /* The following symbol types we don't know how to process.
Handle them in a "default" way, but complain to people who Handle them in a "default" way, but complain to people who
care. */ care. */
default: default:
case N_CATCH: /* Exception handler catcher. */ case N_CATCH: /* Exception handler catcher. */
case N_EHDECL: /* Exception handler name. */ case N_EHDECL: /* Exception handler name. */
@@ -2715,7 +2715,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name,
define_a_symbol: define_a_symbol:
/* These symbol types don't need the address field relocated, /* These symbol types don't need the address field relocated,
since it is either unused, or is absolute. */ since it is either unused, or is absolute. */
case N_GSYM: /* Global variable. */ case N_GSYM: /* Global variable. */
case N_NSYMS: /* Number of symbols (Ultrix). */ case N_NSYMS: /* Number of symbols (Ultrix). */
case N_NOMAP: /* No map? (Ultrix). */ case N_NOMAP: /* No map? (Ultrix). */
@@ -2740,7 +2740,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name,
case 'f': case 'f':
case 'F': case 'F':
/* Deal with the SunPRO 3.0 compiler which omits the /* Deal with the SunPRO 3.0 compiler which omits the
address from N_FUN symbols. */ address from N_FUN symbols. */
if (type == N_FUN if (type == N_FUN
&& valu == section_offsets[SECT_OFF_TEXT (objfile)] && valu == section_offsets[SECT_OFF_TEXT (objfile)]
&& gdbarch_sofun_address_maybe_missing (gdbarch)) && gdbarch_sofun_address_maybe_missing (gdbarch))
@@ -2792,8 +2792,8 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name,
break; break;
/* We use N_OPT to carry the gcc2_compiled flag. Sun uses it /* We use N_OPT to carry the gcc2_compiled flag. Sun uses it
for a bunch of other flags, too. Someday we may parse their for a bunch of other flags, too. Someday we may parse their
flags; for now we ignore theirs and hope they'll ignore ours. */ flags; for now we ignore theirs and hope they'll ignore ours. */
case N_OPT: /* Solaris 2: Compiler options. */ case N_OPT: /* Solaris 2: Compiler options. */
if (name) if (name)
{ {
@@ -2824,7 +2824,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name,
case N_PATCH: /* Solaris 2: Patch Run Time Checker. */ case N_PATCH: /* Solaris 2: Patch Run Time Checker. */
/* N_UNDF: Solaris 2: File separator mark. */ /* N_UNDF: Solaris 2: File separator mark. */
/* N_UNDF: -- we will never encounter it, since we only process /* N_UNDF: -- we will never encounter it, since we only process
one file's symbols at once. */ one file's symbols at once. */
case N_ENDM: /* Solaris 2: End of module. */ case N_ENDM: /* Solaris 2: End of module. */
case N_ALIAS: /* SunPro F77: alias name, ignore for now. */ case N_ALIAS: /* SunPro F77: alias name, ignore for now. */
break; break;
@@ -2839,17 +2839,17 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name,
if (name[0] == '#') if (name[0] == '#')
{ {
/* Initialize symbol reference names and determine if this is a /* Initialize symbol reference names and determine if this is a
definition. If a symbol reference is being defined, go ahead definition. If a symbol reference is being defined, go ahead
and add it. Otherwise, just return. */ and add it. Otherwise, just return. */
const char *s = name; const char *s = name;
int refnum; int refnum;
/* If this stab defines a new reference ID that is not on the /* If this stab defines a new reference ID that is not on the
reference list, then put it on the reference list. reference list, then put it on the reference list.
We go ahead and advance NAME past the reference, even though We go ahead and advance NAME past the reference, even though
it is not strictly necessary at this time. */ it is not strictly necessary at this time. */
refnum = symbol_reference_defined (&s); refnum = symbol_reference_defined (&s);
if (refnum >= 0) if (refnum >= 0)
if (!ref_search (refnum)) if (!ref_search (refnum))

View File

@@ -324,7 +324,7 @@ dcache_read_line (DCACHE *dcache, struct dcache_block *db)
reg_len = region->hi - memaddr; reg_len = region->hi - memaddr;
/* Skip non-readable regions. The cache attribute can be ignored, /* Skip non-readable regions. The cache attribute can be ignored,
since we may be loading this for a stack access. */ since we may be loading this for a stack access. */
if (region->attrib.mode == MEM_WO) if (region->attrib.mode == MEM_WO)
{ {
memaddr += reg_len; memaddr += reg_len;
@@ -401,7 +401,7 @@ dcache_peek_byte (DCACHE *dcache, CORE_ADDR addr, gdb_byte *ptr)
db = dcache_alloc (dcache, addr); db = dcache_alloc (dcache, addr);
if (!dcache_read_line (dcache, db)) if (!dcache_read_line (dcache, db))
return 0; return 0;
} }
*ptr = db->data[XFORM (dcache, addr)]; *ptr = db->data[XFORM (dcache, addr)];
@@ -597,7 +597,7 @@ dcache_info_1 (DCACHE *dcache, const char *exp)
if (linestart == exp || i < 0) if (linestart == exp || i < 0)
{ {
printf_filtered (_("Usage: info dcache [LINENUMBER]\n")); printf_filtered (_("Usage: info dcache [LINENUMBER]\n"));
return; return;
} }
dcache_print_line (dcache, i); dcache_print_line (dcache, i);

View File

@@ -176,14 +176,14 @@ line_is_less_than (const deprecated_dis_line_entry &mle1,
if (mle1.start_pc != mle2.start_pc) if (mle1.start_pc != mle2.start_pc)
val = mle1.start_pc < mle2.start_pc; val = mle1.start_pc < mle2.start_pc;
else else
val = mle1.line < mle2.line; val = mle1.line < mle2.line;
} }
else else
{ {
if (mle1.line != mle2.line) if (mle1.line != mle2.line)
val = mle1.line < mle2.line; val = mle1.line < mle2.line;
else else
val = mle1.start_pc < mle2.start_pc; val = mle1.start_pc < mle2.start_pc;
} }
return val; return val;
} }
@@ -238,7 +238,7 @@ gdb_pretty_print_disassembler::pretty_print_insn (const struct disasm_insn *insn
std::string name, filename; std::string name, filename;
bool omit_fname = ((flags & DISASSEMBLY_OMIT_FNAME) != 0); bool omit_fname = ((flags & DISASSEMBLY_OMIT_FNAME) != 0);
if (!build_address_symbolic (gdbarch, pc, false, omit_fname, &name, if (!build_address_symbolic (gdbarch, pc, false, omit_fname, &name,
&offset, &filename, &line, &unmapped)) &offset, &filename, &line, &unmapped))
{ {
/* We don't care now about line, filename and unmapped. But we might in /* We don't care now about line, filename and unmapped. But we might in
the future. */ the future. */
@@ -460,7 +460,7 @@ do_mixed_source_and_assembly_deprecated
how_many, flags, NULL); how_many, flags, NULL);
/* When we've reached the end of the mle array, or we've seen the last /* When we've reached the end of the mle array, or we've seen the last
assembly range for this source line, close out the list/tuple. */ assembly range for this source line, close out the list/tuple. */
if (i == (newlines - 1) || mle[i + 1].line > mle[i].line) if (i == (newlines - 1) || mle[i + 1].line > mle[i].line)
{ {
inner_list_emitter.reset (); inner_list_emitter.reset ();

View File

@@ -462,8 +462,8 @@ dtrace_process_dof_probe (struct objfile *objfile,
int probe_argc = DOF_UINT (dof, probe->dofpr_nargc); int probe_argc = DOF_UINT (dof, probe->dofpr_nargc);
/* Store argument type descriptions. A description of the type /* Store argument type descriptions. A description of the type
of the argument is in the (J+1)th null-terminated string of the argument is in the (J+1)th null-terminated string
starting at 'strtab' + 'probe->dofpr_nargv'. */ starting at 'strtab' + 'probe->dofpr_nargv'. */
std::vector<struct dtrace_probe_arg> args; std::vector<struct dtrace_probe_arg> args;
p = strtab + DOF_UINT (dof, probe->dofpr_nargv); p = strtab + DOF_UINT (dof, probe->dofpr_nargv);
for (j = 0; j < probe_argc; j++) for (j = 0; j < probe_argc; j++)
@@ -481,7 +481,7 @@ dtrace_process_dof_probe (struct objfile *objfile,
/* Try to parse a type expression from the type string. If /* Try to parse a type expression from the type string. If
this does not work then we set the type to `long this does not work then we set the type to `long
int'. */ int'. */
struct type *type = builtin_type (gdbarch)->builtin_long; struct type *type = builtin_type (gdbarch)->builtin_long;
try try
{ {
@@ -856,8 +856,8 @@ dtrace_static_probe_ops::get_probes
extract the information of any probe defined into it. */ extract the information of any probe defined into it. */
if (bfd_malloc_and_get_section (abfd, sect, &dof) && dof != NULL) if (bfd_malloc_and_get_section (abfd, sect, &dof) && dof != NULL)
dtrace_process_dof (sect, objfile, probesp, dtrace_process_dof (sect, objfile, probesp,
(struct dtrace_dof_hdr *) dof); (struct dtrace_dof_hdr *) dof);
else else
complaint (_("could not obtain the contents of" complaint (_("could not obtain the contents of"
"section '%s' in objfile `%s'."), "section '%s' in objfile `%s'."),
bfd_section_name (sect), bfd_get_filename (abfd)); bfd_section_name (sect), bfd_get_filename (abfd));

View File

@@ -165,12 +165,12 @@ abbrev_table::read (struct objfile *objfile,
abbrev_table->add_abbrev (cur_abbrev); abbrev_table->add_abbrev (cur_abbrev);
/* Get next abbreviation. /* Get next abbreviation.
Under Irix6 the abbreviations for a compilation unit are not Under Irix6 the abbreviations for a compilation unit are not
always properly terminated with an abbrev number of 0. always properly terminated with an abbrev number of 0.
Exit loop if we encounter an abbreviation which we have Exit loop if we encounter an abbreviation which we have
already read (which means we are about to read the abbreviations already read (which means we are about to read the abbreviations
for the next compile unit) or if the end of the abbreviation for the next compile unit) or if the end of the abbreviation
table is reached. */ table is reached. */
if ((unsigned int) (abbrev_ptr - section->buffer) >= section->size) if ((unsigned int) (abbrev_ptr - section->buffer) >= section->size)
break; break;
abbrev_number = read_unsigned_leb128 (abfd, abbrev_ptr, &bytes_read); abbrev_number = read_unsigned_leb128 (abfd, abbrev_ptr, &bytes_read);

View File

@@ -107,7 +107,7 @@ bool
attribute::form_is_section_offset () const attribute::form_is_section_offset () const
{ {
return (form == DW_FORM_data4 return (form == DW_FORM_data4
|| form == DW_FORM_data8 || form == DW_FORM_data8
|| form == DW_FORM_sec_offset || form == DW_FORM_sec_offset
|| form == DW_FORM_loclistx); || form == DW_FORM_loclistx);
} }

View File

@@ -859,8 +859,8 @@ dwarf_expr_context::execute_stack_op (const gdb_byte *op_ptr,
stack.clear (); stack.clear ();
/* FIXME: cagney/2003-03-26: This code should be using /* FIXME: cagney/2003-03-26: This code should be using
get_frame_base_address(), and then implement a dwarf2 get_frame_base_address(), and then implement a dwarf2
specific this_base method. */ specific this_base method. */
this->get_frame_base (&datastart, &datalen); this->get_frame_base (&datastart, &datalen);
eval (datastart, datalen); eval (datastart, datalen);
if (this->location == DWARF_VALUE_MEMORY) if (this->location == DWARF_VALUE_MEMORY)
@@ -1040,7 +1040,7 @@ dwarf_expr_context::execute_stack_op (const gdb_byte *op_ptr,
break; break;
case DW_OP_div: case DW_OP_div:
result_val = value_binop (first, second, BINOP_DIV); result_val = value_binop (first, second, BINOP_DIV);
break; break;
case DW_OP_minus: case DW_OP_minus:
result_val = value_binop (first, second, BINOP_SUB); result_val = value_binop (first, second, BINOP_SUB);
break; break;
@@ -1100,7 +1100,7 @@ dwarf_expr_context::execute_stack_op (const gdb_byte *op_ptr,
with. */ with. */
if (value_type (result_val) != value_type (second)) if (value_type (result_val) != value_type (second))
result_val = value_cast (value_type (second), result_val); result_val = value_cast (value_type (second), result_val);
break; break;
case DW_OP_shra: case DW_OP_shra:
dwarf_require_integral (value_type (first)); dwarf_require_integral (value_type (first));
dwarf_require_integral (value_type (second)); dwarf_require_integral (value_type (second));
@@ -1202,38 +1202,38 @@ dwarf_expr_context::execute_stack_op (const gdb_byte *op_ptr,
case DW_OP_nop: case DW_OP_nop:
goto no_push; goto no_push;
case DW_OP_piece: case DW_OP_piece:
{ {
uint64_t size; uint64_t size;
/* Record the piece. */ /* Record the piece. */
op_ptr = safe_read_uleb128 (op_ptr, op_end, &size); op_ptr = safe_read_uleb128 (op_ptr, op_end, &size);
add_piece (8 * size, 0); add_piece (8 * size, 0);
/* Pop off the address/regnum, and reset the location /* Pop off the address/regnum, and reset the location
type. */ type. */
if (this->location != DWARF_VALUE_LITERAL if (this->location != DWARF_VALUE_LITERAL
&& this->location != DWARF_VALUE_OPTIMIZED_OUT) && this->location != DWARF_VALUE_OPTIMIZED_OUT)
pop (); pop ();
this->location = DWARF_VALUE_MEMORY; this->location = DWARF_VALUE_MEMORY;
} }
goto no_push; goto no_push;
case DW_OP_bit_piece: case DW_OP_bit_piece:
{ {
uint64_t size, uleb_offset; uint64_t size, uleb_offset;
/* Record the piece. */ /* Record the piece. */
op_ptr = safe_read_uleb128 (op_ptr, op_end, &size); op_ptr = safe_read_uleb128 (op_ptr, op_end, &size);
op_ptr = safe_read_uleb128 (op_ptr, op_end, &uleb_offset); op_ptr = safe_read_uleb128 (op_ptr, op_end, &uleb_offset);
add_piece (size, uleb_offset); add_piece (size, uleb_offset);
/* Pop off the address/regnum, and reset the location /* Pop off the address/regnum, and reset the location
type. */ type. */
if (this->location != DWARF_VALUE_LITERAL if (this->location != DWARF_VALUE_LITERAL
&& this->location != DWARF_VALUE_OPTIMIZED_OUT) && this->location != DWARF_VALUE_OPTIMIZED_OUT)
pop (); pop ();
this->location = DWARF_VALUE_MEMORY; this->location = DWARF_VALUE_MEMORY;
} }
goto no_push; goto no_push;
@@ -1267,7 +1267,7 @@ dwarf_expr_context::execute_stack_op (const gdb_byte *op_ptr,
{ {
sect_offset sect_off sect_offset sect_off
= (sect_offset) extract_unsigned_integer (op_ptr, = (sect_offset) extract_unsigned_integer (op_ptr,
this->ref_addr_size, this->ref_addr_size,
byte_order); byte_order);
op_ptr += this->ref_addr_size; op_ptr += this->ref_addr_size;
result_val = value_cast (address_type, result_val = value_cast (address_type,

View File

@@ -492,7 +492,7 @@ bad CFI data; mismatched DW_CFA_restore_state at %s"),
case DW_CFA_def_cfa_register: case DW_CFA_def_cfa_register:
insn_ptr = safe_read_uleb128 (insn_ptr, insn_end, &reg); insn_ptr = safe_read_uleb128 (insn_ptr, insn_end, &reg);
fs->regs.cfa_reg = dwarf2_frame_adjust_regnum (gdbarch, reg, fs->regs.cfa_reg = dwarf2_frame_adjust_regnum (gdbarch, reg,
eh_frame_p); eh_frame_p);
fs->regs.cfa_how = CFA_REG_OFFSET; fs->regs.cfa_how = CFA_REG_OFFSET;
break; break;
@@ -569,7 +569,7 @@ bad CFI data; mismatched DW_CFA_restore_state at %s"),
case DW_CFA_def_cfa_sf: case DW_CFA_def_cfa_sf:
insn_ptr = safe_read_uleb128 (insn_ptr, insn_end, &reg); insn_ptr = safe_read_uleb128 (insn_ptr, insn_end, &reg);
fs->regs.cfa_reg = dwarf2_frame_adjust_regnum (gdbarch, reg, fs->regs.cfa_reg = dwarf2_frame_adjust_regnum (gdbarch, reg,
eh_frame_p); eh_frame_p);
insn_ptr = safe_read_sleb128 (insn_ptr, insn_end, &offset); insn_ptr = safe_read_sleb128 (insn_ptr, insn_end, &offset);
fs->regs.cfa_offset = offset * fs->data_align; fs->regs.cfa_offset = offset * fs->data_align;
fs->regs.cfa_how = CFA_REG_OFFSET; fs->regs.cfa_how = CFA_REG_OFFSET;
@@ -1159,12 +1159,12 @@ incomplete CFI data; unspecified registers (e.g., %s) at %s"),
ULONGEST retaddr_column = fs.retaddr_column; ULONGEST retaddr_column = fs.retaddr_column;
/* It seems rather bizarre to specify an "empty" column as /* It seems rather bizarre to specify an "empty" column as
the return adress column. However, this is exactly the return adress column. However, this is exactly
what GCC does on some targets. It turns out that GCC what GCC does on some targets. It turns out that GCC
assumes that the return address can be found in the assumes that the return address can be found in the
register corresponding to the return address column. register corresponding to the return address column.
Incidentally, that's how we should treat a return Incidentally, that's how we should treat a return
address column specifying "same value" too. */ address column specifying "same value" too. */
if (fs.retaddr_column < fs.regs.reg.size () if (fs.retaddr_column < fs.regs.reg.size ()
&& regs[retaddr_column].how != DWARF2_FRAME_REG_UNSPECIFIED && regs[retaddr_column].how != DWARF2_FRAME_REG_UNSPECIFIED
&& regs[retaddr_column].how != DWARF2_FRAME_REG_SAME_VALUE) && regs[retaddr_column].how != DWARF2_FRAME_REG_SAME_VALUE)
@@ -1461,13 +1461,13 @@ dwarf2_frame_cfa (struct frame_info *this_frame)
this_frame = get_prev_frame (this_frame); this_frame = get_prev_frame (this_frame);
if (get_frame_unwind_stop_reason (this_frame) == UNWIND_UNAVAILABLE) if (get_frame_unwind_stop_reason (this_frame) == UNWIND_UNAVAILABLE)
throw_error (NOT_AVAILABLE_ERROR, throw_error (NOT_AVAILABLE_ERROR,
_("can't compute CFA for this frame: " _("can't compute CFA for this frame: "
"required registers or memory are unavailable")); "required registers or memory are unavailable"));
if (get_frame_id (this_frame).stack_status != FID_STACK_VALID) if (get_frame_id (this_frame).stack_status != FID_STACK_VALID)
throw_error (NOT_AVAILABLE_ERROR, throw_error (NOT_AVAILABLE_ERROR,
_("can't compute CFA for this frame: " _("can't compute CFA for this frame: "
"frame base not available")); "frame base not available"));
return get_frame_base (this_frame); return get_frame_base (this_frame);
} }
@@ -1684,19 +1684,19 @@ dwarf2_frame_find_fde (CORE_ADDR *pc, dwarf2_per_objfile **out_per_objfile)
gdb_assert (!fde_table->empty ()); gdb_assert (!fde_table->empty ());
if (*pc < offset + (*fde_table)[0]->initial_location) if (*pc < offset + (*fde_table)[0]->initial_location)
continue; continue;
seek_pc = *pc - offset; seek_pc = *pc - offset;
auto it = gdb::binary_search (fde_table->begin (), fde_table->end (), auto it = gdb::binary_search (fde_table->begin (), fde_table->end (),
seek_pc, bsearch_fde_cmp); seek_pc, bsearch_fde_cmp);
if (it != fde_table->end ()) if (it != fde_table->end ())
{ {
*pc = (*it)->initial_location + offset; *pc = (*it)->initial_location + offset;
if (out_per_objfile != nullptr) if (out_per_objfile != nullptr)
*out_per_objfile = get_dwarf2_per_objfile (objfile); *out_per_objfile = get_dwarf2_per_objfile (objfile);
return *it; return *it;
} }
} }
return NULL; return NULL;
} }
@@ -1739,9 +1739,9 @@ static const gdb_byte *
decode_frame_entry_1 (struct gdbarch *gdbarch, decode_frame_entry_1 (struct gdbarch *gdbarch,
struct comp_unit *unit, const gdb_byte *start, struct comp_unit *unit, const gdb_byte *start,
int eh_frame_p, int eh_frame_p,
dwarf2_cie_table &cie_table, dwarf2_cie_table &cie_table,
dwarf2_fde_table *fde_table, dwarf2_fde_table *fde_table,
enum eh_frame_type entry_type) enum eh_frame_type entry_type)
{ {
const gdb_byte *buf, *end; const gdb_byte *buf, *end;
ULONGEST length; ULONGEST length;
@@ -1809,7 +1809,7 @@ decode_frame_entry_1 (struct gdbarch *gdbarch,
cie->cie_pointer = cie_pointer; cie->cie_pointer = cie_pointer;
/* The encoding for FDE's in a normal .debug_frame section /* The encoding for FDE's in a normal .debug_frame section
depends on the target address size. */ depends on the target address size. */
cie->encoding = DW_EH_PE_absptr; cie->encoding = DW_EH_PE_absptr;
/* We'll determine the final value later, but we need to /* We'll determine the final value later, but we need to
@@ -1833,8 +1833,8 @@ decode_frame_entry_1 (struct gdbarch *gdbarch,
augmentation += strlen (augmentation); augmentation += strlen (augmentation);
/* The GCC 2.x "eh" augmentation has a pointer immediately /* The GCC 2.x "eh" augmentation has a pointer immediately
following the augmentation string, so it must be handled following the augmentation string, so it must be handled
first. */ first. */
if (augmentation[0] == 'e' && augmentation[1] == 'h') if (augmentation[0] == 'e' && augmentation[1] == 'h')
{ {
/* Skip. */ /* Skip. */
@@ -2043,8 +2043,8 @@ decode_frame_entry (struct gdbarch *gdbarch,
struct comp_unit *unit, const gdb_byte *start, struct comp_unit *unit, const gdb_byte *start,
int eh_frame_p, int eh_frame_p,
dwarf2_cie_table &cie_table, dwarf2_cie_table &cie_table,
dwarf2_fde_table *fde_table, dwarf2_fde_table *fde_table,
enum eh_frame_type entry_type) enum eh_frame_type entry_type)
{ {
enum { NONE, ALIGN4, ALIGN8, FAIL } workaround = NONE; enum { NONE, ALIGN4, ALIGN8, FAIL } workaround = NONE;
const gdb_byte *ret; const gdb_byte *ret;
@@ -2139,13 +2139,13 @@ fde_is_less_than (const dwarf2_fde *aa, const dwarf2_fde *bb)
if (aa->initial_location == bb->initial_location) if (aa->initial_location == bb->initial_location)
{ {
if (aa->address_range != bb->address_range if (aa->address_range != bb->address_range
&& aa->eh_frame_p == 0 && bb->eh_frame_p == 0) && aa->eh_frame_p == 0 && bb->eh_frame_p == 0)
/* Linker bug, e.g. gold/10400. /* Linker bug, e.g. gold/10400.
Work around it by keeping stable sort order. */ Work around it by keeping stable sort order. */
return aa < bb; return aa < bb;
else else
/* Put eh_frame entries after debug_frame ones. */ /* Put eh_frame entries after debug_frame ones. */
return aa->eh_frame_p < bb->eh_frame_p; return aa->eh_frame_p < bb->eh_frame_p;
} }
return aa->initial_location < bb->initial_location; return aa->initial_location < bb->initial_location;
@@ -2166,28 +2166,28 @@ dwarf2_build_frame_info (struct objfile *objfile)
if (objfile->separate_debug_objfile_backlink == NULL) if (objfile->separate_debug_objfile_backlink == NULL)
{ {
/* Do not read .eh_frame from separate file as they must be also /* Do not read .eh_frame from separate file as they must be also
present in the main file. */ present in the main file. */
dwarf2_get_section_info (objfile, DWARF2_EH_FRAME, dwarf2_get_section_info (objfile, DWARF2_EH_FRAME,
&unit->dwarf_frame_section, &unit->dwarf_frame_section,
&unit->dwarf_frame_buffer, &unit->dwarf_frame_buffer,
&unit->dwarf_frame_size); &unit->dwarf_frame_size);
if (unit->dwarf_frame_size) if (unit->dwarf_frame_size)
{ {
asection *got, *txt; asection *got, *txt;
/* FIXME: kettenis/20030602: This is the DW_EH_PE_datarel base /* FIXME: kettenis/20030602: This is the DW_EH_PE_datarel base
that is used for the i386/amd64 target, which currently is that is used for the i386/amd64 target, which currently is
the only target in GCC that supports/uses the the only target in GCC that supports/uses the
DW_EH_PE_datarel encoding. */ DW_EH_PE_datarel encoding. */
got = bfd_get_section_by_name (unit->abfd, ".got"); got = bfd_get_section_by_name (unit->abfd, ".got");
if (got) if (got)
unit->dbase = got->vma; unit->dbase = got->vma;
/* GCC emits the DW_EH_PE_textrel encoding type on sh and ia64 /* GCC emits the DW_EH_PE_textrel encoding type on sh and ia64
so far. */ so far. */
txt = bfd_get_section_by_name (unit->abfd, ".text"); txt = bfd_get_section_by_name (unit->abfd, ".text");
if (txt) if (txt)
unit->tbase = txt->vma; unit->tbase = txt->vma;
try try
{ {
@@ -2209,13 +2209,13 @@ dwarf2_build_frame_info (struct objfile *objfile)
} }
cie_table.clear (); cie_table.clear ();
} }
} }
dwarf2_get_section_info (objfile, DWARF2_DEBUG_FRAME, dwarf2_get_section_info (objfile, DWARF2_DEBUG_FRAME,
&unit->dwarf_frame_section, &unit->dwarf_frame_section,
&unit->dwarf_frame_buffer, &unit->dwarf_frame_buffer,
&unit->dwarf_frame_size); &unit->dwarf_frame_size);
if (unit->dwarf_frame_size) if (unit->dwarf_frame_size)
{ {
size_t num_old_fde_entries = fde_table.size (); size_t num_old_fde_entries = fde_table.size ();

View File

@@ -144,11 +144,11 @@ index_cache::store (dwarf2_per_objfile *per_objfile)
} }
if (debug_index_cache) if (debug_index_cache)
printf_unfiltered ("index cache: writing index cache for objfile %s\n", printf_unfiltered ("index cache: writing index cache for objfile %s\n",
objfile_name (obj)); objfile_name (obj));
/* Write the index itself to the directory, using the build id as the /* Write the index itself to the directory, using the build id as the
filename. */ filename. */
write_psymtabs_to_index (per_objfile, m_dir.c_str (), write_psymtabs_to_index (per_objfile, m_dir.c_str (),
build_id_str.c_str (), dwz_build_id_ptr, build_id_str.c_str (), dwz_build_id_ptr,
dw_index_kind::GDB_INDEX); dw_index_kind::GDB_INDEX);
@@ -198,7 +198,7 @@ index_cache::lookup_gdb_index (const bfd_build_id *build_id,
try try
{ {
if (debug_index_cache) if (debug_index_cache)
printf_unfiltered ("index cache: trying to read %s\n", printf_unfiltered ("index cache: trying to read %s\n",
filename.c_str ()); filename.c_str ());
/* Try to map that file. */ /* Try to map that file. */

View File

@@ -57,7 +57,7 @@
#define DW2_GDB_INDEX_SYMBOL_KIND_SET_VALUE(cu_index, value) \ #define DW2_GDB_INDEX_SYMBOL_KIND_SET_VALUE(cu_index, value) \
do { \ do { \
gdb_assert ((value) >= GDB_INDEX_SYMBOL_KIND_TYPE \ gdb_assert ((value) >= GDB_INDEX_SYMBOL_KIND_TYPE \
&& (value) <= GDB_INDEX_SYMBOL_KIND_OTHER); \ && (value) <= GDB_INDEX_SYMBOL_KIND_OTHER); \
GDB_INDEX_SYMBOL_KIND_SET_VALUE((cu_index), (value)); \ GDB_INDEX_SYMBOL_KIND_SET_VALUE((cu_index), (value)); \
} while (0) } while (0)
@@ -594,7 +594,7 @@ write_psymbols (struct mapped_symtab *symtab,
struct signatured_type_index_data struct signatured_type_index_data
{ {
signatured_type_index_data (data_buf &types_list_, signatured_type_index_data (data_buf &types_list_,
std::unordered_set<partial_symbol *> &psyms_seen_) std::unordered_set<partial_symbol *> &psyms_seen_)
: types_list (types_list_), psyms_seen (psyms_seen_) : types_list (types_list_), psyms_seen (psyms_seen_)
{} {}
@@ -941,7 +941,7 @@ public:
{ {
public: public:
write_one_signatured_type_data (debug_names &nametable_, write_one_signatured_type_data (debug_names &nametable_,
signatured_type_index_data &&info_) signatured_type_index_data &&info_)
: nametable (nametable_), info (std::move (info_)) : nametable (nametable_), info (std::move (info_))
{} {}
debug_names &nametable; debug_names &nametable;
@@ -1069,7 +1069,7 @@ private:
symbol_value (int dwarf_tag_, int cu_index_, bool is_static_, symbol_value (int dwarf_tag_, int cu_index_, bool is_static_,
unit_kind kind_) unit_kind kind_)
: dwarf_tag (dwarf_tag_), cu_index (cu_index_), is_static (is_static_), : dwarf_tag (dwarf_tag_), cu_index (cu_index_), is_static (is_static_),
kind (kind_) kind (kind_)
{} {}
bool bool

View File

@@ -32,9 +32,9 @@ line_header::add_include_dir (const char *include_dir)
{ {
size_t new_size; size_t new_size;
if (version >= 5) if (version >= 5)
new_size = m_include_dirs.size (); new_size = m_include_dirs.size ();
else else
new_size = m_include_dirs.size () + 1; new_size = m_include_dirs.size () + 1;
fprintf_unfiltered (gdb_stdlog, "Adding dir %zu: %s\n", fprintf_unfiltered (gdb_stdlog, "Adding dir %zu: %s\n",
new_size, include_dir); new_size, include_dir);
} }
@@ -51,9 +51,9 @@ line_header::add_file_name (const char *name,
{ {
size_t new_size; size_t new_size;
if (version >= 5) if (version >= 5)
new_size = file_names_size (); new_size = file_names_size ();
else else
new_size = file_names_size () + 1; new_size = file_names_size () + 1;
fprintf_unfiltered (gdb_stdlog, "Adding file %zu: %s\n", fprintf_unfiltered (gdb_stdlog, "Adding file %zu: %s\n",
new_size, name); new_size, name);
} }
@@ -82,15 +82,15 @@ line_header::file_file_name (int file) const
else else
{ {
/* The compiler produced a bogus file number. We can at least /* The compiler produced a bogus file number. We can at least
record the macro definitions made in the file, even if we record the macro definitions made in the file, even if we
won't be able to find the file by name. */ won't be able to find the file by name. */
char fake_name[80]; char fake_name[80];
xsnprintf (fake_name, sizeof (fake_name), xsnprintf (fake_name, sizeof (fake_name),
"<bad macro file number %d>", file); "<bad macro file number %d>", file);
complaint (_("bad file number in macro information (%d)"), complaint (_("bad file number in macro information (%d)"),
file); file);
return make_unique_xstrdup (fake_name); return make_unique_xstrdup (fake_name);
} }

Some files were not shown because too many files have changed in this diff Show More