aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2016-10-18Update gnulib to current upstream masterPedro Alves174-766/+2178
I tried building gdb with G++ 4.7 and CXX="g++ -std=gnu+11", and that tripped on a build error: In file included from build-gnulib/import/stdio.h:53:0, from /home/pedro/gdb/mygit/cxx-convertion/src/gdb/common/common-defs.h:31, from /home/pedro/gdb/mygit/cxx-convertion/src/gdb/defs.h:28, from /home/pedro/gdb/mygit/cxx-convertion/src/gdb/armobsd-tdep.c:20: build-gnulib/import/stddef.h:104:3: error: conflicting declaration ‘typedef union max_align_t max_align_t’ In file included from build-gnulib/import/stddef.h:55:0, from build-gnulib/import/stdio.h:53, from /home/pedro/gdb/mygit/cxx-convertion/src/gdb/common/common-defs.h:31, from /home/pedro/gdb/mygit/cxx-convertion/src/gdb/defs.h:28, from /home/pedro/gdb/mygit/cxx-convertion/src/gdb/armobsd-tdep.c:20: /opt/gcc-4.7/lib/gcc/x86_64-unknown-linux-gnu/4.7.4/include/stddef.h:426:3: error: ‘max_align_t’ has a previous declaration as ‘typedef struct max_align_t max_align_t’ Updating gnulib to current master fixes it, since it brings in this fix: http://lists.gnu.org/archive/html/bug-gnulib/2016-04/msg00000.html Our last update was in August 2015. This doesn't bring in much added baggage, it's mostly bug fixes. It pulled in the "limits-h" module as automatic dependency, and given that looks potentially useful I added it to the set of modules we require. Tested on x86_64 Fedora 23, with g++ 4.7 and g++ 5.3, native and gdbserver. gdb/ChangeLog: 2016-10-18 Pedro Alves <palves@redhat.com> * gnulib/update-gnulib.sh (GNULIB_COMMIT_SHA1): Set to 2692e23a48e21f6daa029e8af9f1a143b7532f47. * gnulib/configure, gnulib/config.in, gnulib/aclocal.m4: Regenerate. * gnulib/import/Makefile: Update. * gnulib/import/alloca: Update. * gnulib/import/basename-lgpl: Update. * gnulib/import/canonicalize-lgpl: Update. * gnulib/import/config: Update. * gnulib/import/dirent: Update. * gnulib/import/dirfd: Update. * gnulib/import/dirname-lgpl: Update. * gnulib/import/dirname.h: Update. * gnulib/import/dosname.h: Update. * gnulib/import/errno: Update. * gnulib/import/extra/snippet/arg-nonnull.h: Update. * gnulib/import/extra/snippet/c++defs.h: Update. * gnulib/import/extra/snippet/warn-on-use.h: Update. * gnulib/import/extra/update-copyright: Update. * gnulib/import/flexmember.h: Update. * gnulib/import/float+.h: Update. * gnulib/import/float: Update. * gnulib/import/float: Update. * gnulib/import/fnmatch: Update. * gnulib/import/fnmatch: Update. * gnulib/import/fnmatch_loop: Update. * gnulib/import/fpucw.h: Update. * gnulib/import/frexp: Update. * gnulib/import/frexpl: Update. * gnulib/import/gettimeofday: Update. * gnulib/import/hard-locale: Update. * gnulib/import/hard-locale.h: Update. * gnulib/import/inttypes: Update. * gnulib/import/isnan: Update. * gnulib/import/isnand-nolibm.h: Update. * gnulib/import/isnand: Update. * gnulib/import/isnanl-nolibm.h: Update. * gnulib/import/isnanl: Update. * gnulib/import/itold: Update. * gnulib/import/limits: Update. * gnulib/import/localcharset: Update. * gnulib/import/localcharset.h: Update. * gnulib/import/lstat: Update. * gnulib/import/m4/00gnulib: Update. * gnulib/import/m4/absolute-header: Update. * gnulib/import/m4/alloca: Update. * gnulib/import/m4/canonicalize: Update. * gnulib/import/m4/codeset: Update. * gnulib/import/m4/configmake: Update. * gnulib/import/m4/dirent_h: Update. * gnulib/import/m4/dirfd: Update. * gnulib/import/m4/dirname: Update. * gnulib/import/m4/double-slash-root: Update. * gnulib/import/m4/eealloc: Update. * gnulib/import/m4/errno_h: Update. * gnulib/import/m4/exponentd: Update. * gnulib/import/m4/exponentl: Update. * gnulib/import/m4/extensions: Update. * gnulib/import/m4/extern-inline: Update. * gnulib/import/m4/fcntl-o: Update. * gnulib/import/m4/flexmember: Update. * gnulib/import/m4/float_h: Update. * gnulib/import/m4/fnmatch: Update. * gnulib/import/m4/fpieee: Update. * gnulib/import/m4/frexp: Update. * gnulib/import/m4/frexpl: Update. * gnulib/import/m4/gettimeofday: Update. * gnulib/import/m4/glibc21: Update. * gnulib/import/m4/gnulib-cache: Update. * gnulib/import/m4/gnulib-common: Update. * gnulib/import/m4/gnulib-comp: Update. * gnulib/import/m4/gnulib-tool: Update. * gnulib/import/m4/hard-locale: Update. * gnulib/import/m4/include_next: Update. * gnulib/import/m4/inttypes-pri: Update. * gnulib/import/m4/inttypes: Update. * gnulib/import/m4/isnand: Update. * gnulib/import/m4/isnanl: Update. * gnulib/import/m4/largefile: Update. * gnulib/import/m4/limits-h: Update. * gnulib/import/m4/localcharset: Update. * gnulib/import/m4/locale-fr: Update. * gnulib/import/m4/locale-ja: Update. * gnulib/import/m4/locale-zh: Update. * gnulib/import/m4/longlong: Update. * gnulib/import/m4/lstat: Update. * gnulib/import/m4/malloc: Update. * gnulib/import/m4/malloca: Update. * gnulib/import/m4/math_h: Update. * gnulib/import/m4/mbrtowc: Update. * gnulib/import/m4/mbsinit: Update. * gnulib/import/m4/mbsrtowcs: Update. * gnulib/import/m4/mbstate_t: Update. * gnulib/import/m4/memchr: Update. * gnulib/import/m4/memmem: Update. * gnulib/import/m4/mmap-anon: Update. * gnulib/import/m4/multiarch: Update. * gnulib/import/m4/nocrash: Update. * gnulib/import/m4/off_t: Update. * gnulib/import/m4/pathmax: Update. * gnulib/import/m4/rawmemchr: Update. * gnulib/import/m4/readlink: Update. * gnulib/import/m4/rename: Update. * gnulib/import/m4/rmdir: Update. * gnulib/import/m4/signal_h: Update. * gnulib/import/m4/ssize_t: Update. * gnulib/import/m4/stat: Update. * gnulib/import/m4/stdbool: Update. * gnulib/import/m4/stddef_h: Update. * gnulib/import/m4/stdint: Update. * gnulib/import/m4/stdio_h: Update. * gnulib/import/m4/stdlib_h: Update. * gnulib/import/m4/strchrnul: Update. * gnulib/import/m4/string_h: Update. * gnulib/import/m4/strstr: Update. * gnulib/import/m4/strtok_r: Update. * gnulib/import/m4/sys_socket_h: Update. * gnulib/import/m4/sys_stat_h: Update. * gnulib/import/m4/sys_time_h: Update. * gnulib/import/m4/sys_types_h: Update. * gnulib/import/m4/time_h: Update. * gnulib/import/m4/unistd_h: Update. * gnulib/import/m4/warn-on-use: Update. * gnulib/import/m4/wchar_h: Update. * gnulib/import/m4/wchar_t: Update. * gnulib/import/m4/wctype_h: Update. * gnulib/import/m4/wint_t: Update. * gnulib/import/malloc: Update. * gnulib/import/malloca: Update. * gnulib/import/malloca.h: Update. * gnulib/import/math: Update. * gnulib/import/math: Update. * gnulib/import/mbrtowc: Update. * gnulib/import/mbsinit: Update. * gnulib/import/mbsrtowcs-impl.h: Update. * gnulib/import/mbsrtowcs-state: Update. * gnulib/import/mbsrtowcs: Update. * gnulib/import/memchr: Update. * gnulib/import/memmem: Update. * gnulib/import/pathmax.h: Update. * gnulib/import/rawmemchr: Update. * gnulib/import/readlink: Update. * gnulib/import/ref-add.sin: Update. * gnulib/import/ref-del.sin: Update. * gnulib/import/rename: Update. * gnulib/import/rmdir: Update. * gnulib/import/same-inode.h: Update. * gnulib/import/signal: Update. * gnulib/import/stat: Update. * gnulib/import/stdbool: Update. * gnulib/import/stddef: Update. * gnulib/import/stdint: Update. * gnulib/import/stdio: Update. * gnulib/import/stdlib: Update. * gnulib/import/str-two-way.h: Update. * gnulib/import/strchrnul: Update. * gnulib/import/streq.h: Update. * gnulib/import/string: Update. * gnulib/import/stripslash: Update. * gnulib/import/strnlen1: Update. * gnulib/import/strnlen1.h: Update. * gnulib/import/strstr: Update. * gnulib/import/strtok_r: Update. * gnulib/import/sys_stat: Update. * gnulib/import/sys_time: Update. * gnulib/import/sys_types: Update. * gnulib/import/time: Update. * gnulib/import/unistd: Update. * gnulib/import/unistd: Update. * gnulib/import/verify.h: Update. * gnulib/import/wchar: Update. * gnulib/import/wctype: Update. * gnulib/import/flexmember.h: New file. * gnulib/import/hard-locale.c: New file. * gnulib/import/hard-locale.h: New file. * gnulib/import/limits.in.h: New file. * gnulib/import/m4/flexmember.m4: New file. * gnulib/import/m4/hard-locale.m4: New file. * gnulib/import/m4/limits-h.m4: New file.
2016-10-18Check addr32flag instead of sizeflag for rip/eipH.J. Lu2-2/+8
Since the address size prefix, 0x67, is ignored for MPX instructions in 64-bit mode, we should check addr32flag instead of sizeflag for rip/eip. PR binutis/20699 * i386-dis.c (OP_E_memory): Check addr32flag instead of sizeflag for rip/eip.
2016-10-18Remove the remaining SSE5 supportH.J. Lu2-1/+6
PR binutis/20704 * i386-dis.c (three_byte_table): Remove the remaining SSE5 support.
2016-10-18Introduce gdb::unique_ptrPedro Alves3-0/+394
Many make_cleanup uses in the code base are best eliminated by using a "owning" smart pointer to manage ownership of the resource automatically. The question is _which_ smart pointer. GDB currently supports building with a C++03 compiler. We have std::auto_ptr in C++03, but, as is collective wisdom by now, that's too easy to misuse, and has therefore been deprecated in C++11 and finally removed in C++17. It'd be nice to be able to use std::unique_ptr instead, which is the modern, safe std::auto_ptr replacement in C++11. In addition to extra safety -- moving (i.e., transfer of ownership of the managed pointer between smart pointers) must be explicit -- std::unique_ptr has (among others) one nice feature that std::auto_ptr doesn't --- ability to specify a custom deleter as template parameter. In gdb's context, that allows easily creating a smart pointer for memory allocated with xmalloc -- the smart pointer then knows to release with xfree instead of delete. This is particularly interesting when managing objects allocated in C libraries, and also, for C++-fying parts of GDB that interact with other parts that still return objects allocated with xmalloc. Since std::unique_ptr's API is quite nice, and eventually we'd like to move to C++11, this patch adds a C++03-compatible smart pointer that exposes the subset of the std::unique_ptr API that we're interested in. An advantage is that whenever we start requiring C++11, we won't have to learn a new API. Meanwhile, this allows continuing to support building with a C++03 compiler. Since C++03 doesn't support rvalue references (boost gets close to emulating them, but it's not fully transparent to user code), the C++03 std::unique_ptr emulation here doesn't try hard to prevent accidentally moving, which is where most of complication of a more thorough emulation would be. Instead, we rely on the fact that GDB will be usually compiled with a C++11 compiler, and use the real std::unique_ptr in that case to catch such accidental moves. IOW, the goal here is to allow code that would be correct using std::unique_ptr to be equally correct in C++03 mode, and, just as efficient. The C++03 version was originally based on GCC 7.0's std::auto_ptr and then heavily customized to behave more like C++11's std::unique_ptr: - Support for custom (stateless) deleters. (Support for stateful deleters could be added, if necessary.) - unique_ptr<T[]> partial specialization (auto_ptr<T> does not know to use delete[]). - Support for all of 'ptr != NULL', 'ptr == NULL' and 'if (ptr)' using the safe bool idiom to emulate C++11's explicit bool operator. - There's no nullptr in C++03, so this allows initialization and assignment from NULL instead (std::auto_ptr allows neither). - Variable names un-uglified (ie., no leading __ prefix everywhere). - Formatting made to follow GDB's coding conventions, including comment style. - Converting "move" constructors done differently in order to truly support: unique_ptr<Derived> func_returning_unique_ptr (.....); ... unique_ptr<Base> ptr = func_returning_unique_ptr (.....); At this point, it no longer shares much at all with the original file, but, that's the history. See comments in the code to find out more. I thought of putting the "emulation" / shim in the "std" namespace, so that when we start requiring C++11 at some point, no actual changes to users of the smart pointer throughout would be necessary. Putting things in the std namespace is technically undefined, however in practice it doesn't cause any issue with any compiler. However, thinking that people might be confused with seeing std::unique_ptr and thinking that we're actually requiring C++11 already, I put the new types in the "gdb" namespace instead. For managing xmalloc pointers, this adds a gdb::unique_xmalloc_ptr<T> "specialization" with a custom xfree deleter. No actual use of any smart pointer is introduced in this patch. That'll be done in following patches. Tested (along with the rest of the series) on: - NetBSD 5.1 (gcc70 on the compile farm), w/ gcc 4.1.3 - x86-64 Fedora 23, gcc 5.3.1 (gnu++03) - x86-64 Fedora 23, and gcc 7.0 (gnu++14) gdb/ChangeLog: 2016-10-18 Pedro Alves <palves@redhat.com> * common/common-defs.h: Include "gdb_unique_ptr.h". * common/gdb_unique_ptr.h: New.
2016-10-18Updated Danish translation for the BFD library.Nick Clifton2-1767/+2553
2016-10-18sim: avr: move changelog entries to subdirMike Frysinger2-7/+7
2016-10-18i386-tdep: Verify architecture before proceeding with `set/show mpx'Maciej W. Rozycki2-2/+10
Make sure the architecture is `bfd_arch_i386' before handling the `set mpx' and `show mpx' commands, avoiding the issue with `i386_mpx_enabled' interpreting `gdbarch->tdep' according to the `struct gdbarch_tdep' definition in i386-tdep.h while indeed in a multi-target configuration it may have a different layout and cause GDB to crash or at least misbehave. gdb/ * i386-tdep.c (i386_mpx_info_bounds): Make sure the architecture is `bfd_arch_i386' before proceeding. (i386_mpx_set_bounds): Likewise.
2016-10-18tilegx-tdep: Correct aliasing errors in `tilegx_analyze_prologue'Maciej W. Rozycki2-1/+6
Fix a load of aliasing build errors: cc1plus: warnings being treated as errors .../gdb/tilegx-tdep.c: In function 'CORE_ADDR tilegx_analyze_prologue(gdbarch*, CORE_ADDR, CORE_ADDR, tilegx_frame_cache*, frame_info*)': .../gdb/tilegx-tdep.c:609: error: dereferencing pointer 'operands' does break strict-aliasing rules .../gdb/tilegx-tdep.c:592: error: dereferencing pointer 'operands' does break strict-aliasing rules .../gdb/tilegx-tdep.c:571: error: dereferencing pointer 'operands' does break strict-aliasing rules [...] .../gdb/tilegx-tdep.c:601: error: dereferencing pointer '<anonymous>' does break strict-aliasing rules .../gdb/tilegx-tdep.c:601: note: initialized from here cc1plus: error: dereferencing pointer 'operands' does break strict-aliasing rules cc1plus: error: dereferencing pointer 'operands' does break strict-aliasing rules .../gdb/tilegx-tdep.c:452: note: initialized from here cc1plus: error: dereferencing pointer 'pretmp.896' does break strict-aliasing rules cc1plus: note: initialized from here cc1plus: error: dereferencing pointer 'pretmp.896' does break strict-aliasing rules cc1plus: note: initialized from here make[1]: *** [tilegx-tdep.o] Error 1 from an attempt to cast a `long long' pointer to an `int64_t' pointer, which may not necessarily be compatible types. Use the `long long' type for the auxiliary variable then as this is the type of the structure member referred. gdb/ * tilegx-tdep.c (tilegx_analyze_prologue): Use the `long long' type for `operands'.
2016-10-18AArch64/opcodes: Correct an `index' global shadowing errorMaciej W. Rozycki2-4/+9
Fix a commit 4df068de5214 ("Add support for SVE addressing modes") build regression: cc1: warnings being treated as errors .../opcodes/aarch64-dis.c: In function 'aarch64_ext_sve_addr_rr_lsl': .../opcodes/aarch64-dis.c:1324: error: declaration of 'index' shadows a global declaration /usr/include/string.h:303: error: shadowed declaration is here make[3]: *** [aarch64-dis.lo] Error 1 in a way following commit 91d6fa6a035c ("Add -Wshadow to the gcc command line options used when compiling the binutils."). opcodes/ * aarch64-dis.c (aarch64_ext_sve_addr_rr_lsl): Rename `index' local variable to `index_regno'.
2016-10-18NDS32/BFD: Correct an aliasing error in `nds32_elf_check_relocs'Maciej W. Rozycki2-2/+8
Fix an aliasing build error: cc1: warnings being treated as errors .../bfd/elf32-nds32.c: In function 'nds32_elf_check_relocs': .../bfd/elf32-nds32.c:6644: warning: dereferencing type-punned pointer will break strict-aliasing rules make[3]: *** [elf32-nds32.lo] Error 1 in a way following commit 6edfbbad0864 ("Fix up gcc4.1 aliasing warnings"), <https://sourceware.org/ml/binutils/2005-10/msg00071.html>. bfd/ * elf32-nds32.c (nds32_elf_check_relocs): Avoid aliasing warning from GCC.
2016-10-18ARM/BFD: Correct an `index' global shadowing errorMaciej W. Rozycki2-4/+9
Fix a commit 5025eb7c0d87 ("Delete relocations associatesd with deleted exidx entries.") build regression: cc1: warnings being treated as errors .../bfd/elf32-arm.c: In function 'elf32_arm_update_relocs': .../bfd/elf32-arm.c:14951: warning: declaration of 'index' shadows a global declaration /usr/include/string.h:304: warning: shadowed declaration is here make[3]: *** [elf32-arm.lo] Error 1 in a way following commit 91d6fa6a035c ("Add -Wshadow to the gcc command line options used when compiling the binutils."). bfd/ * elf32-arm.c (elf32_arm_update_relocs): Rename `index' local variable to `reloc_index'.
2016-10-18Automatic date update in version.inGDB Administrator1-1/+1
2016-10-17Fix duplicate test message in mi-trace-save.expSimon Marchi2-1/+6
gdb/testsuite/ChangeLog: * gdb.trace/mi-trace-save.exp (test_trace_save_wrong_num_args): Change test message.
2016-10-17Fix comment in mi-trace-save.expSimon Marchi2-1/+6
This fixes a comment I forgot to update in the previous patch. gdb/testsuite/ChangeLog: * gdb.trace/mi-trace-save.exp (test_trace_save_wrong_num_args): Update comment.
2016-10-17Fix -trace-save crash when argument is missingSimon Marchi4-0/+56
-trace-save doesn't check whether an argument is passed, leading to a segfault if you pass nothing. I added a small test, which only tests the error conditions of -trace-save. gdb/ChangeLog: * mi/mi-main.c (mi_cmd_trace_save): Check if argument is present before using it. gdb/testsuite/ChangeLog: * gdb.trace/mi-trace-save.exp: New file.
2016-10-17gdb: Fix phony iconv buildPedro Alves2-0/+9
Cross building gdb for mingw32 on Fedora 23 fails with: x86_64-w64-mingw32-g++ -g -O2 [...] ../../src/gdb/charset.c In file included from ../../src/gdb/charset.c:21:0: ../../src/gdb/charset.h:134:3: error: 'iconv_t' does not name a type iconv_t m_desc; ^ ../../src/gdb/charset.c: In constructor 'wchar_iterator::wchar_iterator(const gdb_byte*, size_t, const char*, size_t)': ../../src/gdb/charset.c:600:3: error: 'm_desc' was not declared in this scope m_desc = iconv_open (INTERMEDIATE_ENCODING, charset); ^ ../../src/gdb/charset.c: In destructor 'wchar_iterator::~wchar_iterator()': ../../src/gdb/charset.c:607:7: error: 'm_desc' was not declared in this scope if (m_desc != (iconv_t) -1) ^ ../../src/gdb/charset.c: In member function 'int wchar_iterator::iterate(wchar_iterate_result*, gdb_wchar_t**, const gdb_byte**, size_t*)': ../../src/gdb/charset.c:633:25: error: 'm_desc' was not declared in this scope size_t r = iconv (m_desc, &inptr, &m_bytes, &outptr, &out_avail); ^ This is a regression caused by commit cda6c55bd399 (Turn wchar iterator into a class). The problem is that iconv_t is now exposed in gdb/charset.h, while before it was only used in gdb/charset.c. gdb/charset.c, under #ifdef PHONY_ICONV, does: #undef iconv_t #define iconv_t int So it seems the simplest is to use 'int' in the header file too. gdb/ChangeLog: 2016-10-17 Pedro Alves <palves@redhat.com> * charset.h (class wchar_iterator) [PHONY_ICONV] <m_desc>: Use 'int' as type.
2016-10-17Fixed matching in newly added test.Cupertino Miranda2-1/+5
gas/ChangeLog: 2016-10-17 Cupertino Miranda <cmiranda@synopsys.com> * testsuite/arc/dis-inv.d: Fixed target match.
2016-10-17Display unknown notes. Decode NT_GNU_HWCAP notes.Nick Clifton3-38/+124
* readelf.c (apply_relocations): Fail if the symbol table section linked to by the reloc section does not have either the SHT_SYMTAB or SHT_DYNSYM type. (print_gnu_note): Decode the contents of NT_GNU_HWCAP notes. Print the contents of unknown note types. (process_note): Add the file and section to the parameter list. Use print_symbol to display the note name. Display the contents of unknown note types. (process_corefile_note_segment): Rename to process_notes_at. Add section parameter. Apply relocations to the notes when loading from a section. Display section name when processing notes in a section. * testsuite/binutils-all/readelf.n: Update expected output.
2016-10-17Removed pseudo invalid instructions opcodes.Cupertino Miranda5-93/+25
The disassember was generating invXXX instructions for cases when in reality we had llockd or scondd instrutions. opcodes/ChangeLog: Cupertino Miranda <cmiranda@synopsys.com> arc-tbl.h: Removed any "inv.+" instructions from the table. gas/ChangeLog: Cupertino Miranda <cmiranda@synopsys.com> testsuite/arc/dis-inv.s: Test to validate patch. testsuite/arc/dis-inv.d: Likewise.
2016-10-17Update list of ELF machine numbers.Nick Clifton4-11/+101
include * elf/common.h (DT_SYMTAB_SHNDX): Define. (EM_CLOUDSHIELD, EM_COREA_1ST, EM_COREA_2ND, EM_OPEN8): Define. (EM_VIDEOCORE5, EM_56800EX, EM_BA1, EM_BA2, EM_XCORE): Define. (EM_MCHP_PIC, EM_KM32, EM_KMX32, EM_KMX16, EM_KMX8): Define. (EM_KVARC, EM_CDP, EM_COGE, EM_COOL, EM_NORC): Define. (EM_CSR_KALIMBA, EM_Z80, EM_AMDGPU, EM_RISCV): Define. (ELFOSABI_OPENVOS): Define. (GRP_MASKOS, GRP_MASKPROC): Define. binutils * readelf.c (get_dynamic_type): Add DT_SYMTAB_SHNDX. (get_machine_type): Add EM_CLOUDSHIELD, EM_COREA_1ST, EM_COREA_2ND, EM_OPEN8, EM_VIDEOCORE5, EM_56800EX, EM_BA1, EM_BA2, EM_XCORE, EM_MCHP_PIC, EM_KM32, EM_KMX32, EM_KMX16, EM_KMX8, EM_KVARC, EM_CDP, EM_COGE, EM_COOL, EM_NORC, EM_CSR_KALIMBA, EM_Z80, EM_AMDGPU, EM_RISCV. (get_osabi_name): Add ELFOSABI_CLOUDABI and ELFOSABI_OPENVS. (get_group_flags): Update to handle flags in the GRP_MASKOS and GRP_MASKPROC ranges.
2016-10-17Sync libiberty sources with gcc mainline.Nick Clifton5-31/+152
2016-09-19 Andrew Stubbs <ams@codesourcery.com> * pex-win32.c (argv_to_cmdline): Quote zero-length parameters. * testsuite/test-pexecute.c (main): Insert check for zero-length parameters. 2016-09-10 Mark Wielaard <mjw@redhat.com> * cp-demangle.c (d_substitution): Change struct demangle_component variable name from c to dc. 2016-08-12 Marek Polacek <polacek@redhat.com> PR c/7652 * cp-demangle.c (d_print_mod): Add FALLTHRU. 2016-08-04 Marcel B?hme <boehme.marcel@gmail.com> PR c++/71696 * cplus-dem.c: Prevent infinite recursion when there is a cycle in the referencing of remembered mangled types. (work_stuff): New stack to keep track of the remembered mangled types that are currently being processed. (push_processed_type): New method to push currently processed remembered type onto the stack. (pop_processed_type): New method to pop currently processed remembered type from the stack. (work_stuff_copy_to_from): Copy values of new variables. (delete_non_B_K_work_stuff): Free stack memory. (demangle_args): Push/Pop currently processed remembered type. (do_type): Do not demangle a cyclic reference and push/pop referenced remembered type.
2016-10-17Automatic date update in version.inGDB Administrator1-1/+1
2016-10-16Automatic date update in version.inGDB Administrator1-1/+1
2016-10-15Regenerate spu_ovl.o_cAlan Modra2-53/+57
No real changes here. This is just so that we match current spu_ovl.o with .shstrtab moved. * emultempl/spu_ovl.o_c: Regenerate.
2016-10-15Automatic date update in version.inGDB Administrator1-1/+1
2016-10-14FINAL/OVERRIDE: Define to empty on g++ < 4.7Pedro Alves2-5/+24
final/override were only implemented in g++ 4.7. include/ChangeLog 2016-10-14 Pedro Alves <palves@redhat.com> * ansidecl.h [__cplusplus >= 201103 && GCC_VERSION < 4007] (FINAL, OVERRIDE): Define as empty. [__cplusplus < 201103 && GCC_VERSION < 4007] (FINAL): Define as __final. [__cplusplus < 201103 && GCC_VERSION >= 4007] (OVERRIDE): Define as empty.
2016-10-14Move OVERRIDE/FINAL from gcc/coretypes.h to include/ansidecl.hPedro Alves2-6/+27
So that GDB and other projects that share the top level can use them. Bootstrapped with all default languages + jit on x86-64 Fedora 23. gcc/ChangeLog: 2016-10-14 Pedro Alves <palves@redhat.com> * coretypes.h (OVERRIDE, FINAL): Delete, moved to include/ansidecl.h. include/ChangeLog: 2016-10-14 Pedro Alves <palves@redhat.com> * ansidecl.h (GCC_FINAL): Delete. (OVERRIDE, FINAL): New, moved from gcc/coretypes.h.
2016-10-14Fix typos in trace commands docSimon Marchi2-2/+7
gdb/doc/ChangeLog: * gdb.texinfo (Using Trace Files): Fix typo. (GDB/MI Tracepoint Commands): Likewise.
2016-10-14Document -ctf switch of -trace-saveSimon Marchi2-1/+10
The -trace-save MI command supports saving the trace in the CTF format, as its CLI counterpart, but it's not documented. gdb/doc/ChangeLog: * gdb.texinfo (GDB/MI Tracepoint Commands): Document -ctf switch of -trace-save.
2016-10-14Fix leftover remote test failures from PR binutils/19020Luis Machado2-1/+7
As pointed out in PR binutils/19020, those tests were still failing when doing remote testing. This is because the binary files weren't being copied over to the remote host for testing. FAIL: binutils-all/pr19020a FAIL: binutils-all/pr19020b This small patch fixes this up to make things pass. binutils/ChangeLog: 2016-10-14 Luis Machado <lgustavo@codesourcery.com> * testsuite/lib/utils-lib.exp (run_dump_test): Call remote_download to copy file to remote host.
2016-10-14Fix set sysroot command on AIXUlrich Weigand2-6/+22
set sysroot command on AIX has no effect if a program depends on shared library archives (.a). Fixed by using solib_find and solib_bfd_fopen instead of gdb_bfd_open in solib_aix_bfd_open. gdb/ 2016-10-14 Sangamesh Mallayya <sangamesh.swamy@in.ibm.com> Ulrich Weigand <uweigand@de.ibm.com> * solib-aix.c (solib_aix_bfd_open): Call solib_find so that sysroot path is set properly if program has a dependency on .a archive and sysroot is set via set sysroot command. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-10-14Add separate debug info file sectionAlan Modra2-0/+5
* scripttempl/DWARF.sc: Add .debug_addr.
2016-10-14[ARC] Disassembler: fix LIMM detection for short instructions.Claudiu Zissulescu9-2/+60
The ARC (short) instructions are using a special register number to indicate is the instruction uses a long immediate (LIMM). In the case of short instruction, this LIMM indicator depends on the ISA version used. Thus, for ARCv1 processors, the LIMM indicator is 0x3E, the same value used in "long" instructions. However, for the ARCv2 processors, this LIMM indicator is 0x1E. This patch fixes the LIMM detection for ARCv1 ISA and adds two tests. gas/ 2016-10-13 Claudiu Zissulescu <claziss@synopsys.com> * testsuite/gas/arc/shortlimm_a7.d: New file. * testsuite/gas/arc/shortlimm_a7.s: Likewise. * testsuite/gas/arc/shortlimm_hs.d: Likewise. * testsuite/gas/arc/shortlimm_hs.s: Likewise. include/ 2016-10-13 Claudiu Zissulescu <claziss@synopsys.com> * opcode/arc.h (ARC_OPCODE_ARCV2): New define. opcodes/ 2016-10-13 Claudiu Zissulescu <claziss@synopsys.com> * arc-dis.c (find_format_from_table): Discriminate LIMM indicator usage on ISA basis.
2016-10-14btrace: remove leftover commentMarkus Metzger2-5/+4
Remove a leftover comment on a function that was removed with commit 0568462bbf0f666d5bf9f720e16147da71eec46a.
2016-10-14Include strings.h where availableEli Zaretskii2-0/+8
gdb/ChangeLog 2016-10-14 Eli Zaretskii <eliz@gnu.org> * common/common-defs.h [HAVE_STRINGS_H]: Include strings.h if available, to get prototypes of 'strcasecmp' and 'strncasecmp'.
2016-10-14Automatic date update in version.inGDB Administrator1-1/+1
2016-10-13ARI: Remove true/false checksPedro Alves2-21/+6
These don't make sense with C++. gdb/ChangeLog: 2016-10-13 Pedro Alves <palves@redhat.com> * contrib/ari/gdb_ari.sh (boolean): Suggest bool instead. (false, true): Remove checks.
2016-10-13Share proc get_var_addressYao Qi5-66/+31
This patch moves proc get_var_address into lib/gdb.exp, and remove the duplicate copy in gdb.base/*.exp files. gdb/testsuite: 2016-10-13 Yao Qi <yao.qi@linaro.org> * gdb.base/code_elim.exp (get_var_address): Remove. * gdb.base/relocate.exp: Likewise. * gdb.base/shreloc.exp: Likewise. * lib/gdb.exp (get_var_address): New.
2016-10-13Skip testing structures with floating pointsYao Qi2-56/+68
This patch skips some tests related to floating point in structs.exp if gdb_skip_float_test return false. gdb/testsuite: 2016-10-13 Yao Qi <yao.qi@linaro.org> * gdb.base/structs.exp: Invoke gdb_skip_float_test, and do floating point tests if $skip_float_test is false.
2016-10-12Use std::string in macho_symfile_read_all_osoTom Tromey2-13/+11
This changes macho_symfile_read_all_oso to use std::string. This avoids a cleanup. 2016-10-12 Tom Tromey <tom@tromey.com> * machoread.c (macho_symfile_read_all_oso): Use std::string.
2016-10-12Remove unnecessary null_cleanupTom Tromey2-3/+6
This patch removes an unnecessary null_cleanup. 2016-10-12 Tom Tromey <tom@tromey.com> * tracepoint.c (trace_dump_command): Remove unnecessary null_cleanup.
2016-10-12Turn wchar iterator into a classTom Tromey4-132/+116
This changes wchar_iterator from charset.c into a real C++ class, then updates the users to use the class. This lets us remove some cleanups in favor of the class' destructor. 2016-10-12 Tom Tromey <tom@tromey.com> * valprint.c (generic_emit_char, count_next_character) (generic_printstr): Update. * charset.c (struct wchar_iterator): Move to charset.h. (wchar_iterator::wchar_iterator): Rename from make_wchar_iterator, turn into a constructor. (wchar_iterator::~wchar_iterator): Rename from do_cleanup_iterator, turn into a destructor. (make_cleanup_wchar_iterator): Remove. (wchar_iterator::iterate): Rename from wchar_iterate. Remove "iter" argument. Update. * charset.h: Include <vector>. (class wchar_iterator): New class, from old struct wchar_iterator. (make_wchar_iterator, make_cleanup_wchar_iterator): Don't declare.
2016-10-12Change selttest.c to use use std::vectorTom Tromey2-13/+14
This patch changes selftest.c to use std::vector rather than VEC. I think this is a small net plus. 2016-10-12 Tom Tromey <tom@tromey.com> * selftest.c: Include <vector>, not "vec.h". (self_test_function_ptr): Remove. (tests): Now a std::vector. (register_self_test, run_self_tests): Update.
2016-10-13Convert tid_range_parser and get_number_or_range to classesPedro Alves13-359/+401
This converts tid_range_parser and get_number_or_range to be classes. The various tid_range_parser_* and get_number_or_range_* functions become methods on the respective classes. Then it updates the users to follow. The rationale for the change is that this provides better encapsulation. For example, this forced me to think of a better interface between tid_range_parser and get_number_or_range, since the former peeked into the latter's internals a bit too much. That ended up resulting mostly in these two not-just-straight-1-1 changes: void -tid_range_parser_skip (struct tid_range_parser *parser) +tid_range_parser::skip_range () { ... - tid_range_parser_init (parser, parser->range_parser.end_ptr, - parser->default_inferior); + m_range_parser.skip_range (); + init (m_range_parser.string (), m_default_inferior); } and: /* If we successfully parsed a thread number or finished parsing a thread range, switch back to assuming the next TID is inferior-qualified. */ - if (parser->range_parser.end_ptr == NULL - || parser->range_parser.string == parser->range_parser.end_ptr) + if (!m_range_parser.in_range ()) { For the same reason (encapsulation), this moves the enum tid_range_state definition to within the tid_parser class's scope, since that is private implementation detail. While at it, switch to use "bool" for booleans. gdb/ChangeLog: 2016-10-13 Pedro Alves <palves@redhat.com> Tom Tromey <tom@tromey.com> * tid-parse.h (tid_range_parser): New class. (enum tid_range_state): Move into tid_range_parser's scope. Remove TID_RANGE_ prefix from all values. (tid_range_parser_get_tid, tid_range_parser_get_tid_range) (tid_range_parser_star_range, tid_range_parser_finished) (tid_range_parser_skip, tid_range_parser_qualified): Don't declare. (tid_is_in_list): Update comment. * tid-parse.c (tid_range_parser::tid_range_parser): New. (init, finished, get_string, skip, tid_is_qualified) (get_tid_or_range, get_tid_range, get_tid, star_range): Rename; turn into methods. (tid_is_in_list): Adjust. * cli/cli-utils.h (number_or_range_parser): New class. (init_number_or_range, get_number_or_range) (number_range_setup_range): Don't declare. * cli/cli-utils.c (number_or_range_parser::number_or_range_parser): New. (init_number_or_range, get_number_or_range) (number_range_setup_range): Rename; turn into methods. (number_is_in_list): Adjust. * breakpoint.c (map_breakpoint_numbers): Adjust. Use bool. (trace_pass_command, get_tracepoint_by_number): Adjust. * breakpoint.h (get_tracepoint_by_number): Adjust. * inferior.c (detach_inferior_command, kill_inferior_command) (remove_inferior_command): Adjust. * linespec.c (decode_line_2): Adjust. * memattr.c (mem_enable_command, mem_disable_command) (mem_delete_command): Adjust. * printcmd.c (map_display_numbers): Adjust. * reverse.c (delete_bookmark_command, bookmarks_info): Adjust. * thread.c (thread_apply_command): Adjust.
2016-10-13Automatic date update in version.inGDB Administrator1-1/+1
2016-10-12Fixup gdb.python/py-value.exp for bare-metal aarch64-elfLuis Machado3-5/+21
I noticed that testing aarch64-elf gdb with a physical board ran into issues with gdb.python/py-value.exp. Further investigation showed that we were actually trying to dereference a NULL pointer (argv) when trying to access argv[0]. Being bare-metal, argv is not guaranteed to be valid. So we need to make sure argv is sane before accessing argv[0]. The following patch fixes up the test program to check for a NULL argv and also improves the testcase a bit so it doesn't have to work with a hardcoded argc value. Regression-tested on x86-64 Ubuntu 16.04. gdb/testsuite/ChangeLog: 2016-10-12 Luis Machado <lgustavo@codesourcery.com> * gdb.python/py-value.c (main): Check if argv is NULL before using it. * gdb.python/py-value.exp (test_value_in_inferior): Don't use hardcoded argc values. Add 1 to argc so we guarantee distinct initial/modified argc values.
2016-10-12arc: Add support for NewlibAnton Kolesov3-1/+80
Add support for Newlib as an OS/ABI. The only thing that is specific to it relatively to "generic" baremetal target is location of PC register in jump buffer for longjump support. Sniffer uses .ivt section to decide if ELF file is for ARC Newlib or not. gdb/ChangeLog: * arc-newlib-tdep.c: New file. * configure.tgt: Add newlib support for ARC.
2016-10-12arc: Add evaluation of long jump targetsAnton Kolesov3-1/+39
Standard get_longjmp_target implementation, similar to what is in arm-tdep.c. Actual value of jb_pc should be set in init_osabi methods of particular OS/ABI implementations. gdb/ChangeLog: * arc-tdep.h (struct gdbarch_tdep) <jb_pc>: New field. * arc-tdep.c (arc_get_longjmp_target): New function. (arc_gdbarch_init): Set get_longjmp_target if jb_pc is non-negative. (arc_dump_tdep): Print jb_pc.
2016-10-12arc: Add a gdbarch_tdep structureAnton Kolesov3-1/+15
Add target-specific structure gdbarch_tdep for ARC. gdb/ChangeLog: * arc-tdep.h (struct gdbarch_tdep): New. * arc-tdep.c (arc_gdbarch_init): Allocate gdbarch_tdep.
2016-10-12[AArch64] Track FP registers in prologue analyzerYao Qi3-7/+43
We don't track FP registers in aarch64 prologue analyzer, so this causes an internal error when FP registers are saved by "stp" instruction in prologue (stp d8, d9, [sp,#128]), tbreak _Unwind_RaiseException^M aarch64-tdep.c:335: internal-error: CORE_ADDR aarch64_analyze_prologue(gdbarch*, CORE_ADDR, CORE_ADDR, aarch64_prologue_cache*): Assertion `inst.operands[0].type == AARCH64_OPND_Rt' failed.^M A problem internal to GDB has been detected, This patch teaches GDB to track FP registers (D registers) in prologue analyzer. gdb: 2016-10-12 Yao Qi <yao.qi@linaro.org> PR tdep/20682 * aarch64-tdep.c: Replace 32 with AARCH64_D_REGISTER_COUNT. (aarch64_analyze_prologue): Extend array 'regs' for D registers. Assert that operand 0 and 1 can be X or D registers. Update register number for D registers. Update registers in frame cache. * aarch64-tdep.h (AARCH64_D_REGISTER_COUNT): New macro.