summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* bfd/ChangeLogsergiodj2013-10-092-17/+69
| | | | | | | | 2013-10-09 Sergio Durigan Junior <sergiodj@redhat.com> PR binutils/15993 * elf32-m32c.c (dump_symtab): Add missing "break;" statement on each "case". Reindent "switch" statements.
* daily updateAlan Modra2013-10-081-1/+1
|
* fix PR symtab/15597Tom Tromey2013-10-0812-155/+530
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes gdb PR symtab/15597. The bug is that the .gnu_debugaltlink section includes the build-id of the alt file, but gdb does not use it. This patch fixes the problem by changing gdb to do what it ought to always have done: verify the build id of the file found using the filename in .gnu_debugaltlink; and if that does not match, try to find the correct debug file using the build-id and debug-file-directory. This patch touches BFD. Previously, gdb had its own code for parsing .gnu_debugaltlink; I changed it to use the BFD functions after those were introduced. However, the BFD functions are incorrect -- they assume that .gnu_debugaltlink is formatted like .gnu_debuglink. However, it it is not. Instead, it consists of a file name followed by the build-id -- no alignment, and the build-id is not a CRC. Fixing this properly is a bit of a pain. But, because separate_alt_debug_file_exists just has a FIXME for the build-id case, I did not fix it properly. Instead I introduced a hack. This leaves BFD working just as well as it did before my patch. I'm willing to do something better here but I could use some guidance as to what. It seems that the build-id code in BFD is largely punted on. FWIW gdb is the only user of bfd_get_alt_debug_link_info outside of BFD itself. I moved the build-id logic out of elfread.c and into a new file. This seemed cleanest to me. Writing a test case was a bit of a pain. I added a couple new features to the DWARF assembler to handle this. Built and regtested on x86-64 Fedora 18. * bfd-in2.h: Rebuild. * opncls.c (bfd_get_alt_debug_link_info): Add buildid_len parameter. Change type of buildid_out. Update. (get_alt_debug_link_info_shim): New function. (bfd_follow_gnu_debuglink): Use it. * Makefile.in (SFILES): Add build-id.c. (HFILES_NO_SRCDIR): Add build-id.h. * build-id.c: New file, largely from elfread.c. Modified most functions. * build-id.h: New file. * dwarf2read.c (dwarf2_get_dwz_file): Update for change to bfd_get_alt_debug_link_info. Verify dwz file's build-id. Search for dwz file using build-id. * elfread.c (build_id_bfd_get, build_id_verify) (build_id_to_debug_filename, find_separate_debug_file): Remove. * gdb.dwarf2/dwzbuildid.exp: New file. * lib/dwarf.exp (Dwarf::_section): Add "flags" and "type" parameters. (Dwarf::_defer_output): Change "section" parameter to "section_spec"; update. (Dwarf::gnu_debugaltlink, Dwarf::_note, Dwarf::build_id): New procs.
* * elf32-m68k.c (elf_m68k_size_dynamic_sections): Add DT_DEBUG alsoAndreas Schwab2013-10-082-2/+7
| | | | for PIE executables.
* opcodes/Jan Beulich2013-10-083-26/+33
| | | | | | | | | 2013-10-08 Jan Beulich <jbeulich@suse.com> * i386-opc.tbl (invlpg): Use Anysize instead of Unspecified. (clflush): Use Anysize instead of Byte|Unspecified. (prefetch*): Likewise. * i386-tbl.h: Re-generate.
* 2013-10-08 Jan-Benedict Glaw <jbglaw@lug-owl.de>Jan-Benedict Glaw2013-10-083-2/+7
| | | | | * configure.ac: Update from GCC. * configure: Regenerate.
* [Ada] psymbol search failure due to comparison function discrepancyJoel Brobecker2013-10-082-7/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Upon trying to print the value of a variant record, a user noticed the following problem: (gdb) print rt warning: Unknown upper bound, using 1. warning: Unknown upper bound, using 1. $1 = (a => ((a1 => (4), a2 => (4)), (a1 => (8), a2 => (8)))) The expected output is: (gdb) print rt $1 = (a => ((a1 => (4, 4), a2 => (8, 8)), (a1 => (4, 4), a2 => (8, 8)))) The problems comes from the fact that components "a1" and "a2" are defined as arrays whose upper bound is dynamic. To determine the value of that upper bound, GDB relies on the GNAT encoding and searches for the parallel ___U variable. Unfortunately, the search fails while doing a binary search inside the partial symtab of the unit where the array and its bound (and therefore the parallel ___U variable) are defined. It fails because partial symbols are sorted using strcmp_iw_ordered, while Ada symbol lookups are performed using a different comparison function (ada-lang.c:compare_names). The two functions are supposed to be compatible, but a change performed in April 2011 modified strcmp_iw_ordered, introducing case-sensitivity issues. As a result, the two functions would now disagree when passed the following two arguments: string1="common__inner_arr___SIZE_A_UNIT" string2="common__inner_arr__T4s___U" The difference starts at "_SIZE_A_UNIT" vs "T4s___U". So, it's mostly a matter of comparing '_' with 'T'. On the one hand, strcmp_iw_ordered would return -1, while compare_names returned 11. The change that made all the difference is that strcmp_iw_ordered now performs a case-insensitive comparison, and only resorts to case-sentitive comparison if the first comparison finds an equality. This changes everything, because while 'T' (84) and 't' (116) are on opposite sides of '_' (95). This patch aims at restoring the compatibility between the two functions, by adding case-sensitivity handling in the Ada comparison function. gdb/ChangeLog: * ada-lang.c (compare_names_with_case): Renamed from compare_names, adding a new parameter "casing" and its handling. New function documentation. (compare_names): New function, implemented using compare_names_with_case.
* Add missing ChangeLog entry.Joel Brobecker2013-10-081-0/+4
|
* [Ada] Remove unnecessary ada_exception_sal advance declaration.Joel Brobecker2013-10-081-3/+0
| | | | | | gdb/ChangeLog: * ada-lang.c (ada_exception_sal): Remove advance declaration.
* gdb.ada/mi_catch_ex.exp: Make test names unique.Joel Brobecker2013-10-082-4/+8
| | | | | | gdb/testsuite/ChangeLog: * gdb.ada/mi_catch_ex.exp: Make "mi_execute_to" test names unique.
* daily updateAlan Modra2013-10-071-1/+1
|
* move the demangled_names_hash into the per-BFDTom Tromey2013-10-075-24/+34
| | | | | | | | | | | | | | | | | | | | | | | This moves the demangled_names_hash from the objfile into the per-BFD object. This is part of the objfile splitting project. The demangled names hash is independent of the program space. And, it is needed by the symbol tables. Both of these things indicate that it must be pushed into the per-BFD object, which this patch does. Built and regtested on x86-64 Fedora 18. * objfiles.c (free_objfile_per_bfd_storage): Delete the demangled_names_hash. (free_objfile): Don't delete the demangled_names_hash. * objfiles.h (struct objfile_per_bfd_storage) <demangled_names_hash>: New field. (struct objfile) <demangled_names_hash>: Move to objfile_per_bfd_storage. * symfile.c (reread_symbols): Don't delete the demangled_names_hash. * symtab.c (create_demangled_names_hash): Update. (symbol_set_names): Update.
* don't share per-BFD data if relocations are neededTom Tromey2013-10-074-4/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | Right now we always share per-BFD data across objfiles, if there is a BFD. This works fine. However, we're going to start sharing more data, and sometimes this data will come directly from sections of the BFD. If such a section has SEC_RELOC set, then the data coming from that section will not be truly sharable -- the section will be program-space-dependent, and re-read by gdb for each objfile. This patch disallows per-BFD sharing in this case. This is a bit "heavy" in that we could in theory examine each bit of shared data for suitability. However, that is more complicated, and SEC_RELOC is rare enough that I think we needn't bother. Note that the "no sharing" case is equivalent to "gdb works as it historically did". That is, the sharing is a new(-ish) optimization. Built and regtested on x86-64 Fedora 18. * gdb_bfd.c (struct gdb_bfd_data) <relocation_computed, needs_relocations>: New fields. (gdb_bfd_requires_relocations): New function. * gdb_bfd.h (gdb_bfd_requires_relocations): Declare. * objfiles.c (get_objfile_bfd_data): Disallow sharing if the BFD needs relocations applied.
* * lib/mi-support.exp (varobj_tree::walk_tree): Set _root_idxTom Tromey2013-10-072-0/+8
| | | | to 0.
* 2013-10-07 Chao-ying Fu <Chao-ying.Fu@imgtec.com>Chao-ying Fu2013-10-072-4/+8
| | | | * micromips-opc.c (micromips_opcodes): Fix dmfgc0 and dmtgc0.
* [DOC] Mention what happens when the thread of a thread-specific breakpoint ↵Pedro Alves2013-10-072-0/+24
| | | | | | | | | | | | | | | disappears. We recently made GDB auto-delete thread-specific breakpoints when the corresponding thread is removed from the thread list, but we hadn't mentioned it in the manual. gdb/ 2013-10-07 Pedro Alves <palves@redhat.com> PR breakpoints/11568 * gdb.texinfo (Thread-Specific Breakpoints): Mention what happens when the thread is removed from the thread list.
* Thread-specific breakpoints: say "no longer in the thread list" instead of ↵Pedro Alves2013-10-072-1/+7
| | | | | | | | | | | | | | | "gone". It seems "gone" may confuse people, while that was exactly what it was trying to avoid. Switch to saying "no longer in the thread list", which is really the predicate GDB uses. gdb/ 2013-10-07 Pedro Alves <palves@redhat.com> PR breakpoints/11568 * breakpoint.c (remove_threaded_breakpoints): Say "no longer in the thread list" instead of "gone".
* This patch adds a new convenience variable called "$_exitsignal", whichsergiodj2013-10-0712-3/+308
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | will hold the signal number when the inferior terminates due to the uncaught signal. I've made modifications on infrun.c:handle_inferior_event such that $_exitcode gets cleared when the inferior signalled, and vice-versa. This assumption was made because the variables are mutually exclusive, i.e., when the inferior terminates because of an uncaught signal it is not possible for it to return. I have also made modifications such that when a corefile is loaded, $_exitsignal gets set to the uncaught signal that "killed" the inferior, and $_exitcode is cleared. The patch also adds a NEWS entry, documentation bits, and a testcase. The documentation entry explains how to use $_exitsignal and $_exitcode in a GDB script, by making use of the new $_isvoid convenience function. gdb/ 2013-10-06 Sergio Durigan Junior <sergiodj@redhat.com> * NEWS: Mention new convenience variable $_exitsignal. * corelow.c (core_open): Reset exit convenience variables. Set $_exitsignal to the uncaught signal which generated the corefile. * infrun.c (handle_inferior_event): Reset exit convenience variables. Set $_exitsignal for TARGET_WAITKIND_SIGNALLED. (clear_exit_convenience_vars): New function. * inferior.h (clear_exit_convenience_vars): New prototype. gdb/testsuite/ 2013-10-06 Sergio Durigan Junior <sergiodj@redhat.com> * gdb.base/corefile.exp: Test whether $_exitsignal is set and $_exitcode is void when opening a corefile. * gdb.base/exitsignal.exp: New file. * gdb.base/segv.c: Likewise. * gdb.base/normal.c: Likewise. gdb/doc/ 2013-10-06 Sergio Durigan Junior <sergiodj@redhat.com> * gdb.texinfo (Convenience Variables): Document $_exitsignal. Update entry for $_exitcode.
* daily updateAlan Modra2013-10-061-1/+1
|
* gdb/qiyao2013-10-062-1/+6
| | | | * varobj.h: Add comments to enum varobj_languages.
* daily updateAlan Modra2013-10-051-1/+1
|
* (dwarf2_section_info): Comment tweaks missed in previous checkin.Doug Evans2013-10-051-2/+2
|
* Add support for DWP file format version 2.Doug Evans2013-10-053-118/+802
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * NEWS: Mention support for DWP file format version 2. * dwarf2read.c (dwarf2_section_info): Convert asection field to a union of asection, containing_section. New fields virtual_offset and is_virtual. Change type of readin filed from int to char. (dwo_sections, dwo_file): Tweak comments. (dwp_v2_section_ids): New enum. (dwp_sections): New fields abbrev, info, line, loc, macinfo, macro, str_offsets, types. (virtual_v1_dwo_sections): Renamed from virtual_dwo_sections. All uses updated. (virtual_v2_dwo_sections): New struct. (dwp_hash_table): New fields version, nr_columns. Change type of section_pool field to a union. (dwp_file): New field version. (dwarf2_has_info): Check for virtual sections. (get_containing_section): New function. (get_section_bfd_owner, get_section_bfd_section): Call it. (dwarf2_locate_sections): Update. (dwarf2_section_empty_p): Update. (dwarf2_read_section): Handle virtual sections. (locate_dwz_sections): Update. (create_dwp_hash_table): Document and handle V2 format. (locate_v1_virtual_dwo_sections): Renamed from locate_virtual_dwo_sections and update. All callers updated. (create_dwo_unit_in_dwp_v1): Renamed from create_dwo_in_dwp. Delete arg htab. Rename arg section_index to unit_index. All callers updated. (MAX_NR_V1_DWO_SECTIONS): Renamed from MAX_NR_DWO_SECTIONS. All uses updated. (create_dwp_v2_section, create_dwo_unit_in_dwp_v2): New functions. (lookup_dwo_unit_in_dwp): Add V2 support. (dwarf2_locate_dwo_sections): Update. (dwarf2_locate_common_dwp_sections): Renamed from dwarf2_locate_dwp_sections and update. All callers updated. (dwarf2_locate_v2_dwp_sections): New function. (open_and_init_dwp_file): Add V2 support. (read_str_index): New locals str_section, str_offsets_section.
* daily updateAlan Modra2013-10-051-1/+1
|
* Clean up ptid.h/ptid.c.Pedro Alves2013-10-043-49/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ptid_t contructors, accessors and predicates are documented in _three_ places, and each place uses a different wording. E.g, the descriptions in the .c file of the new ptid_lwp_p, ptid_tid_p weren't updated in the final revision like the descriptions in the .h file were. Clearly, switching to a style that has a single central description avoids such issues. Worse, some of the existing descriptions are plain wrong, such as: /* Attempt to find and return an existing ptid with the given PID, LWP, and TID components. If none exists, create a new one and return that. */ ptid_t ptid_build (int pid, long lwp, long tid); The function does nothing that complicated. It's just a simple constructor. So this gets rid of all the unnecessary descriptions, leaving only the ones near the function declarations in the header file, and fixes/clarifies those that remain. gdb/ 2013-10-04 Pedro Alves <palves@redhat.com> * common/ptid.c (null_ptid, minus_one_ptid, ptid_build) (pid_to_ptid, ptid_get_pid, ptid_get_lwp, ptid_get_tid) (ptid_equal, ptid_is_pid, ptid_lwp_p, ptid_tid_p): Replace describing comments with references to ptid.h. * common/ptid.h: Remove intro description of constructors, accessors and predicates. (struct ptid): Reformat. (minus_one_ptid, ptid_build, pid_to_ptid, ptid_get_pid) (ptid_get_lwp, ptid_get_tid, ptid_equal, ptid_is_pid): Change describing comments.
* Fix syntax error in aix-thread.c:sync_threadlistsJoel Brobecker2013-10-042-1/+6
| | | | | | | | | | This patch fixes a small typo after the BUILD_THREAD -> ptid_build conversion. gdb/ChangeLog: * aix-thread.c (sync_threadlists): Add missing ')' in call to ptid_build.
* Fix build failure in procfs.c after MERGEPID -> ptid_build conversion.Joel Brobecker2013-10-042-1/+6
| | | | | | | gdb/ChangeLog: * procfs.c (procfs_init_inferior): Fix typo causing the build to fail.
* Remove unnecessary cast in aix-thread.c:ptrace32.Joel Brobecker2013-10-042-1/+5
| | | | | | | | | We're casting "addr" into "addr_ptr", but this variable is actually a parameter with that very same type... gdb/ChangeLog: * aix-thread.c (ptrace32): Remove cast to addr_ptr.
* Add support for --start option in -exec-run GDB/MI command.Joel Brobecker2013-10-048-5/+151
| | | | | | | | | | | | | | | | | | | | gdb/ChangeLog: * mi/mi-main.c (run_one_inferior): Add function description. Make ARG a pointer to an integer whose value determines whether we should "run" or "start" the program. (mi_cmd_exec_run): Add handling of the "--start" option. Reject all other command-line options. * NEWS: Add entry for "-exec-run"'s new "--start" option. gdb/doc/ChangeLog: * gdb.texinfo (GDB/MI Program Execution): Document "-exec-run"'s new "--start" option. gdb/testsuite/ChangeLog: * gdb.mi/mi-start.c, gdb.mi/mi-start.exp: New files.
* Move pending_event to remote_notif_state.qiyao2013-10-044-47/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch moves pending_event to remote_notif_state. All pending events are destroyed in remote_notif_state_xfree. However, discard_pending_stop_replies release pending event too, so the pending event of stop notification is released twice, we need some refactor here. We add a new function discard_pending_stop_replies_in_queue which only discard events in stop_reply_queue, and let remote_notif_state_xfree release pending event for all notif_client. After this change, discard_pending_stop_replies is only attached to ifnerior_exit observer, so the INF can't be NULL any more. The NULL checking is removed too. gdb: 2013-10-04 Yao Qi <yao@codesourcery.com> * remote-notif.h (REMOTE_NOTIF_ID): New enum. (struct notif_client) <pending_event>: Moved to struct remote_notif_state. <id>: New field. (struct remote_notif_state) <pending_event>: New field. (notif_event_xfree): Declare. * remote-notif.c (handle_notification): Adjust. (notif_event_xfree): New function. (do_notif_event_xfree): Call notif_event_xfree. (remote_notif_state_xfree): Call notif_event_xfree to free each element in field pending_event. * remote.c (discard_pending_stop_replies): Remove declaration. (discard_pending_stop_replies_in_queue): Declare. (remote_close): Call discard_pending_stop_replies_in_queue instead of discard_pending_stop_replies. (remote_start_remote): Adjust. (stop_reply_xfree): Call notif_event_xfree. (notif_client_stop): Adjust initialization. (remote_notif_remove_all): Rename it to ... (remove_stop_reply_for_inferior): ... this. Update comments. Don't check INF is NULL. (discard_pending_stop_replies): Return early if notif_state is NULL. Adjust. Don't check INF is NULL. (remote_notif_get_pending_events): Adjust. (discard_pending_stop_replies_in_queue): New function. (remote_wait_ns): Likewise.
* Move notif_queue and remote_async_get_pending_events_token to remote_stateqiyao2013-10-044-57/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch also removes notif_xfree, and don't pass it QUEUE_alloc, because we don't have to free notif_client when the remote_notif_state is freed. gdb: 2013-10-04 Yao Qi <yao@codesourcery.com> * remote-notif.c (DECLARE_QUEUE_P): Remove. (notif_queue): Remove. (remote_notif_process): Add one parameter 'notif_queue'. Update comments. Callers update. (remote_async_get_pending_events_token): Remove. (remote_notif_register_async_event_handler): Remove. (remote_notif_unregister_async_event_handler): Remove. (handle_notification): Add parameter 'notif_queue'. Update comments. Callers update. (notif_xfree): Remove. (remote_notif_state_allocate): New function. (remote_notif_state_xfree): New function. (_initialize_notif): Remove code to allocate queue. * remote-notif.h (DECLARE_QUEUE_P): Moved from remote-notif.c. (struct remote_notif_state): New. (handle_notification): Update declaration. (remote_notif_process): Likewise. (remote_notif_register_async_event_handler): Remove. (remote_notif_unregister_async_event_handler): Remove. (remote_notif_state_allocate): Declare. (remote_notif_state_xfree): Declare. * remote.c (struct remote_state) <notif_state>: New field. (remote_close): Don't call remote_notif_unregister_async_event_handler. Call remote_notif_state_xfree. (remote_open_1): Don't call remote_notif_register_async_event_handler. Call remote_notif_state_allocate.
* Fix FIXME: xstrdup should not be hereqiyao2013-10-042-9/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hi, This FIXME goes into my eyes, when I am about to modify something here, /* Name is allocated by name_of_child. */ /* FIXME: xstrdup should not be here. */ This FIXME was introduced in the python pretty-pretter patches. Python pretty-printing [6/6] https://sourceware.org/ml/gdb-patches/2009-05/msg00467.html create_child_with_value is called in two paths, 1. varobj_list_children -> create_child -> create_child_with_value, 2. install_dynamic_child -> install_dynamic_child -> varobj_add_child -> create_child_with_value In path #1, 'name' is allocated by name_of_child, as the original comment said, we don't have to duplicate NAME in create_child_with_value. In path #2, 'name' is got from PyArg_ParseTuple, and we have to duplicate NAME. This patch removes the call to xstrdup in create_child_with_value and call xstrudp in update_dynamic_varobj_children (path #2). gdb: 2013-10-04 Yao Qi <yao@codesourcery.com> * varobj.c (create_child_with_value): Remove 'const' from the type of parameter 'name'. (varobj_add_child): Likewise. (install_dynamic_child): Remove 'const' from the type of parameter 'name'. (varobj_add_child): Likewise. (create_child_with_value): Likewise. Update comments. Don't duplicate 'name'. (update_dynamic_varobj_children): Duplicate 'name' and pass it to install_dynamic_child.
* daily updateAlan Modra2013-10-041-1/+1
|
* 2013-10-04 Jan-Benedict Glaw <jbglaw@lug-owl.de>Jan-Benedict Glaw2013-10-032-4/+8
| | | | * configure: Regenerate.
* aarch64: Add support for GNU indirect functions.willnewton2013-10-033-70/+643
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for STT_GNU_IFUNC symbols to the AArch64 bfd backend. The tests are ported from the ld-ifunc tests but are enabled for cross builds so can be run easily without hardware or a simulator. bfd/ChangeLog: 2013-10-03 Will Newton <will.newton@linaro.org> * configure: Regenerate. * configure.in: Build elf-ifunc.o for AArch64. * elfnn-aarch64.c: Include objalloc.h. (elfNN_aarch64_local_htab_hash): New function. (elfNN_aarch64_local_htab_eq): New function. (elfNN_aarch64_get_local_sym_hash): New function. (elfNN_aarch64_link_hash_table_create): Initialize local STT_GNU_IFUNC symbol hash. (elfNN_aarch64_hash_table_free): Free local STT_GNU_IFUNC symbol hash. (elfNN_aarch64_final_link_relocate): Add sym argument. Add support for handling STT_GNU_IFUNC symbols. (elfNN_aarch64_gc_sweep_hook): Add support for garbage collecting references to STT_GNU_IFUNC symbols. (elfNN_aarch64_adjust_dynamic_symbol): Add support for handling STT_GNU_IFUNC symbols. (elfNN_aarch64_check_relocs): Add support for handling STT_GNU_IFUNC symbols. Ensure we don't increase plt.refcount from -1 to 0. (elfNN_aarch64_post_process_headers): Call _bfd_elf_set_osabi. (elfNN_aarch64_is_function_type): Remove function. (elfNN_aarch64_allocate_dynrelocs): Handle STT_GNU_IFUNC symbols. (elfNN_aarch64_allocate_ifunc_dynrelocs): New function. (elfNN_aarch64_allocate_local_dynrelocs): New function. (elfNN_aarch64_allocate_local_ifunc_dynrelocs): New function. (elfNN_aarch64_size_dynamic_sections): Call elfNN_aarch64_allocate_local_dynrelocs. (elfNN_aarch64_create_small_pltn_entry): Add info argument. Add support for creating .iplt entries for STT_GNU_IFUNC symbols. (elfNN_aarch64_finish_dynamic_symbol): Add support for handling STT_GNU_IFUNC symbols and .iplt. (elfNN_aarch64_finish_local_dynamic_symbol): New function. (elfNN_aarch64_finish_dynamic_sections): Call elfNN_aarch64_finish_local_dynamic_symbol. ld/ChangeLog: 2013-10-03 Will Newton <will.newton@linaro.org> * emulparams/aarch64elf.sh: Add IREL_IN_PLT. * emulparams/aarch64elf32.sh: Likewise. ld/testsuite/ChangeLog: 2013-10-03 Will Newton <will.newton@linaro.org> * ld-ifunc/ifunc.exp: Enable ifunc tests for AArch64. * ld-aarch64/aarch64-elf.exp: Run ifunc tests. * ld-aarch64/ifunc-1-local.d: New file. * ld-aarch64/ifunc-1-local.s: Likewise. * ld-aarch64/ifunc-1.d: Likewise. * ld-aarch64/ifunc-1.s: Likewise. * ld-aarch64/ifunc-10.d: Likewise. * ld-aarch64/ifunc-10.s: Likewise. * ld-aarch64/ifunc-11.d: Likewise. * ld-aarch64/ifunc-11.s: Likewise. * ld-aarch64/ifunc-12.d: Likewise. * ld-aarch64/ifunc-12.s: Likewise. * ld-aarch64/ifunc-13.d: Likewise. * ld-aarch64/ifunc-13a.s: Likewise. * ld-aarch64/ifunc-13b.s: Likewise. * ld-aarch64/ifunc-14a.d: Likewise. * ld-aarch64/ifunc-14a.s: Likewise. * ld-aarch64/ifunc-14b.d: Likewise. * ld-aarch64/ifunc-14b.s: Likewise. * ld-aarch64/ifunc-14c.d: Likewise. * ld-aarch64/ifunc-14c.s: Likewise. * ld-aarch64/ifunc-14d.d: Likewise. * ld-aarch64/ifunc-14e.d: Likewise. * ld-aarch64/ifunc-14f.d: Likewise. * ld-aarch64/ifunc-15.d: Likewise. * ld-aarch64/ifunc-15.s: Likewise. * ld-aarch64/ifunc-16.d: Likewise. * ld-aarch64/ifunc-16.s: Likewise. * ld-aarch64/ifunc-17a.d: Likewise. * ld-aarch64/ifunc-17a.s: Likewise. * ld-aarch64/ifunc-17b.d: Likewise. * ld-aarch64/ifunc-17b.s: Likewise. * ld-aarch64/ifunc-18a.d: Likewise. * ld-aarch64/ifunc-18a.s: Likewise. * ld-aarch64/ifunc-18b.d: Likewise. * ld-aarch64/ifunc-18b.s: Likewise. * ld-aarch64/ifunc-19a.d: Likewise. * ld-aarch64/ifunc-19a.s: Likewise. * ld-aarch64/ifunc-19b.d: Likewise. * ld-aarch64/ifunc-19b.s: Likewise. * ld-aarch64/ifunc-2-local.d: Likewise. * ld-aarch64/ifunc-2-local.s: Likewise. * ld-aarch64/ifunc-2.d: Likewise. * ld-aarch64/ifunc-2.s: Likewise. * ld-aarch64/ifunc-20.d: Likewise. * ld-aarch64/ifunc-20.s: Likewise. * ld-aarch64/ifunc-3.s: Likewise. * ld-aarch64/ifunc-3a.d: Likewise. * ld-aarch64/ifunc-3b.d: Likewise. * ld-aarch64/ifunc-4.d: Likewise. * ld-aarch64/ifunc-4.s: Likewise. * ld-aarch64/ifunc-4a.d: Likewise. * ld-aarch64/ifunc-5-local.s: Likewise. * ld-aarch64/ifunc-5.s: Likewise. * ld-aarch64/ifunc-5a-local.d: Likewise. * ld-aarch64/ifunc-5a.d: Likewise. * ld-aarch64/ifunc-5b-local.d: Likewise. * ld-aarch64/ifunc-5b.d: Likewise. * ld-aarch64/ifunc-5r-local.d: Likewise. * ld-aarch64/ifunc-6.s: Likewise. * ld-aarch64/ifunc-6a.d: Likewise. * ld-aarch64/ifunc-6b.d: Likewise. * ld-aarch64/ifunc-7.s: Likewise. * ld-aarch64/ifunc-7a.d: Likewise. * ld-aarch64/ifunc-7b.d: Likewise. * ld-aarch64/ifunc-7c.d: Likewise. * ld-aarch64/ifunc-8.d: Likewise. * ld-aarch64/ifunc-8a.s: Likewise. * ld-aarch64/ifunc-8b.s: Likewise. * ld-aarch64/ifunc-9.d: Likewise. * ld-aarch64/ifunc-9.s: Likewise.
* 2013-10-03 Phil Muldoon <pmuldoon@redhat.com>pmuldoon2013-10-033-7/+29
| | | | | | | | * python/py-value.c (convert_value_from_python): Move PyInt_Check conversion logic to occur after PyLong_Check. Comment on order change significance. * python/py-arch.c (archpy_disassemble): Comment on order of conversion for integers and longs.
* Always run the PTRACE_O_TRACESYSGOOD tests even if PTRACE_O_TRACEFORK is not ↵Pedro Alves2013-10-032-37/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | supported. If enabling PTRACE_O_TRACEFORK fails, we never test for PTRACE_O_TRACESYSGOOD support. Before PTRACE_O_TRACESYSGOOD is checked, we have: /* First, set the PTRACE_O_TRACEFORK option. If this fails, we know for sure that it is not supported. */ ret = ptrace (PTRACE_SETOPTIONS, child_pid, (PTRACE_TYPE_ARG3) 0, (PTRACE_TYPE_ARG4) PTRACE_O_TRACEFORK); if (ret != 0) { ret = ptrace (PTRACE_KILL, child_pid, (PTRACE_TYPE_ARG3) 0, (PTRACE_TYPE_ARG4) 0); if (ret != 0) { warning (_("linux_check_ptrace_features: failed to kill child")); return; } ret = my_waitpid (child_pid, &status, 0); if (ret != child_pid) warning (_("linux_check_ptrace_features: failed " "to wait for killed child")); else if (!WIFSIGNALED (status)) warning (_("linux_check_ptrace_features: unexpected " "wait status 0x%x from killed child"), status); return; <<<<<<<<<<<<<<<<< } Note that early return. If PTRACE_O_TRACEFORK isn't supported, we're not checking PTRACE_O_TRACESYSGOOD. This didn't use to be a problem before the unification of this whole detection business in linux-ptrace.c. Before, the sysgood detection was completely separate: static void linux_test_for_tracesysgood (int original_pid) { int ret; sigset_t prev_mask; /* We don't want those ptrace calls to be interrupted. */ block_child_signals (&prev_mask); linux_supports_tracesysgood_flag = 0; ret = ptrace (PTRACE_SETOPTIONS, original_pid, 0, PTRACE_O_TRACESYSGOOD); if (ret != 0) goto out; linux_supports_tracesysgood_flag = 1; out: restore_child_signals_mask (&prev_mask); } So we need to get back the decoupling somehow. I think it's cleaner to split the seperate feature detections to separate functions. This patch does that. The new functions are named for their counterparts that existed before this code was moved to linux-ptrace.c. Note I've used forward declarations for the new functions to make the patch clearer, as otherwise the patch would look like I'd be adding a bunch of new code. A reorder can be done in a follow up patch. Tested on x86_64 Fedora 17. gdb/ 2013-10-03 Pedro Alves <palves@redhat.com> * common/linux-ptrace.c (linux_check_ptrace_features): Factor out the PTRACE_O_TRACESYSGOOD and PTRACE_O_TRACEFORK to separate functions. Always test for PTRACE_O_TRACESYSGOOD even if PTRACE_O_TRACEFORK is not supported. (linux_test_for_tracesysgood): New function. (linux_test_for_tracefork): New function, factored out from linux_check_ptrace_features, and also don't kill child_pid here.
* 2013-10-03 Tristan Gingold <gingold@adacore.com>Tristan Gingold2013-10-032-30/+19
| | | | | | | | | * i386-darwin-nat.c (i386_darwin_dr_set): Fix argument type. Remove verbose error reporting. Use detected state to thread_set_state call. (i386_darwin_dr_get): Fix return type. Remove verbose error report. Remove trailing spaces.
* daily updateAlan Modra2013-10-031-1/+1
|
* gdb/testsuite/yufeng2013-10-022-1/+12
| | | | | * gdb.trace/entry-values.exp: Modify regular expression to scan for 'bl' instruction instead of 'call' for ARM and AArch64 targets.
* Print registers not saved in the frame as "<not saved>" instead of ↵Pedro Alves2013-10-0219-30/+154
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "<optimized out>". Currently, in some scenarios, GDB prints <optimized out> when printing outer frame registers. An <optimized out> register is a confusing concept. What this really means is that the register is call-clobbered, or IOW, not saved by the callee. This patch makes GDB say that instead. Before patch: (gdb) p/x $rax $1 = <optimized out> (gdb) info registers rax rax <optimized out> After patch: (gdb) p/x $rax $1 = <not saved> (gdb) info registers rax rax <not saved> However, if for some reason the debug info describes a variable as being in such a register (**), we still want to print <optimized out> when printing the variable. IOW, <not saved> is reserved for inspecting registers at the machine level. The patch uses lval_register+optimized_out to encode the not saved registers, and makes it so that optimized out variables always end up in !lval_register values. ** See <https://sourceware.org/ml/gdb-patches/2012-08/msg00787.html>. Current/recent enough GCC doesn't mark variables/arguments as being in call-clobbered registers in the ranges corresponding to function calls, while older GCCs did. Newer GCCs will just not say where the variable is, so GDB will end up realizing the variable is optimized out. frame_unwind_got_optimized creates not_lval optimized out registers, so by default, in most cases, we'll see <optimized out>. value_of_register is the function eval.c uses for evaluating OP_REGISTER (again, $pc, etc.), and related bits. It isn't used for anything else. This function makes sure to return lval_register values. The patch makes "info registers" and the MI equivalent use it too. I think it just makes a lot of sense, as this makes it so that when printing machine registers ($pc, etc.), we go through a central function. We're likely to need a different encoding at some point, if/when we support partially saved registers. Even then, I think value_of_register will still be the spot to tag the intention to print machine register values differently. value_from_register however may also return optimized out lval_register values, so at a couple places where we're computing a variable's location from a dwarf expression, we convert the resulting value away from lval_register to a regular optimized out value. Tested on x86_64 Fedora 17 gdb/ 2013-10-02 Pedro Alves <palves@redhat.com> * cp-valprint.c (cp_print_value_fields): Adjust calls to val_print_optimized_out. * jv-valprint.c (java_print_value_fields): Likewise. * p-valprint.c (pascal_object_print_value_fields): Likewise. * dwarf2loc.c (dwarf2_evaluate_loc_desc_full) <DWARF_VALUE_REGISTER>: If the register was not saved, return a new optimized out value. * findvar.c (address_from_register): Likewise. * frame.c (put_frame_register): Tweak error string to say the register was not saved, rather than optimized out. * infcmd.c (default_print_one_register_info): Adjust call to val_print_optimized_out. Use value_of_register instead of get_frame_register_value. * mi/mi-main.c (output_register): Use value_of_register instead of get_frame_register_value. * valprint.c (valprint_check_validity): Likewise. (val_print_optimized_out): New value parameter. If the value is lval_register, print <not saved> instead. (value_check_printable, val_print_scalar_formatted): Adjust calls to val_print_optimized_out. * valprint.h (val_print_optimized_out): New value parameter. * value.c (struct value) <optimized_out>: Extend comment. (error_value_optimized_out): New function. (require_not_optimized_out): Use it. Use a different string for lval_register values. * value.h (error_value_optimized_out): New declaration. * NEWS: Mention <not saved>. gdb/testsuite/ 2013-10-02 Pedro Alves <palves@redhat.com> * gdb.dwarf2/dw2-reg-undefined.exp <pattern_rax_rbx_rcx_print, pattern_rax_rbx_rcx_info>: Set to "<not saved>". * gdb.mi/mi-reg-undefined.exp (opt_out_pattern): Delete. (not_saved_pattern): New. Replace use of the former with the latter. gdb/doc/ 2013-10-02 Pedro Alves <palves@redhat.com> * gdb.texinfo (Registers): Expand description of saved registers in frames. Explain <not saved>.
* Teach the testsuite that GDBserver reliably reports program exits.Pedro Alves2013-10-025-6/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Running catch-syscall.exp against a gdbserver that actually supports it, we get: FAIL: gdb.base/catch-syscall.exp: continue until exit (the program exited) FAIL: gdb.base/catch-syscall.exp: continue until exit (the program exited) FAIL: gdb.base/catch-syscall.exp: continue until exit (the program exited) FAIL: gdb.base/catch-syscall.exp: continue until exit at catch syscall with unused syscall (mlock) (the program exited) FAIL: gdb.base/catch-syscall.exp: continue until exit (the program exited) The fail pattern is: Catchpoint 2 (call to syscall exit_group), 0x000000323d4baa29 in _exit () from /lib64/libc.so.6 (gdb) PASS: gdb.base/catch-syscall.exp: program has called exit_group delete breakpoints Delete all breakpoints? (y or n) y (gdb) info breakpoints No breakpoints or watchpoints. (gdb) break exit Breakpoint 3 at 0x323d438bf0 (gdb) continue Continuing. [Inferior 1 (process 21081) exited normally] That "break exit" + "continue" comes from: > # gdb_continue_to_end: > # The case where the target uses stubs has to be handled specially. If a > # stub is used, we set a breakpoint at exit because we cannot rely on > # exit() behavior of a remote target. > # The native-gdbserver.exp board, used to test against gdbserver in "target remote" mode, triggers that case ($use_gdb_stub is true). So gdb_continue_to_end doesn't work for catch-syscall.exp as here we catch the exit_group and continue from that, expecting to see a real program exit. I was about to post a patch that changes catch-syscall.exp to call a new function that just always does what gdb_continue_to_end does in the !$use_gdb_stub case. But, since GDBserver doesn't really need this, in the end I thought it better to teach the testsuite that there are stubs that know how to report program exits, by adding a new "exit_is_reliable" board variable that then gdb_continue_to_end checks. Tested on x86_64 Fedora 17, native and gdbserver. gdb/testsuite/ 2013-10-02 Pedro Alves <palves@redhat.com> * README (Board Settings): Document "exit_is_reliable". * lib/gdb.exp (gdb_continue_to_end): Check whether the board says running to exit reliably reports program exits. * boards/native-gdbserver.exp: Set exit_is_reliable in the board info. * boards/native-stdio-gdbserver.exp: Likewise.
* [GDBserver]: Silence exits if GDB is connected through stdio.Pedro Alves2013-10-023-8/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we make gdbserver gdb_continue_to_end actually expect a process exit with GDBserver, we get many testsuite failures with the remote stdio board: -PASS: gdb.arch/amd64-disp-step.exp: continue until exit at amd64-disp-step +FAIL: gdb.arch/amd64-disp-step.exp: continue until exit at amd64-disp-step (the program exited) -PASS: gdb.base/break.exp: continue until exit at recursive next test +FAIL: gdb.base/break.exp: continue until exit at recursive next test (the program exited) -PASS: gdb.base/chng-syms.exp: continue until exit at breakpoint first time through +FAIL: gdb.base/chng-syms.exp: continue until exit at breakpoint first time through (the program exited) ... etc. ... This is what the log shows for all of them: (gdb) continue Continuing. Child exited with status 0 GDBserver exiting [Inferior 1 (process 22721) exited normally] (gdb) FAIL: gdb.arch/amd64-disp-step.exp: continue until exit (the program exited) The problem is the whole "Child exited ... GDBserver exiting" output, that comes out of GDBserver, and that the testsuite is not expecting. I pondered somehow making the testsuite adjust to this. But, testsuite aside, I think GDBserver should not be outputting this at all when GDB is connected through stdio. GDBserver will be printing this in GDB's console, but the user can already tell from the regular output that the inferior is gone. Again, manually: (gdb) tar remote | ./gdbserver/gdbserver - program Remote debugging using | ./gdbserver/gdbserver - program Process program created; pid = 22486 stdin/stdout redirected Remote debugging using stdio done. Loaded symbols for /lib64/ld-linux-x86-64.so.2 0x000000323d001530 in _start () from /lib64/ld-linux-x86-64.so.2 (gdb) c Continuing. Child exited with status 1 ^^^^^^^^^^^^^^^^^^^^^^^^^^ GDBserver exiting ^^^^^^^^^^^^^^^^^ [Inferior 1 (process 22486) exited with code 01] (gdb) Suppressing those two lines makes the output be exactly like when debugging against a remote tcp gdbserver: (gdb) c Continuing. [Inferior 1 (process 22914) exited with code 01] (gdb) 2013-10-02 Pedro Alves <palves@redhat.com> * server.c (process_serial_event): Don't output "GDBserver exiting" if GDB is connected through stdio. * target.c (mywait): Likewise, be silent if GDB is connected through stdio.
* Use FILENAME_CMP to compare filenames in compare_search_syms.Joel Brobecker2013-10-022-1/+6
| | | | | | | gdb/ChangeLog: * symtab.c (compare_search_syms): Use FILENAME_CMP instead of strcmp to compare two symtab filenames.
* Delete search_symbols_equal (use compare_search_syms instead).Joel Brobecker2013-10-022-14/+8
| | | | | | | | | | | | This avoids duplicating the logic comparing two symbol_search objects (in search_symbols_equal and compare_search_syms). gdb/ChangeLog: * symtab.c (search_symbols_equal): Delete. (sort_search_symbols_remove_dups): Replace call to search_symbols_equal by call to compare_search_syms, adjusting as necessary.
* 2013-10-02 Phil Muldoon <pmuldoon@redhat.com>pmuldoon2013-10-022-1/+10
| | | | | | PR python/15579 * python/python.c: Document gdb.execute command in Python help.
* 2013-10-02 Phil Muldoon <pmuldoon@redhat.com>pmuldoon2013-10-022-2/+11
| | | | | * python/py-frame.c (frame_info_to_frame_object): Use gdbpy_convert_exception. Clean up Python object on failure.
* 2013-10-02 Phil Muldoon <pmuldoon@redhat.com>pmuldoon2013-10-022-2/+11
| | | | | | * python/lib/gdb/command/frame_filters.py (InfoFrameFilter.list_frame_filters): Retrieve exception manually. (ShowFrameFilterPriority.invoke): Ditto.
* Constification of parse_linespec and fallout:Keith Seitz2013-10-0226-132/+289
| | | | | | | https://sourceware.org/ml/gdb-patches/2013-09/msg01017.html https://sourceware.org/ml/gdb-patches/2013-09/msg01018.html https://sourceware.org/ml/gdb-patches/2013-09/msg01019.html https://sourceware.org/ml/gdb-patches/2013-09/msg01020.html
* daily updateAlan Modra2013-10-021-1/+1
|