]> git.ipfire.org Git - thirdparty/binutils-gdb.git/log
thirdparty/binutils-gdb.git
12 years agolanguage-specific read_var_value for Ada renamings
Joel Brobecker [Fri, 2 Mar 2012 19:29:01 +0000 (19:29 +0000)] 
language-specific read_var_value for Ada renamings

The purpose of this patch is to better support renamings in the
"info locals" command. Consider ...

    procedure Foo is
       GV : Integer renames Pck.Global_Variable;
    begin
       Increment (GV); -- STOP
    end Foo;

... Pck.Global_Variable is just an integer. After having stopped at
the "STOP" line, "info locals" yields:

    (gdb) info locals
    gv = <error reading variable gv (Cannot access memory at address 0xffffffffffffffff)>

In reality, two things are happening:

   (1) Variable "GV" does not exist, which is normal, since there is
       "GV" the renaming of another variable;

   (2) But to allow the user access to that renaming the same way
       the code has, the compiler produces an artificial variable
       whose name encodes the renaming:

        gv___XR_pck__global_variable___XE

       For practical reasons, the artificial variable itself is given
       irrelevant types and addresses.

But the "info locals" command does not act as if it was a short-cut
of "foreach VAR in locals, print VAR". Instead it gets the value of
each VAR directly, which does not work in this case, since the variable
is artificial and needs to be decoded first.

This patch makes the "read_var_value" routine language-specific.
The old implementation of "read_var_value" gets renamed to
"default_read_var_value" and all languages now use it (unchanged
behavior), except for Ada. In Ada, the new function ada_read_var_value
checks if we have a renaming, and if so, evaluates its value, or else
defers to default_read_var_value.

gdb/ChangeLog:

        * language.h (struct language_defn): New "method" la_read_var_value.
        * findvar.c: #include "language.h".
        (default_read_var_value): Renames read_var_value.  Rewrite
        function description.
        (read_var_value): New function.
        * value.h (default_read_var_value): Add prototype.
        * ada-lang.c (ada_read_renaming_var_value, ada_read_var_value):
        New functions.
        (ada_language_defn): Add entry for la_read_var_value.
        * c-lang.c, d-lang.c, f-lang.c, jv-lang.c, language.c,
        * m2-lang.c, objc-lang.c, opencl-lang.c, p-lang.c: Update
        language_defn structures to add entry for new la_read_var_value
        field.

12 years ago2012-03-02 Tom Tromey <tromey@redhat.com>
Pedro Alves [Fri, 2 Mar 2012 19:26:10 +0000 (19:26 +0000)] 
2012-03-02  Tom Tromey  <tromey@redhat.com>
    Pedro Alves  <palves@redhat.com>

PR breakpoints/13776:
* breakpoint.c (breakpoint_init_inferior): Delete step-resume
breakpoints.
(delete_longjmp_breakpoint_at_next_stop): New.
* breakpoint.h (delete_longjmp_breakpoint_at_next_stop): Declare.
* target.c (generic_mourn_inferior): Call mark_breakpoints_out
before deleting the inferior.  Add comments.
* thread.c (clear_thread_inferior_resources): Don't delete lonjmp
breakpoints immediately, but only on next stop.  Move that code
next to where we mark other breakpoints for deletion.

12 years agoFix ARI violations in mips-linux-nat.c and mips-tdep.c
Joel Brobecker [Fri, 2 Mar 2012 19:14:30 +0000 (19:14 +0000)] 
Fix ARI violations in mips-linux-nat.c and mips-tdep.c

gdb/ChangeLog:

        * mips-linux-nat.c (mips_linux_read_description): Add missing i18n
        marker.
        * mips-tdep.c (mips_linux_reg_names): Improve comment to avoid ARI
        violation.

12 years agogdb/testsuite/
Edjunior Barbosa Machado [Fri, 2 Mar 2012 18:43:46 +0000 (18:43 +0000)] 
gdb/testsuite/
2012-03-02  Edjunior Machado  <emachado@linux.vnet.ibm.com>

* gdb.arch/altivec-abi.exp (altivec_abi_tests): Remove obsolete
parameter.

12 years ago2012-03-02 Pedro Alves <palves@redhat.com>
Pedro Alves [Fri, 2 Mar 2012 16:54:59 +0000 (16:54 +0000)] 
2012-03-02  Pedro Alves  <palves@redhat.com>

* linux-thread-db.c (attach_thread): Avoid in_thread_list call.

12 years ago2012-03-02 Pedro Alves <palves@redhat.com>
Pedro Alves [Fri, 2 Mar 2012 16:23:42 +0000 (16:23 +0000)] 
2012-03-02  Pedro Alves  <palves@redhat.com>

* inferiors.c (add_pid_to_list, pull_pid_from_list): Delete.
* linux-low.c (struct simple_pid_list): New.
(stopped_pids): New a struct simple_pid_list pointer.
(add_to_pid_list, pull_pid_from_list): New.
(handle_extended_wait): Don't assume the first signal new children
report is SIGSTOP.  Adjust call to pull_pid_from_list.
(linux_wait_for_lwp): Adjust.

12 years ago Fix -Wmissing-prototypes build.
Ulrich Weigand [Fri, 2 Mar 2012 13:38:39 +0000 (13:38 +0000)] 
Fix -Wmissing-prototypes build.
* ppc-linux-nat.c (ppc_linux_get_hwcap): Make static.
* remote-sim.c (gdbsim_has_all_memory): Likewise.
(gdbsim_has_memory): Likewise.

12 years agogdb/
Yao Qi [Fri, 2 Mar 2012 12:56:50 +0000 (12:56 +0000)] 
gdb/
Fix -Wmissing-prototypes build.
* charset.c (phony_iconv_open): Make static.
(phony_iconv_close, phony_iconv): Likewise.
* i386-linux-nat.c (_initialize_i386_linux_nat): New prototype.
* i386-windows-nat.c (_initialize_i386_windows_nat): New
prototype.
* mingw-hdep.c (_initialize_mingw_hdep): New prototype.
* ser-mingw.c (create_select_thread): Make static.
* windows-termcap.c (tgetent): New prototype.
(tgetnum, tgetflag, tgetstr, tputs, tgoto): Likewise.

12 years agogdb/
Jan Kratochvil [Fri, 2 Mar 2012 05:38:51 +0000 (05:38 +0000)] 
gdb/
Fix -Wmissing-prototypes build.
* windows-nat.c (dll_symbol_command, ctrl_c_handler): Make them static.
(_initialize_windows_nat, _initialize_check_for_gdb_ini)
(_initialize_loadable): New prototypes.

12 years ago * dwarf2read.c (load_full_comp_unit): Remove unnecessary reading of
Doug Evans [Fri, 2 Mar 2012 01:55:15 +0000 (01:55 +0000)] 
* dwarf2read.c (load_full_comp_unit): Remove unnecessary reading of
abbrev table, read_comp_unit will do it.

12 years agogdb/gdbserver:
Yao Qi [Fri, 2 Mar 2012 00:18:51 +0000 (00:18 +0000)] 
gdb/gdbserver:
* tracepoint.c (do_action_at_tracepoint): Write `stop_pc' in
debug log.

12 years agogdb/gdbserver:
Yao Qi [Fri, 2 Mar 2012 00:12:47 +0000 (00:12 +0000)] 
gdb/gdbserver:
* tracepoint.c (collect_ust_data_at_tracepoint): Remove parameters
`stop_pc' and `tpoint'.  Update caller.

