I happened to notice that skiplist_entry, in skip.c, contains a
gdb::optional<compiled_regex> -- but that this object's destructor is
never run. This can result in a memory leak.
This patch fixes the bug by applying a bit more C++: changing this
code to use new and delete, and std::unique_ptr; and removing cleanups
in the process.
Built and regression tested on x86-64 Fedora 25.
ChangeLog
2017-08-09 Tom Tromey <tom@tromey.com>
* skip.c (skiplist_entry): New constructor.
(skiplist_entry::enabled, skiplist_entry::function_is_regexp)
(skiplist_entry::file_is_glob): Now bool.
(skiplist_entry::file, skiplist_entry::function): Now
std::string.
(make_skip_entry): Return a unique_ptr. Use new.
(free_skiplist_entry, free_skiplist_entry_cleanup)
(make_free_skiplist_entry_cleanup): Remove.
(skip_command, skip_disable_command, add_skiplist_entry)
(skip_form_bytes, compile_skip_regexp, skip_command, skip_info)
(skip_file_p, skip_gfile_p, skip_function_p, skip_rfunction_p)
(function_name_is_marked_for_skip): Update.
(skip_delete_command): Update. Use delete.
According to ARMv8-A architecture manual, REG_SP is allowed in CRC32
instructions in Thumb mode. It is REG_PC that will cause unpredictable
behaviours on both ARM and Thumb.
This patch removes the incorrect warning on Thumb mode.
Meanwhile the disassembler is updated to use format "<bitfield>R" instead of
"<bitfield>S". "<bitfield>S" is not used elsewhere. so I have deleted related
code from the disassembler.
gas/
* config/tc-arm.c (do_crc32_1): Remove warning on REG_SP for thumb_mode.
* testsuite/gas/arm/crc32-armv8-a-bad.d: Update exepcted result.
* testsuite/gas/arm/crc32-armv8-r-bad.d: Likewise.
* testsuite/gas/arm/crc32-armv8-a.d: Likewise.
* testsuite/gas/arm/crc32-armv8-r.d: Likewise.
* testsuite/gas/arm/crc32-armv8-ar-bad.s: Update test case.
* testsuite/gas/arm/crc32-armv8-ar.s: Likewise.
* testsuite/gas/arm/crc32-bad.l: Update expected error message.
opcode/
* arm-dis.c (thumb32_opcodes): Use format 'R' instead of 'S' for
register operands in CRC instructions.
(print_insn_thumb32): Remove "<bitfield>S" support. Updated the
comments.
Recommit with missing header files added.
gdb/
* aarch64-linux-tdep.c: Include "auxv.h" and "elf/common.h".
(aarch64_linux_core_read_description): New function.
(aarch64_linux_init_abi): Register gdbarch_core_read_description.
Currently, AArch64 only have one target description which is tdesc_aarch64. So,
we haven't implemented any target description detection mechanism for core file.
This patch is an initial implementation of core_read_description method. Future
features can use this to return selected description.
gdb/
* aarch64-linux-tdep.c (aarch64_linux_core_read_description): New
function.
(aarch64_linux_init_abi): Register gdbarch_core_read_description.
To help avoid issues like the one fixed by e88e8651cf ("Fix memory
leak in cp-support.c").
gdb/ChangeLog:
2017-08-09 Pedro Alves <palves@redhat.com>
* cp-name-parser.y (cp_comp_to_string): Return a
gdb::unique_xmalloc_ptr<char>.
* cp-support.c (replace_typedefs_qualified_name)
(replace_typedefs): Adjust to use gdb::unique_xmalloc_ptr<char>.
(cp_canonicalize_string_full): Use op= instead of explicit
convertion.
(cp_class_name_from_physname, method_name_from_physname)
(cp_func_name, cp_remove_params): Adjust to use
gdb::unique_xmalloc_ptr<char>.
* cp-support.h (cp_comp_to_string): Return a
gdb::unique_xmalloc_ptr<char>.
* python/py-type.c (typy_lookup_type): Adjust to use
gdb::unique_xmalloc_ptr<char>.
The return value of cp_comp_to_string was never freed, creating a
sizable memory leak detectable with valgrind.
==21225== 8 bytes in 1 blocks are definitely lost in loss record 4,599 of 10,949^M
==21225== at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)^M
==21225== by 0x4C2FDEF: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)^M
==21225== by 0x76CB31: d_growable_string_resize (cp-demangle.c:3963)^M
==21225== by 0x76CB31: d_growable_string_init (cp-demangle.c:3942)^M
==21225== by 0x76CB31: cplus_demangle_print (cp-demangle.c:4308)^M
==21225== by 0x4C9535: cp_comp_to_string(demangle_component*, int) (cp-name-parser.y:1972)^M
==21225== by 0x53E1D4: cp_canonicalize_string_full[abi:cxx11](char const*, char const* (*)(type*, void*), void*) (cp-support.c:530)^M
==21225== by 0x53E360: cp_canonicalize_string_no_typedefs[abi:cxx11](char const*) (cp-support.c:548)^M
==21225== by 0x5D51D2: find_linespec_symbols(linespec_state*, VEC_symtab_ptr*, char const*, VEC_symbolp**, VEC_bound_minimal_symbol_d**) (linespec.c:4030)^M
==21225== by 0x5D6CF6: linespec_parse_basic (linespec.c:1907)
==21279== 32 bytes in 1 blocks are definitely lost in loss record 6,066 of 10,947^M
==21279== at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)^M
==21279== by 0x4C2FDEF: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)^M
==21279== by 0x76CB31: d_growable_string_resize (cp-demangle.c:3963)^M
==21279== by 0x76CB31: d_growable_string_init (cp-demangle.c:3942)^M
==21279== by 0x76CB31: cplus_demangle_print (cp-demangle.c:4308)^M
==21279== by 0x4C9535: cp_comp_to_string(demangle_component*, int) (cp-name-parser.y:1972)^M
==21279== by 0x53EF14: cp_canonicalize_string[abi:cxx11](char const*) (cp-support.c:569)^M
==21279== by 0x561B75: dwarf2_canonicalize_name(char const*, dwarf2_cu*, obstack*) [clone .isra.210] (dwarf2read.c:20159)
This patch fixes the leak. It is a regression by 2f408ecb.
gdb:
2017-08-09 Alex Lindsay <alexlindsay239@gmail.com>
Yao Qi <yao.qi@linaro.org>
* cp-support.c (cp_canonicalize_string_full): Use
gdb::unique_xmalloc_ptr<char>.
(cp_canonicalize_string): Likewise.
Require GCC 5 or above for 3 x86 tests which fail with GCC 4.9.3.
PR ld/21924
* testsuite/ld-i386/i386.exp: Require GCC 5 or above for
"weakundef1 with PIE" test.
* testsuite/ld-x86-64/tls.exp: Require GCC 5 or above for
"tlsdesc1" and "tlsdesc1 with PIE" tests.
"--rpath ../bfd/.libs ../bfd/.libs/libbfd.so" isn't a valid compiler
command-line option. We should use -Wl,--rpath instead of --rpath.
PR ld/21923
* configure.ac (TESTBFDLIB): Replace --rpath with -Wl,--rpath
for --disable-static.
* configure: Regenerated.
PR 21916
* elf-attrs.c (_bfd_elf_parse_attributes): Complain about very
small section lengths.
* elf.c (_bfd_elf_setup_sections): Skip empty entries in the group
table.
(elfcore_grok_freebsd_prstatus): Add checks to make sure that
there is enough data present in the note.
These were discovered when running --hash-style=gnu as default, the
previous batch being --hash-style=both.
* testsuite/ld-aarch64/ifunc-1-local.d: Run ld with --hash-style=sysv.
* testsuite/ld-aarch64/ifunc-2-local.d: Likewise.
* testsuite/ld-aarch64/ifunc-3a.d: Likewise.
* testsuite/ld-frv/fdpic-pie-1.d: Likewise.
* testsuite/ld-frv/fdpic-pie-2.d: Likewise.
* testsuite/ld-frv/fdpic-pie-7.d: Likewise.
* testsuite/ld-frv/fdpic-pie-8.d: Likewise.
* testsuite/ld-arm/arm-elf.exp: Add --hash-style=sysv to "Using
Thumb lib by another lib" test's ld options.
* testsuite/ld-elf/note-3.l: Match .gnu.hash.
* testsuite/ld-elf/note-3.t: Add .gnu.hash output section.
Fix a commit cd6c3b4ffc ("New gdbarch methods breakpoint_kind_from_pc
and sw_breakpoint_from_kind") regression and restore the use of
`->placed_address' rather than `->reqstd_address' as the location for a
memory breakpoint to be inserted at. Previously
`gdbarch_breakpoint_from_pc' was used that made that adjustment in
`default_memory_insert_breakpoint' from the preinitialized value,
however with the said commit that call is gone, so the passed
`->placed_address' has to be used for the initialization.
The regression manifests itself as the inability to debug any MIPS/Linux
compressed ISA dynamic executable as GDB corrupts the dynamic loader
with one of its implicit breakpoints, causing the program to crash, as
seen for example with the `mips-linux-gnu' target, o32 ABI, MIPS16 code,
and the gdb.base/advance.exp test case:
(gdb) continue
Continuing.
Program received signal SIGBUS, Bus error.
_dl_debug_initialize (ldbase=0, ns=0) at dl-debug.c:51
51 r = &_r_debug;
(gdb) FAIL: gdb.base/advance.exp: Can't run to main
gdb/
PR breakpoints/21886
* mem-break.c (default_memory_insert_breakpoint): Use
`->placed_address' rather than `->reqstd_address' for the
breakpoint location.
Fix build on x86:
opcodes/disassemble.c: In function ‘disassembler’:
opcodes/disassemble.c:113:52: error: unused parameter ‘big’ [-Werror=unused-parameter]
disassembler (enum bfd_architecture a, bfd_boolean big, unsigned long mach,
^~~
opcodes/disassemble.c:113:71: error: unused parameter ‘mach’ [-Werror=unused-parameter]
disassembler (enum bfd_architecture a, bfd_boolean big, unsigned long mach,
^~~~
cc1: all warnings being treated as errors
* disassemble.c (disassembler): Mark big and mach with
ATTRIBUTE_UNUSED.
Fix `set architecture' and `set endian' command disassembly regressions
from commit 39503f8242 ("Delegate opcodes to select disassembler in
GDB"), and commit 003ca0fd22 ("Refactor disassembler selection"), as
well as a MIPS compressed ISA disassembly target regression from commit
6394c60699 ("Don't use print_insn_XXX in GDB"), which caused assertion
failures to trigger.
For example with the `mips-linux-gnu' target we get:
$ cat main.c
int
main (void)
{
return 0;
}
$ gcc -mips32r2 -O2 main.c -o main
$ gcc -mips16 -mips32r2 -O2 main.c -o main16
$ gdb
GNU gdb (GDB) 8.0.50.20170731-git
[...]
(gdb) file main
Reading symbols from main...done.
(gdb) show architecture
The target architecture is set automatically (currently mips:isa32r2)
(gdb) show endian
The target endianness is set automatically (currently big endian)
(gdb) disassemble main
Dump of assembler code for function main:
0x00400500 <+0>: jr ra
0x00400504 <+4>: move v0,zero
End of assembler dump.
(gdb) set architecture mips:isa64r2
The target architecture is assumed to be mips:isa64r2
(gdb) disassemble main
Dump of assembler code for function main:
0x00400500 <+0>:
.../gdb/arch-utils.c:979: internal-error: int default_print_insn(bfd_vma, disassemble_info*): Assertion `info->mach == bfd_get_mach (exec_bfd)' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) n
[...]
Command aborted.
(gdb) set architecture auto
The target architecture is set automatically (currently mips:isa32r2)
(gdb) set endian little
The target is assumed to be little endian
(gdb) disassemble main
Dump of assembler code for function main:
0x00400500 <+0>:
.../gdb/arch-utils.c:978: internal-error: int default_print_insn(bfd_vma, disassemble_info*): Assertion `info->endian == (bfd_big_endian (exec_bfd) ? BFD_ENDIAN_BIG : BFD_ENDIAN_LITTLE)' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) n
[...]
Command aborted.
(gdb) set endian auto
The target endianness is set automatically (currently big endian)
(gdb) set architecture i386
The target architecture is assumed to be i386
(gdb) disassemble main
Dump of assembler code for function main:
0x00400500 <+0>:
.../gdb/arch-utils.c:976: internal-error: int default_print_insn(bfd_vma, disassemble_info*): Assertion `info->arch == bfd_get_arch (exec_bfd)' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) n
[...]
Command aborted.
(gdb) set architecture auto
The target architecture is set automatically (currently mips:isa32r2)
(gdb) file main16
Load new symbol table from "main16"? (y or n) y
Reading symbols from main16...done.
(gdb) disassemble main
Dump of assembler code for function main:
0x00400501 <+0>:
.../gdb/arch-utils.c:979: internal-error: int default_print_insn(bfd_vma, disassemble_info*): Assertion `info->mach == bfd_get_mach (exec_bfd)' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) n
Command aborted.
(gdb)
Remove the assertions then, restoring previous semantics:
(gdb) file main
Reading symbols from main...done.
(gdb) set architecture mips:isa64r2
The target architecture is assumed to be mips:isa64r2
(gdb) disassemble main
Dump of assembler code for function main:
0x00400500 <+0>: jr ra
0x00400504 <+4>: move v0,zero
End of assembler dump.
(gdb) set endian little
The target is assumed to be little endian
(gdb) disassemble main
Dump of assembler code for function main:
0x00400500 <+0>: j 0x3800c
0x00400504 <+4>: addiu s0,t0,0
End of assembler dump.
(gdb) set architecture i386
The target architecture is assumed to be i386
(gdb) disassemble main
Dump of assembler code for function main:
0x00400500 <+0>: add %eax,%esp
0x00400502 <+2>: add %cl,(%eax)
0x00400504 <+4>: add %al,(%eax)
0x00400506 <+6>: adc %ah,0x0
End of assembler dump.
(gdb) set architecture auto
The target architecture is set automatically (currently mips:isa32r2)
(gdb) set endian auto
The target endianness is set automatically (currently big endian)
(gdb) file main16
Load new symbol table from "main16"? (y or n) y
Reading symbols from main16...done.
(gdb) disassemble main
Dump of assembler code for function main:
0x00400501 <+0>: jr ra
0x00400503 <+2>: li v0,0
End of assembler dump.
(gdb)
gdb/
* arch-utils.c (default_print_insn): Remove arch/mach/endian
assertions.
opcodes/
* disassemble.c (disassembler): Remove arch/mach/endian
assertions.
As an update to commit ede5f15146 ("gdbarch.h: Change
gdbarch_info::tdep_info's type to void *") replace the definition of the
`tdep_info' member in `struct gdbarch_info' with an anonymous union,
comprising the original member, with its type reverted to `struct
gdbarch_tdep_info *', a `tdesc_data' member of a `struct tdesc_arch_data
*' type and an `id' member of an `int *' type. Remove now unnecessary
casts throughout use places then, making code easier to read an less
prone to errors, which may happen with casting.
gdb/
* gdbarch.sh (gdbarch_info): Replace the `tdep_info' member with
a union of `tdep_info', `tdesc_data' and `id'.
* aarch64-tdep.c (aarch64_gdbarch_init): Use `info.tdesc_data'
rather than `info.tdep_info'.
* amd64-linux-tdep.c (amd64_linux_init_abi): Likewise.
* i386-linux-tdep.c (i386_linux_init_abi): Likewise.
* i386-tdep.c (i386_gdbarch_init): Likewise.
* mips-linux-tdep.c (mips_linux_init_abi): Likewise.
* mips-tdep.c (mips_gdbarch_init): Likewise.
* nds32-tdep.c (nds32_gdbarch_init): Likewise.
* rs6000-tdep.c (rs6000_gdbarch_init): Likewise.
* ppc-linux-tdep.c (ppu2spu_sniffer): Use `info.id' rather than
`info.tdep_info'.
(ppc_linux_init_abi): Use `info.tdesc_data' rather than
`info.tdep_info'.
* sparc-tdep.c (sparc32_gdbarch_init): Likewise.
* spu-multiarch.c (spu_gdbarch): Use `info.id' rather than
`info.tdep_info'.
* spu-tdep.c (spu_gdbarch_init): Likewise.
* gdbarch.h: Regenerate.
The dwarf2_string_attr did not allow DW_FORM_GNU_str_index as a form for
string types. This manifested as null strings in the namespace_name
lookup (replaced with "(anonymous namespace)") when debugging
Fission-compiled code.
gdb/ChangeLog:
* dwarf2read.c (dwarf2_string_attr): Allow DW_FORM_GNU_strp_alt.
The recent change introducing gdb_argv introduced some build failures in
remote-sim.c.
/home/emaisin/src/binutils-gdb/gdb/remote-sim.c: In function 'void gdbsim_load(target_ops*, const char*, int)':
/home/emaisin/src/binutils-gdb/gdb/remote-sim.c:573:22: error: conflicting declaration 'gdb_argv argv'
gdb_argv argv (args);
^
/home/emaisin/src/binutils-gdb/gdb/remote-sim.c:565:10: note: previous declaration as 'char** argv'
char **argv;
^~~~
/home/emaisin/src/binutils-gdb/gdb/remote-sim.c: In function 'void gdbsim_open(const char*, int)':
/home/emaisin/src/binutils-gdb/gdb/remote-sim.c:730:25: error: declaration of 'gdb_argv args' shadows a parameter
gdb_argv args (arg_buf);
In gdbsim_load, the new gdb_argv object conflicts with old char **argv
variable. I think the old variable should be removed.
In gdbsim_open, the new gdb_argv object conflicts with the args
parameter. This patch renames it to argv.
Built-tested for a mips host.
gdb/ChangeLog:
* remote-sim.c (gdbsim_load): Remove char **argv local variable.
(gdbsim_open): Rename gdb_argv args object to argv.
PR 21884
* elf32-i386.c (elf_i386_link_setup_gnu_properties): If the dynobj
has not been set then use the bfd returned by
_bfd_elf_link_setup_gnu_properties. If that is null then search
through all the input bfds selecting the first normal, ELF format
one.
* elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
Instead of checking if a symbol is __tls_get_addr or ___tls_get_addr,
we check if there is a reference to __tls_get_addr or ___tls_get_addr
before starting relocation check.
* elf32-i386.c (elf_i386_link_hash_entry): Change tls_get_addr
to 1 bit.
(elf_i386_link_hash_newfunc): Initialize tls_get_addr to 0.
(elf_i386_check_tls_transition): Check tls_get_addr directly.
(elf_i386_convert_load_reloc): Update tls_get_addr check.
(elf_i386_link_check_relocs): New function.
(bfd_elf32_bfd_link_check_relocs): New.
* elf64-x86-64.c (elf_x86_64_link_hash_entry): Change tls_get_addr
to 1 bit.
(elf_x86_64_link_hash_newfunc): Initialize tls_get_addr to 0.
(elf_x86_64_check_tls_transition): Check tls_get_addr directly.
(elf_x86_64_convert_load_reloc): Update tls_get_addr check.
(elf_x86_64_link_check_relocs): New function.
(bfd_elf64_bfd_link_check_relocs): New.
(bfd_elf32_bfd_link_check_relocs): Likewise.
When --no-define-common is used to build shared library, treat common
symbol as undefined so that common symbols that are referenced from a
shared library to be assigned addresses only in the main program. This
eliminates the unused duplicate space in the shared library, and also
prevents any possible confusion over resolving to the wrong duplicate
when there are many dynamic modules with specialized search paths for
runtime symbol resolution.
--no-define-common is only allowed when building a shared library.
bfd/
PR ld/21903:
* elflink.c (elf_link_add_object_symbols): Treat common symbol
as undefined for --no-define-common.
include/
PR ld/21903:
* bfdlink.h (bfd_link_info): Add inhibit_common_definition.
ld/
PR ld/21903:
* ld.h (command_line): Remove inhibit_common_definition.
* ldgram.y: Replace command_line.inhibit_common_definition with
link_info.inhibit_common_definition.
* ldlang.c (lang_common): Likewise.
* lexsup.c (parse_args): Likewise.
* ldmain.c (main): Only allow --no-define-common with -shared.
* testsuite/ld-elf/pr21903.s: New file.
* testsuite/ld-elf/pr21903a.d: Likewise.
* testsuite/ld-elf/pr21903b.d: Likewise.
* testsuite/ld-elf/pr21903c.d: Likewise.
* testsuite/ld-elf/pr21903d.d: Likewise.
* testsuite/ld-elf/pr21903e.d: Likewise.
This patch changes most sites calling tilde_expand to use
gdb::unique_xmalloc_ptr, rather than a cleanup. It also changes
scan_expression_with_cleanup to return a unique pointer, because the
patch was already touching code in that area.
Regression tested on the buildbot.
ChangeLog
2017-08-05 Tom Tromey <tom@tromey.com>
* compile/compile-object-load.c (compile_object_load): Use
gdb::unique_xmalloc_ptr.
* cli/cli-dump.c (scan_filename): Rename from
scan_filename_with_cleanup. Change return type.
(scan_expression): Rename from scan_expression_with_cleanup.
Change return type.
(dump_memory_to_file, dump_value_to_file, restore_command):
Use gdb::unique_xmalloc_ptr. Update.
* cli/cli-cmds.c (find_and_open_script): Use
gdb::unique_xmalloc_ptr.
* tracefile-tfile.c (tfile_open): Use gdb::unique_xmalloc_ptr.
* symmisc.c (maintenance_print_symbols)
(maintenance_print_msymbols): Use gdb::unique_xmalloc_ptr.
* symfile.c (symfile_bfd_open, generic_load)
(add_symbol_file_command, remove_symbol_file_command): Use
gdb::unique_xmalloc_ptr.
* source.c (openp): Use gdb::unique_xmalloc_ptr.
* psymtab.c (maintenance_print_psymbols): Use
gdb::unique_xmalloc_ptr.
* corelow.c (core_open): Use gdb::unique_xmalloc_ptr.
* breakpoint.c (save_breakpoints): Use gdb::unique_xmalloc_ptr.
* solib.c (solib_map_sections): Use gdb::unique_xmalloc_ptr.
(reload_shared_libraries_1): Likewise.
I ran the gdb.rust tests against Rust 1.20 (beta) and saw a few
failures. The failures all came because a particular item moved to a
different module. Since the particular choice of module name isn't
important here, I simply widened the allowable results.
Tested locally against rustc 1.19, 1.20, and 1.21.
testsuite/ChangeLog
2017-08-05 Tom Tromey <tom@tromey.com>
* gdb.rust/simple.exp: Allow String to appear in a different
namespace.
This removes the few remaining cleanups in the Rust language code.
The main difficulty here was that the earlier code allocated VEC heads
on an obstack. The new code instead introduces an object that
allocates and maintains the storage for whatever vectors are needed
during the parse.
Regression tested on the buildbot.
ChangeLog
2017-08-05 Tom Tromey <tom@tromey.com>
* rust-exp.y (rust_op_ptr, set_field): Remove typedefs.
(rust_op_vector, rust_set_vector): New typedefs.
(current_parser): New global.
(work_obstack): Change to pointer type. Update all users.
(rust_ast, pstate): Remove globals.
(struct rust_parser): New.
(%union) <params, field_inits>: Change type.
(start, tuple_expr, unit_expr, struct_expr_list, literal)
(field_expr, expr_list, maybe_expr_list, type_list): Update.
(ast_call_ish, ast_path, ast_function_type, ast_tuple_type)
(convert_params_to_types, convert_params_to_expression): Change
type of "params".
(ast_string): Change type of "fields".
(rust_parse): Make a rust_parser. Remove cleanups.
(rust_lex_tests): Make and install an auto_obstack.
The base bfd_link_hash_table works fine here, the only thing to watch
out for is to only set elf_gp if the output is ELF.
bfd/
* elf32-hppa.c (elf32_hppa_set_gp): Don't require an
hppa_link_hash_table.
ld/
* testsuite/ld-unique/pr21529.d: Don't xfail hppa.
When I verify my target description changes, I build GDB and GDBserver for
x32, but it failed.
/../../binutils-gdb/gdb/gdbserver/linux-amd64-ipa.c
../../../binutils-gdb/gdb/gdbserver/linux-amd64-ipa.c: In function ‘const target_desc* get_ipa_tdesc(int)’:
../../../binutils-gdb/gdb/gdbserver/linux-amd64-ipa.c:184:10: error: ‘X86_TDESC_AVX512’ was not declared in this scope
case X86_TDESC_AVX512:
^
../../../binutils-gdb/gdb/gdbserver/linux-amd64-ipa.c:185:14: error: ‘tdesc_x32_avx512_linux’ was not declared in this scope
return tdesc_x32_avx512_linux;
^
../../../binutils-gdb/gdb/gdbserver/linux-amd64-ipa.c: In function ‘void initialize_low_tracepoint()’:
../../../binutils-gdb/gdb/gdbserver/linux-amd64-ipa.c:282:36: error: ‘init_registers_x32_avx512_linux’ was not declared in this scope
init_registers_x32_avx512_linux ();
^
ipa_x32_linux_regobj use to be there, but removed by
22049425ce by mistake.
gdb/gdbserver:
2017-08-04 Yao Qi <yao.qi@linaro.org>
* configure.srv (ipa_x32_linux_regobj): New.
* linux-amd64-ipa.c (get_ipa_tdesc): Use X86_TDESC_AVX_AVX512
instead of X86_TDESC_AVX512.
(initialize_low_tracepoint): Call
init_registers_x32_avx_avx512_linux.
This patch fixes the build failure for target i686-w64-mingw32,
In file included from ../../binutils-gdb/gdb/defs.h:786:0,
from ../../binutils-gdb/gdb/gdb.c:19:
../../binutils-gdb/gdb/utils.h:188:20: error: ‘nullptr_t’ has not been declared
bool operator!= (nullptr_t)
^
../../binutils-gdb/gdb/utils.h:193:20: error: ‘nullptr_t’ has not been declared
bool operator== (nullptr_t)
^
gdb:
2017-08-04 Yao Qi <yao.qi@linaro.org>
* utils.h (gdb_argv): Add namespace std for nullptr_t.
"ld -d" assigns space to common symbols even if a relocatable output
file is specified (with '-r').
PR ld/21904
* testsuite/ld-elf/pr21904.d: New file.
* testsuite/ld-elf/pr21904.s: Likewise.
After the previous patches in this series, make_cleanup_freeargv and
gdb_buildargv are now unused and can be removed.
ChangeLog
2017-08-03 Tom Tromey <tom@tromey.com>
* utils.c (make_cleanup_freeargv, do_freeargv, gdb_buildargv):
Remove.
* utils.h (make_cleanup_freeargv, gdb_buildargv): Remove.
This changes one spot in the Python code to use gdb_argv. This
removes the last cleanup from the Python layer.
ChangeLog
2017-08-03 Tom Tromey <tom@tromey.com>
* python/py-param.c (compute_enum_values): Use gdb_argv.
This introduces gdb_argv, a class wrapping an "argv" pointer; that is,
a pointer to a NULL-terminated array of char*, where both the array
and each non-NULL element in the array are xmalloc'd.
This patch then changes most users of gdb_buildargv to use gdb_argv
instead.
ChangeLog
2017-08-03 Tom Tromey <tom@tromey.com>
* utils.h (struct gdb_argv_deleter): New.
(gdb_argv): New class.
* utils.c (gdb_argv::reset): New method.
* tracepoint.c (delete_trace_variable_command): Use gdb_argv.
* tracefile.c (tsave_command): Use gdb_argv.
* top.c (new_ui_command): Use gdb_argv.
* symmisc.c (maintenance_print_symbols)
(maintenance_print_msymbols, maintenance_expand_symtabs): Use gdb_argv.
* symfile.c (symbol_file_command, generic_load)
(remove_symbol_file_command): Use gdb_argv.
* stack.c (backtrace_command): Use gdb_argv.
* source.c (add_path, show_substitute_path_command)
(unset_substitute_path_command, set_substitute_path_command):
Use gdb_argv.
* skip.c (skip_command): Use gdb_argv. Use gdb_buildargv.
* ser-mingw.c (pipe_windows_open): Use gdb_argv.
* remote.c (extended_remote_run, remote_put_command)
(remote_get_command, remote_delete_command): Use gdb_argv.
* remote-sim.c (gdbsim_load, gdbsim_create_inferior)
(gdbsim_open): Use gdb_argv.
* python/py-cmd.c (gdbpy_string_to_argv): Use gdb_argv.
* psymtab.c (maintenance_print_psymbols): Use gdb_argv.
* procfs.c (procfs_info_proc): Use gdb_argv.
* interps.c (interpreter_exec_cmd): Use gdb_argv.
* infrun.c (handle_command): Use gdb_argv.
* inferior.c (add_inferior_command, clone_inferior_command):
Use gdb_argv.
* guile/scm-string.c (gdbscm_string_to_argv): Use gdb_argv.
* exec.c (exec_file_command): Use gdb_argv.
* cli/cli-cmds.c (alias_command): Use gdb_argv.
* compile/compile.c (build_argc_argv): Use gdb_argv.