From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21025 invoked by alias); 25 Aug 2015 19:07:04 -0000 Mailing-List: contact archer-commits-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: Received: (qmail 21006 invoked by uid 9674); 25 Aug 2015 19:07:03 -0000 Date: Tue, 25 Aug 2015 19:07:00 -0000 Message-ID: <20150825190703.20869.qmail@sourceware.org> From: jkratoch@sourceware.org To: archer-commits@sourceware.org Subject: [SCM] jankratochvil/gdbserverbuildid: Support build-id for main executables X-Git-Refname: refs/heads/jankratochvil/gdbserverbuildid X-Git-Reftype: branch X-Git-Oldrev: 9d526416f035a6d567c0a75ad10f61d67b91debf X-Git-Newrev: d99e54cbaa83585d4bdc557b10d8205f9ee0c2bf X-SW-Source: 2015-q3/txt/msg00042.txt.bz2 List-Id: The branch, jankratochvil/gdbserverbuildid has been updated discards 9d526416f035a6d567c0a75ad10f61d67b91debf (commit) discards a6d283fe348dbafbccd88da6b7099b31fa4126d5 (commit) discards efb71ced9ef12350e058619d3650c6ab7a1dfef0 (commit) discards 7c3dd94e53ba20bc11e098769a141af3f14577df (commit) discards 5cf3c5364b0f2cba7ad361249cfd6ff99aa8d53e (commit) discards daae6fc4931db1b4db2594d8e887ad7f7984fe23 (commit) discards 5c5d66bbc85470417f3d7ee0090054892ca4f0f0 (commit) discards c35b25ff57933441e00c6addddcf0ef76ec4ae46 (commit) discards a69b2e74ab27ba3afd7295f70a055077b348e43a (commit) discards dd0075e027a00de63a3fcda35d82ebd78b8d7d19 (commit) discards 1768eace6960d429a857a2001c7c03434cdb645f (commit) discards c1319b6c65880a7b8e555591c363026e1963f9ab (commit) discards be1f700d55efd36f999ce06c775ae45da58c657c (commit) discards f3631298bda92030bd47a85f64ade40b3c058e80 (commit) discards 4edc3608dd24ab35ee638dbf1a2fa60eb5f3d14b (commit) discards df951efc0fcc567655b25f191d42b79fb0a4cd6b (commit) discards 2cea39c30f7a8a6e244f4f6c80c8bbeb412a0527 (commit) discards 2700a11a5c5abeb4a28e5e98bdf840dafa46262f (commit) discards b84ef18752bbeb8aed01bd1738177c4927e9ffe9 (commit) discards c13173c2eb639887985adbf0a6be994b7fd26781 (commit) discards ec55f3085ced8407ec8a372dfed7f7cf3490a625 (commit) discards 154d3aa120e9a2ed255e4ea0f9c0bd0d092c0e77 (commit) discards 7e0bdfa3a966e5d1d2388a1ca064a1e9e0713220 (commit) discards b5d2b733dfe3ebf72136400d76bd2c5c4ef72f56 (commit) discards 885cf907c1222da14b31c8e36cbaaca4dadfd737 (commit) discards d3de81222038fdc9744a62368cb7d822812f7a61 (commit) discards 91ced4b77535b97c67a3eaa1ca52a1622d82a539 (commit) discards 3c14f41e452101f2b334e3457e192cdaf6399ab4 (commit) discards 4e740c7af8897af2135eccf99b462d66e21944a6 (commit) discards ee82cb85c7a59dc6a5dfcec0871a655e23212dc9 (commit) discards 916c08762b5f7b08d55982ed0e8425407a924a67 (commit) discards 6061861af8d9249058b90c604068a4f3600cc324 (commit) via d99e54cbaa83585d4bdc557b10d8205f9ee0c2bf (commit) via 01da7c01ec1e471365f400750281b4203391ced4 (commit) via adb7552ccb05c06beb2206781096941ed7f82d98 (commit) via 6ab2e5bc9724ebe52a3af5e65fe4a3fdcf8322ab (commit) via d8e8defc149923e8681c102859f88148920231fb (commit) via 31525e5877ccb83604e971922a2df318a42dac01 (commit) via 85f9a15b425c54da58036de2ce14dcfdd9263662 (commit) via fe533db9feb1245389a609bf0d608b598864b97e (commit) via e150dd333417704e098e49e956aa7bad62f90bc5 (commit) via 147927668e1af6fe08cd7fd66c1b7067f1127896 (commit) via ef8f40015e7ba2b0121bdf5fb7df22c477878bc2 (commit) via f9b4ab1e97117468ef757d9c2172bf67f6861b4f (commit) via deb941292b4704a55b5716b25db5eb37fdc9decd (commit) via 78196e2d0b860fa2fa5e3e12a26966d0d86746e3 (commit) via ee826afa4082d831819e959c78f70f87fbb3887c (commit) via 41744ddd2eb4c1c3d739b4ae072ec7555d627b0e (commit) via 43ed69c3939b6ddf70f8adeee9b12e7ea7f0bcd4 (commit) via b0ff8fd19664b4accddde8b198ebdf7d4db9479c (commit) via 08e8ab00fb10cf2ace96879af72bb505b09abb4e (commit) via ad21a771aef7bc9d3f8384a6535a696a264d3b67 (commit) via e8bc24fccbbecf1de9137d6c3ed09893e67f963c (commit) via 184eca8d09fadf7a7f9200a12401346b4cabe313 (commit) via f86c25c91946c70e5ace8256a2ea901c5c292569 (commit) via 44c01eb2a9984e94bc25483829e473e37206ada1 (commit) via 0ebe17076406a85a35eb0c4f362850ed9efb843e (commit) via 7b4dd1456b3c285b1e65dcae65c0ab6c53896991 (commit) via 03d470b67389d35a14a122d2c74c982487779d7a (commit) via 7b852ff6e5f327a01e6d2ef9f8c3d840f1874373 (commit) via 769819ca7bc9c987e4d3ac4c2da81ec5412d6e58 (commit) via 585aca87aa8a2f7a30840ad1bc3fce08a877371e (commit) via 47c5d88029a42bd629e933da0a61e7bf8e9ccbbe (commit) via fe4882f5dd484d3bb8d9a53d5977ee318ecc1848 (commit) via 16ad13eca4a18139cd1dec214ec83fdc7c47ffda (commit) via cdbfb8861732b496b9ee35b130af75b245e2bc02 (commit) via abc56d60aacccb64e146eb7a245b3ca2cea52dd9 (commit) via 38074311927d012e4cbd28d825878974c9209f77 (commit) via dfe7f77c4aae3376c175d8af4d477124c8817427 (commit) via 63e43d3aedb8b1112899c2d0ad74cbbee687e5d6 (commit) via 7c2bea1ad1c779b893eb9cad4c92732583ae0eb5 (commit) via ed8b7b421c98533b9b08995edd7363328b55921e (commit) via db3cb7cb3e51e5eb834412adbf90e81bb76846c6 (commit) via f6011a1c84b1bd616617bfde84dca63f250c950d (commit) via 88e2cf7ee25c72bce35ebe59b13c9701abce9fee (commit) via 5e35436ed12617494d2a2d190e0faca5613a2e9f (commit) via 75e1f0f7a0992835415e9bb924ec21a9aac6d5a1 (commit) via 4a8a7965f233f571b78f7992292a31c990c15a5e (commit) via 32a271eeaf1b1be1367b6ea181a0f39a3da71d45 (commit) via 0d51c8d71c19531bf29a3ba303c040c7c772a4a1 (commit) via 5e137137b2ff267fbf33b1e47f0413292ccb40d6 (commit) via 31a43dd5e1cfb8bb387885b3f641d6d2c04ac5dd (commit) via 8ee525679d030cd2c35eaee3b8d4ac545c5dc8ee (commit) via ff3f0f45c5ff3505d041eba81a999b55c55f4530 (commit) via 9a117542138b8fa4a6ca9c7b4cf9935d509b9809 (commit) via 3d40fbb53b4478d94b6fa5abad0796cec5d5db49 (commit) via 73b8c1fda9f3759874a9a1a7e7402276da057153 (commit) via 4a626d0a0f451c3288a461f64a9f8a49790d422b (commit) via 438e1e427e8393de73d22617abe4d8eba0270e72 (commit) via a8c6d4fcd6b2a30c2b5b87d656ce035dcf8b0035 (commit) via 4422ac93e5d3d23dd441aadaa49c81356aa59b73 (commit) via 91dddb86299bba404599551e9e2633b3c0e5c830 (commit) via a48847eea5f39c1f9fbe4255c9e892647f13f995 (commit) via 0ebbc52beef41c725f75b22c80a37fee00303bb0 (commit) via bb61542818398aa00f869257c0734ffdc39275b5 (commit) via 40e0b27177e747600d3ec186458fe0e482a1cf77 (commit) via 5f40e14d768b94f7fdc050aeba5ee62e6a8d5756 (commit) via 77c365df78441f7b968ec0f62c7ed9f5de36dc60 (commit) via cfe101c6a8227b6b97ed2da85895db7d6083bfa6 (commit) via b83035f1f61c8749983aef1f51162947a284827d (commit) via 5f329d5b1409dfb86e3eb6a22e9f84cc58c254b1 (commit) via d579c450dd97470b0601ceb5d3e3d926e7a1333e (commit) via 595bce7595e076391e7147b0c6db57a8edf2e406 (commit) via 0d6b12851b08f5f71f7d97d2c832b899d63b5df2 (commit) via 99b0bb12cdb22489b403df6afe992b81bebbd9ec (commit) via f8904751117dc8d4d04e5c5286b71b854e6ebba5 (commit) via 049412e38f9ac04654940173db63a37ebca9bfc3 (commit) via 948578a989f8c666c9b0e92c9a50906724921f14 (commit) via 7a8bcb88e77380fe9672b4f10777cc9e48011dd4 (commit) from 9d526416f035a6d567c0a75ad10f61d67b91debf (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit d99e54cbaa83585d4bdc557b10d8205f9ee0c2bf Author: Jan Kratochvil Date: Fri Aug 21 21:40:56 2015 +0200 Support build-id for main executables Hi, make all the existing shlibs build-id functionality working also for the main executables. I think target_so_ops::open_symbol_file_object() is already replaced by what exec_file_and_symbols_resync(), target_pid_to_exec_file() etc. does but open_symbol_file_object() has been forgotten. This patch adds target_so_ops::main_build_id() which could be possibly marged with open_symbol_file_object() but I made it a separate function as I think it is easier to rather remove target_so_ops::open_symbol_file_object(). Jan gdb/ChangeLog 2015-08-20 Jan Kratochvil * NEWS (Changes since GDB 7.10): Mention also main-build-id. * build-id.c (build_id_verify): Add parameter advice. * build-id.h (build_id_verify): Likewise. * dwarf2read.c (dwarf2_get_dwz_file): Update build_id_verify caller. * exec.c: Include build-id.h. (exec_file_and_symbols_resync): Detect and use build-id by solib_main_build_id. * features/library-list-svr4.dtd: Add main-build-id. * solib-svr4.c (struct svr4_info, struct svr4_library_list): Add fields main_build_idsz and main_build_id. (hex2bin_allocate): Generalize messages to binary files. (svr4_library_list_start_list): Parse main-build-id. (svr4_library_list_attributes): Add main-build-id. (svr4_current_sos_direct): Set svr4_info main_build_id*. (svr4_main_build_id): New function. (svr4_clear_solib): Clear svr4_info main_build_id*. (_initialize_svr4_solib): Install svr4_main_build_id. * solib.c (solib_main_build_id): New function. * solist.h (struct target_so_ops): Add method main_build_id. (solib_main_build_id): New prototype. * source.c (file_location_from_filename): Update build_id_verify caller. gdb/gdbserver/ChangeLog 2015-08-20 Jan Kratochvil * linux-low.c (linux_qxfer_libraries_svr4): Print main-build-id. gdb/doc/ChangeLog 2015-08-20 Jan Kratochvil * gdb.texinfo (Files): Add 'set validate-build-id' and 'show validate-build-id'. gdb/testsuite/ChangeLog 2015-08-20 Jan Kratochvil * gdb.base/main-mismatch-mod.c: New file. * gdb.base/main-mismatch.c: New file. * gdb.base/main-mismatch.exp: New file. commit 01da7c01ec1e471365f400750281b4203391ced4 Author: Jan Kratochvil Date: Fri Aug 21 21:40:55 2015 +0200 Make only user-specified executable and symbol filenames sticky Message-ID: <559A7C37.6020501@redhat.com> On 07/03/2015 04:44 PM, Pedro Alves wrote: > (I still suspect that if we reverse the sense of the flag, then > its management ends up being more centralized, as then the > place that sets it is also the place that needs to check it, > instead of doing that in multiple places. But, see below.) It didn't seem fair to impose a subjective preference, so I tried this in order to understand it myself, and I now agree that is really doesn't make much difference, as then we'd have to mark auto-discovered in a few more places that I wasn't originally seeing. There's at least the execd handling in infrun.c, and also spu_symbol_file_add_from_memory. As I was playing with this already, I poked at the other review points I made, and came up with the variant of the patch below. > This function is called while the passed in PID is not the > current inferior. E.g., the remote_add_inferior path. > > Therefore seems to me that these symbol_file_add_main / exec_file_attach > calls can change the symbols of the wrong inferior. ... > I also notice that reread_symbols has an exec_file_attach > call which seems to me results in losing the is_user_supplied > flag if the executable's timestamp changed, at least here: > >> + /* Attempt to open the file that was executed to create this >> + inferior. If the user has explicitly specified executable >> + and/or symbol files then warn the user if their choices do >> + not match. Otherwise, set exec_file and symfile_objfile to >> + the new file. */ >> + exec_file_locate_attach (ptid_get_pid (inferior_ptid), from_tty); >> + >> + if (exec_file_is_user_supplied) >> { >> reopen_exec_file (); >> reread_symbols (); > > > I also notice that the clone-inferior command ends up with > an exec_file_attach call in clone_program_space. That one > should probably be setting the is_user_supplied flag too, > I'd think. Or at least, copying it from the original. > > At this point, I'm wondering about adding a parameter to > exec_file_attach to force considering (now and in future) > the right value to put in the flag in each case. I tried this too (see patch below). As this requires touching the user-supplied paths anyway, it didn't really matter to tag files user-supplied or auto-discovered, so I reverted back to user-supplied. For symbols, we already have the add_flags, so I added SYMFILE_USER_SUPPLIED instead of a new boolean. > >> @@ -2490,11 +2490,14 @@ attach_command_post_wait (char *args, int from_tty, int async_exec) >> inferior = current_inferior (); >> inferior->control.stop_soon = NO_STOP_QUIETLY; >> >> - /* If no exec file is yet known, try to determine it from the >> - process itself. */ >> - if (get_exec_file (0) == NULL) >> - exec_file_locate_attach (ptid_get_pid (inferior_ptid), from_tty); >> - else >> + /* Attempt to open the file that was executed to create this >> + inferior. If the user has explicitly specified executable >> + and/or symbol files then warn the user if their choices do >> + not match. Otherwise, set exec_file and symfile_objfile to >> + the new file. */ >> + exec_file_locate_attach (ptid_get_pid (inferior_ptid), from_tty); >> + >> + if (exec_file_is_user_supplied) >> { >> reopen_exec_file (); >> reread_symbols (); > > It seems to me that we should be able to move these reopen/reread > calls inside exec_file_locate_attach. I did this too. What do you think of the version below? I also tweaked the warnings a bit, to explicitly say "mismatch". This would still need docs/NEWS changes, and a test would be good too. ---------- - pass user-supplied / auto-discovered as arguments to exec_file_attach and symbol_file_add_main - Change exec_file_locate_attach parameter from pid to inferior pointer. - Flip current program space temporarily to make sure we add/reload symbols to/of the right inferior/program space. - Move reopen_exec_file and reread_symbols calls inside exec_file_locate_attach. - Warning message tweaks. - Rename exec_file_locate_attach -> exec_file_and_symbols_resync commit adb7552ccb05c06beb2206781096941ed7f82d98 Author: Jan Kratochvil Date: Fri Aug 21 21:40:55 2015 +0200 Code cleanup: New hex2bin_allocate() Hi, make hex->bin parsing standalone, to be reused in later patch. Jan gdb/ChangeLog 2015-08-20 Jan Kratochvil * solib-svr4.c (hex2bin_allocate): New function from ... (library_list_start_library): ... here, call it. commit 6ab2e5bc9724ebe52a3af5e65fe4a3fdcf8322ab Author: Jan Kratochvil Date: Fri Aug 21 21:40:55 2015 +0200 testcase: Test also locating shlibs by build-id Hi, testcase from the previous patch tests verification of build-id in shared libraries found by their name. This test adds testing that a library can be found by its build-id (debug-file-directory/.build-id/XX/YYYYY...YYYYY). Jan gdb/testsuite/ChangeLog 2015-08-20 Jan Kratochvil * gdb.base/solib-mismatch.exp (nocrlf, expected_header): Make them global. (solib_locate_test): New function. commit d8e8defc149923e8681c102859f88148920231fb Author: Jan Kratochvil Date: Fri Aug 21 21:40:55 2015 +0200 Tests for validate symbol file using build-id Hi, new testcase only. Jan gdb/testsuite/ChangeLog 2015-07-15 Aleksandar Ristovski Date: Fri Aug 21 21:40:55 2015 +0200 build_id_verify: Make it more verbose Hi, it was discussed on this list that if build-ids do not match they should be printed for troubleshooting. It is mostly independent from the other patches. Jan gdb/ChangeLog 2015-08-20 Jan Kratochvil * build-id.c: Include rsp-low.h. (build_id_verify): Print non-matching build-ids, update the messages. commit 85f9a15b425c54da58036de2ce14dcfdd9263662 Author: Jan Kratochvil Date: Fri Aug 21 21:40:54 2015 +0200 solib_bfd_open: Optimize opening twice Hi, this is one of the optimizations allowed by file_location that prevents opening file twice when target build-id is known and it needs to be verified. Jan gdb/ChangeLog 2015-08-20 Jan Kratochvil * solib.c (solib_bfd_fopen): Replace solib_find and solib_bfd_fopen by solib_find_file. commit fe533db9feb1245389a609bf0d608b598864b97e Author: Jan Kratochvil Date: Fri Aug 21 21:40:54 2015 +0200 Verify the build-id Hi, now it is possible to filter-out from openp() search files with non-matching build-id. Jan gdb/ChangeLog 2015-08-20 Jan Kratochvil * source.c: Include build-id.h. (file_location_from_filename): Call build_id_verify for the build-id parameters. commit e150dd333417704e098e49e956aa7bad62f90bc5 Author: Jan Kratochvil Date: Fri Aug 21 21:40:54 2015 +0200 solib_find: Search also by build-id Hi, solib_find() can now try to search also by build-id. Jan gdb/ChangeLog 2015-08-20 Jan Kratochvil * solib.c: Include build-id.h. (solib_find_3): Call build_id_to_file. commit 147927668e1af6fe08cd7fd66c1b7067f1127896 Author: Jan Kratochvil Date: Fri Aug 21 21:40:54 2015 +0200 build_id_to_bfd: Make it return file_location Hi, refactor build_id_to_bfd so that it returns file_location. Jan gdb/ChangeLog 2015-08-20 Jan Kratochvil * build-id.c: Include source.h. (build_id_to_bfd): Rename to ... (build_id_to_file): ... here, return file_location, add parameter opts, make it public. (build_id_to_debug_bfd): Use build_id_to_file. * build-id.h (build_id_to_file): New prototype. commit ef8f40015e7ba2b0121bdf5fb7df22c477878bc2 Author: Jan Kratochvil Date: Fri Aug 21 21:40:54 2015 +0200 Add dummy build-id params to prototypes Hi, it is a lot of text with no functionality. Add build-id parameters where needed, pass them where they are already available, otherwise pass 0 in the top callers. Jan gdb/ChangeLog 2015-08-20 Jan Kratochvil * cli/cli-cmds.c (find_and_open_script): Pass zero build-id. * defs.h (openp, openp_file, source_full_path_of): Add build-id parameters. * dwarf2read.c (try_open_dwop_file): Pass zero build-id. * exec.c (exec_file_locate_attach): Likewise. * infrun.c (follow_exec): Likewise. * nto-tdep.c (nto_find_and_open_solib): Add build-id parameters, pass them. * nto-tdep.h (nto_find_and_open_solib): Add build-id parameters. * solib-aix.c (solib_aix_bfd_open): Add build-id parameters, pass them. * solib-darwin.c (darwin_bfd_open): Likewise. * solib-dsbt.c (enable_break): Pass zero build-id. * solib-frv.c (enable_break2): Likewise. * solib-spu.c (spu_bfd_open): Add build-id parameters, pass them. * solib-svr4.c (enable_break): Pass zero build-id. * solib.c (solib_find_3, solib_find_2, solib_find_1, exec_file_find) (solib_find_file, solib_find, solib_bfd_open): Add build-id parameters, pass them. (solib_map_sections): Pass so->build-id* to bfd_open. (reload_shared_libraries_1): Pass so->build-id* to solib_bfd_open. * solist.h (struct target_so_ops): Add build-id parameters to bfd_open and find_and_open_solib. (exec_file_find, solib_find, solib_bfd_open): Add build-id parameters. * source.c (file_location_from_filename): Add build-id parameters. (filename_to_bfd): Pass zero build-id. (openp): Add build-id parameters, pass them. (openp_bfd): Pass zero build-id. (openp_file, source_full_path_of): Add build-id parameters, pass them. (find_and_open_source): Pass zero build-id. * source.h (file_location_from_filename): Add build-id parameters. commit f9b4ab1e97117468ef757d9c2172bf67f6861b4f Author: Jan Kratochvil Date: Fri Aug 21 21:40:53 2015 +0200 build_id_to_debug_bfd: Make it also non-.debug capable Hi, generalize the function by adding 'suffix' parameter. To be reused later. Jan gdb/ChangeLog 2015-08-20 Jan Kratochvil * build-id.c (build_id_to_debug_bfd): Rename to ... (build_id_to_bfd): ... here, add parameter suffix. (build_id_to_debug_bfd): New function. commit deb941292b4704a55b5716b25db5eb37fdc9decd Author: Jan Kratochvil Date: Fri Aug 21 21:40:53 2015 +0200 symfile_bfd_open: Make it use openp_bfd() Hi, another function gets converted to the new API. Jan gdb/ChangeLog 2015-08-20 Jan Kratochvil * symfile.c (symfile_bfd_open): Use openp_bfd instead of openp and gdb_bfd_open. commit 78196e2d0b860fa2fa5e3e12a26966d0d86746e3 Author: Jan Kratochvil Date: Fri Aug 21 21:40:53 2015 +0200 solib_find: Make it use file_location Hi, refactor the solib*() code to use file_location functions. Jan gdb/ChangeLog 2015-08-20 Jan Kratochvil * nto-tdep.c: Include source.h. (nto_find_and_open_solib): Return file_location, remove parameter temp_pathname. Change openp to openp_file. * nto-tdep.h (nto_find_and_open_solib): Update prototype. * solib.c (solib_find_2): Rename to ... (solib_find_3): ... here, return file_location, change parameter fd to opts. Change gdb_open_cloexec to file_location_from_filename and openp to openp_file calls. (solib_find_1): Rename to ... (solib_find_2): ... here, return file_location, change parameter fd to opts. (solib_find_1): New function. (solib_find): Rename to ... (solib_find_file) ... here, return file_location, change parameter fd to opts. (solib_find): New function. * solist.h (find_and_open_solib): Return file_location, remove parameter temp_pathname. commit ee826afa4082d831819e959c78f70f87fbb3887c Author: Jan Kratochvil Date: Fri Aug 21 21:40:53 2015 +0200 Refactor openp() to return file_location Hi, openp() remains as a backward compatibility wrapper around renamed openp->openp_file(). Jan gdb/ChangeLog 2015-08-19 Jan Kratochvil * defs.h (enum openp_flags): Remove OPF_OPEN_RW_TMP, add OPF_BFD_CANONICAL. (openp_bfd, openp_file): Add prototypes. * exec.c (exec_file_attach): Replace openp by openp_bfd calls. * source.c (file_location_from_filename): Support OPF_BFD_CANONICAL. (openp, openp_bfd): New functions. (openp): Rename to ... (openp_file): ... here, return file_location, remove filename_opened parameter. commit 41744ddd2eb4c1c3d739b4ae072ec7555d627b0e Author: Jan Kratochvil Date: Fri Aug 21 21:40:53 2015 +0200 Add file_location utility functions Hi, build id verification faces a problem current codebase calls openp() and similar functions which search many directories and after they find the file they return its filename. Caller then typically opens that file as BFD. But to search the directories openp() needs to open each file it iterates to verify their build-id. Then it would close the file and caller would reopen it again. This is inefficient (+racy), so a new intermediate representation of the found files is created (file_location). Another possibility would be to depends on bfd cache as being done in exec_file_attach. But then a similar problem is needed for callers which want only fd (and not bfd). Besides that I find depending on pending make_cleanup_bfd_unref() from openp() calls would be tricky. Jan gdb/ChangeLog 2015-08-18 Jan Kratochvil * defs.h (enum openp_flags): Add OPF_IS_BFD. * gdb_bfd.c (fileio_errno_to_host): Make it public. * gdb_bfd.h (fileio_errno_to_host): Add prototype. * source.c: Include inferior.h and gdb/fileio.h. (file_location_enoent, file_location_free, file_location_cleanup) (file_location_is_valid, file_location_from_filename) (file_location_to_bfd, filename_to_bfd): New functions. * source.h (struct file_location): New definition. (file_location_enoent, file_location_free, file_location_is_valid) (file_location file_location_from_filename, file_location_to_bfd) (filename_to_bfd): New prototypes. commit 43ed69c3939b6ddf70f8adeee9b12e7ea7f0bcd4 Author: Jan Kratochvil Date: Fri Aug 21 21:40:52 2015 +0200 gdb_bfd_open_from_target: Optionally do not close fd Hi, gdb_bfd_open_from_target currently always embedded passed fd into returned BFD and closed that fd after closing that BFD. As one cannot do dup() for target fileio FDs one could not use FD after BFD using it has been closed. Jan gdb/ChangeLog 2015-08-18 Jan Kratochvil * gdb_bfd.c (gdb_bfd_iovec_fileio_close_nop): New function. (gdb_bfd_open_from_target): Add parameter do_close. Optionally pass gdb_bfd_iovec_fileio_close_nop. (gdb_bfd_open): Update caller. * gdb_bfd.h (gdb_bfd_open_from_target): Update prototype. commit b0ff8fd19664b4accddde8b198ebdf7d4db9479c Author: Jan Kratochvil Date: Fri Aug 21 21:40:52 2015 +0200 gdb_bfd_open_from_target: Support real fd Hi, gdb_bfd_open_from_target is extended so that it can be now passed also some non-(-1) fd. non-(-1) fd was not supported for remote files in mainline. Jan gdb/ChangeLog 2015-08-18 Jan Kratochvil * gdb_bfd.c (gdb_bfd_iovec_fileio_open_fd): New function. (gdb_bfd_open_from_target): Conditionally use it. commit 08e8ab00fb10cf2ace96879af72bb505b09abb4e Author: Jan Kratochvil Date: Fri Aug 21 21:40:52 2015 +0200 Provide new gdb_bfd_open_from_target Hi, later code needs to call the gdb_bfd_openr_iovec part of gdb_bfd_open with more special parameters. So it is refactored out first (and extended later in the next patches). Jan gdb/ChangeLog 2015-08-18 Jan Kratochvil * gdb_bfd.c (gdb_bfd_open_from_target): New function from ... (gdb_bfd_open): ... here. Call it. * gdb_bfd.h (gdb_bfd_open_from_target): New prototype. commit ad21a771aef7bc9d3f8384a6535a696a264d3b67 Author: Jan Kratochvil Date: Fri Aug 21 21:40:52 2015 +0200 Code cleanup: openp parameter filename_opened is never NULL Hi, this parameter is never passed as NULL in the codebase so the check can be removed. Jan gdb/ChangeLog 2015-08-18 Jan Kratochvil * source.c (openp): Update function comment for filename_opened. Remove NULL check for filename_opened. commit e8bc24fccbbecf1de9137d6c3ed09893e67f963c Author: Jan Kratochvil Date: Fri Aug 21 21:40:51 2015 +0200 Code cleanup: Remove openp parameter mode Hi, simplify the code, make it also suitable for more code refactorings. The new flag OPF_OPEN_RW_TMP is removed later in this patch series. Jan gdb/ChangeLog 2015-08-18 Jan Kratochvil * cli/cli-cmds.c (find_and_open_script): Update openp caller. * defs.h (enum openp_flags): Add OPF_OPEN_RW_TMP. (openp): Remove parameter mode. * dwarf2read.c (try_open_dwop_file): Update openp caller. * exec.c (exec_file_attach): Likewise. * nto-tdep.c (nto_find_and_open_solib): Remove parameter o_flags, update openp caller. * nto-tdep.h (nto_find_and_open_solib): Remove parameter o_flags. * solib.c (solib_find_2): Update openp and find_and_open_solib caller. * solist.h (struct target_so_ops): Remove parameter o_flags from find_and_open_solib method. * source.c (openp): Change parameter mode to a new variable. (source_full_path_of, find_and_open_source): Update openp caller. * symfile.c (symfile_bfd_open): Likewise. commit 184eca8d09fadf7a7f9200a12401346b4cabe313 Author: Jan Kratochvil Date: Fri Aug 21 21:40:51 2015 +0200 Code cleanup: Remove OPF_RETURN_REALPATH Hi, OPF_RETURN_REALPATH is used only at the end of openp() to convert the returned values. That is not useful, code can be simplified if callers that passed OPF_RETURN_REALPATH adjust the returned values on their own. Or at least it helps further refactorizations. Jan gdb/ChangeLog 2015-08-18 Jan Kratochvil * cli/cli-cmds.c (find_and_open_script): Remove OPF_RETURN_REALPATH. Call gdb_realpath_and_xfree. * defs.h (enum openp_flags): Add OPF_NONE, remove OPF_RETURN_REALPATH. * dwarf2read.c (try_open_dwop_file): Remove OPF_RETURN_REALPATH. Call gdb_realpath_and_xfree. * nto-tdep.c (nto_find_and_open_solib): Remove OPF_RETURN_REALPATH. Call gdb_realpath_and_xfree and xstrdup. * solib.c (solib_find_2): New variable temp_pathname_is_realpath. Remove OPF_RETURN_REALPATH. Conditionally call gdb_realpath_and_xfree. * source.c (openp): Remove OPF_RETURN_REALPATH processing. (source_full_path_of, find_and_open_source): Remove OPF_RETURN_REALPATH. Call gdb_realpath_and_xfree. * symfile.c (symfile_bfd_open): Likewise. * utils.c (gdb_realpath_and_xfree): New function. * utils.h (gdb_realpath_and_xfree): New prototype. commit f86c25c91946c70e5ace8256a2ea901c5c292569 Author: Jan Kratochvil Date: Fri Aug 21 21:40:51 2015 +0200 Code cleanup: Add enum for openp_flags Hi, it is for many reasons better, in C++ it could be even type safe. Jan gdb/ChangeLog 2015-08-18 Jan Kratochvil * cli/cli-cmds.c (find_and_open_script): Use enum openp_flags for search_flags. * defs.h (OPF_TRY_CWD_FIRST, OPF_SEARCH_IN_PATH, OPF_RETURN_REALPATH): Wrap them to a new ... (enum openp_flags): ... enum. (openp): Update prototype. * dwarf2read.c (try_open_dwop_file): Use enum openp_flags for flags. * source.c (openp): Update opts parameter type. Move out OPF_* comments. commit 44c01eb2a9984e94bc25483829e473e37206ada1 Author: Jan Kratochvil Date: Fri Aug 21 21:40:51 2015 +0200 Change sysroot to ":target:" Hi, that is try "" first and "target:" second. Various performance problems should be fixed by trying to look up the remote file first on local filesystem. Thanks to build-ids it is quick and safe to verify both files are the same build. Jan gdb/ChangeLog 2015-08-18 Jan Kratochvil * NEWS (Changes since GDB 7.10): Mention sysroot. * main.c (captured_main): Initialize new gdb_sysroot. gdb/testsuite/ChangeLog * gdb.base/attach.exp (do_attach_tests): Update sysroot parsing. * gdb.base/break-probes.exp: Likewise. commit 0ebe17076406a85a35eb0c4f362850ed9efb843e Author: Jan Kratochvil Date: Fri Aug 21 21:40:51 2015 +0200 Permit multiple sysroot directories Hi, the goal is to have both "" and "target:" as the default gdb_sysroot, in this order. Therefore permit multiple directory components of gdb_sysroot. Jan gdb/ChangeLog 2015-08-18 Jan Kratochvil * NEWS (Changes since GDB 7.10): Mention set sysroot and show sysroot. * solib.c: Include source.h. (solib_find_1): Rename to ... (solib_find_2): ... here and change the sysroot variable to parameter. (solib_find_1): Call it using dirnames_to_char_ptr_vec_target_exc. * source.c (dirnames_to_char_ptr_vec_target_exc): New function. * source.h (dirnames_to_char_ptr_vec_target_exc): New declaration. gdb/doc/ChangeLog 2015-08-18 Jan Kratochvil * gdb.texinfo (Files): Permit set sysroot and show sysroot to have multiple components. commit 7b4dd1456b3c285b1e65dcae65c0ab6c53896991 Author: Jan Kratochvil Date: Fri Aug 21 21:40:50 2015 +0200 Code cleanup: Make solib_find_1 variable const Hi, it gets used in the next patch. Jan 2015-08-18 Jan Kratochvil * solib.c (solib_find_1): Make sysroot variable const. commit 03d470b67389d35a14a122d2c74c982487779d7a Author: Jan Kratochvil Date: Fri Aug 21 21:40:50 2015 +0200 Validate symbol file using build-id Consumer part of the "build-id" attribute. gdb/ChangeLog 2015-07-15 Aleksandar Ristovski Validate symbol file using build-id. * NEWS (Changes since GDB 7.10): Add 'set validate-build-id' and 'show validate-build-id'. Add build-id attribute. * build-id.c: Include gdbcmd.h. (validate_build_id, show_validate_build_id, _initialize_build_id): New. * build-id.h (validate_build_id): New declaration. * solib-svr4.c: Include rsp-low.h. (svr4_copy_library_list): Duplicate field build_id. (library_list_start_library): Parse 'build-id' attribute. (svr4_library_attributes): Add 'build-id' attribute. * solib.c (free_so): Free build_id. * solist.h (struct so_list): New fields 'build_idsz' and 'build_id'. commit 7b852ff6e5f327a01e6d2ef9f8c3d840f1874373 Author: Jan Kratochvil Date: Fri Aug 21 21:40:50 2015 +0200 gdbserver build-id attribute generator Producer part of the new "build-id" XML attribute. gdb/ChangeLog 2015-07-15 Aleksandar Ristovski gdbserver build-id attribute generator. * features/library-list-svr4.dtd (library-list-svr4): New 'build-id' attribute. gdb/doc/ChangeLog 2015-07-15 Aleksandar Ristovski gdbserver build-id attribute generator. * gdb.texinfo (Library List Format for SVR4 Targets): Add 'build-id' in description, example, new attribute in dtd. gdb/gdbserver/ChangeLog 2015-07-15 Aleksandar Ristovski gdbserver build-id attribute generator. * linux-low.c (linux-maps.h, search.h, rsp-low.h): Include. (ElfXX_Ehdr, ElfXX_Phdr, ElfXX_Nhdr): New. (ELFXX_FLD, ELFXX_SIZEOF, ELFXX_ROUNDUP, BUILD_ID_INVALID): New. (find_phdr): New. (get_dynamic): Use find_pdhr to traverse program headers. (struct mapping_entry, mapping_entry_s, free_mapping_entry_vec) (compare_mapping_entry_range, struct find_memory_region_callback_data) (read_build_id, find_memory_region_callback, lrfind_mapping_entry) (get_hex_build_id): New. (linux_qxfer_libraries_svr4): Add optional build-id attribute to reply XML document. commit 769819ca7bc9c987e4d3ac4c2da81ec5412d6e58 Author: Jan Kratochvil Date: Fri Aug 21 21:40:50 2015 +0200 Move linux_find_memory_regions_full & co. This should be just a move with no changes. gdb/ChangeLog 2015-07-15 Aleksandar Ristovski Move linux_find_memory_regions_full & co. * linux-tdep.c (linux-maps.h): Include. (gdb_regex.h): Remove the include. (enum filterflags, struct smaps_vmflags, read_mapping, decode_vmflags) (mapping_is_anonymous_p, dump_mapping_p): Moved to common/linux-maps.c. (linux_find_memory_region_ftype): Moved typedef to common/linux-maps.h. (linux_find_memory_regions_full): Moved definition to common/linux-maps.c. * common/linux-maps.c: Include ctype.h, target/target-utils.h, gdb_regex.h and target/target.h. (struct smaps_vmflags, read_mapping, decode_vmflags) (mapping_is_anonymous_p, dump_mapping_p): Move from linux-tdep.c. (linux_find_memory_regions_full): Move from linux-tdep.c. * common/linux-maps.h (read_mapping): New declaration. (linux_find_memory_region_ftype, enum filterflags): Moved from linux-tdep.c. (linux_find_memory_regions_full): New declaration. * target.c (target/target-utils.h): Include. (read_alloc_pread_ftype): Moved typedef to target/target-utils.h. (read_alloc, read_stralloc_func_ftype, read_stralloc): Moved definitions to target/target-utils.c. * target.h (target_fileio_read_stralloc): Move it to target/target.h. * target/target-utils.c (read_alloc, read_stralloc): Move definitions from target.c. * target/target-utils.h (read_alloc_pread_ftype): New typedef. (read_alloc): New declaration. (read_stralloc_func_ftype): New typedef. (read_stralloc): New declaration. * target/target.h (target_fileio_read_stralloc): Move it from target.h. gdb/gdbserver/ChangeLog 2015-07-15 Aleksandar Ristovski * target.c: Include target/target-utils.h and fcntl.h. (target_fileio_read_stralloc_1_pread, target_fileio_read_stralloc_1) (target_fileio_read_stralloc): New functions. commit 585aca87aa8a2f7a30840ad1bc3fce08a877371e Author: Jan Kratochvil Date: Fri Aug 21 21:40:49 2015 +0200 Prepare linux_find_memory_regions_full & co. for move Prepare code for move into gdb/common/. gdb/ChangeLog 2015-07-15 Aleksandar Ristovski Prepare linux_find_memory_regions_full & co. for move. * linux-tdep.c (linux_find_memory_region_ftype): Comment. (linux_find_memory_regions_full): Change signature and prepare for moving to linux-maps. (linux_find_memory_regions_data): Rename field 'obfd' to 'data'. (linux_find_memory_regions_thunk): New. (linux_find_memory_regions_thunk): Use 'data' field instead of 'obfd'. (linux_find_memory_regions_gdb): New. (linux_find_memory_regions): Rename argument 'obfd' to 'func_data'. (linux_make_mappings_corefile_notes): Use linux_find_memory_regions_gdb. * target.c (read_alloc_pread_ftype): New typedef. (target_fileio_read_alloc_1_pread): New function. (read_alloc): Refactor from target_fileio_read_alloc_1. (read_stralloc_func_ftype): New typedef. (target_fileio_read_alloc_1): New implementation. Use read_alloc. (read_stralloc): Refactored from target_fileio_read_stralloc. (target_fileio_read_stralloc): New implementation, use read_stralloc. commit 47c5d88029a42bd629e933da0a61e7bf8e9ccbbe Author: Jan Kratochvil Date: Fri Aug 21 21:40:49 2015 +0200 Move gdb_regex* to common/ Later patches need regex support also in gdbserver. gdb/ChangeLog 2015-07-15 Jan Kratochvil * Makefile.in (HFILES_NO_SRCDIR): Change gdb_regex.h to common/gdb_regex.h. (COMMON_OBS): Add gdb_regex.o. (gdb_regex.o): New. * common/common.m4 (GDB_AC_COMMON): Add gdb_use_included_regex, --without-included-regex and USE_INCLUDED_REGEX. * common/gdb_regex.c: New file from utils.c functions. * common/gdb_regex.h: Move it here from gdb_regex.h, update include file wrapping define name. * configure: Rebuilt. * configure.ac (gdb_use_included_regex, --without-included-regex) (USE_INCLUDED_REGEX): Move them to common/common.m4. * gdb_regex.h: Move it to common/gdb_regex.h. * utils.c: Remove include gdb_regex.h. (do_regfree_cleanup, make_regfree_cleanup, get_regcomp_error) (compile_rx_or_error): Move them to common/gdb_regex.c. gdb/gdbserver/ChangeLog 2015-07-15 Jan Kratochvil * Makefile.in (OBS): Add gdb_regex.o. (gdb_regex.o): New. * config.in: Rebuilt. * configure: Rebuilt. commit fe4882f5dd484d3bb8d9a53d5977ee318ecc1848 Author: Jan Kratochvil Date: Tue Aug 25 21:02:58 2015 +0200 Create empty common/linux-maps.[ch] and common/target-utils.[ch] Prepare new files for later move. gdb/ChangeLog 2015-07-15 Aleksandar Ristovski Create empty common/linux-maps.[ch] and common/target-utils.[ch]. * Makefile.in (ALL_TARGET_OBS): Add linux-maps.o. (HFILES_NO_SRCDIR); Add common/linux-maps.h, common/target-utils.h. (COMMON_OBS): Add target-utils.o. (linux-maps.o, target-utils.o): New. * target/target-utils.c: New file. * target/target-utils.h: New file. * common/linux-maps.c: New file. * common/linux-maps.h: New file. * configure.tgt (aarch64*-*-linux*, alpha*-*-linux*) (am33_2.0*-*-linux*, arm*-*-linux*, bfin-*-*linux*, cris*, frv-*-*) (hppa*-*-linux*, i[34567]86-*-linux*, ia64-*-linux*, m32r*-*-linux*) (m68*-*-linux*, microblaze*-linux-*, microblaze*-*-linux*) (mips*-*-linux*, nios2*-*-linux*, powerpc*-*-linux*, s390*-*-linux*) (sh*-*-linux*, sparc-*-linux*, sparc64-*-linux*, tic6x-*-*linux) (tilegx-*-linux*, x86_64-*-linux*, xtensa*-*-linux*): Add linux-maps.o to gdb_target_obs. gdb/gdbserver/ChangeLog 2015-07-15 Aleksandar Ristovski Create empty common/linux-maps.[ch] and common/target-utils.[ch]. * Makefile.in (OBS): Add target-utils.o. (linux-maps.o, target-utils.o): New. * configure.srv (srv_linux_obj): Add linux-maps.o. commit 16ad13eca4a18139cd1dec214ec83fdc7c47ffda Author: Nick Clifton Date: Tue Aug 25 17:48:20 2015 +0100 Replace assertions with warning messages about ELF binaries containing multiple symbol tables. PR binutils/18854 * elf.c (bfd_section_from_shdr): Replace assertions with warnings about multiple symbol tables. commit cdbfb8861732b496b9ee35b130af75b245e2bc02 Author: Simon Dardis Date: Tue Aug 25 17:04:51 2015 +0100 Update MIPS tests for test failures on some configurations. * gas/mips/micromips32-move.d: Update expected disassembly. * gas/mips/move.d: Likewise. * gas/mips/move.s: Fix for some MIPS configurations. commit abc56d60aacccb64e146eb7a245b3ca2cea52dd9 Author: Pedro Alves Date: Tue Aug 25 16:12:11 2015 +0100 remote: allow aborting long operations (e.g., file transfers) Currently, when remote debugging, if you type Ctrl-C just while the target stopped for an internal event, and GDB is busy doing something that takes a while (e.g., fetching chunks of a shared library off of the target, with vFile, to process ELF headers and debug info), the Ctrl-C is lost. The patch hooks up the QUIT macro to a new target method that lets the target react to the double-Ctrl-C before the event loop is reached, which allows reacting to a double-Ctrl-C even when GDB is busy doing some long operation and not waiting for a stop reply. That end result is: (gdb) c Continuing. ^C ^C Interrupted while waiting for the program. Give up waiting? (y or n) y Quit (gdb) info threads Id Target Id Frame * 1 Thread 11673 0x00007ffff7deb240 in _dl_debug_state () from target:/lib64/ld-linux-x86-64.so.2 (gdb) If, however, GDB is waiting for a stop reply (because the target has been resumed, with e.g., vCont;c), but the target isn't responding, we now get: (gdb) c Continuing. ^C ^C The target is not responding to interrupt requests. Stop debugging it? (y or n) y Disconnected from target. (gdb) info threads No threads. This offers to disconnect, because when we're waiting for a stop reply, there's nothing else we can send the target other than an interrupt request. And if that doesn't work, there's nothing else we can do. The Ctrl-C is presently lost because until we get to a user-visible stop, the SIGINT handler that is installed is the one that forwards the interrupt to the remote side, with the \003 "packet" [1]. But, gdbserver ignores an interrupt request if the program is stopped. Still, even if it didn't, the server can only report back a stop-because-of-SIGINT when the program is next resumed. And it may take a while to actually re-resume the target. [1] - In the old sync days, the remote target would react to a double-Ctrl-C by asking users whether they wanted to give up waiting and disconnect. The code is still there, but it it isn't reacheable on most hosts, which support serial connections in async mode (probably only DJGPP doesn't). Even then, in sync mode, remote.c's SIGINT handler is only installed while the target is resumed, and is removed as soon as the target sends back a stop reply. That means that a Ctrl-C just while GDB is processing an internal event can end up with an odd "Quit" at the prompt instead of "Program stopped by SIGINT". In contrast, in async mode, remote.c's SIGINT handler is set up as long as target_terminal_inferior or target_terminal_ours_for_output are in effect (IOW, until we get a user-visible stop and call target_terminal_ours), so the user shouldn't get back a spurious Quit. However, it's still desirable to be able to interrupt a long-running GDB operation, if GDB takes a while to re-resume the target or get back to the event loop. Tested on x86_64 Fedora 20. gdb/ChangeLog: 2015-08-24 Pedro Alves * defs.h (maybe_quit): Declare. (QUIT): Now calls maybe_quit. * event-loop.c (clear_async_signal_handler) (async_signal_handler_is_marked): New functions. * event-loop.h (async_signal_handler_is_marked) (clear_async_signal_handler): New declarations. * remote.c (remote_check_pending_interrupt): New function. (interrupt_query): Use make_cleanup_restore_target_terminal. No longer check whether the target is async. If waiting for a stop reply, and a Ctrl-C as been sent to the target, offer to disconnect, and throw TARGET_CLOSE_ERROR instead of a quit. Otherwise do not disconnect and throw a quit. (_initialize_remote): Install remote_check_pending_interrupt as to_check_pending_interrupt. * target.c (target_check_pending_interrupt): New function. * target.h (struct target_ops) : New field. (target_check_pending_interrupt): New declaration. * utils.c (maybe_quit): New function. * target-delegates.c: Regenerate. commit 38074311927d012e4cbd28d825878974c9209f77 Author: Jose E. Marchesi Date: Tue Aug 25 17:16:34 2015 +0200 Support for the sparc %pmcdper privileged register. opcodes/ChangeLog: 2015-08-25 Jose E. Marchesi * sparc-dis.c (print_insn_sparc): Handle the privileged register %pmcdper. gas/ChangeLog: 2015-08-25 Jose E. Marchesi * config/tc-sparc.c (priv_reg_table): New privileged register %pmcdper. gas/testsuite/ChangeLog: 2015-08-25 Jose E. Marchesi * gas/sparc/wrpr.s: Test writing to the privileged %pmcdper register. * gas/sparc/wrpr.d: ...and the expected result. * gas/sparc/rdpr.s: Test reading from the privileged %pmcdper register. * gas/sparc/rdpr.d: ...and the expected result. commit dfe7f77c4aae3376c175d8af4d477124c8817427 Author: Yao Qi Date: Tue Aug 25 14:08:45 2015 +0100 Print tid in debug output of debug_reg_change_callback In debug_reg_change_callback, we change debug registers of each LWP. It makes more sense to print LWP's pid rather than group leader's pid. gdb: 2015-08-25 Yao Qi * nat/aarch64-linux-hw-point.c (debug_reg_change_callback): Rename local variable pid to tid, and get lwpid of lwp. Update debug output. commit 63e43d3aedb8b1112899c2d0ad74cbbee687e5d6 Author: Pierre-Marie de Rodat Date: Thu Feb 5 17:00:06 2015 +0100 DWARF: handle non-local references in nested functions GDB's current behavior when dealing with non-local references in the context of nested fuctions is approximative: - code using valops.c:value_of_variable read the first available stack frame that holds the corresponding variable (whereas there can be multiple candidates for this); - code directly relying on read_var_value will instead read non-local variables in frames where they are not even defined. This change adds the necessary context to symbol reads (to get the block they belong to) and to blocks (the static link property, if any) so that GDB can make the proper decisions when dealing with non-local varibale references. gdb/ChangeLog: * ada-lang.c (ada_read_var_value): Add a var_block argument and pass it to default_read_var_value. * block.c (block_static_link): New accessor. * block.h (block_static_link): Declare it. * buildsym.c (finish_block_internal): Add a static_link argument. If there is a static link, associate it to the new block. (finish_block): Add a static link argument and pass it to finish_block_internal. (end_symtab_get_static_block): Update calls to finish_block and to finish_block_internal. (end_symtab_with_blockvector): Update call to finish_block_internal. * buildsym.h: Forward-declare struct dynamic_prop. (struct context_stack): Add a static_link field. (finish_block): Add a static link argument. * c-exp.y: Remove an obsolete comment (evaluation of variables already start from the selected frame, and now they climb *up* the call stack) and propagate the block information to the produced expression. * d-exp.y: Likewise. * f-exp.y: Likewise. * go-exp.y: Likewise. * jv-exp.y: Likewise. * m2-exp.y: Likewise. * p-exp.y: Likewise. * coffread.c (coff_symtab_read): Update calls to finish_block. * dbxread.c (process_one_symbol): Likewise. * xcoffread.c (read_xcoff_symtab): Likewise. * compile/compile-c-symbols.c (convert_one_symbol): Promote the "sym" parameter to struct block_symbol, update its uses and pass its block to calls to read_var_value. (convert_symbol_sym): Update the calls to convert_one_symbol. * compile/compile-loc2c.c (do_compile_dwarf_expr_to_c): Update call to read_var_value. * dwarf2loc.c (block_op_get_frame_base): New. (dwarf2_block_frame_base_locexpr_funcs): Implement the get_frame_base method. (dwarf2_block_frame_base_loclist_funcs): Likewise. (dwarf2locexpr_baton_eval): Add a frame argument and use it instead of the selected frame in order to evaluate the expression. (dwarf2_evaluate_property): Add a frame argument. Update call to dwarf2_locexpr_baton_eval to provide a frame in available and to handle the absence of address stack. * dwarf2loc.h (dwarf2_evaluate_property): Add a frame argument. * dwarf2read.c (attr_to_dynamic_prop): Add a forward declaration. (read_func_scope): Record any available static link description. Update call to finish_block. (read_lexical_block_scope): Update call to finish_block. * findvar.c (follow_static_link): New. (get_hosting_frame): New. (default_read_var_value): Add a var_block argument. Use get_hosting_frame to handle non-local references. (read_var_value): Add a var_block argument and pass it to the LA_READ_VAR_VALUE method. * gdbtypes.c (resolve_dynamic_range): Update calls to dwarf2_evaluate_property. (resolve_dynamic_type_internal): Likewise. * guile/scm-frame.c (gdbscm_frame_read_var): Update call to read_var_value, passing it the block coming from symbol lookup. * guile/scm-symbol.c (gdbscm_symbol_value): Update call to read_var_value (TODO). * infcmd.c (finish_command_continuation): Update call to read_var_value, passing it the block coming from symbol lookup. * infrun.c (insert_exception_resume_breakpoint): Likewise. * language.h (struct language_defn): Add a var_block argument to the LA_READ_VAR_VALUE method. * objfiles.c (struct static_link_htab_entry): New. (static_link_htab_entry_hash): New. (static_link_htab_entry_eq): New. (objfile_register_static_link): New. (objfile_lookup_static_link): New. (free_objfile): Free the STATIC_LINKS hashed map if needed. * objfiles.h: Include hashtab.h. (struct objfile): Add a static_links field. (objfile_register_static_link): New. (objfile_lookup_static_link): New. * printcmd.c (print_variable_and_value): Update call to read_var_value. * python/py-finishbreakpoint.c (bpfinishpy_init): Likewise. * python/py-frame.c (frapy_read_var): Update call to read_var_value, passing it the block coming from symbol lookup. * python/py-framefilter.c (extract_sym): Add a sym_block parameter and set the pointed value to NULL (TODO). (enumerate_args): Update call to extract_sym. (enumerate_locals): Update calls to extract_sym and to read_var_value. * python/py-symbol.c (sympy_value): Update call to read_var_value (TODO). * stack.c (read_frame_local): Update call to read_var_value. (read_frame_arg): Likewise. (return_command): Likewise. * symtab.h (struct symbol_block_ops): Add a get_frame_base method. (struct symbol): Add a block field. (SYMBOL_BLOCK): New accessor. * valops.c (value_of_variable): Remove frame/block handling and pass the block argument to read_var_value, which does this job now. (value_struct_elt_for_reference): Update calls to read_var_value. (value_of_this): Pass the block found to read_var_value. * value.h (read_var_value): Add a var_block argument. (default_read_var_value): Likewise. gdb/testsuite/ChangeLog: * gdb.base/nested-subp1.exp: New file. * gdb.base/nested-subp1.c: New file. * gdb.base/nested-subp2.exp: New file. * gdb.base/nested-subp2.c: New file. * gdb.base/nested-subp3.exp: New file. * gdb.base/nested-subp3.c: New file. commit 7c2bea1ad1c779b893eb9cad4c92732583ae0eb5 Author: Renlin Li Date: Tue Aug 25 12:37:21 2015 +0100 [AArch64] Fix a typo in the comment for BFD_RELOC_AARCH64_LD64_GOT_LO12_NC 2015-08-25 Renlin Li bfd/ * reloc.c (BFD_RELOC_AARCH64_LD64_GOTOFF_LO15): Use LP64 instead of ILP64. * bfd-in2.h: Regenerate. commit ed8b7b421c98533b9b08995edd7363328b55921e Author: Yao Qi Date: Tue Aug 25 11:38:29 2015 +0100 Move aarch64_linux_new_thread to nat/aarch64-linux.c This patch moves aarch64_linux_new_thread in GDB and GDBserver to nat/aarch64-linux.c. gdb: 2015-08-25 Yao Qi * aarch64-linux-nat.c (aarch64_linux_new_thread): Move it to ... * nat/aarch64-linux.c (aarch64_linux_new_thread): ... here. * nat/aarch64-linux.h (aarch64_linux_new_thread): Declare. gdb/gdbserver: 2015-08-25 Yao Qi * linux-aarch64-low.c (aarch64_linux_new_thread): Remove. commit db3cb7cb3e51e5eb834412adbf90e81bb76846c6 Author: Yao Qi Date: Tue Aug 25 11:38:29 2015 +0100 Move aarch64_linux_prepare_to_resume to nat/aarch64-linux.c gdb: 2015-08-25 Yao Qi * Makefile.in (aarch64-liunx.o): New rule. (HFILES_NO_SRCDIR): Add aarch64-linux.h. * config/aarch64/linux.mh (NAT_FILE): Add aarch64-linux.o. * aarch64-linux-nat.c: Include nat/aarch64-linux.h. * aarch64-linux-nat.c (aarch64_get_debug_reg_state): Make it extern. (aarch64_linux_prepare_to_resume): Move it nat/aarch64-linux.c. * nat/aarch64-linux-hw-point.h (aarch64_debug_reg_state): Declare * nat/aarch64-linux.c: New file. * nat/aarch64-linux.h: New file. gdb/gdbserver: 2015-08-25 Yao Qi * Makefile.in (aarch64-linux.o): New rule. * configure.srv (aarch64*-*-linux*): Append aarch64-linux.o to srv_tgtobj. * linux-aarch64-low.c: Include nat/aarch64-linux.h. (aarch64_init_debug_reg_state): Make it extern. (aarch64_linux_prepare_to_resume): Remove. commit f6011a1c84b1bd616617bfde84dca63f250c950d Author: Yao Qi Date: Tue Aug 25 11:38:29 2015 +0100 Make aarch64_linux_prepare_to_resume the same on GDB and GDBserver gdb: 2015-08-25 Yao Qi * aarch64-linux-nat.c (aarch64_linux_prepare_to_resume): Use lwp_arch_private_info and ptid_of_lwp. gdb/gdbserver: 2015-08-25 Yao Qi * linux-aarch64-low.c (aarch64_linux_prepare_to_resume): Use lwp_arch_private_info and ptid_of_lwp. commit 88e2cf7ee25c72bce35ebe59b13c9701abce9fee Author: Yao Qi Date: Tue Aug 25 11:38:29 2015 +0100 Add pid argument in aarch64_get_debug_reg_state This patch addes argument pid in aarch64_get_debug_reg_state, so that its interface is the same on both GDB and GDBserver. gdb/gdbserver: 2015-018-25 Yao Qi * linux-aarch64-low.c (aarch64_get_debug_reg_state): Add argument pid. Find proc_info by find_process_pid. All callers updated. commit 5e35436ed12617494d2a2d190e0faca5613a2e9f Author: Yao Qi Date: Tue Aug 25 11:38:29 2015 +0100 Move debug_reg_change_callback and aarch64_notify_debug_reg_change to nat/aarch64-linux-hw-point.c gdb: 2015-08-25 Yao Qi * aarch64-linux-nat.c (struct arch64_dr_update_callback_param): Move it to nat/aarch64-linux-hw-point.c. (debug_reg_change_callback): Likewise. (aarch64_notify_debug_reg_change): :Likewise. * nat/aarch64-linux-hw-point.c: Include nat/linux-nat.h. (aarch64_dr_update_callback_param): New. (debug_reg_change_callback): New function. (aarch64_notify_debug_reg_change): Likewise. * nat/aarch64-linux-hw-point.h (aarch64_notify_debug_reg_change): Remove the declaration. gdb/gdbserver: 2015-08-25 Yao Qi * linux-aarch64-low.c (struct arch64_dr_update_callback_param): Remove. (debug_reg_change_callback): Remove. (aarch64_notify_debug_reg_change): Remove. commit 75e1f0f7a0992835415e9bb924ec21a9aac6d5a1 Author: Yao Qi Date: Tue Aug 25 11:38:29 2015 +0100 Make debug_reg_change_callback the same on GDB and GDBserver This patch makes function debug_reg_change_callback in GDB and GDBserver look the same, so that the following patch can move them to nat/aarch64-linux-hw-point.c. gdb: 2015-08-25 Yao Qi * aarch64-linux-nat.c (debug_reg_change_callback): Use ptid_of_lwp to get ptid of lwp. gdb/gdbserver: 2015-08-25 Yao Qi * linux-aarch64-low.c (debug_reg_change_callback): Use ptid_of_lwp to get ptid of lwp. commit 4a8a7965f233f571b78f7992292a31c990c15a5e Author: Yao Qi Date: Tue Aug 25 11:38:29 2015 +0100 Make aarch64_notify_debug_reg_change the same on GDB and GDBserver gdb: 2015-08-25 Yao Qi * aarch64-linux-nat.c (aarch64_notify_debug_reg_change): Call current_lwp_ptid. gdb/gdbserver: 2015-08-25 Yao Qi * linux-aarch64-low.c (aarch64_notify_debug_reg_change): Call current_lwp_ptid. commit 32a271eeaf1b1be1367b6ea181a0f39a3da71d45 Author: Yao Qi Date: Tue Aug 25 11:38:29 2015 +0100 Use debug_printf in debug_reg_change_callback gdb: 2015-08-25 Yao Qi * aarch64-linux-nat.c (debug_reg_change_callback): Use debug_printf. gdb/gdbserver: 2015-08-25 Yao Qi * linux-aarch64-low.c (debug_reg_change_callback): Use debug_printf. commit 0d51c8d71c19531bf29a3ba303c040c7c772a4a1 Author: Yao Qi Date: Tue Aug 25 11:38:28 2015 +0100 Use phex debug_reg_change_callback This patch is to use phex in debug_reg_change_callback to make it identical in GDB and GDBserver. gdb/gdbserver: 2015-08-25 Yao Qi * linux-aarch64-low.c (debug_reg_change_callback): Use phex. commit 5e137137b2ff267fbf33b1e47f0413292ccb40d6 Author: Yao Qi Date: Tue Aug 25 11:38:28 2015 +0100 Get pid rather than lwpid We print PID rather than LWPID in the debug output, so we need call ptid_get_pid in debug_reg_change_callback. gdb: 2015-08-25 Yao Qi * aarch64-linux-nat.c (debug_reg_change_callback): Call ptid_get_pid rather than ptid_get_lwp. commit 31a43dd5e1cfb8bb387885b3f641d6d2c04ac5dd Author: Yao Qi Date: Tue Aug 25 11:38:28 2015 +0100 Remove some comments in debug_reg_change_callback gdb/gdbserver: 2015-08-25 Yao Qi * linux-aarch64-low.c (debug_reg_change_callback): Remove comments. commit 8ee525679d030cd2c35eaee3b8d4ac545c5dc8ee Author: Yao Qi Date: Tue Aug 25 11:38:28 2015 +0100 Re-indent the code gdb/gdbserver: 2015-08-25 Yao Qi * linux-aarch64-low.c (debug_reg_change_callback): Re-indent the code. commit ff3f0f45c5ff3505d041eba81a999b55c55f4530 Author: Yao Qi Date: Tue Aug 25 11:38:28 2015 +0100 [gdbserver] Use iterate_over_lwps in aarch64_notify_debug_reg_change This patch makes more bits on aarch64 watchpoint between GDB and GDBserver look similar. gdb/gdbserver: 2015-08-25 Yao Qi * linux-aarch64-low.c (aarch64_dr_update_callback_param) : Remove. (debug_reg_change_callback): Remove argument entry and add argument lwp. Remove local variable thread. Don't print thread id in the debugging output. Don't check whether pid of thread equals to pid. (aarch64_notify_debug_reg_change): Don't set param.pid. Call iterate_over_lwps instead find_inferior. commit 9a117542138b8fa4a6ca9c7b4cf9935d509b9809 Author: GDB Administrator Date: Tue Aug 25 00:00:08 2015 +0000 Automatic date update in version.in commit 3d40fbb53b4478d94b6fa5abad0796cec5d5db49 Author: Pedro Alves Date: Mon Aug 24 19:58:31 2015 +0100 gdbserver crashes when multiprocess extensions aren't supported Ref: https://sourceware.org/ml/gdb-patches/2015-08/msg00675.html If multiprocess extensions are off (because specific gdbserver port doesn't support them), then when gdbserver doesn't have a thread selected yet, and GDB sends Hg packet to select one, gdbserver crashes. That's because extracting the desired thread id out of the packet that GDB sent depends on the current thread to fill in the missing process id ... Fix this by getting the process id from the first (and only) process in the processes list instead. The GNU/Linux port doesn't trip on this because it always runs with multiprocess extensions enabled. To make it easier to catch such regressions going forward, this commit also adds a new smoke test that spawns gdbserver, connects to it and runs to main with the multiprocess extensions force-disabled. gdb/gdbserver/ChangeLog: 2015-08-24 Pedro Alves * inferiors.c (get_first_process): New function. * inferiors.h (get_first_process): New declaration. * remote-utils.c (read_ptid): Default to the first process in the list, instead of to the current thread's process. gdb/testsuite/ChangeLog: 2015-08-24 Pedro Alves * gdb.server/connect-without-multi-process.c: New file. * gdb.server/connect-without-multi-process.exp: New file. commit 73b8c1fda9f3759874a9a1a7e7402276da057153 Author: Pedro Alves Date: Mon Aug 24 19:58:31 2015 +0100 Add "set remote multiprocess-extensions-packet" command Being able to force-disable the RSP multiprocess extensions is useful for testing. gdb/ChangeLog: 2015-08-24 Pedro Alves * NEWS (New commands): Mention set/show remote multiprocess-extensions-packet. * remote.c (remote_query_supported): Only tell the server to use the multiprocess extensions if the user hasn't force-disabled them with "set remote multiprocess-extensions-packet off". gdb/doc/ChangeLog: 2015-08-24 Pedro Alves * gdb.texinfo (Remote Configuration): Document the "set/show remote multiprocess-extensions-packet" commands. commit 4a626d0a0f451c3288a461f64a9f8a49790d422b Author: Pedro Alves Date: Mon Aug 24 18:50:00 2015 +0100 Update gnulib to current upstream master 2015-08-24 Pedro Alves * gnulib/update-gnulib.sh (GNULIB_COMMIT_SHA1): Set to 1029a8112290f6eee9d7878a391c49db42c999bd. * gnulib/configure, gnulib/config.in, gnulib/aclocal.m4: Regenerate. * gnulib/import/Makefile.am: Update. * gnulib/import/Makefile.in: Update. * gnulib/import/alloca.in.h: Update. * gnulib/import/basename-lgpl.c: Update. * gnulib/import/canonicalize-lgpl.c: Update. * gnulib/import/config.charset: Update. * gnulib/import/dirent.in.h: Update. * gnulib/import/dirfd.c: Update. * gnulib/import/dirname-lgpl.c: Update. * gnulib/import/dirname.h: Update. * gnulib/import/dosname.h: Update. * gnulib/import/errno.in.h: Update. * gnulib/import/extra/snippet/arg-nonnull.h: Update. * gnulib/import/extra/snippet/c++defs.h: Update. * gnulib/import/extra/snippet/warn-on-use.h: Update. * gnulib/import/extra/update-copyright: Update. * gnulib/import/float+.h: Update. * gnulib/import/float.c: Update. * gnulib/import/float.in.h: Update. * gnulib/import/fnmatch.c: Update. * gnulib/import/fnmatch.in.h: Update. * gnulib/import/fnmatch_loop.c: Update. * gnulib/import/fpucw.h: Update. * gnulib/import/frexp.c: Update. * gnulib/import/frexpl.c: Update. * gnulib/import/gettimeofday.c: Update. * gnulib/import/inttypes.in.h: Update. * gnulib/import/isnan.c: Update. * gnulib/import/isnand-nolibm.h: Update. * gnulib/import/isnand.c: Update. * gnulib/import/isnanl-nolibm.h: Update. * gnulib/import/isnanl.c: Update. * gnulib/import/itold.c: Update. * gnulib/import/localcharset.c: Update. * gnulib/import/localcharset.h: Update. * gnulib/import/lstat.c: Update. * gnulib/import/m4/00gnulib.m4: Update. * gnulib/import/m4/absolute-header.m4: Update. * gnulib/import/m4/alloca.m4: Update. * gnulib/import/m4/canonicalize.m4: Update. * gnulib/import/m4/codeset.m4: Update. * gnulib/import/m4/configmake.m4: Update. * gnulib/import/m4/dirent_h.m4: Update. * gnulib/import/m4/dirfd.m4: Update. * gnulib/import/m4/dirname.m4: Update. * gnulib/import/m4/double-slash-root.m4: Update. * gnulib/import/m4/eealloc.m4: Update. * gnulib/import/m4/errno_h.m4: Update. * gnulib/import/m4/exponentd.m4: Update. * gnulib/import/m4/exponentl.m4: Update. * gnulib/import/m4/extensions.m4: Update. * gnulib/import/m4/extern-inline.m4: Update. * gnulib/import/m4/fcntl-o.m4: Update. * gnulib/import/m4/float_h.m4: Update. * gnulib/import/m4/fnmatch.m4: Update. * gnulib/import/m4/fpieee.m4: Update. * gnulib/import/m4/frexp.m4: Update. * gnulib/import/m4/frexpl.m4: Update. * gnulib/import/m4/gettimeofday.m4: Update. * gnulib/import/m4/glibc21.m4: Update. * gnulib/import/m4/gnulib-cache.m4: Update. * gnulib/import/m4/gnulib-common.m4: Update. * gnulib/import/m4/gnulib-comp.m4: Update. * gnulib/import/m4/gnulib-tool.m4: Update. * gnulib/import/m4/include_next.m4: Update. * gnulib/import/m4/inttypes-pri.m4: Update. * gnulib/import/m4/inttypes.m4: Update. * gnulib/import/m4/isnand.m4: Update. * gnulib/import/m4/isnanl.m4: Update. * gnulib/import/m4/largefile.m4: Update. * gnulib/import/m4/localcharset.m4: Update. * gnulib/import/m4/locale-fr.m4: Update. * gnulib/import/m4/locale-ja.m4: Update. * gnulib/import/m4/locale-zh.m4: Update. * gnulib/import/m4/longlong.m4: Update. * gnulib/import/m4/lstat.m4: Update. * gnulib/import/m4/malloc.m4: Update. * gnulib/import/m4/malloca.m4: Update. * gnulib/import/m4/math_h.m4: Update. * gnulib/import/m4/mbrtowc.m4: Update. * gnulib/import/m4/mbsinit.m4: Update. * gnulib/import/m4/mbsrtowcs.m4: Update. * gnulib/import/m4/mbstate_t.m4: Update. * gnulib/import/m4/memchr.m4: Update. * gnulib/import/m4/memmem.m4: Update. * gnulib/import/m4/mmap-anon.m4: Update. * gnulib/import/m4/multiarch.m4: Update. * gnulib/import/m4/nocrash.m4: Update. * gnulib/import/m4/off_t.m4: Update. * gnulib/import/m4/pathmax.m4: Update. * gnulib/import/m4/readlink.m4: Update. * gnulib/import/m4/rename.m4: Update. * gnulib/import/m4/rmdir.m4: Update. * gnulib/import/m4/ssize_t.m4: Update. * gnulib/import/m4/stat.m4: Update. * gnulib/import/m4/stdbool.m4: Update. * gnulib/import/m4/stddef_h.m4: Update. * gnulib/import/m4/stdint.m4: Update. * gnulib/import/m4/stdio_h.m4: Update. * gnulib/import/m4/stdlib_h.m4: Update. * gnulib/import/m4/string_h.m4: Update. * gnulib/import/m4/strstr.m4: Update. * gnulib/import/m4/strtok_r.m4: Update. * gnulib/import/m4/sys_socket_h.m4: Update. * gnulib/import/m4/sys_stat_h.m4: Update. * gnulib/import/m4/sys_time_h.m4: Update. * gnulib/import/m4/sys_types_h.m4: Update. * gnulib/import/m4/time_h.m4: Update. * gnulib/import/m4/unistd_h.m4: Update. * gnulib/import/m4/warn-on-use.m4: Update. * gnulib/import/m4/wchar_h.m4: Update. * gnulib/import/m4/wchar_t.m4: Update. * gnulib/import/m4/wctype_h.m4: Update. * gnulib/import/m4/wint_t.m4: Update. * gnulib/import/malloc.c: Update. * gnulib/import/malloca.c: Update. * gnulib/import/malloca.h: Update. * gnulib/import/math.in.h: Update. * gnulib/import/mbrtowc.c: Update. * gnulib/import/mbsinit.c: Update. * gnulib/import/mbsrtowcs-impl.h: Update. * gnulib/import/mbsrtowcs-state.c: Update. * gnulib/import/mbsrtowcs.c: Update. * gnulib/import/memchr.c: Update. * gnulib/import/memmem.c: Update. * gnulib/import/pathmax.h: Update. * gnulib/import/readlink.c: Update. * gnulib/import/ref-add.sin: Update. * gnulib/import/ref-del.sin: Update. * gnulib/import/rename.c: Update. * gnulib/import/rmdir.c: Update. * gnulib/import/same-inode.h: Update. * gnulib/import/stat.c: Update. * gnulib/import/stdbool.in.h: Update. * gnulib/import/stddef.in.h: Update. * gnulib/import/stdint.in.h: Update. * gnulib/import/stdio.c: Update. * gnulib/import/stdio.in.h: Update. * gnulib/import/stdlib.in.h: Update. * gnulib/import/str-two-way.h: Update. * gnulib/import/streq.h: Update. * gnulib/import/string.in.h: Update. * gnulib/import/stripslash.c: Update. * gnulib/import/strnlen1.c: Update. * gnulib/import/strnlen1.h: Update. * gnulib/import/strstr.c: Update. * gnulib/import/strtok_r.c: Update. * gnulib/import/sys_stat.in.h: Update. * gnulib/import/sys_time.in.h: Update. * gnulib/import/sys_types.in.h: Update. * gnulib/import/time.in.h: Update. * gnulib/import/unistd.in.h: Update. * gnulib/import/verify.h: Update. * gnulib/import/wchar.in.h: Update. * gnulib/import/wctype.in.h: Update. * gnulib/import/gettimeofday.c: New file. * gnulib/import/m4/absolute-header.m4: New file. * gnulib/import/m4/gettimeofday.m4: New file. * gnulib/import/m4/sys_socket_h.m4: New file. * gnulib/import/m4/sys_time_h.m4: New file. * gnulib/import/stdio.c: Delete file. * gnulib/import/sys_time.in.h: New file. commit 438e1e427e8393de73d22617abe4d8eba0270e72 Author: Pedro Alves Date: Mon Aug 24 18:50:55 2015 +0100 Prepare for gnulib update After the last gnulib import (Dec 2012), gnulib upstream started replacing mingw's 'struct timeval' with a version with 64-bit time_t, for POSIX compliance: commit f8e84098084b3b53bc6943a5542af1f607ffd477 Author: Bruno Haible Date: Sat Jan 28 18:12:10 2012 +0100 sys_time: Override 'struct timeval' on some native Windows platforms. See: https://lists.gnu.org/archive/html/bug-gnulib/2012-01/msg00372.html However, that results in conflicts with native Winsock2's 'select': select()'s argument http://sourceforge.net/p/mingw-w64/mailman/message/29610438/ ... and libiberty's timeval-utils.h timeval_add/timeval_sub, at the least. We don't really need the POSIX compliance, so this patch prepares us to simply not use gnulib's 'struct timeval' replacement once a more recent gnulib is imported, thus preserving the current behavior, by adding a sys/time.h wrapper header that undefs gnulib's replacements, and including that everywhere instead. The SIZE -> OSIZE change is necessary because newer gnulib's sys/time.h also includes windows.h/winsock2.h, which defines a conflicting SIZE symbol. Cross build-tested mingw-w64 32-bit and 64-bit. Regtested on x86_64 Fedora 20. gdb/ChangeLog: 2015-08-24 Pedro Alves * Makefile.in (HFILES_NO_SRCDIR): Add common/gdb_sys_time.h. * common/gdb_sys_time.h: New file. * event-loop.c: Include gdb_sys_time.h instead of sys/time.h. * gdb_select.h: Likewise. * gdb_usleep.c: Likewise. * maint.c: Likewise. * mi/mi-main.c: Likewise. * mi/mi-parse.h: Likewise. * remote-fileio.c: Likewise. * remote-m32r-sdi.c: Likewise. * remote.c: Likewise. * ser-base.c: Likewise. * ser-pipe.c: Likewise. * ser-tcp.c: Likewise. * ser-unix.c: Likewise. * symfile.c: Likewise. * symfile.c: Likewise. Rename OSIZE to SIZE throughout. * target-memory.c: Include gdb_sys_time.h instead of sys/time.h. * utils.c: Likewise. gdb/gdbserver/ChangeLog: 2015-08-24 Pedro Alves * debug.c: Include gdb_sys_time.h instead of sys/time.h. * event-loop.c: Likewise. * remote-utils.c: Likewise. * tracepoint.c: Likewise. commit a8c6d4fcd6b2a30c2b5b87d656ce035dcf8b0035 Author: Pedro Alves Date: Mon Aug 24 17:58:22 2015 +0100 Fix gdbserver SPU build Ref: https://sourceware.org/ml/gdb-patches/2015-08/msg00675.html gdbserver/spu-low.c: In function 'spu_request_interrupt': gdbserver/spu-low.c:639: error: incompatible type for argument 1 of 'ptid_get_lwp' gdb/gdbserver/ChangeLog: 2015-08-24 Pedro Alves * spu-low.c (spu_request_interrupt): Use lwpid_of instead of ptid_get_lwp. commit 4422ac93e5d3d23dd441aadaa49c81356aa59b73 Author: Luis Machado Date: Mon Aug 24 13:08:20 2015 -0300 Make z int This makes z an int for gdb/testsuite/gdb.opt/inline-markers.c. gdb/testsuite/ChangeLog: 2015-08-24 Luis Machado * gdb.opt/inline-markers.c: Make z int. commit 91dddb86299bba404599551e9e2633b3c0e5c830 Author: Luis Machado Date: Mon Aug 24 12:56:15 2015 -0300 Make z volatile. This fixes a typo in gdb/testsuite/gdb.opt/inline-markers.c, making z a volatile variable. gdb/testsuite/ChangeLog: 2015-08-24 Luis Machado * gdb.opt/inline-markers.c: Make z volatile. commit a48847eea5f39c1f9fbe4255c9e892647f13f995 Author: Luis Machado Date: Mon Aug 24 12:33:21 2015 -0300 Prevent GCC from folding inline test functions While doing some powerpc Linux tests on a ppc 476 board using GCC 5.2, i noticed inline-bt.exp, inline-cmds.exp and inline-locals.exp failing. FAIL: gdb.opt/inline-bt.exp: continue to bar (1) FAIL: gdb.opt/inline-bt.exp: backtrace from bar (1) FAIL: gdb.opt/inline-bt.exp: continue to bar (2) FAIL: gdb.opt/inline-bt.exp: backtrace from bar (2) FAIL: gdb.opt/inline-bt.exp: continue to bar (3) FAIL: gdb.opt/inline-bt.exp: backtrace from bar (3) FAIL: gdb.opt/inline-cmds.exp: continue to bar (1) FAIL: gdb.opt/inline-cmds.exp: backtrace from bar (1) FAIL: gdb.opt/inline-cmds.exp: continue to bar (2) FAIL: gdb.opt/inline-cmds.exp: backtrace from bar (2) FAIL: gdb.opt/inline-cmds.exp: continue to marker FAIL: gdb.opt/inline-cmds.exp: backtrace from marker FAIL: gdb.opt/inline-cmds.exp: step into finish marker FAIL: gdb.opt/inline-locals.exp: continue to bar (1) FAIL: gdb.opt/inline-locals.exp: continue to bar (2) FAIL: gdb.opt/inline-locals.exp: backtrace from bar (2) FAIL: gdb.opt/inline-locals.exp: continue to bar (3) FAIL: gdb.opt/inline-locals.exp: backtrace from bar (3) They failed because the breakpoint supposedly inserted at bar was actually inserted at noinline. (gdb) break inline-markers.c:20^M Breakpoint 2 at 0x1000079c: file gdb/testsuite/gdb.opt/inline-markers.c, line 20.^M (gdb) continue^M Continuing.^M ^M Breakpoint 2, noinline () at gdb/testsuite/gdb.opt/inline-markers.c:35^M 35 inlined_fn (); /* inlined */^M As we can see, line 20 is really inside bar, not noinline: 18 void bar(void) 19 { 20 x += y; /* set breakpoint 1 here */ 21 } Further investigation shows that this is really due to GCC 5's new ICF pass (-fipa-icf), now enabled by default at -O2, which folds bar and marker into noinline, where the call to inlined_fn was inlined. This breaks the testcase since it expects to stop at specific spots. I thought about two possible fixes for this issue. - Disable the ICF pass manually when building the binary (-fno-ipa-icf). This has the advantage of not having to touch the testcase sources themselves, but the disadvantage of having to add conditional blocks to test the GCC version. If we ever change GCC's default, we will have to adjust the conditional block again to match GCC's behavior. - Modify the testcase sources to make the identical functions unique. This solution doesn't touch the testcase itself, but changes the source code slightly in order to make bar, marker and inlined_fn unique. This causes GCC's ICF pass to ignore these functions and not fold them into a common identical function. I'm good with either of them, but i'm more inclined to go with the second one. The attached patch implements this by adding the new global variable z, set to 0, that gets added in different ways to marker and inlined_fn. Since it is 0, it doesn't affect any possible value checks that we may wish to do in the future (we currently only check for values changed by bar). Ok? ps: I also noticed GDB doesn't do a great job at stating that the breakpoint was actually inserted at a different source line than previously requested, so this sounds like a bug that should be fixed, if it is not just wrong DWARF information (did not investigate it further). gdb/testsuite/ChangeLog: 2015-08-24 Luis Machado * gdb.opt/inline-bt.c: New volatile global z. * gdb.opt/inline-cmds.c: Likewise. * gdb.opt/inline-locals.c: Likewise. * gdb.opt/inline-markers.c: New extern global z. (marker): Use z. (inline_fn): Likewise. commit 0ebbc52beef41c725f75b22c80a37fee00303bb0 Author: Pedro Alves Date: Mon Aug 24 15:29:49 2015 +0100 gdb/testsuite/: garbage collect a few references to dead targets gdb/testsuite/ChangeLog: 2015-08-24 Pedro Alves * config/m32r-stub.exp: Remove file. * gdb.base/call-ar-st.exp: Remove reference to sparclet. * gdb.base/call-rt-st.exp: Likewise. * gdb.base/call-strs.exp: Likewise. * gdb.base/default.exp: Remove references to h8300-*-hms and *-*-udi*. * gdb.base/funcargs.exp: Remove reference to sparclet-*-*. commit bb61542818398aa00f869257c0734ffdc39275b5 Author: Pedro Alves Date: Mon Aug 24 15:40:26 2015 +0100 gdb manual: Remove references to deleted targets Support for target dbug/picobug/dink32/m32r/mon2000/ppcbug was just removed, but support for ARM RDI, Sparclet, Sparclite, Z8000, target r3900, target array, target sds, target op50n and target w89k had already been removed many years ago. Drop it all in one go. gdb/doc/ChangeLog: 2015-08-24 Pedro Alves * gdb.texinfo (Embedded Processors) : Remove references to RDI. : Remove references to M32R/D. : Remove references to target dbug. : Remove references to target r3900 and target array. : Remove references to target dink32 and target ppcbug, target sds : Delete nodes. commit 40e0b27177e747600d3ec186458fe0e482a1cf77 Author: Pedro Alves Date: Mon Aug 24 15:40:26 2015 +0100 Delete the remaining ROM monitor targets Ref: https://sourceware.org/ml/gdb/2015-07/msg00011.html All of these targets use gdb/monitor.c, which has bit rotted years ago (I'd guess around ~6), and nobody seems to have noticed: | target | source | |----------------+----------------------| | target dbug | gdb/dbug-rom.c | | target picobug | gdb/microblaze-rom.c | | target dink32 | gdb/dink32-rom.c | | target m32r | gdb/m32r-rom.c | | target mon2000 | gdb/m32r-rom.c | | target ppcbug | gdb/ppcbug-rom.c | This deletes them, along with finally removing monitor.c. A manual update will be done separately. gdb/ChangeLog: 2015-08-24 Pedro Alves * NEWS: Mention removed support for the various ROM monitors. * Makefile.in (ALL_TARGET_OBS): Remove dbug-rom.o, dink32-rom.o, ppcbug-rom.o, m32r-rom.o, dsrec.o and monitor.o from gdb_target_obs. * configure.tgt (h8300-*-*): Remove monitor.o and m32r-rom.o from gdb_target_obs. (m68*-*-*): Remove monitor.o dbug-rom.o and dsrec.o from gdb_target_obs. (microblaze*-linux-*): Remove microblaze-rom.o, monitor.o and dsrec.o from gdb_target_obs. (microblaze*-*-*): Remove microblaze-rom.o, monitor.o and dsrec.o from gdb_target_obs. (powerpc-*-lynx*178): Remove monitor.o and dsrec.o from gdb_target_obs. (powerpc*-*-*): Remove monitor.o, dsrec.o, ppcbug-rom.o and dink32-rom.o from gdb_target_obs. (sh*-*-linux*): Remove monitor.o and dsrec.o from gdb_target_obs. (sh*): Remove monitor.o and dsrec.o from gdb_target_obs. * dbug-rom.c, dink32-rom.c, dsrec.c, m32r-rom.c, microblaze-rom.c, monitor.c, monitor.h, ppcbug-rom.c, srec.h: Delete files. commit 5f40e14d768b94f7fdc050aeba5ee62e6a8d5756 Author: Jan Stancek Date: Mon Aug 24 14:50:15 2015 +0100 Fix the partial disassembly of a broken three byte instruction at the end of a function. opcodes * i386-dis.c (print_insn): Fix decoding of three byte operands. tests * gas/i386/intel.s: Add test of disassembly of a potential three byte instuction at the end of a function. * gas/i386/intel.d: Update expected disassembly. commit 77c365df78441f7b968ec0f62c7ed9f5de36dc60 Author: Andreas Arnez Date: Mon Aug 24 15:37:40 2015 +0200 gnu_vector.exp: Avoid some more known FAILs This avoids two more types of FAILs with the gnu_vector test case. First, for POWER targets newer GCCs emit an ABI note when invoked with "-mcpu=native". Then the test case fell back to non-native compile, producing code for a non-vector ABI. But that is not supported by GDB. Thus the compiler note is now suppressed with "-Wno-psabi". Second, on s390 the test case produced FAILs after falling back to a non-vector ABI when using "finish" or "return" in a vector-valued function. This was due to a long-standing known bug (Bug 8549). This case is now detected, and KFAILs are emitted instead. gdb/testsuite/ChangeLog: * gdb.base/gnu_vector.exp: Try compilation with "-mcpu=native -Wno-psabi" if "-mcpu=native" fails. For the tests with "finish" and "return" use KFAIL when GDB can not read/write the vector return value. commit cfe101c6a8227b6b97ed2da85895db7d6083bfa6 Author: Yaakov Selkowitz Date: Mon Aug 24 10:57:03 2015 +0100 Missing parts of fixes for in-tree libiconv (Commit d23d1dff missed pushing the config/iconv.m4 change, and to regenerate binutils' configure.) Original description: This is the second in a series of patches to make a build with an in-tree GNU libiconv work as designed. Currently GDB is the only toolchain component which actually uses an in-tree libiconv. This patch modifies the common AM_ICONV to use an in-tree libiconv when present and not already provided by libc. (GDB's workaround uses an in-tree libiconv even when libc provides iconv(3); I'm not sure when or why that would be desirable.) config/ChangeLog: 2015-08-24 Yaakov Selkowitz * iconv.m4 (AM_ICONV_LINK): Use in-tree libiconv when present. binutils/ChangeLog: 2015-08-24 Yaakov Selkowitz * configure: Regenerate. commit b83035f1f61c8749983aef1f51162947a284827d Author: GDB Administrator Date: Mon Aug 24 00:00:07 2015 +0000 Automatic date update in version.in commit 5f329d5b1409dfb86e3eb6a22e9f84cc58c254b1 Author: Alan Modra Date: Sun Aug 23 20:54:45 2015 +0930 Reorder enum output_type for better code generation Works around a gcc bug #67328 for the most commonly used of bfd_link_pic and bfd_link_executable. * bfdlink.h (enum output_type): Reorder enum. commit d579c450dd97470b0601ceb5d3e3d926e7a1333e Author: GDB Administrator Date: Sun Aug 23 00:00:07 2015 +0000 Automatic date update in version.in commit 595bce7595e076391e7147b0c6db57a8edf2e406 Author: Alan Modra Date: Sat Aug 22 13:24:34 2015 +0930 Uninitialized vd_nodename Belt and braces fix. Either of the changes here is sufficient to ensure vd_nodename is initialized properly. * elf.c (_bfd_elf_slurp_version_tables): Always init vd_nodename. Don't copy fields not set by _bfd_elf_swap_verdef_in. commit 0d6b12851b08f5f71f7d97d2c832b899d63b5df2 Author: GDB Administrator Date: Sat Aug 22 00:00:09 2015 +0000 Automatic date update in version.in commit 99b0bb12cdb22489b403df6afe992b81bebbd9ec Author: Pedro Alves Date: Fri Aug 21 23:59:33 2015 +0100 Fix ax.c:gdb_eval_agent_expr In C++ mode: src/gdb/gdbserver/ax.c: In function ‘eval_result_type gdb_eval_agent_expr(eval_agent_expr_context*, agent_expr*, ULONGEST*)’: src/gdb/gdbserver/ax.c:1335:11: error: invalid conversion from ‘int’ to ‘eval_result_type’ [-fpermissive] return 1; ^ "1" as an enum eval_result_type is expr_eval_empty_expression, but clearly this wants to return expr_eval_unhandled_opcode. gdb/gdbserver/ChangeLog: 2015-08-21 Pedro Alves * ax.c (gdb_eval_agent_expr): Return expr_eval_unhandled_opcode instead of literal 1. commit f8904751117dc8d4d04e5c5286b71b854e6ebba5 Author: Pedro Alves Date: Fri Aug 21 23:49:37 2015 +0100 C++: Initialize a couple const globals In C++ mode, we get: src/gdb/gdbserver/tdesc.c:43:33: error: uninitialized const ‘default_description’ [-fpermissive] static const struct target_desc default_description; ^ In file included from src/gdb/gdbserver/tdesc.c:19:0: src/gdb/gdbserver/tdesc.h:26:8: note: ‘const struct target_desc’ has no user-provided default constructor struct target_desc ^ gdb/ChangeLog: 2015-08-21 Pedro Alves * frame.c (null_frame_id): Explicitly zero-initialize. gdb/gdbserver/ChangeLog: 2015-08-21 Pedro Alves * tdesc.c (default_description): Explicitly zero-initialize. commit 049412e38f9ac04654940173db63a37ebca9bfc3 Author: Tom Tromey Date: Fri Aug 21 23:45:50 2015 +0100 gdb/dwarf2read.c: rename a field for c++ Fixes: ../../src/gdb/dwarf2read.c:127:15: error: declaration of ‘asection* dwarf2_section_info::::asection’ [-fpermissive] asection *asection; ^ In file included from ../../src/gdb/common/common-types.h:35:0, from ../../src/gdb/common/common-defs.h:44, from ../../src/gdb/defs.h:28, from ../../src/gdb/dwarf2read.c:31: ../bfd/bfd.h:1596:3: error: changes meaning of ‘asection’ from ‘typedef struct bfd_section asection’ [-fpermissive] } asection; ^ gdb/ChangeLog: 2015-08-21 Tom Tromey * dwarf2read.c (struct dwarf2_section_info): Rename field 'asection' to 'section'. (dwarf2_has_info, get_section_bfd_owner, get_section_bfd_section) (dwarf2_locate_sections, dwarf2_locate_sections) (locate_dwz_sections, locate_v1_virtual_dwo_sections) (dwarf2_locate_dwo_sections, dwarf2_locate_dwo_sections) (dwarf2_locate_v2_dwp_sections): Adjust. commit 948578a989f8c666c9b0e92c9a50906724921f14 Author: Patrick Palka Date: Fri Aug 21 12:28:19 2015 -0400 tui: don't overwrite a secondary prompt that was given no input This patch fixes the following bug in TUI: (gdb) break foo No symbol table is loaded. Use the "file" command. Make breakpoint pending on future shared library load? (y or [n]) By submitting an empty command line to a secondary prompt, the line corresponding to the secondary prompt is undesirably cleared and overwritten. Outside of a secondary prompt, clearing the prompt line after submitting an empty command line is intended behavior which complements GDB's repeat-command shorthand. But inside a secondary prompt, this behavior is undesired since the shorthand is not applicable in that case. We should retain the secondary-prompt line even when it's given no input. This patch makes sure that a prompt that was given an empty command line is cleared and overwritten only if it's not a secondary prompt. To acheive this, a new predicate is defined which informs us whether the current input handler is a secondary prompt. gdb/ChangeLog: * top.h (gdb_in_secondary_prompt_p): Declare. * top.c (gdb_secondary_prompt_depth): Define. (gdb_in_secondary_prompt_p): Define. (gdb_readline_wrapper_cleanup): Decrement gdb_secondary_prompt_depth. (gdb_readline_wrapper): Increment gdb_secondary_prompt_depth. * tui/tui-io.c (tui_getc): Don't clear the prompt line if we are in a secondary prompt. commit 7a8bcb88e77380fe9672b4f10777cc9e48011dd4 Author: Patrick Palka Date: Fri Aug 21 12:04:25 2015 -0400 Use tui_putc to output newline entered by the user This is necessary to make sure that start_line is updated after a command has been entered. Usually, start_line gets updated anyway because most commands output text, and outputting text is done through the function tui_puts, which updates start_line. However if a command does not output text, then tui_puts will not get called and start_line will not get updated in time for the next prompt to be displayed. One can observe this bug by executing the command "delete" within TUI. After executing, the prompt line (gdb) delete gets overwritten by the next prompt. With this patch, the prompt line gets preserved. gdb/ChangeLog: * tui/tui-io.c (tui_getc): Use tui_putc instead of waddch to emit the newline. ----------------------------------------------------------------------- Summary of changes: bfd/ChangeLog | 17 + bfd/bfd-in2.h | 2 +- bfd/elf.c | 23 +- bfd/reloc.c | 2 +- bfd/version.h | 2 +- binutils/ChangeLog | 4 + binutils/configure | 93 +- config/ChangeLog | 4 + config/iconv.m4 | 47 +- gas/ChangeLog | 5 + gas/config/tc-sparc.c | 1 + gas/testsuite/ChangeLog | 21 + gas/testsuite/gas/i386/intel.d | 4 + gas/testsuite/gas/i386/intel.s | 11 + gas/testsuite/gas/mips/micromips32-move.d | 10 +- gas/testsuite/gas/mips/move.d | 10 +- gas/testsuite/gas/mips/move.s | 8 +- gas/testsuite/gas/sparc/rdpr.d | 1 + gas/testsuite/gas/sparc/rdpr.s | 1 + gas/testsuite/gas/sparc/wrpr.d | 1 + gas/testsuite/gas/sparc/wrpr.s | 1 + gdb/ChangeLog | 441 ++++ gdb/Makefile.in | 11 +- gdb/NEWS | 13 + gdb/aarch64-linux-nat.c | 144 +-- gdb/ada-lang.c | 5 +- gdb/block.c | 15 + gdb/block.h | 11 + gdb/buildsym.c | 19 +- gdb/buildsym.h | 15 +- gdb/c-exp.y | 5 +- gdb/coffread.c | 6 +- gdb/common/gdb_sys_time.h | 38 + gdb/compile/compile-c-symbols.c | 74 +- gdb/compile/compile-loc2c.c | 2 +- gdb/config/aarch64/linux.mh | 3 +- gdb/configure.tgt | 31 +- gdb/dbug-rom.c | 176 -- gdb/dbxread.c | 8 +- gdb/defs.h | 20 +- gdb/dink32-rom.c | 179 -- gdb/doc/ChangeLog | 16 + gdb/doc/gdb.texinfo | 407 +---- gdb/dsrec.c | 316 --- gdb/dwarf2loc.c | 57 +- gdb/dwarf2loc.h | 11 +- gdb/dwarf2read.c | 138 +- gdb/event-loop.c | 18 +- gdb/event-loop.h | 9 + gdb/exec.c | 7 +- gdb/f-exp.y | 5 +- gdb/findvar.c | 168 ++- gdb/frame.c | 2 +- gdb/gdb_select.h | 2 +- gdb/gdb_usleep.c | 3 +- gdb/gdbserver/ChangeLog | 91 + gdb/gdbserver/Makefile.in | 3 + gdb/gdbserver/ax.c | 2 +- gdb/gdbserver/configure.srv | 1 + gdb/gdbserver/debug.c | 2 +- gdb/gdbserver/event-loop.c | 2 +- gdb/gdbserver/inferiors.c | 8 + gdb/gdbserver/inferiors.h | 3 + gdb/gdbserver/linux-aarch64-low.c | 188 +-- gdb/gdbserver/remote-utils.c | 9 +- gdb/gdbserver/spu-low.c | 2 +- gdb/gdbserver/tdesc.c | 2 +- gdb/gdbserver/tracepoint.c | 2 +- gdb/gdbtypes.c | 7 +- gdb/gnulib/aclocal.m4 | 4 + gdb/gnulib/config.in | 205 ++- gdb/gnulib/configure | 2077 ++++++++++++------ gdb/gnulib/import/Makefile.am | 75 +- gdb/gnulib/import/Makefile.in | 129 +- gdb/gnulib/import/alloca.in.h | 2 +- gdb/gnulib/import/basename-lgpl.c | 2 +- gdb/gnulib/import/canonicalize-lgpl.c | 10 +- gdb/gnulib/import/config.charset | 6 +- gdb/gnulib/import/dirent.in.h | 4 +- gdb/gnulib/import/dirfd.c | 2 +- gdb/gnulib/import/dirname-lgpl.c | 2 +- gdb/gnulib/import/dirname.h | 10 +- gdb/gnulib/import/dosname.h | 2 +- gdb/gnulib/import/errno.in.h | 2 +- gdb/gnulib/import/extra/snippet/arg-nonnull.h | 2 +- gdb/gnulib/import/extra/snippet/c++defs.h | 2 +- gdb/gnulib/import/extra/snippet/warn-on-use.h | 2 +- gdb/gnulib/import/extra/update-copyright | 8 +- gdb/gnulib/import/float+.h | 2 +- gdb/gnulib/import/float.c | 2 +- gdb/gnulib/import/float.in.h | 2 +- gdb/gnulib/import/fnmatch.c | 2 +- gdb/gnulib/import/fnmatch.in.h | 2 +- gdb/gnulib/import/fnmatch_loop.c | 6 +- gdb/gnulib/import/fpucw.h | 2 +- gdb/gnulib/import/frexp.c | 2 +- gdb/gnulib/import/frexpl.c | 2 +- gdb/gnulib/import/gettimeofday.c | 154 ++ gdb/gnulib/import/inttypes.in.h | 22 +- gdb/gnulib/import/isnan.c | 20 +- gdb/gnulib/import/isnand-nolibm.h | 2 +- gdb/gnulib/import/isnand.c | 2 +- gdb/gnulib/import/isnanl-nolibm.h | 2 +- gdb/gnulib/import/isnanl.c | 2 +- gdb/gnulib/import/itold.c | 2 +- gdb/gnulib/import/localcharset.c | 88 +- gdb/gnulib/import/localcharset.h | 2 +- gdb/gnulib/import/lstat.c | 2 +- gdb/gnulib/import/m4/00gnulib.m4 | 22 +- gdb/gnulib/import/m4/absolute-header.m4 | 102 + gdb/gnulib/import/m4/alloca.m4 | 2 +- gdb/gnulib/import/m4/canonicalize.m4 | 2 +- gdb/gnulib/import/m4/codeset.m4 | 2 +- gdb/gnulib/import/m4/configmake.m4 | 13 +- gdb/gnulib/import/m4/dirent_h.m4 | 2 +- gdb/gnulib/import/m4/dirfd.m4 | 2 +- gdb/gnulib/import/m4/dirname.m4 | 2 +- gdb/gnulib/import/m4/double-slash-root.m4 | 2 +- gdb/gnulib/import/m4/eealloc.m4 | 2 +- gdb/gnulib/import/m4/errno_h.m4 | 2 +- gdb/gnulib/import/m4/exponentd.m4 | 2 +- gdb/gnulib/import/m4/exponentl.m4 | 2 +- gdb/gnulib/import/m4/extensions.m4 | 56 +- gdb/gnulib/import/m4/extern-inline.m4 | 79 +- gdb/gnulib/import/m4/fcntl-o.m4 | 2 +- gdb/gnulib/import/m4/float_h.m4 | 2 +- gdb/gnulib/import/m4/fnmatch.m4 | 2 +- gdb/gnulib/import/m4/fpieee.m4 | 2 +- gdb/gnulib/import/m4/frexp.m4 | 12 +- gdb/gnulib/import/m4/frexpl.m4 | 2 +- gdb/gnulib/import/m4/gettimeofday.m4 | 138 ++ gdb/gnulib/import/m4/glibc21.m4 | 2 +- gdb/gnulib/import/m4/gnulib-cache.m4 | 2 +- gdb/gnulib/import/m4/gnulib-common.m4 | 126 +- gdb/gnulib/import/m4/gnulib-comp.m4 | 20 +- gdb/gnulib/import/m4/gnulib-tool.m4 | 2 +- gdb/gnulib/import/m4/include_next.m4 | 55 +- gdb/gnulib/import/m4/inttypes-pri.m4 | 2 +- gdb/gnulib/import/m4/inttypes.m4 | 3 +- gdb/gnulib/import/m4/isnand.m4 | 2 +- gdb/gnulib/import/m4/isnanl.m4 | 43 +- gdb/gnulib/import/m4/largefile.m4 | 25 +- gdb/gnulib/import/m4/localcharset.m4 | 2 +- gdb/gnulib/import/m4/locale-fr.m4 | 2 +- gdb/gnulib/import/m4/locale-ja.m4 | 2 +- gdb/gnulib/import/m4/locale-zh.m4 | 2 +- gdb/gnulib/import/m4/longlong.m4 | 2 +- gdb/gnulib/import/m4/lstat.m4 | 50 +- gdb/gnulib/import/m4/malloc.m4 | 2 +- gdb/gnulib/import/m4/malloca.m4 | 2 +- gdb/gnulib/import/m4/math_h.m4 | 2 +- gdb/gnulib/import/m4/mbrtowc.m4 | 48 +- gdb/gnulib/import/m4/mbsinit.m4 | 2 +- gdb/gnulib/import/m4/mbsrtowcs.m4 | 2 +- gdb/gnulib/import/m4/mbstate_t.m4 | 2 +- gdb/gnulib/import/m4/memchr.m4 | 2 +- gdb/gnulib/import/m4/memmem.m4 | 2 +- gdb/gnulib/import/m4/mmap-anon.m4 | 2 +- gdb/gnulib/import/m4/multiarch.m4 | 2 +- gdb/gnulib/import/m4/nocrash.m4 | 2 +- gdb/gnulib/import/m4/off_t.m4 | 2 +- gdb/gnulib/import/m4/pathmax.m4 | 2 +- gdb/gnulib/import/m4/readlink.m4 | 2 +- gdb/gnulib/import/m4/rename.m4 | 2 +- gdb/gnulib/import/m4/rmdir.m4 | 2 +- gdb/gnulib/import/m4/ssize_t.m4 | 2 +- gdb/gnulib/import/m4/stat.m4 | 2 +- gdb/gnulib/import/m4/stdbool.m4 | 2 +- gdb/gnulib/import/m4/stddef_h.m4 | 10 +- gdb/gnulib/import/m4/stdint.m4 | 2 +- gdb/gnulib/import/m4/stdio_h.m4 | 31 +- gdb/gnulib/import/m4/stdlib_h.m4 | 10 +- gdb/gnulib/import/m4/string_h.m4 | 2 +- gdb/gnulib/import/m4/strstr.m4 | 2 +- gdb/gnulib/import/m4/strtok_r.m4 | 2 +- gdb/gnulib/import/m4/sys_socket_h.m4 | 176 ++ gdb/gnulib/import/m4/sys_stat_h.m4 | 2 +- gdb/gnulib/import/m4/sys_time_h.m4 | 111 + gdb/gnulib/import/m4/sys_types_h.m4 | 6 +- gdb/gnulib/import/m4/time_h.m4 | 31 +- gdb/gnulib/import/m4/unistd_h.m4 | 7 +- gdb/gnulib/import/m4/warn-on-use.m4 | 2 +- gdb/gnulib/import/m4/wchar_h.m4 | 2 +- gdb/gnulib/import/m4/wchar_t.m4 | 2 +- gdb/gnulib/import/m4/wctype_h.m4 | 2 +- gdb/gnulib/import/m4/wint_t.m4 | 2 +- gdb/gnulib/import/malloc.c | 2 +- gdb/gnulib/import/malloca.c | 31 +- gdb/gnulib/import/malloca.h | 4 +- gdb/gnulib/import/math.in.h | 5 +- gdb/gnulib/import/mbrtowc.c | 9 +- gdb/gnulib/import/mbsinit.c | 2 +- gdb/gnulib/import/mbsrtowcs-impl.h | 2 +- gdb/gnulib/import/mbsrtowcs-state.c | 2 +- gdb/gnulib/import/mbsrtowcs.c | 2 +- gdb/gnulib/import/memchr.c | 2 +- gdb/gnulib/import/memmem.c | 2 +- gdb/gnulib/import/pathmax.h | 2 +- gdb/gnulib/import/readlink.c | 2 +- gdb/gnulib/import/ref-add.sin | 2 +- gdb/gnulib/import/ref-del.sin | 2 +- gdb/gnulib/import/rename.c | 8 +- gdb/gnulib/import/rmdir.c | 2 +- gdb/gnulib/import/same-inode.h | 2 +- gdb/gnulib/import/stat.c | 2 +- gdb/gnulib/import/stdbool.in.h | 2 +- gdb/gnulib/import/stddef.in.h | 54 +- gdb/gnulib/import/stdint.in.h | 5 +- gdb/gnulib/import/stdio.c | 3 - gdb/gnulib/import/stdio.in.h | 56 +- gdb/gnulib/import/stdlib.in.h | 46 +- gdb/gnulib/import/str-two-way.h | 2 +- gdb/gnulib/import/streq.h | 2 +- gdb/gnulib/import/string.in.h | 23 +- gdb/gnulib/import/stripslash.c | 2 +- gdb/gnulib/import/strnlen1.c | 2 +- gdb/gnulib/import/strnlen1.h | 2 +- gdb/gnulib/import/strstr.c | 2 +- gdb/gnulib/import/strtok_r.c | 2 +- gdb/gnulib/import/sys_stat.in.h | 6 +- gdb/gnulib/import/sys_time.in.h | 213 ++ gdb/gnulib/import/sys_types.in.h | 4 +- gdb/gnulib/import/time.in.h | 75 +- gdb/gnulib/import/unistd.in.h | 91 +- gdb/gnulib/import/verify.h | 136 +- gdb/gnulib/import/wchar.in.h | 11 +- gdb/gnulib/import/wctype.in.h | 12 +- gdb/gnulib/update-gnulib.sh | 2 +- gdb/go-exp.y | 5 +- gdb/guile/scm-frame.c | 9 +- gdb/guile/scm-symbol.c | 6 +- gdb/infcmd.c | 2 +- gdb/infrun.c | 7 +- gdb/jv-exp.y | 4 +- gdb/language.h | 12 +- gdb/m2-exp.y | 5 +- gdb/m32r-rom.c | 634 ----- gdb/maint.c | 2 +- gdb/mi/mi-main.c | 2 +- gdb/mi/mi-parse.h | 2 +- gdb/microblaze-rom.c | 192 -- gdb/monitor.c | 2417 -------------------- gdb/monitor.h | 261 --- gdb/nat/aarch64-linux-hw-point.c | 88 + gdb/nat/aarch64-linux-hw-point.h | 5 +- gdb/nat/aarch64-linux.c | 80 + gdb/{gdb_usleep.c => nat/aarch64-linux.h} | 26 +- gdb/objfiles.c | 91 + gdb/objfiles.h | 22 + gdb/p-exp.y | 5 +- gdb/ppcbug-rom.c | 224 -- gdb/printcmd.c | 6 +- gdb/python/py-finishbreakpoint.c | 2 +- gdb/python/py-frame.c | 9 +- gdb/python/py-framefilter.c | 29 +- gdb/python/py-symbol.c | 6 +- gdb/remote-fileio.c | 2 +- gdb/remote-m32r-sdi.c | 2 +- gdb/remote.c | 49 +- gdb/ser-base.c | 2 +- gdb/ser-pipe.c | 2 +- gdb/ser-tcp.c | 2 +- gdb/ser-unix.c | 2 +- gdb/srec.h | 35 - gdb/stack.c | 8 +- gdb/symfile.c | 14 +- gdb/symtab.h | 19 + gdb/target-delegates.c | 26 + gdb/target-memory.c | 2 +- gdb/target.c | 8 + gdb/target.h | 10 + gdb/testsuite/ChangeLog | 48 + gdb/testsuite/config/m32r-stub.exp | 1 - gdb/testsuite/gdb.base/call-ar-st.exp | 5 - gdb/testsuite/gdb.base/call-rt-st.exp | 5 - gdb/testsuite/gdb.base/call-strs.exp | 5 - gdb/testsuite/gdb.base/default.exp | 33 +- gdb/testsuite/gdb.base/funcargs.exp | 22 +- gdb/testsuite/gdb.base/gnu_vector.exp | 66 +- .../inline-markers.c => gdb.base/nested-subp1.c} | 35 +- gdb/testsuite/gdb.base/nested-subp1.exp | 55 + .../inline-markers.c => gdb.base/nested-subp2.c} | 40 +- gdb/testsuite/gdb.base/nested-subp2.exp | 64 + gdb/testsuite/gdb.base/nested-subp3.c | 66 + gdb/testsuite/gdb.base/nested-subp3.exp | 55 + gdb/testsuite/gdb.opt/inline-bt.c | 1 + gdb/testsuite/gdb.opt/inline-cmds.c | 1 + gdb/testsuite/gdb.opt/inline-locals.c | 1 + gdb/testsuite/gdb.opt/inline-markers.c | 5 +- .../gdb.server/connect-without-multi-process.c} | 15 +- .../gdb.server/connect-without-multi-process.exp | 61 + gdb/top.c | 18 + gdb/top.h | 4 + gdb/tui/tui-io.c | 4 +- gdb/utils.c | 14 +- gdb/valops.c | 35 +- gdb/value.h | 2 + gdb/xcoffread.c | 5 +- include/ChangeLog | 4 + include/bfdlink.h | 2 +- opcodes/ChangeLog | 9 + opcodes/i386-dis.c | 6 +- opcodes/sparc-dis.c | 8 +- 303 files changed, 6081 insertions(+), 6903 deletions(-) create mode 100644 gdb/common/gdb_sys_time.h delete mode 100644 gdb/dbug-rom.c delete mode 100644 gdb/dink32-rom.c delete mode 100644 gdb/dsrec.c mode change 100644 => 100755 gdb/gnulib/import/extra/update-copyright create mode 100644 gdb/gnulib/import/gettimeofday.c create mode 100644 gdb/gnulib/import/m4/absolute-header.m4 create mode 100644 gdb/gnulib/import/m4/gettimeofday.m4 create mode 100644 gdb/gnulib/import/m4/sys_socket_h.m4 create mode 100644 gdb/gnulib/import/m4/sys_time_h.m4 delete mode 100644 gdb/gnulib/import/stdio.c create mode 100644 gdb/gnulib/import/sys_time.in.h delete mode 100644 gdb/m32r-rom.c delete mode 100644 gdb/microblaze-rom.c delete mode 100644 gdb/monitor.c delete mode 100644 gdb/monitor.h create mode 100644 gdb/nat/aarch64-linux.c copy gdb/{gdb_usleep.c => nat/aarch64-linux.h} (68%) delete mode 100644 gdb/ppcbug-rom.c delete mode 100644 gdb/srec.h delete mode 100644 gdb/testsuite/config/m32r-stub.exp copy gdb/testsuite/{gdb.opt/inline-markers.c => gdb.base/nested-subp1.c} (58%) create mode 100644 gdb/testsuite/gdb.base/nested-subp1.exp copy gdb/testsuite/{gdb.opt/inline-markers.c => gdb.base/nested-subp2.c} (53%) create mode 100644 gdb/testsuite/gdb.base/nested-subp2.exp create mode 100644 gdb/testsuite/gdb.base/nested-subp3.c create mode 100644 gdb/testsuite/gdb.base/nested-subp3.exp copy gdb/{gnulib/import/isnand.c => testsuite/gdb.server/connect-without-multi-process.c} (71%) create mode 100644 gdb/testsuite/gdb.server/connect-without-multi-process.exp First 500 lines of diff: diff --git a/bfd/ChangeLog b/bfd/ChangeLog index dcd0e88..18a5cd0 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,20 @@ +2015-08-25 Nick Clifton + + PR binutils/18854 + * elf.c (bfd_section_from_shdr): Replace assertions with warnings + about multiple symbol tables. + +2015-08-25 Renlin Li + + * reloc.c (BFD_RELOC_AARCH64_LD64_GOTOFF_LO15): Use LP64 instead of + ILP64. + * bfd-in2.h: Regenerate. + +2015-08-22 Alan Modra + + * elf.c (_bfd_elf_slurp_version_tables): Always init vd_nodename. + Don't copy fields not set by _bfd_elf_swap_verdef_in. + 2015-08-19 Jiong Wang * elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize new relocation diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index 6ba3641..82bf269 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -5753,7 +5753,7 @@ BFD_RELOC_AARCH64_ADR_GOTPAGE. Valid in ILP32 ABI only. */ BFD_RELOC_AARCH64_LD32_GOT_LO12_NC, /* Unsigned 15 bit byte offset for 64 bit load/store from the page of -the GOT entry for this symbol. Valid in ILP64 ABI only. */ +the GOT entry for this symbol. Valid in LP64 ABI only. */ BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, /* Scaled 14 bit byte offset to the page base of the global offset table. */ diff --git a/bfd/elf.c b/bfd/elf.c index f20679e..81cc1db 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -1833,7 +1833,15 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex) goto success; } - BFD_ASSERT (elf_onesymtab (abfd) == 0); + /* PR 18854: A binary might contain more than one symbol table. + Unusual, but possible. Warn, but continue. */ + if (elf_onesymtab (abfd) != 0) + { + (*_bfd_error_handler) + (_("%B: warning: multiple symbol tables detected - ignoring the table in section %u"), + abfd, shindex); + goto success; + } elf_onesymtab (abfd) = shindex; elf_tdata (abfd)->symtab_hdr = *hdr; elf_elfsections (abfd)[shindex] = hdr = &elf_tdata (abfd)->symtab_hdr; @@ -1898,7 +1906,15 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex) goto success; } - BFD_ASSERT (elf_dynsymtab (abfd) == 0); + /* PR 18854: A binary might contain more than one dynamic symbol table. + Unusual, but possible. Warn, but continue. */ + if (elf_dynsymtab (abfd) != 0) + { + (*_bfd_error_handler) + (_("%B: warning: multiple dynamic symbol tables detected - ignoring the table in section %u"), + abfd, shindex); + goto success; + } elf_dynsymtab (abfd) = shindex; elf_tdata (abfd)->dynsymtab_hdr = *hdr; elf_elfsections (abfd)[shindex] = hdr = &elf_tdata (abfd)->dynsymtab_hdr; @@ -7871,7 +7887,7 @@ error_return_verref: goto error_return_bad_verdef; iverdef = &iverdefarr[(iverdefmem.vd_ndx & VERSYM_VERSION) - 1]; - memcpy (iverdef, &iverdefmem, sizeof (Elf_Internal_Verdef)); + memcpy (iverdef, &iverdefmem, offsetof (Elf_Internal_Verdef, vd_bfd)); iverdef->vd_bfd = abfd; @@ -7920,6 +7936,7 @@ error_return_verref: ((bfd_byte *) everdaux + iverdaux->vda_next)); } + iverdef->vd_nodename = NULL; if (iverdef->vd_cnt) iverdef->vd_nodename = iverdef->vd_auxptr->vda_nodename; diff --git a/bfd/reloc.c b/bfd/reloc.c index 3d329a5..caa6fb4 100644 --- a/bfd/reloc.c +++ b/bfd/reloc.c @@ -6793,7 +6793,7 @@ ENUM BFD_RELOC_AARCH64_LD64_GOTOFF_LO15 ENUMDOC Unsigned 15 bit byte offset for 64 bit load/store from the page of - the GOT entry for this symbol. Valid in ILP64 ABI only. + the GOT entry for this symbol. Valid in LP64 ABI only. ENUM BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14 ENUMDOC diff --git a/bfd/version.h b/bfd/version.h index a00b9d7..c770d60 100644 --- a/bfd/version.h +++ b/bfd/version.h @@ -1,4 +1,4 @@ -#define BFD_VERSION_DATE 20150821 +#define BFD_VERSION_DATE 20150825 #define BFD_VERSION @bfd_version@ #define BFD_VERSION_STRING @bfd_version_package@ @bfd_version_string@ #define REPORT_BUGS_TO @report_bugs_to@ diff --git a/binutils/ChangeLog b/binutils/ChangeLog index caa0829..004d9a3 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,7 @@ +2015-08-24 Yaakov Selkowitz + + * configure: Regenerate. + 2015-08-17 Alan Modra * configure: Regenerate. diff --git a/binutils/configure b/binutils/configure index c47d0f8..82572e8 100755 --- a/binutils/configure +++ b/binutils/configure @@ -14135,31 +14135,6 @@ fi - am_save_CPPFLAGS="$CPPFLAGS" - - for element in $INCICONV; do - haveit= - for x in $CPPFLAGS; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - if test "X$x" = "X$element"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" - fi - done - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 $as_echo_n "checking for iconv... " >&6; } if test "${am_cv_func_iconv+set}" = set; then : @@ -14168,6 +14143,8 @@ else am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no + am_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $INCICONV" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -14187,8 +14164,49 @@ if ac_fn_c_try_link "$LINENO"; then : fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext + CPPFLAGS="$am_save_CPPFLAGS" + + if test "$am_cv_func_iconv" != yes && test -d ../libiconv; then + for _libs in .libs _libs; do + am_save_CPPFLAGS="$CPPFLAGS" + am_save_LIBS="$LIBS" + CPPFLAGS="$CPPFLAGS -I../libiconv/include" + LIBS="$LIBS ../libiconv/lib/$_libs/libiconv.a" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +int +main () +{ +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + INCICONV="-I../libiconv/include" + LIBICONV='${top_builddir}'/../libiconv/lib/$_libs/libiconv.a + LTLIBICONV='${top_builddir}'/../libiconv/lib/libiconv.la + am_cv_lib_iconv=yes + am_cv_func_iconv=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CPPFLAGS="$am_save_CPPFLAGS" + LIBS="$am_save_LIBS" + if test "$am_cv_func_iconv" = "yes"; then + break + fi + done + fi + if test "$am_cv_func_iconv" != yes; then + am_save_CPPFLAGS="$CPPFLAGS" am_save_LIBS="$LIBS" + CPPFLAGS="$LIBS $INCICONV" LIBS="$LIBS $LIBICONV" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -14210,6 +14228,7 @@ if ac_fn_c_try_link "$LINENO"; then : fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext + CPPFLAGS="$am_save_CPPFLAGS" LIBS="$am_save_LIBS" fi @@ -14222,12 +14241,34 @@ $as_echo "#define HAVE_ICONV 1" >>confdefs.h fi if test "$am_cv_lib_iconv" = yes; then + + for element in $INCICONV; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5 $as_echo_n "checking how to link with libiconv... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5 $as_echo "$LIBICONV" >&6; } else - CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi diff --git a/config/ChangeLog b/config/ChangeLog index 102fc47..6847cb9 100644 --- a/config/ChangeLog +++ b/config/ChangeLog @@ -1,3 +1,7 @@ +2015-08-24 Yaakov Selkowitz + + * iconv.m4 (AM_ICONV_LINK): Use in-tree libiconv when present. + 2015-07-27 H.J. Lu Sync with GCC diff --git a/config/iconv.m4 b/config/iconv.m4 index c5f3579..5f9304a 100644 --- a/config/iconv.m4 +++ b/config/iconv.m4 @@ -7,6 +7,7 @@ dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. dnl From Bruno Haible. +dnl with modifications to support building with in-tree libiconv AC_DEFUN([AM_ICONV_LINKFLAGS_BODY], [ @@ -28,24 +29,51 @@ AC_DEFUN([AM_ICONV_LINK], dnl accordingly. AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) - dnl Add $INCICONV to CPPFLAGS before performing the following checks, - dnl because if the user has installed libiconv and not disabled its use - dnl via --without-libiconv-prefix, he wants to use it. The first - dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed. - am_save_CPPFLAGS="$CPPFLAGS" - AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) - AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [ am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no + dnl Add $INCICONV to CPPFLAGS before performing the first check, + dnl because if the user has installed libiconv and not disabled its use + dnl via --without-libiconv-prefix, he wants to use it. This first + dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed. + am_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $INCICONV" AC_TRY_LINK([#include #include ], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);], am_cv_func_iconv=yes) + CPPFLAGS="$am_save_CPPFLAGS" + + if test "$am_cv_func_iconv" != yes && test -d ../libiconv; then + for _libs in .libs _libs; do + am_save_CPPFLAGS="$CPPFLAGS" + am_save_LIBS="$LIBS" + CPPFLAGS="$CPPFLAGS -I../libiconv/include" + LIBS="$LIBS ../libiconv/lib/$_libs/libiconv.a" + AC_TRY_LINK([#include +#include ], + [iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd);], + INCICONV="-I../libiconv/include" + LIBICONV='${top_builddir}'/../libiconv/lib/$_libs/libiconv.a + LTLIBICONV='${top_builddir}'/../libiconv/lib/libiconv.la + am_cv_lib_iconv=yes + am_cv_func_iconv=yes) + CPPFLAGS="$am_save_CPPFLAGS" + LIBS="$am_save_LIBS" + if test "$am_cv_func_iconv" = "yes"; then + break + fi + done + fi + if test "$am_cv_func_iconv" != yes; then + am_save_CPPFLAGS="$CPPFLAGS" am_save_LIBS="$LIBS" + CPPFLAGS="$LIBS $INCICONV" LIBS="$LIBS $LIBICONV" AC_TRY_LINK([#include #include ], @@ -54,6 +82,7 @@ AC_DEFUN([AM_ICONV_LINK], iconv_close(cd);], am_cv_lib_iconv=yes am_cv_func_iconv=yes) + CPPFLAGS="$am_save_CPPFLAGS" LIBS="$am_save_LIBS" fi ]) @@ -61,12 +90,10 @@ AC_DEFUN([AM_ICONV_LINK], AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.]) fi if test "$am_cv_lib_iconv" = yes; then + AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) AC_MSG_CHECKING([how to link with libiconv]) AC_MSG_RESULT([$LIBICONV]) else - dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV - dnl either. - CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi diff --git a/gas/ChangeLog b/gas/ChangeLog index 3bcd8e6..02d94ad 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2015-08-25 Jose E. Marchesi + + * config/tc-sparc.c (priv_reg_table): New privileged register + %pmcdper. + 2015-08-21 Nick Clifton PR gas/18581 diff --git a/gas/config/tc-sparc.c b/gas/config/tc-sparc.c index 6e7a3ef..28e6ec8 100644 --- a/gas/config/tc-sparc.c +++ b/gas/config/tc-sparc.c @@ -805,6 +805,7 @@ struct priv_reg_entry priv_reg_table[] = {"wstate", 14}, {"fq", 15}, {"gl", 16}, + {"pmcdper", 23}, {"ver", 31}, {"", -1}, /* End marker. */ }; diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 2951966..f6f8b37 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,24 @@ +2015-08-25 Jose E. Marchesi + + * gas/sparc/wrpr.s: Test writing to the privileged %pmcdper + register. + * gas/sparc/wrpr.d: ...and the expected result. + * gas/sparc/rdpr.s: Test reading from the privileged %pmcdper + register. + * gas/sparc/rdpr.d: ...and the expected result. + +2015-08-25 Simon Dardis + + * gas/mips/micromips32-move.d: Update expected disassembly. + * gas/mips/move.d: Likewise. + * gas/mips/move.s: Fix for some MIPS configurations. + +2015-08-24 Jan Stancek + + * gas/i386/intel.s: Add test of disassembly of a potential + three byte instuction at the end of a function. + * gas/i386/intel.d: Update expected disassembly. + 2015-08-21 Nick Clifton PR gas/18581 diff --git a/gas/testsuite/gas/i386/intel.d b/gas/testsuite/gas/i386/intel.d index 45a66a5..d10b4f0 100644 --- a/gas/testsuite/gas/i386/intel.d +++ b/gas/testsuite/gas/i386/intel.d @@ -698,4 +698,8 @@ Disassembly of section .text: [ ]*[a-f0-9]+: 0f 4b 90 90 90 90 90 cmovnp -0x6f6f6f70\(%eax\),%edx [ ]*[a-f0-9]+: 66 0f 4a 90 90 90 90 90 cmovp -0x6f6f6f70\(%eax\),%dx [ ]*[a-f0-9]+: 66 0f 4b 90 90 90 90 90 cmovnp -0x6f6f6f70\(%eax\),%dx +[ ]*[a-f0-9]+: 24 2f and \$0x2f,%al +[ ]*[a-f0-9]+: 0f \.byte 0xf +[a-f0-9]+ : +[ ]*[a-f0-9]+: 0f ba e2 03 bt \$0x3,%edx #pass diff --git a/gas/testsuite/gas/i386/intel.s b/gas/testsuite/gas/i386/intel.s index a3a07b3..045d6ae 100644 --- a/gas/testsuite/gas/i386/intel.s +++ b/gas/testsuite/gas/i386/intel.s @@ -698,3 +698,14 @@ fidivr dword ptr [ebx] cmovpo edx, 0x90909090[eax] cmovpe dx, 0x90909090[eax] cmovpo dx, 0x90909090[eax] + + # Test that disassembly of a partial instruction shows the partial byte: + # https://www.sourceware.org/ml/binutils/2015-08/msg00226.html + .byte 0x24 + .byte 0x2f + .byte 0x0f +barn: + .byte 0x0f + .byte 0xba + .byte 0xe2 + .byte 0x03 diff --git a/gas/testsuite/gas/mips/micromips32-move.d b/gas/testsuite/gas/mips/micromips32-move.d index 1a30f06..b13d927 100644 --- a/gas/testsuite/gas/mips/micromips32-move.d +++ b/gas/testsuite/gas/mips/micromips32-move.d @@ -1,4 +1,4 @@ -#objdump: -dr -m mips:micromips +#objdump: -dr -m mips:micromips -M reg-names=numeric #name: microMIPS insn32 move test #source: micromips32-move.s @@ -8,7 +8,7 @@ Disassembly of section .text: 0+ <.*>: - 0: 001f 6a90 move t5,ra - 4: 001f 6950 move t5,ra - 8: 581f 6950 move t5,ra - c: 001f 6a90 move t5,ra + 0: 001f 6a90 move \$13,\$31 + 4: 001f 6950 move \$13,\$31 + 8: 581f 6950 move \$13,\$31 + c: 001f 6a90 move \$13,\$31 diff --git a/gas/testsuite/gas/mips/move.d b/gas/testsuite/gas/mips/move.d index aa978ea..28a9673 100644 --- a/gas/testsuite/gas/mips/move.d +++ b/gas/testsuite/gas/mips/move.d @@ -1,4 +1,4 @@ -#objdump: -dr +#objdump: -dr -M reg-names=numeric #name: MIPS move disassembly test #source: move.s @@ -8,7 +8,7 @@ Disassembly of section .text: 0+ <.*>: - 0: 03e06825 move t5,ra - 4: 03e06821 move t5,ra - 8: 03e0682d move t5,ra - c: 03e06825 move t5,ra + 0: 03e08025 move \$16,\$31 + 4: 03e08021 move \$16,\$31 hooks/post-receive -- Repository for Project Archer.