12 years agogdb/
Jan Kratochvil [Fri, 2 Mar 2012 00:06:13 +0000 (00:06 +0000)] 
gdb/
Fix -Wmissing-prototypes build.
* alpha-tdep.c (alpha_deal_with_atomic_sequence): Make it static.
* amd64-darwin-tdep.c (_initialize_amd64_darwin_tdep): New prototype.
* amd64-windows-tdep.c (_initialize_amd64_windows_tdep): Likewise.
* arm-symbian-tdep.c (arm_symbian_skip_trampoline_code): Make it static.
(_initialize_arm_symbian_tdep): New prototype.
* arm-wince-tdep.c (arm_wince_skip_main_prologue): Make it static.
* i386-darwin-tdep.c (_initialize_i386_darwin_tdep): New prototype.
* i386-linux-tdep.c (i386_linux_displaced_step_copy_insn): Make it
static.
* lm32-tdep.c (_initialize_lm32_tdep): New prototype.
* microblaze-linux-tdep.c (_initialize_microblaze_linux_tdep): New
prototype.
* microblaze-tdep.c (microblaze_debug, microblaze_fetch_instruction)
(microblaze_skip_prologue, microblaze_frame_cache): Make them static.
* mips-linux-tdep.c (mips_linux_regset_from_core_section): Make it
static.
* moxie-tdep.c (moxie_process_record): Likewise.
* remote-mips.c (mips_can_use_watchpoint, mips_insert_watchpoint)
(mips_remove_watchpoint, mips_stopped_by_watchpoint): Make them static.
* rl78-tdep.c (rl78_breakpoint_from_pc): Make it static.
(_initialize_rl78_tdep): New prototype.
* rx-tdep.c (rx_breakpoint_from_pc): Make it static.
(_initialize_rx_tdep): New prototype.
* solib-darwin.c (darwin_in_dynsym_resolve_code): Make it static.
(_initialize_darwin_solib): New prototype.
* solib-spu.c: Include solib-spu.h.
(_initialize_spu_solib): New prototype.
* spu-multiarch.c (_initialize_spu_multiarch): New prototype.
* tic6x-tdep.c (tic6x_analyze_prologue, tic6x_skip_prologue)
(tic6x_breakpoint_from_pc, tic6x_frame_unwind_cache)
(tic6x_software_single_step): Make it static.
(_initialize_tic6x_tdep): New prototype.

12 years agogdb/
Jan Kratochvil [Fri, 2 Mar 2012 00:01:24 +0000 (00:01 +0000)] 
gdb/
Fix -Wmissing-prototypes build.
* cris-tdep.c (cris_can_use_hardware_watchpoint)
(cris_region_ok_for_watchpoint, cris_stopped_data_address): Remove.

12 years ago*** empty log message ***
gdbadmin [Fri, 2 Mar 2012 00:00:32 +0000 (00:00 +0000)] 
*** empty log message ***

12 years agogdb/
Jan Kratochvil [Thu, 1 Mar 2012 23:58:48 +0000 (23:58 +0000)] 
gdb/
Fix -Wmissing-prototypes build.
* frv-tdep.c (frv_check_watch_resources, frv_stopped_data_address)
(frv_have_stopped_data_address): Remove.

12 years agogdb/
Jan Kratochvil [Thu, 1 Mar 2012 23:55:40 +0000 (23:55 +0000)] 
gdb/
Fix -Wmissing-prototypes build.
* Makefile.in (HFILES_NO_SRCDIR): Add sh64-tdep.h.
* sh-tdep.c: Include sh64-tdep.h.
* sh-tdep.h (sh64_gdbarch_init, sh64_show_regs): Remove declarations.
* sh64-tdep.c: Include sh64-tdep.h.
* sh64-tdep.h: New file.

12 years ago * mips-tdep.c (mips32_scan_prologue): Correct indentation.
Maciej W. Rozycki [Thu, 1 Mar 2012 23:35:46 +0000 (23:35 +0000)] 
* mips-tdep.c (mips32_scan_prologue): Correct indentation.

12 years agodaily update
Alan Modra [Thu, 1 Mar 2012 23:00:05 +0000 (23:00 +0000)] 
daily update

12 years ago * mips-tdep.c (mips_gdbarch_init): Only set pc_regnum and
Maciej W. Rozycki [Thu, 1 Mar 2012 22:52:03 +0000 (22:52 +0000)] 
* mips-tdep.c (mips_gdbarch_init): Only set pc_regnum and
sp_regnum once the gdbarch_init_osabi hook has been called.

12 years agoFix typo in frame.h:read_frame_register_unsigned function description.
Joel Brobecker [Thu, 1 Mar 2012 22:47:46 +0000 (22:47 +0000)] 
Fix typo in frame.h:read_frame_register_unsigned function description.

gdb/ChangeLog:

* frame.h (read_frame_register_unsigned): Fix typo in function
description.

12 years ago * mips-tdep.c (mips32_bc1_pc): New function.
Maciej W. Rozycki [Thu, 1 Mar 2012 22:37:51 +0000 (22:37 +0000)] 
* mips-tdep.c (mips32_bc1_pc): New function.
(mips32_next_pc): Handle BC1ANY2F, BC1ANY2T, BC1ANY4F, BC1ANY4T,
BPOSGE32 and BPOSGE64 instructions.
(deal_with_atomic_sequence): Likewise.
(mips32_instruction_has_delay_slot): Likewise.

12 years ago gdb/
Maciej W. Rozycki [Thu, 1 Mar 2012 22:19:48 +0000 (22:19 +0000)] 
gdb/
* features/mips-dsp.xml: New file.
* features/mips64-dsp.xml: New file.
* features/mips-dsp-linux.xml: New file.
* features/mips64-dsp-linux.xml: New file.
* features/Makefile (WHICH): Add mips-dsp-linux and
mips64-dsp-linux.
(mips-dsp-expedite, mips64-dsp-expedite): New variables.
* features/mips-dsp-linux.c: New file.
* features/mips64-dsp-linux.c: New file.
* regformats/mips-dsp-linux.dat: New file.
* regformats/mips64-dsp-linux.dat: New file.
* mips-linux-nat.c (mips_linux_register_addr): Handle DSP
registers.
(mips64_linux_register_addr): Likewise.
(mips64_linux_regsets_fetch_registers): Likewise.
(mips64_linux_regsets_store_registers): Likewise.
(mips64_linux_fetch_registers): Update call to
mips64_linux_regsets_fetch_registers.
(mips64_linux_store_registers): Update call to
mips64_linux_regsets_store_registers.
(mips_linux_read_description): Probe for DSP registers.
(_initialize_mips_linux_nat): Call initialize_tdesc_mips_dsp_linux
and initialize_tdesc_mips64_dsp_linux.
* mips-linux-tdep.c (supply_gregset, mips64_supply_gregset):
Remove padding of no longer used embedded register slots.
* mips-linux-tdep.h (DSP_BASE, DSP_CONTROL): New macros.
(MIPS_RESTART_REGNUM): Redefine enum value.
* mips-tdep.c (mips_generic_reg_names): Remove trailing null
strings.
(mips_tx39_reg_names): Likewise.
(mips_linux_reg_names): New array of register names for Linux
targets.
(mips_register_name): Check for a null pointer in
mips_processor_reg_names and return an empty string.
(mips_register_type): Exclude embedded registers for the IRIX
and Linux ABIs.
(mips_pseudo_register_type): Likewise.  Use dynamic numbers to
refer to FP registers, LO, HI, BadVAddr, Cause and PC.  Handle
DSP registers.
(mips_stab_reg_to_regnum): Handle DSP accumulators.
(mips_dwarf_dwarf2_ecoff_reg_to_regnum): Likewise.
(mips_gdbarch_init): Likewise.  Initialize internal register
indices for the Linux ABI.  Use dynamic numbers to refer to
registers, as applicable, while parsing the target description.
* mips-tdep.h (struct mips_regnum): Add dspacc/dspctl offsets.

gdb/doc/
* gdb.texinfo (MIPS Features): Add org.gnu.gdb.mips.dsp.

