aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.python/python.exp
AgeCommit message (Collapse)AuthorFilesLines
2014-10-15Clean up gdb.python/ testsYao Qi1-3/+3
This patch is to clean up various gdb.python/*.exp tests, such as removing trailing ".*" from the pattern and fix one typo I find during reading the code. gdb/testsuite: 2014-10-15 Yao Qi <yao@codesourcery.com> * gdb.python/python.exp: Remove trailing ".*". Fix typo locationn. * gdb.python/py-symbol.exp: Remove trailing ".*" in the pattern. * gdb.python/py-symtab.exp: Likewise.
2014-08-22Copy .py files to remote hostYao Qi1-2/+5
Some gdb.python/*.exp tests fail because the .py files aren't copied to the (remote) host. This patch is to copy needed .py files to host. Most of gdb.python/*.exp tests do this. As it is still controversial to delete *.py files on host, we don't do that in this patch. gdb/testsuite: 2014-08-22 Yao Qi <yao@codesourcery.com> * gdb.python/py-finish-breakpoint.exp: Copy .py file to host. * gdb.python/py-finish-breakpoint2.exp: Likewise. * gdb.python/python.exp: Likewise. Use .py file on the host instead of the build.
2014-05-21PR gdb/13860: make -interpreter-exec console "list" behave more like "list".Pedro Alves1-2/+3
I noticed that "list" behaves differently in CLI vs MI. Particularly: $ ./gdb -nx -q ./testsuite/gdb.mi/mi-cli Reading symbols from /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.mi/mi-cli...done. (gdb) start Temporary breakpoint 1 at 0x40054d: file ../../../src/gdb/testsuite/gdb.mi/basics.c, line 62. Starting program: /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.mi/mi-cli Temporary breakpoint 1, main () at ../../../src/gdb/testsuite/gdb.mi/basics.c:62 62 callee1 (2, "A string argument.", 3.5); (gdb) list 57 { 58 } 59 60 main () 61 { 62 callee1 (2, "A string argument.", 3.5); 63 callee1 (2, "A string argument.", 3.5); 64 65 do_nothing (); /* Hello, World! */ 66 (gdb) Note the list started at line 57. IOW, the program stopped at line 62, and GDB centered the list on that. compare with: $ ./gdb -nx -q ./testsuite/gdb.mi/mi-cli -i=mi =thread-group-added,id="i1" ~"Reading symbols from /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.mi/mi-cli..." ~"done.\n" (gdb) start &"start\n" ... ~"\nTemporary breakpoint " ~"1, main () at ../../../src/gdb/testsuite/gdb.mi/basics.c:62\n" ~"62\t callee1 (2, \"A string argument.\", 3.5);\n" *stopped,reason="breakpoint-hit",disp="del",bkptno="1",frame={addr="0x000000000040054d",func="main",args=[],file="../../../src/gdb/testsuite/gdb.mi/basics.c",fullname="/home/pedro/gdb/mygit/src/gdb/testsuite/gdb.mi/basics.c",line="62"},thread-id="1",stopped-threads="all",core="0" =breakpoint-deleted,id="1" (gdb) -interpreter-exec console list ~"62\t callee1 (2, \"A string argument.\", 3.5);\n" ~"63\t callee1 (2, \"A string argument.\", 3.5);\n" ~"64\t\n" ~"65\t do_nothing (); /* Hello, World! */\n" ~"66\t\n" ~"67\t callme (1);\n" ~"68\t callme (2);\n" ~"69\t\n" ~"70\t return 0;\n" ~"71\t}\n" ^done (gdb) Here the list starts at line 62, where the program was stopped. This happens because print_stack_frame, called from both normal_stop and mi_on_normal_stop, is the function responsible for setting the current sal from the selected frame, overrides the PRINT_WHAT argument, and only after that does it decide whether to center the current sal line or not, based on the overridden value, and it will always decide false. (The print_stack_frame call in mi_on_normal_stop is a little different from the call in normal_stop, in that it is an unconditional SRC_AND_LOC call. A future patch will make those uniform.) A previous version of this patch made MI uniform with CLI here, by making print_stack_frame also center when MI is active. That changed the output of a "list" command in mi-cli.exp, to expect line 57 instead of 62, as per the example above. However, looking deeper, that list in question is the first "list" after the program stops, and right after the stop, before the "list", the test did "set listsize 1". Let's try the same thing with the CLI: (gdb) start 62 callee1 (2, "A string argument.", 3.5); (gdb) set listsize 1 (gdb) list 57 { Huh, that's unexpected. Why the 57? It's because print_stack_frame, called in reaction to the breakpoint stop, expecting the next "list" to show 10 lines (the listsize at the time) around line 62, sets the lines listed range to 57-67 (62 +/- 5). If the user changes the listsize before "list", why would we still show that range? Looks bogus to me. So the fix for this whole issue should be delay trying to center the listing to until actually listing, so that the correct listsize can be taken into account. This makes MI and CLI uniform too, as it deletes the center code from print_stack_frame. A series of tests are added to list.exp to cover this. mi-cli.exp was after all correct all along, but it now gains an additional test that lists lines with listsize 10, to ensure the centering is consistent with CLI's. One related Python test changed related output -- it's a test that prints the line number after stopping for a breakpoint, similar to the new list.exp tests. Previously we'd print the stop line minus 5 (due to the premature centering), now we print the stop line. I think that's a good change. Tested on x86_64 Fedora 20. gdb/ 2014-05-21 Pedro Alves <palves@redhat.com> * cli/cli-cmds.c (list_command): Handle the first "list" after the current source line having changed. * frame.h (set_current_sal_from_frame): Remove 'center' parameter. * infrun.c (normal_stop): Adjust call to set_current_sal_from_frame. * source.c (clear_lines_listed_range): New function. (set_current_source_symtab_and_line, identify_source_line): Clear the lines listed range. (line_info): Handle the first "info line" after the current source line having changed. * stack.c (print_stack_frame): Remove center handling. (set_current_sal_from_frame): Remove 'center' parameter. Don't center sal.line. gdb/testsuite/ 2014-05-21 Pedro Alves <palves@redhat.com> * gdb.base/list.exp (build_pattern, test_list): New procedures. Use them to test variations of "list" after reaching a breakpoint. * gdb.mi/mi-cli.exp (line_main_callme_2): New global. Test "list" with listsize 10 after reaching a breakpoint. * gdb.python/python.exp (decode_line current location line number): Adjust expected line number.
2014-03-22 * extension.c (eval_ext_lang_from_control_command): Avoid dereferencingDoug Evans1-0/+7
NULL pointer. testsuite/ * gdb.python/python.exp (python not supported): Verify multi-line python command issues an error.
2014-01-01Update Copyright year range in all files maintained by GDB.Joel Brobecker1-1/+1
2013-11-23 * gdb.python/python.exp: Don't call skip_python_tests, we still wantDoug Evans1-3/+2
to test some things in the case where python is not configured in.
2013-10-01 * gdb.python/python.exp: Remove redundant print-stack tests.Doug Evans1-15/+9
Make all print-stack test names unique. Fix spelling of print-stack.
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-11 * gdb.python/py-prettyprint.py (_iterator): Remove exception_flagPaul Koning1-1/+1
exception. (_iterator_except): New function. (ArrayPrinter): Use _iterator function instead of local _iterator class for Python 3 compatibility. (NoStringContainerPrinter): Use _iterator_except instead of _iterator. * gdb.python/py-typeprint.exp: Use exec(open(...).read()) instead of execfile for Python 3 compatibility. * gdb.python/python.exp: Handle Python 2.4 exception traceback format in error_prompt test.
2012-12-102012-12-10 Paul Koning <paul_koning@dell.com>Paul Koning1-36/+36
* 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-09-20 * NEWS: Update.Tom Tromey1-0/+18
* python/python.c (finalize_python): New function. (_initialize_python): Make a final cleanup. testsuite * gdb.python/python.exp: Test atexit.register.
2012-09-13Refactor Python "gdb" module into a proper Python package, by introducingYit Phang Khoo1-2/+2
a new "_gdb" module for code implemented in C, and using reload/__import__ instead of exec. gdb/ * python/lib/gdb/__init__.py: Import * from _gdb. (GdbOutputFile, sys.stdout, GdbOutputErrorFile, sys.stderr, prompt_hook, sys.argv): Moved from finish_python_initialization. (pretty_printers, PYTHONDIR): Moved from _initialize_python. (packages, auto_load_packages): New list and function replacing module_dict and auto-loading code, using __file__ instead of gdb.PYTHONDIR and reload/__import__ instead of exec. (GdbSetPythonDirectory): Replacing function of the same name from finish_python_initialization, using reload/__import__ instead of exec, as well as call auto_load_packages. * python/py-prettyprint.c (find_pretty_printer_from_gdb): Check gdb_python_module and not gdb_module. * python/python-internal.h (gdb_python_module): Declare. * python/python.c (gdb_python_module): New global. (before_prompt_hook): Check gdb_python_module and not gdb_module. (_initialize_python): Rename gdb module to _gdb. Move gdb.PYTHONDIR and gdb.pretty_printer to lib/gdb/__init__.py. (finish_python_initialization): Move Python code to lib/gdb/__init__.py; instead, set up sys.path and import gdb into __main__. gdb/testsuite/ * gdb.python/python.exp (Test stderr location): Update module location of GDB-specific sys.stderr. (Test stdout location): Ditto for sys.stdout.
2012-06-27 * gdb.python/python.exp: Fix regexps in pagination tests.Tom Tromey1-2/+2
2012-06-22 * gdb.python/lib-types.exp: Use standard_testfile,Tom Tromey1-8/+4
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-05-132012-05-13 Siva Chandra Reddy <sivachandra@google.com>Siva Chandra Reddy1-0/+20
Add a new function gdb.find_pc_line to the Python API. * NEWS (Python Scripting): Add entry about the new function. * python/python.c (gdbpy_find_pc_line): New function which implements gdb.find_pc_line. (GdbMethods): Add entry for the new function. doc/ * gdb.texinfo (Basic Python): Add description about the function gdb.find_pc_line testsuite/ * gdb.python/python.c: Add a new breakpoint comment. * gdb.python/python.exp: Add tests to test gdb.find_pc_line.
2012-03-30 * gdb.python: Add test for linespecs with commas.Keith Seitz1-0/+3
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-12-162011-12-16 Phil Muldoon <pmuldoon@redhat.com>Phil Muldoon1-12/+63
* testsuite/gdb.python/py-function.exp: Change "on" to "full" for python print-stack. Add set/show python print-stack off|full|message tests. 2011-12-16 Phil Muldoon <pmuldoon@redhat.com> * python/python.c: Define python_excp_enums. (eval_python_from_control_command): Do not call gdbpy_print_stack. (python_command): Ditto. (gdbpy_print_stack): Rewrite to use new enum constants. (maint_set_python): Remove function. (maint_show_python): Ditto. (_initialize_python): Do not add "maint" commands. Add "set/show python print-stack commands". * NEWS: Update to reflect removal for "maint set/show print-stack" 2011-12-16 Phil Muldoon <pmuldoon@redhat.com> * doc/gdb.texinfo (Python Commands): Remove "maint set/show print stack". Add documentation for "set/show python print-stack".
2011-10-27 * cli/cli-cmds.c (source_script_with_search): Pass full path toDoug Evans1-0/+2
source_script_from_stream if it may have been found on the search path. * python/py-auto-load.c (source_section_scripts): Pass full path to source_python_script_for_objfile. * python/python.c (source_python_script): Delete stream parameter. All callers updated. (source_python_script_for_objfile): Ditto. * python/python-internal.h (source_python_script_for_objfile): Update. * python/python.h (source_python_script): Update. testsuite/ * gdb.python/python.exp: Test source -s.
2011-10-18 * gdb.base/source.exp: Don't include full file name in test name.Tom Tromey1-2/+4
* gdb.python/python.exp: Don't include full file name in test name.
2011-09-30gdb.python/python.exp: fix up raceMarek Polacek1-2/+14
2011-08-172011-08-17 Phil Muldoon <pmuldoon@redhat.com>Phil Muldoon1-0/+26
Tom Tromey <tromey@redhat.com> Matt Rice <ratmice@gmail.com> * python/lib/gdb/prompt.py: New file. * python/lib/gdb/command/prompt.py: New file. * NEWS: Document set extended-prompt and gdb.prompt library 2011-08-17 Phil Muldoon <pmuldoon@redhat.com> * gdb.texinfo (Prompt): Add set/show extended-prompt documentation (Basic Python): Add prompt_hook anchor. (Python modules): Reword module text to reflect multiple modules. (gdb.prompt): Document gdb.prompt module. 2011-08-17 Phil Muldoon <pmuldoon@redhat.com> * gdb.python/python.exp: Add extended-prompt tests.
2011-07-212011-07-21 Phil Muldoon <pmuldoon@redhat.com>Phil Muldoon1-0/+82
Tom Tromey <tromey@redhat.com> * top.c (set_prompt): Rewrite to free previous prompt, free asynch_new_prompt and set both on new prompts. * event-top.c (display_gdb_prompt): Add prompt substitution logic. * python/python.c (before_prompt_hook): New function. 2011-07-21 Phil Muldoon <pmuldoon@redhat.com> * gdb.python/python.exp: Add prompt substitution tests. 2011-07-21 Phil Muldoon <pmuldoon@redhat.com> * observer.texi (GDB Observers): Add before_prompt observer. * gdb.texinfo (Basic Python): Add documentation for prompt substitution.
2011-07-112011-07-11 Phil Muldoon <pmuldoon@redhat.com>Phil Muldoon1-0/+15
PR python/12438 * python/python.c: Set gdbpy_should_print_stack default to off. (set_python): Deprecate maint set python print-stack to class_deprecate. (_initialize_python): Deprecate maint set/show python print-stack. Add new prefix command, python. Add new setting, print-backtrace. * NEWS: Document set python print-stack. Document default change. 2011-07-11 Phil Muldoon <pmuldoon@redhat.com> PR python/12438 * gdb.texinfo (Python Commands): Add deprecate note to maint set/show python print-stack. Document set/show python print-backtrace. 2011-07-11 Phil Muldoon <pmuldoon@redhat.com> PR python/12438 * gdb.python/python.exp: Add maint set/show python print-stack deprecated tests. Add set/show python print-backtrace tests.
2011-07-06gdb.python/python.exp: Update filename paths.matt rice1-3/+3
gdb.python/py-symtab.exp: Ditto.
2011-03-182011-03-18 Phil Muldoon <pmuldoon@redhat.com>Phil Muldoon1-0/+8
PR python/12149 * python/python.c (gdbpy_write): Accept a stream argument and operate to the appropriate stream. (gdbpy_flush): Likewise. (_initialize_python): Add stream constants. (finish_python_initialization): Add GdbOutputErrorFile class. 2011-03-18 Phil Muldoon <pmuldoon@redhat.com> PR python/12149 * gdb.texinfo (Basic Python): Update gdb.write and flush text. 2011-03-18 Phil Muldoon <pmuldoon@redhat.com> PR python/12149 * gdb.python/python.exp: Add gdb.write tests.
2011-01-102011-01-10 Phil Muldoon <pmuldoon@redhat.com>Phil Muldoon1-18/+0
* gdb.python/py-cmd.exp: Remove gdb_py_test_multiple function. Use load_lib gdb-python.exp. * gdb.python/python.exp: Ditto. * gdb.python/py-function.exp: Ditto.
2011-01-01run copyright.sh for 2011.Joel Brobecker1-1/+1
2010-11-232010-11-23 Phil Muldoon <pmuldoon@redhat.com>Phil Muldoon1-0/+5
PR python/12212 * python/py-inferior.c (find_thread_object): Check if PIDGET returns 0. 2010-11-23 Phil Muldoon <pmuldoon@redhat.com> PR python/12212 * gdb.python/python.exp: Check that selected_thread raises an error when no inferior is loaded.
2010-11-12gdbTom Tromey1-2/+2
* varobj.c (value_get_print_value): Rearrange. Pass stream to apply_varobj_pretty_printer. * c-lang.c: Include exceptions.h. (c_get_string): Throw MEMORY_ERROR when appropriate. * python/py-prettyprint.c (enum string_repr_result): New. (print_stack_unless_memory_error): New function. (print_string_repr): Change return type. Use print_stack_unless_memory_error. (print_children): Use print_stack_unless_memory_error. (apply_val_pretty_printer): Update. Don't print children if string representation threw an exception. (apply_varobj_pretty_printer): Add 'stream' argument. Use print_stack_unless_memory_error. * python/python.c (gdbpy_gdb_error, gdbpy_gdb_memory_error): New globals. (_initialize_python): Initialize them. * python/python-internal.h (GDB_PY_HANDLE_EXCEPTION): Use gdbpy_convert_exception. (GDB_PY_SET_HANDLE_EXCEPTION): Likewise. (gdbpy_gdb_error, gdbpy_gdb_memory_error): Declare. (gdbpy_convert_exception): Declare. (apply_varobj_pretty_printer): Update. * python/py-utils.c (gdbpy_convert_exception): New function. gdb/doc * gdb.texinfo (Basic Python): Update. Add xref. (Exception Handling): Document new exception classes. (Types In Python): Update. (Frames In Python): Update. gdb/testsuite * gdb.python/py-prettyprint.c (main): Add new 'ns2' local. * gdb.python/py-prettyprint.exp (run_lang_tests): Add test for MemoryError. * gdb.python/python.exp (gdb_py_test_multiple): Update exception type. * gdb.python/py-value.exp (test_value_in_inferior): Add test for MemoryError. (test_subscript_regression): Update exception type.
2010-10-01 * lib/gdb-python.exp: New file.Doug Evans1-11/+2
* 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-09-11gdb/Jan Kratochvil1-0/+6
Redirect also uiout and stdtarg{,err} in execute_command_to_string. * cli-logging.c (struct saved_output_files) <targerr>: New. (set_logging_redirect, pop_output_files, handle_redirections): Redirect also gdb_stdtargerr. * defs.h (struct ui_out, make_cleanup_ui_out_redirect_pop): New declarations. * event-top.c (gdb_setup_readline, gdb_disable_readline): Redirect also gdb_stdtargerr. * top.c (execute_command_to_string): Move make_cleanup_ui_file_delete to the top. Redirect also gdb_stdlog, gdb_stdtarg and gdb_stdtargerr. Use ui_out_redirect, register make_cleanup_ui_out_redirect_pop. * tui/tui-io.c (tui_setup_io): Redirect also gdb_stdtargerr. * utils.c (do_ui_out_redirect_pop, make_cleanup_ui_out_redirect_pop): New functions. gdb/testsuite/ * gdb.python/python.exp (set height 0, collect help from uiout) (verify help to uiout): New tests.
2010-08-19 * gdb.python/py-shared.exp: New file, factored out fromPedro Alves1-21/+4
python.exp. * gdb.python/py-shared.c: New file. * gdb.python/py-shared-sl.c: New file. * gdb.python/python-1.c: New file. * gdb.python/python-sl.c: Delete. * gdb.python/python.c: Mention python-1.c. * gdb.python/python.exp: Move shared library tests to py-shared.exp. * gdb.python/Makefile.in (EXECUTABLES): Add py-shared and python. (MISCELLANEOUS): New. (clean mostlyclean): Also remove $MISCELLANEOUS.
2010-08-16 * gdb.python/python.exp: Fix syntax in "post event insertion" test.Doug Evans1-1/+1
2010-08-112010-08-11 Tom Tromey <tromey@redhat.com>Phil Muldoon1-0/+14
Phil Muldoon <pmuldoon@redhat.com> * python/python.c (gdbpy_run_events): New function. (gdbpy_post_event): Likewise. (gdbpy_initialize_events): Likewise. (_initialize_python): Call gdbpy_initialize_events. 2010-08-11 Tom Tromey <tromey@redhat.com> Phil Muldoon <pmuldoon@redhat.com> * gdb.texinfo (Basic Python): Describe post_event API. 2010-08-11 Phil Muldoon <pmuldoon@redhat.com> * gdb.python/python.exp (gdb_py_test_multiple): Add gdb.post_event tests.
2010-08-112010-08-11 Phil Muldoon <pmuldoon@redhat.com>Phil Muldoon1-1/+80
Thiago Jung Bauermann <bauerman@br.ibm.com> Tom Tromey <tromey@redhat.com> * python/python.c (gdbpy_solib_address): New function. (gdbpy_decode_line): Likewise. 2010-08-11 Phil Muldoon <pmuldoon@redhat.com> * gdb.texinfo (Basic Python): Describe solib_address and decode_line Python APIs 2010-08-11 Phil Muldoon <pmuldoon@redhat.com> * gdb.python/python.c: New File. * gdb.python/python-sl.c: New File. * gdb.python/python.exp: Test solib_address and decode_line * functions.
2010-08-07gdb/Jan Kratochvil1-0/+23
* defs.h (make_cleanup_restore_uinteger, make_cleanup_restore_ui_file) (make_cleanup_restore_page_info) (set_batch_flag_and_make_cleanup_restore_page_info): New declarations. * gdbcmd.h (execute_command_to_string): New declaration. * python/python.c (struct restore_ui_file_closure, restore_ui_file) (make_cleanup_restore_ui_file): Move to utils.c (execute_gdb_command) <to_string>: Move ... * top.c (execute_command_to_string): ... here. Call set_batch_flag_and_make_cleanup_restore_page_info. * utils.c (make_cleanup_restore_integer): New source file blank line. (make_cleanup_restore_uinteger): New. (struct restore_ui_file_closure, do_restore_ui_file) (make_cleanup_restore_ui_file): Move here from python/python.c. (init_page_info) <batch_flag> (do_restore_page_info_cleanup, make_cleanup_restore_page_info) (set_batch_flag_and_make_cleanup_restore_page_info): New. gdb/testsuite/ * gdb.python/python.exp (show height, set height 10) (verify pagination beforehand, verify pagination beforehand: q) (gdb.execute does not page, verify pagination afterwards) (verify pagination afterwards: q): New. gdb/doc/ * gdb.texinfo (Mode Options) <-batch> (Basic Python) <gdb.execute>: Describe setting width and height.
2010-06-25gdbTom Tromey1-0/+4
PR python/10808: * python/python.c (execute_gdb_command): Add keywords. Accept "to_string" argument. (struct restore_ui_file_closure): New. (restore_ui_file): New function. (make_cleanup_restore_ui_file): Likewise. (GdbMethods) <execute>: Update. gdb/doc PR python/10808: * gdb.texinfo (Basic Python): Document new gdb.execute argument. gdb/testsuite PR python/10808: * gdb.python/python.exp: Add new tests.
2010-06-08gdb/Jan Kratochvil1-0/+3
* configure.ac <"${have_libpython}" != no>: New workaround of python#4434. * configure: Regenerate. gdb/testsuite/ * gdb.python/python.exp (pythonX.Y/lib-dynload/*.so): New.
2010-01-18 * gdb.python/source2.py: New file.Joel Brobecker1-0/+6
* gdb.python/source1: New file. * gdb.python/python.exp: Test "source" command.
2010-01-01Update copyright year in most headers.Joel Brobecker1-1/+1
Automatic update by copyright.sh.
2009-05-28gdbTom Tromey1-0/+3
2009-04-01 Tom Tromey <tromey@redhat.com> Thiago Jung Bauermann <bauerman@br.ibm.com> Phil Muldoon <pmuldoon@redhat.com> * python/python.c: Include objfiles.h, observer.h. (gdbpy_auto_load): New global. (gdbpy_current_objfile): Likewise. (GDBPY_AUTO_FILENAME): New define. (gdbpy_new_objfile): New function. (gdbpy_get_current_objfile): Likewise. (gdbpy_objfiles): Likewise. (_initialize_python): Add "maint set auto-load". Call gdbpy_initialize_objfile. Attach objfile observer. (GdbMethods): New methods current_objfile, objfiles. * python/python-objfile.c: New file. * python/python-internal.h (objfile_to_objfile_object): Declare. (objfpy_get_printers): Likewise. (gdbpy_initialize_objfile): Likewise. * Makefile.in (SUBDIR_PYTHON_OBS): Add python-objfile.o. (SUBDIR_PYTHON_SRCS): Add python-objfile.c. (python-objfile.o): New target. gdb/doc 2009-04-01 Tom Tromey <tromey@redhat.com> Thiago Jung Bauermann <bauerman@br.ibm.com> * gdb.texinfo (Python API): Update. (Auto-loading): New node. (Objfiles In Python): New node. gdb/testsuite 2009-04-06 Tom Tromey <tromey@redhat.com> * gdb.python/python.exp (gdb_py_test_multiple): Add two objfile tests. * gdb.python/python-value.exp (py_objfile_tests): New proc. Call it.
2009-01-14 * NEWS: Document "define" for prefixed commands.Daniel Jacobowitz1-1/+1
* cli/cli-cmds.c (show_user): Update calls to show_user_1. Call show_user_1 for prefix commands. * cli/cli-decode.c (help_cmd_list): Recurse for "help user-defined". * cli/cli-script.c (validate_comname): Rewrite to handle prefix commands. Return the containing command list. (define_command, document_command): Update to handle prefix commands. (show_user_1): Add prefix and name arguments. Handle prefix commands. * cli/cli-script.h (show_user_1): Update prototype. doc/ * gdb.texinfo (Define, Hooks): Document prefix command support. testsuite/ * gdb.base/define.exp: Test defining and hooking prefix commands. * gdb.python/python.exp: Update test for "show user" output.
2009-01-03 Updated copyright notices for most files.Joel Brobecker1-1/+1
2008-08-16gdb/Thiago Jung Bauermann1-0/+7
2008-08-16 Vladimir Prus <vladimir@codesourcery.com> Thiago Jung Bauermann <bauerman@br.ibm.com> * cli-script.c (read_next_line): Add parse_commands argument. (recurse_read_control_structure): Adapt to new read_next_line signature. (read_command_lines): Add parse_commands argument. (define_command): Adapt to new read_command_lines signature. (document_command): Likewise. * breakpoint.c (commands_command): Likewise. * defs.h (read_command_lines): Adjust function prototype. testsuite/ 2008-08-16 Thiago Jung Bauermann <bauerman@br.ibm.com> * gdb.base/define.exp: Test indented command documentation. * gdb.python/python.exp: Test indented multi-line command.
2008-08-06Initial python support.Thiago Jung Bauermann1-0/+66
gdb/ 2008-08-06 Vladimir Prus <vladimir@codesourcery.com> Tom Tromey <tromey@redhat.com> Thiago Jung Bauermann <bauerman@br.ibm.com> Doug Evans <dje@google.com> * Makefile.in (SUBDIR_PYTHON_OBS, SUBDIR_PYTHON_SRCS, SUBDIR_PYTHON_DEPS, SUBDIR_PYTHON_LDFLAGS, SUBDIR_PYTHON_CFLAGS, PYTHON_CFLAGS): New. (python_h, python_internal_h): New. (cli-script.o): Depend on python.h (python.o, python-utils.o): New. * cli/cli-script.c (print_command_lines): Handle python_control. (execute_control_command): Handle python_control. (execute_control_command_untraced): New function. (while_command): Call execute_control_command_untraced. (if_command): Likewise. (get_command_line): Remove static attribute. (read_next_line): Handle "python". (recurse_read_control_structure): Handle python_control. (read_command_lines): Handle python_control. Include python.h. * cli/cli-script.h (get_command_line): Add prototype. (execute_control_command_untraced): Likewise. * configure.ac: Add --with-python. * defs.h (enum command_control_type) <python_control>: New constant. * python/python-internal.h: New file. * python/python.c: New file. * python/python.h: New file. * python/python-utils.c: New file. * NEWS: Mention Python scripting support and its new commands. gdb/doc/ 2008-08-06 Tom Tromey <tromey@redhat.com> * gdb.texinfo (Extending GDB): New chapter. (Sequences): Demoted chapter, now a section under the new Extending GDB chapter. (Python): New section. gdb/testsuite/ 2008-08-06 Tom Tromey <tromey@redhat.com> * gdb.python/python.exp: New file.