diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2020-10-26 11:39:39 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2020-10-26 12:27:18 -0400 |
commit | 0fb7ea580dcad8d1e0c6d117a9722bb3d0c2449c (patch) | |
tree | 0bc7cd2428947c251a57b0a2349374716096f25d /gdb/stabsread.c | |
parent | 55c3ad8801359ecb166ff3c04c3bd14140f623a1 (diff) | |
download | binutils-users/simark/fix-leading-whitespace.zip binutils-users/simark/fix-leading-whitespace.tar.gz binutils-users/simark/fix-leading-whitespace.tar.bz2 |
gdb, gdbserver, gdbsupport: fix leading space vs tabs issuesusers/simark/fix-leading-whitespace
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
Diffstat (limited to 'gdb/stabsread.c')
-rw-r--r-- | gdb/stabsread.c | 624 |
1 files changed, 312 insertions, 312 deletions
diff --git a/gdb/stabsread.c b/gdb/stabsread.c index 9556263..da1d876 100644 --- a/gdb/stabsread.c +++ b/gdb/stabsread.c @@ -148,7 +148,7 @@ static int attach_fields_to_type (struct stab_field_info *, struct type *, struct objfile *); static struct type *read_struct_type (const char **, struct type *, - enum type_code, + enum type_code, struct objfile *); static struct type *read_array_type (const char **, struct type *, @@ -182,7 +182,7 @@ static void reg_value_complaint (int regnum, int num_regs, const char *sym) { complaint (_("bad register number %d (max %d) in symbol %s"), - regnum, num_regs - 1, sym); + regnum, num_regs - 1, sym); } static void @@ -281,7 +281,7 @@ dbx_lookup_type (int typenums[2], struct objfile *objfile) } /* Type is defined outside of header files. - Find it in this object file's type vector. */ + Find it in this object file's type vector. */ if (index >= type_vector_length) { old_len = type_vector_length; @@ -397,7 +397,7 @@ patch_block_stabs (struct pending *symbols, struct pending_stabs *stabs, if (stabs) { /* for all the stab entries, find their corresponding symbols and - patch their types! */ + patch their types! */ for (ii = 0; ii < stabs->count; ++ii) { @@ -413,16 +413,16 @@ patch_block_stabs (struct pending *symbols, struct pending_stabs *stabs, if (!sym) { /* FIXME-maybe: it would be nice if we noticed whether - the variable was defined *anywhere*, not just whether - it is defined in this compilation unit. But neither - xlc or GCC seem to need such a definition, and until - we do psymtabs (so that the minimal symbols from all - compilation units are available now), I'm not sure - how to get the information. */ + the variable was defined *anywhere*, not just whether + it is defined in this compilation unit. But neither + xlc or GCC seem to need such a definition, and until + we do psymtabs (so that the minimal symbols from all + compilation units are available now), I'm not sure + how to get the information. */ /* On xcoff, if a global is defined and never referenced, - ld will remove it from the executable. There is then - a N_GSYM stab for it, but no regular (C_EXT) symbol. */ + ld will remove it from the executable. There is then + a N_GSYM stab for it, but no regular (C_EXT) symbol. */ sym = new (&objfile->objfile_obstack) symbol; SYMBOL_DOMAIN (sym) = VAR_DOMAIN; SYMBOL_ACLASS_INDEX (sym) = LOC_OPTIMIZED_OUT; @@ -614,7 +614,7 @@ symbol_reference_defined (const char **string) else { /* Must be a reference. Either the symbol has already been defined, - or this is a forward reference to it. */ + or this is a forward reference to it. */ *string = p; return -1; } @@ -692,7 +692,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, if (processing_gcc_compilation) { /* GCC 2.x puts the line number in desc. SunOS apparently puts in the - number of bytes occupied by a type or object, which we ignore. */ + number of bytes occupied by a type or object, which we ignore. */ SYMBOL_LINE (sym) = desc; } else @@ -776,11 +776,11 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, { case 'c': /* c is a special case, not followed by a type-number. - SYMBOL:c=iVALUE for an integer constant symbol. - SYMBOL:c=rVALUE for a floating constant symbol. - SYMBOL:c=eTYPE,INTVALUE for an enum constant symbol. - e.g. "b:c=e6,0" for "const b = blob1" - (where type 6 is defined by "blobs:t6=eblob1:0,blob2:1,;"). */ + SYMBOL:c=iVALUE for an integer constant symbol. + SYMBOL:c=rVALUE for a floating constant symbol. + SYMBOL:c=eTYPE,INTVALUE for an enum constant symbol. + e.g. "b:c=e6,0" for "const b = blob1" + (where type 6 is defined by "blobs:t6=eblob1:0,blob2:1,;"). */ if (*p != '=') { SYMBOL_ACLASS_INDEX (sym) = LOC_CONST; @@ -947,17 +947,17 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, process_function_types: /* Function result types are described as the result type in stabs. - We need to convert this to the function-returning-type-X type - in GDB. E.g. "int" is converted to "function returning int". */ + We need to convert this to the function-returning-type-X type + in GDB. E.g. "int" is converted to "function returning int". */ if (SYMBOL_TYPE (sym)->code () != TYPE_CODE_FUNC) SYMBOL_TYPE (sym) = lookup_function_type (SYMBOL_TYPE (sym)); /* All functions in C++ have prototypes. Stabs does not offer an - explicit way to identify prototyped or unprototyped functions, - but both GCC and Sun CC emit stabs for the "call-as" type rather - than the "declared-as" type for unprototyped functions, so - we treat all functions as if they were prototyped. This is used - primarily for promotion when calling the function from GDB. */ + explicit way to identify prototyped or unprototyped functions, + but both GCC and Sun CC emit stabs for the "call-as" type rather + than the "declared-as" type for unprototyped functions, so + we treat all functions as if they were prototyped. This is used + primarily for promotion when calling the function from GDB. */ SYMBOL_TYPE (sym)->set_is_prototyped (true); /* fall into process_prototype_types. */ @@ -988,17 +988,17 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, struct type *ptype; /* A type number of zero indicates the start of varargs. - FIXME: GDB currently ignores vararg functions. */ + FIXME: GDB currently ignores vararg functions. */ if (p[0] == '0' && p[1] == '\0') break; ptype = read_type (&p, objfile); /* The Sun compilers mark integer arguments, which should - be promoted to the width of the calling conventions, with - a type which references itself. This type is turned into - a TYPE_CODE_VOID type by read_type, and we have to turn - it back into builtin_int here. - FIXME: Do we need a new builtin_promoted_int_arg ? */ + be promoted to the width of the calling conventions, with + a type which references itself. This type is turned into + a TYPE_CODE_VOID type by read_type, and we have to turn + it back into builtin_int here. + FIXME: Do we need a new builtin_promoted_int_arg ? */ if (ptype->code () == TYPE_CODE_VOID) ptype = objfile_type (objfile)->builtin_int; ftype->field (nparams).set_type (ptype); @@ -1019,16 +1019,16 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, case 'G': /* For a class G (global) symbol, it appears that the - value is not correct. It is necessary to search for the - corresponding linker definition to find the value. - These definitions appear at the end of the namelist. */ + value is not correct. It is necessary to search for the + corresponding linker definition to find the value. + These definitions appear at the end of the namelist. */ SYMBOL_TYPE (sym) = read_type (&p, objfile); SYMBOL_ACLASS_INDEX (sym) = LOC_STATIC; SYMBOL_DOMAIN (sym) = VAR_DOMAIN; /* Don't add symbol references to global_sym_chain. - Symbol references don't have valid names and wont't match up with - minimal symbols when the global_sym_chain is relocated. - We'll fixup symbol references when we fixup the defining symbol. */ + Symbol references don't have valid names and wont't match up with + minimal symbols when the global_sym_chain is relocated. + We'll fixup symbol references when we fixup the defining symbol. */ if (sym->linkage_name () && sym->linkage_name ()[0] != '#') { i = hashname (sym->linkage_name ()); @@ -1039,8 +1039,8 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, break; /* This case is faked by a conditional above, - when there is no code letter in the dbx data. - Dbx data never actually contains 'l'. */ + when there is no code letter in the dbx data. + Dbx data never actually contains 'l'. */ case 's': case 'l': SYMBOL_TYPE (sym) = read_type (&p, objfile); @@ -1101,8 +1101,8 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, case 'P': /* acc seems to use P to declare the prototypes of functions that - are referenced by this file. gdb is not prepared to deal - with this extra information. FIXME, it ought to. */ + are referenced by this file. gdb is not prepared to deal + with this extra information. FIXME, it ought to. */ if (type == N_FUN) { SYMBOL_TYPE (sym) = read_type (&p, objfile); @@ -1186,26 +1186,26 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, case 't': /* In Ada, there is no distinction between typedef and non-typedef; - any type declaration implicitly has the equivalent of a typedef, - and thus 't' is in fact equivalent to 'Tt'. - - Therefore, for Ada units, we check the character immediately - before the 't', and if we do not find a 'T', then make sure to - create the associated symbol in the STRUCT_DOMAIN ('t' definitions - will be stored in the VAR_DOMAIN). If the symbol was indeed - defined as 'Tt' then the STRUCT_DOMAIN symbol will be created - elsewhere, so we don't need to take care of that. - - This is important to do, because of forward references: - The cleanup of undefined types stored in undef_types only uses - STRUCT_DOMAIN symbols to perform the replacement. */ + any type declaration implicitly has the equivalent of a typedef, + and thus 't' is in fact equivalent to 'Tt'. + + Therefore, for Ada units, we check the character immediately + before the 't', and if we do not find a 'T', then make sure to + create the associated symbol in the STRUCT_DOMAIN ('t' definitions + will be stored in the VAR_DOMAIN). If the symbol was indeed + defined as 'Tt' then the STRUCT_DOMAIN symbol will be created + elsewhere, so we don't need to take care of that. + + This is important to do, because of forward references: + The cleanup of undefined types stored in undef_types only uses + STRUCT_DOMAIN symbols to perform the replacement. */ synonym = (sym->language () == language_ada && p[-2] != 'T'); /* Typedef */ SYMBOL_TYPE (sym) = read_type (&p, objfile); /* For a nameless type, we don't want a create a symbol, thus we - did not use `sym'. Return without further processing. */ + did not use `sym'. Return without further processing. */ if (nameless) return NULL; @@ -1213,9 +1213,9 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, SYMBOL_VALUE (sym) = valu; SYMBOL_DOMAIN (sym) = VAR_DOMAIN; /* C++ vagaries: we may have a type which is derived from - a base type which did not have its name defined when the - derived class was output. We fill in the derived class's - base part member's name here in that case. */ + a base type which did not have its name defined when the + derived class was output. We fill in the derived class's + base part member's name here in that case. */ if (SYMBOL_TYPE (sym)->name () != NULL) if ((SYMBOL_TYPE (sym)->code () == TYPE_CODE_STRUCT || SYMBOL_TYPE (sym)->code () == TYPE_CODE_UNION) @@ -1236,29 +1236,29 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, || SYMBOL_TYPE (sym)->code () == TYPE_CODE_FUNC) { /* If we are giving a name to a type such as "pointer to - foo" or "function returning foo", we better not set - the TYPE_NAME. If the program contains "typedef char - *caddr_t;", we don't want all variables of type char - * to print as caddr_t. This is not just a - consequence of GDB's type management; PCC and GCC (at - least through version 2.4) both output variables of - either type char * or caddr_t with the type number - defined in the 't' symbol for caddr_t. If a future - compiler cleans this up it GDB is not ready for it - yet, but if it becomes ready we somehow need to - disable this check (without breaking the PCC/GCC2.4 - case). - - Sigh. - - Fortunately, this check seems not to be necessary - for anything except pointers or functions. */ - /* ezannoni: 2000-10-26. This seems to apply for + foo" or "function returning foo", we better not set + the TYPE_NAME. If the program contains "typedef char + *caddr_t;", we don't want all variables of type char + * to print as caddr_t. This is not just a + consequence of GDB's type management; PCC and GCC (at + least through version 2.4) both output variables of + either type char * or caddr_t with the type number + defined in the 't' symbol for caddr_t. If a future + compiler cleans this up it GDB is not ready for it + yet, but if it becomes ready we somehow need to + disable this check (without breaking the PCC/GCC2.4 + case). + + Sigh. + + Fortunately, this check seems not to be necessary + for anything except pointers or functions. */ + /* ezannoni: 2000-10-26. This seems to apply for versions of gcc older than 2.8. This was the original problem: with the following code gdb would tell that the type for name1 is caddr_t, and func is char(). - typedef char *caddr_t; + typedef char *caddr_t; char *name2; struct x { @@ -1281,26 +1281,26 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, add_symbol_to_list (sym, get_file_symbols ()); if (synonym) - { - /* Create the STRUCT_DOMAIN clone. */ - struct symbol *struct_sym = new (&objfile->objfile_obstack) symbol; - - *struct_sym = *sym; - SYMBOL_ACLASS_INDEX (struct_sym) = LOC_TYPEDEF; - SYMBOL_VALUE (struct_sym) = valu; - SYMBOL_DOMAIN (struct_sym) = STRUCT_DOMAIN; - if (SYMBOL_TYPE (sym)->name () == 0) + { + /* Create the STRUCT_DOMAIN clone. */ + struct symbol *struct_sym = new (&objfile->objfile_obstack) symbol; + + *struct_sym = *sym; + SYMBOL_ACLASS_INDEX (struct_sym) = LOC_TYPEDEF; + SYMBOL_VALUE (struct_sym) = valu; + SYMBOL_DOMAIN (struct_sym) = STRUCT_DOMAIN; + if (SYMBOL_TYPE (sym)->name () == 0) SYMBOL_TYPE (sym)->set_name (obconcat (&objfile->objfile_obstack, sym->linkage_name (), (char *) NULL)); - add_symbol_to_list (struct_sym, get_file_symbols ()); - } + add_symbol_to_list (struct_sym, get_file_symbols ()); + } break; case 'T': /* Struct, union, or enum tag. For GNU C++, this can be be followed - by 't' which means we are typedef'ing it as well. */ + by 't' which means we are typedef'ing it as well. */ synonym = *p == 't'; if (synonym) @@ -1309,7 +1309,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, SYMBOL_TYPE (sym) = read_type (&p, objfile); /* For a nameless type, we don't want a create a symbol, thus we - did not use `sym'. Return without further processing. */ + did not use `sym'. Return without further processing. */ if (nameless) return NULL; @@ -1370,9 +1370,9 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, case 'X': /* This is used by Sun FORTRAN for "function result value". - Sun claims ("dbx and dbxtool interfaces", 2nd ed) - that Pascal uses it too, but when I tried it Pascal used - "x:3" (local symbol) instead. */ + Sun claims ("dbx and dbxtool interfaces", 2nd ed) + that Pascal uses it too, but when I tried it Pascal used + "x:3" (local symbol) instead. */ SYMBOL_TYPE (sym) = read_type (&p, objfile); SYMBOL_ACLASS_INDEX (sym) = LOC_LOCAL; SYMBOL_VALUE (sym) = valu; @@ -1397,7 +1397,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, && SYMBOL_IS_ARGUMENT (sym)) { /* We have to convert LOC_REGISTER to LOC_REGPARM_ADDR (for - variables passed in a register). */ + variables passed in a register). */ if (SYMBOL_CLASS (sym) == LOC_REGISTER) SYMBOL_ACLASS_INDEX (sym) = LOC_REGPARM_ADDR; /* Likewise for converting LOC_ARG to LOC_REF_ARG (for the 7th @@ -1499,30 +1499,30 @@ read_type (const char **pp, struct objfile *objfile) return error_type (pp, objfile); if (**pp != '=') - { - /* Type is not being defined here. Either it already - exists, or this is a forward reference to it. - dbx_alloc_type handles both cases. */ - type = dbx_alloc_type (typenums, objfile); + { + /* Type is not being defined here. Either it already + exists, or this is a forward reference to it. + dbx_alloc_type handles both cases. */ + type = dbx_alloc_type (typenums, objfile); - /* If this is a forward reference, arrange to complain if it - doesn't get patched up by the time we're done - reading. */ - if (type->code () == TYPE_CODE_UNDEF) - add_undefined_type (type, typenums); + /* If this is a forward reference, arrange to complain if it + doesn't get patched up by the time we're done + reading. */ + if (type->code () == TYPE_CODE_UNDEF) + add_undefined_type (type, typenums); - return type; - } + return type; + } /* Type is being defined here. */ /* Skip the '='. - Also skip the type descriptor - we get it below with (*pp)[-1]. */ + Also skip the type descriptor - we get it below with (*pp)[-1]. */ (*pp) += 2; } else { /* 'typenums=' not present, type is anonymous. Read and return - the definition, but don't put it in the type vector. */ + the definition, but don't put it in the type vector. */ typenums[0] = typenums[1] = -1; (*pp)++; } @@ -1619,9 +1619,9 @@ again: *pp = p + 1; } - /* If this type has already been declared, then reuse the same - type, rather than allocating a new one. This saves some - memory. */ + /* If this type has already been declared, then reuse the same + type, rather than allocating a new one. This saves some + memory. */ for (ppt = *get_file_symbols (); ppt; ppt = ppt->next) for (i = 0; i < ppt->nsyms; i++) @@ -1635,8 +1635,8 @@ again: { obstack_free (&objfile->objfile_obstack, type_name); type = SYMBOL_TYPE (sym); - if (typenums[0] != -1) - *dbx_lookup_type (typenums, objfile) = type; + if (typenums[0] != -1) + *dbx_lookup_type (typenums, objfile) = type; return type; } } @@ -1671,10 +1671,10 @@ again: (*pp)--; /* We deal with something like t(1,2)=(3,4)=... which - the Lucid compiler and recent gcc versions (post 2.7.3) use. */ + the Lucid compiler and recent gcc versions (post 2.7.3) use. */ /* Allocate and enter the typedef type first. - This handles recursive types. */ + This handles recursive types. */ type = dbx_alloc_type (typenums, objfile); type->set_code (TYPE_CODE_TYPEDEF); { @@ -1695,22 +1695,22 @@ again: here as well. Once a type pointed to has been created it should not be modified. - Well, it's not *absolutely* wrong. Constructing recursive - types (trees, linked lists) necessarily entails modifying - types after creating them. Constructing any loop structure - entails side effects. The Dwarf 2 reader does handle this - more gracefully (it never constructs more than once - instance of a type object, so it doesn't have to copy type - objects wholesale), but it still mutates type objects after - other folks have references to them. - - Keep in mind that this circularity/mutation issue shows up - at the source language level, too: C's "incomplete types", - for example. So the proper cleanup, I think, would be to - limit GDB's type smashing to match exactly those required - by the source language. So GDB could have a - "complete_this_type" function, but never create unnecessary - copies of a type otherwise. */ + Well, it's not *absolutely* wrong. Constructing recursive + types (trees, linked lists) necessarily entails modifying + types after creating them. Constructing any loop structure + entails side effects. The Dwarf 2 reader does handle this + more gracefully (it never constructs more than once + instance of a type object, so it doesn't have to copy type + objects wholesale), but it still mutates type objects after + other folks have references to them. + + Keep in mind that this circularity/mutation issue shows up + at the source language level, too: C's "incomplete types", + for example. So the proper cleanup, I think, would be to + limit GDB's type smashing to match exactly those required + by the source language. So GDB could have a + "complete_this_type" function, but never create unnecessary + copies of a type otherwise. */ replace_type (type, xtype); type->set_name (NULL); } @@ -1723,11 +1723,11 @@ again: break; /* In the following types, we must be sure to overwrite any existing - type that the typenums refer to, rather than allocating a new one - and making the typenums point to the new one. This is because there - may already be pointers to the existing type (if it had been - forward-referenced), and we must change it to a pointer, function, - reference, or whatever, *in-place*. */ + type that the typenums refer to, rather than allocating a new one + and making the typenums point to the new one. This is because there + may already be pointers to the existing type (if it had been + forward-referenced), and we must change it to a pointer, function, + reference, or whatever, *in-place*. */ case '*': /* Pointer to another type */ type1 = read_type (pp, objfile); @@ -1737,7 +1737,7 @@ again: case '&': /* Reference to another type */ type1 = read_type (pp, objfile); type = make_reference_type (type1, dbx_lookup_type (typenums, objfile), - TYPE_CODE_REF); + TYPE_CODE_REF); break; case 'f': /* Function returning another type */ @@ -1747,76 +1747,76 @@ again: case 'g': /* Prototyped function. (Sun) */ { - /* Unresolved questions: - - - According to Sun's ``STABS Interface Manual'', for 'f' - and 'F' symbol descriptors, a `0' in the argument type list - indicates a varargs function. But it doesn't say how 'g' - type descriptors represent that info. Someone with access - to Sun's toolchain should try it out. - - - According to the comment in define_symbol (search for - `process_prototype_types:'), Sun emits integer arguments as - types which ref themselves --- like `void' types. Do we - have to deal with that here, too? Again, someone with - access to Sun's toolchain should try it out and let us - know. */ - - const char *type_start = (*pp) - 1; - struct type *return_type = read_type (pp, objfile); - struct type *func_type - = make_function_type (return_type, + /* Unresolved questions: + + - According to Sun's ``STABS Interface Manual'', for 'f' + and 'F' symbol descriptors, a `0' in the argument type list + indicates a varargs function. But it doesn't say how 'g' + type descriptors represent that info. Someone with access + to Sun's toolchain should try it out. + + - According to the comment in define_symbol (search for + `process_prototype_types:'), Sun emits integer arguments as + types which ref themselves --- like `void' types. Do we + have to deal with that here, too? Again, someone with + access to Sun's toolchain should try it out and let us + know. */ + + const char *type_start = (*pp) - 1; + struct type *return_type = read_type (pp, objfile); + struct type *func_type + = make_function_type (return_type, dbx_lookup_type (typenums, objfile)); - struct type_list { - struct type *type; - struct type_list *next; - } *arg_types = 0; - int num_args = 0; - - while (**pp && **pp != '#') - { - struct type *arg_type = read_type (pp, objfile); - struct type_list *newobj = XALLOCA (struct type_list); - newobj->type = arg_type; - newobj->next = arg_types; - arg_types = newobj; - num_args++; - } - if (**pp == '#') - ++*pp; - else - { + struct type_list { + struct type *type; + struct type_list *next; + } *arg_types = 0; + int num_args = 0; + + while (**pp && **pp != '#') + { + struct type *arg_type = read_type (pp, objfile); + struct type_list *newobj = XALLOCA (struct type_list); + newobj->type = arg_type; + newobj->next = arg_types; + arg_types = newobj; + num_args++; + } + if (**pp == '#') + ++*pp; + else + { complaint (_("Prototyped function type didn't " "end arguments with `#':\n%s"), type_start); - } + } - /* If there is just one argument whose type is `void', then - that's just an empty argument list. */ - if (arg_types - && ! arg_types->next - && arg_types->type->code () == TYPE_CODE_VOID) - num_args = 0; + /* If there is just one argument whose type is `void', then + that's just an empty argument list. */ + if (arg_types + && ! arg_types->next + && arg_types->type->code () == TYPE_CODE_VOID) + num_args = 0; func_type->set_fields ((struct field *) TYPE_ALLOC (func_type, num_args * sizeof (struct field))); - memset (func_type->fields (), 0, num_args * sizeof (struct field)); - { - int i; - struct type_list *t; - - /* We stuck each argument type onto the front of the list - when we read it, so the list is reversed. Build the - fields array right-to-left. */ - for (t = arg_types, i = num_args - 1; t; t = t->next, i--) - func_type->field (i).set_type (t->type); - } - func_type->set_num_fields (num_args); + memset (func_type->fields (), 0, num_args * sizeof (struct field)); + { + int i; + struct type_list *t; + + /* We stuck each argument type onto the front of the list + when we read it, so the list is reversed. Build the + fields array right-to-left. */ + for (t = arg_types, i = num_args - 1; t; t = t->next, i--) + func_type->field (i).set_type (t->type); + } + func_type->set_num_fields (num_args); func_type->set_is_prototyped (true); - type = func_type; - break; + type = func_type; + break; } case 'k': /* Const qualifier on some type (Sun) */ @@ -1881,7 +1881,7 @@ again: default: /* Ignore unrecognized type attributes, so future compilers - can invent new ones. */ + can invent new ones. */ break; } ++*pp; @@ -1959,19 +1959,19 @@ again: case 's': /* Struct type */ case 'u': /* Union type */ { - enum type_code type_code = TYPE_CODE_UNDEF; - type = dbx_alloc_type (typenums, objfile); - switch (type_descriptor) - { - case 's': - type_code = TYPE_CODE_STRUCT; - break; - case 'u': - type_code = TYPE_CODE_UNION; - break; - } - type = read_struct_type (pp, type, type_code, objfile); - break; + enum type_code type_code = TYPE_CODE_UNDEF; + type = dbx_alloc_type (typenums, objfile); + switch (type_descriptor) + { + case 's': + type_code = TYPE_CODE_STRUCT; + break; + case 'u': + type_code = TYPE_CODE_UNION; + break; + } + type = read_struct_type (pp, type, type_code, objfile); + break; } case 'a': /* Array type */ @@ -2058,10 +2058,10 @@ rs6000_builtin_type (int typenum, struct objfile *objfile) { case 1: /* The size of this and all the other types are fixed, defined - by the debugging format. If there is a type called "int" which - is other than 32 bits, then it should use a new negative type - number (or avoid negative type numbers for that case). - See stabs.texinfo. */ + by the debugging format. If there is a type called "int" which + is other than 32 bits, then it should use a new negative type + number (or avoid negative type numbers for that case). + See stabs.texinfo. */ rettype = init_integer_type (objfile, 32, 0, "int"); break; case 2: @@ -2107,8 +2107,8 @@ rs6000_builtin_type (int typenum, struct objfile *objfile) break; case 14: /* This is an IEEE double on the RS/6000, and different machines with - different sizes for "long double" should use different negative - type numbers. See stabs.texinfo. */ + different sizes for "long double" should use different negative + type numbers. See stabs.texinfo. */ rettype = init_float_type (objfile, 64, "long double", floatformats_ieee_double); break; @@ -2244,8 +2244,8 @@ read_member_functions (struct stab_field_info *fip, const char **pp, while (**pp != ';') { /* We should be positioned at the start of the function name. - Scan forward to find the first ':' and if it is not the - first of a "::" delimiter, then this is not a member function. */ + Scan forward to find the first ':' and if it is not the + first of a "::" delimiter, then this is not a member function. */ p = *pp; while (*p != ':') { @@ -2547,13 +2547,13 @@ read_member_functions (struct stab_field_info *fip, const char **pp, So, to summarize what we expect and handle here: - Given Given Real Real Action + Given Given Real Real Action method name physname physname method name __opi [none] __opi__3Foo operator int opname - [now or later] + [now or later] Foo _._3Foo _._3Foo ~Foo separate and - rename + rename operator i _ZN3FoocviEv _ZN3FoocviEv operator int demangle __comp_ctor _ZN3FooC1ERKS_ _ZN3FooC1ERKS_ Foo demangle */ @@ -2698,9 +2698,9 @@ read_cpp_abbrev (struct stab_field_info *fip, const char **pp, *pp = p + 1; /* At this point, *pp points to something like "22:23=*22...", - where the type number before the ':' is the "context" and - everything after is a regular type definition. Lookup the - type, find it's name, and construct the field name. */ + where the type number before the ':' is the "context" and + everything after is a regular type definition. Lookup the + type, find it's name, and construct the field name. */ context = read_type (pp, objfile); @@ -2738,7 +2738,7 @@ read_cpp_abbrev (struct stab_field_info *fip, const char **pp, } /* At this point, *pp points to the ':'. Skip it and read the - field type. */ + field type. */ p = ++(*pp); if (p[-1] != ':') @@ -2768,8 +2768,8 @@ read_cpp_abbrev (struct stab_field_info *fip, const char **pp, { invalid_cpp_abbrev_complaint (*pp); /* We have no idea what syntax an unrecognized abbrev would have, so - better return 0. If we returned 1, we would need to at least advance - *pp to avoid an infinite loop. */ + better return 0. If we returned 1, we would need to at least advance + *pp to avoid an infinite loop. */ return 0; } return 1; @@ -2852,18 +2852,18 @@ read_one_struct_field (struct stab_field_info *fip, const char **pp, && FIELD_BITSIZE (fip->list->field) == 0) { /* This can happen in two cases: (1) at least for gcc 2.4.5 or so, - it is a field which has been optimized out. The correct stab for - this case is to use VISIBILITY_IGNORE, but that is a recent - invention. (2) It is a 0-size array. For example - union { int num; char str[0]; } foo. Printing _("<no value>" for - str in "p foo" is OK, since foo.str (and thus foo.str[3]) - will continue to work, and a 0-size array as a whole doesn't - have any contents to print. - - I suspect this probably could also happen with gcc -gstabs (not - -gstabs+) for static fields, and perhaps other C++ extensions. - Hopefully few people use -gstabs with gdb, since it is intended - for dbx compatibility. */ + it is a field which has been optimized out. The correct stab for + this case is to use VISIBILITY_IGNORE, but that is a recent + invention. (2) It is a 0-size array. For example + union { int num; char str[0]; } foo. Printing _("<no value>" for + str in "p foo" is OK, since foo.str (and thus foo.str[3]) + will continue to work, and a 0-size array as a whole doesn't + have any contents to print. + + I suspect this probably could also happen with gcc -gstabs (not + -gstabs+) for static fields, and perhaps other C++ extensions. + Hopefully few people use -gstabs with gdb, since it is intended + for dbx compatibility. */ /* Ignore this field. */ fip->list->visibility = VISIBILITY_IGNORE; @@ -2871,9 +2871,9 @@ read_one_struct_field (struct stab_field_info *fip, const char **pp, else { /* Detect an unpacked field and mark it as such. - dbx gives a bit size for all fields. - Note that forward refs cannot be packed, - and treat enums as if they had the width of ints. */ + dbx gives a bit size for all fields. + Note that forward refs cannot be packed, + and treat enums as if they had the width of ints. */ struct type *field_type = check_typedef (fip->list->field.type ()); @@ -2949,9 +2949,9 @@ read_struct_fields (struct stab_field_info *fip, const char **pp, p = *pp; /* If is starts with CPLUS_MARKER it is a special abbreviation, - unless the CPLUS_MARKER is followed by an underscore, in - which case it is just the name of an anonymous type, which we - should handle like any other type name. */ + unless the CPLUS_MARKER is followed by an underscore, in + which case it is just the name of an anonymous type, which we + should handle like any other type name. */ if (is_cplus_marker (p[0]) && p[1] != '_') { @@ -2961,9 +2961,9 @@ read_struct_fields (struct stab_field_info *fip, const char **pp, } /* Look for the ':' that separates the field name from the field - values. Data members are delimited by a single ':', while member - functions are delimited by a pair of ':'s. When we hit the member - functions (if any), terminate scan loop and return. */ + values. Data members are delimited by a single ':', while member + functions are delimited by a pair of ':'s. When we hit the member + functions (if any), terminate scan loop and return. */ while (*p != ':' && *p != '\0') { @@ -2982,8 +2982,8 @@ read_struct_fields (struct stab_field_info *fip, const char **pp, if (p[0] == ':' && p[1] == ':') { /* (the deleted) chill the list of fields: the last entry (at - the head) is a partially constructed entry which we now - scrub. */ + the head) is a partially constructed entry which we now + scrub. */ fip->list = fip->list->next; } return 1; @@ -3116,8 +3116,8 @@ read_baseclasses (struct stab_field_info *fip, const char **pp, } /* The last piece of baseclass information is the type of the - base class. Read it, and remember it's type name as this - field's name. */ + base class. Read it, and remember it's type name as this + field's name. */ newobj->field.set_type (read_type (pp, objfile)); newobj->field.name = newobj->field.type ()->name (); @@ -3341,12 +3341,12 @@ complain_about_struct_wipeout (struct type *type) { name = type->name (); switch (type->code ()) - { - case TYPE_CODE_STRUCT: kind = "struct "; break; - case TYPE_CODE_UNION: kind = "union "; break; - case TYPE_CODE_ENUM: kind = "enum "; break; - default: kind = ""; - } + { + case TYPE_CODE_STRUCT: kind = "struct "; break; + case TYPE_CODE_UNION: kind = "union "; break; + case TYPE_CODE_ENUM: kind = "enum "; break; + default: kind = ""; + } } else { @@ -3365,8 +3365,8 @@ complain_about_struct_wipeout (struct type *type) for instance the following scenario where we have the following two stabs entries: - .stabs "t:p(0,21)=*(0,22)=k(0,23)=xsdummy:",160,0,28,-24 - .stabs "dummy:T(0,23)=s16x:(0,1),0,3[...]" + .stabs "t:p(0,21)=*(0,22)=k(0,23)=xsdummy:",160,0,28,-24 + .stabs "dummy:T(0,23)=s16x:(0,1),0,3[...]" A stubbed version of type dummy is created while processing the first stabs entry. The length of that type is initially set to zero, since @@ -3389,7 +3389,7 @@ set_length_in_type_chain (struct type *type) if (TYPE_LENGTH(ntype) == 0) TYPE_LENGTH (ntype) = TYPE_LENGTH (type); else - complain_about_struct_wipeout (ntype); + complain_about_struct_wipeout (ntype); ntype = TYPE_CHAIN (ntype); } } @@ -3410,7 +3410,7 @@ set_length_in_type_chain (struct type *type) static struct type * read_struct_type (const char **pp, struct type *type, enum type_code type_code, - struct objfile *objfile) + struct objfile *objfile) { struct stab_field_info fi; @@ -3426,7 +3426,7 @@ read_struct_type (const char **pp, struct type *type, enum type_code type_code, scribbling on existing structure type objects when new definitions appear. */ if (! (type->code () == TYPE_CODE_UNDEF - || type->is_stub ())) + || type->is_stub ())) { complain_about_struct_wipeout (type); @@ -3855,9 +3855,9 @@ read_huge_number (const char **pp, int end, int *bits, while ((c = *p++) >= '0' && c < ('0' + radix)) { if (n <= upper_limit) - { - if (twos_complement_representation) - { + { + if (twos_complement_representation) + { /* Octal, signed, twos complement representation. In this case, n is the corresponding absolute value. */ if (n == 0) @@ -3866,24 +3866,24 @@ read_huge_number (const char **pp, int end, int *bits, n = -sn; } - else - { - n *= radix; - n -= c - '0'; - } - } - else - { - /* unsigned representation */ - n *= radix; - n += c - '0'; /* FIXME this overflows anyway. */ - } - } + else + { + n *= radix; + n -= c - '0'; + } + } + else + { + /* unsigned representation */ + n *= radix; + n += c - '0'; /* FIXME this overflows anyway. */ + } + } else - overflow = 1; + overflow = 1; /* This depends on large values being output in octal, which is - what GCC does. */ + what GCC does. */ if (radix == 8) { if (nbits == 0) @@ -3936,8 +3936,8 @@ read_huge_number (const char **pp, int end, int *bits, } /* -0x7f is the same as 0x80. So deal with it by adding one to - the number of bits. Two's complement represention octals - can't have a '-' in front. */ + the number of bits. Two's complement represention octals + can't have a '-' in front. */ if (sign == -1 && !twos_complement_representation) ++nbits; if (bits) @@ -3955,7 +3955,7 @@ read_huge_number (const char **pp, int end, int *bits, static struct type * read_range_type (const char **pp, int typenums[2], int type_size, - struct objfile *objfile) + struct objfile *objfile) { struct gdbarch *gdbarch = objfile->arch (); const char *orig_pp = *pp; @@ -4003,16 +4003,16 @@ read_range_type (const char **pp, int typenums[2], int type_size, int nbits = 0; /* If a type size attribute has been specified, the bounds of - the range should fit in this size. If the lower bounds needs - more bits than the upper bound, then the type is signed. */ + the range should fit in this size. If the lower bounds needs + more bits than the upper bound, then the type is signed. */ if (n2bits <= type_size && n3bits <= type_size) - { - if (n2bits == type_size && n2bits > n3bits) - got_signed = 1; - else - got_unsigned = 1; - nbits = type_size; - } + { + if (n2bits == type_size && n2bits > n3bits) + got_signed = 1; + else + got_unsigned = 1; + nbits = type_size; + } /* Range from 0 to <large number> is an unsigned large integral type. */ else if ((n2bits == 0 && n2 == 0) && n3bits != 0) { @@ -4020,8 +4020,8 @@ read_range_type (const char **pp, int typenums[2], int type_size, nbits = n3bits; } /* Range from <large number> to <large number>-1 is a large signed - integral type. Take care of the case where <large number> doesn't - fit in a long but <large number>-1 does. */ + integral type. Take care of the case where <large number> doesn't + fit in a long but <large number>-1 does. */ else if ((n2bits != 0 && n3bits != 0 && n2bits == n3bits + 1) || (n2bits != 0 && n3bits == 0 && (n2bits == sizeof (long) * HOST_CHAR_BIT) @@ -4094,16 +4094,16 @@ read_range_type (const char **pp, int typenums[2], int type_size, else if (n2 == 0) { /* -1 is used for the upper bound of (4 byte) "unsigned int" and - "unsigned long", and we already checked for that, - so don't need to test for it here. */ + "unsigned long", and we already checked for that, + so don't need to test for it here. */ if (n3 < 0) /* n3 actually gives the size. */ return init_integer_type (objfile, -n3 * TARGET_CHAR_BIT, 1, NULL); /* Is n3 == 2**(8n)-1 for some integer n? Then it's an - unsigned n-byte integer. But do require n to be a power of - two; we don't want 3- and 5-byte integers flying around. */ + unsigned n-byte integer. But do require n to be a power of + two; we don't want 3- and 5-byte integers flying around. */ { int bytes; unsigned long bits; @@ -4145,7 +4145,7 @@ handle_true_range: if (index_type == NULL) { /* Does this actually ever happen? Is that why we are worrying - about dealing with it rather than just calling error_type? */ + about dealing with it rather than just calling error_type? */ complaint (_("base type %d of range type is not defined"), rangenums[1]); @@ -4390,14 +4390,14 @@ cleanup_undefined_types_noname (struct objfile *objfile) type = dbx_lookup_type (nat.typenums, objfile); if (nat.type != *type && (*type)->code () != TYPE_CODE_UNDEF) - { - /* The instance flags of the undefined type are still unset, - and needs to be copied over from the reference type. - Since replace_type expects them to be identical, we need - to set these flags manually before hand. */ - nat.type->set_instance_flags ((*type)->instance_flags ()); - replace_type (nat.type, *type); - } + { + /* The instance flags of the undefined type are still unset, + and needs to be copied over from the reference type. + Since replace_type expects them to be identical, we need + to set these flags manually before hand. */ + nat.type->set_instance_flags ((*type)->instance_flags ()); + replace_type (nat.type, *type); + } } noname_undefs_length = 0; @@ -4427,7 +4427,7 @@ cleanup_undefined_types_1 (void) It is important to check the instance flags, because we have seen examples where the debug info contained definitions such as: - "foo_t:t30=B31=xefoo_t:" + "foo_t:t30=B31=xefoo_t:" In this case, we have created an undefined type named "foo_t" whose instance flags is null (when processing "xefoo_t"), and then created @@ -4484,7 +4484,7 @@ cleanup_undefined_types_1 (void) default: { complaint (_("forward-referenced types left unresolved, " - "type code %d."), + "type code %d."), (*type)->code ()); } break; @@ -4526,7 +4526,7 @@ scan_file_globals (struct objfile *objfile) while (1) { /* Avoid expensive loop through all minimal symbols if there are - no unresolved symbols. */ + no unresolved symbols. */ for (hash = 0; hash < HASHSIZE; hash++) { if (global_sym_chain[hash]) |