aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2018-03-30Make power8 the default cpu when assembling for 64-bit little endian targets.Peter Bergner2-1/+11
gas/ PR binutils/23013 * config/tc-ppc.c (ppc_set_cpu): Select appropriate cpu when ppc_obj64 and little endian.
2018-03-30Automatic date update in version.inGDB Administrator1-1/+1
2018-03-29PR binutils/22875: MIPS: Remove duplicate unsupported relocation processingMaciej W. Rozycki2-6/+7
Remove a duplicate `unsupported relocation type' message and the setting of the `bfd_error_bad_value' error from `mips_elf32_rtype_to_howto', added with commit f3185997ac09 ("PR 22875: Stop strip corrupting unknown relocs"), <https://sourceware.org/ml/binutils/2018-02/msg00445.html>. This message is already produced and the `bfd_error_bad_value' error set by `mips_elf32_rtype_to_howto' before a NULL howto is returned, so there is no need to repeat these actions here. bfd/ * elf32-mips.c (mips_info_to_howto_rel): Remove the calls to `_bfd_error_handler' and to set the `bfd_error_bad_value' error.
2018-03-29Automatic date update in version.inGDB Administrator1-1/+1
2018-03-28BFD/PA: Remove ATTRIBUTE_UNUSED from `elf_hppa_info_to_howto_rel'Maciej W. Rozycki2-1/+6
Remove ATTRIBUTE_UNUSED annotation from the `abfd' parameter in `elf_hppa_info_to_howto' now that commit f3185997ac09 ("PR 22875: Stop strip corrupting unknown relocs"), <https://sourceware.org/ml/binutils/2018-02/msg00445.html>, made it used. bfd/ * elf-hppa.h (elf_hppa_info_to_howto_rel): Remove ATTRIBUTE_UNUSED from `abfd'.
2018-03-28BFD/PA: Correct formatting in `elf_hppa_info_to_howto_rel'Maciej W. Rozycki2-1/+7
Wrap the `_bfd_error_handler' call to fit in 80 columns, fixing commit e8f5af786c76 ("Use standardized error message for unrecognized relocs."). bfd/ * elf-hppa.h (elf_hppa_info_to_howto_rel): Correct `_bfd_error_handler' call formatting.
2018-03-28MIPS/BFD: Call `mips_elf32_rtype_to_howto' directly with o32 (ChangeLog)Maciej W. Rozycki1-1/+1
Correct ChangeLog date for commit 8205a328f8b8 ("MIPS/BFD: Call `mips_elf32_rtype_to_howto' directly with o32").
2018-03-28Use top-level config support for enabling plugins.Cary Coutant8-834/+1622
Also recognizes --plugin options when plugins are disabled. 2018-03-28 Cary Coutant <ccoutant@gmail.com> gold/ PR gold/21423 PR gold/22500 * configure.ac: Call AC_USE_SYSTEM_EXTENSIONS. Replace check for --enable-plugins with AC_PLUGINS. * options.cc (parse_plugin, parse_plugin_opt): Remove #ifdef. (General_options::finalize): Check if plugins enabled. * options.h (--plugin, --plugin-opt): Define even if plugins not enabled. * Makefile.in: Regenerate. * aclocal.m4: Regenerate. * configure: Regenerate. * testsuite/Makefile.in: Regenerate.
2018-03-28MIPS/BFD: Call `mips_elf32_rtype_to_howto' directly with o32Maciej W. Rozycki2-3/+7
Call `mips_elf32_rtype_to_howto' directly rather than via the `->elf_backend_mips_rtype_to_howto' method in the o32 backend, complementing commit 861fb55ab50a ("Defer allocation of R_MIPS_REL32 GOT slots"), <https://sourceware.org/ml/binutils/2008-08/msg00096.html>, and reverting the change to `mips_info_to_howto_rel' originally made with commit 0a44bf6950b3 ("mips-vxworks support"), <https://sourceware.org/ml/binutils/2006-03/msg00179.html>. With `mips_vxworks_rtype_to_howto' gone there is a single backend method used across all o32 targets, so there in no need for the indirection and the associated extra cost. This also makes the o32 backend consistent with the n32 and n64 backends. bfd/ * elf32-mips.c (mips_info_to_howto_rel): Call `mips_elf32_rtype_to_howto' directly rather than via `->elf_backend_mips_rtype_to_howto'.
2018-03-28[2/2][LD][AARCH64]Add BFD_RELOC_AARCH64_TLSLE_LDST8/16/32/64_TPREL_LO12 ↵Renlin Li53-4/+615
support in LD. This patch adds the following relocation support into binutils bfd linker. BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC, BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC, BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC, BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC. Those relocations includes both ip64 and ilp32 variant.
2018-03-28[1/2][GAS][AARCH64]Add BFD_RELOC_AARCH64_TLSLE_LDST8/16/32/64_TPREL_LO12 ↵Renlin Li33-6/+555
support in GAS. This patch adds the following relocation support into binutils gas. BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC, BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC, BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC, BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC. Those relocations includes both ip64 and ilp32 variant.
2018-03-28Add support for R_AARCH64_TLSLE_LDST8_TPREL_LO12, etc.Cary Coutant5-3/+65
elfcpp/ PR gold/22969 * aarch64.h: Fix spelling of R_AARCH64_TLSLE_LDST16_TPREL_LO12_NC. gold/ PR gold/22969 * aarch64-reloc.def: Add TLSLE_LDST* relocations. * aarch64.cc (Target_aarch64::optimize_tls_reloc): Likewise. (Target_aarch64::Scan::local): Likewise. (Target_aarch64::Scan::global): Likewise. (Target_aarch64::Relocate::relocate): Likewise. (Target_aarch64::Relocate::relocate_tls): Likewise.
2018-03-28x86: drop VecESizeJan Beulich13-7950/+7978
It again can be inferred from other information. The vpopcntd templates all need to have Dword added to their memory operands; the lack thereof was actually a bug preventing certain Intel syntax code to assemble, so test cases get extended.
2018-03-28x86: convert broadcast insn attribute to booleanJan Beulich8-2006/+2311
The (only) valid broadcast type for an insn can be inferred from other information.
2018-03-28x86: fold to-scalar-int conversion insnsJan Beulich5-489/+94
2018-03-28x86: don't show suffixes for to-scalar-int conversion insnsJan Beulich5-40/+42
In the course of folding their patterns (possible now that the pointless and partly even bogus VecESize are no longer in the way) I've noticed that vcvt*2usi, other than their vcvt*2si counterparts, don't allow for any suffixes. As that is supposedly intentional, make the disassembler consistently omit suffixes for all to-scalar-int conversion insns.
2018-03-28PR ld/22972 on SPARC.Eric Botcazou8-7/+118
This is a regression for the corner case of a hidden symbol in a PIC/PIE binary which is subject to both a new-style GOTDATA relocation and an old-style GOT relocation. In this case, depending on the link order, the R_SPARC_RELATIVE dynamic relocation for the GOT slot needed because of the old-style relocation can be replaced with R_SPARC_NONE coming from the GOTDATA relocation. The fix simply records whether an old-style GOT relocation is seen for a symbol and prevents the R_SPARC_NONE from being generated in this case. bfd/ * elfxx-sparc.c (struct _bfd_sparc_elf_link_hash_entry): Add new flag has_old_style_got_reloc. (_bfd_sparc_elf_check_relocs) <GOT relocations>: Set it for old-style relocations. Fix a couple of long lines. (_bfd_sparc_elf_relocate_section) <R_SPARC_GOTDATA_OP>: Do not generate a R_SPARC_NONE for the GOT slot if the symbol is also subject to old-style GOT relocations. ld/ * testsuite/ld-sparc/sparc.exp: Add test for mixed GOTDATA/GOT relocs. * testsuite/ld-sparc/gotop-hidden.c: New file. * testsuite/ld-sparc/got-hidden32.s: Likewise. * testsuite/ld-sparc/got-hidden64.s: Likewise. * testsuite/ld-sparc/pass.out: Likewise.
2018-03-28Enhance the AARCH64 assembler to support LDFF1xx instructions which use ↵Nick Clifton12-571/+720
REG+REG addressing with an assumed offset register. PR 22988 opcode * opcode/aarch64.h (enum aarch64_opnd): Add AARCH64_OPND_SVE_ADDR_R. opcodes * aarch64-tbl.h (aarch64_opcode_table): Add entries for LDFF1xx instructions with only a base address register. * aarch64-opc.c (operand_general_constraint_met_p): Add code to handle AARHC64_OPND_SVE_ADDR_R. (aarch64_print_operand): Likewise. * aarch64-asm-2.c: Regenerate. * aarch64_dis-2.c: Regenerate. * aarch64-opc-2.c: Regenerate. gas * config/tc-aarch64.c (parse_operands): Add code to handle AARCH64_OPN_SVE_ADDR_R. * testsuite/gas/aarch64/sve.s: Add tests for LDFF1xx instructions with an assumed XZR offset address register. * testsuite/gas/aarch64/sve.d: Update expected disassembly.
2018-03-27gold/testsuite: Fix bad regexp in split_x86_64.shRoland McGrath2-2/+6
gold/ * testsuite/split_x86_64.sh: Fix bad regexp.
2018-03-28Automatic date update in version.inGDB Administrator1-1/+1
2018-03-27Remove cleanups from prompt_for_continueTom Tromey2-7/+6
This removes the cleanups from prompt_for_continue by the use of unique_xmalloc_ptr. gdb/ChangeLog 2018-03-27 Tom Tromey <tom@tromey.com> * utils.c (prompt_for_continue): Use unique_xmalloc_ptr.
2018-03-27Remove cleanups from gdb_readline_wrapperTom Tromey2-57/+59
This removes some cleanups from gdb_readline_wrapper by changing the existing gdb_readline_wrapper_cleanup struct to have a constructor and destructor, and then changing gdb_readline_wrapper to simply instantiate it on the stack. gdb/ChangeLog 2018-03-27 Pedro Alves <palves@redhat.com> Tom Tromey <tom@tromey.com> * top.c (class gdb_readline_wrapper_cleanup): Add constructor, destructor. Now a class. (gdb_readline_wrapper_cleanup): Remove function. (gdb_readline_wrapper): Remove cleanups.
2018-03-27C++-ify typedef hashTom Tromey6-165/+153
This changes the typedef_hash_table structure to be a C++ class. It adds constructors and destructors and changes some functions to be methods of the class. Then it changes the various users of this class to adapt. This allows for the removal of some cleanups. Regression tested by the buildbot. gdb/ChangeLog 2018-03-27 Tom Tromey <tom@tromey.com> * typeprint.h (struct type_print_options) <local_typedefs, global_typedefs>: Remove "struct" keyword. (class typedef_hash_table): New class. (recursively_update_typedef_hash, add_template_parameters) (create_typedef_hash, free_typedef_hash, copy_typedef_hash) (find_typedef_in_hash): Don't declare. * typeprint.c (struct typedef_hash_table): Move to typeprint.h. (typedef_hash_table::recursively_update): Rename from recursively_update_typedef_hash. Now a member. (typedef_hash_table::add_template_parameters): Rename from add_template_parameters. Now a member. (typedef_hash_table::typedef_hash_table): Now a constructor; rename from create_typedef_hash. (typedef_hash_table::~typedef_hash_table): Now a destructor; rename from free_typedef_hash. (do_free_typedef_hash, make_cleanup_free_typedef_hash) (do_free_global_table): Remove. (typedef_hash_table::typedef_hash_table): New constructor; renamed from copy_type_recursive. (create_global_typedef_table): Remove. (typedef_hash_table::find_global_typedef): Now a member of typedef_hash_table. (typedef_hash_table::find_typedef): Rename from find_typedef_in_hash; now a member. (whatis_exp): Update. * extension.h (struct ext_lang_type_printers): Add constructor and destructor. (start_ext_lang_type_printers, free_ext_lang_type_printers): Don't declare. * extension.c (ext_lang_type_printers::ext_lang_type_printers): Now a constructor; rename from start_ext_lang_type_printers. (ext_lang_type_printers): Now a destructor; rename from free_ext_lang_type_printers. * c-typeprint.c (find_typedef_for_canonicalize, c_print_type_1): Update. (c_type_print_base_struct_union): Update. Remove cleanups.
2018-03-27Include <cmath> in dwarf-index-write.cTom Tromey2-0/+5
On x86-64 Fedora 26, when building with the system gcc, I get: ../../binutils-gdb/gdb/dwarf-index-write.c: In member function ‘void debug_names::build()’: ../../binutils-gdb/gdb/dwarf-index-write.c:705:13: error: ‘pow’ is not a member of ‘std’ There are actually more messages, but this is sufficient to show the problem. The fix is to include <cmath>. I'm checking this in as obvious. Tested by building. gdb/ChangeLog 2018-03-27 Tom Tromey <tom@tromey.com> * dwarf-index-write.c: Include <cmath>.
2018-03-27set varsize-limit: New GDB setting for maximum dynamic object sizeJoel Brobecker11-0/+167
This is a command we somehow forgot to contribute at the time the Ada language was first contributed to the FSF. This command allows the user to change the maximum size we allow when reading memory from dynamic objects (the default is 65536 bytes). At the moment, this limit is only used by Ada, and so the implementation is kept inside ada-lang.c. However, it is conceivable that other language might want to use it also to handle the same kind of issues; for instance, this might be useful when handling dynamic types in C. So the name of the setting was made language-neutral, to allow for this. Note that an alias for "set var" needs to be introduced as well. We are not adding a test for that, since this is a feature that is already exercized by numerous existing tests. gdb/ChangeLog * NEWS: Add entry describing new "set|show varsize-limit" command. * ada-lang.c (_initialize_ada_language): Add "set/show varsize-limit" command. * printcmd.c (_initialize_printcmd): Add "set var" alias of "set variable". gdb/doc/ChangeLog: * gdb.texinfo (Ada Settings): New subsubsection. gdb/testsuite/ChangeLog: * gdb.ada/varsize_limit: New testcase. Tested on x86_64-linux.
2018-03-27Move DWARF index-related things to a separate fileSimon Marchi7-2053/+2256
I want to add a DWARF index-related feature (automatically produce index files when loading objfiles in GDB), but I don't want to add many hundred lines to the already too big dwarf2read.c. I thought it would be a logical split to move everything related to the DWARF index to its own file. I first tried to move everything that reads and writes DWARF indices to a separate file, but found that the "read" part is a little bit entangled with the rest of dwarf2read.c, so the line is hard to draw about where to split. The write part is quite isolated though, so I moved this part to a new file, dwarf-index-write.c. Some things are necessary to both reading and writing indices, so I placed them in dwarf-index-common.{c,h}. The idea would be to have a dwarf-index-read.c eventually that would use it too (for now that code is still in dwarf2read.c). This required moving some things to a new dwarf2read.h header, so they can be read by the code that writes the index. The patch is big in number of lines, but it's all existing code being moved around. The only changes are that some functions are not static anymore, a declaration is added in a .h file, and therefore the comment is moved there. I built-tested it with a little and big endian target. This patch is also available on the users/simark/split-dwarf2read branch. gdb/ChangeLog: * Makefile.in (COMMON_SFILES): Add dwarf-index-common.c and dwarf-index-write.c (HFILES_NO_SRCDIR): Add dwarf-index-common.h and dwarf2read.h. * dwarf-index-common.c: New file. * dwarf-index-common.h: New file. * dwarf-index-write.c: New file. * dwarf2read.c: Include dwarf2read.h and dwarf-index-common.h. (struct dwarf2_section_info): Move from here. (dwarf2_section_info_def): Likewise. (DEF_VEC_O (dwarf2_section_info_def)): Likewise. (offset_type): Likewise. (DW2_GDB_INDEX_SYMBOL_STATIC_SET_VALUE): Likewise. (DW2_GDB_INDEX_SYMBOL_KIND_SET_VALUE): Likewise. (DW2_GDB_INDEX_CU_SET_VALUE): Likewise. (byte_swap): Likewise. (MAYBE_SWAP): Likewise. (dwarf2_per_cu_ptr): Likewise. (DEF_VEC_P (dwarf2_per_cu_ptr)): Likewise. (struct tu_stats): Likewise. (struct dwarf2_per_objfile): Likewise. (struct dwarf2_per_cu_data): Likewise. (struct signatured_type): Likewise. (sig_type_ptr): Likewise. (DEF_VEC_P (sig_type_ptr)): Likewise. (INDEX4_SUFFIX): Likewise. (INDEX5_SUFFIX): Likewise. (DEBUG_STR_SUFFIX): Likewise. (dwarf2_read_section): Make non-static. (mapped_index_string_hash): Move from here. (dwarf5_djb_hash): Likewise. (file_write): Likewise. (class data_buf): Likewise. (struct symtab_index_entry): Likewise. (struct mapped_symtab): Likewise. (find_slot): Likewise. (hash_expand): Likewise. (add_index_entry): Likewise. (uniquify_cu_indices): Likewise. (class c_str_view): Likewise. (class c_str_view_hasher): Likewise. (class vector_hasher): Likewise. (write_hash_table): Likewise. (psym_index_map): Likewise. (struct addrmap_index_data): Likewise. (add_address_entry): Likewise. (add_address_entry_worker): Likewise. (write_address_map): Likewise. (symbol_kind): Likewise. (write_psymbols): Likewise. (struct signatured_type_index_data): Likewise. (write_one_signatured_type): Likewise. (recursively_count_psymbols): Likewise. (recursively_write_psymbols): Likewise. (class debug_names): Likewise. (check_dwarf64_offsets): Likewise. (psyms_seen_size): Likewise. (write_gdbindex): Likewise. (write_debug_names): Likewise. (assert_file_size): Likewise. (write_psymtabs_to_index): Likewise. (save_gdb_index_command): Likewise. (_initialize_dwarf2_read): Don't register the "save gdb-index" command. * dwarf2read.h: New file.
2018-03-27problem looking up some symbols when they have a linkage nameJoel Brobecker23-2/+278
This patch fixes a known failure in gdb.ada/maint_with_ada.exp (maintenance check-psymtabs). Another way to witness the same issue is by considering the following Ada declarations... type Wrapper is record A : Integer; end record; u00045 : constant Wrapper := (A => 16#060287af#); pragma Export (C, u00045, "symada__cS"); ... which declares a variable name "u00045" but with a linkage name which is "symada__cS". This variable is a record with one component, the Ada equivalent of a struct with one field in C. Trying to print that variable's value currently yields: (gdb) p /x <symada__cS> 'symada(char, signed)' has unknown type; cast it to its declared type This indicates that GDB was only able to find the minimal symbol, but not the full symbol. The expected output is: (gdb) print /x <symada__cS> $1 = (a => 0x60287af) The error message gives a hint about what's happening: We processed the symbol through gdb_demangle, which in the case of this particular symbol name, ends up matching the C++ naming scheme. As a result, the demangler transforms our symbol name into 'symada(char, signed)', thus breaking Ada lookups. This patch fixes the issue by first introducing a new language_defn attribute called la_store_sym_names_in_linkage_form_p, which is a boolean to be set to true for the few languages that do not want their symbols to have their names stored in demangled form, and false otherwise. We then use this language attribute to skip the call to gdb_demangle for all languages whose la_store_sym_names_in_linkage_form_p is true. In terms of the selection of languages for which the new attribute is set to true, the selection errs on the side of preserving the existing behavior, and only changes the behavior for the languages where we are certain storing symbol names in demangling form is not needed. It is conceivable that other languages might be in the same situation, but I not knowing in detail the symbol name enconding strategy, I decided to play it safe and let other language maintainers potentially adjust their language if it makes sense to do so. gdb/ChangeLog: PR gdb/22670 * dwarf2read.c (dwarf2_physname): Do not return the demangled symbol name if the CU's language stores symbol names in linkage format. * language.h (struct language_defn) <la_store_sym_names_in_linkage_form_p>: New field. Adjust all instances of this struct. gdb/testsuite/ChangeLog: * gdb.ada/maint_with_ada.exp: Remove PR gdb/22670 setup_kfail. * gdb.ada/notcplusplus: New testcase. * gdb.base/c-linkage-name.c: New file. * gdb.base/c-linkage-name.exp: New testcase. Tested on x86_64-linux. This also passes AdaCore's internal GDB testsuite.
2018-03-26Remove verbose code from backtrace commandTom Tromey2-18/+4
In https://sourceware.org/ml/gdb-patches/2017-06/msg00741.html, Pedro asks: > Doesn't the "info verbose on" bit affect frame filters too? The answer is that yes, it could. However, it's not completely effective, because the C code can't guess how many frames might need to be unwound to satisfy the request -- a frame filter will request as many frames as it needs. Also, I tried removing this code from backtrace, and I think the result is better without it. In particular, now the expansion line occurs just before the frame that caused the expansion, like: (gdb) bt no-filters #0 0x00007ffff576cecd in poll () from /lib64/libc.so.6 Reading in symbols for ../../binutils-gdb/gdb/event-loop.c...done. #1 0x00000000007ecc33 in gdb_wait_for_event (block=1) at ../../binutils-gdb/gdb/event-loop.c:772 #2 0x00000000007ec006 in gdb_do_one_event () at ../../binutils-gdb/gdb/event-loop.c:347 #3 0x00000000007ec03e in start_event_loop () at ../../binutils-gdb/gdb/event-loop.c:371 Reading in symbols for ../../binutils-gdb/gdb/main.c...done. #4 0x000000000086693d in captured_command_loop ( Reading in symbols for ../../binutils-gdb/gdb/exceptions.c...done. data=0x0) at ../../binutils-gdb/gdb/main.c:325 So, I am proposing this patch to simply remove this code. gdb/ChangeLog 2018-03-26 Tom Tromey <tom@tromey.com> * stack.c (backtrace_command_1): Remove verbose code.
2018-03-26Simplify exception handling in py-framefilter.cTom Tromey2-394/+167
This patch changes py-framefilter.c as suggested by Pedro in: https://sourceware.org/ml/gdb-patches/2017-06/msg00748.html In particular, gdb exceptions are now caught at the outermost layer, rather than in each particular function. This simplifies much of the code. gdb/ChangeLog 2018-03-26 Tom Tromey <tom@tromey.com> * python/py-framefilter.c (py_print_type): Don't catch exceptions. Return void. (py_print_value): Likewise. (py_print_single_arg): Likewise. (enumerate_args): Don't catch exceptions. (py_print_args): Likewise. (py_print_frame): Likewise. (gdbpy_apply_frame_filter): Catch exceptions here.
2018-03-26Improve "backtrace" help textTom Tromey2-6/+12
This improves help text in stack.c in two ways. First, it removes trailing newlines from various help strings. I think these are never needed. Second, it adds a "Usage" line to the "backtrace" text, as suggested by Pedro. gdb/ChangeLog 2018-03-26 Tom Tromey <tom@tromey.com> * stack.c (_initialize_stack): Remove trailing newlines from help text. Add "Usage" line to "backtrace" help.
2018-03-26Call wrap_hint in one more spot in py-framefilter.cTom Tromey2-0/+6
PR python/16486 notes that "bt" output is still wrapped differently when a frame filter is in use. This patch brings it a bit closer by adding one more wrap_hint call, in a place where stack.c does this as well. gdb/ChangeLog 2018-03-26 Tom Tromey <tom@tromey.com> PR python/16486: * python/py-framefilter.c (py_print_args): Call wrap_hint.
2018-03-26Return EXT_LANG_BT_ERROR in one more spot in py-framefilter.cTom Tromey2-0/+6
While reading py-framefilter.c, I found one spot where an exception could be caught but then not be turned into EXT_LANG_BT_ERROR. This patch fixes this spot. gdb/ChangeLog 2018-03-26 Tom Tromey <tom@tromey.com> * python/py-framefilter.c (py_print_single_arg): Return EXT_LANG_BT_ERROR from catch.
2018-03-26Move some code later in backtrace_command_1Tom Tromey2-52/+59
PR backtrace/15584 notes that some code in backtrace_command_1 is not useful when frame filters are in use. This patch moves this code into the no-frame-filters "if". This also removes the unused local "trailing_level", which I noticed while moving the code around. gdb/ChangeLog 2018-03-26 Tom Tromey <tom@tromey.com> PR backtrace/15584: * stack.c (backtrace_command_1): Move some code into no-filters "if".
2018-03-26Throw a "quit" on a KeyboardException in py-framefilter.cTom Tromey5-4/+41
If a C-c comes while the Python code for a frame filter is running, it will be turned into a Python KeyboardException. It seems good for this to be treated like a GDB quit, so this patch changes py-framefilter.c to notice this situation and call throw_quit in this case. gdb/ChangeLog 2018-03-26 Tom Tromey <tom@tromey.com> * python/py-framefilter.c (throw_quit_or_print_exception): New function. (gdbpy_apply_frame_filter): Use it. gdb/testsuite/ChangeLog 2018-03-26 Tom Tromey <tom@tromey.com> * gdb.python/py-framefilter.exp: Add test for KeyboardInterrupt. * gdb.python/py-framefilter.py (name_error): New global. (ErrorInName.function): Use name_error.
2018-03-26Allow C-c to work in backtrace in more casesTom Tromey2-11/+18
PR cli/17716 notes that it is difficult to C-c (or "q" at a pagination prompt) while backtracing using a frame filter. One reason for this is that many places in py-framefilter.c use RETURN_MASK_ALL in a try/catch. This patch changes these spots to use RETURN_MASK_ERROR instead. This is safe to do because this entire file is exception safe now. gdb/ChangeLog 2018-03-26 Tom Tromey <tom@tromey.com> PR cli/17716: * python/py-framefilter.c (py_print_type, py_print_value) (enumerate_args, py_print_args, gdbpy_apply_frame_filter): Use RETURN_MASK_ERROR.
2018-03-26Avoid manual resource management in py-framefilter.cTom Tromey2-15/+10
This patch removes the last bit of manual resource management from py-framefilter.c. This will be useful in the next patch. gdb/ChangeLog 2018-03-26 Tom Tromey <tom@tromey.com> * python/py-framefilter.c (enumerate_args): Use gdb::unique_xmalloc_ptr.
2018-03-26Remove EXT_LANG_BT_COMPLETEDTom Tromey3-9/+14
While looking at the frame filter code, I noticed that EXT_LANG_BT_COMPLETED is not really needed. Semantically there is no difference between the "completed" and "ok" results. So, this patch removes this constant. gdb/ChangeLog 2018-03-26 Tom Tromey <tom@tromey.com> * python/py-framefilter.c (py_print_frame): Return EXT_LANG_BT_OK. (gdbpy_apply_frame_filter): Update comment. * extension.h (enum ext_lang_bt_status) <EXT_LANG_BT_COMPLETED>: Remove. <EXT_LANG_BT_NO_FILTERS>: Change value.
2018-03-26Allow hiding of some filtered framesTom Tromey8-25/+57
When a frame filter elides some frames, they are still printed by "bt", indented a few spaces. PR backtrace/15582 notes that it would be nice for users if elided frames could simply be dropped. This patch adds this capability. gdb/ChangeLog 2018-03-26 Tom Tromey <tom@tromey.com> PR backtrace/15582: * stack.c (backtrace_command): Parse "hide" argument. * python/py-framefilter.c (py_print_frame): Handle PRINT_HIDE. * extension.h (enum frame_filter_flags) <PRINT_HIDE>: New constant. gdb/doc/ChangeLog 2018-03-26 Tom Tromey <tom@tromey.com> PR backtrace/15582: * gdb.texinfo (Backtrace): Mention "hide" argument. gdb/testsuite/ChangeLog 2018-03-26 Tom Tromey <tom@tromey.com> PR backtrace/15582: * gdb.python/py-framefilter.exp: Add "bt hide" test.
2018-03-26Change backtrace_command_1 calling to use flagsTom Tromey2-10/+13
The next patch will add more flags to backtrace_command_1; and rather than add another boolean argument, this patch changes it to accept a flags value. gdb/ChangeLog 2018-03-26 Tom Tromey <tom@tromey.com> * stack.c (backtrace_command_1): Remove "show_locals" parameter, add "flags". (backtrace_command): Remove "fulltrace", add "flags".
2018-03-26Rationalize "backtrace" command line parsingTom Tromey4-73/+57
The backtrace command has peculiar command-line parsing. In particular, it splits the command line, then loops over the arguments. If it sees a word it recognizes, like "full", it effectively drops this word from the argument vector. Then, it pastes together the remaining arguments, passing them on to backtrace_command_1, which in turn passes the resulting string to parse_and_eval_long. The documentation doesn't mention the parse_and_eval_long at all, so it is a bit of a hidden feature that you can "bt 3*2". The strange algorithm above also means you can "bt 3 * no-filters 2" and get 6 frames... This patch changes backtrace's command line parsing to be a bit more rational. Now, special words like "full" are only recognized at the start of the command. This also updates the documentation to describe the various bt options individually. gdb/ChangeLog 2018-03-26 Tom Tromey <tom@tromey.com> * stack.c (backtrace_command): Rewrite command line parsing. gdb/doc/ChangeLog 2018-03-26 Tom Tromey <tom@tromey.com> * gdb.texinfo (Backtrace): Describe options individually.
2018-03-27Automatic date update in version.inGDB Administrator1-1/+1
2018-03-26Remove DEF_VEC_I(offset_type)Simon Marchi2-2/+4
It is unused. gdb/ChangeLog: * dwarf2read.c (DEF_VEC_I(offset_type)): Remove.
2018-03-26Add include guard to filename-seen-cache.hSimon Marchi2-0/+9
While moving things around, I stumbled on filename_seen_cache being re-defined, because filename-seen-cache.h doesn't have an include guard. gdb/ChangeLog: * filename-seen-cache.h: Add include guard.
2018-03-26Fix case where IR file provides symbol visibility but replacement file does not.Cary Coutant7-4/+172
In PR 22868, two IR files provide conflicting visibility for a symbol. When a def with PROTECTED visibility is seen after a def with DEFAULT visibility, gold does not override the visibility. Later, if the replacement object define the symbol with DEFAULT visibility, the symbol remains DEFAULT. This was caused by a recent change to allow multiply-defined absolute symbols, combined with the fact that the plugin framework was using SHN_ABS as the section index for placeholder symbols. The solution is to use a real (but arbitrary) section index. gold/ PR gold/22868 * plugin.cc (Sized_pluginobj::do_add_symbols): Use a real section index instead of SHN_ABS for defined symbols. * testsuite/Makefile.am (plugin_pr22868): New test case. * testsuite/Makefile.in: Regenerate * testsuite/plugin_pr22868.sh: New test script. * testsuite/plugin_pr22868_a.c: New source file. * testsuite/plugin_pr22868_b.c: New source file.
2018-03-26Remove struct keyword from section_addr_infoKeith Seitz3-2/+9
Buildbot pointed out a failiure in windows-nat.c: ../../binutils-gdb/gdb/windows-nat.c:582:10: error: using typedef-name 'section_addr_info' after 'struct' struct section_addr_info *addrs; ^~~~~~~~~~~~~~~~~ In file included from ../../binutils-gdb/gdb/windows-nat.c:49:0: ../../binutils-gdb/gdb/symfile.h:75:37: note: 'section_addr_info' has a previous declaration here typedef std::vector<other_sections> section_addr_info; ^~~~~~~~~~~~~~~~~ A recursive grep of the sources for "struct section_addr_info" reveals one additional reference in a comment. In both cases, this patch simply removes the struct keyword. gdb/ChangeLog: * symfile.c (place_section): Remove "struct" from section_addr_info in comment. * windows-nat.c (struct safe_symbol_file_add_args) <addrs>: Remove "struct" keyword from section_addr_info.
2018-03-26Make gdbserver reg_defs a vector of objectsAlan Hayward6-37/+42
gdb/ * regformats/regdef.h (reg): Add constructors. gdb/gdbserver/ * regcache.c (find_register_by_number): Return a ref. (find_regno): Use references. (register_size): Likewise. (register_data): Likewise. * tdesc.c (target_desc::~target_desc): Remove free calls. (target_desc::operator==): Use std::vector compare. (init_target_desc): Use reference. (tdesc_create_reg): Use reg constructors. * tdesc.h (struct target_desc): Replace pointer with object.
2018-03-26Automatic date update in version.inGDB Administrator1-1/+1
2018-03-25eval.c: reverse minsym and symPedro Alves2-4/+9
I noticed that in evaluate_funcall, where we handle OP_VAR_MSYM_VALUE/OP_VAR_VALUE to figure out the symbol's name gets the minimal_symbol/symbol backwards. Happens to be harmless in practice because the symbol name is recorded in the common initial sequence (in the general_symbol_info field). gdb/ChangeLog: 2018-03-25 Pedro Alves <palves@redhat.com> * eval.c (evaluate_funcall): Swap OP_VAR_MSYM_VALUE/OP_VAR_VALUE if then/else bodies in var_func_name extraction.
2018-03-25Fix date in gdb/ChangeLogPedro Alves1-1/+1
2018-03-25x86-64: Add ENDBR64 to the TLSDESC PLT entryH.J. Lu4-14/+31
The TLSDESC entry in a lazy procedure linkage table is called indirectly with "callq *(%rax)". This patch adds an ENDBR64 to support indirect branch tracking in Intel CET. The TLSDESC PLT entry now looks like: 0xf3, 0x0f, 0x1e, 0xfa, /* endbr64 */ 0xff, 0x35, 8, 0, 0, 0, /* pushq GOT+8(%rip) */ 0xff, 0x25, 16, 0, 0, 0 /* jmpq *GOT+TDG(%rip) */ The BND prefix isn't needed since MPX isn't used for TLSDESC. bfd/ PR ld/23000 * elf64-x86-64.c (elf_x86_64_finish_dynamic_sections): Add ENDBR64 to the TLSDESC PLT entry. ld/ PR ld/23000 * testsuite/ld-x86-64/tlsdesc.pd: Updated.