aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.python/py-inferior.exp
AgeCommit message (Collapse)AuthorFilesLines
2023-01-13Use "require" for Python testsTom Tromey1-3/+2
This changes various tests to use "require" for the Python feature.
2023-01-01Update copyright year range in header of all files managed by GDBJoel Brobecker1-1/+1
This commit is the result of running the gdb/copyright.py script, which automated the update of the copyright year range for all source files managed by the GDB project to be updated to include year 2023.
2022-11-28gdb/testsuite: remove use of then keyword from gdb.python/*.expAndrew Burgess1-1/+1
The canonical form of 'if' in modern TCL is 'if {} {}'. But there's still a bunch of places in the testsuite where we make use of the 'then' keyword, and sometimes these get copies into new tests, which just spreads poor practice. This commit removes all use of the 'then' keyword from the gdb.python/ test script directory. There should be no changes in what is tested after this commit.
2022-03-23gdb/python: remove Python 2 supportSimon Marchi1-5/+1
New in this version: - Add a PY_MAJOR_VERSION check in configure.ac / AC_TRY_LIBPYTHON. If the user passes --with-python=python2, this will cause a configure failure saying that GDB only supports Python 3. Support for Python 2 is a maintenance burden for any patches touching Python support. Among others, the differences between Python 2 and 3 string and integer types are subtle. It requires a lot of effort and thinking to get something that behaves correctly on both. And that's if the author and reviewer of the patch even remember to test with Python 2. See this thread for an example: https://sourceware.org/pipermail/gdb-patches/2021-December/184260.html So, remove Python 2 support. Update the documentation to state that GDB can be built against Python 3 (as opposed to Python 2 or 3). Update all the spots that use: - sys.version_info - IS_PY3K - PY_MAJOR_VERSION - gdb_py_is_py3k ... to only keep the Python 3 portions and drop the use of some now-removed compatibility macros. I did not update the configure script more than just removing the explicit references to Python 2. We could maybe do more there, like check the Python version and reject it if that version is not supported. Otherwise (with this patch), things will only fail at compile time, so it won't really be clear to the user that they are trying to use an unsupported Python version. But I'm a bit lost in the configure code that checks for Python, so I kept that for later. Change-Id: I75b0f79c148afbe3c07ac664cfa9cade052c0c62
2022-01-26Change how Python architecture and language are handledTom Tromey1-0/+2
Currently, gdb's Python layer captures the current architecture and language when "entering" Python code. This has some undesirable effects, and so this series changes how this is handled. First, there is code like this: gdbpy_enter enter_py (python_gdbarch, python_language); This is incorrect, because both of these are NULL when not otherwise assigned. This can cause crashes in some cases -- I've added one to the test suite. (Note that this crasher is just an example, other ones along the same lines are possible.) Second, when the language is captured in this way, it means that Python code cannot affect the current language for its own purposes. It's reasonable to want to write code like this: gdb.execute('set language mumble') ... stuff using the current language gdb.execute('set language previous-value') However, this won't actually work, because the language is captured on entry. I've added a test to show this as well. This patch changes gdb to try to avoid capturing the current values. The Python concept of the current gdbarch is only set in those few cases where a non-default value is computed or needed; and the language is not captured at all -- instead, in the cases where it's required, the current language is temporarily changed.
2022-01-01Automatic Copyright Year update after running gdb/copyright.pyJoel Brobecker1-1/+1
This commit brings all the changes made by running gdb/copyright.py as per GDB's Start of New Year Procedure. For the avoidance of doubt, all changes in this commits were performed by the script.
2021-11-30gdb/python: introduce gdb.TargetConnection object typeAndrew Burgess1-2/+18
This commit adds a new object type gdb.TargetConnection. This new type represents a connection within GDB (a connection as displayed by 'info connections'). There's three ways to find a gdb.TargetConnection, there's a new 'gdb.connections()' function, which returns a list of all currently active connections. Or you can read the new 'connection' property on the gdb.Inferior object type, this contains the connection for that inferior (or None if the inferior has no connection, for example, it is exited). Finally, there's a new gdb.events.connection_removed event registry, this emits a new gdb.ConnectionEvent whenever a connection is removed from GDB (this can happen when all inferiors using a connection exit, though this is not always the case, depending on the connection type). The gdb.ConnectionEvent has a 'connection' property, which is the gdb.TargetConnection being removed from GDB. The gdb.TargetConnection has an 'is_valid()' method. A connection object becomes invalid when the underlying connection is removed from GDB (as discussed above, this might be when all inferiors using a connection exit, or it might be when the user explicitly replaces a connection in GDB by issuing another 'target' command). The gdb.TargetConnection has the following read-only properties: 'num': The number for this connection, 'type': e.g. 'native', 'remote', 'sim', etc 'description': The longer description as seen in the 'info connections' command output. 'details': A string or None. Extra details for the connection, for example, a remote connection's details might be 'hostname:port'.
2021-09-30gdb/testsuite: make runto_main not pass no-message to runtoSimon Marchi1-1/+0
As follow-up to this discussion: https://sourceware.org/pipermail/gdb-patches/2020-August/171385.html ... make runto_main not pass no-message to runto. This means that if we fail to run to main, for some reason, we'll emit a FAIL. This is the behavior we want the majority of (if not all) the time. Without this, we rely on tests logging a failure if runto_main fails, otherwise. They do so in a very inconsisteny mannet, sometimes using "fail", "unsupported" or "untested". The messages also vary widly. This patch removes all these messages as well. Also, remove a few "fail" where we call runto (and not runto_main). by default (without an explicit no-message argument), runto prints a failure already. In two places, gdb.multi/multi-re-run.exp and gdb.python/py-pp-registration.exp, remove "message" passed to runto. This removes a few PASSes that we don't care about (but FAILs will still be printed if we fail to run to where we want to). This aligns their behavior with the rest of the testsuite. Change-Id: Ib763c98c5f4fb6898886b635210d7c34bd4b9023
2021-05-14gdb/python: add a 'connection_num' attribute to Inferior objectsTankut Baris Aktemur1-1/+24
Define a 'connection_num' attribute for Inferior objects. The read-only attribute is the ID of the connection of an inferior, as printed by "info inferiors". In GDB's internal terminology, that's the process stratum target of the inferior. If the inferior has no target connection, the attribute is None. gdb/ChangeLog: 2021-05-14 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> * python/py-inferior.c (infpy_get_connection_num): New function. (inferior_object_getset): Add a new element for 'connection_num'. * NEWS: Mention the 'connection_num' attribute of Inferior objects. gdb/doc/ChangeLog: 2021-05-14 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> * python.texi (Inferiors In Python): Mention the 'connection_num' attribute. gdb/testsuite/ChangeLog: 2021-05-14 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> * gdb.python/py-inferior.exp: Add test cases for 'connection_num'.
2021-01-01Update copyright year range in all GDB filesJoel Brobecker1-1/+1
This commits the result of running gdb/copyright.py as per our Start of New Year procedure... gdb/ChangeLog Update copyright year range in copyright header of all GDB files.
2020-06-30Fix test breakages caused by removal of gdb_py_test_multiple.Philippe Waroquiers1-2/+2
Tom de Vries detected that some python tests were broken as they were still using gdb_py_test_multiple that was replaced by gdb_test_multiline. Repair these tests by using the new function. gdb/testsuite/ChangeLog 2020-06-30 Philippe Waroquiers <philippe.waroquiers@skynet.be> * gdb.python/py-breakpoint.exp: use gdb_test_multiline instead of gdb_py_test_multiple. * gdb.python/py-cmd.exp: Likewise. * gdb.python/py-events.exp: Likewise. * gdb.python/py-function.exp: Likewise. * gdb.python/py-inferior.exp: Likewise. * gdb.python/py-infthread.exp: Likewise. * gdb.python/py-linetable.exp: Likewise. * gdb.python/py-parameter.exp: Likewise. * gdb.python/py-value.exp: Likewise.
2020-01-10Add "info connections" command, "info inferiors" connection number/stringPedro Alves1-2/+2
This commit extends the CLI a bit for multi-target, in three ways. #1 - New "info connections" command. This is a new command that lists the open connections (process_stratum targets). For example, if you're debugging two remote connections, a couple local/native processes, and a core dump, all at the same time, you might see something like this: (gdb) info connections Num What Description 1 remote 192.168.0.1:9999 Remote serial target in gdb-specific protocol 2 remote 192.168.0.2:9998 Remote serial target in gdb-specific protocol * 3 native Native process 4 core Local core dump file #2 - New "info inferiors" "Connection" column You'll also see a new matching "Connection" column in "info inferiors", showing you which connection an inferior is bound to: (gdb) info inferiors Num Description Connection Executable 1 process 18526 1 (remote 192.168.0.1:9999) target:/tmp/a.out 2 process 18531 2 (remote 192.168.0.2:9998) target:/tmp/a.out 3 process 19115 3 (native) /tmp/prog1 4 process 6286 4 (core) myprogram * 5 process 19122 3 (native) /bin/hello #3 - Makes "add-inferior" show the inferior's target connection "add-inferior" now shows you the connection you've just bound the inferior to, which is the current process_stratum target: (gdb) add-inferior [New inferior 2] Added inferior 2 on connection 1 (extended-remote localhost:2346) gdb/ChangeLog: 2020-01-10 Pedro Alves <palves@redhat.com> * Makefile.in (COMMON_SFILES): Add target-connection.c. * inferior.c (uiout_field_connection): New function. (print_inferior): Add new "connection-id" column. (add_inferior_command): Show connection number/string of added inferior. * process-stratum-target.h (process_stratum_target::connection_string): New virtual method. (process_stratum_target::connection_number): New field. * remote.c (remote_target::connection_string): New override. * target-connection.c: New file. * target-connection.h: New file. * target.c (decref_target): Remove process_stratum targets from the connection list. (target_stack::push): Add process_stratum targets to the connection list. gdb/testsuite/ChangeLog: 2020-01-10 Pedro Alves <palves@redhat.com> * gdb.base/kill-detach-inferiors-cmd.exp: Adjust expected output of "add-inferior". * gdb.base/quit-live.exp: Likewise. * gdb.base/remote-exec-file.exp: Likewise. * gdb.guile/scm-progspace.exp: Likewise. * gdb.linespec/linespec.exp: Likewise. * gdb.mi/new-ui-mi-sync.exp: Likewise. * gdb.mi/user-selected-context-sync.exp: Likewise. * gdb.multi/multi-target.exp (setup): Add "info connection" and "info inferiors" tests. * gdb.multi/remove-inferiors.exp: Adjust expected output of "add-inferior". * gdb.multi/watchpoint-multi.exp: Likewise. * gdb.python/py-inferior.exp: Likewise. * gdb.server/extended-remote-restart.exp: Likewise. * gdb.threads/fork-plus-threads.exp: Adjust expected output of "info inferiors". * gdb.threads/forking-threads-plus-breakpoint.exp: Likewise. * gdb.trace/report.exp: Likewise.
2020-01-01Update copyright year range in all GDB files.Joel Brobecker1-1/+1
gdb/ChangeLog: Update copyright year range in all GDB files.
2019-01-01Update copyright year range in all GDB files.Joel Brobecker1-1/+1
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.
2018-10-06Add Inferior.architecture methodTom Tromey1-0/+8
I've written a couple of gdb unwinders in Python, and while doing so, I wanted to find the architecture of the inferior. (In an unwinder in particular, one can't use the frame's architecture, because there is no frame.) This patch adds Inferior.architecture to allow this. Normally I think I would have chosen an attribute and not a method here, but seeing that Frame.architecture is a method, I chose a method as well, for consistency. gdb/ChangeLog 2018-10-06 Tom Tromey <tom@tromey.com> PR python/19399: * python/py-inferior.c: Add "architecture" entry. (infpy_architecture): New function. gdb/doc/ChangeLog 2018-10-06 Tom Tromey <tom@tromey.com> PR python/19399: * python.texi (Inferiors In Python): Document Inferior.Architecture. gdb/testsuite/ChangeLog 2018-10-06 Tom Tromey <tom@tromey.com> PR python/19399: * gdb.python/py-inferior.exp: Add architecture test.
2018-09-13python: Add Inferior.progspace propertySimon Marchi1-0/+5
This patch adds a progspace property to the gdb.Inferior type, which allows getting the gdb.Progspace object associated to that inferior. In conjunction with the following patch, this will allow scripts iterate on objfiles associated with a particular inferior. gdb/ChangeLog: * python/py-inferior.c (infpy_get_progspace): New function. (inferior_object_getset): Add progspace property. * NEWS: Mention the new property. gdb/doc/ChangeLog: * python.texi (Inferiors In Python): Document Inferior.progspace. (Program Spaces In Python): Document that gdb.current_progspace() is the same as gdb.selected_inferior().progspace. gdb/testsuite/ChangeLog: * gdb.python/py-inferior.exp: Add tests for Inferior.progspace and a few other Inferior properties when the Inferior is no longer valid.
2018-09-13python: Provide textual representation for Inferior and ObjfileSimon Marchi1-1/+16
Printing a GDB Python object is notoriously not helpful: >>> print(gdb.selected_inferior()) <gdb.Inferior object at 0x7fea59aed198> >>> print(gdb.objfiles()) [<gdb.Objfile object at 0x7fea59b57c90>] This makes printing debug traces more difficult than it should be. This patch provides some repr() implementation for these two types (more to come if people agree with the idea, but I want to test the water first). Here's the same example as above, but with this patch: >>> print(gdb.selected_inferior()) <gdb.Inferior num=1> >>> print(gdb.objfiles()) [<gdb.Objfile filename=/home/emaisin/build/binutils-gdb-gcc-git/gdb/test>] I implemented repr rather than str, because when printing a list (or another container I suppose), Python calls the repr method of the elements. This is useful when printing a list of inferiors or objfiles. The print(gdb.objfiles()) above would not have worked if I had implemented str. I found this post useful to understand the difference between repr and str: https://stackoverflow.com/questions/1436703/difference-between-str-and-repr gdb/ChangeLog: * python/py-inferior.c (infpy_repr): New. (inferior_object_type): Register infpy_repr. * python/py-objfile.c (objfpy_repr): New. (objfile_object_type): Register objfpy_repr. gdb/testsuite/ChangeLog: * gdb.python/py-inferior.exp: Test repr() of gdb.Inferior. * gdb.python/py-objfile.exp: Test repr() of gdb.Objfile. * gdb.python/py-symtab.exp: Update test printing an objfile. gdb/doc/ChangeLog: * python.texi (Basic Python): Mention the string representation of GDB Python objects.
2018-09-12python: Add tests for trying to use an invalid Inferior objectSimon Marchi1-0/+13
This patch adds tests for trying to use property or methods on a gdb.Inferior object that represents an inferior that does not exist anymore. We expect an exception to be thrown. gdb/testsuite/ChangeLog: * gdb.python/py-inferior.exp: Test using an invalid gdb.Inferior object.
2018-01-02Update copyright year range in all GDB filesJoel Brobecker1-1/+1
gdb/ChangeLog: Update copyright year range in all GDB files
2017-09-11Add new_inferior, inferior_deleted, and new_thread eventsTom Tromey1-0/+24
This adds a few new events to gdb's Python layer: new_inferior, inferior_deleted, and new_thread. I wanted to be able to add a combined inferior/thread display window to my GUI, and I needed a few events to make this work. This is PR python/15622. ChangeLog 2017-09-11 Tom Tromey <tom@tromey.com> PR python/15622: * NEWS: Add entry. * python/python.c (do_start_initialization): Initialize new event types. * python/python-internal.h (gdbpy_initialize_new_inferior_event) (gdbpy_initialize_inferior_deleted_event) (gdbpy_initialize_new_thread_event): Declare. * python/py-threadevent.c (create_thread_event_object): Add option "thread" parameter. * python/py-inferior.c (new_thread_event_object_type) (new_inferior_event_object_type) (inferior_deleted_event_object_type): Declare. (python_new_inferior, python_inferior_deleted): New functions. (add_thread_object): Emit new_thread event. (gdbpy_initialize_inferior): Attach new functions to corresponding observers. (new_thread, new_inferior, inferior_deleted): Define new event types. * python/py-evts.c (gdbpy_initialize_py_events): Add new registries. * python/py-events.h (events_object) <new_inferior, inferior_deleted, new_thread>: New fields. * python/py-event.h (create_thread_event_breakpoint): Add optional "thread" parameter. doc/ChangeLog 2017-09-11 Tom Tromey <tom@tromey.com> * python.texi (Events In Python): Document new events. testsuite/ChangeLog 2017-09-11 Tom Tromey <tom@tromey.com> * gdb.python/py-infthread.exp: Add tests for new_thread event. * gdb.python/py-inferior.exp: Add tests for new inferior events.
2017-06-13gdb/testsuite: Add "get_endianness" convenience procAndreas Arnez1-9/+3
The test suite contains multiple instances of determining the target's endianness with GDB's "show endian" command. This patch replaces these by an invocation of a new convenience proc 'get_endianness'. gdb/testsuite/ChangeLog: * lib/gdb.exp (get_endianness): New proc. * gdb.arch/aarch64-fp.exp: Use it. * gdb.arch/altivec-regs.exp: Likewise. * gdb.arch/e500-regs.exp: Likewise. * gdb.arch/vsx-regs.exp: Likewise. * gdb.base/dump.exp: Likewise. * gdb.base/funcargs.exp: Likewise. * gdb.base/gnu_vector.exp: Likewise. * gdb.dwarf2/formdata16.exp: Likewise. * gdb.dwarf2/implptrpiece.exp: Likewise. * gdb.dwarf2/nonvar-access.exp: Likewise. * gdb.python/py-inferior.exp: Likewise. * gdb.trace/unavailable-dwarf-piece.exp: Likewise.
2017-01-01update copyright year range in GDB filesJoel Brobecker1-1/+1
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.
2016-12-01Fix test names starting with uppercase output by basic functionsLuis Machado1-1/+1
The following patch is based on the previous patch i sent and handles cases of test names that start with an uppercase letter. Test names should start with lowercase unless it starts with the name of a technology, architecture, ISA etc. This first patch addresses cases of test names output explicitly via xfail, kfail, kpass, fail, pass, unsupported, untested and also names set with the pattern "set test" and "set testname". gdb/testsuite/ChangeLog: 2016-12-01 Luis Machado <lgustavo@codesourcery.com> Fix test names starting with uppercase throughout all the files below. * gdb.ada/array_return.exp * gdb.ada/catch_ex.exp * gdb.ada/info_exc.exp * gdb.ada/mi_catch_ex.exp * gdb.ada/mi_dyn_arr.exp * gdb.ada/mi_ex_cond.exp * gdb.ada/mi_exc_info.exp * gdb.ada/mi_interface.exp * gdb.ada/mi_task_arg.exp * gdb.ada/mi_task_info.exp * gdb.ada/mi_var_array.exp * gdb.arch/alpha-step.exp * gdb.arch/amd64-disp-step.exp * gdb.arch/arm-disp-step.exp * gdb.arch/disp-step-insn-reloc.exp * gdb.arch/e500-prologue.exp * gdb.arch/ftrace-insn-reloc.exp * gdb.arch/gdb1558.exp * gdb.arch/i386-bp_permanent.exp * gdb.arch/i386-disp-step.exp * gdb.arch/i386-float.exp * gdb.arch/i386-gnu-cfi.exp * gdb.arch/ia64-breakpoint-shadow.exp * gdb.arch/mips16-thunks.exp * gdb.arch/pa-nullify.exp * gdb.arch/powerpc-aix-prologue.exp * gdb.arch/powerpc-power.exp * gdb.arch/ppc-dfp.exp * gdb.arch/s390-tdbregs.exp * gdb.arch/spu-info.exp * gdb.arch/spu-ls.exp * gdb.arch/thumb-bx-pc.exp * gdb.base/advance.exp * gdb.base/annota-input-while-running.exp * gdb.base/arrayidx.exp * gdb.base/asmlabel.exp * gdb.base/async.exp * gdb.base/attach-wait-input.exp * gdb.base/auto-connect-native-target.exp * gdb.base/batch-preserve-term-settings.exp * gdb.base/bfp-test.exp * gdb.base/bigcore.exp * gdb.base/bp-permanent.exp * gdb.base/break-always.exp * gdb.base/break-fun-addr.exp * gdb.base/break-idempotent.exp * gdb.base/break-main-file-remove-fail.exp * gdb.base/break-probes.exp * gdb.base/break-unload-file.exp * gdb.base/break.exp * gdb.base/call-ar-st.exp * gdb.base/call-rt-st.exp * gdb.base/call-sc.exp * gdb.base/call-signal-resume.exp * gdb.base/call-strs.exp * gdb.base/callexit.exp * gdb.base/callfuncs.exp * gdb.base/catch-gdb-caused-signals.exp * gdb.base/catch-signal-siginfo-cond.exp * gdb.base/catch-syscall.exp * gdb.base/compare-sections.exp * gdb.base/cond-eval-mode.exp * gdb.base/condbreak-call-false.exp * gdb.base/consecutive-step-over.exp * gdb.base/cursal.exp * gdb.base/disabled-location.exp * gdb.base/disasm-end-cu.exp * gdb.base/display.exp * gdb.base/double-prompt-target-event-error.exp * gdb.base/dprintf-bp-same-addr.exp * gdb.base/dprintf-detach.exp * gdb.base/dprintf-next.exp * gdb.base/dprintf-non-stop.exp * gdb.base/dprintf-pending.exp * gdb.base/dso2dso.exp * gdb.base/ending-run.exp * gdb.base/enum_cond.exp * gdb.base/examine-backward.exp * gdb.base/exe-lock.exp * gdb.base/exec-invalid-sysroot.exp * gdb.base/execl-update-breakpoints.exp * gdb.base/execution-termios.exp * gdb.base/fileio.exp * gdb.base/fixsection.exp * gdb.base/foll-exec-mode.exp * gdb.base/foll-exec.exp * gdb.base/fork-running-state.exp * gdb.base/frame-args.exp * gdb.base/fullpath-expand.exp * gdb.base/func-ptr.exp * gdb.base/gcore-relro-pie.exp * gdb.base/gdb1090.exp * gdb.base/gdb1555.exp * gdb.base/global-var-nested-by-dso.exp * gdb.base/gnu-ifunc.exp * gdb.base/hbreak-in-shr-unsupported.exp * gdb.base/hbreak-unmapped.exp * gdb.base/hook-stop.exp * gdb.base/infcall-input.exp * gdb.base/info-fun.exp * gdb.base/info-shared.exp * gdb.base/interrupt-noterm.exp * gdb.base/jit-so.exp * gdb.base/jit.exp * gdb.base/line-symtabs.exp * gdb.base/list.exp * gdb.base/longjmp.exp * gdb.base/macscp.exp * gdb.base/max-value-size.exp * gdb.base/nodebug.exp * gdb.base/nofield.exp * gdb.base/overlays.exp * gdb.base/paginate-after-ctrl-c-running.exp * gdb.base/paginate-bg-execution.exp * gdb.base/paginate-inferior-exit.exp * gdb.base/pending.exp * gdb.base/pr11022.exp * gdb.base/printcmds.exp * gdb.base/ptr-typedef.exp * gdb.base/ptype.exp * gdb.base/randomize.exp * gdb.base/range-stepping.exp * gdb.base/realname-expand.exp * gdb.base/relativedebug.exp * gdb.base/remote.exp * gdb.base/savedregs.exp * gdb.base/sepdebug.exp * gdb.base/set-noassign.exp * gdb.base/shlib-call.exp * gdb.base/shreloc.exp * gdb.base/sigaltstack.exp * gdb.base/sigbpt.exp * gdb.base/siginfo-addr.exp * gdb.base/siginfo-obj.exp * gdb.base/siginfo-thread.exp * gdb.base/signest.exp * gdb.base/signull.exp * gdb.base/sigrepeat.exp * gdb.base/skip.exp * gdb.base/so-impl-ld.exp * gdb.base/solib-corrupted.exp * gdb.base/solib-disc.exp * gdb.base/solib-display.exp * gdb.base/solib-overlap.exp * gdb.base/solib-search.exp * gdb.base/solib-symbol.exp * gdb.base/source-execution.exp * gdb.base/sss-bp-on-user-bp-2.exp * gdb.base/sss-bp-on-user-bp.exp * gdb.base/stack-checking.exp * gdb.base/stale-infcall.exp * gdb.base/step-break.exp * gdb.base/step-line.exp * gdb.base/step-over-exit.exp * gdb.base/step-test.exp * gdb.base/structs.exp * gdb.base/sym-file.exp * gdb.base/symtab-search-order.exp * gdb.base/term.exp * gdb.base/type-opaque.exp * gdb.base/unload.exp * gdb.base/until-nodebug.exp * gdb.base/until.exp * gdb.base/unwindonsignal.exp * gdb.base/watch-cond.exp * gdb.base/watch-non-mem.exp * gdb.base/watch_thread_num.exp * gdb.base/watchpoint-reuse-slot.exp * gdb.base/watchpoint-solib.exp * gdb.base/watchpoint.exp * gdb.btrace/dlopen.exp * gdb.cell/arch.exp * gdb.cell/break.exp * gdb.cell/bt.exp * gdb.cell/core.exp * gdb.cell/data.exp * gdb.cell/dwarfaddr.exp * gdb.cell/ea-cache.exp * gdb.cell/ea-standalone.exp * gdb.cell/ea-test.exp * gdb.cell/f-regs.exp * gdb.cell/fork.exp * gdb.cell/gcore.exp * gdb.cell/mem-access.exp * gdb.cell/ptype.exp * gdb.cell/registers.exp * gdb.cell/sizeof.exp * gdb.cell/solib-symbol.exp * gdb.cell/solib.exp * gdb.compile/compile-tls.exp * gdb.cp/exception.exp * gdb.cp/gdb2495.exp * gdb.cp/local.exp * gdb.cp/mb-inline.exp * gdb.cp/mb-templates.exp * gdb.cp/pr10687.exp * gdb.cp/pr9167.exp * gdb.cp/scope-err.exp * gdb.cp/templates.exp * gdb.cp/virtfunc.exp * gdb.dwarf2/dw2-dir-file-name.exp * gdb.dwarf2/dw2-single-line-discriminators.exp * gdb.fortran/complex.exp * gdb.fortran/library-module.exp * gdb.guile/guile.exp * gdb.guile/scm-cmd.exp * gdb.guile/scm-frame-inline.exp * gdb.guile/scm-objfile.exp * gdb.guile/scm-pretty-print.exp * gdb.guile/scm-symbol.exp * gdb.guile/scm-type.exp * gdb.guile/scm-value.exp * gdb.linespec/keywords.exp * gdb.linespec/ls-errs.exp * gdb.linespec/macro-relative.exp * gdb.linespec/thread.exp * gdb.mi/mi-breakpoint-changed.exp * gdb.mi/mi-dprintf-pending.exp * gdb.mi/mi-fullname-deleted.exp * gdb.mi/mi-logging.exp * gdb.mi/mi-pending.exp * gdb.mi/mi-solib.exp * gdb.mi/new-ui-mi-sync.exp * gdb.mi/user-selected-context-sync.exp * gdb.multi/dummy-frame-restore.exp * gdb.multi/multi-arch-exec.exp * gdb.multi/remove-inferiors.exp * gdb.multi/watchpoint-multi-exit.exp * gdb.opt/solib-intra-step.exp * gdb.perf/backtrace.exp * gdb.perf/single-step.exp * gdb.perf/skip-command.exp * gdb.perf/skip-prologue.exp * gdb.perf/solib.exp * gdb.python/lib-types.exp * gdb.python/py-as-string.exp * gdb.python/py-bad-printers.exp * gdb.python/py-block.exp * gdb.python/py-breakpoint.exp * gdb.python/py-cmd.exp * gdb.python/py-events.exp * gdb.python/py-evthreads.exp * gdb.python/py-finish-breakpoint.exp * gdb.python/py-finish-breakpoint2.exp * gdb.python/py-frame-inline.exp * gdb.python/py-frame.exp * gdb.python/py-inferior.exp * gdb.python/py-infthread.exp * gdb.python/py-mi.exp * gdb.python/py-objfile.exp * gdb.python/py-pp-maint.exp * gdb.python/py-pp-registration.exp * gdb.python/py-prettyprint.exp * gdb.python/py-recurse-unwind.exp * gdb.python/py-shared.exp * gdb.python/py-symbol.exp * gdb.python/py-symtab.exp * gdb.python/py-template.exp * gdb.python/py-type.exp * gdb.python/py-unwind-maint.exp * gdb.python/py-unwind.exp * gdb.python/py-value.exp * gdb.python/python.exp * gdb.reverse/finish-reverse-bkpt.exp * gdb.reverse/insn-reverse.exp * gdb.reverse/next-reverse-bkpt-over-sr.exp * gdb.reverse/solib-precsave.exp * gdb.reverse/solib-reverse.exp * gdb.stabs/gdb11479.exp * gdb.stabs/weird.exp * gdb.threads/fork-child-threads.exp * gdb.threads/fork-plus-threads.exp * gdb.threads/fork-thread-pending.exp * gdb.threads/forking-threads-plus-breakpoint.exp * gdb.threads/hand-call-in-threads.exp * gdb.threads/interrupted-hand-call.exp * gdb.threads/linux-dp.exp * gdb.threads/local-watch-wrong-thread.exp * gdb.threads/next-while-other-thread-longjmps.exp * gdb.threads/non-ldr-exit.exp * gdb.threads/pending-step.exp * gdb.threads/print-threads.exp * gdb.threads/process-dies-while-detaching.exp * gdb.threads/process-dies-while-handling-bp.exp * gdb.threads/pthreads.exp * gdb.threads/queue-signal.exp * gdb.threads/reconnect-signal.exp * gdb.threads/signal-command-handle-nopass.exp * gdb.threads/signal-command-multiple-signals-pending.exp * gdb.threads/signal-delivered-right-thread.exp * gdb.threads/signal-sigtrap.exp * gdb.threads/sigthread.exp * gdb.threads/staticthreads.exp * gdb.threads/stepi-random-signal.exp * gdb.threads/thread-unwindonsignal.exp * gdb.threads/thread_check.exp * gdb.threads/thread_events.exp * gdb.threads/tid-reuse.exp * gdb.threads/tls-nodebug.exp * gdb.threads/tls-shared.exp * gdb.threads/tls-so_extern.exp * gdb.threads/tls.exp * gdb.threads/wp-replication.exp * gdb.trace/actions-changed.exp * gdb.trace/actions.exp * gdb.trace/backtrace.exp * gdb.trace/change-loc.exp * gdb.trace/collection.exp * gdb.trace/deltrace.exp * gdb.trace/disconnected-tracing.exp * gdb.trace/entry-values.exp * gdb.trace/ftrace-lock.exp * gdb.trace/ftrace.exp * gdb.trace/infotrace.exp * gdb.trace/mi-trace-frame-collected.exp * gdb.trace/mi-trace-unavailable.exp * gdb.trace/mi-traceframe-changed.exp * gdb.trace/mi-tracepoint-changed.exp * gdb.trace/mi-tsv-changed.exp * gdb.trace/no-attach-trace.exp * gdb.trace/packetlen.exp * gdb.trace/passc-dyn.exp * gdb.trace/passcount.exp * gdb.trace/pending.exp * gdb.trace/pr16508.exp * gdb.trace/qtro.exp * gdb.trace/range-stepping.exp * gdb.trace/read-memory.exp * gdb.trace/report.exp * gdb.trace/save-trace.exp * gdb.trace/signal.exp * gdb.trace/stap-trace.exp * gdb.trace/status-stop.exp * gdb.trace/strace.exp * gdb.trace/tfile.exp * gdb.trace/tfind.exp * gdb.trace/trace-break.exp * gdb.trace/trace-condition.exp * gdb.trace/trace-enable-disable.exp * gdb.trace/trace-mt.exp * gdb.trace/tracecmd.exp * gdb.trace/tracefile-pseudo-reg.exp * gdb.trace/tspeed.exp * gdb.trace/tstatus.exp * gdb.trace/tsv.exp * gdb.trace/unavailable.exp * gdb.trace/while-dyn.exp * gdb.trace/while-stepping.exp * lib/gdb-guile.exp * lib/gdb.exp * lib/mi-support.exp * lib/pascal.exp * lib/perftest.exp * lib/prelink-support.exp * lib/selftest-support.exp
2016-01-12Reapply: List inferiors/threads/pspaces in ascending orderPedro Alves1-2/+2
[This reapplies a change that was accidentally reverted with c0ecb95f3d.] Before: (gdb) info threads Id Target Id Frame 3 Thread 0x7ffff77c3700 (LWP 29035) callme () at foo.c:30 2 Thread 0x7ffff7fc4700 (LWP 29034) 0x000000000040087b in child_function_2 (arg=0x0) at foo.c:60 * 1 Thread 0x7ffff7fc5740 (LWP 29030) 0x0000003b37209237 in pthread_join (threadid=140737353893632, thread_return=0x0) at pthread_join.c:92 After: (gdb) info threads Id Target Id Frame * 1 Thread 0x7ffff7fc5740 (LWP 29030) 0x0000003b37209237 in pthread_join (threadid=140737353893632, thread_return=0x0) at pthread_join.c:92 2 Thread 0x7ffff7fc4700 (LWP 29034) 0x000000000040087b in child_function_2 (arg=0x0) at foo.c:60 3 Thread 0x7ffff77c3700 (LWP 29035) callme () at foo.c:30 gdb/doc/ChangeLog: 2015-11-24 Pedro Alves <palves@redhat.com> PR 17539 * gdb.texinfo (Inferiors and Programs): Adjust "maint info program-spaces" example to ascending order listing. (Threads): Adjust "info threads" example to ascending order listing. (Forks): Adjust "info inferiors" example to ascending order listing. gdb/ChangeLog: 2015-11-24 Pedro Alves <palves@redhat.com> PR 17539 * inferior.c (add_inferior_silent): Append the new inferior to the end of the list. * progspace.c (add_program_space): Append the new pspace to the end of the list. * thread.c (new_thread): Append the new thread to the end of the list. gdb/testsuite/ChangeLog: 2015-11-24 Pedro Alves <palves@redhat.com> PR 17539 * gdb.base/foll-exec-mode.exp: Adjust to GDB listing inferiors and threads in ascending order. * gdb.base/foll-fork.exp: Likewise. * gdb.base/foll-vfork.exp: Likewise. * gdb.base/multi-forks.exp: Likewise. * gdb.mi/mi-nonstop.exp: Likewise. * gdb.mi/mi-nsintrall.exp: Likewise. * gdb.multi/base.exp: Likewise. * gdb.multi/multi-arch.exp: Likewise. * gdb.python/py-inferior.exp: Likewise. * gdb.threads/break-while-running.exp: Likewise. * gdb.threads/execl.exp: Likewise. * gdb.threads/gcore-thread.exp: Likewise. * gdb.threads/info-threads-cur-sal.exp: Likewise. * gdb.threads/kill.exp: Likewise. * gdb.threads/linux-dp.exp: Likewise. * gdb.threads/multiple-step-overs.exp: Likewise. * gdb.threads/next-bp-other-thread.exp: Likewise. * gdb.threads/step-bg-decr-pc-switch-thread.exp: Likewise. * gdb.threads/step-over-lands-on-breakpoint.exp: Likewise. * gdb.threads/step-over-trips-on-watchpoint.exp: Likewise. * gdb.threads/thread-find.exp: Likewise. * gdb.threads/tls.exp: Likewise. * lib/mi-support.exp (mi_reverse_list): Delete. (mi_check_thread_states): No longer reverse list.
2016-01-11testsuite: Fix false FAILs on too long base directoryJan Kratochvil1-2/+2
I was getting gu (print arg0)^M = 0x7fffffffdafb "/unsafebuild-x86_64-redhat-linux-gnu/gdb/testsuite.unix.-m64/outputs/gdb.guile/scm-value/scm-"...^M (gdb) FAIL: gdb.guile/scm-value.exp: verify dereferenced value python print (arg0)^M 0x7fffffffdafd "/unsafebuild-x86_64-redhat-linux-gnu/gdb/testsuite.unix.-m64/outputs/gdb.python/py-value/py-v"...^M (gdb) FAIL: gdb.python/py-value.exp: verify dereferenced value and also: (gdb) p argv[0]^M $2 = 0x7fffffffd832 "/home/jkratoch/redhat/gdb-test-", 'x' <repeats 169 times>...^M (gdb) FAIL: gdb.guile/scm-value.exp: argv[0] should be available on this target gdb/testsuite/ChangeLog 2016-01-11 Jan Kratochvil <jan.kratochvil@redhat.com> * gdb.guile/scm-value.exp (test_value_in_inferior): Set print elements and repeats to unlimited. * gdb.python/py-value.exp: Likewise. * lib/gdb.exp (gdb_has_argv0): Save and temporarily set print elements and repeats to unlimited.
2016-01-01GDB copyright headers update after running GDB's copyright.py script.Joel Brobecker1-1/+1
gdb/ChangeLog: Update year range in copyright notice of all files.
2015-11-24List inferiors/threads/pspaces in ascending orderPedro Alves1-2/+2
Before: (gdb) info threads Id Target Id Frame 3 Thread 0x7ffff77c3700 (LWP 29035) callme () at foo.c:30 2 Thread 0x7ffff7fc4700 (LWP 29034) 0x000000000040087b in child_function_2 (arg=0x0) at foo.c:60 * 1 Thread 0x7ffff7fc5740 (LWP 29030) 0x0000003b37209237 in pthread_join (threadid=140737353893632, thread_return=0x0) at pthread_join.c:92 After: (gdb) info threads Id Target Id Frame * 1 Thread 0x7ffff7fc5740 (LWP 29030) 0x0000003b37209237 in pthread_join (threadid=140737353893632, thread_return=0x0) at pthread_join.c:92 2 Thread 0x7ffff7fc4700 (LWP 29034) 0x000000000040087b in child_function_2 (arg=0x0) at foo.c:60 3 Thread 0x7ffff77c3700 (LWP 29035) callme () at foo.c:30 gdb/doc/ChangeLog: 2015-11-24 Pedro Alves <palves@redhat.com> PR 17539 * gdb.texinfo (Inferiors and Programs): Adjust "maint info program-spaces" example to ascending order listing. (Threads): Adjust "info threads" example to ascending order listing. (Forks): Adjust "info inferiors" example to ascending order listing. gdb/ChangeLog: 2015-11-24 Pedro Alves <palves@redhat.com> PR 17539 * inferior.c (add_inferior_silent): Append the new inferior to the end of the list. * progspace.c (add_program_space): Append the new pspace to the end of the list. * thread.c (new_thread): Append the new thread to the end of the list. gdb/testsuite/ChangeLog: 2015-11-24 Pedro Alves <palves@redhat.com> PR 17539 * gdb.base/foll-exec-mode.exp: Adjust to GDB listing inferiors and threads in ascending order. * gdb.base/foll-fork.exp: Likewise. * gdb.base/foll-vfork.exp: Likewise. * gdb.base/multi-forks.exp: Likewise. * gdb.mi/mi-nonstop.exp: Likewise. * gdb.mi/mi-nsintrall.exp: Likewise. * gdb.multi/base.exp: Likewise. * gdb.multi/multi-arch.exp: Likewise. * gdb.python/py-inferior.exp: Likewise. * gdb.threads/break-while-running.exp: Likewise. * gdb.threads/execl.exp: Likewise. * gdb.threads/gcore-thread.exp: Likewise. * gdb.threads/info-threads-cur-sal.exp: Likewise. * gdb.threads/kill.exp: Likewise. * gdb.threads/linux-dp.exp: Likewise. * gdb.threads/multiple-step-overs.exp: Likewise. * gdb.threads/next-bp-other-thread.exp: Likewise. * gdb.threads/step-bg-decr-pc-switch-thread.exp: Likewise. * gdb.threads/step-over-lands-on-breakpoint.exp: Likewise. * gdb.threads/step-over-trips-on-watchpoint.exp: Likewise. * gdb.threads/thread-find.exp: Likewise. * gdb.threads/tls.exp: Likewise. * lib/mi-support.exp (mi_reverse_list): Delete. (mi_check_thread_states): No longer reverse list.
2015-11-24Make gdb.python/py-inferior.exp test names uniquePedro Alves1-100/+117
Before we had: $ cat testsuite/gdb.sum | grep "PASS" | sort | uniq -c | sort -n ... 1 PASS: gdb.python/py-inferior.exp: write str 2 PASS: gdb.python/py-inferior.exp: Get inferior list length 2 PASS: gdb.python/py-inferior.exp: py start_addr = gdb.selected_frame ().read_var ('search_buf') 2 PASS: gdb.python/py-inferior.exp: Switch to first inferior 3 PASS: gdb.python/py-inferior.exp: find mixed-sized pattern 4 PASS: gdb.python/py-inferior.exp: py length = search_buf.type.sizeof 4 PASS: gdb.python/py-inferior.exp: py start_addr = search_buf.address 5 PASS: gdb.python/py-inferior.exp: Check inferior validity $ gdb/testsuite/ChangeLog: 2015-11-24 Pedro Alves <palves@redhat.com> * gdb.python/py-inferior.exp: Use with_test_prefix. Consistently use lowercase.
2015-01-01Update year range in copyright notice of all files owned by the GDB project.Joel Brobecker1-1/+1
gdb/ChangeLog: Update year range in copyright notice of all files.
2014-01-01Update Copyright year range in all files maintained by GDB.Joel Brobecker1-1/+1
2013-06-07Remove superfluous semicolons from testsuite throughout.Pedro Alves1-1/+1
A few months ago semicolons after "return" were removed throughout the testsuite. However, as I pointed out in review, they're unnecessary not just after "return", but pretty much after any tcl command. ';' is the command separator, and you only need it if there's another command on the same line afterwards. This patch was written by running: $ find . -name "*.exp" | xargs grep -l ";\s*$" | xargs sed -i 's/\([^#][^\s*;]*\)\s*;\s*$/\1/' and then undoing changes to comments, and lib/future.exp. Tested on x86_64 Fedora 17. gdb/testsuite/ 2013-06-07 Pedro Alves <palves@redhat.com> * boards/native-extended-gdbserver.exp: Remove semicolon. * config/arm-ice.exp: Likewise. * config/bfin.exp: Likewise. * config/cygmon.exp: Likewise. * config/h8300.exp: Likewise. * config/monitor.exp: Likewise. * config/sid.exp: Likewise. * config/sim.exp: Likewise. * config/slite.exp: Likewise. * config/vx.exp: Likewise. * gdb.arch/i386-bp_permanent.exp: Likewise. * gdb.asm/asm-source.exp: Likewise. * gdb.base/args.exp: Likewise. * gdb.base/attach-pie-misread.exp: Likewise. * gdb.base/auxv.exp: Likewise. * gdb.base/bigcore.exp: Likewise. * gdb.base/bitfields2.exp: Likewise. * gdb.base/bitfields.exp: Likewise. * gdb.base/break.exp: Likewise. * gdb.base/break-interp.exp: Likewise. * gdb.base/callfuncs.exp: Likewise. * gdb.base/call-sc.exp: Likewise. * gdb.base/commands.exp: Likewise. * gdb.base/corefile.exp: Likewise. * gdb.base/dbx.exp: Likewise. * gdb.base/ending-run.exp: Likewise. * gdb.base/exprs.exp: Likewise. * gdb.base/funcargs.exp: Likewise. * gdb.base/hbreak2.exp: Likewise. * gdb.base/huge.exp: Likewise. * gdb.base/list.exp: Likewise. * gdb.base/memattr.exp: Likewise. * gdb.base/overlays.exp: Likewise. * gdb.base/printcmds.exp: Likewise. * gdb.base/recurse.exp: Likewise. * gdb.base/remotetimeout.exp: Likewise. * gdb.base/reread.exp: Likewise. * gdb.base/savedregs.exp: Likewise. * gdb.base/scope.exp: Likewise. * gdb.base/sepdebug.exp: Likewise. * gdb.base/setshow.exp: Likewise. * gdb.base/setvar.exp: Likewise. * gdb.base/sigaltstack.exp: Likewise. * gdb.base/siginfo-addr.exp: Likewise. * gdb.base/siginfo.exp: Likewise. * gdb.base/siginfo-obj.exp: Likewise. * gdb.base/sigrepeat.exp: Likewise. * gdb.base/sigstep.exp: Likewise. * gdb.base/structs.exp: Likewise. * gdb.base/testenv.exp: Likewise. * gdb.base/twice.exp: Likewise. * gdb.base/valgrind-db-attach.exp: Likewise. * gdb.base/valgrind-infcall.exp: Likewise. * gdb.base/varargs.exp: Likewise. * gdb.base/watchpoint.exp: Likewise. * gdb.cp/gdb1355.exp: Likewise. * gdb.cp/misc.exp: Likewise. * gdb.disasm/hppa.exp: Likewise. * gdb.disasm/t01_mov.exp: Likewise. * gdb.disasm/t02_mova.exp: Likewise. * gdb.disasm/t03_add.exp: Likewise. * gdb.disasm/t04_sub.exp: Likewise. * gdb.disasm/t05_cmp.exp: Likewise. * gdb.disasm/t06_ari2.exp: Likewise. * gdb.disasm/t07_ari3.exp: Likewise. * gdb.disasm/t08_or.exp: Likewise. * gdb.disasm/t09_xor.exp: Likewise. * gdb.disasm/t10_and.exp: Likewise. * gdb.disasm/t11_logs.exp: Likewise. * gdb.disasm/t12_bit.exp: Likewise. * gdb.disasm/t13_otr.exp: Likewise. * gdb.gdb/selftest.exp: Likewise. * gdb.hp/gdb.base-hp/callfwmall.exp: Likewise. * gdb.mi/mi-reverse.exp: Likewise. * gdb.pascal/floats.exp: Likewise. * gdb.python/py-inferior.exp: Likewise. * gdb.threads/attach-into-signal.exp: Likewise. * gdb.threads/pthreads.exp: Likewise. * gdb.threads/thread_events.exp: Likewise. * gdb.threads/watchthreads.exp: Likewise. * gdb.trace/actions-changed.exp: Likewise. * gdb.trace/actions.exp: Likewise. * gdb.trace/ax.exp: Likewise. * gdb.trace/backtrace.exp: Likewise. * gdb.trace/change-loc.exp: Likewise. * gdb.trace/deltrace.exp: Likewise. * gdb.trace/disconnected-tracing.exp: Likewise. * gdb.trace/ftrace.exp: Likewise. * gdb.trace/infotrace.exp: Likewise. * gdb.trace/passc-dyn.exp: Likewise. * gdb.trace/passcount.exp: Likewise. * gdb.trace/pending.exp: Likewise. * gdb.trace/qtro.exp: Likewise. * gdb.trace/range-stepping.exp: Likewise. * gdb.trace/report.exp: Likewise. * gdb.trace/save-trace.exp: Likewise. * gdb.trace/status-stop.exp: Likewise. * gdb.trace/strace.exp: Likewise. * gdb.trace/tfile.exp: Likewise. * gdb.trace/tfind.exp: Likewise. * gdb.trace/trace-break.exp: Likewise. * gdb.trace/tracecmd.exp: Likewise. * gdb.trace/trace-mt.exp: Likewise. * gdb.trace/tspeed.exp: Likewise. * gdb.trace/tsv.exp: Likewise. * gdb.trace/while-stepping.exp: Likewise. * lib/gdb.exp: Likewise. * lib/gdbserver-support.exp: Likewise. * lib/java.exp: Likewise. * lib/mi-support.exp: Likewise. * lib/pascal.exp: Likewise. * lib/prompt.exp: Likewise. * lib/trace-support.exp: Likewise.
2013-01-01Update years in copyright notice for the GDB files.Joel Brobecker1-1/+1
Two modifications: 1. The addition of 2013 to the copyright year range for every file; 2. The use of a single year range, instead of potentially multiple year ranges, as approved by the FSF.
2012-12-102012-12-10 Paul Koning <paul_koning@dell.com>Paul Koning1-32/+37
* gdb.base/charset.exp: Change print syntax for Python 3 compatibility. * gdb.python/py-block.exp: Ditto. * gdb.python/py-breakpoint.exp: Ditto. * gdb.python/py-cmd.exp: Ditto. * gdb.python/py-events.py: Ditto. * gdb.python/py-finish-breakpoint.py: Ditto. * gdb.python/py-finish-breakpoint2.exp: Ditto. * gdb.python/py-finish-breakpoint2.py: Ditto. * gdb.python/py-frame-inline.exp: Ditto. * gdb.python/py-frame.exp: Ditto. * gdb.python/py-infthread.exp: Ditto. * gdb.python/py-objfile.exp: Ditto. * gdb.python/py-parameter.exp: Ditto. * gdb.python/py-progspace.exp: Ditto. * gdb.python/py-prompt.exp: Ditto. * gdb.python/py-symbol.exp: Ditto. * gdb.python/py-symtab.exp: Ditto. * gdb.python/py-template.exp: Ditto. * gdb.python/py-value-cc.exp: Ditto. * gdb.python/python.exp: Ditto. * gdb.python/source2.py: Ditto. * gdb.python/lib-types.exp: Change print syntax for Python 3 compatibility. Use sorted() function rather than sort() method. Accept either int or long values for enum values. * gdb.python/py-events.exp: Use exec(open(...).read()) instead of execfile for Python 3 compatibility. * gdb.python/py-evsignal.exp: Ditto. * gdb.python/py-evthreads.exp: Ditto. * gdb.python/py-mi.exp: Ditto. * gdb.python/py-pp-maint.exp: Ditto. * gdb.python/py-prettyprint.exp: Ditto. * gdb.python/py-finish-breakpoint.exp: Change print syntax for Python 3 compatibility. Skip tests for Python 2.4. * gdb.python/py-inferior.exp: Change print syntax for Python 3 compatibility. Use byte string rather than character string in memory write test if Python 3. * gdb.python/py-pp-maint.py: Change class declarations to "new class" syntax. * gdb.python/py-prettyprint.py: Change iterator class to generator function for Python 3 compatibility. Make all classes "new style". Fix indentation issue and stray semicolon. * gdb.python/py-shared.expChange print syntax for Python 3 compatibility. Define "long" if Python 3. * gdb.python/py-type.exp: Change print syntax for Python 3 compatibility. Accept either int or long values for enum values. * gdb.python/py-value.exp: Change print syntax for Python 3 compatibility. Skip "long" and "unicode" tests if Python 3. Accept either "type" or "class" in type checks. * lib/gdb.exp (gdb_py_is_py3k): New flag set if Python 3. (gdb_py_is_py24): New flag set if Python 2.4 or 2.5.
2012-07-26gdb/Jan Kratochvil1-3/+12
* python/py-inferior.c (infpy_threads): Call update_thread_list (). gdb/testsuite/ * gdb.python/py-inferior.c (thread): New function. (check_threads): New function. (test_threads): New function. * gdb.python/py-inferior.exp: Added test. Replaced runto with continue to breakpoint.
2012-06-22 * gdb.python/lib-types.exp: Use standard_testfile,Tom Tromey1-3/+3
prepare_for_testing. * gdb.python/py-block.exp: Use standard_testfile. * gdb.python/py-breakpoint.exp: Use standard_testfile. * gdb.python/py-events.exp: Use standard_testfile, standard_output_file. * gdb.python/py-evsignal.exp: Use standard_testfile. * gdb.python/py-evethreads.exp: Use standard_testfile. * gdb.python/py-explore-cc.exp: Use standard_testfile. * gdb.python/py-explore.exp: Use standard_testfile. * gdb.python/py-finish-breakpoint.exp: Use standard_testfile, standard_output_file. * gdb.python/py-finish-breakpoint2.exp: Use standard_testfile, prepare_for_testing. * gdb.python/py-frame-inline.exp: Use standard_testfile. * gdb.python/py-frame.exp: Use standard_testfile. * gdb.python/py-inferior.exp: Use standard_testfile. * gdb.python/py-infthread.exp: Use standard_testfile. * gdb.python/py-mi.exp: Use standard_testfile. * gdb.python/py-objfile-script.exp: Use standard_testfile, build_executable. * gdb.python/py-objfile.exp: Use standard_testfile. * gdb.python/py-pp-maint.exp: Use standard_testfile, prepare_for_testing. * gdb.python/py-prettyprint.exp: Use standard_testfile. * gdb.python/py-progspace.exp: Use standard_testfile, build_executable. * gdb.python/py-prompt.exp: Use standard_testfile, build_executable. * gdb.python/py-section-script.exp: Use standard_testfile, build_executable. * gdb.python/py-shared.exp: Use standard_testfile, standard_output_file, clean_restart. * gdb.python/py-symbol.exp: Use standard_output_file, prepare_for_testing. * gdb.python/py-symtab.exp: Use standard_output_file, prepare_for_testing * gdb.python/py-template.exp: Use standard_testfile. * gdb.python/py-type.exp: Use standard_testfile. * gdb.python/py-value-cc.exp: Use standard_testfile. * gdb.python/py-value.exp: Use standard_testfile. * gdb.python/python.exp: Use standard_testfile, build_executable.
2012-01-162012-01-16 Pedro Alves <palves@redhat.com>Pedro Alves1-4/+0
Remove all calls to strace.
2012-01-04Copyright year update in most files of the GDB Project.Joel Brobecker1-1/+1
gdb/ChangeLog: Copyright year update in most files of the GDB Project.
2011-09-152011-09-15 Kevin Pouget <kevin.pouget@st.com>Kevin Pouget1-1/+11
PR Python/12692 Add gdb.selected_inferior() to Python interface. * python/py-inferior.c (GdbMethods): New Python method definition. doc: PR Python/12692 Add gdb.selected_inferior() to Python interface. * gdb.texinfo (Inferiors In Python): Describe new gdb.selected_inferior() function. testsuite: PR Python/12692 Add gdb.selected_inferior() to Python interface. * gdb.python/py-inferior.exp: Add testcase for gdb.selected_inferior().
2011-06-08py-inferior.exp: Make sure local var is allocated on the stack.Joel Brobecker1-1/+1
The testcase, at some point, is trying to change the contents of a string that was defined as follow: char *str = "hello, testsuite"; The problem is that the string is constant, and str is never used to change the contents of the string in the program, so the compiler is free to allocate it in a read-only section. This is what happens on x86-windows, for instance. As a result, trying to change the contents of the string during the `python gdb.inferiors()[0].write_memory (addr, str)' results in the following error: (gdb) python gdb.inferiors()[0].write_memory (addr, str) gdb: write target memory, 5 bytes at 0x00403064 Traceback (most recent call last): File "<string>", line 1, in <module> gdb.MemoryError: Cannot access memory at address 0x403064 Error while executing Python code. This patch prevents this from happening by declaring str as an array rather than a pointer. gdb/testsuite/ChangeLog: * gdb.python/py-inferior.c (f2): Make str an array rather than a pointer. * gdb.python/py-inferior.exp: Adjust testcase accordingly.
2011-03-172011-03-17 Phil Muldoon <pmuldoon@redhat.com>Phil Muldoon1-0/+20
* python/py-symtab.c: Populate symtab_object_methods, sal_object_methods. (stpy_is_valid): New function. (salpy_is_valid): Ditto. * python/py-symbol.c: Declare symbol_object_methods. Populate. (sympy_is_valid): New function. * python/py-objfile.c: Declare objfile_object_methods. Populate. (objfpy_is_valid): New function. * python/py-inferior.c: Populate inferior_object_methods. (infpy_is_valid): New function. * python/py-infthread.c: Populate thread_object_methods. (thpy_is_valid): New function. * python/py-block.c: Declare block_object_methods. Populate. Declare block_iterator_object_methods. Populate. (blpy_is_valid): New function. (blpy_iter_is_valid): Ditto. 2010-03-17 Phil Muldoon <pmuldoon@redhat.com> * gdb.python/Makefile.in: Add py-objfile. * gdb.python/py-objfile.exp: New file. * gdb.python/py-objfile.c: New file. * gdb.python/py-block.exp: Add is_valid tests. * gdb.python/py-inferior.exp: Ditto. * gdb.python/py-infthread.exp: Ditto. * gdb.python/py-symbol.exp: Ditto. * gdb.python/py-symtab.exp: Ditto. 2011-03-17 Phil Muldoon <pmuldoon@redhat.com> * gdb.texinfo (Blocks In Python): Add is_valid method description. (Inferiors In Python): Likewise. (Threads In Python): Likewise. (Symbols In Python): Likewise. (Objfiles In Python): Likewise. (Symbol Tables In Python): Likewise.
2011-03-03py-inferior.exp: Avoid searching pattern beyond bufferJoel Brobecker1-5/+5
gdb/testsuite/ChangeLog: * gdb.python/py-inferior.exp: Avoid searching pattern beyond end of buffer.
2011-03-02use gdb_test_no_output in gdb.python/py-inferior.expJoel Brobecker1-39/+39
gdb/testsuite/ChangeLog: * gdb.python/py-inferior.exp: Use gdb_test_no_output instead of gdb_test when running a test where we expected no output back.
2011-01-01run copyright.sh for 2011.Joel Brobecker1-1/+1
2010-11-12gdb/testsuite/Nathan Froyd1-7/+18
* gdb.python/py-inferior.exp: Pack values in target endianness.
2010-10-01 * lib/gdb-python.exp: New file.Doug Evans1-10/+1
* gdb.python/py-block.exp: Use it. * gdb.python/py-breakpoint.exp: Ditto. * gdb.python/py-frame.exp: Ditto. * gdb.python/py-inferior.exp: Ditto. * gdb.python/py-param.exp: Ditto. * gdb.python/py-prettyprint.exp: Ditto. * gdb.python/py-shared.exp: Ditto. * gdb.python/py-symbol.exp: Ditto. * gdb.python/py-symtab.exp: Ditto. * gdb.python/py-type.exp: Ditto. * gdb.python/py-value.exp: Ditto. * gdb.python/python.exp: Ditto.
2010-06-282010-06-28 Phil Muldoon <pmuldoon@redhat.com>Phil Muldoon1-0/+191
Tom Tromey <tromey@redhat.com> Thiago Jung Bauermann <bauerman@br.ibm.com> * value.c (pack_unsigned_long): New function. (value_from_ulongest): New function. * value.h (value_from_ulongest): Declare. * python/python.c (_initialize_python): Call gdbpy_initialize_thread and gdbpy_initialize_inferior. * python/python-internal.h: Define thread_object. (gdbpy_inferiors, gdbpy_selected_thread) (frame_info_to_frame_object, create_thread_object) (find_thread_object, find_inferior_object) (gdbpy_initialize_thread, gdbpy_initialize_inferiors) (gdbpy_is_value_object, get_addr_from_python): Declare. * python/py-value.c (builtin_type_upylong): Define. (convert_value_from_python): Add logic for ulongest. (gdbpy_is_value_object): New function. * python/py-utils.c (get_addr_from_python): New function. * python/py-frame.c (frame_info_to_frame_object): Return a PyObject. (gdbpy_selected_frame): Use PyObject over frame_info. * Makefile.in (SUBDIR_PYTHON_OBS): Add py-inferior and py-infthread. (SUBDIR_PYTHON_SRCS): Likewise. (py-inferior.o): New Rule. (py-infthread.o): New Rule. * python/py-inferior.c: New File. * python/py-infthread.c: New File. 2010-06-28 Phil Muldoon <pmuldoon@redhat.com> Tom Tromey <tromey@redhat.com> Thiago Jung Bauermann <bauerman@br.ibm.com> * gdb.texinfo (Inferiors In Python): New node. * gdb.texinfo (Threads In Python): New node. 2010-06-28 Phil Muldoon <pmuldoon@redhat.com> Tom Tromey <tromey@redhat.com> Thiago Jung Bauermann <bauerman@br.ibm.com> * gdb.python/py-inferior.c: New File. * gdb.python/py-infthread.c: New File. * gdb.python/py-inferior.exp: New File. * gdb.python/py-infthread.exp: New File.