Skip to content
Snippets Groups Projects
  1. Jan 01, 2023
  2. Mar 23, 2022
    • Simon Marchi's avatar
      gdb/python: remove Python 2/3 compatibility macros · 5aee4587
      Simon Marchi authored
      New in this version:
      
       - Rebase on master, fix a few more issues that appeared.
      
      python-internal.h contains a number of macros that helped make the code
      work with both Python 2 and 3.  Remove them and adjust the code to use
      the Python 3 functions.
      
      Change-Id: I99a3d80067fb2d65de4f69f6473ba6ffd16efb2d
      5aee4587
  3. Jan 01, 2022
  4. Jan 01, 2021
  5. Jan 01, 2020
  6. Jan 01, 2019
    • Joel Brobecker's avatar
      Update copyright year range in all GDB files. · 42a4f53d
      Joel Brobecker authored
      This commit applies all changes made after running the gdb/copyright.py
      script.
      
      Note that one file was flagged by the script, due to an invalid
      copyright header
      (gdb/unittests/basic_string_view/element_access/char/empty.cc).
      As the file was copied from GCC's libstdc++-v3 testsuite, this commit
      leaves this file untouched for the time being; a patch to fix the header
      was sent to gcc-patches first.
      
      gdb/ChangeLog:
      
      	Update copyright year range in all GDB files.
      42a4f53d
  7. Jan 02, 2018
  8. Feb 14, 2017
    • Tim Wiederhake's avatar
      python: Implement btrace Python bindings for record history. · 75c0bdf4
      Tim Wiederhake authored
      
      This patch implements the gdb.Record Python object methods and fields for
      record target btrace.  Also, implement a stub for record target full.
      
      Signed-off-by: default avatarTim Wiederhake <tim.wiederhake@intel.com>
      
      gdb/ChangeLog:
      
      	* Makefile.in (SUBDIR_PYTHON_OBS): Add py-record-btrace.o,
      	py-record-full.o.
      	(SUBDIR_PYTHON_SRCS): Add py-record-btrace.c, py-record-full.c.
      	* python/py-record-btrace.c, python/py-record-btrace.h,
      	python/py-record-full.c, python/py-record-full.h: New file.
      	* python/py-record.c: Add include for py-record-btrace.h and
      	py-record-full.h.
      	(recpy_method, recpy_format, recpy_goto, recpy_replay_position,
      	recpy_instruction_history, recpy_function_call_history, recpy_begin,
      	recpy_end): Use functions from py-record-btrace.c and py-record-full.c.
      	* python/python-internal.h (PyInt_FromSsize_t, PyInt_AsSsize_t):
      	New definition.
      	(gdbpy_initialize_btrace): New export.
      	* python/python.c (_initialize_python): Add gdbpy_initialize_btrace.
      
      Change-Id: I8bd893672ffc7e619cc1386767897249e125973a
      75c0bdf4
  9. Jan 01, 2017
    • Joel Brobecker's avatar
      update copyright year range in GDB files · 61baf725
      Joel Brobecker authored
      This applies the second part of GDB's End of Year Procedure, which
      updates the copyright year range in all of GDB's files.
      
      gdb/ChangeLog:
      
              Update copyright year range in all GDB files.
      61baf725
  10. Nov 16, 2016
    • Kevin Buettner's avatar
      Extend test gdb.python/py-recurse-unwind.exp · 1a2f3d7f
      Kevin Buettner authored
      This patch modifies the unwinder (sniffer) defined in
      py-recurse-unwind.py so that, depending upon the value of one of its
      class variables, it will take different paths through the code,
      testing different functionality.
      
      The original test attempted to obtain the value of an undefined
      symbol.
      
      This somewhat expanded test checks to see if 'pc' can be read via
      gdb.PendingFrame.read_register() and also via gdb.parse_and_eval().
      
      gdb/testsuite/ChangeLog:
      
      	* gdb.python/py-recurse-unwind.c (main): Add loop.
      	* gdb.python/py-recurse-unwind.py (TestUnwinder): Add calls
      	to read_register() and gdb.parse_and_eval().  Make each code
      	call a separate case that can be individually tested.
      	* gdb.python/py-recurse-unwind.exp (cont_and_backtrace): New
      	proc. Call cont_and_backtrace for each of the code paths that
      	we want to test in the unwinder.
      1a2f3d7f
  11. Aug 24, 2016
    • Kevin Buettner's avatar
      Test case to detect recursive unwinding in Python-based unwinders. · bb1fe4ac
      Kevin Buettner authored
      This test case verifies that GDB will not attempt to invoke a python
      unwinder recursively.
      
      At the moment, the behavior exhibited by GDB looks like this:
      
          (gdb) source py-recurse-unwind.py
          Python script imported
          (gdb) b ccc
          Breakpoint 1 at 0x4004bd: file py-recurse-unwind.c, line 23.
          (gdb) run
          Starting program: py-recurse-unwind
          TestUnwinder: Recursion detected - returning early.
          TestUnwinder: Recursion detected - returning early.
          TestUnwinder: Recursion detected - returning early.
          TestUnwinder: Recursion detected - returning early.
      
          Breakpoint 1, ccc (arg=<unavailable>) at py-recurse-unwind.c:23
          23      }
          (gdb) bt
          #-1 ccc (arg=<unavailable>) at py-recurse-unwind.c:23
          Backtrace stopped: previous frame identical to this frame (corrupt stack?)
      
      [I've shortened pathnames for easier reading.]
      
      The desired / expected behavior looks like this:
      
          (gdb) source py-recurse-unwind.py
          Python script imported
          (gdb) b ccc
          Breakpoint 1 at 0x4004bd: file py-recurse-unwind.c, line 23.
          (gdb) run
          Starting program: py-recurse-unwind
      
          Breakpoint 1, ccc (arg=789) at py-recurse-unwind.c:23
          23      }
          (gdb) bt
          #0  ccc (arg=789) at py-recurse-unwind.c:23
          #1  0x00000000004004d5 in bbb (arg=456) at py-recurse-unwind.c:28
          #2  0x00000000004004ed in aaa (arg=123) at py-recurse-unwind.c:34
          #3  0x00000000004004fe in main () at py-recurse-unwind.c:40
      
      Note that GDB's problems go well beyond the fact that it invokes the
      unwinder recursively.  In the process it messes up some internal state
      (the frame stash) leading to display of (only) the sentinel frame in
      the backtrace.
      
      gdb/testsuite/ChangeLog:
      
      	* gdb.python/py-recurse-unwind.c: New file.
      	* gdb.python/py-recurse-unwind.py: New file.
      	* gdb.python/py-recurse-unwind.exp: New file.
      bb1fe4ac
  12. Feb 10, 2016
    • Keith Seitz's avatar
      breakpoints/19546: Fix crash after updating breakpoints · 9ef9e6a6
      Keith Seitz authored
      One of the last checks update_breakpoints_after_exec does while looping
      over the list of breakpoints is check that the breakpoint has a valid
      location spec. It uses event_location_empty_p to check if the location spec
      is "empty", and if it is, the breakpoint is deleted.
      
      momentary_breakpoint types rely on setting the breakpoint structure's
      location spec to NULL, thereby causing an update to delete the breakpoint.
      However, event_location_empty_p assumed that locations were never NULL.
      As a result, GDB would crash dereferencing a NULL pointer whenever
      update_breakpoints_after_exec would encounter a momentary_breakpoint.
      
      This patch creates a new wrapper/helper function which tests that the given
      breakpoint's location spec is non-NULL and if it is not "empty"
      or "unspecified."
      
      gdb/ChangeLog
      
      	PR breakpoints/19546
      	* breakpoint.c (breakpoint_event_location_empty_p): New function.
      	(update_breakpoints_after_exec, bkpt_re_set): Use this new function
      	instead of event_location_empty_p.
      
      gdb/testsuite/ChangeLog
      
      	PR breakpoints/19546
      	* gdb.base/infcall-exec.c: New file.
      	* gdb.base/infcall-exec2.c: New file.
      	* gdb.base/infcall-exec.exp: New file.
  13. Jan 01, 2016
  14. Jan 01, 2015
  15. Jan 01, 2014
  16. Jun 07, 2013
    • Pedro Alves's avatar
      Fix formating in copyright headers. · 47d48711
      Pedro Alves authored
      File list found with:
      $ grep "along with this program" * -A 1 -rn \
      	| grep "*/" \
      	| grep -v "along with this program" \
      	| sed 's,-[0-9]\+-.*,,g'
      
      Tested on x86_64 Fedora 17.
      
      gdb/
      2013-06-07  Pedro Alves  <palves@redhat.com>
      
      	* darwin-nat.c: Fix formating in copyright header.
      	* darwin-nat.h: Likewise.
      	* gnu-nat.c: Likewise.
      	* machoread.c: Likewise.
      
      gdb/testsuite/
      2013-06-07  Pedro Alves  <palves@redhat.com>
      
      	* gdb.ada/info_types.c: Fix formating in copyright header.
      	* gdb.base/break-on-linker-gcd-function.cc: Likewise.
      	* gdb.base/float.c: Likewise.
      	* gdb.base/inferior-died.c: Likewise.
      	* gdb.base/interp.c: Likewise.
      	* gdb.base/jit-main.c: Likewise.
      	* gdb.base/jit-solib.c: Likewise.
      	* gdb.base/long_long.c: Likewise.
      	* gdb.base/longjmp.c: Likewise.
      	* gdb.base/nextoverexit.c: Likewise.
      	* gdb.base/pr11022.c: Likewise.
      	* gdb.base/prelink-lib.c: Likewise.
      	* gdb.base/prelink.c: Likewise.
      	* gdb.base/prologue.c: Likewise.
      	* gdb.base/restore.c: Likewise.
      	* gdb.base/sigchld.c: Likewise.
      	* gdb.base/solib-search-lib1.c: Likewise.
      	* gdb.base/solib-search-lib2.c: Likewise.
      	* gdb.base/solib-search.c: Likewise.
      	* gdb.base/solib-search.h: Likewise.
      	* gdb.base/whatis.c: Likewise.
      	* gdb.cp/abstract-origin.cc: Likewise.
      	* gdb.cp/anon-struct.cc: Likewise.
      	* gdb.cp/baseenum.cc: Likewise.
      	* gdb.cp/bs15503.cc: Likewise.
      	* gdb.cp/call-c-1.c: Likewise.
      	* gdb.cp/call-c.cc: Likewise.
      	* gdb.cp/class2.cc: Likewise.
      	* gdb.cp/classes.cc: Likewise.
      	* gdb.cp/cttiadd.cc: Likewise.
      	* gdb.cp/cttiadd1.cc: Likewise.
      	* gdb.cp/cttiadd2.cc: Likewise.
      	* gdb.cp/cttiadd3.cc: Likewise.
      	* gdb.cp/derivation.cc: Likewise.
      	* gdb.cp/derivation2.cc: Likewise.
      	* gdb.cp/dispcxx.cc: Likewise.
      	* gdb.cp/exception.cc: Likewise.
      	* gdb.cp/gdb2384-base.cc: Likewise.
      	* gdb.cp/gdb2384-base.h: Likewise.
      	* gdb.cp/gdb2384.cc: Likewise.
      	* gdb.cp/gdb2495.cc: Likewise.
      	* gdb.cp/mb-inline.h: Likewise.
      	* gdb.cp/mb-inline1.cc: Likewise.
      	* gdb.cp/mb-inline2.cc: Likewise.
      	* gdb.cp/member-name.cc: Likewise.
      	* gdb.cp/member-ptr.cc: Likewise.
      	* gdb.cp/misc.cc: Likewise.
      	* gdb.cp/namespace1.cc: Likewise.
      	* gdb.cp/nextoverthrow.cc: Likewise.
      	* gdb.cp/pr-574.cc: Likewise.
      	* gdb.cp/pr9631.cc: Likewise.
      	* gdb.cp/printmethod.cc: Likewise.
      	* gdb.cp/psmang1.cc: Likewise.
      	* gdb.cp/psmang2.cc: Likewise.
      	* gdb.cp/psymtab-parameter.cc: Likewise.
      	* gdb.cp/ptype-flags.cc: Likewise.
      	* gdb.cp/ref-params.cc: Likewise.
      	* gdb.cp/ref-types.cc: Likewise.
      	* gdb.cp/smartp.cc: Likewise.
      	* gdb.cp/try_catch.cc: Likewise.
      	* gdb.cp/userdef.cc: Likewise.
      	* gdb.cp/using-crash.cc: Likewise.
      	* gdb.cp/virtfunc.cc: Likewise.
      	* gdb.cp/virtfunc2.cc: Likewise.
      	* gdb.dwarf2/callframecfa.S: Likewise.
      	* gdb.dwarf2/dw2-ranges.c: Likewise.
      	* gdb.dwarf2/dw2-ranges2.c: Likewise.
      	* gdb.dwarf2/dw2-ranges3.c: Likewise.
      	* gdb.dwarf2/dw2-restore.S: Likewise.
      	* gdb.dwarf2/pieces.S: Likewise.
      	* gdb.dwarf2/valop.S: Likewise.
      	* gdb.java/jnpe.java: Likewise.
      	* gdb.mi/mi-stepn.c: Likewise.
      	* gdb.mi/mi-var-cp.cc: Likewise.
      	* gdb.mi/mi-var-rtti.cc: Likewise.
      	* gdb.mi/ns-stale-regcache.c: Likewise.
      	* gdb.mi/pr11022.c: Likewise.
      	* gdb.mi/solib-lib.c: Likewise.
      	* gdb.mi/solib-main.c: Likewise.
      	* gdb.python/py-arch.c: Likewise.
      	* gdb.python/py-block.c: Likewise.
      	* gdb.python/py-breakpoint.c: Likewise.
      	* gdb.python/py-events.c: Likewise.
      	* gdb.python/py-evthreads.c: Likewise.
      	* gdb.python/py-explore.c: Likewise.
      	* gdb.python/py-explore.cc: Likewise.
      	* gdb.python/py-finish-breakpoint.c: Likewise.
      	* gdb.python/py-finish-breakpoint2.cc: Likewise.
      	* gdb.python/py-symbol.c: Likewise.
      	* gdb.threads/execl.c: Likewise.
      	* gdb.threads/execl1.c: Likewise.
      47d48711
  17. May 07, 2013
  18. Jan 01, 2013
  19. Jan 04, 2012
  20. Aug 01, 2011
    • Paul Pluzhnikov's avatar
      2011-08-01 Paul Pluzhnikov <ppluzhnikov@google.com> · fbe12357
      Paul Pluzhnikov authored
      	PR gdb/13045
      	* doublest.c (convert_doublest_to_floatformat): Pass correct
      	mantissa length to put_field.
      
      testsuite/ChangeLog:
      
      2011-07-30  Paul Pluzhnikov  <ppluzhnikov@google.com>
      
      	PR gdb/13045
      	* gdb.base/float.exp: Add new test case for PR gdb/13045
      	* gdb.base/float.c: New file.
      fbe12357
  21. Jan 31, 2011
  22. Jan 29, 2011
    • Jan Kratochvil's avatar
      gdb/ · 80b23b6a
      Jan Kratochvil authored
      	Fix crash.
      	* valops.c (compare_parameters): Verify TYPE_NFIELDS before
      	touching TYPE_FIELD_ARTIFICIAL.
      
      gdb/testsuite/
      	* gdb.cp/noparam.exp: New file.
      	* gdb.cp/noparam.cc: New file.
      80b23b6a
  23. Jan 01, 2011
  24. Apr 15, 2010
    • Doug Evans's avatar
      * NEWS: Add entry for python program space support. · fa33c3cd
      Doug Evans authored
      	* Makefile.in (SUBDIR_PYTHON_OBS): Add py-progspace.o.
      	(SUBDIR_PYTHON_SRCS): Add py-progspace.c.
      	(py-progspace.o): New rule.
      	* python/py-prettyprint.c (find_pretty_printer_from_objfiles): New
      	function.
      	(find_pretty_printer_from_progspace): New function.
      	(find_pretty_printer_from_gdb): New function.
      	(find_pretty_printer): Rewrite.
      	* python/py-progspace.c: New file.
      	* python/python-internal.h (program_space): Add forward decl.
      	(pspace_to_pspace_object, pspy_get_printers): Declare.
      	(gdbpy_initialize_pspace): Declare.
      	* python/python.c: #include "progspace.h".
      	(gdbpy_get_current_progspace, gdbpy_progspaces): New functions.
      	(_initialize_python): Call gdbpy_initialize_pspace.
      	(GdbMethods): Add current_progspace, progspaces.
      
      	doc/
      	* gdb.texinfo (Python API): Add progspaces section.
      	(Selecting Pretty-Printers): Progspace pretty-printers are
      	searched too.
      	(Progspaces In Python): New section.
      
      	testsuite/
      	* gdb.python/py-progspace.c: New file.
      	* gdb.python/py-progspace.exp: New file.
      fa33c3cd
  25. Feb 01, 2010
    • Jan Kratochvil's avatar
      gdb/ · b381ea14
      Jan Kratochvil authored
      	* solib-svr4.c (scan_dyntag): New variable dyn_addr.  Replace gdb_assert
      	by a conditional setting DYN_ADDR.  Use DYN_ADDR.
      	* config/djgpp/fnchange.lst: Add translations for
      	symbol-without-target_section.exp and symbol-without-target_section.c.
      
      gdb/testsuite/
      	* gdb.base/symbol-without-target_section.exp,
      	gdb.base/symbol-without-target_section.c: New.
      b381ea14
  26. Jan 19, 2010
    • Jan Kratochvil's avatar
      gdb/ · a0f49112
      Jan Kratochvil authored
      	* breakpoint.c (watchpoint_check): Check the call
      	gdbarch_in_function_epilogue_p before calling frame_find_by_id.
      	Extend the comment.
      	* config/djgpp/fnchange.lst: Add translations for
      	watchpoint-cond-gone.exp, watchpoint-cond-gone.c and
      	watchpoint-cond-gone-stripped.c.
      
      gdb/testsuite/
      	* gdb.base/watchpoint-cond-gone.exp, gdb.base/watchpoint-cond-gone.c,
      	gdb.base/watchpoint-cond-gone-stripped.c: New.
      a0f49112
  27. Jan 01, 2010
  28. Nov 02, 2009
    • Jan Kratochvil's avatar
      gdb/ · 287ccc17
      Jan Kratochvil authored
      	* symfile.c (separate_debug_file_exists): When the CRCs mismatch
      	print a warning.
      	(find_separate_debug_file): Pass in the objfile's name.
      
      gdb/testsuite/
      	* gdb.base/sepdebug.exp (CRC mismatch is reported): New test.
      	* gdb.base/sepdebug2.c: New file.
      287ccc17
  29. Mar 18, 2009
    • Pedro Alves's avatar
      * return-nodebug.c: Don't include stdio.h. · 51272cf2
      Pedro Alves authored
      	(init): Delete.
      	(func): Delete definition and provide extern declaration.
      	(t): New.
      	(main): Don't call printf.  Call func and store its result in t.
      	* return-nodebug1.c: New.
      	* return-nodebug.exp: Don't expect stdio output.  Instead, print
      	the global variable t.  Drop printf formatters and cast types from
      	foreach loop.  Don't use prepare_for_testing.  Compile
      	return-nodebug.c and return-nodebug1.c in separate steps.  Don't
      	define FORMAT or CAST.
      51272cf2
  30. Jan 03, 2009
  31. Jan 01, 2008
  32. Aug 23, 2007
  33. Jan 21, 2007
    • Daniel Jacobowitz's avatar
      2007-01-21 Jan Kratochvil <jan.kratochvil@redhat.com> · cb1df416
      Daniel Jacobowitz authored
      	    Daniel Jacobowitz  <dan@codesourcery.com>
      
      	* buildsym.c (end_symtab): Use preallocated symtab if available.
      	Fill in SYMBOL_SYMTAB.
      	* buildsym.h (struct subfile): Add symtab member.
      	* dwarf2read.c (struct dwarf2_cu): Add line_header.
      	(struct file_entry): Add symtab.
      	(free_cu_line_header): New function.
      	(read_file_scope): Use it.  Save line_header in the cu.  Process
      	lines before DIEs.
      	(add_file_name): Initialize new symtab member.
      	(dwarf_decode_lines): Create symtabs for included files.
      	(new_symbol): Set SYMBOL_SYMTAB.
      	* symtab.c (lookup_symbol): Use SYMBOL_SYMTAB.
      	(search_symbols): Likewise.
      	* symtab.h (struct symbol): Add symtab member.
      	(SYMBOL_SYMTAB): Define.
      
      	* gdb.base/included.c, gdb.base/included.exp,
      	gdb.base/included.h: New files.
      cb1df416
  34. Jan 09, 2007
  35. Apr 11, 2005
    • Daniel Jacobowitz's avatar
      gdb/ · 9494c6a5
      Daniel Jacobowitz authored
      	* config/djgpp/fnchange.lst: Remove entries for gdb.gdbserver.
      gdb/testsuite/
      	* Makefile.in (ALL_SUBDIRS): Replace gdb.gdbserver with
      	gdb.server.
      	* configure.ac: Likewise.
      	* configure: Regenerated.
      	* gdb.gdbserver/Makefile.in: Moved to...
      	* gdb.server/Makefile.in: ... here.
      	* gdb.gdbserver/server.c: Moved to...
      	* gdb.server/server.c: ... here.
      	* gdb.gdbserver/server-run.exp: Moved to...
      	* gdb.server/server-run.exp: ... here.
      9494c6a5
  36. Apr 08, 2005
    • Daniel Jacobowitz's avatar
      gdb/testsuite/ · 6f8eac0e
      Daniel Jacobowitz authored
      	* Makefile.in (ALL_SUBDIRS): Add gdb.gdbserver.
      	* configure.ac: Create gdb.gdbserver/Makefile.
      	* configure: Regenerated.
      	* lib/gdbserver-support.exp: New file, derived from
      	config/gdbserver.exp.
      	* config/gdbserver.exp: Use gdbserver-support.exp.
      	* gdb.gdbserver/Makefile.in: New file.
      	* gdb.gdbserver/server.c: New file.
      	* gdb.gdbserver/server-run.exp: New file.
      gdb/
      	* config/fnchange.lst: Add testsuite/gdb.gdbserver entries.
      6f8eac0e
  37. Oct 12, 2004
    • Daniel Jacobowitz's avatar
      * configure.in: Add gdb.dwarf2. · 0eb3658b
      Daniel Jacobowitz authored
      	* configure: Regenerated.
      	* Makefile.in: Add gdb.dwarf2.
      	* gdb.dwarf2/Makefile.in, gdb.dwarf2/dw2-basic.S,
      	gdb.dwarf2/dw2-basic.exp, gdb.dwarf2/main.c,
      	gdb.dwarf2/file1.txt: New files.
      0eb3658b
  38. Aug 12, 2004
    • Jeff Johnston's avatar
      · 37fdf854
      Jeff Johnston authored
      2004-08-12  Jeff Johnston  <jjohnstn@redhat.com>
      
              * gdb.base/unload.exp: New test for breakpoints in dynamically
              loaded libraries.
              * gdb.base/unload.c: Ditto.
              * gdb.base/unloadshr.c: Ditto.
      37fdf854
  39. Apr 22, 2004
  40. Apr 12, 2004
Loading