aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2012-03-01 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.Cary Coutant2-0/+8
2012-03-01Do not set MULTILINE_COMMENT_PREFIXES before calling update-copyrightJoel Brobecker2-12/+6
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.
2012-03-01Import gnulib's latest update-copyright script...Joel Brobecker3-5/+22
... 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.
2012-03-01remove dead code in varobj.c:c_value_of_variableJoel Brobecker2-5/+4
gdb/ChangeLog: * varobj.c (c_value_of_variable): Remove dead code.
2012-03-01 * elfxx-tilegx.c (tilegx_elf_relocate_section): Silence bogus warning.Alan Modra2-1/+5
2012-03-01*** empty log message ***gdbadmin1-1/+1
2012-02-29daily updateAlan Modra1-1/+1
2012-02-29 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):Cary Coutant7-66/+246
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.
2012-02-29[Ada] processId: Do not modify already encoded IDsJoel Brobecker2-2/+18
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.
2012-02-29ada-lang.c:ada_find_renaming_symbol minor improvement.Joel Brobecker4-8/+21
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.
2012-02-29Minor cleanup to a couple of functions in ada-lang.c.Joel Brobecker3-11/+20
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.
2012-02-29[Ada] avoid error message pollution with uninitialized tagged variableJoel Brobecker7-67/+203
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.
2012-02-29[Ada] New functions to decode Ada types and valuesJoel Brobecker3-0/+51
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.
2012-02-29[Ada] Fix comment in ada-lang.c:ada_is_ignored_fieldJoel Brobecker2-3/+12
Fix a comment that completly mistunderstood the code... gdb/ChangeLog: * ada-lang.c (ada_is_ignored_field): Rewrite wrong comment.
2012-02-29[Ada] Do not cache lookup result if not full_searchJoel Brobecker2-2/+7
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.
2012-02-29[Ada] print packed arrays indexed by enumerated typeJoel Brobecker8-5/+129
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.
2012-02-29[Ada] Handle reference to array descriptorsJoel Brobecker7-0/+123
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.
2012-02-29Ada: ada_to_fixed_value should also unwrap_valueJoel Brobecker2-7/+15
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.
2012-02-29[Ada] whatis not printing array type name for value from historyJoel Brobecker7-0/+124
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.
2012-02-29Add support for condition in Ada exception catchpoint commandsJoel Brobecker2-13/+93
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.
2012-02-29gdb/Jan Kratochvil5-7/+104
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.
2012-02-29gdb/Jan Kratochvil2-3/+12
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.
2012-02-29gdb/testsuite/Jan Kratochvil3-73/+146
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.
2012-02-29gdb/Jan Kratochvil7-0/+29
* 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.
2012-02-29gdb/gdbserver:Yao Qi5-0/+220
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.
2012-02-29 * doc/binutils.texi (c++filt): Fix typos.Nick Clifton2-4/+8
2012-02-29*** empty log message ***gdbadmin1-1/+1
2012-02-28daily updateAlan Modra1-1/+1
2012-02-28gdb/testsuite/Thomas Schwinge5-58/+68
* 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.
2012-02-28Fix ARI violation in ada_tasks_inferior_data_sniffer.Joel Brobecker2-7/+15
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.
2012-02-28gdb/testsuite/Thomas Schwinge6-18/+8
* 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.
2012-02-28gdb/Jan Kratochvil2-0/+7
Fix static analysis issue found by cppcheck. * microblaze-tdep.c (microblaze_extract_return_value): Fix uninitialized BUF for size 2.
2012-02-28*** empty log message ***gdbadmin1-1/+1
2012-02-27 * mips-tdep.c (mips32_instruction_has_delay_slot): New function.Maciej W. Rozycki2-0/+242
(mips16_instruction_has_delay_slot): Likewise. (mips_segment_boundary): Likewise. (mips_adjust_breakpoint_address): Likewise. (mips_gdbarch_init): Use mips_adjust_breakpoint_address.
2012-02-27daily updateAlan Modra1-1/+1
2012-02-27 * infrun.c (handle_inferior_event): Don't proceed throughMaciej W. Rozycki2-1/+9
shared library trampolines if stepping at the machine instruction level.
2012-02-27 * mips-linux-tdep.c (mips_linux_init_abi): Set num_pseudo_regsMaciej W. Rozycki2-0/+6
too.
2012-02-27 * gdb.cp/breakpoint.exp (test_breakpoint): Fix the runto_mainMaciej W. Rozycki2-1/+6
failure return path.
2012-02-27 * sh-tdep.c (sh_make_stub_cache, sh_stub_this_id)Thomas Schwinge2-0/+60
(sh_stub_unwind_sniffer): New functions. (sh_stub_unwind): New variable. (sh_gdbarch_init): Wire everything.
2012-02-272012-02-27 Pedro Alves <palves@redhat.com>Pedro Alves6-64/+53
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.
2012-02-272012-02-27 Pedro Alves <palves@redhat.com>Pedro Alves2-0/+64
PR server/9684 * linux-low.c (pid_is_stopped): New. (linux_attach_lwp_1): Handle attaching to 'T (stopped)' processes.
2012-02-272012-02-27 Luis Machado <lgustavo@codesourcery.com>Luis Machado2-1/+5
* gdb.base/save-bp.exp: Account for new condition evaluator output.
2012-02-27 * config/tc-crx.c (check_range): Correct uint32_t misconceptions.Alan Modra2-5/+6
2012-02-27 * chew.c (print_stack_level, main): Use %ld to print stack delta.Alan Modra2-4/+8
2012-02-27cpu/Alan Modra4-3/+11
* mt.opc (print_dollarhex): Trim values to 32 bits. opcodes/ * mt-dis.c: Regenerate.
2012-02-27 * v850-opc.c (extract_v8): Rearrange to make it obvious thisAlan Modra2-32/+36
is the inverse of corresponding insert function. (extract_d22, extract_u9, extract_r4): Likewise. (extract_d9): Correct sign extension. (extract_d16_15): Don't assume "long" is 32 bits, and don't rely on implementation defined behaviour for shift right of signed types. (extract_d16_16, extract_d17_16, extract_i9): Likewise. (extract_d23): Likewise, and correct mask.
2012-02-27 * config/tc-tic4x.c (tic4x_do_align): Remove ATTRIBUTE_UNUSED onAlan Modra2-13/+23
params. Properly generate NOP pattern. Comment reason for subseg_text_p failure.
2012-02-27 * elf32-sh.c (sh_elf_osec_to_segment): Check for elf flavour bfdAlan Modra2-4/+14
before calling elf specific function. (sh_elf_osec_readonly_p): Test for error return from above.
2012-02-27 * config/tc-h8300.c (constant_fits_width_p): Trim constant to 32 bitsAlan Modra2-12/+26
and sign extend before range tests. (constant_fits_size_p): Similarly. (get_specific): Trim X_add_number to 32 bits. (fix_operand_size): Likewise, and use unsigned test for signed ranges.
2012-02-27gas/Alan Modra7-34/+54
* config/tc-crx.c: Include bfd_stdint.h. (getconstant): Remove irrelevant comment. Don't fail due to sign-extension of int mask. (check_range): Rewrite using unsigned arithmetic throughout. opcodes/ * crx-dis.c (print_arg): Mask constant to 32 bits. * crx-opc.c (cst4_map): Use int array. include/opcode/ * crx.h (cst4_map): Update declaration.