From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 62398 invoked by alias); 13 Nov 2016 16:02:50 -0000 Mailing-List: contact archer-commits-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: Received: (qmail 62375 invoked by uid 9674); 13 Nov 2016 16:02:49 -0000 Date: Sun, 13 Nov 2016 16:02:00 -0000 Message-ID: <20161113160249.62245.qmail@sourceware.org> From: jkratoch@sourceware.org To: archer-commits@sourceware.org Subject: [SCM] users/jkratoch/dwarf5gcc: Merge remote-tracking branch 'gdb/master' into dwarf5gcc X-Git-Refname: refs/heads/users/jkratoch/dwarf5gcc X-Git-Reftype: branch X-Git-Oldrev: 3e11dd8696f156b8e79f5b2188be1cf8f894e85b X-Git-Newrev: 459afe42d7936cd753cbd3655bd9971f584bee1d X-SW-Source: 2016-q4/txt/msg00014.txt.bz2 List-Id: The branch, users/jkratoch/dwarf5gcc has been updated via 459afe42d7936cd753cbd3655bd9971f584bee1d (commit) via b612f4193c6119fb06933b0dabcc84a2b952d57e (commit) via 3f47df7fb3fb46566bb68dd638a61cef87dd14e9 (commit) via 75d6c74e79ded209b1f0959b1780ab5b8885b9c2 (commit) via 8001f1183f32d674fa3e9af1cca16856afdffc3e (commit) via d93f4d96bb0fb307db9e2dade38ddb3c6bc469ca (commit) via 6cb2202baaf482a8c7d54e5ec93af2f057e7ce28 (commit) via 8a19d84c2ba3ff1273ae1583681a0c428cf4425e (commit) via 7d15592e06e4abccc97cb8c5670f564327f747e9 (commit) via 1f8db343049c3e06483a278e14b7e140ec55c8b3 (commit) via 86b80085c889cd388fa677a5ae9053fd4be3776c (commit) via 2f7d995359c7f280431f015726485ca421b0a65a (commit) via df2c87b5803750d21f03b7d36f8d1abace3e1e14 (commit) via 74f5402d08b857d60499b27851c204954ce6c42c (commit) via c84364ece4faa7b3eb0f60f4dc301282e9693e1e (commit) via a2cfc830e715142a0dd28496feaedf569b116b0e (commit) via b0bfa7b5b884f78b798ab8d34d2a50bc63f558df (commit) via 8787d804e1cbbd1946239d6c5e560c87d38bac06 (commit) via 3d731f6949e2b0099cfbe0cf608d60a52a66d354 (commit) via 1924ff7567abf9e1341ae135fb5097bc5f7b76f4 (commit) via fa09f4ea584e1bc33036e9ef82142db92b31da7c (commit) via 7103ad7639b7ed80bec170404185a8e39079446b (commit) via 668e167446b2777869f413841ec05aed59473d9f (commit) via 65408fa680538f997cdd4b6fb9d74f043a060801 (commit) via 91588b3af8e026ba11c7368476cc1f3fa8c2e2b1 (commit) via e04659e8607bfed6995fd2ced9aaab55e2143302 (commit) via a6bbedbad370ad895a6c559a60efe27a5a7838e6 (commit) via a18590c38657a982f8d544f2f54f39ba9abe9fca (commit) via ac33b731d214d79738ca04d27f7464d4482f6a01 (commit) via 9b9720149dfee4a9a961c29d0382fc5bdf9c975b (commit) via 4e9d2153228d95c972907a8b13237218d380c5d3 (commit) via 60227d64dd9228be1a07fc7122894fc2875b1a70 (commit) via 1032d6ebdcd53b8c09c76a1c3b932065d84b0b20 (commit) via 7766fd10024dc0587838fbc4608f3f8e30e17a26 (commit) via fad0c9fb7dd362bdb5a3e4f89fb7f6e6789f5beb (commit) via 7efeed176a291c15c74e80aee5d7f906e28081cf (commit) via 8354c62cd144964fce17e11ce035c0c2c0635cbf (commit) via 64f367a201565d5c7d1e03da072db51123ac2174 (commit) via 2806dc7eec04db49fca03e04827e3dff7f6704e0 (commit) via 6c73cd95f96d37dbf6092a87c8ba0f35277223a5 (commit) via 7a63494a0df60cf71b9cf03c4eb8f24719d03e66 (commit) via 8c84bffb45ac63b98fffc5c1a492c2eb7e4f27e2 (commit) via 7bc2c8b83ea82b4315c67e7658af815aed062e73 (commit) via f5396833d35a257902409493a63f777dcd771868 (commit) via 0bb65f1e7c9eed7338ef2e4a2f5b42d010409c39 (commit) via 82b19a4d2f9c9e8d56fdffdd702f7db4af486386 (commit) via 4c1d4908aa9e61a35a2555e5529997d7f996a516 (commit) via 1f334aeb2268db153f01143e9b0ac01448ecaa56 (commit) via 7353f2470c2eda19c31c9fa44c315c7c69dea7c4 (commit) via 30a7bb833cbd848b1814f18b91dfdafba4e86839 (commit) via e8b24d9ff5b9419fc079f5fe975fac6f499f8bfb (commit) via cc977dc7d53ef4546592a4f02a2e06a621beae6f (commit) via 3cde5c42d1c1ddcf8bbde5c47233c644370c959c (commit) via 833177a4a5c1a2a6cabe70bfe35ecf241b68d169 (commit) via 2f408ecb929bd56613e94cf1e84ace4692c78257 (commit) via d2af8993a7cac29eaa5a4efd47c9117bbd175068 (commit) via 5698084a7303c45fdc94fb44c47355413b271562 (commit) via af1fe7b3b87de27d84a82d4f44b937c2800205ff (commit) via 3b4de39c9d9ff014ae90e2bafbf7ce1f42c2198e (commit) via 6f0302493af0ace93943041c3374069c15c363f7 (commit) via 66bbce5bda870c49a68f2b77a29fb96eca72632f (commit) via aaee65aea29ac8f7317e866d5dbef9f96cfdb253 (commit) via 3d8b0d9483f6eabc2c1739ac3dd64c30061a6a72 (commit) via b3ced9bad2d8d5eb9ebabc5f8f7c6ab871f63748 (commit) via c92aed165e8af79f51c5165f98f12389bb59a121 (commit) via 02030646c2a799614d31e52008403d8be067ac5d (commit) via 7b01d34b2a62fb8cda96fe40c755f99e63b8ba4f (commit) via db1ec11fff1a46f7046bcbd971a42632d2ea795c (commit) via 3ab692db7f4d96022a132379614031a852de6f35 (commit) via 09b0e4b047b44063cf4c8c00527886743619c24e (commit) via d16c5475b560adbad2d9bc78ec3718658f4090e3 (commit) via 56dbf31760f721893a44d3da26adfccf548995c7 (commit) via 77e1c7426aad05b20f48762234c02139e9c02f8e (commit) via a0f86e735886f3d373507fa9cfc0cf2a2f32eabc (commit) via 322a851675234b3c16be6dd5035b07f5e3410ec7 (commit) via 1f45808ead357e8a81dec16b9802a6c369e08426 (commit) via 8de00631b8bd1c328f1916b1fd95bd0d9ff2017e (commit) via 4d01a485d29732b19743e8b138897f3509e071b0 (commit) via b064640146bb6908a0ccca27ca8ee2b06b668137 (commit) via 896b6bda6904765f36692d76a37b99c0412ca9ae (commit) via 4f8ad951f662864884d4b11315c940c5239a4a89 (commit) via d4081a383e28db26c65298f7405554d4312b1342 (commit) via cb64e50d42a49bce61050c79c5ab0846905b6a82 (commit) via 93f9a11fbdb8f09428b17180d51a09a1bda39a52 (commit) via 0bc5d801ec836cd4b7d1ab7d05658e7a1d05df22 (commit) via 771da62d67a9f27c1e706610efe51b13c3f9fd60 (commit) via 53c3572a9f5b03a92292cb6d24bf69b52c95500e (commit) via 3b0d929dd61fcd55b4ef320a2033c731443b394f (commit) via 089e3718bd8de11fc4d6bbc8d32701033d467960 (commit) via 20955dbf718992e83b7c971344931934b62a784f (commit) via 9dc193c3be85aafa60ceff57d3b0430af607b4ce (commit) via ec7b600bf1410f6bda239666fac258a605dc3f43 (commit) via 48c97fa1ba7d6628352fc2433abd91a41f6c8171 (commit) via 5996220cfa24ef6fddb782617720cd56913b1bb7 (commit) via ad9eb1fdda263cd91ee8fb36292fb29d546b0076 (commit) via bc71081e53e3c0a52a28d5874e65a54194e2205f (commit) via a57160325ef479bd7181a4319126b1177c4a5cbb (commit) via 5ada5c6fca335963b0b9fb9e91c999fcdaab2f89 (commit) from 3e11dd8696f156b8e79f5b2188be1cf8f894e85b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 459afe42d7936cd753cbd3655bd9971f584bee1d Merge: 3e11dd8 b612f41 Author: Jan Kratochvil Date: Sun Nov 13 17:02:24 2016 +0100 Merge remote-tracking branch 'gdb/master' into dwarf5gcc commit b612f4193c6119fb06933b0dabcc84a2b952d57e Author: Anthony Green Date: Sun Nov 13 08:11:44 2016 -0500 add missing ChangeLog entry commit 3f47df7fb3fb46566bb68dd638a61cef87dd14e9 Author: Anthony Green Date: Sun Nov 13 07:37:02 2016 -0500 Assemble 'bad' moxie instruction commit 75d6c74e79ded209b1f0959b1780ab5b8885b9c2 Author: GDB Administrator Date: Sun Nov 13 00:00:20 2016 +0000 Automatic date update in version.in commit 8001f1183f32d674fa3e9af1cca16856afdffc3e Author: Tom Tromey Date: Tue Nov 8 20:32:50 2016 -0700 Remove some cleanups from the rust code This removes some cleanups from the rust code, in favor of C++ objects with destructors. 2016-11-12 Tom Tromey * rust-exp.y (super_name): Use std::vector. (lex_number): Use std::string. (convert_params_to_types): Return std::vector. (convert_ast_to_type, convert_name): Update. * rust-lang.c (rust_get_disr_info): Use unique_xmalloc_ptr. commit d93f4d96bb0fb307db9e2dade38ddb3c6bc469ca Author: Tom Tromey Date: Tue Nov 8 20:22:29 2016 -0700 Use std::string in rust_get_disr_info This changes rust_get_disr_info to use std::string in one more spot, avoiding a memory leak. 2016-11-12 Tom Tromey * rust-lang.c (rust_get_disr_info): Use std::string in one more spot. commit 6cb2202baaf482a8c7d54e5ec93af2f057e7ce28 Author: Mike Frysinger Date: Sat Nov 12 01:02:23 2016 -0500 sim: mips: add PR info to ChangeLog commit 8a19d84c2ba3ff1273ae1583681a0c428cf4425e Author: GDB Administrator Date: Sat Nov 12 00:00:19 2016 +0000 Automatic date update in version.in commit 7d15592e06e4abccc97cb8c5670f564327f747e9 Author: Yao Qi Date: Fri Nov 11 16:50:42 2016 +0000 Don't handle unavailable/optimized-out in spu_software_single_step When we do software single step, frame is always the innermost one, so it is impossible to get unavailable/optimized-out errors. gdb: 2016-11-11 Yao Qi * spu-tdep.c (spu_software_single_step): Don't call get_frame_register_bytes, call get_frame_register_unsigned instead. commit 1f8db343049c3e06483a278e14b7e140ec55c8b3 Author: Catherine Moore Date: Fri Nov 11 07:42:37 2016 -0800 Identify verilog dump tests as such. A couple of the verilog dump tests were marked as ihex tests. This patch identifies the tests as verilog format dump tests. commit 86b80085c889cd388fa677a5ae9053fd4be3776c Author: Nick Clifton Date: Fri Nov 11 15:13:07 2016 +0000 Accept L and LL suffixes to integer constants. PR gas/20732 * expr.c (integer_constant): If tc_allow_L_suffix is defined and non-zero then accept a L or LL suffix. * testsuite/gas/sparc/pr20732.d: New test source file. * testsuite/gas/sparc/pr20732.d: New test output file. * testsuite/gas/sparc/sparc.exp: Run new test. commit 2f7d995359c7f280431f015726485ca421b0a65a Author: Nick Clifton Date: Fri Nov 11 14:13:02 2016 +0000 Extend information displayed about objdump's output of dynamic symbols. commit df2c87b5803750d21f03b7d36f8d1abace3e1e14 Author: Nick Clifton Date: Fri Nov 11 11:49:45 2016 +0000 Add the ability for nm to display symbol version information. PR binutils/20751 * nm.c (with_symbol_versions): New local variable. (long_options): Add --with-symbol-versions. (usage): Mention --with-symbol-versions. (print_symbol): If with_symbol_versions is set then display the version information associated with the symbol. * NEWS: Mention the new feature. * doc/binutils.texi (nm): Document the new option. (objdump): Describe how symbol version information is displayed for dynamic symbol dumps. (readelf): Describe how symbol version information is displayed. * testsuite/binutils-all/nm.exp: Add a test of the new feature. commit 74f5402d08b857d60499b27851c204954ce6c42c Author: Szabolcs Nagy Date: Fri Nov 11 10:43:15 2016 +0000 [AArch64] Add ARMv8.3 combined pointer authentication branch instructions Add support for ARMv8.3 pointer authentication instructions that are encoded as unconditional branch instructions. opcodes/ 2016-11-11 Szabolcs Nagy * aarch64-tbl.h (arch64_opcode_table): Add braa, brab, blraa, blrab, braaz, brabz, blraaz, blrabz, retaa, retab, eretaa, eretab. * aarch64-asm-2.c: Regenerate. * aarch64-dis-2.c: Regenerate. * aarch64-opc-2.c: Regenerate. gas/ 2016-11-08 Szabolcs Nagy * testsuite/gas/aarch64/pac.s: Add ARMv8.3 branch instruction tests. * testsuite/gas/aarch64/pac.d: Likewise. commit c84364ece4faa7b3eb0f60f4dc301282e9693e1e Author: Szabolcs Nagy Date: Fri Nov 11 10:39:46 2016 +0000 [AArch64] Add ARMv8.3 PACGA instruction Add support for the ARMv8.3 PACGA instruction. include/ 2016-11-11 Szabolcs Nagy * opcode/aarch64.h (enum aarch64_opnd): Add AARCH64_OPND_Rm_SP. opcodes/ 2016-11-11 Szabolcs Nagy * aarch64-tbl.h (arch64_opcode_table): Add pacga. (AARCH64_OPERANDS): Add Rm_SP. * aarch64-opc.c (aarch64_print_operand): Handle AARCH64_OPND_Rm_SP. * aarch64-asm-2.c: Regenerate. * aarch64-dis-2.c: Regenerate. * aarch64-opc-2.c: Regenerate. gas/ 2016-11-11 Szabolcs Nagy * config/tc-aarch64.c (process_omitted_operand): Handle AARCH64_OPND_Rm_SP. (parse_operands): Likewise. * testsuite/gas/aarch64/pac.s: Add pacga. * testsuite/gas/aarch64/pac.d: Add pacga. commit a2cfc830e715142a0dd28496feaedf569b116b0e Author: Szabolcs Nagy Date: Fri Nov 11 10:36:32 2016 +0000 [AArch64] Add ARMv8.3 single source PAC instructions Add support for ARMv8.3 pointer authentication instructions that are encoded as single source data processing instructions. opcodes/ 2016-11-08 Szabolcs Nagy * aarch64-tbl.h (arch64_opcode_table): Add pacia, pacib, pacda, pacdb, autia, autib, autda, autdb, paciza, pacizb, pacdza, pacdzb, autiza, autizb, autdza, autdzb, xpaci, xpacd. * aarch64-asm-2.c: Regenerate. * aarch64-dis-2.c: Regenerate. * aarch64-opc-2.c: Regenerate. gas/testsuite/ 2016-11-11 Szabolcs Nagy * testsuite/gas/aarch64/pac.s: New. * testsuite/gas/aarch64/pac.d: New. commit b0bfa7b5b884f78b798ab8d34d2a50bc63f558df Author: Szabolcs Nagy Date: Fri Nov 11 10:33:30 2016 +0000 [AArch64] Add ARMv8.3 pointer authentication key registers Add support for system registers introduced in ARMv8.3 for pointer authentication. opcodes/ 2016-11-11 Szabolcs Nagy * aarch64-opc.c (aarch64_sys_regs): Add apiakeylo_el1, apiakeyhi_el1, apibkeylo_el1, apibkeyhi_el1, apdakeylo_el1, apdakeyhi_el1, apdbkeylo_el1, apdbkeyhi_el1, apgakeylo_el1 and apgakeyhi_el1. (aarch64_sys_reg_supported_p): Add feature test for new registers. gas/ 2016-11-11 Szabolcs Nagy * testsuite/gas/aarch64/sysreg-3.s: New. * testsuite/gas/aarch64/sysreg-3.d: New. * testsuite/gas/aarch64/illegal-sysreg-3.l: New. * testsuite/gas/aarch64/illegal-sysreg-3.d: New. commit 8787d804e1cbbd1946239d6c5e560c87d38bac06 Author: Szabolcs Nagy Date: Fri Nov 11 10:29:07 2016 +0000 [AArch64] Add ARMv8.3 instructions which are in the NOP space This patch adds support for a subset of the ARMv8.3 pointer authentication instructions: XPACLRI, PACIA1716, PACIB1716, AUTIA1716, AUTIA1716, PACIAZ, PACIASP, PACIBZ, PACISP, AUTIAZ, AUTIASP, AUTIBZ, AUTIBSP. These are aliases to HINT #0x7, HINT #0x8, HINT #0xa, HINT #0xc, HINT #0xe, HINT #0x18, HINT #0x19, ..., HINT #0x1f respectively. For more details about pointer authentication in ARMv8.3 see https://community.arm.com/groups/processors/blog/2016/10/27/armv8-a-architecture-2016-additions opcodes/ 2016-11-11 Szabolcs Nagy * aarch64-tbl.h (aarch64_feature_v8_3, ARMV8_3, V8_3_INSN): New. (arch64_opcode_table): Add xpaclri, pacia1716, pacib1716, autia1716, autib1716, paciaz, paciasp, pacibz, pacibsp, autiaz, autiasp, autibz, autibsp. * aarch64-asm-2.c: Regenerate. * aarch64-dis-2.c: Regenerate. gas/ 2016-11-11 Szabolcs Nagy * testsuite/gas/aarch64/system-3.s: New. * testsuite/gas/aarch64/system-3.d: New. * testsuite/gas/aarch64/system.d: Update expected output. commit 3d731f6949e2b0099cfbe0cf608d60a52a66d354 Author: Szabolcs Nagy Date: Fri Nov 11 10:22:56 2016 +0000 [AArch64] Increase max_num_aliases in aarch64-gen Some ARMv8.3 pointer authentication instructions are encoded as HINT aliases, so to allow more instruction aliases in the generator, max_num_aliases is increased from 16 to 32. opcodes/ 2016-11-11 Szabolcs Nagy * aarch64-gen.c (find_alias_opcode): Increase max_num_aliases to 32. commit 1924ff7567abf9e1341ae135fb5097bc5f7b76f4 Author: Szabolcs Nagy Date: Fri Nov 11 10:20:30 2016 +0000 [AArch64] Add ARMv8.3 command line option and feature flag ARMv8.3 can be selected with -march=armv8.3-a command line option. An overview of the ARMv8.3 architecture extension is at https://community.arm.com/groups/processors/blog/2016/10/27/armv8-a-architecture-2016-additions gas/ 2016-11-11 Szabolcs Nagy * config/tc-aarch64.c (aarch64_archs): Add "armv8.3-a". * doc/c-aarch64.texi (-march): Likewise. include/ 2016-11-11 Szabolcs Nagy * opcode/aarch64.h (AARCH64_FEATURE_V8_3): Define. (AARCH64_ARCH_V8_3): Define. (AARCH64_ARCH_V8_1, AARCH64_ARCH_V8_2): Simplify. commit fa09f4ea584e1bc33036e9ef82142db92b31da7c Author: Szabolcs Nagy Date: Fri Nov 11 10:14:31 2016 +0000 [AArch64] Fix feature dependencies for +simd and +crypto According to the gas manual, +simd implies +fp and +crypto implies +simd. Make sure +nofp turns +simd, +crypto and +fp16 off. gas/ 2016-11-07 Szabolcs Nagy * config/tc-aarch64.c (aarch64_features): Fix "simd" and "crypto". * testsuite/gas/aarch64/illegal-crypto-nofp.d: New. * testsuite/gas/aarch64/illegal-crypto-nofp.l: New. * testsuite/gas/aarch64/illegal-fp16-nofp.d: New. * testsuite/gas/aarch64/illegal-fp16-nofp.l: New. * testsuite/gas/aarch64/illegal-fp16-nofp.s: New. commit 7103ad7639b7ed80bec170404185a8e39079446b Author: Luke Allardyce Date: Fri Nov 11 10:08:05 2016 +0000 Accept hidden COFF symbols, but treat them as if they were debugging symbols. PR ld/20722 * coffcode.h (coff_slurp_symbol_table): Accept C_HIDDEN symbols, but treat them as debugging symbols. commit 668e167446b2777869f413841ec05aed59473d9f Author: Yao Qi Date: Fri Nov 11 08:38:31 2016 +0000 Remove apply_val_pretty_printer parameter valaddr This patch removes the parameter valaddr of extension_language_ops::apply_val_pretty_printer and remove const from "struct value *val". valaddr can be got in each extension language's implementation of apply_val_pretty_printer. gdb: 2016-11-11 Yao Qi * cp-valprint.c (cp_print_value): Remove local base_valaddr. * extension-priv.h (struct extension_language_ops) : Remove the second parameter. Remove const from "struct value *". Callers updated. * extension.c (apply_ext_lang_val_pretty_printer): Update comments. Remove parameter valaddr. Remove const from "struct value *". * extension.h (apply_ext_lang_val_pretty_printer): Update declaration. * guile/guile-internal.h (gdbscm_apply_val_pretty_printer): Update declaration. * guile/scm-pretty-print.c (gdbscm_apply_val_pretty_printer): Remove parameter valaddr. Remove const from "struct value *". * python/py-prettyprint.c (gdbpy_apply_val_pretty_printer): Likewise. * python/python-internal.h (gdbpy_apply_val_pretty_printer): Update declaration. commit 65408fa680538f997cdd4b6fb9d74f043a060801 Author: Yao Qi Date: Fri Nov 11 08:38:31 2016 +0000 Remove parameter valaddr from c print functions This patch removes parameter valaddr from some c print functions. gdb: 2016-11-11 Yao Qi * c-lang.h (cp_print_value_fields): Update declaration. * cp-valprint.c (cp_print_value): Update declaration. (cp_print_value_fields): Remove parameter valaddr. Callers updated. (cp_print_value): Likewise. commit 91588b3af8e026ba11c7368476cc1f3fa8c2e2b1 Author: Mike Frysinger Date: Fri Nov 11 01:29:21 2016 -0500 sim: mips: fix dv-tx3904cpu build error When building for mipstx39-rtems4.12 targets, some funcs use SD and CPU implicitly. Restore the defines for these to the local sd and cpu vars. This was broken by the clean up in commit d47f5b30d8481272e9480118bdcb. Reported-by: Joel Sherrill commit e04659e8607bfed6995fd2ced9aaab55e2143302 Author: Mike Frysinger Date: Fri Nov 11 01:28:36 2016 -0500 sim: mips: fix builds for r3900 cpus due to missing check_u64 commit a6bbedbad370ad895a6c559a60efe27a5a7838e6 Author: GDB Administrator Date: Fri Nov 11 00:00:08 2016 +0000 Automatic date update in version.in commit a18590c38657a982f8d544f2f54f39ba9abe9fca Author: Nick Clifton Date: Thu Nov 10 12:26:53 2016 +0000 Provide a more helpful error message when the BFD library is unable to load an extremely large section. PR target/20737 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Bind defined symbol locally in PIE. commit ac33b731d214d79738ca04d27f7464d4482f6a01 Author: Jiong Wang Date: Thu Nov 10 09:25:17 2016 +0000 [AArch64] Bind defined symbol locally in PIE bfd/ PR target/20737 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Bind defined symbol locally in PIE. ld/ * testsuite/ld-aarch64/pie-bind-locally-a.s: New test source. * testsuite/ld-aarch64/pie-bind-locally-b.s: Likewise. * testsuite/ld-aarch64/pie-bind-locally.d: New testcase. * testsuite/ld-aarch64/aarch64-elf.exp: Run new testcase. commit 9b9720149dfee4a9a961c29d0382fc5bdf9c975b Author: Tom Tromey Date: Sat Oct 15 09:20:02 2016 -0600 Use unique_xmalloc_ptr in Python code This changes some utility functions in the Python code to return unique_xmalloc_ptr, and then fixes up the callers. I chose unique_xmalloc_ptr rather than std::string because at a few call points the xmalloc'd string is released and ownership transferred elsewhere. This patch found a few existing memory leaks. For example, py-unwind.c called gdbpy_obj_to_string but never freed the result. Built and regression tested on the buildbot. 2016-11-09 Tom Tromey * varobj.h (varobj_get_display_hint): Change return type. * varobj.c (varobj_get_display_hint): Return unique_xmalloc_ptr. (varobj_value_get_print_value): Update. * python/python.c (gdbpy_before_prompt_hook, gdbpy_print_stack) (gdbpy_apply_type_printers): Update. * python/python-internal.h (unicode_to_target_string) (python_string_to_target_string, python_string_to_host_string) (gdbpy_obj_to_string, gdbpy_exception_to_string) (gdbpy_get_display_hint): Change return types. * python/py-varobj.c (py_varobj_iter_next): Update. * python/py-value.c (valpy_getitem, convert_value_from_python): Update. * python/py-utils.c (unicode_to_encoded_string) (unicode_to_target_string, python_string_to_target_string) (python_string_to_host_string, gdbpy_obj_to_string) (gdbpy_exception_to_string): Return unique_xmalloc_ptr. * python/py-unwind.c (pyuw_parse_register_id): Update. * python/py-type.c (typy_getitem): Update. * python/py-prettyprint.c (gdbpy_get_display_hint) (print_stack_unless_memory_error, print_children) (gdbpy_apply_val_pretty_printer): Update. * python/py-param.c (set_parameter_value): Update. (get_doc_string, call_doc_function): Return unique_xmalloc_ptr. (get_set_value, get_show_value, compute_enum_values, parmpy_init): Update. * python/py-infthread.c (thpy_set_name): Update. * python/py-function.c (fnpy_call, fnpy_init): Update. * python/py-framefilter.c (extract_sym): Change "name" to unique_xmalloc_ptr. (enumerate_args, enumerate_locals): Update. (py_print_frame): Use unique_xmalloc_ptr. * python/py-frame.c (frapy_read_var): Update. Remove cleanup. * python/py-cmd.c (cmdpy_function, cmdpy_completer, cmdpy_init): Update. * python/py-breakpoint.c (bppy_set_condition): Use unique_xmalloc_ptr. (bppy_init): Likewise. Remove cleanup. (local_setattro): Update. * mi/mi-cmd-var.c (print_varobj, mi_cmd_var_list_children) (varobj_update_one): Update. commit 4e9d2153228d95c972907a8b13237218d380c5d3 Author: GDB Administrator Date: Thu Nov 10 00:00:17 2016 +0000 Automatic date update in version.in commit 60227d64dd9228be1a07fc7122894fc2875b1a70 Author: H.J. Lu Date: Wed Nov 9 14:00:18 2016 -0800 X86: Remove the .s suffix from EVEX vpextrw The .s suffix indicates that the instruction is encoded by swapping 2 register operands. Since vpextrw takes an XMM register and an integer register, the .s suffix should be ignored for EVEX vpextrw. gas/ PR binutils/20799 * testsuite/gas/i386/opcode.s: Add a test for EVEX vpextrw. * testsuite/gas/i386/opcode-intel.d: Updated. * testsuite/gas/i386/opcode-suffix.d: Likewise. * testsuite/gas/i386/opcode.d: Likewise. * testsuite/gas/i386/x86-64-avx512bw-opts.s: Remove vpextrw tests. * testsuite/gas/i386/x86-64-avx512bw-opts-intel.d: Updated. * testsuite/gas/i386/x86-64-avx512bw-opts.d: Likewise. opcodes/ PR binutils/20799 * i386-dis-evex.h (evex_table): Replace EdqwS with Edqw. * i386-dis.c (EdqwS): Removed. (dqw_swap_mode): Likewise. (intel_operand_size): Don't check dqw_swap_mode. (OP_E_register): Likewise. (OP_E_memory): Likewise. (OP_G): Likewise. (OP_EX): Likewise. * i386-opc.tbl: Remove "S" from EVEX vpextrw. * i386-tbl.h: Regerated. commit 1032d6ebdcd53b8c09c76a1c3b932065d84b0b20 Author: H.J. Lu Date: Wed Nov 9 13:44:42 2016 -0800 Update opcodes/ChangeLog commit 7766fd10024dc0587838fbc4608f3f8e30e17a26 Author: H.J. Lu Date: Wed Nov 9 12:11:50 2016 -0800 X86: Update opcode-suffix.d PR binutils/20754 * testsuite/gas/i386/opcode-suffix.d: Updated. commit fad0c9fb7dd362bdb5a3e4f89fb7f6e6789f5beb Author: Pedro Alves Date: Wed Nov 9 18:48:25 2016 +0000 Further cleanup/modernization of gdb.base/commands.exp - Use multi_line for matching multi-line GDB output. - Add a multi_line_input variant of multi_line to build GDB input and use it throughout. (The two changes above make the tests much more readable, IMO.) - Add a new valnum_re global to get rid of the multiple "\\\$\[0-9\]*". - Remove gdb_stop_suppressing_tests uses. - tighten a few regexps. - Replace send_gdb/gdb_expect with gdb_test_multiple and simplify, making pass/fail messages the same. gdb/ChangeLog: 2016-11-09 Pedro Alves * gdb.base/commands.exp (runto_or_return): New procedure. (gdbvar_simple_if_test, gdbvar_simple_while_test) (gdbvar_complex_if_while_test, progvar_simple_if_test) (progvar_simple_while_test, progvar_complex_if_while_test) (if_while_breakpoint_command_test) (infrun_breakpoint_command_test, breakpoint_command_test) (user_defined_command_test, watchpoint_command_test) (test_command_prompt_position, redefine_hook_test) (stray_arg0_test, error_clears_commands_left, redefine_hook_test) (redefine_backtrace_test): Use runto_or_return, $valnum_re, multi_line_input and multi_line. Remove gdb_expect and gdb_stop_suppressing_tests uses. * lib/gdb.exp (valnum_re): New global. * lib/gdb.exp (valnum_re): New global. (multi_line_input): New procedure. commit 7efeed176a291c15c74e80aee5d7f906e28081cf Author: H.J. Lu Date: Wed Nov 9 10:20:13 2016 -0800 X86: Merge AVX512F vmovq AVX512F vmovq doesn't support masking. We can't swap register operand in AVX512F vmovq with Reg64 since Reg64 != RegXMM. This patch merges AVX512F vmovq. * i386-opc.tbl: Merge AVX512F vmovq. commit 8354c62cd144964fce17e11ce035c0c2c0635cbf Author: Simon Marchi Date: Wed Nov 9 10:55:14 2016 -0500 Make gdb.mi/user-selected-context-sync.exp use proc_with_prefix Pedro's patch provides a cleaner way to prefix tests with the proc name, so let's use that. gdb/testsuite/ChangeLog: * gdb.mi/user-selected-context-sync.exp (with_test_prefix_procname): Remove. (test_setup): Define with proc_with_prefix. (test_cli_inferior): Likewise. (test_cli_thread): Likewise. (test_cli_frame): Likewise. (test_cli_select_frame): Likewise. (test_cli_up_down): Likewise. (test_mi_thread_select): Likewise. (test_mi_stack_select_frame): Likewise. (test_cli_in_mi_inferior): Likewise. (test_cli_in_mi_thread): Likewise. (test_cli_in_mi_frame): Likewise. (top level): Do not use with_test_prefix_procname. commit 64f367a201565d5c7d1e03da072db51123ac2174 Author: Pedro Alves Date: Wed Nov 9 15:45:49 2016 +0000 gdb/testsuite: Introduce "proc_with_prefix" While adding new tests to gdb.base/commands.exp, I noticed that the file includes a bunch of individual testcases split into their own procedures, and that none have ever been adjusted to use with_test_prefix. Instead, each gdb_test/gdb_test_multiple/etc invocation takes care of including the procedure name in the test message, in order to make sure test messages are unique. Simon convinced me that using the procedure name as prefix is not that bad of an idea: https://sourceware.org/ml/gdb-patches/2016-10/msg00020.html This commit adds an IMO simpler alternative to with_test_prefix_procname added by that patch -- a new "proc_with_prefix" convenience proc that is meant to be used in place of "proc", and then uses it in commands.exp. Procedures defined with this automatically run their bodies under with_test_prefix $proc_name. Here's a sample of the resulting gdb.sum diff: [...] -PASS: gdb.base/commands.exp: break factorial #3 -PASS: gdb.base/commands.exp: set value to 5 in test_command_prompt_position -PASS: gdb.base/commands.exp: if test in test_command_prompt_position -PASS: gdb.base/commands.exp: > OK in test_command_prompt_position +PASS: gdb.base/commands.exp: test_command_prompt_position: break factorial +PASS: gdb.base/commands.exp: test_command_prompt_position: set value to 5 +PASS: gdb.base/commands.exp: test_command_prompt_position: if test +PASS: gdb.base/commands.exp: test_command_prompt_position: > OK [...] gdb/testsuite/ChangeLog: 2016-11-09 Pedro Alves * gdb.base/commands.exp (gdbvar_simple_if_test) (gdbvar_simple_while_test, gdbvar_complex_if_while_test) (progvar_simple_if_test, progvar_simple_while_test) (progvar_complex_if_while_test, if_while_breakpoint_command_test) (infrun_breakpoint_command_test, breakpoint_command_test) (user_defined_command_test, watchpoint_command_test) (test_command_prompt_position, deprecated_command_test) (bp_deleted_in_command, temporary_breakpoint_commands) (stray_arg0_test, source_file_with_indented_comment) (recursive_source_test, if_commands_test) (error_clears_commands_left, redefine_hook_test) (redefine_backtrace_test): Use proc_with_prefix. * lib/gdb.exp (proc_with_prefix): New proc. commit 2806dc7eec04db49fca03e04827e3dff7f6704e0 Author: Pedro Alves Date: Wed Nov 9 15:09:31 2016 +0000 Fix formattting of gdb/ChangeLog and gdb/testsuite/ChangeLog enties Leading tab/spaces. Missing periods. Duplicate date. commit 6c73cd95f96d37dbf6092a87c8ba0f35277223a5 Author: Pedro Alves Date: Wed Nov 9 12:49:43 2016 +0000 agent_expr_up: gdb::unique_ptr -> std::unique_ptr Now that we require C++11, use std::unique_ptr directly. This allows simplifying collection_list a bit by placing unique pointers in the vector directly, making the vector own its elements. gdb/ChangeLog: 2016-11-09 Pedro Alves * ax-gdb.c (agent_eval_command_one): Use std::move instead of gdb::move. * ax.h (agent_expr_up): Use std::unique_ptr instead of gdb::unique_ptr. * breakpoint.c (parse_cond_to_aexpr): Use std::move instead of gdb::move. * tracepoint.c (collection_list::collect_symbol): Likewise. (collection_list::~collection_list): Delete. (encode_actions_1): Use std::move instead of gdb::move. (collection_list::add_aexpr): Use std::move instead of unique_ptr::release. * tracepoint.h (collection_list) <~collection_list>: Delete declaration. : Now a vector of agent_ptr_up. commit 7a63494a0df60cf71b9cf03c4eb8f24719d03e66 Author: Pedro Alves Date: Wed Nov 9 14:53:58 2016 +0000 gdb: Use vector::emplace_back Now that we require C++11, we can use vector::emplace_back to construct elements in place instead of constructing and then copying. gdb/ChangeLog: 2016-11-09 Pedro Alves * main.c (struct cmdarg): Add constructor. (captured_main_1): Use vector::emplace_back. * tracepoint.c (collection_list::add_memrange): Likewise. commit 8c84bffb45ac63b98fffc5c1a492c2eb7e4f27e2 Author: Andreas Arnez Date: Wed Nov 9 13:02:13 2016 +0100 tui-winsource: Remove failed-allocation logic This removes dead code in tui_alloc_source_buffer for handling a NULL return value from xmalloc. gdb/ChangeLog: * tui/tui-winsource.c (tui_alloc_source_buffer): Remove failed-xmalloc handling. commit 7bc2c8b83ea82b4315c67e7658af815aed062e73 Author: Andreas Arnez Date: Wed Nov 9 13:02:13 2016 +0100 tui-winsource: Allocate for actual lines only The logic for allocating a TUI source window's content buffer allocates two more lines than needed, because it does not reduce the window height by the highlight box's overhead. However, it does reduce the line width accordingly. This patch makes the height and width calculation consistent and improves the comment. gdb/ChangeLog: * tui/tui-winsource.c (tui_alloc_source_buffer): Subtract highlight box's overhead when calculating the content height. commit f5396833d35a257902409493a63f777dcd771868 Author: Andreas Arnez Date: Wed Nov 9 13:02:13 2016 +0100 tui-disasm: Fix line buffer size calculation The code that fills the TUI disassembly window content first calculates the maximum full length of a displayed disassembly line. This calculation typically yields the wrong result. The result is too large, so the bug does not cause any run-time failures, but unnecessary confusion for the reader. This patch fixes the calculation. gdb/ChangeLog: * tui/tui-disasm.c (tui_set_disassem_content): Fix calculation of the longest disassembly line's length. commit 0bb65f1e7c9eed7338ef2e4a2f5b42d010409c39 Author: Andreas Arnez Date: Wed Nov 9 13:02:12 2016 +0100 tui-disasm: Fix window content buffer overrun A user reported a GDB crash with TUI when trying to debug a function with a long demangled C++ method name. It turned out that the logic for displaying the TUI disassembly window has a bug that can cause a buffer overrun, possibly overwriting GDB-internal data structures. In particular, the logic performs an unguarded strcpy. Another (harmless) bug in tui_alloc_source_buffer causes the buffer to be two lines longer than needed. This may have made the crash appear less frequently. gdb/ChangeLog: * tui/tui-disasm.c (tui_set_disassem_content): Fix line buffer overrun due to unchecked strcpy. gdb/testsuite/ChangeLog: * gdb.base/tui-layout.c: New file. * gdb.base/tui-layout.exp: Use tui-layout.c, to ensure that the disassembly window contains very long lines. commit 82b19a4d2f9c9e8d56fdffdd702f7db4af486386 Author: Tristan Gingold Date: Wed Nov 9 10:25:00 2016 +0100 darwin-nat.c: handle Darwin 16 (aka Sierra). Support message from new task and dead name notification on task of an existing process. With Sierra, exec(2) terminate the current task and creates a new one. 'set startup-with-shell off' must still be used on Darwin 16. 2016-11-09 Tristan Gingold * darwin-nat.c (find_inferior_task_it): Fix indentation. (find_inferior_notify_it): Remove. (find_inferior_pid_it): New function. (darwin_find_inferior_by_notify): Remove. (darwin_find_inferior_by_pid): New function. (darwin_find_new_inferior): New function. (darwin_check_message_ndr): New function from darwin_decode_exception_message. (darwin_decode_exception_message): Call darwin_check_message_ndr. Handle SIGTRAP addressed to an unknown task (when a task spawned). (darwin_decode_notify_message): New function. (darwin_decode_message): Handle unknown task. (darwin_deallocate_threads): New function from darwin_mourn_inferior. (darwin_mourn_inferior): Use darwin_deallocate_threads and darwin_deallocate_exception_ports. (darwin_deallocate_exception_ports): New function from darwin_mourn_inferior. (darwin_setup_exceptions): New function from darwin_attach_pid. (darwin_setup_request_notification): Likewise. (darwin_attach_pid): Call darwin_setup_request_notification and darwin_setup_request_notification. commit 4c1d4908aa9e61a35a2555e5529997d7f996a516 Author: GDB Administrator Date: Wed Nov 9 00:00:27 2016 +0000 Automatic date update in version.in commit 1f334aeb2268db153f01143e9b0ac01448ecaa56 Author: H.J. Lu Date: Tue Nov 8 11:03:06 2016 -0800 X86: Remove the THREE_BYTE_0F7A entry Remove the THREE_BYTE_0F7A entry which is leftover from SSE5. PR binutils/20701 * i386-dis.c (THREE_BYTE_0F7A): Removed. (dis386_twobyte): Don't use THREE_BYTE_0F7A. (three_byte_table): Remove THREE_BYTE_0F7A. commit 7353f2470c2eda19c31c9fa44c315c7c69dea7c4 Author: Tom Tromey Date: Mon Oct 31 11:23:34 2016 -0600 Fix py-value.exp failure on Python 3 I happened to notice that one test in py-value.exp did not work properly with Python 3. This patch fixes the problem. 2016-11-08 Tom Tromey * gdb.python/py-value.exp (test_value_creation): Make "long" test depend on Python 2. commit 30a7bb833cbd848b1814f18b91dfdafba4e86839 Author: Tom Tromey Date: Mon Oct 31 11:10:35 2016 -0600 Fix some error-handling bugs in python frame filters While writing a Python frame filter, I found a few bugs in the current frame filter code. In particular: * One spot converts a Python long to a CORE_ADDR using PyLong_AsLong. However, this can fail on overflow. I changed this to use get_addr_from_python. * Another spot is doing the same but with PyLong_AsUnsignedLongLong; I changed this as well just for consistency. * Converting line numbers can print "-1" if conversion from long fails. This isn't fatal but just a bit ugly. I've included a test case for the first issue. The line number one didn't seem important enough to bother with. 2016-11-08 Tom Tromey * python/py-framefilter.c (py_print_frame): Use get_addr_from_python. Check for errors when getting line number. 2016-11-08 Tom Tromey * gdb.python/py-framefilter.py (ElidingFrameDecorator.address): New method. commit e8b24d9ff5b9419fc079f5fe975fac6f499f8bfb Author: Yao Qi Date: Tue Nov 8 16:02:42 2016 +0000 Remove parameter valaddr from la_val_print Nowadays, we pass both val and return value of value_contents_for_printing (val) to la_val_print. The latter is unnecessary. This patch removes the second parameter of la_val_print, and get valaddr in each language's implementation by calling value_contents_for_printing. Since value_contents_for_printing calls value_fetch_lazy, I also make VAL non-const. Note that - I don't clean up the valaddr usages in each language's routines, - I don't remove valaddr from apply_ext_lang_val_pretty_printer, and extension language ops apply_val_pretty_printer. They can be done in followup patches. gdb: 2016-11-08 Yao Qi * ada-lang.h (ada_val_print): Remove second parameter. Remove const from "struct value *". * ada-valprint.c (print_field_values): Remove const from "struct value *". (val_print_packed_array_elements): Likewise. (print_variant_part): Likewise. (ada_val_print_string): Likewise. (ada_val_print_gnat_array): Likewise. (ada_val_print_ptr): Likewise. (ada_val_print_num): Likewise. (ada_val_print_enum): Likewise. (ada_val_print_flt): Likewise. (ada_val_print_union): Likewise. (ada_val_print_struct_union): Likewise. (ada_val_print_ref): Likewise. (ada_val_print_1): Remove second parameter. Remove const from "struct value *". (ada_val_print): Likewise. * c-lang.h (c_val_print): Likewise. * c-valprint.c (c_val_print_array): Remove const from "struct value *". (c_val_print_ptr): Likewise. (c_val_print_struct): Likewise. (c_val_print_union): Likewise. (c_val_print_int): Likewise. (c_val_print_memberptr): Likewise. (c_val_print): Remove second parameter. Remove const from "struct value *". All callers updated. * cp-valprint.c (cp_print_value): Remove const from "struct value *". (cp_print_value_fields): Likewise. (c_val_print_value): Likewise. * d-lang.h (d_val_print): Remove second parameter. Remove const from "struct value *". * d-valprint.c (dynamic_array_type): Likewise. (d_val_print): Likewise. * f-lang.h (f_val_print): Likewise. * f-valprint.c (f_val_print): Likewise. * go-lang.h (go_val_print): Likewise. * go-valprint.c (print_go_string): Likewise. (go_val_print): Likewise. * language.c (unk_lang_val_print): Likewise. * language.h (struct language_defn) : Likewise. Update comments. (LA_VAL_PRINT): Remove. * m2-lang.h (m2_val_print): Remove const from "struct value *". * m2-valprint.c (m2_print_array_contents): Likewise. (m2_val_print): Likewise. * p-lang.h (pascal_val_print): Remove second parameter. Remove const from "struct value *". (pascal_object_print_value_fields): Likewise. * p-valprint.c (pascal_val_print): Likewise. (pascal_object_print_value_fields): Likewise. (pascal_object_print_value): Likewise. * rust-lang.c (rust_get_disr_info): Likewise. (val_print_struct): Likewise. (rust_val_print): Likewise. * valprint.c (generic_val_print_array): Likewise. (generic_val_print_ptr): Likewise. (generic_val_print_memberptr): Likewise. (generic_val_print_ref): Likewise. (generic_val_print_enum): Likewise. (generic_val_print_flags): Likewise. (generic_val_print_func): Likewise. (generic_val_print_bool): Likewise. (generic_val_print_int): Likewise. (generic_val_print_char): Likewise. (generic_val_print_float): Likewise. (generic_val_print_decfloat): Likewise. (generic_val_print_complex): Likewise. (generic_val_print): Likewise. (val_print): Likewise. (common_val_print): Likewise. (val_print_type_code_flags): Likewise. (val_print_scalar_formatted): Likewise. (val_print_array_elements): Likewise. * valprint.h (val_print_array_elements): Update declaration. (val_print_scalar_formatted): Likewise. (generic_val_print): Likewise. * value.h (val_print): Likewise. commit cc977dc7d53ef4546592a4f02a2e06a621beae6f Author: Yao Qi Date: Tue Nov 8 15:58:47 2016 +0000 Use get_frame_register_value instead of deprecated_frame_register_read This patch calls get_frame_register_value instead of deprecated_frame_register_read, so that we can pass value_contents_for_printing to val_print. Both get_frame_register_value and deprecated_frame_register_read call frame_unwind_register_value indirectly, so no functionality is changed by this patch. gdb: 2016-11-08 Yao Qi * mt-tdep.c (mt_registers_info): Call get_frame_register_value instead of deprecated_frame_register_read. * sh64-tdep.c (sh64_do_register): Likewise. commit 3cde5c42d1c1ddcf8bbde5c47233c644370c959c Author: Pedro Alves Date: Tue Nov 8 15:26:47 2016 +0000 Eliminate agent_expr_p; VEC -> std::vector in struct bp_target_info After the previous patch, we end up with these two types with quite similar, and potentially confusing names: typedef gdb::unique_ptr agent_expr_up; /* Pointer to an agent_expr structure. */ typedef struct agent_expr *agent_expr_p; The latter is only necessary to put agent_expr pointers in VECs. So just eliminate it and use std::vector instead. gdb/ChangeLog: 2016-11-08 Pedro Alves * ax.h (agent_expr_p): Delete. (DEF_VEC_P (agent_expr_p)): Delete. * breakpoint.c (build_target_condition_list) (build_target_command_list): Adjust to use of std::vector. (bp_location_dtor): Remove now unnecessary VEC_free calls. * breakpoint.h: Include . (struct bp_target_info) : Now std::vector's. * remote.c (remote_add_target_side_condition): bp_tgt->conditions is now a std::vector; adjust. (remote_add_target_side_commands, remote_insert_breakpoint): bp_tgt->tcommands is now a std::vector; adjust. commit 833177a4a5c1a2a6cabe70bfe35ecf241b68d169 Author: Pedro Alves Date: Tue Nov 8 15:26:47 2016 +0000 'struct agent_expr *' -> unique_ptr This patch makes the gen_* functions return a unique_ptr instead of raw pointer: typedef gdb::unique_ptr agent_expr_up; and then adjusts the codebase throughout to stop using make_cleanup_free_agent_expr. The cond_bytecode and cmd_bytecode fields of struct bp_location are owning pointers, so they're changed to be unique_ptr's instead of raw pointers. gdb/ChangeLog: 2016-11-08 Pedro Alves * ax-gdb.c (is_nontrivial_conversion): Use agent_expr_up. (gen_trace_for_var, gen_trace_for_expr, gen_eval_for_expr) (gen_trace_for_return_address, gen_printf): Use and return an agent_expr_up. Don't use make_cleanup_free_agent_expr. (agent_eval_command_one, maint_agent_printf_command): Use agent_expr_up. Don't use make_cleanup_free_agent_expr. * ax-gdb.h (gen_trace_for_expr, gen_trace_for_var) (gen_trace_for_return_address, gen_eval_for_expr, gen_printf): Use agent_expr_up. * ax-general.c (new_agent_expr): Rename to ... (agent_expr::agent_expr): ... this, and now a constructor. (free_agent_expr): Rename to ... (agent_expr::~agent_exp): ... this, and now a destructor. (do_free_agent_expr_cleanup, make_cleanup_free_agent_expr): Delete. * ax.h (struct agent_expr): Add ctor/dtor. (agent_expr_up): New typedef. (new_agent_expr, free_agent_expr, make_cleanup_free_agent_expr): Delete declarations. * breakpoint.c (parse_cond_to_aexpr): Use and return an agent_expr_up. Don't use make_cleanup_free_agent_expr. (build_target_condition_list): Adjust to use agent_expr_up. (parse_cmd_to_aexpr): Use and return an agent_expr_up. Don't use make_cleanup_free_agent_expr. (build_target_command_list): Adjust to use agent_expr_up. (force_breakpoint_reinsertion): Adjust to use agent_expr_up. (bp_location_dtor): Remove unnecessary free_agent_expr and xfree calls. * breakpoint.h (struct bp_target_info) : Now agent_expr_up's. * remote.c (remote_download_tracepoint): Adjust to use agent_expr_up and remove use of make_cleanup_free_agent_expr. * tracepoint.c (validate_actionline, collect_symbol): Adjust to use agent_expr_up and remove uses of make_cleanup_free_agent_expr. (collection_list::~collection_list): Call delete instead of free_agent_expr. (encode_actions_1): Adjust to use agent_expr_up and remove uses of make_cleanup_free_agent_expr. (add_aexpr): Change parameter type to agent_expr_up; Return a raw agent_expr pointer. commit 2f408ecb929bd56613e94cf1e84ace4692c78257 Author: Pedro Alves Date: Tue Nov 8 15:26:47 2016 +0000 Use ui_file_as_string throughout more This replaces most of the remaining ui_file_xstrdup calls with ui_file_as_string calls. Whenever a call was replaced, that led to a cascade of other necessary adjustments throughout, to make the code use std::string instead of raw pointers. And then whenever I added a std::string as member of a struct, I needed to adjust allocation/destruction of said struct to use new/delete instead of xmalloc/xfree. The stopping point was once gdb built again. These doesn't seem to be a way to reasonably split this out further. Maybe-not-obvious changes: - demangle_for_lookup returns a cleanup today. To get rid of that, and avoid unnecessary string dupping/copying, this introduces a demangle_result_storage type that the caller instantiates and passes to demangle_for_lookup. - Many methods returned a "char *" to indicate that the caller owns the memory and must free it. Those are switched to return a std::string instead. Methods that return a "view" into some internal string return a "const char *" instead. I.e., we only copy/allocate when necessary. gdb/ChangeLog: 2016-11-08 Pedro Alves * ada-lang.c (ada_name_for_lookup, type_as_string): Use and return std::string. (type_as_string_and_cleanup): Delete. (ada_lookup_struct_elt_type): Use type_as_string. * ada-lang.h (ada_name_for_lookup): Now returns std::string. * ada-varobj.c (ada_varobj_scalar_image): Return a std::string. (ada_varobj_describe_child): Make 'child_name' and 'child_path_expr' parameters std::string pointers. (ada_varobj_describe_struct_child, ada_varobj_describe_ptr_child): Likewise, and use string_printf. (ada_varobj_describe_simple_array_child) (ada_varobj_describe_child): Likewise. (ada_varobj_get_name_of_child, ada_varobj_get_path_expr_of_child) (ada_varobj_get_value_image) (ada_varobj_get_value_of_array_variable) (ada_varobj_get_value_of_variable, ada_name_of_variable) (ada_name_of_child, ada_path_expr_of_child) (ada_value_of_variable): Now returns std::string. Use string_printf. (ada_value_of_child): Adjust. * break-catch-throw.c (check_status_exception_catchpoint): Adjust to use std::string. * breakpoint.c (watch_command_1): Adjust to use std::string. * c-lang.c (c_get_string): Adjust to use std::string. * c-typeprint.c (print_name_maybe_canonical): Use std::string. * c-varobj.c (varobj_is_anonymous_child): Use ==/!= std::string operators. (c_name_of_variable): Now returns a std::string. (c_describe_child): The 'cname' and 'cfull_expression' output parameters are now std::string pointers. Adjust. (c_name_of_child, c_path_expr_of_child, c_value_of_variable) (cplus_number_of_children): Adjust to use std::string and string_printf. (cplus_name_of_variable): Now returns a std::string. (cplus_describe_child): The 'cname' and 'cfull_expression' output parameters are now std::string pointers. Adjust. (cplus_name_of_child, cplus_path_expr_of_child) (cplus_value_of_variable): Now returns a std::string. * cp-abi.c (cplus_typename_from_type_info): Return std::string. * cp-abi.h (cplus_typename_from_type_info): Return std::string. (struct cp_abi_ops) : Return std::string. * cp-support.c (inspect_type): Use std::string. (cp_canonicalize_string_full, cp_canonicalize_string_no_typedefs) (cp_canonicalize_string): Return std::string and adjust. * cp-support.h (cp_canonicalize_string) (cp_canonicalize_string_no_typedefs, cp_canonicalize_string_full): Return std::string. * dbxread.c (read_dbx_symtab): Use std::string. * dwarf2read.c (dwarf2_canonicalize_name): Adjust to use std::string. * gdbcmd.h (lookup_struct_elt_type): Adjust to use std::string. * gnu-v3-abi.c (gnuv3_get_typeid): Use std::string. (gnuv3_get_typename_from_type_info): Return a std::string and adjust. (gnuv3_get_type_from_type_info): Adjust to use std::string. * guile/guile.c (gdbscm_execute_gdb_command): Adjust to use std::string. * infcmd.c (print_return_value_1): Adjust to use std::string. * linespec.c (find_linespec_symbols): Adjust to demangle_for_lookup API change. Use std::string. * mi/mi-cmd-var.c (print_varobj, mi_cmd_var_set_format) (mi_cmd_var_info_type, mi_cmd_var_info_path_expression) (mi_cmd_var_info_expression, mi_cmd_var_evaluate_expression) (mi_cmd_var_assign, varobj_update_one): Adjust to use std::string. * minsyms.c (lookup_minimal_symbol): Use std::string. * python/py-varobj.c (py_varobj_iter_next): Use new instead of XNEW. vitem->name is a std::string now, adjust. * rust-exp.y (convert_ast_to_type, convert_name): Adjust to use std::string. * stabsread.c (define_symbol): Adjust to use std::string. * symtab.c (demangle_for_lookup): Now returns 'const char *'. Add a demangle_result_storage parameter. Use it for storage. (lookup_symbol_in_language) (lookup_symbol_in_objfile_from_linkage_name): Adjust to new demangle_for_lookup API. * symtab.h (struct demangle_result_storage): New type. (demangle_for_lookup): Now returns 'const char *'. Add a demangle_result_storage parameter. * typeprint.c (type_to_string): Return std::string and use ui_file_as_string. * value.h (type_to_string): Change return type to std::string. * varobj-iter.h (struct varobj_item) : Now a std::string. (varobj_iter_delete): Use delete instead of xfree. * varobj.c (create_child): Return std::string instead of char * in output parameter. (name_of_variable, name_of_child, my_value_of_variable): Return std::string instead of char *. (varobj_create, varobj_get_handle): Constify 'objname' parameter. Adjust to std::string fields. (varobj_get_objname): Return a const char * instead of a char *. (varobj_get_expression): Return a std::string. (varobj_list_children): Adjust to use std::string. (varobj_get_type): Return a std::string. (varobj_get_path_expr): Return a const char * instead of a char *. Adjust to std::string fields. (varobj_get_formatted_value, varobj_get_value): Return a std::string. (varobj_set_value): Change type of 'expression' parameter to std::string. Use std::string. (install_new_value): Use std::string. (delete_variable_1): Adjust to use std::string. (create_child): Change the 'name' parameter to a std::string reference. Swap it into the new item's name. (create_child_with_value): Swap item's name into the new child's name. Use string_printf. (new_variable): Use new instead of XNEW. (free_variable): Don't xfree fields that are now std::string. (name_of_variable, name_of_child): Now returns std::string. (value_of_root): Adjust to use std::string. (my_value_of_variable, varobj_value_get_print_value): Return and use std::string. (varobj_value_get_print_value): Adjust to use ui_file_as_string and std::string. * varobj.h (struct varobj) : Now std::string's. : Return std::string. (varobj_create, varobj_get_handle): Constify 'objname' parameter. (varobj_get_objname): Return a const char * instead of a char *. (varobj_get_expression, varobj_get_type): Return a std::string. (varobj_get_path_expr): Return a const char * instead of a char *. (varobj_get_formatted_value, varobj_get_value): Return a std::string. (varobj_set_value): Constify 'expression' parameter. (varobj_value_get_print_value): Return a std::string. commit d2af8993a7cac29eaa5a4efd47c9117bbd175068 Author: Pedro Alves Date: Tue Nov 8 15:26:47 2016 +0000 Use ui_file_as_string in gdb/language.c gdb/ChangeLog: 2016-11-08 Pedro Alves * language.c (add_language): Use ui_file_as_string and adjust to use std::string. commit 5698084a7303c45fdc94fb44c47355413b271562 Author: Pedro Alves Date: Tue Nov 8 15:26:46 2016 +0000 Use ui_file_as_string in gdb/rust-lang.c gdb/ChangeLog: 2016-11-08 Pedro Alves Tom Tromey * rust-lang.c (struct disr_info) : Now a std::string. (rust_get_disr_info): Use ui_file_as_string and adjust to use std::string. (rust_val_print): Adjust to use std::string. commit af1fe7b3b87de27d84a82d4f44b937c2800205ff Author: Pedro Alves Date: Tue Nov 8 15:26:46 2016 +0000 Use ui_file_as_string in gdb/infrun.c gdb/ChangeLog: 2016-11-08 Pedro Alves * infrun.c (print_target_wait_results): Use ui_file_as_string and std::string. commit 3b4de39c9d9ff014ae90e2bafbf7ce1f42c2198e Author: Pedro Alves Date: Tue Nov 8 15:26:46 2016 +0000 Use ui_file_as_string in gdb/ada-lang.c gdb/ChangeLog: 2016-11-08 Pedro Alves * ada-lang.c (type_as_string): Use ui_file_as_string and return std::string. (type_as_string_and_cleanup): Delete. (ada_lookup_struct_elt_type): Use type_as_string. commit 6f0302493af0ace93943041c3374069c15c363f7 Author: Pedro Alves Date: Tue Nov 8 15:26:46 2016 +0000 Use ui_file_as_string in gdbarch.sh/gdbarch.c gdb/ChangeLog: 2016-11-08 Pedro Alves * gdbarch.sh (verify_gdbarch): Use ui_file_as_string and std::string. * gdbarch.c: Regenerate. commit 66bbce5bda870c49a68f2b77a29fb96eca72632f Author: Pedro Alves Date: Tue Nov 8 15:26:46 2016 +0000 Use ui_file_as_string in gdb/c-exp.y gdb/ChangeLog: 2016-11-08 Pedro Alves * c-exp.y (OPERATOR NEW): Adjust to use ui_file_as_string and std::string. commit aaee65aea29ac8f7317e866d5dbef9f96cfdb253 Author: Pedro Alves Date: Tue Nov 8 15:26:46 2016 +0000 Use ui_file_as_string in gdb/compile/ Using ui_file_as_string would imply changing a few prototypes to pass around source and object file names as std::string. Instead of that, wrap those two in a new class. This ends up eliminating a small wrinkle: get_new_file_names and compile_object_load have swapped parameters. The former takes "source, objfile", while the latter takes "objfile, source". gdb/ChangeLog: 2016-11-08 Pedro Alves * c-lang.h (c_compute_program): Now returns std::string. * compile/compile-internal.h (class compile_file_names): New class. * compile/compile-object-load.c (compile_object_load): Replace object_file and source_file parameters with a compile_file_names parameter. Adjust. * compile-object-load.h: Include "compile-internal.h". (compile_object_load): Replace object_file and source_file parameters with a compile_file_names parameter. * compile/compile-c-support.c (c_compute_program): Now returns a std::string. Use ui_file_as_string. * compile/compile.c (get_new_file_names): Remove parameters and return a compile_file_names instead. (compile_to_object): Now returns a compile_file_names. Use ui_file_as_string. (eval_compile_command): Use compile_file_names. * language.h (struct language_defn) : Now returns std::string. commit 3d8b0d9483f6eabc2c1739ac3dd64c30061a6a72 Author: Pedro Alves Date: Tue Nov 8 15:26:45 2016 +0000 Use ui_file_as_string in gdb/cli/cli-setshow.c gdb/ChangeLog: 2016-11-08 Pedro Alves * cli/cli-setshow.c (do_show_command): Adjust to use ui_file_as_string and std::string. commit b3ced9bad2d8d5eb9ebabc5f8f7c6ab871f63748 Author: Pedro Alves Date: Tue Nov 8 15:26:45 2016 +0000 Use ui_file_as_string in gdb/remote.c gdb/ChangeLog: 2016-11-08 Pedro Alves * remote.c (escape_buffer): Use ui_file_as_string and return std::string. (putpkt_binary, read_frame): Adjust to use std::string. commit c92aed165e8af79f51c5165f98f12389bb59a121 Author: Pedro Alves Date: Tue Nov 8 15:26:45 2016 +0000 Use ui_file_as_string in gdb/python/ gdb/ChangeLog: 2016-11-08 Pedro Alves * python/py-arch.c (archpy_disassemble): Use ui_file_as_string and std::string. * python/py-breakpoint.c (bppy_get_commands): Use ui_file_as_string and std::string. * python/py-frame.c (frapy_str): Likewise. * python/py-type.c (typy_str): Likewise. * python/py-unwind.c (unwind_infopy_str): Likewise. * python/py-value.c (valpy_str): Likewise. commit 02030646c2a799614d31e52008403d8be067ac5d Author: Pedro Alves Date: Tue Nov 8 15:26:45 2016 +0000 Use ui_file_as_string in gdb/printcmd.c Yet another cleanup eliminated. gdb/ChangeLog: 2016-11-08 Pedro Alves * printcmd.c (eval_command): Use ui_file_as_string and std::string. commit 7b01d34b2a62fb8cda96fe40c755f99e63b8ba4f Author: Pedro Alves Date: Tue Nov 8 15:26:45 2016 +0000 Use ui_file_as_string in gdb/top.c Yet another cleanup is eliminated. gdb/ChangeLog: 2016-11-08 Pedro Alves * top.c (quit_confirm): Use ui_file_as_string and std::string. commit db1ec11fff1a46f7046bcbd971a42632d2ea795c Author: Pedro Alves Date: Tue Nov 8 15:26:45 2016 +0000 Use ui_file_as_string in execute_command_to_string ... and then return std::string and adjust all callers. gdb/ChangeLog: 2016-11-08 Pedro Alves * gdbcmd.h (execute_command_to_string): Now returns std::string. (lookup_struct_elt_type): Adjust to use std::string. * top.c (execute_command_to_string): Use ui_file_as_string and return std::string. * guile/guile.c (gdbscm_execute_gdb_command): Adjust to use std::string. * python/python.c (execute_gdb_command): Adjust to use std::string. commit 3ab692db7f4d96022a132379614031a852de6f35 Author: Pedro Alves Date: Tue Nov 8 15:26:44 2016 +0000 Use ui_file_as_string in gdb/guile/ gdb/ChangeLog: 2016-11-08 Pedro Alves * guile/scm-breakpoint.c (gdbscm_breakpoint_commands): Use ui_file_as_string and adjust to use std::string. * guile/scm-disasm.c (gdbscm_arch_disassemble): Likewise. * guile/scm-frame.c (frscm_print_frame_smob): Likewise. * guile/scm-type.c (tyscm_type_name): Use ui_file_as_string and adjust to use std::string. Throw exception directly instead of returning it in EXCP output parameter. (tyscm_print_type_smob, gdbscm_type_print_name): Adjust to tyscm_type_name interface change. * guile/scm-value.c (vlscm_print_value_smob, gdbscm_value_print): Use ui_file_as_string and std::string. commit 09b0e4b047b44063cf4c8c00527886743619c24e Author: Pedro Alves Date: Tue Nov 8 15:26:44 2016 +0000 Use ui_file_as_string in gdb/arm-tdep.c gdb/ChangeLog: 2016-11-08 Pedro Alves * arm-tdep.c (_initialize_arm_tdep): Use ui_file_as_string and std::string. commit d16c5475b560adbad2d9bc78ec3718658f4090e3 Author: Pedro Alves Date: Tue Nov 8 15:26:44 2016 +0000 Use ui_file_as_string in gdb/utils.c gdb/ChangeLog: 2016-11-08 Pedro Alves * utils.c (error_stream): Use ui_file_as_string and std::string. commit 56dbf31760f721893a44d3da26adfccf548995c7 Author: Pedro Alves Date: Tue Nov 8 15:26:44 2016 +0000 Use ui_file_as_string in gdb/ui-out.c gdb/ChangeLog: 2016-11-08 Pedro Alves * ui-out.c (ui_out_field_stream): Use ui_file_as_string. commit 77e1c7426aad05b20f48762234c02139e9c02f8e Author: Pedro Alves Date: Tue Nov 8 15:26:44 2016 +0000 Use ui_file_as_string in gdb/ada-valprint.c gdb/ChangeLog: 2016-11-08 Pedro Alves * ada-valprint.c (ada_print_floating): Use ui_file_as_string and std::string. commit a0f86e735886f3d373507fa9cfc0cf2a2f32eabc Author: Pedro Alves Date: Tue Nov 8 15:26:44 2016 +0000 Use ui_file_as_string in gdb/xtensa-tdep.c gdb/ChangeLog: 2016-11-08 Pedro Alves * xtensa-tdep.c (xtensa_verify_config): Use ui_file_as_string and std::string. commit 322a851675234b3c16be6dd5035b07f5e3410ec7 Author: Pedro Alves Date: Tue Nov 8 15:26:44 2016 +0000 Use ui_file_as_string in dwarf2_compute_name gdb/ChangeLog: 2016-11-08 Pedro Alves * dwarf2read.c (dwarf2_compute_name): Use ui_file_as_string and std::string. commit 1f45808ead357e8a81dec16b9802a6c369e08426 Author: Pedro Alves Date: Tue Nov 8 15:26:43 2016 +0000 Clean up tracepoint.h/c:collection_list Noticed we could do this while working on the expression_up change. The main goal here was getting rid of the encode_actions_and_make_cleanup / do_clear_collection_list cleanups. While at it, uncrustify the code: - Make collection_list a C++ class, with data members private (and thus renamed m_...). - Make related functions be member methods. - Use std::vector instead of an open coding a vector implementation. - Use std::sort instead of qsort. - Rename the "list" member of collection_list, which is an incredibly obfuscating name. - Rename a couple other things here and there for clarify. - Use "bool" more. gdb/ChangeLog: 2016-11-08 Pedro Alves * mi/mi-main.c (print_variable_or_computed): Constify 'expression' parameter. (mi_cmd_trace_frame_collected): Call encode_actions instead of encode_actions_and_make_cleanup. Adjust to use std::vector. * tracepoint.c (memrange_cmp): Delete. (memrange_comp): New. (memrange_sortmerge): Take a memrange vector as parameter instead of a collection_list. Use std::sort instead of qsort. (add_register): Now a method of collection_list. Adjust to m_ prefix of data fields. (add_memrange): Now a method of collection_list. Adjust to m_ prefix of data fields. Adjust to use std::vector. (collect_symbol): Now a method of collection_list. Adjust to m_ prefix of data fields. (do_collect_symbol): Adjust. Call add_wholly_collected instead of accessing the vector directly. (collection_list::add_wholly_collected): New. (add_local_symbols): Now a method of collection_list. (add_static_trace_data): Now a method of collection_list. Adjust to use bool. (clear_collection_list, do_clear_collection_list): Delete. (init_collection_list): Delete. (collection_list::collection_list): New. (collection_list::~collection_list): New. (stringify_collection_list): Rename to ... (collection_list::stringify): ... this and adjust to being a method of collection_list. Adjust to use of std::vector. (append_exp): Now a method of collection_list. Use ui_file_as_string. Adjust to std::vector. (collection_list::finish): New. (encode_actions_1): Adjust. (encode_actions_and_make_cleanup): Rename to ... (encode_actions)... this. No longer returns a cleanup. No longer call init_collection_list nor install do_clear_collection_list cleanups. Call collection_list::finish instead of memrange_sortmerge directly. (encode_actions_rsp): Adjust to call encode_actions instead of encode_actions_and_make_cleanup. Adjust to method renames. (add_aexpr): Now a method of collection_list. * tracepoint.h: Include and . (struct memrange): Add constructors. (struct collection_list): Now a class. (class collection_list) : New methods. : Rename to ... : ... this. : Delete fields. : New field. : Delete fields. : New field. : Rename to ... : ... this. Now a bool. : Rename to ... : ... this. Now a std::vector. : Rename to ... : ... this. Now a std::vector. (encode_actions_and_make_cleanup): Delete declaration. (encode_actions): New declaration. commit 8de00631b8bd1c328f1916b1fd95bd0d9ff2017e Author: Pedro Alves Date: Tue Nov 8 15:26:43 2016 +0000 Introduce ui_file_as_string ui_file_as_string is a variant of ui_file_xstrdup that returns a std::string instead of a xmalloc'ed char *. The idea is using the new function to eliminate "make_cleanup (xfree, ...)" cleanups throughout. Following patches will make use of this. gdb/ChangeLog: 2016-11-08 Pedro Alves * ui-file.c (do_ui_file_as_string, ui_file_as_string): New functions. * ui-file.h: Include . (ui_file_as_string): New declaration. commit 4d01a485d29732b19743e8b138897f3509e071b0 Author: Pedro Alves Date: Tue Nov 8 15:26:43 2016 +0000 'struct expression *' -> gdb::unique_xmalloc_ptr This patch makes parse_expression and friends return a unique_ptr instead of raw pointer [1]: typedef gdb::unique_malloc_ptr expression_up; and then adjusts the codebase throughout to stop using cleanups to manage lifetime of expression pointers. Whenever I found a structure owning an expression pointer, I made it store a unique_ptr instead of a raw pointer, which then requires using new/delete of the holding structure, instead of XNEW/xfree. [1] - I'd like to set the rule that types named with an "_up" suffix are unique_ptr typedefs. Note I used gdb::unique_xmalloc_ptr instead of gdb::unique_ptr, simply because we still use xmalloc instead of new to allocate expression objects. Once that's changed, all we need to do is change the expression_up typedef and the smart pointer will then call delete instead of xfree. gdb/ChangeLog: 2016-11-08 Pedro Alves * ada-lang.c (ada_read_renaming_var_value): Use expression_up. (struct ada_catchpoint_location) : Now an expression_up. (ada_catchpoint_location_dtor): Reset excep_cond_expr instead of using xfree. (create_excep_cond_exprs): Use expression_up and gdb::move. (allocate_location_exception): Use new instead of XNEW. (should_stop_exception): Likewise. Adjust to use expression_up. (create_ada_exception_catchpoint): Use new instead of XNEW. * ax-gdb.c (agent_eval_command_one): Use expression_up instead of cleanups. (maint_agent_printf_command): Use expression_up. * break-catch-sig.c (create_signal_catchpoint): Use new instead of XNEW. * break-catch-syscall.c (create_syscall_event_catchpoint): Likewise. * break-catch-throw.c (handle_gnu_v3_exceptions): Use new instead of XCNEW. Use gdb::unique_ptr instead of cleanups. * breakpoint.c (set_breakpoint_condition, update_watchpoint) (parse_cmd_to_aexpr, watchpoint_check) (bpstat_check_breakpoint_conditions, watchpoint_locations_match): Adjust to use expression_up. (init_bp_location): Adjust. (free_bp_location): Use delete instead of xfree. (set_raw_breakpoint_without_location, set_raw_breakpoint) (add_solib_catchpoint, create_fork_vfork_event_catchpoint) (new_single_step_breakpoint, create_breakpoint_sal): Use new instead of XNEW. (find_condition_and_thread): Adjust to use expression_up. (create_breakpoint): Use new instead of XNEW. (dtor_watchpoint): Don't xfree expression pointers, they're unique_ptr's now. (insert_watchpoint, remove_watchpoint): Adjust. (watch_command_1): Use expression_up. Use new instead of XCNEW. (catch_exec_command_1): Use new instead of XNEW. (bp_location_dtor): Don't xfree expression pointers, they're unique_ptr's now. (base_breakpoint_allocate_location) (strace_marker_create_breakpoints_sal): Use new instead of XNEW. (delete_breakpoint): Use delete instead of xfree. * breakpoint.h (struct bp_location) : Now an unique_ptr instead of a raw pointer. (struct watchpoint) : Likewise. * cli/cli-script.c (execute_control_command): Use expression_up instead of cleanups. * dtrace-probe.c (dtrace_process_dof_probe): Use expression_up. * eval.c (parse_and_eval_address, parse_and_eval_long) (parse_and_eval, parse_to_comma_and_eval, parse_and_eval_type): Use expression_up instead of cleanups. * expression.h (expression_up): New typedef. (parse_expression, parse_expression_with_language, parse_exp_1): Change return type to expression_up. * mi/mi-main.c (mi_cmd_data_evaluate_expression) (print_variable_or_computed): Use expression_up. * objc-lang.c (print_object_command): Use expression_up instead of cleanups. * parse.c (parse_exp_1, parse_exp_in_context) (parse_exp_in_context_1, parse_expression) (parse_expression_with_language): Return an expression_up instead of a raw pointer. (parse_expression_for_completion): Use expression_up. * printcmd.c (struct display) : Now an expression_up instead of a raw pointer. (print_command_1, output_command_const, set_command, x_command): Use expression_up instead of cleanups. (display_command): Likewise. Use new instead of XNEW. (free_display): Use delete instead of xfree. (do_one_display): Adjust to use expression_up. * remote.c (remote_download_tracepoint): Likewise. * stack.c (return_command): Likewise. * tracepoint.c (validate_actionline, encode_actions_1): Use expression_up instead of cleanups. * typeprint.c (whatis_exp, maintenance_print_type): Likewise. * value.c (init_if_undefined_command): Likewise. * varobj.c (struct varobj_root) : Now an expression_up instead of a raw pointer. (varobj_create): Adjust. (varobj_set_value): Use an expression_up instead of cleanups. (new_root_variable): Use new instead of XNEW. (free_variable): Use delete instead of xfree. (value_of_root_1): Use std::swap. commit b064640146bb6908a0ccca27ca8ee2b06b668137 Author: Pedro Alves Date: Tue Nov 8 15:26:43 2016 +0000 cli-script.c: Simplify using std::string, eliminate cleanups gdb/ChangeLog: 2016-11-08 Pedro Alves * cli/cli-script.c (execute_control_command): Use std::string instead of cleanups. (locate_arg): Constify return type. (insert_args): Constify paremeter. Simplify using std::string. Return a std::string. commit 896b6bda6904765f36692d76a37b99c0412ca9ae Author: Pedro Alves Date: Tue Nov 8 15:26:43 2016 +0000 breakpoint.c:commands_command_1 constification and cleanup This is constification needed for next patch. Adjust commands_command_1 to use std::string too because the "arg" parameter is currently overwritten and then passed to make_cleanup. The constification alone would trigger a compile error in the make_cleanup call otherwise (passing const char * to void * parameter). Using std::string gets rid of the cleanup in the first place, resulting in simpler code. gdb/ChangeLog: 2016-11-08 Pedro Alves * breakpoint.c (struct commands_info) : Constify. (commands_command_1): Constify 'arg' parameter. Use std::string and string_printf. (commands_from_control_command): Constify 'arg' parameter. (map_breakpoint_numbers): Constify 'args' parameter. * breakpoint.h (commands_from_control_command): Constify 'arg' parameter. commit 4f8ad951f662864884d4b11315c940c5239a4a89 Author: Pedro Alves Date: Tue Nov 8 15:26:42 2016 +0000 cli/cli-script.c: Remove some dead NULL checks gdb/ChangeLog: 2016-11-08 Pedro Alves * cli/cli-script.c (execute_control_command): Assume insert_args never returns NULL. (insert_args): Assume xmalloc never returns NULL. commit d4081a383e28db26c65298f7405554d4312b1342 Author: Pedro Alves Date: Tue Nov 8 15:26:42 2016 +0000 Introduce string_printf This introduces the string_printf function. Like asprintf, but returns a std::string. gdb/ChangeLog: 2016-11-08 Pedro Alves * Makefile.in (COMMON_OBS): Add utils-selftests.o. * common/common-utils.c (string_printf): New function. * common/common-utils.h: Include . (string_printf): Declare. * utils-selftests.c: New file. commit cb64e50d42a49bce61050c79c5ab0846905b6a82 Author: Nick Clifton Date: Tue Nov 8 15:03:46 2016 +0000 Fix heap-buffer-overflow error detected by address sanitization on a fuzzed binary. PR binutils/20794 * readelf.c (process_section_headers): Fix off-by-one error when checking for invalid sh_link and sh_info fields. commit 93f9a11fbdb8f09428b17180d51a09a1bda39a52 Author: Yao Qi Date: Tue Nov 8 14:28:32 2016 +0000 gdbarch software_single_step returns VEC (CORE_ADDR) * This patch changes gdbarch method software_single_step to return a vector of addresses on which GDB should insert breakpoints, and don't insert breakpoints. Instead, the caller of gdbarch_software_single_step inserts breakpoints if the returned vector is not NULL. gdb: 2016-11-08 Yao Qi * aarch64-tdep.c (aarch64_software_single_step): Return VEC (CORE_ADDR) *. Return NULL instead of 0. Don't call insert_single_step_breakpoint. * alpha-tdep.c (alpha_deal_with_atomic_sequence): Likewise. (alpha_software_single_step): Likewise. * alpha-tdep.h (alpha_software_single_step): Update declaration. * arm-linux-tdep.c (arm_linux_software_single_step): Return VEC (CORE_ADDR) *. Return NULL instead of 0. * arm-tdep.c (arm_software_single_step): Return NULL instead of 0. * arm-tdep.h (arm_software_single_step): Update declaration. * breakpoint.c (insert_single_step_breakpoints): New function. * breakpoint.h (insert_single_step_breakpoints): Declare. * cris-tdep.c (cris_software_single_step): Return VEC (CORE_ADDR) *. Don't call insert_single_step_breakpoint. * gdbarch.sh (software_single_step): Change it to return VEC (CORE_ADDR) *. * gdbarch.c, gdbarch.h: Regenerated. * infrun.c (maybe_software_singlestep): Adjust. * mips-tdep.c (mips_deal_with_atomic_sequence): Return VEC (CORE_ADDR) *. Don't call insert_single_step_breakpoint. (micromips_deal_with_atomic_sequence): Likewise. (deal_with_atomic_sequence): Likewise. (mips_software_single_step): Likewise. * mips-tdep.h (mips_software_single_step): Update declaration. * moxie-tdep.c (moxie_software_single_step): Likewise. * nios2-tdep.c (nios2_software_single_step): Likewise. * ppc-tdep.h (ppc_deal_with_atomic_sequence): Update declaration. * record-full.c (record_full_resume): Adjust. (record_full_wait_1): Likewise. * rs6000-aix-tdep.c (rs6000_software_single_step): Return VEC (CORE_ADDR) *. Don't call insert_single_step_breakpoint. * rs6000-tdep.c (ppc_deal_with_atomic_sequence): Return VEC (CORE_ADDR) *. Don't call insert_single_step_breakpoint. * s390-linux-tdep.c (s390_software_single_step): Likewise. * sparc-tdep.c (sparc_software_single_step): Likewise. * spu-tdep.c (spu_software_single_step): Likewise. * tic6x-tdep.c (tic6x_software_single_step): Likewise. commit 0bc5d801ec836cd4b7d1ab7d05658e7a1d05df22 Author: Yao Qi Date: Tue Nov 8 12:58:33 2016 +0000 Clear addr bit in next_pcs vector This patch is to split the loop of calling gdbarch_addr_bits_remove and insert_single_step_breakpoint into two loops. gdb: 2016-11-08 Yao Qi * arm-linux-tdep.c (arm_linux_software_single_step): Write adjusted address back to vector. Call insert_single_step_breakpoint in a new loop. * arm-tdep.c (arm_software_single_step): Likewise. commit 771da62d67a9f27c1e706610efe51b13c3f9fd60 Author: Yao Qi Date: Tue Nov 8 12:47:16 2016 +0000 Remove arm_insert_single_step_breakpoint This patch is to remove arm_insert_single_step_breakpoint. gdb: 2016-11-08 Yao Qi * arm-linux-tdep.c (arm_linux_software_single_step): Don't call arm_insert_single_step_breakpoint, call insert_single_step_breakpoint instead. * arm-tdep.c (arm_insert_single_step_breakpoint): Remove. (arm_software_single_step): Don't call arm_insert_single_step_breakpoint, call insert_single_step_breakpoint instead. * arm-tdep.h (arm_insert_single_step_breakpoint): Remove declaration. commit 53c3572a9f5b03a92292cb6d24bf69b52c95500e Author: Cordian A. Daniluk Date: Sat Oct 29 20:39:57 2016 +0200 Fix PR breakpoints/20739: Badly formatted adress string in error message Remove duplicate `0x'-prefix for the hex address printed. `paddress' already prepends this, so no need to do it manually. gdb/ChangeLog: 2016-11-08 Cordian A. Daniluk PR breakpoints/20739 * breakpoint.c (check_fast_tracepoint_sals): Don't print duplicate 0x prefix. commit 3b0d929dd61fcd55b4ef320a2033c731443b394f Author: Pedro Alves Date: Tue Nov 8 12:32:05 2016 +0000 Fix bfd/dwarf2.c build breakage Fix build breakage introduced by commit 089e3718bd8d ("Greatly improve the speed if looking up DWARF line number information."): - bfd_boolean is_linkage; - const char *name; - struct arange arange; + int line; + int tag; + bfd boolean is_linkage; bfd/ChangeLog: 2016-11-08 Pedro Alves * dwarf2.c (struct funcinfo) : Type is bfd_boolean, not "bfd boolean". commit 089e3718bd8de11fc4d6bbc8d32701033d467960 Author: Igor Tsimbalist Date: Tue Nov 8 12:01:58 2016 +0000 Greatly improve the speed if looking up DWARF line number information. * dwarf2.c (comp_unit): Add new fields 'lookup_funcinfo_table' and 'number_of_functions' to keep lookup table and number of entries in the table. (line_sequence): Add new fields 'line_info_lookup' and 'num_lines' to keep lookup table and number of entries in the table. (lookup_funcinfo): New structure for lookup table for function references. (build_line_info_table): New function to create and build the lookup table for line information. (lookup_address_in_line_info_table): Use the lookup table instead of traverse a linked list. (compare_lookup_funcinfos): New compare fuction used in sorting of lookup table for function references. (build_lookup_funcinfo_table): New function to create, build and sort the lookup table for functions references. (lookup_address_in_function_table): Use the table instead of traverse a linked list. (_bfd_dwarf2_cleanup_debug_info): Free memory from function references lookup table. commit 20955dbf718992e83b7c971344931934b62a784f Author: Yao Qi Date: Tue Nov 8 11:32:53 2016 +0000 Fix indentation gdb: 2016-11-08 Yao Qi * rust-lang.c (val_print_struct): Fix indentation. commit 9dc193c3be85aafa60ceff57d3b0430af607b4ce Author: Lionel Flandrin Date: Tue Nov 8 10:27:36 2016 +0000 Check for truncated registers in process_g_packet While investigating an unrelated issue in remote.c I noticed that the bound checking for 'g' packets was bogus: The previous code would only check that the first byte of the register was within bounds before passing the buffer to regcache_raw_supply. If it turned out that the register in the 'g' packet was incomplete then regcache_raw_supply would proceed to memcpy out-of-bounds. Since the buffer is allocated with alloca it's relatively unlikely to crash (you just end up dumping gdb's stack into the cache) but it's still a bit messy. I changed this logic to check for truncated registers and raise an error if one is encountered. Hopefully it should make debugging remote stubs a bit easier. gdb/ChangeLog: 2016-11-08 Lionel Flandrin * remote.c (process_g_packet): Detect truncated registers in 'g' packets and raise an error. commit ec7b600bf1410f6bda239666fac258a605dc3f43 Author: GDB Administrator Date: Tue Nov 8 00:00:34 2016 +0000 Automatic date update in version.in commit 48c97fa1ba7d6628352fc2433abd91a41f6c8171 Author: H.J. Lu Date: Mon Nov 7 14:58:38 2016 -0800 X86: Properly handle bad FPU opcode Since Bad_Opcode and FGRPd9_2 were the same in i386-dis.c, all Bad_Opcode entries in float_reg were displaced as FGRPd9_2. This patch adds an entry for Bad_Opcode in fgrps to avoid treating it as FGRPd9_2. gas/ PR binutils/20775 * testsuite/gas/i386/i386.exp: Run fpu-bad. * testsuite/gas/i386/fpu-bad.d: New file. * testsuite/gas/i386/fpu-bad.s: Likewise. opcodes/ PR binutils/20775 * i386-dis.c (FGRPd9_2): Replace 0 with 1. (FGRPd9_4): Replace 1 with 2. (FGRPd9_5): Replace 2 with 3. (FGRPd9_6): Replace 3 with 4. (FGRPd9_7): Replace 4 with 5. (FGRPda_5): Replace 5 with 6. (FGRPdb_4): Replace 6 with 7. (FGRPde_3): Replace 7 with 8. (FGRPdf_4): Replace 8 with 9. (fgrps): Add an entry for Bad_Opcode. commit 5996220cfa24ef6fddb782617720cd56913b1bb7 Author: Doug Evans Date: Mon Nov 7 13:31:24 2016 -0800 Fix ext lang calls to value_struct_elt. gdb/ChangeLog: * guile/scm-value.c (gdbscm_value_field): Fix call to value_struct_elt. * python/py-value.c (valpy_getitem): Ditto. commit ad9eb1fdda263cd91ee8fb36292fb29d546b0076 Author: Doug Evans Date: Mon Nov 7 13:27:22 2016 -0800 i386-tdep.c (i386_gdbarch_init): Add comments. gdb/ChangeLog: * i386-tdep.c (i386_gdbarch_init): Add comments. commit bc71081e53e3c0a52a28d5874e65a54194e2205f Author: Doug Evans Date: Mon Nov 7 13:23:10 2016 -0800 python/py-unwind.c (unwind_infopy_str): Fix use of VEC_iterate. gdb/ChangeLog: * python/py-unwind.c (unwind_infopy_str): Fix use of VEC_iterate. commit a57160325ef479bd7181a4319126b1177c4a5cbb Author: Doug Evans Date: Mon Nov 7 13:15:48 2016 -0800 configure.tgt (x86_64-*-elf*): Remove i386bsd-tdep.o. gdb/ChangeLog: * configure.tgt (x86_64-*-elf*): Remove i386bsd-tdep.o. commit 5ada5c6fca335963b0b9fb9e91c999fcdaab2f89 Author: Doug Evans Date: Mon Nov 7 13:08:55 2016 -0800 Sync config.sub,config.guess with upstream. ----------------------------------------------------------------------- Summary of changes: ChangeLog | 6 + bfd/ChangeLog | 45 + bfd/coffcode.h | 5 +- bfd/compress.c | 8 + bfd/dwarf2.c | 377 ++- bfd/elfnn-aarch64.c | 3 +- bfd/version.h | 2 +- binutils/ChangeLog | 21 + binutils/NEWS | 4 + binutils/doc/binutils.texi | 27 +- binutils/nm.c | 18 + binutils/readelf.c | 8 +- binutils/testsuite/binutils-all/nm-ver.s | 9 + binutils/testsuite/binutils-all/nm.exp | 31 + config.guess | 28 +- config.sub | 20 +- gas/ChangeLog | 81 + gas/config/tc-aarch64.c | 7 +- gas/config/tc-moxie.c | 7 + gas/doc/c-aarch64.texi | 2 +- gas/expr.c | 8 + gas/testsuite/gas/aarch64/illegal-crypto-nofp.d | 3 + gas/testsuite/gas/aarch64/illegal-crypto-nofp.l | 19 + gas/testsuite/gas/aarch64/illegal-fp16-nofp.d | 2 + gas/testsuite/gas/aarch64/illegal-fp16-nofp.l | 6 + gas/testsuite/gas/aarch64/illegal-fp16-nofp.s | 7 + gas/testsuite/gas/aarch64/illegal-sysreg-3.d | 3 + gas/testsuite/gas/aarch64/illegal-sysreg-3.l | 21 + gas/testsuite/gas/aarch64/pac.d | 52 + gas/testsuite/gas/aarch64/pac.s | 56 + gas/testsuite/gas/aarch64/sysreg-3.d | 28 + gas/testsuite/gas/aarch64/sysreg-3.s | 21 + gas/testsuite/gas/aarch64/system-3.d | 34 + gas/testsuite/gas/aarch64/system-3.s | 41 + gas/testsuite/gas/aarch64/system.d | 26 +- gas/testsuite/gas/i386/fpu-bad.d | 11 + gas/testsuite/gas/i386/fpu-bad.s | 4 + gas/testsuite/gas/i386/i386.exp | 1 + gas/testsuite/gas/i386/opcode-intel.d | 1 + gas/testsuite/gas/i386/opcode-suffix.d | 9 + gas/testsuite/gas/i386/opcode.d | 1 + gas/testsuite/gas/i386/opcode.s | 2 + .../gas/i386/x86-64-avx512bw-opts-intel.d | 24 - gas/testsuite/gas/i386/x86-64-avx512bw-opts.d | 24 - gas/testsuite/gas/i386/x86-64-avx512bw-opts.s | 24 - gas/testsuite/gas/sparc/pr20732.d | 14 + gas/testsuite/gas/sparc/pr20732.s | 3 + gas/testsuite/gas/sparc/sparc.exp | 1 + gdb/ChangeLog | 883 +++++- gdb/Makefile.in | 2 +- gdb/aarch64-tdep.c | 18 +- gdb/ada-lang.c | 83 +- gdb/ada-lang.h | 6 +- gdb/ada-valprint.c | 121 +- gdb/ada-varobj.c | 130 +- gdb/alpha-tdep.c | 28 +- gdb/alpha-tdep.h | 2 +- gdb/arm-linux-tdep.c | 14 +- gdb/arm-tdep.c | 32 +- gdb/arm-tdep.h | 4 +- gdb/ax-gdb.c | 149 +- gdb/ax-gdb.h | 24 +- gdb/ax-general.c | 48 +- gdb/ax.h | 19 +- gdb/break-catch-sig.c | 2 +- gdb/break-catch-syscall.c | 2 +- gdb/break-catch-throw.c | 26 +- gdb/breakpoint.c | 251 +- gdb/breakpoint.h | 31 +- gdb/c-exp.y | 9 +- gdb/c-lang.c | 9 +- gdb/c-lang.h | 24 +- gdb/c-typeprint.c | 5 +- gdb/c-valprint.c | 33 +- gdb/c-varobj.c | 142 +- gdb/cli/cli-script.c | 128 +- gdb/cli/cli-setshow.c | 7 +- gdb/common/common-utils.c | 23 + gdb/common/common-utils.h | 6 + gdb/compile/compile-c-support.c | 6 +- gdb/compile/compile-internal.h | 25 + gdb/compile/compile-object-load.c | 18 +- gdb/compile/compile-object-load.h | 4 +- gdb/compile/compile.c | 106 +- gdb/configure.tgt | 9 +- gdb/cp-abi.c | 2 +- gdb/cp-abi.h | 7 +- gdb/cp-support.c | 60 +- gdb/cp-support.h | 10 +- gdb/cp-valprint.c | 35 +- gdb/cris-tdep.c | 13 +- gdb/d-lang.h | 4 +- gdb/d-valprint.c | 14 +- gdb/darwin-nat.c | 342 ++- gdb/dbxread.c | 22 +- gdb/dtrace-probe.c | 6 +- gdb/dwarf2read.c | 25 +- gdb/eval.c | 43 +- gdb/expression.h | 12 +- gdb/extension-priv.h | 14 +- gdb/extension.c | 16 +- gdb/extension.h | 4 +- gdb/f-lang.h | 4 +- gdb/f-valprint.c | 13 +- gdb/gdbarch.c | 10 +- gdb/gdbarch.h | 19 +- gdb/gdbarch.sh | 25 +- gdb/gdbcmd.h | 2 +- gdb/gdbtypes.c | 12 +- gdb/gnu-v3-abi.c | 57 +- gdb/go-lang.h | 4 +- gdb/go-valprint.c | 14 +- gdb/guile/guile-internal.h | 4 +- gdb/guile/guile.c | 18 +- gdb/guile/scm-breakpoint.c | 6 +- gdb/guile/scm-disasm.c | 6 +- gdb/guile/scm-frame.c | 6 +- gdb/guile/scm-pretty-print.c | 9 +- gdb/guile/scm-type.c | 42 +- gdb/guile/scm-value.c | 21 +- gdb/i386-tdep.c | 8 +- gdb/infcmd.c | 12 +- gdb/infrun.c | 14 +- gdb/language.c | 11 +- gdb/language.h | 23 +- gdb/linespec.c | 53 +- gdb/m2-lang.h | 4 +- gdb/m2-valprint.c | 21 +- gdb/main.c | 31 +- gdb/mi/mi-cmd-var.c | 95 +- gdb/mi/mi-main.c | 44 +- gdb/minsyms.c | 17 +- gdb/mips-tdep.c | 59 +- gdb/mips-tdep.h | 2 +- gdb/moxie-tdep.c | 34 +- gdb/mt-tdep.c | 9 +- gdb/nios2-tdep.c | 8 +- gdb/objc-lang.c | 7 +- gdb/p-lang.h | 6 +- gdb/p-valprint.c | 19 +- gdb/parse.c | 50 +- gdb/ppc-tdep.h | 2 +- gdb/printcmd.c | 63 +- gdb/python/py-arch.c | 10 +- gdb/python/py-breakpoint.c | 38 +- gdb/python/py-cmd.c | 17 +- gdb/python/py-frame.c | 23 +- gdb/python/py-framefilter.c | 70 +- gdb/python/py-function.c | 15 +- gdb/python/py-infthread.c | 8 +- gdb/python/py-param.c | 46 +- gdb/python/py-prettyprint.c | 35 +- gdb/python/py-type.c | 15 +- gdb/python/py-unwind.c | 17 +- gdb/python/py-utils.c | 60 +- gdb/python/py-value.c | 27 +- gdb/python/py-varobj.c | 12 +- gdb/python/python-internal.h | 17 +- gdb/python/python.c | 43 +- gdb/record-full.c | 18 +- gdb/remote.c | 108 +- gdb/rs6000-aix-tdep.c | 12 +- gdb/rs6000-tdep.c | 12 +- gdb/rust-exp.y | 101 +- gdb/rust-lang.c | 97 +- gdb/s390-linux-tdep.c | 16 +- gdb/sh64-tdep.c | 15 +- gdb/sparc-tdep.c | 9 +- gdb/spu-tdep.c | 32 +- gdb/stabsread.c | 21 +- gdb/stack.c | 6 +- gdb/symtab.c | 87 +- gdb/symtab.h | 39 +- gdb/testsuite/ChangeLog | 94 +- gdb/testsuite/gdb.base/commands.exp | 519 ++-- gdb/testsuite/gdb.base/dump.exp | 4 +- gdb/testsuite/gdb.base/tui-layout.c | 47 + gdb/testsuite/gdb.base/tui-layout.exp | 17 +- .../gdb.mi/user-selected-context-sync.exp | 55 +- gdb/testsuite/gdb.python/py-framefilter.py | 6 + gdb/testsuite/gdb.python/py-value.exp | 6 +- gdb/testsuite/lib/gdb.exp | 21 + gdb/tic6x-tdep.c | 9 +- gdb/top.c | 14 +- gdb/tracepoint.c | 522 ++-- gdb/tracepoint.h | 72 +- gdb/tui/tui-disasm.c | 43 +- gdb/tui/tui-winsource.c | 22 +- gdb/typeprint.c | 21 +- gdb/ui-file.c | 22 + gdb/ui-file.h | 6 + gdb/ui-out.c | 9 +- gdb/utils-selftests.c | 60 + gdb/utils.c | 5 +- gdb/valprint.c | 191 +- gdb/valprint.h | 12 +- gdb/value.c | 8 +- gdb/value.h | 6 +- gdb/varobj-iter.h | 4 +- gdb/varobj.c | 236 +- gdb/varobj.h | 73 +- gdb/xtensa-tdep.c | 9 +- include/ChangeLog | 10 + include/opcode/aarch64.h | 22 +- ld/ChangeLog | 8 + ld/testsuite/ld-aarch64/aarch64-elf.exp | 2 + ld/testsuite/ld-aarch64/pie-bind-locally-a.s | 5 + ld/testsuite/ld-aarch64/pie-bind-locally-b.s | 6 + ld/testsuite/ld-aarch64/pie-bind-locally.d | 9 + opcodes/ChangeLog | 86 + opcodes/aarch64-asm-2.c | 922 +++--- opcodes/aarch64-dis-2.c | 3579 +++++++++++--------- opcodes/aarch64-gen.c | 4 +- opcodes/aarch64-opc-2.c | 97 +- opcodes/aarch64-opc.c | 25 + opcodes/aarch64-tbl.h | 51 + opcodes/i386-dis-evex.h | 2 +- opcodes/i386-dis.c | 348 +-- opcodes/i386-opc.tbl | 14 +- opcodes/i386-tbl.h | 84 +- sim/mips/ChangeLog | 11 + sim/mips/dv-tx3904cpu.c | 5 + sim/mips/mips.igen | 1 + 223 files changed, 7620 insertions(+), 5887 deletions(-) create mode 100644 binutils/testsuite/binutils-all/nm-ver.s create mode 100644 gas/testsuite/gas/aarch64/illegal-crypto-nofp.d create mode 100644 gas/testsuite/gas/aarch64/illegal-crypto-nofp.l create mode 100644 gas/testsuite/gas/aarch64/illegal-fp16-nofp.d create mode 100644 gas/testsuite/gas/aarch64/illegal-fp16-nofp.l create mode 100644 gas/testsuite/gas/aarch64/illegal-fp16-nofp.s create mode 100644 gas/testsuite/gas/aarch64/illegal-sysreg-3.d create mode 100644 gas/testsuite/gas/aarch64/illegal-sysreg-3.l create mode 100644 gas/testsuite/gas/aarch64/pac.d create mode 100644 gas/testsuite/gas/aarch64/pac.s create mode 100644 gas/testsuite/gas/aarch64/sysreg-3.d create mode 100644 gas/testsuite/gas/aarch64/sysreg-3.s create mode 100644 gas/testsuite/gas/aarch64/system-3.d create mode 100644 gas/testsuite/gas/aarch64/system-3.s create mode 100644 gas/testsuite/gas/i386/fpu-bad.d create mode 100644 gas/testsuite/gas/i386/fpu-bad.s create mode 100644 gas/testsuite/gas/sparc/pr20732.d create mode 100644 gas/testsuite/gas/sparc/pr20732.s create mode 100644 gdb/testsuite/gdb.base/tui-layout.c create mode 100644 gdb/utils-selftests.c create mode 100644 ld/testsuite/ld-aarch64/pie-bind-locally-a.s create mode 100644 ld/testsuite/ld-aarch64/pie-bind-locally-b.s create mode 100644 ld/testsuite/ld-aarch64/pie-bind-locally.d First 500 lines of diff: diff --git a/ChangeLog b/ChangeLog index c4412c8..84ad164 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2016-11-07 Doug Evans + + * config.sub: Sync with upstream version 2016-11-03. + git://git.sv.gnu.org/config.git + * config.guess: Sync with upstream version 2016-10-02. + 2016-09-27 Simon Marchi * .gitignore: Add archives and make stamps. diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 810dd05..b8a1ba4 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,48 @@ +2016-11-11 Luke Allardyce + + PR ld/20722 + * coffcode.h (coff_slurp_symbol_table): Accept C_HIDDEN symbols, + but treat them as debugging symbols. + +2016-11-10 Jiong Wang + + PR target/20737 + * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Bind defined + symbol locally in PIE. + +2016-11-10 Nick Clifton + + PR binutils/20801 + * compress.c (bfd_get_full_section_contents): Provide a more + helpful error message when a section is too large to load. + +2016-11-08 Pedro Alves + + * dwarf2.c (struct funcinfo) : Type is bfd_boolean, + not "bfd boolean". + +2016-11-08 Igor Tsimbalist + + * dwarf2.c (comp_unit): Add new fields 'lookup_funcinfo_table' and + 'number_of_functions' to keep lookup table and number of entries in + the table. + (line_sequence): Add new fields 'line_info_lookup' and 'num_lines' + to keep lookup table and number of entries in the table. + (lookup_funcinfo): New structure for lookup table for function + references. + (build_line_info_table): New function to create and build the lookup + table for line information. + (lookup_address_in_line_info_table): Use the lookup table instead of + traverse a linked list. + (compare_lookup_funcinfos): New compare fuction used in sorting of + lookup table for function references. + (build_lookup_funcinfo_table): New function to create, build and + sort the lookup table for functions references. + (lookup_address_in_function_table): Use the table instead of + traverse a linked list. + (_bfd_dwarf2_cleanup_debug_info): Free memory from function references + lookup table. + 2016-11-04 Nick Clifton * targets.c (bfd_target_vector): Only add riscv_elf32_vec target diff --git a/bfd/coffcode.h b/bfd/coffcode.h index 0862f66..b926c65 100644 --- a/bfd/coffcode.h +++ b/bfd/coffcode.h @@ -5068,7 +5068,6 @@ coff_slurp_symbol_table (bfd * abfd) case C_UEXT: /* Tentative external definition. */ #endif case C_EXTLAB: /* External load time label. */ - case C_HIDDEN: /* Ext symbol in dmert public lib. */ default: _bfd_error_handler /* xgettext:c-format */ @@ -5076,6 +5075,10 @@ coff_slurp_symbol_table (bfd * abfd) abfd, src->u.syment.n_sclass, dst->symbol.section->name, dst->symbol.name); ret = FALSE; + /* Faal through. */ + case C_HIDDEN: /* Ext symbol in dmert public lib. */ + /* PR 20722: These symbols can also be generated by + building DLLs with --gc-sections enabled. */ dst->symbol.flags = BSF_DEBUGGING; dst->symbol.value = (src->u.syment.n_value); break; diff --git a/bfd/compress.c b/bfd/compress.c index 0a96630..95e8c23 100644 --- a/bfd/compress.c +++ b/bfd/compress.c @@ -247,7 +247,15 @@ bfd_get_full_section_contents (bfd *abfd, sec_ptr sec, bfd_byte **ptr) { p = (bfd_byte *) bfd_malloc (sz); if (p == NULL) + { + /* PR 20801: Provide a more helpful error message. */ + if (bfd_get_error () == bfd_error_no_memory) + _bfd_error_handler + /* xgettext:c-format */ + (_("error: %B(%A) is too large (%#lx bytes)"), + abfd, sec, (long) sz); return FALSE; + } } if (!bfd_get_section_contents (abfd, sec, p, 0, sz)) diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c index 81001c4..287ba0f 100644 --- a/bfd/dwarf2.c +++ b/bfd/dwarf2.c @@ -144,16 +144,16 @@ struct dwarf2_debug /* Length of the loaded .debug_str section. */ bfd_size_type dwarf_str_size; - /* Pointer to the .debug_ranges section loaded into memory. */ + /* Pointer to the .debug_ranges section loaded into memory. */ bfd_byte *dwarf_ranges_buffer; - /* Length of the loaded .debug_ranges section. */ + /* Length of the loaded .debug_ranges section. */ bfd_size_type dwarf_ranges_size; /* If the most recent call to bfd_find_nearest_line was given an address in an inlined function, preserve a pointer into the calling chain for subsequent calls to bfd_find_inliner_info to - use. */ + use. */ struct funcinfo *inliner_chain; /* Section VMAs at the time the stash was built. */ @@ -256,6 +256,12 @@ struct comp_unit /* A list of the functions found in this comp. unit. */ struct funcinfo *function_table; + /* A table of function information references searchable by address. */ + struct lookup_funcinfo *lookup_funcinfo_table; + + /* Number of functions in the function_table and sorted_function_table. */ + bfd_size_type number_of_functions; + /* A list of the variables found in this comp. unit. */ struct varinfo *variable_table; @@ -390,7 +396,7 @@ struct info_hash_table struct bfd_hash_table base; }; -/* Function to create a new entry in info hash table. */ +/* Function to create a new entry in info hash table. */ static struct bfd_hash_entry * info_hash_table_newfunc (struct bfd_hash_entry *entry, @@ -476,7 +482,7 @@ insert_info_hash_table (struct info_hash_table *hash_table, } /* Look up an info entry list from an info hash table. Return NULL - if there is none. */ + if there is none. */ static struct info_list_node * lookup_info_hash_table (struct info_hash_table *hash_table, const char *key) @@ -1214,22 +1220,22 @@ non_mangled (int lang) struct line_info { - struct line_info* prev_line; - bfd_vma address; - char *filename; - unsigned int line; - unsigned int column; - unsigned int discriminator; - unsigned char op_index; - unsigned char end_sequence; /* End of (sequential) code sequence. */ + struct line_info * prev_line; + bfd_vma address; + char * filename; + unsigned int line; + unsigned int column; + unsigned int discriminator; + unsigned char op_index; + unsigned char end_sequence; /* End of (sequential) code sequence. */ }; struct fileinfo { - char *name; - unsigned int dir; - unsigned int time; - unsigned int size; + char * name; + unsigned int dir; + unsigned int time; + unsigned int size; }; struct line_sequence @@ -1237,11 +1243,13 @@ struct line_sequence bfd_vma low_pc; struct line_sequence* prev_sequence; struct line_info* last_line; /* Largest VMA. */ + struct line_info** line_info_lookup; + bfd_size_type num_lines; }; struct line_info_table { - bfd* abfd; + bfd * abfd; unsigned int num_files; unsigned int num_dirs; unsigned int num_sequences; @@ -1260,23 +1268,37 @@ struct line_info_table struct funcinfo { /* Pointer to previous function in list of all functions. */ - struct funcinfo *prev_func; + struct funcinfo * prev_func; /* Pointer to function one scope higher. */ - struct funcinfo *caller_func; + struct funcinfo * caller_func; /* Source location file name where caller_func inlines this func. */ - char *caller_file; + char * caller_file; /* Source location file name. */ - char *file; + char * file; /* Source location line number where caller_func inlines this func. */ - int caller_line; + int caller_line; /* Source location line number. */ - int line; - int tag; - bfd_boolean is_linkage; - const char *name; - struct arange arange; + int line; + int tag; + bfd_boolean is_linkage; + const char * name; + struct arange arange; /* Where the symbol is defined. */ - asection *sec; + asection * sec; +}; + +struct lookup_funcinfo +{ + /* Function information corresponding to this lookup table entry. */ + struct funcinfo * funcinfo; + + /* The lowest address for this specific function. */ + bfd_vma low_addr; + + /* The highest address of this function before the lookup table is sorted. + The highest address of all prior functions after the lookup table is + sorted, which is used for binary search. */ + bfd_vma high_addr; }; struct varinfo @@ -1539,7 +1561,7 @@ arange_add (const struct comp_unit *unit, struct arange *first_arange, while (arange); /* Need to allocate a new arange and insert it into the arange list. - Order isn't significant, so just insert after the first arange. */ + Order isn't significant, so just insert after the first arange. */ arange = (struct arange *) bfd_alloc (unit->abfd, sizeof (*arange)); if (arange == NULL) return FALSE; @@ -1579,17 +1601,62 @@ compare_sequences (const void* a, const void* b) return 0; } +/* Construct the line information table for quick lookup. */ + +static bfd_boolean +build_line_info_table (struct line_info_table * table, + struct line_sequence * seq) +{ + bfd_size_type amt; + struct line_info** line_info_lookup; + struct line_info* each_line; + unsigned int num_lines; + unsigned int index; + + if (seq->line_info_lookup != NULL) + return TRUE; + + /* Count the number of line information entries. We could do this while + scanning the debug information, but some entries may be added via + lcl_head without having a sequence handy to increment the number of + lines. */ + num_lines = 0; + for (each_line = seq->last_line; each_line; each_line = each_line->prev_line) + num_lines++; + + if (num_lines == 0) + return TRUE; + + /* Allocate space for the line information lookup table. */ + amt = sizeof (struct line_info*) * num_lines; + line_info_lookup = (struct line_info**) bfd_alloc (table->abfd, amt); + if (line_info_lookup == NULL) + return FALSE; + + /* Create the line information lookup table. */ + index = num_lines; + for (each_line = seq->last_line; each_line; each_line = each_line->prev_line) + line_info_lookup[--index] = each_line; + + BFD_ASSERT (index == 0); + + seq->num_lines = num_lines; + seq->line_info_lookup = line_info_lookup; + + return TRUE; +} + /* Sort the line sequences for quick lookup. */ static bfd_boolean sort_line_sequences (struct line_info_table* table) { - bfd_size_type amt; - struct line_sequence* sequences; - struct line_sequence* seq; - unsigned int n = 0; - unsigned int num_sequences = table->num_sequences; - bfd_vma last_high_pc; + bfd_size_type amt; + struct line_sequence* sequences; + struct line_sequence* seq; + unsigned int n = 0; + unsigned int num_sequences = table->num_sequences; + bfd_vma last_high_pc; if (num_sequences == 0) return TRUE; @@ -1610,6 +1677,8 @@ sort_line_sequences (struct line_info_table* table) sequences[n].low_pc = seq->low_pc; sequences[n].prev_sequence = NULL; sequences[n].last_line = seq->last_line; + sequences[n].line_info_lookup = NULL; + sequences[n].num_lines = 0; seq = seq->prev_sequence; free (last_seq); } @@ -2091,7 +2160,7 @@ lookup_address_in_line_info_table (struct line_info_table *table, unsigned int *discriminator_ptr) { struct line_sequence *seq = NULL; - struct line_info *each_line; + struct line_info *info; int low, high, mid; /* Binary search the array of sequences. */ @@ -2109,26 +2178,43 @@ lookup_address_in_line_info_table (struct line_info_table *table, break; } - if (seq && addr >= seq->low_pc && addr < seq->last_line->address) + /* Check for a valid sequence. */ + if (!seq || addr < seq->low_pc || addr >= seq->last_line->address) + goto fail; + + if (!build_line_info_table (table, seq)) + goto fail; + + /* Binary search the array of line information. */ + low = 0; + high = seq->num_lines; + info = NULL; + while (low < high) { - /* Note: seq->last_line should be a descendingly sorted list. */ - for (each_line = seq->last_line; - each_line; - each_line = each_line->prev_line) - if (addr >= each_line->address) - break; + mid = (low + high) / 2; + info = seq->line_info_lookup[mid]; + if (addr < info->address) + high = mid; + else if (addr >= seq->line_info_lookup[mid + 1]->address) + low = mid + 1; + else + break; + } - if (each_line - && !(each_line->end_sequence || each_line == seq->last_line)) - { - *filename_ptr = each_line->filename; - *linenumber_ptr = each_line->line; - if (discriminator_ptr) - *discriminator_ptr = each_line->discriminator; - return seq->last_line->address - seq->low_pc; - } + /* Check for a valid line information entry. */ + if (info + && addr >= info->address + && addr < seq->line_info_lookup[mid + 1]->address + && !(info->end_sequence || info == seq->last_line)) + { + *filename_ptr = info->filename; + *linenumber_ptr = info->line; + if (discriminator_ptr) + *discriminator_ptr = info->discriminator; + return seq->last_line->address - seq->low_pc; } +fail: *filename_ptr = NULL; return 0; } @@ -2136,16 +2222,102 @@ lookup_address_in_line_info_table (struct line_info_table *table, /* Read in the .debug_ranges section for future reference. */ static bfd_boolean -read_debug_ranges (struct comp_unit *unit) +read_debug_ranges (struct comp_unit * unit) { - struct dwarf2_debug *stash = unit->stash; + struct dwarf2_debug * stash = unit->stash; + return read_section (unit->abfd, &stash->debug_sections[debug_ranges], stash->syms, 0, - &stash->dwarf_ranges_buffer, &stash->dwarf_ranges_size); + &stash->dwarf_ranges_buffer, + &stash->dwarf_ranges_size); } /* Function table functions. */ +static int +compare_lookup_funcinfos (const void * a, const void * b) +{ + const struct lookup_funcinfo * lookup1 = a; + const struct lookup_funcinfo * lookup2 = b; + + if (lookup1->low_addr < lookup2->low_addr) + return -1; + if (lookup1->low_addr > lookup2->low_addr) + return 1; + if (lookup1->high_addr < lookup2->high_addr) + return -1; + if (lookup1->high_addr > lookup2->high_addr) + return 1; + + return 0; +} + +static bfd_boolean +build_lookup_funcinfo_table (struct comp_unit * unit) +{ + struct lookup_funcinfo *lookup_funcinfo_table = unit->lookup_funcinfo_table; + unsigned int number_of_functions = unit->number_of_functions; + struct funcinfo *each; + struct lookup_funcinfo *entry; + size_t index; + struct arange *range; + bfd_vma low_addr, high_addr; + + if (lookup_funcinfo_table || number_of_functions == 0) + return TRUE; + + /* Create the function info lookup table. */ + lookup_funcinfo_table = (struct lookup_funcinfo *) + bfd_malloc (number_of_functions * sizeof (struct lookup_funcinfo)); + if (lookup_funcinfo_table == NULL) + return FALSE; + + /* Populate the function info lookup table. */ + index = number_of_functions; + for (each = unit->function_table; each; each = each->prev_func) + { + entry = &lookup_funcinfo_table[--index]; + entry->funcinfo = each; + + /* Calculate the lowest and highest address for this function entry. */ + low_addr = entry->funcinfo->arange.low; + high_addr = entry->funcinfo->arange.high; + + for (range = entry->funcinfo->arange.next; range; range = range->next) + { + if (range->low < low_addr) + low_addr = range->low; + if (range->high > high_addr) + high_addr = range->high; + } + + entry->low_addr = low_addr; + entry->high_addr = high_addr; + } + hooks/post-receive -- Repository for Project Archer.