1. Mar 05, 2019
    • Matthew Malcomson's avatar
      Allow multiple tests to be run on systems with older versions of TCL installed. · 093f70cc
      Matthew Malcomson authored
      	PR 24287
      	* testsuite/lib/binutils-common.exp (run_dump_test): Replace a use
      	of "lmap" with a "foreach" loop.
      093f70cc
    • GDB Administrator's avatar
      Automatic date update in version.in · 54c56910
      GDB Administrator authored
      54c56910
    • Sergio Durigan Junior's avatar
      Use '$enable_unittest' instead of '$development' on gdbserver/configure.srv... · 45950eb6
      Sergio Durigan Junior authored
      Use '$enable_unittest' instead of '$development' on gdbserver/configure.srv (for 'aarch64*-*-linux*' case)
      
      On commit 8ecfd7bd ("Add parameter to
      allow enabling/disabling selftests via configure") it seems that I
      forgot to use the proper '$enable_unittest' variable when checking to
      see whether to add selftest-related objects to 'srv_regobj'.  This
      causes a build failure on Aarch64 when 'development=false' (which is
      the case for the 8.3 branch) and 'enable_unittest=true'.
      
      This patch fixes the problem by using '$enable_unittest' instead of
      '$development' when performing the check.  As a reminder, it's
      important to notice that '$enable_unittest's default value (i.e., when
      the option '--enable-unit-tests' is not passed to configure) is the
      same as '$development', so this patch doesn't affect the current
      build.
      
      I'd like to install this patch both on master and on the 8.3 branch.
      
      OK?
      
      gdb/gdbserver/ChangeLog:
      2019-03-04  Sergio Durigan Junior  <sergiodj@redhat.com>
      
      	* configure.srv: Use '$enable_unittest' instead of '$development'
      	when checking whether to fill 'srv_regobj' on 'aarch64*-*-linux*'
      	case.
      45950eb6
  2. Mar 04, 2019
    • Richard Bunt's avatar
      gdbserver short-circuit-argument-list failures · 7b63ad86
      Richard Bunt authored
      This patch fixes test case failures observed when running
      short-circuit-argument-list.exp with gdb server boards. Thanks to Sergio
      Durigan Junior for pointing this out.
      
      Assertions failed with the native{,-extended}-gdbserver boards as the
      standard output from the test program appears in a different location
      than observed on non-gdbserver boards. This standard output was used to
      determine whether a function, which had been logically short-circuited,
      was called or not. Since the location of the standard out cannot be
      relied upon to verify this, a new mechanism was needed.
      
      The test program now records function calls in variables named the same
      as the function with a "_called" suffix. These variables can then be
      queried from the test case to verify the occurrence of a call.
      
      A method to reset the call counts has been included in the test case, so
      that any future assertions added to this test can ensure a fresh set of
      initial values before proceeding. Not resetting values between groups of
      assertions creates a dependency between them, which increases the
      likelihood that a single failure causes subsequent assertions to fail.
      
      Regression tested on x86_64, aarch64 and ppc64le.
      Regression tested with Ada on x86_64.
      Regression tested with the native{,-extended}-gdbserver boards on x86_64.
      7b63ad86
    • Nick Clifton's avatar
      Stop objcopy from attempting to copy thin archives. · f5f20315
      Nick Clifton authored
      	PR 24281
      	* objcopy.c (copy_archive): Do not copy thin  archives.
      f5f20315
    • GDB Administrator's avatar
      Automatic date update in version.in · 67490c6b
      GDB Administrator authored
      67490c6b
  3. Mar 03, 2019
  4. Mar 02, 2019
    • Eli Zaretskii's avatar
      Avoid compilation warnings on MinGW. · a6a4b2c6
      Eli Zaretskii authored
      gdb/ChangeLog:
      2019-03-02  Eli Zaretskii  <eliz@gnu.org>
      
      	* xml-syscall.c (xml_list_syscalls_by_group): Drop 'struct' from
      	for-loop range, to avoid compiler warnings.
      
      	* tui/tui.c (tui_enable) [__MINGW32__]: Don't declare 'cap', to
      	avoid compiler warnings about unused variables.
      a6a4b2c6
    • Eli Zaretskii's avatar
      GDB no longer supports Windows before XP. · 742a7df5
      Eli Zaretskii authored
      gdb/ChangeLog:
      2019-03-02  Eli Zaretskii  <eliz@gnu.org>
      
      	* NEWS: Mention end of support for native debugging on MS-Windows
      	before XP.
      742a7df5
    • Eli Zaretskii's avatar
      Fix GDB compilation on MinGW (PR gdb/24292) · 41fa577f
      Eli Zaretskii authored
      gdb/ChangeLog:
      
      2019-03-02  Eli Zaretskii  <eliz@gnu.org>
      
      	PR gdb/24292
      	* common/netstuff.c:
      	* gdbserver/gdbreplay.c
      	* gdbserver/remote-utils.c:
      	* ser-tcp.c:
      	* unittests/parse-connection-spec-selftests.c [USE_WIN32API]:
      	Include ws2tcpip.h instead of wsiapi.h and winsock2.h.  Redefine
      	_WIN32_WINNT to 0x0501 if defined to a smaller value, as
      	'getaddrinfo' and 'freeaddrinfo' were not available before
      	Windows XP, and mingw.org's MinGW headers by default define
      	_WIN32_WINNT to 0x500.
      41fa577f
    • GDB Administrator's avatar
      Automatic date update in version.in · ca5a17b0
      GDB Administrator authored
      ca5a17b0
  5. Mar 01, 2019
    • Andreas Krebbel's avatar
      Revert "Add support to GNU ld to separate got related plt entries" · 24801b15
      Andreas Krebbel authored
      bfd/ChangeLog:
      
      2019-03-01  Andreas Krebbel  <krebbel@linux.ibm.com>
      
      	This reverts commit 5a12586d.
      	2019-01-14  Maamoun Tarsha  <maamountk@hotmail.com>
      
      	PR 20113
      	* elf32-s390.c (allocate_dynrelocs): Update comment.
      
      ld/ChangeLog:
      
      2019-03-01  Andreas Krebbel  <krebbel@linux.ibm.com>
      
      	This reverts commit 5a12586d.
      	2019-01-14  Maamoun Tarsha  <maamountk@hotmail.com>
      
      	PR 20113
      	* emulparams/elf64_s390.sh (SEPARATE_GOTPLT): Define.
      	* emulparams/elf_s390.sh (SEPARATE_GOTPLT): Define.
      	* testsuite/ld-s390/gotreloc_31-1.dd: Update expected output.
      	* testsuite/ld-s390/tlsbin.dd: Likewise.
      	* testsuite/ld-s390/tlsbin.rd: Likewise.
      	* testsuite/ld-s390/tlsbin.sd: Likewise.
      	* testsuite/ld-s390/tlsbin_64.dd: Likewise.
      	* testsuite/ld-s390/tlsbin_64.rd: Likewise.
      	* testsuite/ld-s390/tlsbin_64.sd: Likewise.
      	* testsuite/ld-s390/tlspic.dd: Likewise.
      	* testsuite/ld-s390/tlspic.rd: Likewise.
      	* testsuite/ld-s390/tlspic.sd: Likewise.
      	* testsuite/ld-s390/tlspic_64.dd: Likewise.
      	* testsuite/ld-s390/tlspic_64.rd: Likewise.
      	* testsuite/ld-s390/tlspic_64.sd: Likewise.
      	* testsuite/ld-s390/s390.exp: Skip s390 tests for tpf targets.
      24801b15
    • Gary Benson's avatar
      Fix coff_start_symtab resource leak found by Coverity · 827f438f
      Gary Benson authored
      This commit fixes a resource leak found by Coverity, where
      coff_start_symtab performs an xstrdup that is now performed
      within start_symtab by buildsym_compunit::buildsym_compunit.
      
      gdb/ChangeLog:
      
      	* coffread.c (coff_start_symtab): Remove unnecessary xstrdup.
      827f438f
    • Tamar Christina's avatar
      Binutils: Always skip only 1 byte for CIE version 1's return address register. · 4ffd2909
      Tamar Christina authored
      According to the specification for the CIE entries, when the CIE version is 1 then
      the return address register field is always 1 byte.  Readelf does this correctly in
      read_cie in dwarf.c but ld does this incorrectly and always tries to read a
      skip_leb128.  If the value here has the top bit set then ld will incorrectly read
      at least another byte, causing either an assert failure or an incorrect address to
      be used in eh_frame.
      
      I'm not sure how to generate a generic test for this as I'd need to write assembly,
      and it's a bit hard to trigger. Essentially the relocated value needs to start with
      something that & 0x70 != 0x10 while trying to write a personality.
      
      bfd/ChangeLog:
      
      	* elf-eh-frame.c (_bfd_elf_write_section_eh_frame): Correct CIE parse.
      4ffd2909
    • Alan Modra's avatar
      PR24272, out-of-bounds read in pex64_xdata_print_uwd_codes · b24cc414
      Alan Modra authored
      The fix here is to use an unsigned comparison for
          if (a->NumberOfRvaAndSizes > IMAGE_NUMBEROF_DIRECTORY_ENTRIES)
      
      include/
      	PR 24272
      	* coff/internal.h (struct internal_extra_pe_aouthdr): Change type
      	of SizeOfCode, SizeOfInitializedData, and SizeOfUninitializedData
      	to bfd_vma.  Change type of SectionAlignment, FileAlignment,
      	Reserved1, SizeOfImage, SizeOfHeaders, CheckSum, LoaderFlags,
      	and NumberOfRvaAndSizes to uint32_t.
      bfd/
      	PR 24272
      	* peXXigen.c (_bfd_XXi_swap_aouthdr_in): Use unsigned index.
      	(_bfd_XX_print_private_bfd_data_common): Adjust for type changes.
      b24cc414
    • GDB Administrator's avatar
      Automatic date update in version.in · b09e83c1
      GDB Administrator authored
      b09e83c1
    • Alan Hayward's avatar
      Testsuite: Catch gdbserver socket listen errors · 01abb042
      Alan Hayward authored
      When launching gdbserver, the testsuite checks for binding failure but
      does not check for failure to listen to socket error (which can happen
      due to another gdbserver binding to the socket at the same time).
      
      When this error occurs, the test will ignore the error and connect GDB
      to the failed port.  This may succeed and GDB will now be connected to
      the gdbserver from another test.  This eventually causes both tests to
      fail.
      
      When running the tests suite with native-gdbserver across many cores,
      this issue may happen once or twice, each causing random failures for
      two .exp testscripts.
      
      Example gdb.log output for the failure:
      
      The testsuite sucessfully notices a failure to connect to port 2348.
      It launches again with port 2349, which also fails.  The testsuite
      ignores this error and uses gdb to connect to the port - which succeeds.
      
      spawn /work/build/gdb/testsuite/../gdbserver/gdbserver --once localhost:2348 /work/build/gdb/testsuite/outputs/gdb.ada/arrayidx/p^M
      Can't bind address: Address already in use.^M
      Exiting^M
      Port 2348 is already in use.
      spawn /work/build/gdb/testsuite/../gdbserver/gdbserver --once localhost:2349 /work/build/gdb/testsuite/outputs/gdb.ada/arrayidx/p^M
      Can't listen on socket: Address already in use.^M
      Exiting^M
      target remote localhost:2349^M
      Remote debugging using localhost:2349^M
      Reading /lib/ld-linux-aarch64.so.1 from remote target...^M
      warning: File transfers from remote targets can be slow. Use "set sysroot" to access files locally instead.^M
      Reading /lib/ld-linux-aarch64.so.1 from remote target...^M
      Reading symbols from target:/lib/ld-linux-aarch64.so.1...^M
      Reading /lib/ld-2.23.so from remote target...^M
      Reading /lib/.debug/ld-2.23.so from remote target...^M
      Reading /work/build/install/lib/debug//lib/ld-2.23.so from remote target...^M
      Reading /work/build/install/lib/debug/lib//ld-2.23.so from remote target...^M
      Reading target:/work/build/install/lib/debug/lib//ld-2.23.so from remote target...^M
      (No debugging symbols found in target:/lib/ld-linux-aarch64.so.1)^M
      0x0000ffffbf6d2cc0 in ?? () from target:/lib/ld-linux-aarch64.so.1^M
      (gdb) continue^M
      Continuing.^M
      Reading /lib/aarch64-linux-gnu/libc.so.6 from remote target...^M
      Reading /lib/aarch64-linux-gnu/libc-2.23.so from remote target...^M
      Reading /lib/aarch64-linux-gnu/.debug/libc-2.23.so from remote target...^M
      Reading /work/build/install/lib/debug//lib/aarch64-linux-gnu/libc-2.23.so from remote target...^M
      Reading /work/build/install/lib/debug/lib/aarch64-linux-gnu//libc-2.23.so from remote target...^M
      Reading target:/work/build/install/lib/debug/lib/aarch64-linux-gnu//libc-2.23.so from remote target...^M
      [Inferior 1 (process 35351) exited normally]^M
      (gdb) FAIL: gdb.ada/arrayidx.exp: can't run to main
      
      Meanwhile, at the same time, in another test, gdbserver successfully
      connects to port 2349.  GDB then tries to connect to the port, but it
      times out because the GDB in the test above has already connected to it.
      
      spawn /work/build/gdb/testsuite/../gdbserver/gdbserver --once localhost:2348 /work/build/gdb/testsuite/outputs/gdb.ada/rdv_wait/foo^M
      Can't bind address: Address already in use.^M
      Exiting^M
      Port 2348 is already in use.
      spawn /work/build/gdb/testsuite/../gdbserver/gdbserver --once localhost:2349 /work/build/gdb/testsuite/outputs/gdb.ada/rdv_wait/foo^M
      Process /work/build/gdb/testsuite/outputs/gdb.ada/rdv_wait/foo created; pid = 65162^M
      Listening on port 2349^M
      Remote debugging from host 127.0.0.1, port 45154^M
      target remote localhost:2349^M
      localhost:2349: Connection timed out.^M
      (gdb) ^CQuit^M
      (gdb) task 2^M
      Cannot inspect Ada tasks when program is not running^M
      
      gdb/testsuite/ChangeLog:
      
      	* lib/gdbserver-support.exp (gdbserver_start): Check for listen
      	failure.
      01abb042
  6. Feb 28, 2019
    • Rainer Orth's avatar
      Can't interrupt process without controlling terminal on Solaris (PR gdb/8527) · 92137da0
      Rainer Orth authored
      If gdb attaches to a process that either has no controlling terminal,
      or the controlling terminal differs from the one gdb is running under,
      break/^C doesn't interrupt the debugged process on Solaris.
      
      Fixed as follows, analogous to what all all other targets do.  Patch from
      the PR, recently re-submitted by Brian Vandenberg.
      
      Tested on amd64-pc-solaris2.11, sparcv9-sun-solaris2.11, and
      x86_64-pc-linux-gnu.
      
      2019-02-28  Brian Vandenberg  <phantall@gmail.com>
      	    Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
      
      	gdb:
      	PR gdb/8527
      	* procfs.c (proc_wait_for_stop): Wrap write of PCWSTOP in
      	set_sigint_trap, clear_sigint_trap.
      
      	gdb/testsuite:
      	PR gdb/8527
      	* gdb.base/interrupt-daemon-attach.c,
      	gdb.base/interrupt-daemon-attach.exp: New test.
      92137da0
    • Nick Clifton's avatar
      Prevent a buffer overrun error when attempting to parse a corrupt ELF file. · eed5def8
      Nick Clifton authored
      	PR 24273
      	* elf.c (bfd_elf_string_from_elf_section): Check for a string
      	section that is not NUL terminated.
      eed5def8
    • Joel Brobecker's avatar
      (gdb/sim) Move Mike Frysinger to past maintainers section · 9c4c3318
      Joel Brobecker authored
      sim/ChangeLog:
      
      	* MAINTAINERS: Move Mike Frysinger to past maintainers' section.
      9c4c3318
    • GDB Administrator's avatar
      Automatic date update in version.in · b8ec59a1
      GDB Administrator authored
      b8ec59a1
    • Philippe Waroquiers's avatar
      Fix regcache leak, and avoid possible regcache access after detach. · 799efbe8
      Philippe Waroquiers authored
      Valgrind reports leaks like the below in various tests,
      e.g. gdb.threads/attach-slow-waitpid.exp, gdb.ada/task_switch_in_core.exp, ...
      
      Fix the leak by clearing the regcache when detaching from an inferior.
      Note that these leaks are 'created' when GDB exits,
      when the regcache::current_regcache is destroyed : the elements
      of the forward_list are pointers, and the 'pointed to' memory is not
      deleted by the forward_list destructor.
      
      Nevertheless, fixing this leak is good as it makes a bunch of
      tests 'leak clean'.
      
      Also, it seems strange to keep a register cache for a process from
      which GDB detached : it is not clear if this cache is still valid
      after detach.  And effectively, when clearing only the regcache,
      (and not the frame cache), then the frame cache was still 'pointing'
      at this regcache and was used when switching to the child process
      in the test gdb.threads/watchpoint-fork.exp, which seems strange.
      
      So, we solve the leak and avoid possible accesses to the regcache
      and frame cache of the detached inferior, by clearing both the
      regcache and the frame cache.
      
      Tested on debian/amd64, natively, under Valgrind,
      and with make check RUNTESTFLAGS="--target_board=native-gdbserver".
      
      ==27679== VALGRIND_GDB_ERROR_BEGIN
      ==27679== 1,123 (72 direct, 1,051 indirect) bytes in 1 blocks are definitely lost in loss record 2,942 of 3,400
      ==27679==    at 0x4C2C4CC: operator new(unsigned long) (vg_replace_malloc.c:344)
      ==27679==    by 0x5CDF71: get_thread_arch_aspace_regcache(ptid_t, gdbarch*, address_space*) (regcache.c:330)
      ==27679==    by 0x5CE12A: get_thread_regcache (regcache.c:366)
      ==27679==    by 0x5CE12A: get_current_regcache() (regcache.c:372)
      ==27679==    by 0x4FF63D: post_create_inferior(target_ops*, int) (infcmd.c:452)
      ==27679==    by 0x43AF62: core_target_open(char const*, int) (corelow.c:458)
      ==27679==    by 0x408B68: cmd_func(cmd_list_element*, char const*, int) (cli-decode.c:1892)
      ...
      
      gdb/ChangeLog
      2019-02-27  Philippe Waroquiers  <philippe.waroquiers@skynet.be>
      
      	* target.c (target_detach): Clear the regcache and the
      	frame cache.
      799efbe8
    • H.J. Lu's avatar
      x86-64: Skip protected check on symbol defined by linker · 5cfe428c
      H.J. Lu authored
      Skip symbol defined by linker when checking copy reloc on protected
      symbol.
      
      bfd/
      
      	PR ld/24276
      	* elf64-x86-64.c (elf_x86_64_check_relocs): Skip symbol defined
      	by linker when checking copy reloc on protected symbol.
      
      ld/
      
      	PR ld/24276
      	* testsuite/ld-i386/i386.exp: Run PR ld/24276 test.
      	* testsuite/ld-x86-64/x86-64.exp: Likewise.
      	* testsuite/ld-i386/pr24276.dso: New file.
      	* testsuite/ld-i386/pr24276.warn: Likewise.
      	* testsuite/ld-x86-64/pr24276.dso: Likewise.
      	* testsuite/ld-x86-64/pr24276.warn: Likewise.
      5cfe428c
    • Tom Tromey's avatar
      Handle \r\n in gdbreplay · 43ac54fc
      Tom Tromey authored
      I tried gdbreplay yesterday, but the remotelogfile I received was made
      on Windows, so the lines were terminated with \r\n rather than plain
      \n.
      
      This patch changes gdbreplay to allow \r\n line termination when
      reading the log file.
      
      gdb/gdbserver/ChangeLog
      2019-02-27  Tom Tromey  <tromey@adacore.com>
      
      	* gdbreplay.c (logchar): Handle \r\n.
      43ac54fc
    • Pedro Alves's avatar
      Test "set width/height -1" · 5862844d
      Pedro Alves authored
      As a follow up to the previous commit, add a test for "set
      width/height -1", to make sure we don't overflow in readline with
      negative values either.
      
      gdb/testsuite/ChangeLog:
      2019-02-27  Pedro Alves  <palves@redhat.com>
      
      	* gdb.base/page.exp: Add tests for "set width/height -1".
      5862844d
    • Pedro Alves's avatar
      Make 'show width/height' display "unlimited" when capped for readline · 8ed25214
      Pedro Alves authored
      When we cap the height/width sizes before passing to readline, tweak
      the corresponding command variable to show "unlimited":
      
        (gdb) set height 0x8000
        (gdb) show height
        Number of lines gdb thinks are in a page is unlimited.
      
      Instead of the current output:
        (gdb) set height 0x8000
        (gdb) show height
        Number of lines gdb thinks are in a page is 32768.
      
      gdb/ChangeLog:
      2019-02-27  Pedro Alves  <palves@redhat.com>
      
      	* utils.c (set_screen_size): When we cap the height/width sizes,
      	tweak the corresponding command variable to show "unlimited":
      
      gdb/testsuite/ChangeLog:
      2019-02-27  Pedro Alves  <palves@redhat.com>
      
      	* gdb.base/page.exp: Add tests for "set/show width/height" with
      	"infinite" values.
      8ed25214
    • Saagar Jha's avatar
      Prevent overflow in rl_set_screen_size · 23031e31
      Saagar Jha authored
      GDB calls rl_set_screen_size in readline with the current screen size,
      measured in rows and columns.  To represent "infinite" sizes, GDB
      passes in INT_MAX; however, since rl_set_screen_size internally
      multiplies the number of rows and columns, this causes a signed
      integer overflow.  To prevent this we can instead pass in the
      approximate square root of INT_MAX (which is still reasonably large),
      so that even when the number of rows and columns is "infinite" we
      don't overflow.
      
      gdb/ChangeLog:
      2019-02-27  Saagar Jha  <saagar@saagarjha.com>
      	    Pedro Alves  <palves@redhat.com>
      
      	* utils.c (set_screen_size): Reduce "infinite" rows and columns
      	before calling rl_set_screen_size.
      23031e31
    • Tom Tromey's avatar
      Remove Python 2.4 and 2.5 support · 6c28e44a
      Tom Tromey authored
      This removes all the remainings spots I could find that work around
      issues in Python 2.4 and 2.5.
      
      I don't have a good way to test that Python 2.6 still works.
      
      Tested by the buildbot.
      
      gdb/ChangeLog
      2019-02-27  Tom Tromey  <tromey@adacore.com>
      
      	* config.in, configure: Rebuild.
      	* configure.ac (HAVE_LIBPYTHON2_4, HAVE_LIBPYTHON2_5): Never
      	define.
      	* python/py-value.c: Remove Python 2.4 workaround.
      	* python/py-utils.c (gdb_pymodule_addobject): Remove Python 2.4
      	workaround.
      	* python/py-type.c (convert_field, gdbpy_initialize_types): Remove
      	Python 2.4 workaround.
      	* python/python-internal.h: Remove Python 2.4 comment.
      	(Py_ssize_t): Don't define.
      	(PyVarObject_HEAD_INIT, Py_TYPE): Don't define.
      	(gdb_Py_DECREF): Remove Python 2.4 workaround.
      	(gdb_PyObject_GetAttrString, PyObject_GetAttrString): Remove.
      	(gdb_PyObject_HasAttrString, PyObject_HasAttrString): Remove.
      	* python/python.c (do_start_initialization): Remove Python 2.4
      	workaround.
      	* python/py-prettyprint.c (class dummy_python_frame): Remove.
      	(print_children): Remove Python 2.4 workaround.
      	* python/py-inferior.c (buffer_procs): Remove Python 2.4
      	workaround.
      	(CHARBUFFERPROC_NAME): Remove.
      	* python/py-breakpoint.c (gdbpy_initialize_breakpoints): Remove
      	Python 2.4 workaround.
      
      gdb/testsuite/ChangeLog
      2019-02-27  Tom Tromey  <tromey@adacore.com>
      
      	* lib/gdb.exp (skip_python_tests_prompt): Don't check for Python
      	2.4.
      	* gdb.python/py-finish-breakpoint.exp: Remove Python 2.4
      	workaround.
      
      gdb/ChangeLog
      2019-02-27  Tom Tromey  <tromey@adacore.com>
      
      	* config.in, configure: Rebuild.
      	* configure.ac (HAVE_LIBPYTHON2_4, HAVE_LIBPYTHON2_5): Never
      	define.
      	* python/py-value.c: Remove Python 2.4 workaround.
      	* python/py-utils.c (gdb_pymodule_addobject): Remove Python 2.4
      	workaround.
      	* python/py-type.c (convert_field, gdbpy_initialize_types): Remove
      	Python 2.4 workaround.
      	* python/python-internal.h: Remove Python 2.4 comment.
      	(Py_ssize_t): Don't define.
      	(PyVarObject_HEAD_INIT, Py_TYPE): Don't define.
      	(gdb_Py_DECREF): Remove Python 2.4 workaround.
      	(gdb_PyObject_GetAttrString, PyObject_GetAttrString): Remove.
      	(gdb_PyObject_HasAttrString, PyObject_HasAttrString): Remove.
      	* python/python.c (do_start_initialization): Remove Python 2.4
      	workaround.
      	* python/py-prettyprint.c (class dummy_python_frame): Remove.
      	(print_children): Remove Python 2.4 workaround.
      	* python/py-inferior.c (buffer_procs): Remove Python 2.4
      	workaround.
      	(CHARBUFFERPROC_NAME): Remove.
      	* python/py-breakpoint.c (gdbpy_initialize_breakpoints): Remove
      	Python 2.4 workaround.
      6c28e44a
    • Kevin Buettner's avatar
      Document fact that mininum Python version is now 2.6 · 2c3fc25d
      Kevin Buettner authored
      gdb/ChangeLog:
      
      	* NEWS: Note minimum Python version.
      
      gdb/doc/ChangeLog:
      
      	* gdb.texinfo (Configure Options): Document minimum python
      	version.
      2c3fc25d
    • Kevin Buettner's avatar
      Use Python 2.[67] / 3.X / PEP 3118 buffer protocol · 6ca62222
      Kevin Buettner authored
      This patch removes the non-IS_PY3K code in infpy_write_memory()
      and infpy_search_memory().  In both cases, the remaining code
      from these ifdefs is related to use of the PEP 3118 buffer protocol.
      (Deleted code is either due to simplification or related to use of the
      old buffer protocol.)  PEP 3118 is sometimes referred to as the "new"
      buffer protocol, though it's not that new anymore.
      
      The link below describes new features in Python 2.6.  In particular,
      it says that the buffer protocol described by PEP 3118 is in Python
      2.6.  It also says (at the top of the page) that Python 2.6 was
      released on Oct 1, 2008.
      
      https://docs.python.org/3/whatsnew/2.6.html#pep-3118-revised-buffer-protocol
      
      The last security release for the Python 2.6 series was 2.6.9.  It was
      released on Oct 29, 2013.  According to this document...
      
      https://www.python.org/download/releases/2.6.9/
      
      ...support for the 2.6 series has ended:
      
          With the 2.6.9 release, and five years after its first release,
          the Python 2.6 series is now officially retired.  All official
          maintenance for Python 2.6, including security patches, has ended.
          For ongoing maintenance releases, please see the Python 2.7
          series.
      
      As noted earlier, Python 2.6, Python 2.7, and Python 3.X all have
      support for the PEP 3118 buffer protocol.  Python releases prior
      to 2.6 use an older buffer protocol.  Since Python 2.6 has been
      retired for a good while now, it seems reasonable to me to remove
      code using the older buffer protocol from GDB.
      
      I have also simplified some of the code via use of the Py_buffer
      unique_ptr specialization which I introduced in the two argument
      gdb.Value constructor patch series.  Therefore, there is a dependency
      on patch #1 from that series.
      
      I have tested against both Python 2.7.15 and 3.7.2.  I see no
      regressions among the non-racy tests.  I've also verified that
      PyBuffer_Release is being called when the affected functions exit
      while running the tests in gdb.python/py-inferior.exp by hand.  I've
      also tried running valgrind on GDB while running this test, but I'm
      puzzled by the results that I'm seeing - I'm seeing no additional
      leaks when I comment out the Py_buffer_up lines that I introduced.
      That said, I'm not seeing any leaks that obviously originate from
      either infpy_write_memory() or infpy_search_memory().
      
      gdb/ChangeLog:
      
      	* python/py-inferior.c (infpy_write_memory): Remove non-IS_PY3K
      	code from these functions.  Remove corresponding ifdefs.  Use
      	Py_buffer_up instead of explicit calls to PyBuffer_Release.
      	Remove gotos and target of gotos.
      	(infpy_search_memory): Likewise.
      6ca62222
  7. Feb 27, 2019
    • Andrew Burgess's avatar
      gdb/hppa: Use default gdbarch method default_dummy_id. · f4bc7d2c
      Andrew Burgess authored
      Make use of the default gdbarch method for gdbarch_dummy_id.
      
      I have not tested this change but, by inspecting the code, I believe
      the default method is equivalent to the code being deleted.
      
      gdb/ChangeLog:
      
      	* gdb/hppa-tdep.c (hppa_dummy_id): Delete.
      	(hppa_gdbarch_init): Don't register deleted functions with
      	gdbarch.
      f4bc7d2c
    • Andrew Burgess's avatar
      gdb/h8300: Use default gdbarch methods where possible · 9734a586
      Andrew Burgess authored
      Make use of the default gdbarch methods for gdbarch_dummy_id,
      gdbarch_unwind_pc, and gdbarch_unwind_sp where possible.
      
      I have not tested this change but, by inspecting the code, I believe
      the default methods are equivalent to the code being deleted.
      
      gdb/ChangeLog:
      
      	* gdb/h8300-tdep.c (h8300_unwind_pc): Delete.
      	(h8300_unwind_sp): Delete.
      	(h8300_dummy_id): Delete.
      	(h8300_gdbarch_init): Don't register deleted functions with
      	gdbarch.
      9734a586
    • Andrew Burgess's avatar
      gdb/ft32: Use default gdbarch methods where possible · 68b867f3
      Andrew Burgess authored
      Make use of the default gdbarch methods for gdbarch_dummy_id,
      gdbarch_unwind_pc, and gdbarch_unwind_sp where possible.
      
      I have not tested this change but, by inspecting the code, I believe
      the default methods are equivalent to the code being deleted.
      
      gdb/ChangeLog:
      
      	* gdb/ft32-tdep.c (ft32_dummy_id): Delete.
      	(ft32_unwind_pc): Delete.
      	(ft32_unwind_sp): Delete.
      	(ft32_gdbarch_init): Don't register deleted functions with
      	gdbarch.
      68b867f3
    • Andrew Burgess's avatar
      gdb/frv: Use default gdbarch methods where possible · 2fbe7ad0
      Andrew Burgess authored
      Make use of the default gdbarch methods for gdbarch_dummy_id,
      gdbarch_unwind_pc, and gdbarch_unwind_sp where possible.
      
      I have not tested this change but, by inspecting the code, I believe
      the default methods are equivalent to the code being deleted.
      
      gdb/ChangeLog:
      
      	* gdb/frv-tdep.c (frv_dummy_id): Delete.
      	(frv_unwind_pc): Delete.
      	(frv_unwind_sp): Delete.
      	(frv_gdbarch_init): Don't register deleted functions with
      	gdbarch.
      2fbe7ad0
    • Andrew Burgess's avatar
      gdb/riscv: Use default gdbarch methods where possible · 76055cbe
      Andrew Burgess authored
      Make use of the default gdbarch methods for gdbarch_dummy_id,
      gdbarch_unwind_pc, and gdbarch_unwind_sp where possible.
      
      This change has been tested with no regressions.
      
      gdb/ChangeLog:
      
      	* gdb/riscv-tdep.c (riscv_dummy_id): Delete.
      	(riscv_unwind_pc): Delete.
      	(riscv_unwind_sp): Delete.
      	(riscv_gdbarch_init): Don't register deleted functions with
      	gdbarch.
      76055cbe
    • Andrew Burgess's avatar
      gdb/csky: Use default gdbarch methods where possible · 4133e5a1
      Andrew Burgess authored
      Make use of the default gdbarch methods for gdbarch_dummy_id,
      gdbarch_unwind_pc, and gdbarch_unwind_sp where possible.
      
      I have not tested this change but, by inspecting the code, I believe
      the default methods are equivalent to the code being deleted.
      
      gdb/ChangeLog:
      
      	* gdb/csky-tdep.c (csky_dummy_id): Delete.
      	(csky_unwind_pc): Delete.
      	(csky_unwind_sp): Delete.
      	(csky_gdbarch_init): Don't register deleted functions with
      	gdbarch.
      4133e5a1
    • Andrew Burgess's avatar
      gdb/cris: Use default gdbarch methods where possible · 8010f576
      Andrew Burgess authored
      Make use of the default gdbarch methods for gdbarch_dummy_id,
      gdbarch_unwind_pc, and gdbarch_unwind_sp where possible.
      
      I have not tested this change but, by inspecting the code, I believe
      the default methods are equivalent to the code being deleted.
      
      gdb/ChangeLog:
      
      	* gdb/cris-tdep.c (cris_dummy_id): Delete.
      	(cris_unwind_pc): Delete.
      	(cris_unwind_sp): Delete.
      	(cris_gdbarch_init): Don't register deleted functions with
      	gdbarch.
      8010f576
    • Andrew Burgess's avatar
      gdb/bfin: Use default gdbarch methods where possible · b56bf084
      Andrew Burgess authored
      Make use of the default gdbarch methods for gdbarch_dummy_id,
      and gdbarch_unwind_pc.
      
      I have not tested this change but, by inspecting the code, I believe
      the default methods are equivalent to the code being deleted.
      
      gdb/ChangeLog:
      
      	* gdb/bfin-tdep.c (bfin_dummy_id): Delete.
      	(bfin_unwind_pc): Delete.
      	(bfin_gdbarch_init): Don't register deleted functions with gdbarch.
      b56bf084
    • Andrew Burgess's avatar
      gdb/arm: Use default gdbarch methods where possible · a19a650f
      Andrew Burgess authored
      Make use of the default gdbarch methods for gdbarch_dummy_id,
      gdbarch_unwind_pc, and gdbarch_unwind_sp where possible.
      
      I have not tested this change but, by inspecting the code, I believe
      the default methods are equivalent to the code being deleted.
      
      gdb/ChangeLog:
      
      	* gdb/arm-tdep.c (arm_dummy_id): Delete.
      	(arm_unwind_pc): Delete.
      	(arm_unwind_sp): Delete.
      	(arm_gdbarch_init): Don't register deleted functions with gdbarch.
      a19a650f