gdb/gdbserver/
* linux-low.h (linux_target_ops): Add regset_bitmap member.
* linux-low.c (use_linux_regsets): New macro.
[!HAVE_LINUX_REGSETS] (regsets_fetch_inferior_registers): Likewise.
[!HAVE_LINUX_REGSETS] (regsets_store_inferior_registers): Likewise.
(linux_register_in_regsets): New function.
(usr_fetch_inferior_registers): Skip registers covered by
regsets.
(usr_store_inferior_registers): Likewise.
(usr_fetch_inferior_registers): New macro.
(usr_store_inferior_registers): Likewise.
(linux_fetch_registers): Handle mixed regset/non-regset targets.
(linux_store_registers): Likewise.
* linux-mips-low.c (init_registers_mips_dsp_linux): New
prototype.
(init_registers_mips64_dsp_linux): Likewise.
(init_registers_mips_linux): New macro.
(init_registers_mips_dsp_linux): Likewise.
(mips_dsp_num_regs): Likewise.
(DSP_BASE, DSP_CONTROL): New fallback macros.
(mips_base_regs): New macro.
(mips_regmap): Use it.  Fix the size.
(mips_dsp_regmap): New variable.
(mips_dsp_regset_bitmap): Likewise.
(mips_arch_setup): New function.
(mips_cannot_fetch_register): Use the_low_target.regmap rather
than mips_regmap.
(mips_cannot_store_register): Likewise.
(the_low_target): Update .arch_setup, .num_regs and .regmap
initializers.  Add .regset_bitmap initializer.
* linux-arm-low.c (the_low_target): Add .regset_bitmap
initializer.
* linux-bfin-low.c (the_low_target): Likewise.
* linux-cris-low.c (the_low_target): Likewise.
* linux-crisv32-low.c (the_low_target): Likewise.
* linux-ia64-low.c (the_low_target): Likewise.
* linux-m32r-low.c (the_low_target): Likewise.
* linux-m68k-low.c (the_low_target): Likewise.
* linux-ppc-low.c (the_low_target): Likewise.
* linux-s390-low.c (the_low_target): Likewise.
* linux-sh-low.c (the_low_target): Likewise.
* linux-sparc-low.c (the_low_target): Likewise.
* linux-tic6x-low.c (the_low_target): Likewise.
* linux-x86-low.c (the_low_target): Likewise.
* linux-xtensa-low.c (the_low_target): Likewise.
* configure.srv <mips*-*-linux*>: Add mips-dsp-linux.o and
mips64-dsp-linux.o to srv_regobj.  Add mips-dsp-linux.xml,
mips64-dsp-linux.xml, mips-dsp.xml and mips64-dsp.xml to
srv_xmlfiles.
* Makefile.in (mips-dsp-linux.o, mips-dsp-linux.c): New targets.
(mips64-dsp-linux.o, mips64-dsp-linux.c): Likewise.

gdb/testsuite/
* gdb.xml/tdesc-regs.exp: Add "mips-dsp.xml" to the list of MIPS
core registers.

12 years ago2012-03-01 Pedro Alves <palves@redhat.com>
Pedro Alves [Thu, 1 Mar 2012 21:26:48 +0000 (21:26 +0000)] 
2012-03-01  Pedro Alves  <palves@redhat.com>

* jit-reader.in [!__cplusplus]
(GDB_DECLARE_GPL_COMPATIBLE_READER): Add missing backslash.

12 years ago2012-03-01 Pedro Alves <palves@redhat.com>
Pedro Alves [Thu, 1 Mar 2012 21:14:53 +0000 (21:14 +0000)] 
2012-03-01  Pedro Alves  <palves@redhat.com>

* configure.ac (build_warnings): Add -Wmissing-prototypes.
* configure: Regenerate.

12 years ago2012-03-01 Pedro Alves <palves@redhat.com>
Pedro Alves [Thu, 1 Mar 2012 21:14:00 +0000 (21:14 +0000)] 
2012-03-01  Pedro Alves  <palves@redhat.com>

* amd64-linux-tdep.c (amd64_linux_record_signal): Make static.
* breakpoint.c (create_exception_master_breakpoint, trace_command)
(ftrace_command, strace_command): Make static.
* d-lang.c (_initialize_d_language): Declare.
* dwarf2expr.c (_initialize_dwarf2expr): Declare.
* dwarf2loc.c (_initialize_dwarf2loc):
* dwarf2read.c (process_psymtab_comp_unit): Make static.
* exec.c (exec_get_section_table): Make static.
* i386-linux-tdep.c (i386_linux_record_signal): Make static.
* infcmd.c (ensure_valid_thread, ensure_not_tfind_mode): Make static.
* inferior.c (remove_inferior_command, add_inferior_command)
(clone_inferior_command): Make static.
* linux-nat.c (linux_nat_thread_address_space)
(linux_nat_core_of_thread): Make static.
* linux-tdep.c (_initialize_linux_tdep): Declare.
* objc-lang.c (_initialize_objc_lang): Declare.
* opencl-lang.c (builtin_opencl_type, opencl_language_arch_info):
Make static.
(_initialize_opencl_language): Declare.
* record.c (_initialize_record): Declare.
* remote.c (demand_private_info, remote_get_tib_address)
(remote_supports_cond_tracepoints)
(remote_supports_fast_tracepoints, remote_get_tracepoint_status):
Make static.
* skip.c (_initialize_step_skip): Declare.
* symtab.c (skip_prologue_using_lineinfo): Make static.
* tracepoint.c (delete_trace_state_variable)
(trace_variable_command, delete_trace_variable_command)
(get_uploaded_tsv, find_matching_tracepoint_location)
(find_matching_tsv, create_tsv_from_upload, get_traceframe_info):
Make static.
* value.c (pack_unsigned_long): Make static.
* varobj.c (varobj_ensure_python_env): Make static.
* windows-tdep.c (_initialize_windows_tdep): Declare.
* xml-syscall.c (make_cleanup_free_syscalls_info): Make static.

12 years ago2012-03-01 Pedro Alves <palves@redhat.com>
Pedro Alves [Thu, 1 Mar 2012 21:12:47 +0000 (21:12 +0000)] 
2012-03-01  Pedro Alves  <palves@redhat.com>

* linux-tdep.c (linux_has_shared_address_space): Make static.  Add
gdbarch parameter.
(linux_init_abi): Install it as has_shared_address_space gdbarch
callback.

12 years ago2012-03-01 Pedro Alves <palves@redhat.com>
Pedro Alves [Thu, 1 Mar 2012 21:12:05 +0000 (21:12 +0000)] 
2012-03-01  Pedro Alves  <palves@redhat.com>

* observer.c (observer_test_first_notification_function)
(observer_test_second_notification_function)
(observer_test_third_notification_function): Add declarations.

12 years ago2012-03-01 Pedro Alves <palves@redhat.com>
Pedro Alves [Thu, 1 Mar 2012 21:11:23 +0000 (21:11 +0000)] 
2012-03-01  Pedro Alves  <palves@redhat.com>

* common/signals.c (default_target_signal_to_host)
(default_target_signal_from_host): Move ...
* arch-utils.c: ... here.
* arch-utils.h (default_target_signal_to_host)
(default_target_signal_from_host): Declare.

* common/signals.c (target_signal_from_command): Move ...
* infrun.c: ... here.
* inferior.h (target_signal_from_command): Declare.
* target.h (target_signal_from_command)
(default_target_signal_from_host, default_target_signal_to_host):
Delete declarations.

* common/signals.c (_initialize_signals): Delete.

12 years ago2012-03-01 Pedro Alves <palves@redhat.com>
Pedro Alves [Thu, 1 Mar 2012 21:09:55 +0000 (21:09 +0000)] 
2012-03-01  Pedro Alves  <palves@redhat.com>

* jit-reader.in (plugin_is_GPL_compatible): Add declarations for
both __cplusplus and !__cplusplus.

12 years ago2012-03-01 Pedro Alves <palves@redhat.com>
Pedro Alves [Thu, 1 Mar 2012 21:09:16 +0000 (21:09 +0000)] 
2012-03-01  Pedro Alves  <palves@redhat.com>

* psymtab.c (find_and_open_source): Delete declaration.
* source.c (find_and_open_source): Move comment ...
* source.h (find_and_open_source): ... to this new declaration.

12 years ago2012-03-01 Pedro Alves <palves@redhat.com>
Pedro Alves [Thu, 1 Mar 2012 21:08:37 +0000 (21:08 +0000)] 
2012-03-01  Pedro Alves  <palves@redhat.com>

* inline-frame.c: Include inline-frame.h.

12 years ago2012-03-01 Pedro Alves <palves@redhat.com>
Pedro Alves [Thu, 1 Mar 2012 21:08:07 +0000 (21:08 +0000)] 
2012-03-01  Pedro Alves  <palves@redhat.com>

* tui/tui-data.c (set_gen_win_origin): Delete.
* tui/tui-data.h (tui_set_gen_win_origin): Delete declaration.
* tui/tui-regs.c (tui_last_reg_element_no_in_line): Delete.

12 years ago2012-03-01 Pedro Alves <palves@redhat.com>
Pedro Alves [Thu, 1 Mar 2012 21:07:31 +0000 (21:07 +0000)] 
2012-03-01  Pedro Alves  <palves@redhat.com>

* remote.c (encode_actions): Delete declaration.
* tracepoint.c (encode_actions): Make extern.
* tracepoint.h (encode_actions): Declare.

