* amd64-tdep.c: Include features/i386/x32.c and
features/i386/x32-avx.c.
(_initialize_amd64_tdep): Call initialize_tdesc_x32 and
initialize_tdesc_x32_avx.
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.
Make auto-load handle multiple components of DEBUG_FILE_DIRECTORY.
* auto-load.c (auto_load_objfile_script): Remove check for NULL
DEBUG_FILE_DIRECTORY. Handle multiple components of
DEBUG_FILE_DIRECTORY.
Pedro Alves <palves@redhat.com>
* linux-low.c (enum stopping_threads_kind): New.
(stopping_threads): Change type to `enum stopping_threads_kind'.
(handle_extended_wait): If stopping and suspending threads, leave
the new_lwp suspended too.
(linux_wait_for_event): Adjust.
(stop_all_lwps): Set `stopping_threads' to
STOPPING_AND_SUSPENDING_THREADS or STOPPING_THREADS depending on
whether we're suspending threads or just stopping them. Assert no
recursion happens.
(partial_map_symtabs_matching_filename): Skip included psymtabs.
(psymtab_to_symtab): Find unshared psymtab.
(dump_psymtab): Print including psymtabs.
(recursively_search_psymtabs): New function.
(expand_symtabs_matching_via_partial): Use it.
* psympriv.h (struct partial_symtab) <user, searched_flag>: New
fields.
(enum psymtab_search_status): New.
gdb/ChangeLog:
* findvar.c (default_read_var_value): For LOC_UNRESOLVED symbols,
try locating the symbol in the symbol's own objfile first, before
extending the search to all objfiles.
* symtab.c (lookup_symbol_aux_objfile): New function, extracted
out of lookup_symbol_aux_symtabs.
(lookup_symbol_aux_symtabs): Add new parameter "exclude_objfile".
Replace extracted-out code by call to lookup_symbol_aux_objfile.
Do not search EXCLUDE_OBJFILE.
(lookup_static_symbol_aux): Update call to lookup_symbol_aux_symtabs.
(lookup_symbol_global): Search for matches in the block's objfile
first, before searching all other objfiles.
Now that this method is no longer used by any architecture,
we can remove its support.
gdb/ChangeLog:
* infcall.c (call_function_by_hand): Remove AT_SYMBOL handling.
* inferior.h (AT_SYMBOL): Delete.
This patch switches the mips code to use the ON_STACK method
for function calls instead of AT_SYMBOL, which we want to remove.
gdb/ChangeLog:
* mips-tdep.c (mips_push_dummy_code): New function.
(mips_gdbarch_init): Set the gdbarch call_dummy_location to
ON_STACK and install mips_push_dummy_code as our gdbarch
push_dummy_code routine.
commands, even when the current interpreter is MI.
interps.c (interp_set_temp): New function.
interps.h (interp_set_temp): Add prototype.
cli/cli-script.c (restore_interp): New cleanup function.
(read_command_lines): Temporarily override the current interpreter
with CLI and arrange for restoring the original one.
* sh-linux-tdep.c: Include trad-frame.h and tramp-frame.h.
(sh_linux_sigtramp_cache): New function.
(sh_linux_sigreturn_init): New function.
(sh_linux_rt_sigreturn_init): New function.
(SH_MOVW,SH_TRAP,SH_OR_R0_R0): New symbols for instruction
patterns.
(SH_NR_SIGRETURN,SH_NR_RT_SIGRETURN): New symbols for sigreturn
syscall codes.
(sh_linux_sigreturn_tramp_frame): New tramp_frame definition.
(sh_linux_rt_sigreturn_tramp_frame): Likewise.
(sh_linux_init_abi): Add init calls to register new tramp_frame
definitions under 32-bit SH, update comments.
* 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.
This patch makes sure that the value of segment registers are
read properly as 16bit values on Windows.
gdb/ChangeLog:
* windows-nat.h (segment_register_p_ftype): New typedef.
(windows_set_segment_register_p): Add declaration.
* windows-nat.c (segment_register_p): New static global.
(windows_set_segment_register_p): New function.
(do_windows_fetch_inferior_registers): Add special handling
for segment registers.
* amd64-windows-nat.c: #include "amd64-tdep.h".
(amd64_windows_segment_register_p): New function.
(_initialize_amd64_windows_nat): Call windows_set_segment_register_p.
* i386-windows-nat.c: #include "i386-tdep.h".
(i386_windows_segment_register_p): New function.
(_initialize_i386_windows_nat): Call windows_set_segment_register_p.
* printcmd.c (set_command): Emit a warning if the expression is not
an assignment.
testsuite/
2012-05-04 Tristan Gingold <gingold@adacore.com>
* gdb.base/set-noassign.exp: New test.
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.
init_and_read_dies_worker. All callers updated.
(init_cu_and_read_dies, init_tu_and_read_dies): Delete. All calls
replaced with init_cutu_and_read_dies.
(load_partial_comp_unit): Pass 1 for use_existing_cu.
(find_partial_die): Remove FIXME. Don't free current CU.
testsuite/
* gdb.dwarf2/pr13961.S: New file.
* gdb.dwarf2/pr13961.exp: New file.
All callers updated.
(init_cu_die_reader): Verify the section is non-empty.
(dwarf_decode_line_header): Don't dereference section->asection
until we know the section is present.
* symfile.c (default_symfile_relocate): Use sectp->owner instead of
objfile->obfd.
* symfile.h (dwarf2_debug_sections): New member addr.
* dwarf2expr.c (execute_stack_op): New case DW_OP_GNU_addr_index.
(ctx_no_get_addr_index): New function.
* dwarf2expr.h (dwarf_expr_context_funcs): New member get_addr_index.
(ctx_no_get_addr_index): Declare.
* dwarf2-frame.c (dwarf2_frame_ctx_funcs): Update.
* dwarf2loc.c (dwarf_expr_get_addr_index): New function.
(dwarf_expr_ctx_funcs): Update.
(needs_get_addr_index): New function.
(needs_frame_ctx_funcs): Update.
* dwarf2loc.h (dwarf2_read_addr_index): Declare.
* dwarf2read.c: #include "gdbcore.h".
(dwarf2_per_objfile): New members addr, dwo_files.
(dwarf2_elf_names): Add entry for addr.
(struct dwo_section_names): New type.
(dwo_section_names): New static global.
(dwarf2_cu): New members dwo_unit, addr_base, have_addr_base.
(dwarf2_per_cu_data): New member is_debug_types, all boolean uses of
old debug_types_section member updated to use this.
Rename member debug_types_section to info_or_types_section,
all uses updated.
(signatured_type): Rename member type_offset to type_offset_in_tu,
all uses updated. New member type_offset_in_section.
(struct dwo_sections): New type.
(struct dwo_unit): New type.
(struct dwo_file): New type.
(die_reader_specs): New member dwo_file.
(dwarf2_locate_sections): Watch for .debug_addr.
(zlib_decompress_section): Use sectp->owner instead of objfile->obfd.
(dwarf2_read_section): Get bfd of section from bfd's asection,
instead of objfile.
(create_cus_from_index): Initialize the_cu->info_or_types_section.
(create_signatured_type_table_from_index): Initialize
sig_type->info_or_types_section.
(dw2_get_file_names): Statement lists for type units with DWO files
live in the DWO file.
(create_debug_types_hash_table): New function.
(create_all_type_units): Rewrite.
(init_cu_die_reader): New arg dwo_file, all callers updated.
(init_and_read_dies_worker): Get section from
this_cu->info_or_types_section. Set sig_type->type_offset_in_section.
Watch for DW_AT_GNU_dwo_name and if present lookup the file and
continue reading the CU/TU from there.
(init_cutu_and_read_dies_no_follow): New arg dwo_file, all callers
updated. Get section from this_cu->info_or_types_section.
(create_all_comp_units): Initialize this_cu->info_or_types_section.
(skip_one_die): New cases DW_FORM_GNU_addr_index,
DW_FORM_GNU_str_index.
(hash_dwo_file, eq_dwo_file): New functions.
(allocate_dwo_file_hash_table): New function.
(hash_dwo_unit, eq_dwo_unit): New functions.
(allocate_dwo_unit_table): New function.
(dwarf2_locate_dwo_sections): New function.
(struct create_dwo_info_table_data): New type.
(create_debug_info_hash_table_reader): New function.
(create_debug_info_hash_table): New function.
(try_open_dwo_file, open_dwo_file, init_dwo_file): New function.
(lookup_dwo_file): New function.
(lookup_dwo_comp_unit, lookup_dwo_type_unit): New functions.
(free_dwo_file, free_dwo_file_cleanup): New functions.
(free_dwo_file_from_slot, free_dwo_files): New functions.
(dwarf2_get_pc_bounds): Handle DW_FORM_GNU_addr_index.
(dwarf2_record_block_ranges): Ditto.
(read_partial_die): Ditto.
(process_enumeration_scope): Update to use type_offset_in_section.
(read_full_die_1): New function.
(read_full_die): Rewrite.
(read_attribute_value): New cases DW_FORM_GNU_addr_index,
DW_FORM_GNU_str_index.
(read_addr_index_1, read_addr_index): New functions.
(read_addr_index_from_leb128): New function.
(struct dwarf2_read_addr_index_data): New type.
(dwarf2_read_addr_index_reader): New function.
(dwarf2_read_addr_index): New function.
(read_str_index): New function.
(leb128_size): New function.
(dwarf_decode_line_header): Delete arg abfd, all callers updated.
If processing a type unit from a DWO file, get the line section
from the DWO file.
(var_decode_location): Watch for DW_OP_GNU_addr_index.
(dwarf2_const_value_attr): New cases DW_FORM_GNU_addr_index,
DW_FORM_GNU_str_index.
(lookup_die_type): Check whether section offset of type's die is
known before looking it up. Remove assert. Condition can
legimately happen for inter-cu type references.
(dwarf_attr_name): Handle Fission attributes.
(dwarf_form_name): Handle Fission forms.
(dump_die_shallow): New cases DW_FORM_GNU_addr_index,
DW_FORM_GNU_str_index.
(follow_die_sig): Update to use type_offset_in_section.
(decode_locdesc): New case DW_OP_GNU_addr_index.
(skip_form_bytes): New cases DW_FORM_GNU_addr_index,
DW_FORM_GNU_str_index.
(cu_debug_loc_section): New function.
(fill_in_loclist_baton, dwarf2_symbol_mark_computed): Call it.
(dwarf2_per_objfile_free): Unmap .debug_addr section.
Free DWO files if present.
* xcoffread.c (dwarf2_xcoff_names): Add .debug_addr.
testsuite/
* gdb.dwarf2/dw2-intercu.S (.Ltype_int2_in_cu2): Renamed from
.Ltype_int_in_cu2. Use name "int2" instead of "int".
All uses updated.
* gdb.dwarf2/dw2-intercu.exp: Add "ptype int2" ahead of
"ptype func_cu1" to expand cu2 before cu1.
* dwarf2read.c (dwarf2_per_objfile): Replace members
debug_info_type_hash and debug_types_type_hash with die_type_hash.
(die_reader_specs): New member "die_section". Temporarily make
member "buffer" non-const, pending constifying all info_ptr uses.
(die_reader_func_ftype): New typedef.
(dw2_get_file_names_reader): New function.
(dw2_get_file_names): Rewrite.
(read_and_check_type_unit_head): Rename arg type_offset to
type_offset_in_tu.
(create_all_type_units): Improve debugging message.
Improve dummy type unit check.
(init_cu_die_reader): New arg "section". All callers updated.
(init_and_read_dies_worker): New function.
(init_cu_and_read_dies, init_tu_and_read_dies): New functions.
(init_cutu_and_read_dies_no_follow): New function.
(init_cutu_and_read_dies_simple): New function.
(process_psymtab_comp_unit_reader): New function.
(process_psymtab_comp_unit): Delete args section,
is_debug_types_section. Rewrite. All callers updated.
(process_psymtab_type_unit): Renamed from process_type_comp_unit.
All callers updated. Rewrite.
(load_partial_comp_unit_reader): New function.
(load_partial_comp_unit): Rewrite.
(skip_children): New arg reader. Delete args buffer, cu.
All callers updated.
(skip_one_die): New arg reader. Delete args buffer, cu.
All callers updated.
(locate_pdi_sibling): New arg reader. Delete args buffer, abfd, cu.
All callers updated.
(load_full_comp_unit_reader): New function.
(load_full_comp_unit): Rewrite.
(read_comp_unit): Delete.
(read_die_and_children_1): Delete, contents moved ...
(read_die_and_children): ... here.
(dwarf2_read_abbrevs): New arg abbrev_section. All callers updated.
(load_partial_dies): New arg reader. Delete args abfd, buffer, cu.
All callers updated.
(read_partial_die): New arg reader. Delete args abfd, buffer, cu.
All callers updated.
(find_partial_die): Rewrite load_all_dies support.
(read_attribute_value): New arg reader. Delete args abfd, cu.
All callers updated.
(read_attribute): New arg reader. Delete args abfd, cu.
All callers updated.
(load_full_type_unit): Add assert.
(read_signatured_type_reader): New function.
(read_signatured_type): Rewrite.
(free_stack_comp_unit): Remove call to age_cached_comp_units.
(free_one_cached_comp_unit): Change target_cu arg to target_per_cu.
All callers updated. Set per_cu->cu = NULL after freeing it.
(dwarf2_per_cu_offset_and_type): Renamed from dwarf2_offset_and_type.
(per_cu_offset_and_type_hash): Renamed from offset_and_type_hash.
(per_cu_offset_and_type_eq): Renamed from offset_and_type_eq.
(set_die_type): Update.
(get_die_type_at_offset): Update.
(read_file_scope): Call prepare_one_comp_unit.
(read_type_unit_scope): Ditto.
(prepare_one_comp_unit): Set producer if present.
Tom Tromey <tromey@redhat.com>
* breakpoint.c (struct breakpoint_objfile_data)
<longjmp_searched>,<longjmp_probes>,<exception_searched>,
<exception_probes>: New fields.
(free_breakpoint_probes): New function.
(create_longjmp_master_breakpoint): Prefer SystemTap probe over
`_Unwind_DebugHook'.
(create_exception_master_breakpoint): Likewise.
(_initialize_breakpoint): Registering cleanup for SystemTap probes.
* infrun.c: Including necessary header files for handling SystemTap
probes.
(handle_inferior_event): Handling longjmp breakpoint and exceptions
via SystemTap probes.
(check_exception_resume): Remove `func' argument. Handle exception
unwinding breakpoint set via a SystemTap probe.
(insert_exception_resume_from_probe): New function.
Tom Tromey <tromey@redhat.com>
* ax-gdb.c (gen_expr): Clean up code to handle internal variables
and to compile agent expressions.
* infrun.c (siginfo_make_value): New argument `ignore'.
(siginfo_funcs): New struct.
(_initialize_infrun): New argument when calling
`create_internalvar_type_lazy'.
* thread.c (thread_id_make_value): New argument `ignore'.
(thread_funcs): New struct.
(_initialize_thread): New argument when calling
`create_internalvar_type_lazy'.
* tracepoint.c (sdata_make_value): New argument `ignore'.
(sdata_funcs): New struct.
(_initialize_tracepoint): New argument when calling
`create_internalvar_type_lazy'.
* value.c (make_value): New struct.
(create_internalvar_type_lazy): New argument `data'.
(compile_internalvar_to_ax): New function.
(value_of_internalvar): Properly handling `make_value' case.
(clear_internalvar): Likewise.
(show_convenience): Adding `TRY_CATCH' block.
* value.h (internalvar_make_value): Delete, replace by...
(struct internalvar_funcs): ... this.
(create_internalvar_type_lazy) <fun>: Delete argument.
(create_internalvar_type_lazy) <funcs>, <data>: New arguments.
(compile_internalvar_to_ax): New function.
* windows-tdep.c (tlb_make_value): New argument `ignore'.
(tlb_funcs): New struct.
(_initialize_windows_tdep): New argument when calling
`create_internalvar_type_lazy'.
Fix DW_AT_lower_bound defaults for DWARF-4+.
* dwarf2read.c (read_subrange_type): Remove initialization of low and
high. New variable low_default_is_valid. Implement DWARF-4+
DW_AT_lower_bound defaults. Print complaint for DW_AT_lower_bound with
no default by the DWARF standard.
* infrun.c (handle_inferior_event): Move the check for return
trampolines ahead of the check for function trampolines.
* mips-tdep.h (MIPS_S2_REGNUM, MIPS_GP_REGNUM): New macros.
* mips-tdep.c (mips_str_mips16_call_stub): New variable.
(mips_str_mips16_ret_stub): Likewise.
(mips_str_call_fp_stub): Likewise.
(mips_str_call_stub): Likewise.
(mips_str_fn_stub): Likewise.
(mips_str_pic): Likewise.
(mips_in_frame_stub): New function.
(mips_unwind_pc): Return the return address rather than the PC
if the PC of an intermediate frame is inside a call thunk.
(mips_is_stub_suffix): New function.
(mips_is_stub_mode): Likewise.
(mips_get_mips16_fn_stub_pc): Likewise.
(mips_skip_mips16_trampoline_code): Update to handle all the
currently generated stub types. Don't recurse into __fn_stub
thunks. Remove heuristics to handle stubs beyond etext/_etext.
Use cooked register accesses.
(mips_in_return_stub): Reintroduce function.
(mips_skip_trampoline_code): Traverse trampolines recursively.
(mips_gdbarch_init): Handle MIPS16 return trampolines.
gdb/testsuite/
* gdb.arch/mips16-thunks-inmain.c: New file.
* gdb.arch/mips16-thunks-main.c: New file.
* gdb.arch/mips16-thunks-sin.c: New file.
* gdb.arch/mips16-thunks-sinfrob.c: New file.
* gdb.arch/mips16-thunks-sinfrob16.c: New file.
* gdb.arch/mips16-thunks-sinmain.c: New file.
* gdb.arch/mips16-thunks-sinmips16.c: New file.
* gdb.arch/mips16-thunks.exp: New file.
* procfs.c (procfs_make_note_section): Be sure to NUL-terminate
fname and psargs before trying to concatenate.
* tui/tui-stack.c (tui_get_function_from_frame): NUL-terminate
"name" before applying strchr.
(PTRACE_ARG4_TYPE): Likewise.
(PTRACE_XFER_TYPE): Likewise.
* linux-arm-low.c (arm_prepare_to_resume): Cast third argument of
ptrace to PTRACE_ARG3_TYPE.
* linux-low.c (PTRACE_ARG3_TYPE): Move macro to linux-low.h.
(PTRACE_ARG4_TYPE): Likewise.
(PTRACE_XFER_TYPE): Likewise.
(linux_detach_one_lwp): Cast fourth argument of
ptrace to long then PTRACE_ARG4_TYPE.
(regsets_fetch_inferior_registers): Cast third argument of
ptrace to long then PTRACE_ARG3_TYPE.
(regsets_store_inferior_registers): Likewise.
Revert this patch to allow breakpoint always-inserted
in record target.
2011-12-05 Pedro Alves <pedro@codesourcery.com>
* breakpoint.c: Include record.h.
(breakpoints_always_inserted_mode): Return false when the record
target is in use.
* breakpoint.c (iterate_over_bp_locations): New.
* breakpoint.h: Declare.
New typedef walk_bp_location_callback.
* record.c (record_open): Call record_init_record_breakpoints.
(record_sync_record_breakpoints): New.
(record_init_record_breakpoints): New.
* NEWS: Mention supporting breakpoint always-inserted mode in
record target.
This appears to be an oversight, since this is done already for
sparc64-*-linux*, and essentially every other linux target.
gdb/
* configure.tgt (sparc-*-linux*): Set build_gdbserver to yes.
The code for handling calls to internal functions (esp., Python
functions) and for handling STT_GNU_IFUNC had not been added to the Ada
expression evaluator. This change adapts them from eval.c.
gdb/Changelog:
* ada-lang.c (ada_evaluate_subexp): Add cases for
TYPE_CODE_INTERNAL_FUNCTION and for TYPE_GNU_IFUNC, following
their treatment in eval.c.
SPARC-T4 adds a "compare and branch" instruction which fuses
a compare and a branch instruction into one. The branch
is non-delayed, there are no anulling facilities, and the
displacement is 10-bits.
This also corrects the existing bit test for Branch on
Integer Register. The distinguising characteristic between
Branch on Integer Register and Compare-and-Branch is bit
28. The existing code was checking bit 24 for zero, but
that's pointless because bit 24 is already covered by
the "X_OP2 (insn) == 3" test.
gdb/
* sparc-tdep.c (X_DISP10): Define.
(sparc_analyze_control_transfer): Handle compare-and-branch.
Fix compilation compatibility with python-2.4
* python/py-type.c (convert_field): Cast ADDRSTRING for
PyObject_SetAttrString as non-const. New comment.
(make_cleanup_dtor_ftype): New typedef.
(make_cleanup_dtor): Use it.
(ALL_CLEANUPS): Replace with ...
(all_cleanups): ... this. Declare. All uses updated.
* cleanups.c: #include "gdb_assert.h".
(sentinel_cleanup): New static global.
(SENTINEL_CLEANUP): Define.
(cleanup_chain, final_cleanup_chain): Initialize to SENTINEL_CLEANUP.
(make_my_cleanup2): Assert result is non-NULL.
(all_cleanups): New function.
(save_my_cleanups): Initialize new chain to SENTINEL_CLEANUP instead
of NULL.
The problem showed up on AIX when we switched from the system linker
to GNU ld. What happens is that configure is adding -lpthdebug to
CONFIG_LDFLAGS when AIX thread debugging support is detected. But
this causes the "-lpthread" switch to be placed at the _before_
GDB's .o files (see Makefile.in):
INTERNAL_LDFLAGS = [...] $(CONFIG_LDFLAGS)
[...]
gdb$(EXEEXT): gdb.o $(LIBGDB_OBS) $(ADD_DEPS) $(CDEPS) $(TDEPLIBS)
rm -f gdb$(EXEEXT)
$(CC_LD) $(INTERNAL_LDFLAGS) $(WIN32LDAPP) \
-o gdb$(EXEEXT) gdb.o $(LIBGDB_OBS) \
$(TDEPLIBS) $(TUI_LIBRARY) $(CLIBS) $(LOADLIBES)
And as a result of this, the linker reports an error due to some
symbols in aix-thread.o not being satisfied.
This patch adds the "-lpthread" switch to LIBS instead, which should
be the right place to add it.
gdb/ChangeLog (Tristan Gingold):
* configure.ac (aix): Put -lpthread into libs.
* configure: Regenerate.
Fix 64-bit constants on 32-bit hosts.
* dwarf2read.c (read_unsigned_leb128): Change declaration return type
from unsigned long to ULONGEST.
(read_signed_leb128): Change declaration return type from long to
LONGEST.
(dwarf2_const_value_attr): Change declaration parameter value from long
to LONGEST.
(dwarf2_compute_name): Change variable value from long to LONGEST.
(read_unsigned_leb128): Change return type, variable result and some
casts from unsigned long to ULONGEST.
(read_signed_leb128): Change return type, variable result and some
casts from long to LONGEST.
(dwarf2_const_value_data, dwarf2_const_value_attr): Change parameter
value from long to LONGEST.
(dwarf2_const_value): Change variable value from long to LONGEST.
* symmisc.c (print_symbol): Change SYMBOL_VALUE format strings to use
plongest and hex_string.
* symtab.h (struct general_symbol_info): Change ivalue from long to
LONGEST, remove the comment.
* tracepoint.c (validate_actionline, collect_symbol, scope_info):
Change SYMBOL_VALUE format strings to use plongest and hex_string.
PR symtab/7259:
* ada-exp.y (convert_char_literal): Use TYPE_FIELD_ENUMVAL.
* ada-lang.c (ada_discrete_type_high_bound)
(ada_discrete_type_low_bound): Use TYPE_FIELD_ENUMVAL for
TYPE_CODE_ENUM.
(ada_identical_enum_types_p): Use TYPE_FIELD_ENUMVAL.
(pos_atr, value_val_atr): Use TYPE_FIELD_ENUMVAL for TYPE_CODE_ENUM.
* ada-typeprint.c (print_enum_type): Change variable lastval to LONGEST.
Use TYPE_FIELD_ENUMVAL.
* ada-valprint.c (print_optional_low_bound, ada_print_scalar)
(ada_val_print_1): Use TYPE_FIELD_ENUMVAL for TYPE_CODE_ENUM.
* c-typeprint.c (c_type_print_base): Move variable lastval to inner
block, change it to LONGEST. Use TYPE_FIELD_ENUMVAL for
TYPE_CODE_ENUM.
* coffread.c (coff_read_enum_type): Use SET_FIELD_ENUMVAL.
* dwarf2read.c (process_enumeration_scope): Likewise.
* gdb-gdb.py (TypeFlagsPrinter): Use field.enumval instead of
field.bitpos.
(class StructMainTypePrettyPrinter): Support also
FIELD_LOC_KIND_ENUMVAL.
* gdbtypes.c (get_discrete_bounds): Use TYPE_FIELD_ENUMVAL for
TYPE_CODE_ENUM.
(recursive_dump_type): Use TYPE_FIELD_ENUMVAL for TYPE_CODE_ENUM.
(copy_type_recursive): Support also FIELD_LOC_KIND_ENUMVAL.
* gdbtypes.h (enum field_loc_kind): New FIELD_LOC_KIND_ENUMVAL.
(struct main_type.flds_bnds.fields.loc): Adjust bitpos comment. New
field enumval.
(struct main_type.flds_bnds.bields): Adjust loc_kind and bitsize to
accommodate enumval.
(struct call_site): Adjust loc_kind to accommodate enumval.
(FIELD_ENUMVAL, FIELD_ENUMVAL_LVAL, SET_FIELD_ENUMVAL)
(TYPE_FIELD_ENUMVAL): New macros.
* m2-typeprint.c (m2_enum): Use TYPE_FIELD_ENUMVAL.
* mdebugread.c (parse_symbol): Use TYPE_FIELD_ENUMVAL for
TYPE_CODE_ENUM.
* p-typeprint.c (pascal_type_print_base): Likewise.
* python/lib/gdb/printing.py (class FlagEnumerationPrinter): Use
enumval.
* python/lib/gdb/types.py (make_enum_dict): Likewise.
* python/py-type.c (convert_field): New variable addrstring. Use
TYPE_FIELD_ENUMVAL for TYPE_CODE_ENUM.
(check_types_equal): Support also FIELD_LOC_KIND_ENUMVAL.
* stabsread.c (read_enum_type): Use SET_FIELD_ENUMVAL.
* typepint.c (print_type_scalar): Use TYPE_FIELD_ENUMVAL for
TYPE_CODE_ENUM.
* valprint.c (generic_val_print): Likewise.
gdb/testsuite/
PR symtab/7259:
* gdb.base/enumval.c: New test case.
* gdb.base/enumval.exp: New test case.
* gdb.python/py-type.exp (test_enums): Use field.enumval instead of
field.bitpos.
This patch fixes the following problem:
% gdb foo
(gdb) b main
/[...]/progspace.c:216: internal-error: set_current_program_space: Assertion `pspace != NULL' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n)
The problem happens when we try to get the program space from
a minimal symbol. For that, we go through the minimal symbol's
obj_section->objfile->pspace. But the minimal symbol's obj_section
is not set, and thus we somehow get a NULL program space. And
the reason why the obj_section is not set is because the XCOFF
reader did not pass the bfd_section when calling minsyms.c's
prim_record_minimal_symbol_and_info.
gdb/ChangeLog:
* xcoffread.c (xcoff_secnum_to_sections): New function.
(secnum_to_section, secnum_to_bfd_section): Reimplement
using xcoff_secnum_to_sections. Rename "secnum" parameter
into "n_scnum".
(RECORD_MINIMAL_SYMBOL): Delete.
(record_minimal_symbol): New function.
(scan_xcoff_symtab): Replace uses of RECORD_MINIMAL_SYMBOL
by call to record_minimal_symbol and set misc_func_recorded
to 1. Set last_csect_sec to the XCOFF section index instead
of GDB's section_offset index. Update calls to
prim_record_minimal_symbol_and_info to pass the BFD section
as well.