2012-11-16 Mircea Gherzan <mircea.gherzan@intel.com>
gdb/doc:
* gdb.texinfo (GDB/MI Catchpoint Commands): New section.
gdb/:
* NEWS: mention the -catch-load/-catch-unload MI commands.
* NEWS: Mention Python 3 support.
* varobj.c (value_get_print_value): Use
python_string_to_target_string.
* python/py-block.c: Use PyVarObject_HEAD_INIT in initialization
of type objects.
* python/py-breakpoint.c: Ditto.
* python/py-cmd.c: Ditto.
* python/py-event.c: Ditto.
* python/py-event.h: Ditto.
* python/py-evtregistry.c: Ditto.
* python/py-finishbreakpoint.c: Ditto.
* python/py-frame.c: Ditto.
* python/py-function.c: Ditto.
* python/py-infthread.c: Ditto.
* python/py-lazy-string.c: Ditto.
* python/py-progspace.c: Ditto.
* /python/py-symbol.c: Ditto.
* python/py-evts.c: (gdbpy_initialize_py_events): Add module
initialization for Python 3.
* python/py-inferior.c: Use PyVarObject_HEAD_INIT in initialization
of type objects.
(infpy_read_memory): Return memoryview object if Python 3.
(infpy_write_memory): Use "s*" operand parsing code for Python 3.
(infpy_search_memory): Ditto.
(get_buffer): New function for Python 3.
* python/py-objfile.c: Use PyVarObject_HEAD_INIT in initialization
of type objects.
(objfpy_dealloc): Use Py_TYPE to call tp_free.
* python/py-param.c: Use PyVarObject_HEAD_INIT in initialization
of type objects.
(get_attr): Use PyUnicode_CompareWithASCIIString if Python 3.
(set_attr): Ditto.
* python/py-prettyprint.c (print_string_repr): use PyBytes methods
instead of PyString methods if Python 3.
(print_children): Skip push_dummy_python_frame call if Python 3.
* python/py-symtab.c: Use PyVarObject_HEAD_INIT in initialization
of type objects.
(salpy_dealloc): Use Py_TYPE to call tp_free.
* python/py-type.c: Use PyVarObject_HEAD_INIT in initialization
of type objects.
(field_dealloc): Use Py_TYPE to call tp_free.
(typy_dealloc): Ditto.
(type_object_as_number): Adjust struct initializations for
differences in layout for Python 2 vs. Python 3.
* python/py-utils.c (python_string_to_unicode): Omit non-Unicode
string case for Python 3.
(unicode_to_encoded_python_string): Shorten code (no functional
change).
(python_string_to_target_python_string): Comment that in Python 3
returned value is a Python "bytes" type.
(gdbpy_is_string): Omit non-Unicode string check in Python 3.
(gdb_py_object_from_longest): Omit non-long integer case in Python
3.
(gdb_py_object_from_ulongest): Ditto.
* python/py-value.c: Use PyVarObject_HEAD_INIT in initialization
of type objects.
(valpy_dealloc): Use Py_TYPE to call tp_free.
(valpy_int): Omit function if Python 3.
(convert_value_from_python): Use "%S" format (Python object as a
string) if Python 3.
(value_object_as_number): Adjust struct initializations for
differences in layout for Python 2 vs. Python 3.
* python/python-config.py: Adjust syntax for Python 3
compatibility.
Include "sys.abiflags" string as part of python library name, if
that attribute exists (Python 3).
* python/python-internal.h (IS_PY3): Define if Python 3.
(Py_TPFLAGS_HAVE_ITER, Py_TPFLAGS_CHECKTYPES): Define with
placeholder value if Python 3.
(PyInt_Check, PyInt_FromLong, PyInt_AsLong, PyString_FromString,
PyString_Decode, PyString_FromFormat, PyString_Check): Define as
analogous Python 3 API function if Python 3.
(PyVarObject_HEAD_INIT): Define if not already defined.
(Py_TYPE): Ditto.
* python/python.c (eval_python_command): Omit Py_FlushLine call if
Python 3.
Check return values of all Python API calls for error.
Supply dummy "python" and "python-interactive" commands if Python
initialization failed.
(_initialize_python): Convert argc to wchar_t** if Python 3.
Add module initialization for Python 3.
(finish_python_initialization): Pass wchar_t * argument to
PySys_SetPath if Python 3.
* python/lib/gdb/__init__.py: Define "reload" if Python 3.
(_GdbFile): New class for common output file behavior.
(GdbOutFile): Subclass from _GdbFile.
(GdbOutputErrorFile): Ditto.
(auto_load_packages): Adjust syntax for Python 3 compatibility.
* python/lib/gdb/printing.py: Define basestr and int if Python 3.
* python/lib/gdb/prompt.py: Use sorted() function rather than
sort() method.
* python/lib/gdb/command/explore.py: Define raw_input if Python 3.
Adjust syntax for Python 3 compatibility.
* python/lib/gdb/command/pretty_printers.py: Use sorted() function
rather than sort() method.
Adjust syntax for Python 3 compatibility.
* python/lib/gdb/command/type_printers.py: Ditto.
* doc/gdb.texinfo (Inferior.read_memory): Mention that the return
value is a memoryview object if Python 3.
(get_init_files): If --data-directory is provided,
and SYSTEM_GDBINIT lives in data-directory, look for it there.
* NEWS: Mention it.
doc/
* gdb.texinfo (System-wide configuration): If the system-wide init
file lives in the data-directory, and --data-directory is provided,
look for it there.
* mi/mi-main.c (mi_cmd_data_write_memory): Handle additional
parameter COUNT, for pattern filling of memory regions.
* NEWS: Mention it.
doc
* gdb.texinfo (GDB/MI Data Manipulation): Document new optional
parameter "count" of -data-write-memory-bytes, and add an example.
testsuite
* gdb.mi/mi-fill-memory.exp: New test.
* data-directory/Makefile.in (PYTHON_FILES): Add
type_printers.py.
* python/lib/gdb/command/type_printers.py: New file.
* python/lib/gdb/command/types.py (TypePrinter): New class.
(_get_some_type_recognizers, get_type_recognizers,
apply_type_recognizers, register_type_printer): New
functions.
* python/py-objfile.c (objfile_object) <type_printers>: New
field.
(objfpy_dealloc): Decref new field.
(objfpy_new): Set new field.
(objfpy_get_type_printers, objfpy_set_type_printers): New
functions.
(objfile_to_objfile_object): Set new field.
(objfile_getset): Add "type_printers".
* python/py-progspace.c (pspace_object) <type_printers>: New
field.
(pspy_dealloc): Decref new field.
(pspy_new): Set new field.
(pspy_get_type_printers, pspy_set_type_printers): New functions.
(pspace_to_pspace_object): Set new field.
(pspace_getset): Add "type_printers".
* python/python.c (start_type_printers, apply_type_printers,
free_type_printers): New functions.
(_initialize_python): Set gdb.type_printers.
* python/python.h (start_type_printers, apply_type_printers,
free_type_printers): Declare.
* typeprint.c (type_print_raw_options, default_ptype_flags):
Update for new fields.
(do_free_global_table, create_global_typedef_table,
find_global_typedef): New functions.
(find_typedef_in_hash): Use find_global_typedef.
(whatis_exp): Use create_global_typedef_table. Change cleanup
handling.
* typeprint.h (struct type_print_options) <global_typedefs,
global_printers>: New fields.
doc
* gdb.texinfo (Symbols): Document "info type-printers",
"enable type-printer" and "disable type-printer".
(Python API): Add new node to menu.
(Type Printing API): New node.
(Progspaces In Python): Document type_printers field.
(Objfiles In Python): Likewise.
(gdb.types) <get_type_recognizers, apply_type_recognizers,
register_type_printer, TypePrinter>: Document.
testsuite
* gdb.base/completion.exp: Update for "info type-printers".
* gdb.python/py-typeprint.cc: New file.
* gdb.python/py-typeprint.exp: New file.
* gdb.python/py-typeprint.py: New file.
* c-typeprint.c (c_type_print_base): Handle print_method and
print_typedefs flags.
* gdbcmd.h (setprinttypelist, showprinttypelist): Declare.
* python/py-type.c (typy_str): Use LA_PRINT_TYPE and raw
options.
* typeprint.c (type_print_raw_options, default_ptype_flags):
Update for new field.s
(whatis_exp): Parse flags. Use LA_PRINT_TYPE.
(setprinttypelist, showprinttypelist, print_methods,
print_typedefs): New globals.
(set_print_type, show_print_type, set_print_type_methods,
show_print_type_methods, set_print_type_typedefs,
show_print_type_typedefs): New functions.
(_initialize_typeprint): Update documentation. Add "print
type methods" and "print type typedefs" parameters.
* typeprint.h (struct type_print_options) <print_methods,
print_typedefs>: New fields.
doc
* gdb.texinfo (Symbols): Document "set print type methods",
"set print type typedefs", and flags to ptype and whatis.
gdb/ChangeLog
* source.c (print_source_lines_base): Add fullname field giving
full path to file in mi output.
* NEWS: Mention the new fullname field.
gdb/doc/ChangeLog
* gdb.texinfo (GDB/MI Data Manipulation): Add fullname field to
the example -data-disassemble output. Extend the description of
the -data-disassemble results to document all fields. Document
the cli disassemble command as being related to -data-disassemble.
gdb/testsuite/ChangeLog
* gdb.mi/mi-disassemble.exp: Expect fullname field in mi
disassembly output.
The documentation is a little ambiguous and might be suggesting that
GDB checks all locations where a gdbinit might be located for gdb.ini
files. This clarifies the current situation.
gdb/doc/ChangeLog:
* gdb.texinfo (Startup): Minor rewording, and clarify scope of
gdb.ini warning for Windows port.
2012-09-18 Sergio Durigan Junior <sergiodj@redhat.com>
* infcmd.c (_initialize_infcmd): Register `j' as an alias for
`jump'.
gdb/doc/ChangeLog:
2012-09-18 Sergio Durigan Junior <sergiodj@redhat.com>
* gdb.texinfo (jump): Mention new alias `j' for `jump'.
* cli/cli-decode.c (add_setshow_zuinteger_unlimited_cmd): New.
Update comment to add_setshow_integer_cmd.
* cli/cli-setshow.c (do_set_command): Handle case
'var_zuinteger_unlimited'.
(do_show_command): Likewise.
* cli/cli-cmds.c (init_cmds): Call add_setshow_zuinteger_unlimited_cmd
for command 'remotetimeout'.
* command.h (enum var_types): New zuinteger_unlimited. Update comment
to var_integer.
* source.c (_initialize_source): Call add_setshow_zuinteger_unlimited_cmd
for command 'set listsize'.
gdb/doc/
* gdb.texinfo (List): Describe the meaning of 0 and -1 in
'set listsize'.
gdb/testsuite/
* gdb.base/list.exp (set_listsize): Don't set arg to "unlimited"
when it is less than 0.
Python interactive prompt with "pi" as alias, and add "py" as
an alias to "python".
* NEWS: Mention the new commands.
* doc/gdb.texinfo (Python Commands): Document the new
commands.
* python/python.c (eval_python_command): New function.
(python_interactive_command): For "python-interactive" with
arguments, call eval_python_command. For "python-interactive"
without arguments, call PyRun_InteractiveLoop.
(_initialize_python): Add "python-interactive" command with
"pi" as alias, and add "py" as an alias to "python".
(_initialize_values): Mention convenience functions in the help text
for "show convenience".
doc/
* gdb.texinfo (Convenience Vars): Update text for "show convenience"
to include functions.
testsuite/
* gdb.base/default.exp: Update expected output of "show convenience".
2012-08-06 Nathaniel Flath <flat0103@gmail.com>
* NEWS: New entry for 'cd' default parameters.
* cli/cli-cmds.c (cd_command): Replace error_no_arg by DIR assignment.
gdb/doc/
2012-08-06 Nathaniel Flath <flat0103@gmail.com>
* gdb.texinfo (Working Directory): Added information about new
default argument for 'cd' command.
and delete reference to --use-deprecated-index-sections.
* symfile.h (use_deprecated_index_sections): Delete.
* dwarf2read.c (use_deprecated_index_sections): Make static.
(read_index_from_section): Update wording of how to load
deprecated index sections.
(_initialize_dwarf2_read): New options
"set/show use-deprecated-index-sections".
* main.c (captured_main): Delete --use-deprecated-index-sections.
doc/
* gdb.texinfo (Mode Options): Delete --use-deprecated-index-sections.
(Index Files): Document how to control the use of deprecated index
sections.
(Index Section Format): Replace --use-deprecated-index-sections with
"set use-deprecated-index-sections on".
avoid file-name clashes between Index.html and index.html on
case-insensitive filesystems. See the discussion starting in
http://sourceware.org/ml/gdb-patches/2012-06/msg00457.html for the
details of the problem.
(Top): Update the master menu for the above.
(Concept Index, Command and Variable Index): New nodes, instead of
the old "Index" node that was deleted. All cross-references
updated.
Execute -ix and -iex only after system and user gdbinit files.
* main.c (captured_main): Move CMDARG_INIT_FILE and CMDARG_INIT_COMMAND
processing down after gdbinit files.
gdb/doc/
* gdb.texinfo (File Options): Change -ix and -iex commands that apply
only after gdbinit files.
(Startup): Move -iex and -iex commands down after gdbinit files.
Support shell wildcards for 'set auto-load safe-path'.
* auto-load.c: Include fnmatch.h.
(filename_is_in_dir): Rename to ...
(filename_is_in_pattern_1, filename_is_in_pattern): ... here and split
it. Update function comment. Rename dir_len to pattern_len. New
variables filename_len, pattern and filename. Add more DEBUG_AUTO_LOAD
messages. Use gdb_filename_fnmatch.
(filename_is_in_auto_load_safe_path_vec): Rename variable dir to
pattern.
(_initialize_auto_load): Extend the "set auto-load safe-path" help text.
* defs.h (gdb_filename_fnmatch): New declaration.
* utils.c: Include fnmatch.h.
(gdb_filename_fnmatch): New function.
gdb/doc/
* gdb.texinfo (Auto-loading safe path): Note the shell wildcard
possibility.
from non-MI uses.
* common/linux-osdata.c (struct osdata_type): Add title field.
(osdata_table): Add titles to each entry.
(linux_command_xfer_osdata): Add a column for title data.
* gdb.texinfo (Miscellaneous GDB/MI Commands): Update -info-os
example, add note about title column.
New attribute 'last' for gdb.Symtab_and_line.
* NEWS (Python Scripting): Add entry about the new attribute.
* python/py-symtab.c (salpy_get_last): New function which
implements the get method for the 'last' attribute of
gdb.Symtab_and_line.
(sal_object_getset): Add entry for the 'last' attribute.
doc/
* gdb.texinfo (Symbol Tables In Python): Add description about
the new 'last' attribute of gdb.Symtab_and line.
testsuite/
* gdb.python/py-symtab.exp: Add tests to test the new attribute
'last' of gdb.Symtab_and_line.
* gdb.python/py-symbol.c: Move break point comment to enable
testing of gdb.Symtab_and_line.last.
* NEWS: Document additions to .gdb_index.
* dwarf2read.c: #include "gdb/gdb-index.h".
(DW2_GDB_INDEX_SYMBOL_STATIC_SET_VALUE): New macro.
(DW2_GDB_INDEX_SYMBOL_KIND_SET_VALUE): New macro.
(DW2_GDB_INDEX_CU_SET_VALUE): New macro.
(dwarf2_read_index): Recognize version 7.
(dw2_do_expand_symtabs_matching): New args want_specific_block,
block_kind, domain): All callers updated.
(dw2_find_symbol_file): Handle new index CU values.
(dw2_expand_symtabs_matching): Match symbol kind if requested.
(add_index_entry): New args is_static, kind. All callers updated.
(offset_type_compare, uniquify_cu_indices): New functions
(symbol_kind): New function.
(write_psymtabs_to_index): Remove duplicate CU values.
(write_psymtabs_to_index): Write .gdb_index version 7.
doc/
* gdb.texinfo (Index Section Format): Document version 7 format.
include/gdb/
* gdb-index.h: New file.
and infpy_write_memory.
gdb/doc:
* gdb.texinfo (Inferiors In Python): Replace "gdb.read_memory"
and "gdb.write_memory" with "Inferior.read_memory" and
"Inferior.write_memory".
* gdb.texinfo (Summary): Add a link to "Free Documentation".
(Free Documentation): Add @node line.
(Continuing and Stepping) <advance location>: Use @item instead of
@itemx.
(Reverse Execution) <set exec-direction reverse>: Use @item instead of
@itemx.
(Embedded Processors): Put the link to "PA" to its correct place,
according to document structure.
(Python API): Put the link to "Lazy Strings In Python" to its
correct place.
(Index): Use @@ in @tex block to get a literal @.
* gdbint.texinfo: Fix the @subtitle line.
* stabs.texinfo (Top): Put the link to "Symbol Types Index" to its
correct place.
* NEWS (--with-auto-load-dir): Prepend $debugdir to the default path.
Describe it.
* auto-load.c (auto_load_expand_dir_vars): New function.
(auto_load_safe_path_vec_update): Use it, remove the
substitute_path_component call thanks to it.
(auto_load_objfile_script): Remove the debug_file_directory processing.
Use auto_load_expand_dir_vars, remove the substitute_path_component
call thanks to it.
* configure: Regenerate.
* configure.ac (--with-auto-load-dir): Prepend $debugdir to the default
path. Escape $ also for $debugdir.
(--with_auto_load_safe_path): Escape $ also for $debugdir.
* utils.c (substitute_path_component): Accept also DIRNAME_SEPARATOR.
gdb/doc/
* gdb.texinfo (Separate Debug Files): New anchor debug-file-directory.
Mention also --with-separate-debug-dir.
(Auto-loading): Prepend $debugdir in the sample output.
(Auto-loading safe path): Likewise. Mention also $debugdir for the
auto-load safe-path variable.
(objfile-gdb.py file): Remove the extra debug-file-directory paragraph.
Mention also $debugdir for 'set auto-load scripts-directory'.
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.
Kwok Cheung Yeung <kcy@codesourcery.com>
* NEWS: Describe new info os commands.
* common/linux-osdata.c (PID_T, TIME_T): Define.
(MAX_PID_T_STRLEN): New.
(linux_common_core_of_thread): Add comment. Change to use PID_T and
MAX_PID_T_STRLEN.
(command_from_pid): Add comment. Change to use PID_T.
(commandline_from_pid): Change to use PID_T.
(user_from_pid): Add comment.
(get_process_owner): Add comment. Change to use PID_T and
MAX_PID_T_STRLEN.
(get_number_of_cpu_cores): Add comment.
(get_cores_used_by_process): Add comment. Change to use PID_T and
MAX_PID_T_STRLEN.
(linux_xfer_osdata_processes): Change to use PID_T and
MAX_PID_T_STRLEN.
(compare_processes): New function.
(linux_xfer_osdata_processgroups): New function.
(linux_xfer_osdata_threads): Change to use PID_T.
(linux_xfer_osdata_fds): New function.
(format_socket_state, print_sockets): New functions.
(union socket_addr): New union.
(linux_xfer_osdata_isockets): New function.
(time_from_time_t, group_from_gid): New functions.
(linux_xfer_osdata_shm): New function.
(linux_xfer_osdata_sem): New function.
(linux_xfer_osdata_msg): New function.
(linux_xfer_osdata_modules): New function.
(osdata_table): Add new entries.
* common/buffer.c (buffer_xml_printf): Add support for long and
long long format specifiers.
* gdb.texinfo (Operating System Auxiliary Information): Document new
'info os' subcommands.
* gdb.base/info-os.exp: New file.
* gdb.base/info-os.c: New file.
Provide $ddir substitution for --with-auto-load-safe-path.
* NEWS (--with-auto-load-safe-path, --without-auto-load-safe-path): New
entries.
* auto-load.c: Include observer.h.
(auto_load_safe_path_vec_update): Call substitute_path_component for
each component. New variable ddir_subst.
(auto_load_gdb_datadir_changed): New function.
(set_auto_load_safe_path): Rename DEFAULT_AUTO_LOAD_SAFE_PATH to
AUTO_LOAD_SAFE_PATH. New comment.
(_initialize_auto_load): Rename DEFAULT_AUTO_LOAD_SAFE_PATH to
AUTO_LOAD_SAFE_PATH. Install auto_load_gdb_datadir_changed.
* config.in: Regenerate.
* configure: Regenerate.
* configure.ac (--auto-load-safe-path): Rename
DEFAULT_AUTO_LOAD_SAFE_PATH to AUTO_LOAD_SAFE_PATH. Default to
GDB_DATADIR/auto-load.
* defs.h (substitute_path_component): New declaration.
* top.c: Include observer.h.
(set_gdb_datadir): New function.
(init_main): Install it for "set data-directory".
* utils.c (substitute_path_component): New function.
gdb/doc/
Provide $ddir substitution for --with-auto-load-safe-path.
* gdb.texinfo (Auto-loading): Replace /usr/local by $ddir/auto-load.
(Auto-loading safe path): Likewise. Mention the default value,
$ddir substitution, --with-auto-load-safe-path and
--without-auto-load-safe-path.
* observer.texi (gdb_datadir_changed): New.
* auto-load.c (set_auto_load_safe_path): Reset AUTO_LOAD_SAFE_PATH
back to DEFAULT_AUTO_LOAD_SAFE_PATH if it is being set to "".
(show_auto_load_safe_path): Check any-directory by comparison with "/".
(add_auto_load_safe_path): Change the error message.
(_initialize_auto_load): Change the "safe-path" help text.
* configure: Regenerate
* configure.ac (--without-auto-load-safe-path): Set
WITH_AUTO_LOAD_SAFE_PATH to /.
gdb/doc/
* gdb.texinfo (Auto-loading safe path): Make 'directories'
for 'set auto-load safe-path' optional. Mention if it is omitted.
Change disabling security protection condition to "/", twice.
Add two new methods global_block and static_block to gdb.Symtab
objects.
* NEWS (Python scripting): Add entry about the new methods.
* python/py-symtab.c (stpy_global_block): New function which
implements the gdb.Symtab.global_block() method.
(stpy_static_block): New function which implements the
gdb.Symtab.static_block() method.
(symtab_object_methods): Add entries for the two new methods.
* testsuite/gdb.python/py-symbol.exp: Add tests to test the new
methods gdb.Symtab.global_block() and gdb.Symtab.static_block().
* tessuite/gdb.python/py-symbol.c: Add new struct to help test
gdb.Symtab.static_block().
* doc/gdb.texinfo (Symbol Tables In Python): Add documentation
about the new methods global_block and static_block on
gdb.Symtab objects.
* doc/gdb.texinfo (Blocks In Python): Add a note saying that
future improvements to GDB and its infrastructure can move
symbols across blocks within a symbol table.
New option "set auto-load safe-path".
* NEWS: New commands "set auto-load safe-path"
and "show auto-load safe-path".
* auto-load.c: Include gdb_vecs.h, readline/tilde.h and completer.h.
(auto_load_safe_path, auto_load_safe_path_vec)
(auto_load_safe_path_vec_update, set_auto_load_safe_path)
(show_auto_load_safe_path, add_auto_load_safe_path, filename_is_in_dir)
(filename_is_in_auto_load_safe_path_vec, file_is_auto_load_safe): New.
(source_gdb_script_for_objfile): New variable is_safe. Call
file_is_auto_load_safe. Return if it is not.
(struct loaded_script): New field loaded.
(maybe_add_script): Add parameter loaded. Initialize SLOT with it.
(print_script): Use LOADED indicator instead of FULL_PATH. Change
output "Missing" to "No".
(_initialize_auto_load): New variable cmd. Initialize
auto_load_safe_path. Register "set auto-load safe-path",
"show auto-load safe-path" and "add-auto-load-safe-path".
* auto-load.h (maybe_add_script): Add parameter loaded.
(file_is_auto_load_safe): New declaration.
* config.in: Regenerate.
* configure: Regenerate.
* configure.ac: New parameters --with-auto-load-safe-path
and --without-auto-load-safe-path.
* linux-thread-db.c (try_thread_db_load_from_pdir_1)
(try_thread_db_load_from_dir): Check file_is_auto_load_safe first.
* main.c (captured_main): Check file_is_auto_load_safe for
LOCAL_GDBINIT.
* python/py-auto-load.c (gdbpy_load_auto_script_for_objfile): New
variable is_safe. Call file_is_auto_load_safe. Return if it is not.
(source_section_scripts): Call file_is_auto_load_safe. Return if it is
not.
gdb/doc/
New option "set auto-load safe-path".
* gdb.texinfo (Auto-loading): Extend the "show auto-load"
and "info auto-load" examples for safe-path. Put there also references
for "set auto-load safe-path" and "show auto-load safe-path".
New menu item for Auto-loading safe path.
(Auto-loading safe path): New node.
(Python Auto-loading): Update the expected output from "Missing"
to "No".
gdb/testsuite/
New option "set auto-load safe-path".
* gdb.python/py-objfile-script.exp (set auto-load safe-path): New.
* gdb.python/py-section-script.exp (set auto-load safe-path): New.
auto-load: Implementation.
* NEWS: New descriptions for "info auto-load",
"info auto-load gdb-scripts", "info auto-load python-scripts",
"info auto-load local-gdbinit" and "info auto-load libthread-db".
Deprecate "info auto-load-scripts", "set auto-load-scripts on|off"
and "show auto-load-scripts". New description for "set auto-load",
"show auto-load", "set auto-load gdb-scripts",
"show auto-load gdb-scripts", "set auto-load python-scripts",
"show auto-load python-scripts", "set auto-load local-gdbinit",
"show auto-load local-gdbinit", "set auto-load libthread-db" and
"show auto-load libthread-db".
* auto-load.c: Remove include python/python-internal.h. Add includes
exceptions.h, cli/cli-script.h, gdbcmd.h, cli/cli-decode.h and
cli/cli-setshow.h.
(GDB_AUTO_FILE_NAME, source_gdb_script_for_objfile)
(auto_load_gdb_scripts, show_auto_load_gdb_scripts): New.
(gdbpy_global_auto_load): Rename to ...
(global_auto_load): ... here.
(auto_load_local_gdbinit, auto_load_local_gdbinit_pathname)
(auto_load_local_gdbinit_loaded, show_auto_load_local_gdbinit)
(script_language_gdb, source_gdb_script_for_objfile): New.
(struct loaded_script): New field language.
(hash_loaded_script_entry, eq_loaded_script_entry): Calculate also
LANGUAGE.
(maybe_add_script): Add parameter language. Drop redundant
entry.full_path initialization. Initialize entry.language and
(*slot)->language.
(auto_load_objfile_script): Change parameter suffix to language.
Remove the call of maybe_add_script.
Call language->source_script_for_objfile.
(load_auto_scripts_for_objfile, struct collect_matching_scripts_data):
New.
(collect_matching_scripts): Adjust it for
struct collect_matching_scripts_data.
(auto_load_info_scripts_pattern_nl): New variable.
(info_auto_load_scripts): Rename to ...
(auto_load_info_scripts): ... here, add parameter language. Adjust it
for struct collect_matching_scripts_data.
(info_auto_load_gdb_scripts, info_auto_load_local_gdbinit)
(set_auto_load_cmd, auto_load_set_cmdlist_get, show_auto_load_cmd)
(auto_load_show_cmdlist_get, info_auto_load_cmd)
(auto_load_info_cmdlist_get): New.
(_initialize_auto_load): Move add_info of "auto-load-scripts" to
python/py-auto-load.c. New installment for "set auto-load gdb-scripts",
"info auto-load gdb-scripts", "set auto-load local-gdbinit" and
"info auto-load local-gdbinit".
* auto-load.h (struct script_language): New.
(gdbpy_global_auto_load): Rename to ...
(global_auto_load): ... here.
(auto_load_local_gdbinit, auto_load_local_gdbinit_pathname)
(auto_load_local_gdbinit_loaded): New declarations.
(maybe_add_script): New parameter language.
(auto_load_objfile_script): Change parameter suffix to language.
(load_auto_scripts_for_objfile, auto_load_info_scripts_pattern_nl)
(auto_load_info_scripts, auto_load_set_cmdlist_get)
(auto_load_show_cmdlist_get, auto_load_info_cmdlist_get): New
declarations.
* linux-thread-db.c: Include auto-load.h and ctype.h.
(auto_load_thread_db, show_auto_load_thread_db): New.
(struct thread_db_info): New field filename.
(delete_thread_db_info): Call xfree for FILENAME.
(try_thread_db_load): Initialize FILENAME.
(try_thread_db_load_from_pdir, try_thread_db_load_from_dir): Return
if !AUTO_LOAD_THREAD_DB.
(info_auto_load_libthread_db_compare, info_auto_load_libthread_db): New.
(_initialize_thread_db): Install auto_load_thread_db
as "set auto-load libthread-db" and install info_auto_load_libthread_db
as "info auto-load libthread-db".
* main.c (captured_main): Rename gdbpy_global_auto_load to
global_auto_load. Initialize AUTO_LOAD_LOCAL_GDBINIT_PATHNAME and
AUTO_LOAD_LOCAL_GDBINIT_LOADED.
(print_gdb_help): Extend the help for 'local init file'.
* python/py-auto-load.c: Remove a comment about gdb scripts extension.
(GDBPY_AUTO_SECTION_NAME): Extend the comment it is Python specific.
(auto_load_scripts): Rename to ...
(auto_load_python_scripts): ... here, update the comment.
(gdbpy_load_auto_script_for_objfile): New declaration.
(show_auto_load_python_scripts, script_language_python)
(gdbpy_load_auto_script_for_objfile): New.
(source_section_scripts): Refactor the code.
(load_auto_scripts_for_objfile): Rename to ...
(gdbpy_load_auto_scripts_for_objfile): ... here, update the
auto_load_objfile_script caller, drop GDBPY_GLOBAL_AUTO_LOAD checking.
(info_auto_load_python_scripts): New.
(gdbpy_initialize_auto_load): New variables cmd and cmd_name.
Rename "set auto-load-scripts" to "set auto-load python-scripts".
Register "set auto-load-scripts" as its deprecated alias. Register
"info auto-load python-scripts". Register "info auto-load-scripts" as
its deprecated alias.
(load_auto_scripts_for_objfile): Rename to ...
(gdbpy_load_auto_scripts_for_objfile): ... here.
* python/python.h (load_auto_scripts_for_objfile): Rename to ...
(gdbpy_load_auto_scripts_for_objfile): ... here.
gdb/doc/
auto-load: Implementation.
* gdb.texinfo (Mode Options): New anchor for -nx.
(Startup): New anchors for Option -init-eval-command,
Home Directory Init File
and Init File in the Current Directory during Startup.
Mention set auto-load local-gdbinit with a reference.
Change the sample code to "set auto-load python-scripts".
(Threads): New anchor set libthread-db-search-path.
Provide references to libthread_db.so.1 file.
(Controlling GDB): New menu item for Auto-loading.
(Auto-loading, Init File in the Current Directory)
(libthread_db.so.1 file, objfile-gdb.gdb file): New nodes.
(Python): Rename the menu item Auto-loading to Python Auto-loading.
(Writing a Pretty-Printer, Objfiles In Python): Update the renamed
reference.
(Auto-loading): Rename to ...
(Python Auto-loading): ... here. Change "set auto-load-scripts" to
"set auto-load python-scripts", new anchor for it. Change
"show auto-load-scripts" to "show auto-load python-scripts", new anchor
for it. Change "info auto-load-scripts"
to "info auto-load python-scripts", new anchor for it. Change "scripts"
to "Python scripts".
gdb/testsuite/
auto-load: Implementation.
* gdb.base/help.exp (test set height): Increase the height.
* gdb.python/py-objfile-script.exp (info auto-load-scripts): Change
to ...
(info auto-load python-scripts): ... here.
* gdb.python/py-section-script.exp (info auto-load-scripts *): Change
to ...
(info auto-load python-scripts *): ... here.
2012-04-14 Anton Gorenkov <xgsa@yandex.ru>
PR mi/13393
* gdb.texinfo (Print Settings): Extend the description for "set print
object".
(GDB/MI Variable Objects): Extend the description for -var-create and
-var-list-children.
gdb/testsuite/ChangeLog:
2012-04-14 Anton Gorenkov <xgsa@yandex.ru>
PR mi/13393
* gdb.mi/mi-var-rtti.cc: New file.
* gdb.mi/mi-var-rtti.exp: New file.
* lib/mi-support.exp (mi_varobj_update_with_child_type_change): New
function.
(mi_varobj_update_with_type_change): updated to avoid code duplication.
gdb/ChangeLog:
2012-04-14 Anton Gorenkov <xgsa@yandex.ru>
PR mi/13393
* value.c (value_actual_type): New function.
* value.h (value_actual_type): New declaration.
* varobj.c (update_type_if_necessary): New function.
(varobj_create): Call value_actual_type instead of
value_type.
(install_dynamic_child): distinct changed and type changed MI variable
objects.
(update_dynamic_varobj_children): Updated for install_dynamic_child
change. All callers updated.
(varobj_update): Support for MI variable object type change if
the value changed and RTTI is used to determine the type.
(create_child_with_value): Call value_actual_type instead of
value_type.
(adjust_value_for_child_access): Extended with a new parameter which
specify whether the given value should be casted to enclosing type.
All callers updated.
New command 'explore' which helps explore values and types in
scope.
* NEWS: Add an entry about the new 'explore' command.
* data-directory/Makefile.in: Add gdb/command/explore.py
* python/lib/gdb/command/explore.py: Implemention of the 'explore'
command using the GDB Python API.
* doc/gdb.texinfo (Examining Data): Document the 'explore'
command.
* testsuite/gdb.python/Makefile.in: Add py-explore to EXECUTABLES.
* testsuite/gdb.python/py-explore.c: C program used for testing
the new 'explore' command on C constructs.
* testsuite/gdb.python/py-explore.cc: C++ program used for testing
the new 'explore' command on C++ constructs.
* testsuite/gdb-python/py-explore.exp: Tests for the new 'explore'
command on C constructs.
* testsuite/gdb-python/py-explore-cc.exp: Tests for the new
'explore' command on C++ constructs.
gdb/doc/ChangeLog:
* gdb.texinfo (GDB/MI Variable Objects): Document what happens
to the children of a varobj and its update range when -var-update
returns that the varobj's type changed.
Python scripting: Add new method Value.referenced_value to
gdb.Value which can dereference pointer as well as reference
values.
* NEWS: Add entry under 'Python scripting' about the new method
Value.referenced_value on gdb.Value objects.
* python/py-value.c (valpy_referenced_value): New function
defining a new method on gdb.Value objects which can dereference
pointer and reference values.
* testsuite/gdb.python/py-value.cc: Add test case for
testing the methodology exposing C++ values to Python.
* testsuite/gdb.python/py-value-cc.exp: Add tests testing the
methodology exposing C++ values to Python.
* testsuite/gdb.python/Makefile.in: Add py-value-cc to
EXECUTABLES.
* docs/gdb.texinfo (Python API/Values From Inferior): Add
description about the new method Value.referenced_value. Add
description on how Value.dereference is different (and similar)
to Value.referenced_value.
* NEWS: Describe new options --init-command=FILE, -ix and
--init-eval-command=COMMAND, -iex.
* main.c (struct cmdarg): New enum items CMDARG_INIT_FILE and
CMDARG_INIT_COMMAND.
(captured_main): New enum items OPT_IX and OPT_IEX. Add
"init-command", "init-eval-command", "ix" and "iex" to the variable
long_options. Handle OPT_IX and OPT_IEX. Process them from CMDARG_VEC.
New comment for CMDARG_FILE and CMDARG_COMMAND processing.
(print_gdb_help): Describe --init-command=FILE, -ix and
--init-eval-command=COMMAND, -iex.
gdb/doc/
* gdb.texinfo (File Options): Describe --init-command=FILE, -ix and
--init-eval-command=COMMAND, -iex.
(Startup): Describe -iex and -ix. Simplify the example
for "set auto-load-scripts off".
gdb/testsuite/
* gdb.gdb/selftest.exp (do_steps_and_nexts): New entry
for cmdarg_vec = NULL. Remove entries for cmdsize = 1, cmdarg = and
ncmd = 0. New entry for VEC_cleanup cmdarg_s.
PR breakpoints/10738
* dwarf2read.c (use_deprecated_index_sections): New global.
(struct partial_die_info): New member may_be_inlined.
(read_partial_die): Set may_be_inlined where appropriate.
(add_partial_subprogram): Add partial symbols for partial
DIEs that may be inlined.
(new_symbol_full): Add inlined subroutines to the current
scope.
(write_psymtabs_to_index): Bump version number.
(dwarf2_read_index): Read only version 6 indices unless
use_deprecated_index_sections is set.
* linespec.c (symbol_and_data_callback): New structure.
(iterate_inline_only): New function.
(iterate_over_all_matching_symtabs): New argument
"include_inline". If nonzero, also call the callback for
symbols representing inlined subroutines.
(lookup_prefix_sym): Pass extra argument to the above.
(find_function_symbols): Likewise.
(add_matching_symbols_to_info): Likewise.
* NEWS: Mention that GDB can now set breakpoints on inlined
functions.
gdb/doc:
PR breakpoints/10738
* gdb.texinfo (Inline Functions): Remove the now-unnecessary @item
stating that GDB cannot set breakpoints on inlined functions.
(Mode Options): Document --use-deprecated-index-sections.
(Index Section Format): Document new index section version format.
gdb/testsuite:
PR breakpoints/10738
* gdb.opt/inline-break.exp: New file.
* gdb.opt/inline-break.c: Likewise.
* gdb.dwarf2/inline-break.exp: Likewise.
* gdb.dwarf2/inline-break.S: Likewise.
* gdb.base/annota1.exp: Cope with old .gdb_index warnings.
* gdb.base/async-shell.exp: Likewise.
* lib/mi-support.exp (library_loaded_re): Likewise.