12 years ago2012-03-01 Pedro Alves <palves@redhat.com>
Pedro Alves [Thu, 1 Mar 2012 21:06:54 +0000 (21:06 +0000)] 
2012-03-01  Pedro Alves  <palves@redhat.com>

* python/py-breakpoint.c: Include python.h.
* python/py-continueevent.c (create_continue_event_object): Make
static.
* python/py-lazy-string.c (stpy_get_type): Make static.
* python/py-newobjfileevent.c (create_new_objfile_event_object):
Make static.
* python/py-utils.c (unicode_to_target_python_string): Make
static.
* python/py-value.c: Include python.h.

12 years ago2012-03-01 Pedro Alves <palves@redhat.com>
Pedro Alves [Thu, 1 Mar 2012 21:06:14 +0000 (21:06 +0000)] 
2012-03-01  Pedro Alves  <palves@redhat.com>

* inferior.c (delete_threads_of_inferior): Delete.

12 years ago2012-03-01 Pedro Alves <palves@redhat.com>
Pedro Alves [Thu, 1 Mar 2012 21:05:31 +0000 (21:05 +0000)] 
2012-03-01  Pedro Alves  <palves@redhat.com>

Import fallback definitions from glibc.

* gdb_proc_service.h [!HAVE_PROC_SERVICE_H] (struct
ps_prochandle): Forward declare.
(ps_err_e): Use glibc's comments.
[!HAVE_PROC_SERVICE_H] (ps_pdread, ps_pdwrite, ps_ptread)
(ps_ptwrite, ps_lgetregs, ps_lsetregs, ps_lgetfpregs)
(ps_lsetfpregs, ps_getpid, ps_get_thread_area, ps_pglobal_lookup)
(ps_pstop, ps_pcontinue, ps_lstop, ps_lcontinue, ps_lgetxregsize)
(ps_lgetxregs, ps_lsetxregs, ps_plog): Declare.
(struct ps_prochandle): Adjust comment.

12 years ago2012-03-01 Pedro Alves <palves@redhat.com>
Pedro Alves [Thu, 1 Mar 2012 21:03:15 +0000 (21:03 +0000)] 
2012-03-01  Pedro Alves  <palves@redhat.com>

* ada-lang.c (ada_modulus_from_name): Delete.
* ada-lex.l (lexer_init): Make static.

12 years ago * gdb.base/hbreak2.exp: New test for "hbreak" and "thbreak".
Maciej W. Rozycki [Thu, 1 Mar 2012 21:01:11 +0000 (21:01 +0000)] 
* gdb.base/hbreak2.exp: New test for "hbreak" and "thbreak".

12 years ago2012-03-01 Pedro Alves <palves@redhat.com>
Pedro Alves [Thu, 1 Mar 2012 20:49:02 +0000 (20:49 +0000)] 
2012-03-01  Pedro Alves  <palves@redhat.com>

PR gdb/13767

gdb/
* frame.c (read_frame_register_unsigned): New.
* frame.h (read_frame_register_unsigned): Declare.
* i387-tdep.c (print_i387_status_word): New parameter `status_p'.
Handle it.
(print_i387_control_word): New parameter `control_p'.  Handle it.
(i387_print_float_info): Handle unavailable float registers.

gdb/testsuite/
* gdb.trace/unavailable.exp (gdb_unavailable_floats): New.
(gdb_collect_globals_test): Call it.

12 years ago * gdb.cp/method2.exp: Output of overload menu is now
Keith Seitz [Thu, 1 Mar 2012 20:34:13 +0000 (20:34 +0000)] 
* gdb.cp/method2.exp: Output of overload menu is now
alphabetized.  Update tests for "break A::method".
* gdb.cp/ovldbreak.exp: Use gdb_get_line_number instead
of hard-coding them.
Overload menu is alphabetized: rewrite to accommodate.
Unset variables LINE and TYPES which are used in other tests.
Compute the output of "info break".
Update the breakpoint table after all breakpoints are deleted.
(continue_to_bp_overloaded): Rename ACTUALS to ARGUMENT and
compute ACTUALS and the method body based on parameters.
Update expected output accordingly.
* gdb.cp/ovldbreak.cc (foo::overload1arg): Reformat and add
unique comments to allow the use of gdb_get_line_number.

* gdb.cp/method2.exp: Use prepare_for_testing and cleanup
some Tcl syntax.
* gdb.cp/ovldbreak.exp: Likewise.

12 years ago * linespec.c (decode_line_2): Sort the list of methods
Keith Seitz [Thu, 1 Mar 2012 20:33:09 +0000 (20:33 +0000)] 
* linespec.c (decode_line_2): Sort the list of methods
alphabetically before presenting the user with a selection
menu.

12 years ago * gdb.base/help.exp (help show user): Update expected result
Keith Seitz [Thu, 1 Mar 2012 20:25:50 +0000 (20:25 +0000)] 
* gdb.base/help.exp (help show user): Update expected result
for new doc string changes (add "non-python").

12 years ago * dwarf2read.c (dwarf2_cu): Remove unused members has_form_ref_addr,
Doug Evans [Thu, 1 Mar 2012 19:55:35 +0000 (19:55 +0000)] 
* dwarf2read.c (dwarf2_cu): Remove unused members has_form_ref_addr,
has_namespace_info.
(dwarf2_read_abbrevs): Remove corresponding initialization.

12 years ago * NEWS: Mention new python command class gdb.COMMAND_USER.
Doug Evans [Thu, 1 Mar 2012 19:30:25 +0000 (19:30 +0000)] 
* NEWS: Mention new python command class gdb.COMMAND_USER.
* cli/cli-cmds.c (show_user): Print error when used on a python
command.
(init_cli_cmds): Update documentation strings for "show user" and
"set/show max-user-call-depth" to clarify that it does not apply to
python commands.
* python/py-cmd.c (cmdpy_init): Treat class_user as a valid class in
error check.
(gdbpy_initialize_commands): Add COMMAND_USER as a constant in
gdb python api.
* top.c (execute_command): Only execute a user-defined command as a
legacy macro if c->user_commands is set.

doc/
* gdb.texinfo (Commands In Python): Put example python macro in
COMMAND_USER category rather than COMMAND_OBSCURE.
Document gdb.COMMAND_USER.
(User-defined Commands): Update documentation to clarify
"set/show max-user-call-depth" and "show user" don't apply to python
commands.  Update documentation to clarify "help user-defined" may
also include python commands defined as COMMAND_USER.

testsuite/
* gdb.python/py-cmd.exp: Add test to verify that python commands can
be put in the user-defined category and that the commands appear in
"help user-defined".

12 years ago * valprint.h (struct generic_val_print_decorations): New.
Tom Tromey [Thu, 1 Mar 2012 19:27:18 +0000 (19:27 +0000)] 
* valprint.h (struct generic_val_print_decorations): New.
(generic_val_print): Declare.
* valprint.c (generic_val_print): New function.
* p-valprint.c (p_decorations): New global.
(pascal_val_print) <TYPE_CODE_REF, TYPE_CODE_ENUM,
TYPE_CODE_FLAGS, TYPE_CODE_FUNC, TYPE_CODE_RANGE, TYPE_CODE_INT,
TYPE_CODE_FLT, TYPE_CODE_VOID, TYPE_CODE_ERROR, TYPE_CODE_UNDEF,
TYPE_CODE_BOOL, TYPE_CODE_CHAR>: Call generic_val_print.
* m2-valprint.c (m2_decorations): New global.
(m2_val_print) <TYPE_CODE_REF, TYPE_CODE_ENUM, TYPE_CODE_FUNC,
TYPE_CODE_BOOL, TYPE_CODE_RANGE, TYPE_CODE_INT, TYPE_CODE_CHAR,
TYPE_CODE_FLT, TYPE_CODE_METHOD, TYPE_CODE_VOID, TYPE_CODE_UNDEF,
TYPE_CODE_ERROR>: Call generic_val_print.
* f-valprint.c (f_decorations): New global.
(f_val_print): Use print_function_pointer_address.
<TYPE_CODE_REF, TYPE_CODE_FUNC, TYPE_CODE_CHAR, TYPE_CODE_FLAGS,
TYPE_CODE_FLT, TYPE_CODE_VOID, TYPE_CODE_ENUM, TYPE_CODE_RANGE,
TYPE_CODE_BOOL, TYPE_CODE_COMPLEX, TYPE_CODE_UNDEF>: Call
generic_val_print.
* c-valprint.c (c_decorations): New global.
(c_val_print) <TYPE_CODE_MEMBERPTR, TYPE_CODE_REF, TYPE_CODE_ENUM,
TYPE_CODE_FLAGS, TYPE_CODE_FUNC, TYPE_CODE_METHOD, TYPE_CODE_BOOL,
TYPE_CODE_RANGE, TYPE_CODE_CHAR, TYPE_CODE_FLT,
TYPE_CODE_DECFLOAT, TYPE_CODE_VOID, TYPE_CODE_ERROR,
TYPE_CODE_UNDEF, TYPE_CODE_COMPLEX>: Call generic_val_print.
* ada-valprint.c (ada_val_print_1) <TYPE_CODE_FLAGS>: Remove
case.

