aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
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.
2018-03-25Automatic date update in version.inGDB Administrator1-1/+1
2018-03-23Fix warn-unused-return message.Cary Coutant2-3/+15
gold/ * plugin.cc (link_or_copy_file): Remove newlines from warning messages. Add pedantic check for return value from ::write.
2018-03-23Add missing ChangeLog entry for last commit.Cary Coutant1-0/+21
2018-03-23aarch64: Make "info address" resolve TLS variablesWeimin Pan3-15/+10
TLS variables can't be resolved on aarch64-linux-gnu Running the test case with upstream gdb shows two failures: (1) Receiving different error messages when printing TLS variable before program runs - because the ARM compiler does not emit dwarf attribute DW_AT_location for TLS, the result is expected and the baseline may need to be changed for aarch64. (2) Using "info address" command on C++ static TLS object resulted in "symbol unresolved" error - below is a snippet from the test case: class K { public: static __thread int another_thread_local; }; __thread int K::another_thread_local; (gdb) info address K::another_thread_local Symbol "K::another_thread_local" is unresolved. This patch contains fix for (2). Function info_address_command() handles the "info address" command and calls lookup_minimal_symbol_and_objfile() to find sym's symbol entry in mininal symbol table if SYMBOL_COMPUTED_OPS (sym) is false. Problem is that function lookup_minimal_symbol_and_objfile() only looked up an objfile's minsym ordinary hash table, not its demangled hash table, which was the reason why the C++ name was not found. The fix is to call lookup_minimal_symbol(), which already looks up entries in both minsym's hash tables, to find names when traversing the object file list in lookup_minimal_symbol_and_objfile(). Tested in both aarch64-linux-gnu and amd64-linux-gnu. No regressions.
2018-03-24Automatic date update in version.inGDB Administrator1-1/+1
2018-03-23Add psymbols for nested typesKeith Seitz7-1/+190
c++/22968 involves the inability of ptype to find a type definition for a type defined inside another type. I recently added some additional support for nested type definitions, but I apparently overlooked psymbols. The user reports that using -readnow fixes the problem: $ gdb 22968 -ex "ptype Outer::Inner" There is no field named Inner $ gdb -readnow 22968 -ex "ptype Outer::Inner" type = struct Outer::Inner { <no data field> } We clearly did not find a psymbol for Outer::Inner because it was located in another CU. This patch addresses this problem by scanning structs for additional psymbols. Rust is already doing this. With this patch, the identical result to "-readnow" is given (without using `-readnow', of course). gdb/ChangeLog: PR c++/22968 * dwarf2read.c (scan_partial_symbols): Scan structs/classes for nested type definitions for C++, too. gdb/testsuite/ChangeLog: PR c++/22968 * gdb.cp/subtypes.exp: New file. * gdb.cp/subtypes.h: New file. * gdb.cp/subtypes.cc: New file. * gdb.cp/subtypes-2.cc: New file.
2018-03-23Add --debug=plugin option to record plugin actions.Cary Coutant3-21/+294
With --debug=plugin, gold will log all plugin actions to a log file, and make copies of plugin-supplied replacement files in a temporary directory created under the current working directory. gold/ * debug.h (DEBUG_PLUGIN): New constant. (DEBUG_ALL): Add DEBUG_PLUGIN. (debug_string_to_enum): Likewise. * plugin.cc (make_sized_plugin_object): Add filename parameter. (Plugin_recorder): New class. (Plugin_manager::~Plugin_manager): Delete recorder_. (Plugin_manager::load_plugins): Create and initialize recorder_. (Plugin_manager::claim_file): Record claimed and unclaimed files. (Plugin_manager::make_plugin_object): Use object name as name for plugin object, if available. (Plugin_manager::add_input_file): Record replacement files. (Sized_pluginobj::do_add_symbols): Record plugin symbols. (Plugin_finish::run): Call Plugin_recorder::finish(). (make_sized_plugin_object): Add filename parameter and pass to Sized_pluginobj constructor. * plugin.h (Plugin::filename): New method. (Plugin::recorder): New method. (Plugin::recorder_): New data member.
2018-03-23Change machoread.c to use std::vectorTom Tromey2-56/+47
This changes machoread.c to use std::vector rather than VEC. This allows removing some cleanups. Regression tested by the buildbot, though I don't think anything actually tests macho reading. gdb/ChangeLog 2018-03-23 Tom Tromey <tom@tromey.com> * machoread.c (struct oso_el): Add a constructor. Don't define as a typedef. (macho_register_oso): Remove. (macho_symtab_read): Take a std::vector. (oso_el_compare_name): Now a std::sort comparator. (macho_symfile_read_all_oso): Take a std::vector. (macho_symfile_read): Use std::vector. Remove cleanups.
2018-03-23Make gdbserver find_register_by_number staticAlan Hayward3-16/+14
gdbserver/ * regcache.c (find_register_by_number): Make static. (find_regno): Use find_register_by_number * regcache.h (struct reg): Remove declaration.
2018-03-23Improve readelf's selection of a file start symbol when displaying a gnu ↵Nick Clifton5-13/+36
build attribute. * readelf.c (get_symbol_for_build_attribute): Skip ARM mapping symbols. (print_gnu_build_attribute_description): If no file start symbol could be found, look for one two bytes into the file. * testsuite/binutils-all/note-4-64.s: Set the address of the file start symbol to two bytes into the file. * testsuite/binutils-all/note-4-32.s: Likewise.
2018-03-23Add an extra library name template to the list used by the WIN32 targets.Nick Clifton4-0/+13
PR 22948 * emultempl/pe.em (open_dynamic_archive): Add libXXX.lib template to library name list. * emultempl/pep.em (open_dynamic_archive): Likewise. * ld.texinfo (WIN32): Update documentation.
2018-03-23gdb: Fix testsuite issue in gdb.arch/amd64-disp-step-avx.expAndrew Burgess3-8/+32
This test starts up and confirms that $xmm0 has the value 0, it then modifies $xmm0 (in the inferior) and confirms that the new value can be read (in GDB). On some machines I was noticing that this test would occasionally fail, and on investigation I believe that the reason for this is that the test is linked as a dynamically linked executable and makes use of the system libraries during startup. The reason that this causes problems is that both the runtime linker and the startup code run before main can, and do (on at least some platforms) make use of the XMM registers. In this commit I modify the test program slightly to allow it to be linked statically, without using the startup libraries. Now by the time GDB reaches the symbol main we have only executed one 'nop' instruction, and the XMM registers should all have the value 0. I've extended the test script to confirm that $xmm0 to $xmm15 are all initially 0, and I also check that at the point after $xmm0 has been modified, all the other XMM registers ($xmm1 to $xmm15) are still 0. The test program is still linked against libc in order that we can call the exit function, however, we now call _exit rather than exit in order to avoid all of the usual cleanup that exit does. This clean up tries to tear down things that are usually setup during the startup code, but now this isn't called calling exit will just result in a crash. gdb/testsuite/ChangeLog: * gdb.arch/amd64-disp-step-avx.S: Add '_start' label. (done): Call '_exit' not 'exit' to avoid atexit handlers. * gdb.arch/amd64-disp-step-avx.exp: Pass -static, and -nostartfiles when compiling the test. Confirm that all registers xmm0 to xmm15 are initially 0, and that xmm1 to xmm15 are 0 after.
2018-03-23gdb: Minor cleanup in some gdb.arch/* testsAndrew Burgess6-33/+16
A small number of tests incorrectly tried to pass -Wa,-g through to GCC as an extra compile time flag, either to gdb_compile or prepare_for_testing. The problem is that the syntax used for passing the flags was incorrect, and as a result these extra flags were being ignored. Luckily, the 'debug' flag was being passed in each case anyway, which means that the '-g' flag would already be added. Given that all these tests pass 'debug', and the invalid flag has been ignored for some time, I'm just removing the flags in this commit. I've also changed the tests from using gdb_compile to prepare_for_testing, which allows some extra code to be removed from a couple of tests scripts. There should be no change in the test results after this commit. gdb/testsuite/ChangeLog: * gdb.arch/amd64-disp-step-avx.exp: Remove unneeded assembler flag option, syntax was wrong anyway. * gdb.arch/arm-disp-step.exp: Likewise. * gdb.arch/sparc64-regs.exp: Likewise. * gdb.arch/amd64-disp-step.exp: Remove unneeded assembler flag option, syntax was wrong anyway, switch to use prepare_for_testing. * gdb.arch/i386-disp-step.exp: Likewise.
2018-03-23Move gdbserver tdesc header funcs to c fileAlan Hayward3-42/+57
gdbserver/ * tdesc.c (target_desc::~target_desc): Move to here. (target_desc::operator==): Likewise. * tdesc.h (target_desc::~target_desc): Move from here. (target_desc::operator==): Likewise.
2018-03-23Testsuite: fully migrate to use_gdb_stub convenience funcAndreas Arnez25-24/+52
In the GDB test suite, there are still multiple invocations of "target_info exists use_gdb_stub". However, the recommended way of checking for use_gdb_stub is to call the convenience function of the same name. Replace these occurrences and just call "use_gdb_stub" instead. gdb/testsuite/ChangeLog: * gdb.ada/exec_changed.exp: Replace "target_info exists use_gdb_stub" by "use_gdb_stub". * gdb.ada/start.exp: Likewise. * gdb.base/async-shell.exp: Likewise. * gdb.base/attach-pie-misread.exp: Likewise. * gdb.base/attach-wait-input.exp: Likewise. * gdb.base/break-entry.exp: Likewise. * gdb.base/break-interp.exp: Likewise. * gdb.base/dprintf-detach.exp: Likewise. * gdb.base/nostdlib.exp: Likewise. * gdb.base/solib-nodir.exp: Likewise. * gdb.base/statistics.exp: Likewise. * gdb.base/testenv.exp: Likewise. * gdb.mi/mi-exec-run.exp: Likewise. * gdb.mi/mi-start.exp: Likewise. * gdb.multi/dummy-frame-restore.exp: Likewise. * gdb.multi/multi-arch-exec.exp: Likewise. * gdb.multi/multi-arch.exp: Likewise. * gdb.multi/tids.exp: Likewise. * gdb.multi/watchpoint-multi.exp: Likewise. * gdb.python/py-events.exp: Likewise. * gdb.threads/attach-into-signal.exp: Likewise. * gdb.threads/attach-stopped.exp: Likewise. * gdb.threads/threadapply.exp: Likewise. * lib/selftest-support.exp: Likewise.
2018-03-22Remove some cleanups from record-full.cTom Tromey2-15/+12
This removes some cleanups from record-full.c in a straightforward way. Tested by the buildbot. gdb/ChangeLog 2018-03-22 Tom Tromey <tom@tromey.com> * record-full.c (record_full_exec_insn): Use gdb::byte_vector. (record_full_goto_bookmark): Use std::string.
2018-03-23Automatic date update in version.inGDB Administrator1-1/+1
2018-03-22ppc: Fix stwux and stdux masks in skip_prologuePedro Franco de Carvalho2-9/+8
This patch merges the masks for matching the stwux and stdux instructions in rs6000-tdep.c:skip_prologue into a single mask that only matches these two instructions. Commit 72dd273062 fixed the warning described in PR tdep/18295, this patch addresses the comment in the same PR indicating that the mask was too permissive. gdb/Changelog: PR tdep/18295 * rs6000-tdep.c (skip_prologue): Match both stwux and stdux a single mask.
2018-03-22ppc: Detect when LR is saved through frame pointerPedro Franco de Carvalho2-18/+63
This patch extends rs6000-tdep.c:skip_prologue so that it can detect when the Link Register is saved using the frame pointer (usually r31) in adition to the stack pointer (r1). The frame pointer offset from the frame base is tracked separately from the stack pointer offset for cases when the frame pointer is not in synch with the stack pointer at the moment of the LR save. Previously, "stq" could also be detected as an instruction that saves LR or CR. Because this was likely unintentional, this patch also restricts the matches to stw/stwu/std/stdu. gdb/ChangeLog: * rs6000-tdep.c (store_insn_p): New function. (skip_prologue): New variable alloca_reg_offset. Set lr_reg and cr_reg to their unshifted values. Use store_insn_p to match LR saves using either R1 or fdata->alloca_reg. Use store_insn_p to match CR saves. Set alloca_reg_offset when alloca_reg and framep are set. Remove lr_reg shift when assigning to fdata->lr_register.
2018-03-22Make "info proc cmdline" show args on GNU/LinuxAndreas Arnez4-4/+38
Currently "info proc cmdline" on GNU/Linux does not show the full command line, but only argument 0. And even a warning is shown if there are more. This was discussed in 2014 already: https://sourceware.org/ml/gdb-patches/2014-04/msg00212.html Follow the advice there and avoid target_fileio_read_stralloc. Instead, use target_fileio_read_alloc to read the whole command line and then replace NUL characters by spaces. Also add an appropriate test case. Note that gdbserver already handles this correctly. gdb/ChangeLog: * linux-tdep.c (linux_info_proc): For "info proc cmdline", print command line args instead of emitting a warning. gdb/testsuite/ChangeLog: * gdb.base/info-proc.exp: Add test for "info proc cmdline".
2018-03-22S390: Correct brace style in s390_get_wordsizeAndreas Arnez2-4/+9
This corrects bad formatting in the newly introduced function s390_get_wordsize. gdb/gdbserver/ChangeLog: * linux-s390-low.c (s390_get_wordsize): Correct brace style.
2018-03-22x86: use local variable in check_VecOperands()Jan Beulich2-7/+13
This is just to make a subsequent change a little easier to read.
2018-03-22x86: drop pointless VecESizeJan Beulich3-952/+958
The attribute is meaningful only in templates allowing embedded broadcast. Drop them everywhere else.
2018-03-22x86: drop remaining redundant DispNJan Beulich2-75/+81
A few of them were missed in commit 7ac2002247 ("x86: derive DispN from BaseIndex") and also couldn't be removed by subsequent commits touching certain templates anyway.
2018-03-22ix86: allow HLE store of accumulator to absolute addressJan Beulich5-0/+25
Since they're shorter to encode, the 0xa0...0xa3 encodings are preferred for moves between accumulator and absolute address outside of 64-bit mode. With HLE release semantics this encoding is unsupported though, with the assembler raising an error. The operation is valid though, we merely need to pick the longer encoding in that case.
2018-03-22x86: fix swapped operand handling for BNDMOVJan Beulich10-7/+54
The wrong placement of the Load attribute in the templates prevented this from working. The disassembler also didn't handle this consistently with other similar dual-encoding insns.
2018-03-22x86/Intel: fix fallout from earlier template foldingJan Beulich8-27/+366
While many templates allowing multiple suitably matching XMM/YMM/ZMM operand sizes can be folded, a few need to be split in order to not wrongly accept "xmmword ptr" operands when only XMM registers are permitted (and memory operands are more narrow). Add a test case validating this.
2018-03-22x86: fold a few XOP templatesJan Beulich8-240/+200
Also add a new test case verifying that mixed operands of SIMD insns with a size-less memory operand in the middle are properly rejected.
2018-03-22Get rid of VEC(static_tracepoint_marker_p)Simon Marchi14-195/+183
This patch replaces VEC(static_tracepoint_marker_p) with std::vector, and does some c++ification around that. I thought a new overload of hex2str was useful, so I added it as well as corresponding unit tests. I also added an overload of ui_out::field_string that takes an std::string directly. gdb/ChangeLog: * tracepoint.h (struct static_tracepoint_marker): Initialize fields, define default constructor, move constructor and move assignment, disable the rest. <str_id, extra>: Make std::string. (release_static_tracepoint_marker): Remove. (free_current_marker): Remove. * tracepoint.c (free_current_marker): Remove. (parse_static_tracepoint_marker_definition): Adjust to std::string, use new hex2str overload. (release_static_tracepoint_marker): Remove. (print_one_static_tracepoint_marker): Get marker by reference and adjust to std::string. (info_static_tracepoint_markers_command): Adjust to std::vector changes * target.h (static_tracepoint_marker_p): Remove typedef. (DEF_VEC_P(static_tracepoint_marker_p)): Remove. (struct target_ops) <to_static_tracepoint_marker_at>: Return bool. <to_static_tracepoint_markers_by_strid>: Return std::vector. * target-debug.h (target_debug_print_VEC_static_tracepoint_marker_p_p): Remove. (target_debug_print_std_vector_static_tracepoint_marker): New. (target_debug_print_struct_static_tracepoint_marker_p): Rename to... (target_debug_print_static_tracepoint_marker_p): ... this. * target-delegates.c: Re-generate. * breakpoint.h (struct tracepoint) <static_trace_marker_id>: Make std::string. * breakpoint.c (init_breakpoint_sal): Adjust to std::string. (decode_static_tracepoint_spec): Adjust to std::vector. (tracepoint_print_one_detail): Adjust to std::string. (strace_marker_decode_location): Adjust to std::string. (update_static_tracepoint): Adjust to std::string, remove call to release_static_tracepoint_marker. * linux-nat.c (linux_child_static_tracepoint_markers_by_strid): Adjust to std::vector. * remote.c (remote_static_tracepoint_marker_at): Return bool. (remote_static_tracepoint_markers_by_strid): Adjust to std::vector. * common/rsp-low.h (hex2str): New overload with explicit count of bytes. * common/rsp-low.c (hex2str): New overload with explicit count of bytes. * unittests/rsp-low-selftests.c (test_hex2str): New function. (_initialize_rsp_low_selftests): Add test_hex2str test. * unittests/tracepoint-selftests.c (test_parse_static_tracepoint_marker_definition): Adjust to std::string.
2018-03-22Make parse_static_tracepoint_marker_definition work with multiple static ↵Simon Marchi4-3/+91
tracepoint definitions Since I modify the parse_static_tracepoint_marker_definition function in the next patch, I wanted to write a unit test for it. Doing so showed that it doesn't handle multiple consecutive static tracepoint definitions separated by commas. However, the RSP documentation [1] states that servers may return multiple definitions, like: 1234:6d61726b657231:6578747261207374756666,abba:6d61726b657232: The problem is that the function uses strlen to compute the length of the last field (the extra field). If there are additional definitions in addition to the one we are currently parsing, the returned length will include those definitions, and we'll try to hex-decode past the extra field. This patch changes parse_static_tracepoint_marker_definition to consider the case where the current definition is followed by a comma and more definitions. It also adds the unit test that found the issue in the first place. I don't think this causes any backwards compatibility issues, because the previous code only handled single static tracepoint definitions, and the new code handles that correctly. gdb/ChangeLog: * tracepoint.c (parse_static_tracepoint_marker_definition): Consider case where the definition is followed by more definitions. * Makefile.in (SUBDIR_UNITTESTS_SRCS): Add tracepoint-selftests.c. * unittests/tracepoint-selftests.c: New. [1] https://sourceware.org/gdb/onlinedocs/gdb/Tracepoint-Packets.html#qTfSTM
2018-03-22Automatic date update in version.inGDB Administrator1-1/+1