aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2017-05-04Python: Fix indentation in py-record-btrace.cTim Wiederhake2-30/+36
2017-05-04Automatic date update in version.inGDB Administrator1-1/+1
2017-05-03Make sure malloc is linked into gdb.cp/oranking.cc.Keith Seitz2-0/+22
On some platforms, e.g., arm-eabi-none, we need to make certain that malloc is linked into the program because the test suite uses function calls requiring malloc: (gdb) p foo101("abc") evaluation of this expression requires the program to have a function "malloc". gdb/testsuite/ChangeLog * gdb.cp/oranking.cc (dummy): New function to grab malloc. (main): Call it.
2017-05-03Automatic date update in version.inGDB Administrator1-1/+1
2017-05-02Automatic date update in version.inGDB Administrator1-1/+1
2017-05-01Automatic date update in version.inGDB Administrator1-1/+1
2017-04-30Automatic date update in version.inGDB Administrator1-1/+1
2017-04-29Automatic date update in version.inGDB Administrator1-1/+1
2017-04-28Use ptid method lwp in mips_linux_new_threadYao Qi2-1/+6
gdb: 2017-04-28 Yao Qi <yao.qi@linaro.org> * mips-linux-nat.c (mips_linux_new_thread): Use ptid method lwp instead of ptid_get_lwp.
2017-04-28[MIPS] Use lwpid from lwp_info instead of inferior_ptidYao Qi2-3/+7
RAJESH reported that GDB gets "Couldn't write debug register: No such process." on mips64 when GDB attaches to a multi threaded application. Looks GDB nows PTRACE_GET_WATCH_REGS for inferior_ptid but PTRACE_SET_WATCH_REGS for lwp->ptid, they may be different. gdb: 2017-04-28 Yao Qi <yao.qi@linaro.org> * mips-linux-nat.c (mips_linux_new_thread): Get lwpid from lwp_info instead of getting from inferior_ptid.
2017-04-28Automatic date update in version.inGDB Administrator1-1/+1
2017-04-27Fix overload resolution involving rvalue references and cv qualifiers.Keith Seitz8-57/+119
The following patch fixes several outstanding overload resolution problems with rvalue references and cv qualifiers in the test suite. The tests for these problems typically passed with one compiler version and failed with another. This behavior occurs because of the ordering of the overloaded functions in the debug info. So the first best match "won out" over the a subsequent better match. One of the bugs addressed by this patch is the failure of rank_one_type to account for type equality of two overloads based on CV qualifiers. This was leading directly to problems evaluating rvalue reference overload quality, but it is also highlighted in gdb.cp/oranking.exp, where two test KFAIL as a result of this shortcoming. I found the overload resolution code committed with the rvalue reference patch (f9aeb8d49) needlessly over-complicated, and I have greatly simplified it. This fixes some KFAILing tests in gdb.exp/rvalue-ref-overload.exp. gdb/ChangeLog * gdbtypes.c (LVALUE_REFERENCE_TO_RVALUE_BINDING_BADNESS) DIFFERENT_REFERENCE_TYPE_BADNESS): Remove. (CV_CONVERSION_BADNESS): Define. (rank_one_type): Remove overly restrictive rvalue reference rank checks. Add cv-qualifier checks and subranks for type equality. * gdbtypes.h (REFERENCE_CONVERSION_RVALUE, REFERENCE_CONVERSION_CONST_LVALUE, CV_CONVERSION_BADNESS, CV_CONVERSION_CONST, CV_CONVERSION_VOLATILE): Declare. gdb/testsuite/ChangeLog * gdb.cp/oranking.cc (test15): New function. (main): Call test15 and declare additional variables for testing. * gdb.cp/oranking.exp: Remove kfail status for "p foo4(&a)" and "p foo101('abc')" tests. * gdb.cp/rvalue-ref-overloads.exp: Remove kfail status for "lvalue reference overload" test. * gdb.cp/rvalue-ref-params.exp: Remove kfail status for "print value of f1 on Child&& in f2" test.
2017-04-27Add missing incref when creating Inferior Python objectSimon Marchi2-2/+10
The test py-inferior.exp fails when using a debug build of Python 3.6. I don't see it failing with my system's default Python, but it might be related to the different memory allocation scheme used when doing a build with pydebug. The issue is that we are missing a Py_INCREF in inferior_to_inferior_object. The PyObject_New function initializes the object with a refcount of 1. If we assume that this refcount corresponds to the reference we are returning, then we are missing an incref for the reference in the inferior data. The counterpart for the incref that corresponds to the reference in the inferior data is in py_free_inferior, in the form the gdbpy_ref instance. Here's how I can get it to crash (with some debug output): $ ./gdb -nx -ex "set debug python 1" (gdb) add-inferior Added inferior 2 (gdb) python infs = gdb.inferiors() Creating Python Inferior object inf = 1 Creating Python Inferior object inf = 2 (gdb) remove-inferiors 2 py_free_inferior inf = 2 infpy_dealloc inf = <unknown> (gdb) python infs = None Fatal Python error: Objects/tupleobject.c:243 object at 0x7f9cf1a568d8 has negative ref count -1 Current thread 0x00007f9cf1b68780 (most recent call first): File "<string>", line 1 in <module> [1] 408 abort (core dumped) ./gdb -nx -ex "set debug python 1" After having created the inferiors object, their refcount is 1 (which comes from PyObject_New), but it should be two. The gdb inferior object has a reference and the "infs" list has a reference. When invoking remove-inferiors, py_free_inferior gets called. It does the decref that corresponds to the reference that the gdb inferior object kept. At this moment, the refcount drops to 0 and the object gets deallocated, even though the "infs" list still has a reference. When we set "infs" to None, Python tries to decref the already zero refcount and the assert triggers. With this patch, it looks better: (gdb) add-inferior Added inferior 2 (gdb) python infs = gdb.inferiors() Creating Python Inferior object inf = 1 Creating Python Inferior object inf = 2 (gdb) remove-inferiors 2 py_free_inferior inf = 2 (gdb) python infs = None infpy_dealloc inf = <unknown> gdb/ChangeLog: * python/py-inferior.c (inferior_to_inferior_object): Increment reference count when creating the object.
2017-04-27Automatic date update in version.inGDB Administrator1-1/+1
2017-04-26Automatic date update in version.inGDB Administrator1-1/+1
2017-04-25Change gdbarch_wchar_bit for AArch64 and ARMYao Qi3-2/+6
The size of wchar_t on AArch64 and ARM is 4-byte, so we can use the default value (4*TARGET_CHAR_BIT). This patch fixes some fails in gdb.cp/wide_char_types.exp on aarch64-linux. gdb: 2017-04-25 Yao Qi <yao.qi@linaro.org> * aarch64-tdep.c (aarch64_gdbarch_init): Don't call set_gdbarch_wchar_bit. * arm-tdep.c (arm_gdbarch_init): Likewise.
2017-04-25Automatic date update in version.inGDB Administrator1-1/+1
2017-04-24Automatic date update in version.inGDB Administrator1-1/+1
2017-04-23Automatic date update in version.inGDB Administrator1-1/+1
2017-04-22Automatic date update in version.inGDB Administrator1-1/+1
2017-04-21release branch: Fix: --enable-werrorJan Kratochvil3-0/+10
gdb-8.0-branch ./configure --enable-werror --enable-targets=all aarch64-tdep.c:3045:13: error: ‘void selftests::aarch64_process_record_test()’ declared ‘static’ but never defined [-Werror=unused-function] arm-tdep.c:9601:13: error: ‘void selftests::arm_record_test()’ declared ‘static’ but never defined [-Werror=unused-function] gdb/ChangeLog 2017-04-21 Jan Kratochvil <jan.kratochvil@redhat.com> * aarch64-tdep.c (selftests::aarch64_process_record_test): Make it #if GDB_SELF_TEST. * arm-tdep.c (selftests::arm_record_test): Likewise.
2017-04-21Automatic date update in version.inGDB Administrator1-1/+1
2017-04-20Automatic date update in version.inGDB Administrator1-1/+1
2017-04-19Automatic date update in version.inGDB Administrator1-1/+1
2017-04-18PR threads/20743: Don't attempt to suspend or resume exited threads.John Baldwin2-34/+34
When resuming a native FreeBSD process, ignore exited threads when suspending/resuming individual threads prior to continuing the process. gdb/ChangeLog: PR threads/20743 * fbsd-nat.c (resume_one_thread_cb): Remove. (resume_all_threads_cb): Remove. (fbsd_resume): Use ALL_NON_EXITED_THREADS instead of iterate_over_threads.
2017-04-18Automatic date update in version.inGDB Administrator1-1/+1
2017-04-17Set development mode to "off" by default.Joel Brobecker2-1/+5
bfd/ChangeLog: * development.sh (development): Set to false.
2017-04-17Bump version to 7.99.90.DATE-git.Joel Brobecker2-1/+6
Now that the GDB 8.0 branch has been created, we can bump the version number to a pre-8.0 number. gdb/ChangeLog: GDB 8.0 branch created (725bf5cf125783c2a7ca4ab63d3768e220bab2db): * version.in: Bump version to 7.99.90.DATE-git.
2017-04-15Automatic date update in version.ingdb-8.0-branchpointGDB Administrator1-1/+1
2017-04-13Fix build breakage on Cygwin (PR gdb/21385)Sergio Durigan Junior2-1/+7
On gdb/windows-nat.c:windows_create_inferior, ALLARGS needs to be declared independently of the host that we're building for. This fixes a build breakage on Cygwin. 2017-04-13 Sergio Durigan Junior <sergiodj@redhat.com> PR gdb/21385 * windows-nat.c (windows_create_inferior): Declare 'allargs' independently of the host, and fix build breakage on Cygwin.
2017-04-14Automatic date update in version.inGDB Administrator1-1/+1
2017-04-13Make inferior a class with cdtors, and use new/deletePedro Alves3-50/+66
struct inferior became a non-POD when enum_flags was made a non-POD, so we should be allocating/destroying inferiors with new/delete, etc. That's what this commit does. Note: this commit makes all boolean fields of inferior be "bool", except the "detaching" field. That'll require more work, so I split it to a separate patch. gdb/ChangeLog: 2017-04-13 Pedro Alves <palves@redhat.com> * inferior.c (free_inferior): Convert to ... (inferior::~inferior): ... this dtor. (inferior::inferior): New ctor, factored out from ... (add_inferior_silent): ... here. Allocate the inferior with a new expression. (delete_inferior): Call delete instead of free_inferior. * inferior.h (gdb_environ, continuation): Forward declare. (inferior): Now a class. Add in-class initialization to all members. Make boolean fields bool, except 'detaching'. (inferior::inferior): New explicit ctor. (inferior::~inferior): New.
2017-04-13GC inferior.c:init_inferior_listPedro Alves3-21/+5
Not used anywhere. This was actually never used. It came in because I originally created inferior.c by copying thread.c, and doing s/thread/inferior/g, and missed that nothing needs this. :-) gdb/ChangeLog: 2017-04-13 Pedro Alves <palves@redhat.com> * inferior.c (init_inferior_list): Delete. * inferior.h (init_inferior_list): Delete.
2017-04-13Improve coverage of the PR threads/13217 regression testPedro Alves2-1/+36
- Make sure we end up with no thread selected after the detach. - Test both "thread apply all" and "thread apply $some_threads", for completeness. gdb/ChangeLog: 2017-04-13 Pedro Alves <palves@redhat.com> PR threads/13217 * gdb.threads/threadapply.exp (thr_apply_detach): New procedure. (top level): Call it twice, with different thread sets.
2017-04-13C++fy thread_apply_all_commandPedro Alves2-64/+85
This eliminates a couple cleanups. gdb/ChangeLog: 2017-04-13 Pedro Alves <palves@redhat.com> * thread.c: Include <algorithm>. (thread_array_cleanup): Delete. (scoped_inc_dec_ref): New class. (live_threads_count): New function. (set_thread_refcount): Delete. (tp_array_compar_ascending): Now a bool. (tp_array_compar): Convert to a std::sort comparison function. (thread_apply_all_command): Use std::vector and scoped_inc_dec_ref and live_threads_count.
2017-04-13Fix follow-fork latent bugPedro Alves2-2/+8
A later patch in the series adds an assertion to switch_to_thread that the resulting inferior_ptid always matches the "current_inferior()" inferior. This exposed a latent bug in the follow-fork code, where we're building the fork child inferior. We're switching inferior_ptid, but not the current inferior object... gdb/ChangeLog: 2017-04-13 Pedro Alves <palves@redhat.com> * infrun.c (follow_fork_inferior): Also switch the current inferior.
2017-04-13watch_command_1: Fix dangling frame accessPedro Alves2-13/+26
While working on some changes to switch_to_thread, I inadvertently make switch_to_thread call reinit_frame_cache more frequently, even when the thread didn't change. This exposed a latent bug in watch_command_1, where we're referencing a frame after creating/inserting breakpoints, which potentially calls reinit_frame_cache if it needs to install breakpoints with a different thread selected. Handle this similarly to how it's already handled in other similar cases. I.e., save any frame-related information we might need before creating a breakpoint. gdb/ChangeLog: 2017-04-13 Pedro Alves <palves@redhat.com> * breakpoint.c (watch_command_1): Save watchpoint-frame info before calling create_internal_breakpoint.
2017-04-13readelf: fix out of range subtraction, seg fault from a NULL pointer and ↵Nick Clifton2-5/+33
memory exhaustion, all from parsing corrupt binaries. PR binutils/21379 * readelf.c (process_dynamic_section): Detect over large section offsets in the DT_SYMTAB entry. PR binutils/21345 * readelf.c (process_mips_specific): Catch an unfeasible memory allocation before it happens and print a suitable error message.
2017-04-13Add note merging to strip and add code to merge stack size notes.Nick Clifton4-15/+129
* objcopy.c: Add --no-merge-notes option to disable note merging. Add --[no-]merge-notes option to strip, and enable it by default. (num_bytes): New function. (merge_gnu_build_notes): Add code to merge stack size notes. * binutils.texi: Update strip and objcopy documentation. * readelf.c (print_gnu_build_attribute_name): Use defined constants for note types.
2017-04-13Regen cgen filesAlan Modra14-24/+53
* epiphany-desc.c: Regenerate. * fr30-desc.c: Regenerate. * frv-desc.c: Regenerate. * ip2k-desc.c: Regenerate. * iq2000-desc.c: Regenerate. * lm32-desc.c: Regenerate. * m32c-desc.c: Regenerate. * m32r-desc.c: Regenerate. * mep-desc.c: Regenerate. * mt-desc.c: Regenerate. * or1k-desc.c: Regenerate. * xc16x-desc.c: Regenerate. * xstormy16-desc.c: Regenerate.
2017-04-13fork-child.c: Avoid unnecessary heap-allocation / string copyingPedro Alves2-116/+215
The previous change to fork-child.c converted the argv building from an alloca-allocated array of non-owning arg pointers, to a std::vector of owning pointers, which results in N string dups, with N being the number of arguments in the vector, and then requires manually releasing the pointers owned by the vector. This patch makes the vector hold non-owning pointers, and avoids the string dups, by doing one single string copy of the arguments upfront, and replacing separators with NULL terminators in place, like we used to. All the logic to do that is encapsulated in a new class. With this, there's no need to remember to manually release the argv elements with free_vector_argv either. gdb/ChangeLog: 2017-04-13 Pedro Alves <palves@redhat.com> * fork-child.c (execv_argv): New class. (breakup_args): Refactored as ... (execv_argv::init_for_no_shell): .. this method of execv_argv. Copy arguments to storage and replace separators with NULL terminators in place. (escape_bang_in_quoted_argument): Adjust to return bool. (execv_argv::execv_argv): New ctor. (execv_argv::init_for_shell): New method, factored out from fork_inferior. Don't strdup strings into the vector. (fork_inferior): Eliminate "shell" local and use execv_argv. Use Remove free_vector_argv call.
2017-04-13 * config.sub: Sync with master version in config project.Andrew Jenner2-3/+7
2017-04-13Add ChangeLog entriesIain Buclaw2-0/+10
ChangeLog entries were left unstaged in my previous commit on March 30th.
2017-04-13Wrap long linesAlan Modra11-40/+81
Not a comprehensive change, just some split out from fixes made for the %A and %B changes. * coffcode.h: Wrap some overly long _bfd_error_handler args. * elf.c: Likewise. * elf32-arm.c: Likewise. * elf32-i386.c: Likewise. * elf32-mep.c: Likewise. * elf64-ia64-vms.c: Likewise. * elf64-x86-64.c: Likewise. * elflink.c: Likewise. * elfnn-ia64.c: Likewise. * elfxx-mips.c: Likewise.
2017-04-13Use %A and %B in more error messagesAlan Modra50-314/+341
* aoutx.h: Use %B and %A in error messages throughout file. * aout-cris.c: Likewise. * archive.c: Likewise. * binary.c: Likewise. * coff-rs6000.c: Likewise. * coff-tic4x.c: Likewise. * coffcode.h: Likewise. * coffgen.c: Likewise. * cofflink.c: Likewise. * coffswap.h: Likewise. * cpu-arm.c: Likewise. * elf-eh-frame.c: Likewise. * elf-m10300.c: Likewise. * elf.c: Likewise. * elf32-arc.c: Likewise. * elf32-arm.c: Likewise. * elf32-bfin.c: Likewise. * elf32-frv.c: Likewise. * elf32-iq2000.c: Likewise. * elf32-m32c.c: Likewise. * elf32-microblaze.c: Likewise. * elf32-nds32.c: Likewise. * elf32-rl78.c: Likewise. * elf32-rx.c: Likewise. * elf32-score.c: Likewise. * elf32-score7.c: Likewise. * elf32-sh64.c: Likewise. * elf32-v850.c: Likewise. * elf32-vax.c: Likewise. * elf32-visium.c: Likewise. * elf64-ia64-vms.c: Likewise. * elf64-mmix.c: Likewise. * elf64-sh64.c: Likewise. * elfcode.h: Likewise. * elfnn-aarch64.c: Likewise. * elfnn-ia64.c: Likewise. * elfxx-mips.c: Likewise. * hpux-core.c: Likewise. * ieee.c: Likewise. * ihex.c: Likewise. * linker.c: Likewise. * merge.c: Likewise. * mmo.c: Likewise. * oasys.c: Likewise. * pdp11.c: Likewise. * peXXigen.c: Likewise. * rs6000-core.c: Likewise. * vms-alpha.c: Likewise. * xcofflink.c: Likewise.
2017-04-13Rewrite bfd error handlerAlan Modra21-271/+361
This steals _doprnt from libiberty, extended to handle %A and %B. Which lets us do away with the current horrible %A and %B handling that requires all %A and %B arguments to be passed first, rather than in the natural order. * bfd.c (PRINT_TYPE): Define. (_doprnt): New function. (error_handler_internal): Use _doprnt. * coff-arm.c: Put %A and %B arguments to _bfd_error_handler calls in their natural order, throughout file. * coff-mcore.c: Likewise. * coff-ppc.c: Likewise. * coff-tic80.c: Likewise. * cofflink.c: Likewise. * elf-s390-common.c: Likewise. * elf.c: Likewise. * elf32-arm.c: Likewise. * elf32-i386.c: Likewise. * elf32-m32r.c: Likewise. * elf32-msp430.c: Likewise. * elf32-spu.c: Likewise. * elf64-ia64-vms.c: Likewise. * elf64-sparc.c: Likewise. * elf64-x86-64.c: Likewise. * elflink.c: Likewise. * elfnn-aarch64.c: Likewise. * elfnn-ia64.c: Likewise. * elfxx-mips.c: Likewise.
2017-04-13Missing _bfd_error_handler argsAlan Modra4-25/+33
* elf32-arm.c (arm_type_of_stub): Supply missing args to "long branch veneers" error. Fix double space and format message. * elf32-avr.c (avr_add_stub): Do not pass NULL as %B arg. * elf64-ppc.c (tocsave_find): Supply missing %B arg.
2017-04-13Regen bfd-in2.hAlan Modra2-1/+6
* bfd-in2.h: Regenerate.
2017-04-13Fix a typo in rx_fpsw_typeYao Qi2-1/+6
gdb: 2017-04-13 Yao Qi <yao.qi@linaro.org> * rx-tdep.c (rx_fpsw_type): Check tdep->rx_fpsw_type instead of tdep->rx_psw_type.
2017-04-13XCNEW gdbarch_tdep in rl78 and rxYao Qi3-2/+7
"struct gdbarch_tdep" is XNEW'ed in rl78 and rx, so the memory is not cleared. As the result, tdep->rl78_psw_type is never initialized properly. struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); if (tdep->rl78_psw_type == NULL) { tdep->rl78_psw_type = arch_flags_type (gdbarch, "builtin_type_rl78_psw", 1); The bug is found by my unit test in the following patch. gdb: 2017-04-13 Yao Qi <yao.qi@linaro.org> * rl78-tdep.c (rl78_gdbarch_init): Use XCNEW instead of XNEW. * rx-tdep.c (rx_gdbarch_init): Likewise.