12 years ago * valprint.c (val_print): Update.
Tom Tromey [Thu, 1 Mar 2012 19:26:13 +0000 (19:26 +0000)] 
* valprint.c (val_print): Update.
* p-valprint (pascal_val_print): Return void.
* p-lang.h (pascal_val_print): Return void.
* m2-valprint.c (m2_val_print): Return void.
* m2-lang.h (m2_val_print): Return void.
* language.h (struct language_defn) <la_val_print>: Return void.
* language.c (unk_lang_val_print): Return void.
* jv-valprint.c (java_val_print): Return void.
* jv-lang.h (java_val_print): Return void.
* f-valprint.c (f_val_print): Return void.
* f-lang.h (f_val_print): Return void.
* d-valprint.c (d_val_print): Return void.
(dynamic_array_type): Update.
* d-lang.h (d_val_print): Return void.
* c-valprint.c (c_val_print): Return void.
* c-lang.h (c_val_print): Return void.
* ada-valprint.c (ada_vada_val_print, ada_val_print_1): Return
void.
* ada-lang.h (ada_val_print): Return void.

12 years ago * value.h (val_print): Return void.
Tom Tromey [Thu, 1 Mar 2012 19:24:57 +0000 (19:24 +0000)] 
* value.h (val_print): Return void.
* valprint.c (val_print): Return void.

12 years ago * value.h (common_val_print): Return void.
Tom Tromey [Thu, 1 Mar 2012 19:23:36 +0000 (19:23 +0000)] 
* value.h (common_val_print): Return void.
* valprint.c (common_val_print): Return void.

12 years ago * value.h (value_print): Return void.
Tom Tromey [Thu, 1 Mar 2012 19:22:22 +0000 (19:22 +0000)] 
* value.h (value_print): Return void.
* valprint.c (value_print): Return void.
* p-valprint.c (pascal_value_print): Return void.
* p-lang.h (pascal_value_print): Return void.
* language.h (struct language_defn) <la_value_print>: Return
void.
* language.c (unk_lang_value_print): Return void.
* jv-valprint.c (java_value_print): Return void.
* jv-lang.h (java_value_print): Return void.
* f-valprint.c (c_value_print): Don't declare.
Include c-lang.h.
* c-valprint.c (c_value_print): Return void.
* c-lang.h (c_value_print): Return void.
* ada-valprint.c (ada_value_print): Return void.
* ada-lang.h (ada_value_print): Return void.

12 years ago * value.c (value_primitive_field): Handle virtual base classes.
Tom Tromey [Thu, 1 Mar 2012 18:28:16 +0000 (18:28 +0000)] 
* value.c (value_primitive_field): Handle virtual base classes.

12 years ago * gdbtypes.h (struct vbase): Remove.
Tom Tromey [Thu, 1 Mar 2012 18:26:13 +0000 (18:26 +0000)] 
* gdbtypes.h (struct vbase): Remove.

12 years ago * c-valprint.c (print_function_pointer_address): Move...
Tom Tromey [Thu, 1 Mar 2012 18:25:19 +0000 (18:25 +0000)] 
* c-valprint.c (print_function_pointer_address): Move...
* valprint.c: ... here.  Make non-static.
* m2-valprint.c (print_function_pointer_address): Remove.
* valprint.h (print_function_pointer_address): Declare.

12 years ago[NEWS] Document condition at end of catch exception/assert commands
Joel Brobecker [Thu, 1 Mar 2012 18:12:43 +0000 (18:12 +0000)] 
[NEWS] Document condition at end of catch exception/assert commands

gdb/ChangeLog:

        * NEWS: Document the fact that one can provide a condition when
        creating an Ada exception catchpoint.

12 years ago * valprint.c (val_print_type_code_flags): Fix placement of
Tom Tromey [Thu, 1 Mar 2012 15:50:16 +0000 (15:50 +0000)] 
* valprint.c (val_print_type_code_flags): Fix placement of
trailing brace.

12 years ago PR ld/13789
Hans-Peter Nilsson [Thu, 1 Mar 2012 08:24:10 +0000 (08:24 +0000)] 
PR ld/13789
* ld-elf/zerosize1.d: Allow xyzzy to be either OBJECT or NOTYPE.

12 years ago * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
Cary Coutant [Thu, 1 Mar 2012 07:27:38 +0000 (07:27 +0000)] 
* object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.

12 years agoDo not set MULTILINE_COMMENT_PREFIXES before calling update-copyright
Joel Brobecker [Thu, 1 Mar 2012 02:41:14 +0000 (02:41 +0000)] 
Do not set MULTILINE_COMMENT_PREFIXES before calling update-copyright

This was a local hack to work around a limitation in update-copyright.
But the limitation is now OBE, because the copyright statements should
now always fit on a single line, thanks to the new policy of using
one single year range in the copyright notice.

gdb/ChangeLog:

        * copyright.py (MULTILINE_COMMENT_PREFIXES): Delete.
        (update_files): Do not set MULTILINE_COMMENT_PREFIXES
        environment variable before calling update-copyright.

12 years agoImport gnulib's latest update-copyright script...
Joel Brobecker [Thu, 1 Mar 2012 02:41:04 +0000 (02:41 +0000)] 
Import gnulib's latest update-copyright script...

... and update our copyright.py script to set environment variable
UPDATE_COPYRIGHT_USE_INTERVALS to '2' instead of '1'.  This tells
the script to collapse all years into one single interval.

gdb/ChangeLog:

        * gnulib/extra/update-copyright: Update to the latest from
        gnulib's git repository.
        * copyright.py: Set UPDATE_COPYRIGHT_USE_INTERVALS environment
        variable to 2 instead of 1.

12 years agoremove dead code in varobj.c:c_value_of_variable
Joel Brobecker [Thu, 1 Mar 2012 01:59:22 +0000 (01:59 +0000)] 
remove dead code in varobj.c:c_value_of_variable

gdb/ChangeLog:

        * varobj.c (c_value_of_variable): Remove dead code.

12 years ago * elfxx-tilegx.c (tilegx_elf_relocate_section): Silence bogus warning.
Alan Modra [Thu, 1 Mar 2012 01:55:11 +0000 (01:55 +0000)] 
* elfxx-tilegx.c (tilegx_elf_relocate_section): Silence bogus warning.

12 years ago*** empty log message ***
gdbadmin [Thu, 1 Mar 2012 00:00:03 +0000 (00:00 +0000)] 
*** empty log message ***

12 years agodaily update
Alan Modra [Wed, 29 Feb 2012 23:00:05 +0000 (23:00 +0000)] 
daily update

12 years ago * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
Cary Coutant [Wed, 29 Feb 2012 21:22:29 +0000 (21:22 +0000)] 
* dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
Call Object::decompressed_section_contents.
* dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
New dtor.
(Sized_dwarf_line_info::buffer_start_): New data member.
* merge.cc (Output_merge_data::do_add_input_section): Call
Object::decompressed_section_contents.
(Output_merge_string::do_add_input_section): Likewise.
* object.cc (need_decompressed_section): New function.
(build_compressed_section_map): Decompress sections needed later.
(Sized_relobj_file::do_decompressed_section_contents): New function.
(Sized_relobj_file::do_discard_decompressed_sections): New function.
* object.h (Object::decompressed_section_contents): New function.
(Object::discard_decompressed_sections): New function.
(Object::do_decompressed_section_contents): New function.
(Object::do_discard_decompressed_sections): New function.
(Compressed_section_info): New type.
(Compressed_section_map): Include decompressed section contents.
(Sized_relobj_file::do_decompressed_section_contents): New function.
(Sized_relobj_file::do_discard_decompressed_sections): New function.

12 years ago[Ada] processId: Do not modify already encoded IDs
Joel Brobecker [Wed, 29 Feb 2012 19:53:16 +0000 (19:53 +0000)] 
[Ada] processId: Do not modify already encoded IDs

The processID function is supposed to take a symbol name, and process it
in a way that allows us to look that symbol up.  This patch is adding
a guard to make sure that we do not apply any transformation if we detect
that we are given an already-encoded symbol name.  For instance:

    gv___XR_pck__global_variable___XE

This happens in the case where we are trying to print the value of
a renaming. To do this, we simply parse and evaluate the XR symbol
name as an expression. Without this change, the expression parser
transforms gv___XR_pck__global_variable___XE into somethink like
gv___xr_pck__global_variable___xe, which then screws up the rest
of the renaming evaluation.

gdb/ChangeLog:

        * ada-lex.p (processId): Do not modify already encoded IDs.
        Update function documentation.

12 years agoada-lang.c:ada_find_renaming_symbol minor improvement.
Joel Brobecker [Wed, 29 Feb 2012 19:51:49 +0000 (19:51 +0000)] 
ada-lang.c:ada_find_renaming_symbol minor improvement.

This is a minor improvement in ada_find_renaming_symbol: What we were
doing was going from a symbol, get its name, and then search for
renamings.  But if the original symbol was already itself a renaming,
then we'd look the symbol up again to return it.  Since we had the
symbol in the first place, we shouldn't need to look it up again.

This is what this patch does: Modify ada_find_renaming_symbol to
take a symbol instead of the symbol's (linkage) name, and then updates
the one caller.

gdb/ChangeLog:

        * ada-lang.h (ada_find_renaming_symbol): Replace parameter
        "name" with "struct symbol *name_sym".
        * ada-exp.y (write_var_or_type): Update call to
        ada_find_renaming_symbol.
        * ada-lang.c (ada_find_renaming_symbol): Replace parameter
        "name" with "struct symbol *name_sym". Adjust Implementation
        accordingly.  Adjust the function documentation.

12 years agoMinor cleanup to a couple of functions in ada-lang.c.
Joel Brobecker [Wed, 29 Feb 2012 19:50:22 +0000 (19:50 +0000)] 
Minor cleanup to a couple of functions in ada-lang.c.

gdb/ChangeLog:

        * ada-lang.h (ada_find_any_symbol, ada_find_any_type): Delete.
        * ada-lang.c (ada_find_any_type): Add advance declaration.
        Make static.  Replace ada_find_any_symbol by
        ada_find_any_type_symbol.
        (ada_find_any_type_symbol): Renames ada_find_any_symbol.
        Improve function description.  Make static.
        (ada_find_renaming_symbol, find_old_style_renaming_symbol):
        Replace ada_find_any_symbol by ada_find_any_type_symbol.

12 years ago[Ada] avoid error message pollution with uninitialized tagged variable
Joel Brobecker [Wed, 29 Feb 2012 19:46:48 +0000 (19:46 +0000)] 
[Ada] avoid error message pollution with uninitialized tagged variable

Consider the following function...

  3 procedure Foo is
  4    I : Integer := Ident (10);
  5    Obj : Base;
  6 begin
  7    Obj.X := I;
  8    Do_Nothing (Obj.X'Address);
  9 end Foo;

... where type "Base" is defined as a plain tagged record. If the user
stops execution before "Obj" gets initialized (for example, by inserting
a breakpoint "on" the function - or in other words, by inserting a
breakpoint using the function name as the location), one might get
the following of output if you try printing the value of obj:

    (gdb) p obj
    object size is larger than varsize-limit
    object size is larger than varsize-limit
    object size is larger than varsize-limit
    $1 = object size is larger than varsize-limit
    (x => 4204154)

Same thing with "info locals":

   (gdb) info locals
    i = 0
    obj = object size is larger than varsize-limit
    (x => 4204154)

We have also seen different error messages such as "Cannot read
memory at 0x...".

The error happens because we are trying to read the dispatch table
of a tagged type variable before it gets initialized.  So the errors
might legitimately occur, and are supposed to be be contained.
However, the way things are written in ada-lang.c:ada_tag_name,
although the exception is in fact contained, the error message still
gets to be printed out.

This patch prevents this from happening by eliminating the use of
catch_errors, and using a TRY_CATCH block instead.  Doing this removed
the need to use functions specifically fitted for catch_errors, and
thus some other simplifications could me made.  In the end, the code
got reorganized a bit to better show the logic behind it, as well as
the common patterns.

gdb/ChangeLog:

        * ada-lang.c (struct tag_args): Delete.
        (ada_get_tsd_type): Function body moved up in source file.
        (ada_tag_name_1, ada_tag_name_2): Delete.
        (ada_get_tsd_from_tag): New function.
        (ada_tag_name_from_tsd): New function.
        (ada_tag_name): Use a TRY_CATCH block instead of catch_errors
        to determine the tag name.

gdb/testsuite/ChangeLog:

        * gdb.ada/tagged_not_init: New testcase.

12 years ago[Ada] New functions to decode Ada types and values
Joel Brobecker [Wed, 29 Feb 2012 19:44:12 +0000 (19:44 +0000)] 
[Ada] New functions to decode Ada types and values

This patch introduces two new functions that will be used to support
the implementation of the ada-varobj effort.  The function descriptions
should say it all...

gdb/ChangeLog:

        * ada-lang.h (ada_get_decoded_value, ada_get_decoded_type): Add
        declaration.
        * ada-lang.c (ada_get_decoded_value, ada_get_decoded_type): New
        function.

12 years ago[Ada] Fix comment in ada-lang.c:ada_is_ignored_field
Joel Brobecker [Wed, 29 Feb 2012 19:37:07 +0000 (19:37 +0000)] 
[Ada] Fix comment in ada-lang.c:ada_is_ignored_field

Fix a comment that completly mistunderstood the code...

gdb/ChangeLog:

        * ada-lang.c (ada_is_ignored_field): Rewrite wrong comment.

12 years ago[Ada] Do not cache lookup result if not full_search
Joel Brobecker [Wed, 29 Feb 2012 19:35:37 +0000 (19:35 +0000)] 
[Ada] Do not cache lookup result if not full_search

The ada_lookup_symbol_list function has recently been changed to accept
a "full_search" parameter. When null, this parameter instructs the
function to perform a partial search (global and static symbols are not
searched). When doing a partial search, the result should not be saved
into the lookup cache, as the result might be incomplete.

This manifested itself when trying to perform a function call on AVR
after having inserted a breakpoint inside that function:

    (gdb) b same
    Breakpoint 2 at 0x78: file r.adb, line 5.
    (gdb) call same(42)

    Breakpoint 2, r.same (i=42) at r.adb:5
    5             return I;
    The program being debugged stopped while in a function called from GDB.
    Evaluation of the expression containing the function
    (at 0x0x800068) will be abandoned.
    ^^^^^^^^^^^^^^^
    When the function is done executing, GDB will silently stop.

The expected output for the underlined portion is "(r.same)".

What happens is that the breakpoint command triggers 3 lookups of the
name "same":
  1. full search in LABEL_DOMAIN -> no match, cached;
  2. full search in VAR_DOMAIN -> 1 match, cached;
  3. partial search in VAR_DOMAIN -> no match, cached.

The third lookup therefore causes the results of the partial search
to be cached, thus overriding the result of the full search lookup.

During the following command, the reference to "same" triggers a lookup
of that symbol again. And since GDB CAN find the result of that lookup
in the cache, it returns just that, which is: No match. (wrong!)

As a result, we fallback on the symbol table to resolve the lookup.
And instead of pushing an OP_VAR_VALUE subexpression for symbol "same",
the parser ends up pushing an UNOP_MEMVAL subexpression using the value
of the minimal symbol. This is where being on AVR becomes important:
addresses on AVR are modular types, and if GDB thinks an address is
a data address, it converts it.

This is where one notices the fact that the breakpoint was inserted
at 0x78, and yet GDB says that the function we stopped at is at
0x0x800068...

This patch fixes the problem by making sure we only cache the result
of full searches.

gdb/ChangeLog:

        * ada-lang.c (ada_lookup_symbol_list): Only cache the result of
        full searches.

12 years ago[Ada] print packed arrays indexed by enumerated type
Joel Brobecker [Wed, 29 Feb 2012 19:34:40 +0000 (19:34 +0000)] 
[Ada] print packed arrays indexed by enumerated type

Consider the following declarations (a packed array indexed by an
enumerated type):

    type Color is (Black, Red, Green, Blue, White);
    type Full_Table is array (Color) of Boolean;
    pragma Pack (Full_Table);
    Full : Full_Table := (False, True, False, True, False);

GDB is unable to print the index values correctly. It prints the
enumeration's underlying value instead of the enumeration name:

    (gdb) p full
    $1 = (0 => false, true, false, true, false)
    (gdb) p full'first
    $2 = 0

And yet, it is capable of printing the correct type description:

    (gdb) ptype full
    type = array (black .. white) of boolean <packed: 1-bit elements>

To get to the real index type, one has to follow the parallel XA type.
We already do this for normal arrays. We can do it for this packed
array as well.

gdb/ChangeLog:

        * ada-lang.c (constrained_packed_array_type): If there is a
        parallel XA type, use it to determine the array index type.

gdb/testsuite/ChangeLog:

        * gdb.ada/arrayidx.exp: Adjust expected output for p_one_two_three.
        * gdb.ada/enum_idx_packed: New testcase.

12 years ago[Ada] Handle reference to array descriptors
Joel Brobecker [Wed, 29 Feb 2012 19:33:02 +0000 (19:33 +0000)] 
[Ada] Handle reference to array descriptors

This patch is to help handle aliased array variables, such as:

   type Bounded is array (Integer range <>) of Integer;
   function New_Bounded (Low, High : Integer) return Bounded;
   BT : aliased Bounded := New_Bounded (Low => 1, High => 3);

In that case, the compiler describes variable "BT" as a reference
to a thin pointer, and GDB is unable to print its value:

    (gdb) p bt
    $1 =

The problems starts when ada_value_print deconstructs the struct
value into contents and address in order to call val_print. It
turns out in this case that "bt" is not an lval. In the debug
information, this variable's location is described as:

        .uleb128 0xd    # (DIE (0xe0) DW_TAG_variable)
        .ascii "bt\0"   # DW_AT_name
        [...]
        .byte   0x6     # DW_AT_location
        .byte   0x91    # DW_OP_fbreg
        .sleb128 -56
        .byte   0x6     # DW_OP_deref
        .byte   0x23    # DW_OP_plus_uconst
        .uleb128 0x8
        .byte   0x9f    # DW_OP_stack_value

So, when ada_value_print passes the bt's (value) address, it passes
in effect a meaningless address. The problem continues shortly after
when ada_val_print_1 re-creates the value from the contents and address.
The value has become an lval_memory, with a null address.

As a result, we trigger a memory error later on, while trying to
read the array bounds in order to transform our value into a simple
array.

To avoid the problem entirely, the fix is to coerce references before
transforming array descriptors into simple arrays.

gdb/ChangeLog:

        * ada-valprint.c (ada_val_print_1): If our value is a reference
        to an array descriptor, dereference it before converting it
        to a simple array.

gdb/testsuite/ChangeLog:

        * gdb.ada/aliased_array: New testcase.

12 years agoAda: ada_to_fixed_value should also unwrap_value
Joel Brobecker [Wed, 29 Feb 2012 19:30:53 +0000 (19:30 +0000)] 
Ada: ada_to_fixed_value should also unwrap_value

We should always unwrap a value before trying to "fix" it. It is
therefore logical that ada_to_fixed_value would call unwrap_value
before creating the fixed value.

This simplifies the code in ada-lang.c a bit.

gdb/ChangeLog:

        * ada-lang.c (ada_to_fixed_value): Call unwrap_value before
        creating fixed value.
        (ada_value_ind, ada_coerce_ref, assign_component)
        (ada_evaluate_subexp): Remove call to unwrap_value before
        call to ada_to_fixed_value.

12 years ago[Ada] whatis not printing array type name for value from history
Joel Brobecker [Wed, 29 Feb 2012 19:29:12 +0000 (19:29 +0000)] 
[Ada] whatis not printing array type name for value from history

Consider the following declaration:

   type Full_Table is array (Color) of Integer;
   Full : Full_Table := (144, 233, 377, 610, 987);

The debugger correctly prints the type name of variable "full":

        (gdb) whatis full
        type = pck.full_table

But is unable to do so when using the value history:

        (gdb) print full
        $1 = (144, 233, 377, 610, 987)
        (gdb) whatis $
 !!! -> type = array (black .. white) of integer

This is because the evaluation creates a "fixed" version of
the array type, and that "fixed" version is missing a type name.
As a result, whatis falls back to describing the type (a la ptype)
instead of printing the type name.

gdb/ChangeLog:

        * ada-lang.c (to_fixed_array_type): Set result's type name.

gdb/testsuite/ChangeLog:

        * gdb.ada/whatis_array_val: New testcase.

12 years agoAdd support for condition in Ada exception catchpoint commands
Joel Brobecker [Wed, 29 Feb 2012 19:09:47 +0000 (19:09 +0000)] 
Add support for condition in Ada exception catchpoint commands

Previously, conditions could be associated to Ada exception catchpoints,
but not while creating the exception catchpoint:

    (gdb) catch exception first_exception if except_counter = 5
    Junk at end of expression

This patch improves the parsing of the command arguments to allow
an "if CONDITION" at the end.  All Ada exception catchpoint commands
have been enhanced to support this.

gdb/ChangeLog:

        * ada-lang.c (catch_ada_exception_command_split): Add new
        argument cond_string.  Add support for condition at end of
        "catch exception" commands.
        (ada_decode_exception_location): Add new argument cond_string.
        Update call to catch_ada_exception_command_split.
        (create_ada_exception_catchpoint): Add new argument cond_string.
        Set the breakpoint condition if needed.
        (catch_ada_exception_command): Update call to
        ada_decode_exception_location.
        (ada_decode_assert_location): Add function documentation.
        Add support for condition at end of "catch assert" command.
        (catch_assert_command): Update calls to ada_decode_assert_location
        and create_ada_exception_catchpoint.

12 years agogdb/
Jan Kratochvil [Wed, 29 Feb 2012 14:59:41 +0000 (14:59 +0000)] 
gdb/
Fix disp-step-syscall.exp: fork: single step over fork.
* i386-linux-tdep.c (-i386_linux_get_syscall_number): Rename to ...
(i386_linux_get_syscall_number_from_regcache): ... here, new function
comment, change parameters gdbarch and ptid to regcache.  Remove
parameter regcache, initialize gdbarch from regcache here.
(i386_linux_get_syscall_number, i386_linux_displaced_step_copy_insn):
New functions.
(i386_linux_init_abi): Install i386_linux_displaced_step_copy_insn
instead.
* i386-tdep.c (i386_syscall_p): Check also for 'sysenter' and
'syscall'.  Make the 'int' check more strict.

gdb/testsuite/
Fix disp-step-syscall.exp: fork: single step over fork.
* gdb.base/disp-step-syscall.exp (syscall_insn): Anchor it by
whitespaces.
(single step over $syscall): Remove its check.
(single step over $syscall final pc): New check.

12 years agogdb/
Jan Kratochvil [Wed, 29 Feb 2012 14:56:55 +0000 (14:56 +0000)] 
gdb/
Fix reverse mode for syscall on AMD CPUs in 32-bit mode.
* i386-linux-tdep.c (i386_linux_intx80_sysenter_record): Rename to ...
(i386_linux_intx80_sysenter_syscall_record): ... here.
(i386_linux_init_abi): Initialize also I386_SYSCALL_RECORD.
Use the renamed function name.

12 years agogdb/testsuite/
Jan Kratochvil [Wed, 29 Feb 2012 14:55:46 +0000 (14:55 +0000)] 
gdb/testsuite/
Support processors without SSSE3.
* gdb.reverse/i386-sse-reverse.c (sse_test): Move pabsb, pabsw and
pabsd into ...
(ssse3_test): ... a new function.
(main): Call ssse3_test.
* gdb.reverse/i386-sse-reverse.exp: New variable end_ssse3_test.
Update expected values everywhere.
(reverse-step to pabsd, verify xmm0 after reverse pabsd)
(verify xmm1 after reverse pabsd, verify xmm2 after reverse pabsd)
(reverse-step to pabsw, verify xmm0 after reverse pabsw)
(verify xmm1 after reverse pabsw, verify xmm2 after reverse pabsw)
(reverse-step to pabsb, verify xmm0 after reverse pabsb)
(verify xmm1 after reverse pabsb, verify xmm2 after reverse pabsb):
Move these tests lower.
(set breakpoint at end of ssse3_test, continue to end of ssse3_test)
(verify xmm0 at end of ssse3_test, verify xmm1 at end of ssse3_test)
(verify xmm2 at end of ssse3_test, continue to end of ssse3_test #2):
New tests.

12 years agogdb/
Jan Kratochvil [Wed, 29 Feb 2012 14:52:44 +0000 (14:52 +0000)] 
gdb/
* arm-linux-tdep.c (arm_linux_copy_svc): Reset stale FRAME.
* breakpoint.c (until_break_command): Likewise.
* elfread.c (elf_gnu_ifunc_resolver_stop): Likewise.
* infcall.c (call_function_by_hand): Likewise.
* infcmd.c (finish_forward): Likewise.
* infrun.c (insert_exception_resume_breakpoint): Likewise.

12 years agogdb/gdbserver:
Yao Qi [Wed, 29 Feb 2012 13:59:41 +0000 (13:59 +0000)] 
gdb/gdbserver:

2012-02-29  Yao Qi  <yao@codesourcery.com>
    Pedro Alves  <palves@redhat.com>

* linux-low.c (linux_wait_1): Call unsuspend_all_lwps when
`step_over_finished' is true.

gdb/testsuite:

2012-02-29  Yao Qi  <yao@codesourcery.com>
    Pedro Alves  <palves@redhat.com>

* gdb.trace/trace-mt.c: New
* gdb.trace/trace-mt.exp: New.

12 years ago * doc/binutils.texi (c++filt): Fix typos.
Nick Clifton [Wed, 29 Feb 2012 10:44:10 +0000 (10:44 +0000)] 
* doc/binutils.texi (c++filt): Fix typos.

12 years ago*** empty log message ***
gdbadmin [Wed, 29 Feb 2012 00:00:33 +0000 (00:00 +0000)] 
*** empty log message ***

12 years agodaily update
Alan Modra [Tue, 28 Feb 2012 23:00:05 +0000 (23:00 +0000)] 
daily update

12 years agogdb/testsuite/
Thomas Schwinge [Tue, 28 Feb 2012 22:40:48 +0000 (22:40 +0000)] 
gdb/testsuite/
* gdb.base/annota1.exp: Use gdb_get_line_number for retrieving line
numbers instead of hardcoding them.
* gdb.base/annota1.c: Provide suitable markers.
* gdb.base/annota3.exp: Use gdb_get_line_number for retrieving line
numbers instead of hardcoding them.
* gdb.base/annota3.c: Provide suitable markers.

12 years agoFix ARI violation in ada_tasks_inferior_data_sniffer.
Joel Brobecker [Tue, 28 Feb 2012 16:30:42 +0000 (16:30 +0000)] 
Fix ARI violation in ada_tasks_inferior_data_sniffer.

This patch removes some variable assignments inside condition
expressions.

gdb/ChangeLog:

        * ada-tasks.c (ada_tasks_inferior_data_sniffer): Rework code to
        avoid variable assignments inside condition.

12 years agogdb/testsuite/
Thomas Schwinge [Tue, 28 Feb 2012 10:24:15 +0000 (10:24 +0000)] 
gdb/testsuite/
        * gdb.base/annota1.c [__sh__]: Remove any special-casing.
        * gdb.base/annota3.c: Likewise.
        * gdb.base/sigall.c: Likewise.
        * gdb.base/signals.c: Likewise.
        * gdb.reverse/sigall-reverse.c: Likewise.

12 years agogdb/
Jan Kratochvil [Tue, 28 Feb 2012 08:14:11 +0000 (08:14 +0000)] 
gdb/
Fix static analysis issue found by cppcheck.
* microblaze-tdep.c (microblaze_extract_return_value): Fix
uninitialized BUF for size 2.

12 years ago*** empty log message ***
gdbadmin [Tue, 28 Feb 2012 00:00:32 +0000 (00:00 +0000)] 
*** empty log message ***

12 years ago * mips-tdep.c (mips32_instruction_has_delay_slot): New function.
Maciej W. Rozycki [Mon, 27 Feb 2012 23:05:40 +0000 (23:05 +0000)] 
* mips-tdep.c (mips32_instruction_has_delay_slot): New function.
(mips16_instruction_has_delay_slot): Likewise.
(mips_segment_boundary): Likewise.
(mips_adjust_breakpoint_address): Likewise.
(mips_gdbarch_init): Use mips_adjust_breakpoint_address.

12 years agodaily update
Alan Modra [Mon, 27 Feb 2012 23:00:04 +0000 (23:00 +0000)] 
daily update

12 years ago * infrun.c (handle_inferior_event): Don't proceed through
Maciej W. Rozycki [Mon, 27 Feb 2012 21:36:47 +0000 (21:36 +0000)] 
* infrun.c (handle_inferior_event): Don't proceed through
shared library trampolines if stepping at the machine
instruction level.

12 years ago * mips-linux-tdep.c (mips_linux_init_abi): Set num_pseudo_regs
Maciej W. Rozycki [Mon, 27 Feb 2012 21:27:46 +0000 (21:27 +0000)] 
* mips-linux-tdep.c (mips_linux_init_abi): Set num_pseudo_regs
too.

12 years ago * gdb.cp/breakpoint.exp (test_breakpoint): Fix the runto_main
Maciej W. Rozycki [Mon, 27 Feb 2012 20:48:25 +0000 (20:48 +0000)] 
* gdb.cp/breakpoint.exp (test_breakpoint): Fix the runto_main
failure return path.

12 years ago * sh-tdep.c (sh_make_stub_cache, sh_stub_this_id)
Thomas Schwinge [Mon, 27 Feb 2012 16:40:48 +0000 (16:40 +0000)] 
* sh-tdep.c (sh_make_stub_cache, sh_stub_this_id)
(sh_stub_unwind_sniffer): New functions.
(sh_stub_unwind): New variable.
(sh_gdbarch_init): Wire everything.

12 years ago2012-02-27 Pedro Alves <palves@redhat.com>
Pedro Alves [Mon, 27 Feb 2012 16:22:16 +0000 (16:22 +0000)] 
2012-02-27  Pedro Alves  <palves@redhat.com>

gdb/gdbserver/
* linux-low.c (pid_is_stopped): Delete, moved to common/.
(linux_attach_lwp_1): Adjust to use linux_proc_pid_is_stopped.

gdb/
* linux-nat.c (pid_is_stopped): Delete, moved to common/.
(linux_nat_post_attach_wait): Adjust to use
linux_proc_pid_is_stopped.

* common/linux-procfs.h (linux_proc_pid_is_stopped): Declare.
* common/linux-procfs.c (linux_proc_pid_is_stopped): New function,
based on pid_is_stopped from both linux-nat.c and
gdbserver/linux-low.c, and renamed.

12 years ago2012-02-27 Pedro Alves <palves@redhat.com>
Pedro Alves [Mon, 27 Feb 2012 16:19:19 +0000 (16:19 +0000)] 
2012-02-27  Pedro Alves  <palves@redhat.com>

PR server/9684
* linux-low.c (pid_is_stopped): New.
(linux_attach_lwp_1): Handle attaching to 'T (stopped)' processes.

12 years ago2012-02-27 Luis Machado <lgustavo@codesourcery.com>
Luis Machado [Mon, 27 Feb 2012 13:22:59 +0000 (13:22 +0000)] 
2012-02-27  Luis Machado  <lgustavo@codesourcery.com>

* gdb.base/save-bp.exp: Account for new condition evaluator output.

12 years ago * config/tc-crx.c (check_range): Correct uint32_t misconceptions.
Alan Modra [Mon, 27 Feb 2012 12:36:21 +0000 (12:36 +0000)] 
* config/tc-crx.c (check_range): Correct uint32_t misconceptions.

12 years ago * chew.c (print_stack_level, main): Use %ld to print stack delta.
Alan Modra [Mon, 27 Feb 2012 07:03:00 +0000 (07:03 +0000)] 
* chew.c (print_stack_level, main): Use %ld to print stack delta.